izapple2/base64a.go

47 lines
986 B
Go

package apple2
import (
"github.com/ivanizag/apple2/core6502"
)
/*
Copam BASE64A adaptation.
*/
// newBase64a instantiates an apple2
func newBase64a() *Apple2 {
var a Apple2
a.Name = "Base 64A"
a.mmu = newMemoryManager(&a)
a.cpu = core6502.NewNMOS6502(a.mmu)
a.io = newIoC0Page(&a)
addApple2SoftSwitches(a.io)
addBase64aSoftSwitches(a.io)
return &a
}
func addBase64aSoftSwitches(io *ioC0Page) {
// Other softswitches, not implemented but called from the ROM
io.addSoftSwitchW(0x0C, notImplementedSoftSwitchW, "80COLOFF")
io.addSoftSwitchW(0x0E, notImplementedSoftSwitchW, "ALTCHARSETOFF")
// Write on the speaker. That is a double access and should do nothing
// but works somehow on the BASE64A
io.addSoftSwitchW(0x30, func(io *ioC0Page, value uint8) {
speakerSoftSwitch(io)
}, "SPEAKER")
}
func charGenColumnsMapBase64a(column int) int {
bit := column + 2
// Weird positions
if column == 6 {
bit = 2
} else if column == 0 {
bit = 1
}
return bit
}