mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-12-22 09:30:19 +00:00
21 lines
412 B
Go
21 lines
412 B
Go
package apple2
|
|
|
|
type cardBase struct {
|
|
rom []memoryPage
|
|
slot int
|
|
ssr [16]softSwitchR
|
|
ssw [16]softSwitchW
|
|
}
|
|
|
|
func (c *cardBase) insert(a *Apple2, slot int) {
|
|
c.slot = slot
|
|
if slot != 0 && c.rom[0] != nil {
|
|
a.mmu.setPage(uint8(0xC0+slot), c.rom[0])
|
|
}
|
|
|
|
for i := 0; i < 0x10; i++ {
|
|
a.io.addSoftSwitchR(uint8(0xC80+slot*0x10+i), c.ssr[i])
|
|
a.io.addSoftSwitchW(uint8(0xC80+slot*0x10+i), c.ssw[i])
|
|
}
|
|
}
|