2020-10-03 23:38:26 +02:00
|
|
|
package izapple2
|
2019-06-09 17:36:29 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Copam BASE64A adaptation.
|
|
|
|
*/
|
|
|
|
|
2019-11-04 00:23:03 +01:00
|
|
|
func loadBase64aRom(a *Apple2) error {
|
2024-07-28 22:37:48 +02:00
|
|
|
return loadMultiPageRom(a, []string{
|
|
|
|
"<internal>/BASE64A_D0.BIN",
|
|
|
|
"<internal>/BASE64A_D8.BIN",
|
|
|
|
"<internal>/BASE64A_E0.BIN",
|
|
|
|
"<internal>/BASE64A_E8.BIN",
|
|
|
|
"<internal>/BASE64A_F0.BIN",
|
|
|
|
"<internal>/BASE64A_F8.BIN",
|
|
|
|
})
|
2019-11-04 00:23:03 +01:00
|
|
|
}
|
|
|
|
|
2019-10-12 21:37:37 +02:00
|
|
|
func addBase64aSoftSwitches(io *ioC0Page) {
|
2019-10-21 00:00:42 +02:00
|
|
|
// Other softswitches, not implemented but called from the ROM
|
2022-08-05 19:43:17 +02:00
|
|
|
io.addSoftSwitchW(0x0C, buildNotImplementedSoftSwitchW(io), "80COLOFF")
|
|
|
|
io.addSoftSwitchW(0x0E, buildNotImplementedSoftSwitchW(io), "ALTCHARSETOFF")
|
2019-11-04 00:23:03 +01:00
|
|
|
|
|
|
|
// ROM pagination softswitches. They use the annunciator 0 and 1
|
|
|
|
mmu := io.apple2.mmu
|
2022-08-05 19:43:17 +02:00
|
|
|
io.addSoftSwitchRW(0x58, func() uint8 {
|
2024-01-22 23:09:35 +01:00
|
|
|
if rom, ok := mmu.physicalROM.(*memoryRangeROM); ok {
|
|
|
|
p := rom.getPage()
|
|
|
|
rom.setPage(p & 2)
|
|
|
|
}
|
2019-11-04 00:23:03 +01:00
|
|
|
return 0
|
|
|
|
}, "ANN0OFF-ROM")
|
2022-08-05 19:43:17 +02:00
|
|
|
io.addSoftSwitchRW(0x59, func() uint8 {
|
2024-01-22 23:09:35 +01:00
|
|
|
if rom, ok := mmu.physicalROM.(*memoryRangeROM); ok {
|
|
|
|
p := rom.getPage()
|
|
|
|
rom.setPage(p | 1)
|
|
|
|
}
|
2019-11-04 00:23:03 +01:00
|
|
|
return 0
|
|
|
|
}, "ANN0ON-ROM")
|
2022-08-05 19:43:17 +02:00
|
|
|
io.addSoftSwitchRW(0x5A, func() uint8 {
|
2024-01-22 23:09:35 +01:00
|
|
|
if rom, ok := mmu.physicalROM.(*memoryRangeROM); ok {
|
|
|
|
p := rom.getPage()
|
|
|
|
rom.setPage(p & 1)
|
|
|
|
}
|
2019-11-04 00:23:03 +01:00
|
|
|
return 0
|
|
|
|
}, "ANN1OFF-ROM")
|
2022-08-05 19:43:17 +02:00
|
|
|
io.addSoftSwitchRW(0x5B, func() uint8 {
|
2024-01-22 23:09:35 +01:00
|
|
|
if rom, ok := mmu.physicalROM.(*memoryRangeROM); ok {
|
|
|
|
p := rom.getPage()
|
|
|
|
rom.setPage(p | 2)
|
|
|
|
}
|
2019-11-04 00:23:03 +01:00
|
|
|
return 0
|
|
|
|
}, "ANN1ON-ROM")
|
|
|
|
|
2019-06-09 17:36:29 +02:00
|
|
|
}
|
|
|
|
|
2019-10-12 21:37:37 +02:00
|
|
|
func charGenColumnsMapBase64a(column int) int {
|
|
|
|
bit := column + 2
|
|
|
|
// Weird positions
|
|
|
|
if column == 6 {
|
|
|
|
bit = 2
|
|
|
|
} else if column == 0 {
|
|
|
|
bit = 1
|
|
|
|
}
|
|
|
|
return bit
|
2019-06-09 17:36:29 +02:00
|
|
|
}
|