LC mem fix. Fixes IIe self check and The Games: Summer Edition

This commit is contained in:
Ivan Izaguirre 2020-04-04 20:15:32 +02:00
parent b9dbcc43a8
commit 810c1a7d89
2 changed files with 11 additions and 16 deletions

View File

@ -26,6 +26,10 @@ for $D000-$F7FF.
Power on RESET initializes ROM to read mode and RAM to write mode, Power on RESET initializes ROM to read mode and RAM to write mode,
and selects the second 4K bank to map $D000-$DFFF." and selects the second 4K bank to map $D000-$DFFF."
Writing to the softswtich disables writing in LC? Saw that
somewhere but doing so fails IIe self check.
*/ */
type cardLanguage struct { type cardLanguage struct {
@ -56,11 +60,11 @@ func (c *cardLanguage) assign(a *Apple2, slot int) {
for i := uint8(0x0); i <= 0xf; i++ { for i := uint8(0x0); i <= 0xf; i++ {
iCopy := i iCopy := i
c.addCardSoftSwitchR(iCopy, func(*ioC0Page) uint8 { c.addCardSoftSwitchR(iCopy, func(*ioC0Page) uint8 {
c.ssAction(iCopy, false) c.ssAction(iCopy)
return 0 return 0
}, "LANGCARDR") }, "LANGCARDR")
c.addCardSoftSwitchW(iCopy, func(*ioC0Page, uint8) { c.addCardSoftSwitchW(iCopy, func(*ioC0Page, uint8) {
c.ssAction(iCopy, true) c.ssAction(iCopy)
}, "LANGCARDW") }, "LANGCARDW")
} }
@ -68,7 +72,7 @@ func (c *cardLanguage) assign(a *Apple2, slot int) {
c.applyState() c.applyState()
} }
func (c *cardLanguage) ssAction(ss uint8, write bool) { func (c *cardLanguage) ssAction(ss uint8) {
c.altBank = ((ss >> 3) & 1) == 0 c.altBank = ((ss >> 3) & 1) == 0
action := ss & 0x3 action := ss & 0x3
switch action { switch action {
@ -94,11 +98,6 @@ func (c *cardLanguage) ssAction(ss uint8, write bool) {
c.writeState = lcWriteEnabled c.writeState = lcWriteEnabled
} }
// Writing to the softswtich disables writes.
if write {
c.writeState = lcWriteDisabled
}
c.applyState() c.applyState()
} }

View File

@ -35,18 +35,19 @@ func (c *cardSaturn) assign(a *Apple2, slot int) {
for i := uint8(0x0); i <= 0xf; i++ { for i := uint8(0x0); i <= 0xf; i++ {
iCopy := i iCopy := i
c.addCardSoftSwitchR(iCopy, func(*ioC0Page) uint8 { c.addCardSoftSwitchR(iCopy, func(*ioC0Page) uint8 {
c.ssAction(iCopy, false) c.ssAction(iCopy)
return 0 return 0
}, "SATURNR") }, "SATURNR")
c.addCardSoftSwitchW(iCopy, func(*ioC0Page, uint8) { c.addCardSoftSwitchW(iCopy, func(*ioC0Page, uint8) {
c.ssAction(iCopy, true) c.ssAction(iCopy)
c.ssAction(iCopy)
}, "SATURNW") }, "SATURNW")
} }
c.cardBase.assign(a, slot) c.cardBase.assign(a, slot)
c.applyState() c.applyState()
} }
func (c *cardSaturn) ssAction(ss uint8, write bool) { func (c *cardSaturn) ssAction(ss uint8) {
switch ss { switch ss {
case 0: case 0:
// RAM read, no writes // RAM read, no writes
@ -110,11 +111,6 @@ func (c *cardSaturn) ssAction(ss uint8, write bool) {
c.writeState = lcWriteEnabled c.writeState = lcWriteEnabled
} }
// Writing to the softswtich disables writes.
if write {
c.writeState = lcWriteDisabled
}
c.applyState() c.applyState()
} }