Added aux memory and 80 column card stubs ...
... just enough to fool prodos that there's only 64k of RAM and no 80 column card.
This commit is contained in:
parent
f1dff51564
commit
6f19957ee7
35
mmu/io.go
35
mmu/io.go
|
@ -142,9 +142,35 @@ func readWrite(address uint16, isRead bool) bool {
|
|||
}
|
||||
|
||||
switch address {
|
||||
case CLRAUXRD:
|
||||
SetFakeAuxMemoryRead(false)
|
||||
return true
|
||||
case SETAUXRD:
|
||||
SetFakeAuxMemoryRead(true)
|
||||
return true
|
||||
case CLRAUXWR:
|
||||
SetFakeAuxMemoryWrite(false)
|
||||
return true
|
||||
case SETAUXWR:
|
||||
SetFakeAuxMemoryWrite(true)
|
||||
return true
|
||||
case CLRAUXZP:
|
||||
SetFakeAltZP(false)
|
||||
return true
|
||||
case SETAUXZP:
|
||||
SetFakeAltZP(true)
|
||||
return true
|
||||
case CLR80VID:
|
||||
// 80 column card hasn't been implemented yet
|
||||
return true
|
||||
case TXTPAGE1:
|
||||
// 80 column card hasn't been implemented yet
|
||||
SetFakePage2(false)
|
||||
return true
|
||||
case TXTPAGE2:
|
||||
// 80 column card hasn't been implemented yet
|
||||
SetFakePage2(true)
|
||||
return true
|
||||
case CLRTEXT:
|
||||
VideoState.TextMode = false
|
||||
return true
|
||||
|
@ -157,12 +183,6 @@ func readWrite(address uint16, isRead bool) bool {
|
|||
case SETMIXED:
|
||||
VideoState.Mixed = true
|
||||
return true
|
||||
case TXTPAGE1:
|
||||
return true
|
||||
case TXTPAGE2:
|
||||
return true
|
||||
fmt.Println("TXTPAGE2 not implemented")
|
||||
return true
|
||||
case CLRHIRES:
|
||||
VideoState.HiresMode = false
|
||||
return true
|
||||
|
@ -252,6 +272,9 @@ func ReadIO(address uint16) uint8 {
|
|||
keyboard.ResetStrobe()
|
||||
return strobe
|
||||
}
|
||||
case RDRAMRD, RDRAMWR, RDAUXZP:
|
||||
panic("Read/write aux memory not implemented")
|
||||
return 0x0d
|
||||
case RDCXROM:
|
||||
if UsingExternalSlotRom {
|
||||
return 0x8d
|
||||
|
|
57
mmu/mmu.go
57
mmu/mmu.go
|
@ -25,6 +25,10 @@ var (
|
|||
UsingExternalSlotRom bool // Which IO ROM is being used
|
||||
UpperReadMappedToROM bool // Do reads go to the RAM or ROM
|
||||
UpperRamReadOnly bool // Is the upper RAM read only
|
||||
FakeAuxMemoryRead bool // Aux memory isn't implemented
|
||||
FakeAuxMemoryWrite bool // Aux memory isn't implemented
|
||||
FakeAltZP bool // Aux memory isn't implemented
|
||||
FakePage2 bool // Aux memory isn't implemented
|
||||
)
|
||||
|
||||
func ApplyMemoryConfiguration() {
|
||||
|
@ -146,9 +150,33 @@ func SetD000Bank(value int) {
|
|||
ApplyMemoryConfiguration()
|
||||
}
|
||||
|
||||
func SetFakeAuxMemoryRead(value bool) {
|
||||
FakeAuxMemoryRead = value
|
||||
ApplyMemoryConfiguration()
|
||||
}
|
||||
|
||||
func SetFakeAuxMemoryWrite(value bool) {
|
||||
FakeAuxMemoryWrite = value
|
||||
ApplyMemoryConfiguration()
|
||||
}
|
||||
|
||||
func SetFakeAltZP(value bool) {
|
||||
FakeAltZP = value
|
||||
ApplyMemoryConfiguration()
|
||||
}
|
||||
|
||||
func SetFakePage2(value bool) {
|
||||
FakePage2 = value
|
||||
ApplyMemoryConfiguration()
|
||||
}
|
||||
|
||||
func InitRAM() {
|
||||
UpperRamReadOnly = false
|
||||
D000Bank = 2
|
||||
FakeAuxMemoryRead = false // Aux memory isn't implemented
|
||||
FakeAuxMemoryWrite = false // Aux memory isn't implemented
|
||||
FakeAltZP = false // Aux memory isn't implemented
|
||||
FakePage2 = false // Aux memory isn't implemented
|
||||
ApplyMemoryConfiguration()
|
||||
}
|
||||
|
||||
|
@ -188,9 +216,25 @@ func SetMemoryMode(mode uint8) {
|
|||
func ReadMemory(address uint16) uint8 {
|
||||
if (address >= 0xc000) && (address < 0xc100) {
|
||||
return ReadIO(address)
|
||||
} else {
|
||||
return ReadPageTable[address>>8][address&0xff]
|
||||
}
|
||||
|
||||
if FakePage2 && (address >= 0x400 && address < 0x800) {
|
||||
// Return nothingness
|
||||
return uint8(0x00)
|
||||
}
|
||||
|
||||
if FakeAuxMemoryRead {
|
||||
if address >= 0x200 {
|
||||
// Return nothingness
|
||||
return uint8(0x00)
|
||||
} else {
|
||||
if FakeAltZP {
|
||||
return uint8(0x00)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ReadPageTable[address>>8][address&0xff]
|
||||
}
|
||||
|
||||
func WriteMemory(address uint16, value uint8) {
|
||||
|
@ -206,12 +250,21 @@ func WriteMemory(address uint16, value uint8) {
|
|||
return
|
||||
}
|
||||
|
||||
if FakePage2 && (address >= 0x400 && address < 0x800) {
|
||||
// Do nothing
|
||||
return
|
||||
}
|
||||
|
||||
memory := WritePageTable[address>>8]
|
||||
// If memory is nil, then it's read only. The write is ignored.
|
||||
if memory != nil {
|
||||
memory[uint8(address&0xff)] = value
|
||||
}
|
||||
|
||||
if FakeAuxMemoryWrite {
|
||||
return
|
||||
}
|
||||
|
||||
if system.RunningFunctionalTests && address == 0x200 {
|
||||
testNumber := ReadMemory(0x200)
|
||||
if testNumber == 0xf0 {
|
||||
|
|
Loading…
Reference in New Issue