izapple2/base64a.go

50 lines
1.0 KiB
Go
Raw Normal View History

package apple2
2019-10-12 19:37:37 +00:00
import (
"github.com/ivanizag/apple2/core6502"
)
/*
Copam BASE64A adaptation.
*/
2019-10-12 19:37:37 +00:00
// newBase64a instantiates an apple2
func newBase64a() *Apple2 {
var a Apple2
a.Name = "Base 64A"
2019-10-12 19:37:37 +00:00
a.mmu = newMemoryManager(&a)
a.cpu = core6502.NewNMOS6502(a.mmu)
2019-10-12 19:37:37 +00:00
// Set the io in 0xc000
a.io = newIoC0Page(&a)
a.mmu.setPages(0xc0, 0xc0, a.io)
addApple2SoftSwitches(a.io)
addBase64aSoftSwitches(a.io)
2019-10-12 19:37:37 +00:00
return &a
}
2019-10-12 19:37:37 +00:00
func addBase64aSoftSwitches(io *ioC0Page) {
2019-10-20 22:00:42 +00:00
// 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
2019-10-12 19:37:37 +00:00
io.addSoftSwitchW(0x30, func(io *ioC0Page, value uint8) {
2019-08-05 22:37:27 +00:00
speakerSoftSwitch(io)
2019-10-20 22:00:42 +00:00
}, "SPEAKER")
}
2019-10-12 19:37:37 +00:00
func charGenColumnsMapBase64a(column int) int {
bit := column + 2
// Weird positions
if column == 6 {
bit = 2
} else if column == 0 {
bit = 1
}
return bit
}