2019-03-02 19:41:25 +00:00
|
|
|
package apple2
|
|
|
|
|
|
|
|
type cardBase struct {
|
2019-05-10 16:07:36 +00:00
|
|
|
a *Apple2
|
2019-05-16 20:51:04 +00:00
|
|
|
rom *memoryRange
|
2019-03-02 19:41:25 +00:00
|
|
|
slot int
|
|
|
|
ssr [16]softSwitchR
|
|
|
|
ssw [16]softSwitchW
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *cardBase) insert(a *Apple2, slot int) {
|
2019-05-10 16:07:36 +00:00
|
|
|
c.a = a
|
2019-03-02 19:41:25 +00:00
|
|
|
c.slot = slot
|
2019-05-16 20:51:04 +00:00
|
|
|
if slot != 0 && c.rom != nil {
|
2019-05-16 20:55:19 +00:00
|
|
|
c.rom.base = uint16(0xc000 + slot*0x100)
|
|
|
|
a.mmu.setPagesRead(uint8(0xc0+slot), uint8(0xc0+slot), c.rom)
|
2019-03-02 19:41:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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])
|
|
|
|
}
|
|
|
|
}
|