Skip to content

Commit

Permalink
Help is uppercase when lowercase is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanizag committed Jul 21, 2024
1 parent 21f1517 commit 10f6c05
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions apple2.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Apple2 struct {
softVideoSwitch *SoftVideoSwitch
board string
isApple2e bool
hasLowerCase bool
isFourColors bool // An Apple II without the 6 color mod
commandChannel chan command

Expand Down
3 changes: 3 additions & 0 deletions screen/snapshotsDebug.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ func SnapshotCharacterGenerator(vs VideoSource, isAltText bool) *image.RGBA {

// SnapshotMessageGenerator shows a message on the screen
func SnapshotMessageGenerator(vs VideoSource, message string) *image.RGBA {
if !vs.SupportsLowercase() {
message = strings.ToUpper(message)
}
lines := strings.Split(message, "\n")
text := make([]uint8, textLines*text40Columns)
for i := range text {
Expand Down
5 changes: 5 additions & 0 deletions screen/testScenarios.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ func (ts *TestScenario) GetCardImage(light color.Color) *image.RGBA {
return nil
}

// SupportsLowercase returns true if the video source supports lowercase
func (ts *TestScenario) SupportsLowercase() bool {
return true
}

func buildImageName(name string, screenMode int, altSet bool) string {
var screenName string
switch screenMode {
Expand Down
2 changes: 2 additions & 0 deletions screen/videoSource.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ type VideoSource interface {
GetSuperVideoMemory() []uint8
// GetCardImage returns an image provided by a card, like the videx card
GetCardImage(light color.Color) *image.RGBA
// SupportsLowercase returns true if the video source supports lowercase
SupportsLowercase() bool
}
2 changes: 2 additions & 0 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ func configure(configuration *configuration) (*Apple2, error) {

addApple2SoftSwitches(a.io)
if a.isApple2e {
a.hasLowerCase = true
a.mmu.initExtendedRAM(1)
addApple2ESoftSwitches(a.io)
}
if board == "base64a" {
a.hasLowerCase = true
addBase64aSoftSwitches(a.io)
}

Expand Down
5 changes: 5 additions & 0 deletions videoSourceImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ func (a *Apple2) GetCardImage(light color.Color) *image.RGBA {
return a.softVideoSwitch.BuildAlternateImage(light)
}

// SupportsLowercase returns true if the video source supports lowercase
func (a *Apple2) SupportsLowercase() bool {
return a.hasLowerCase
}

// DumpTextModeAnsi returns the text mode contents using ANSI escape codes for reverse and flash
func DumpTextModeAnsi(a *Apple2) string {
is80Columns := a.io.isSoftSwitchActive(ioFlag80Col)
Expand Down

0 comments on commit 10f6c05

Please sign in to comment.