Fixed aux memory writes that should have been ignored

This was killing the Prodos basic intepreter bootstrapper since a write was
going to main memory at $800, leading to invalid code when the JMP to $0800
from the prodos reloader was done.
This commit is contained in:
Will Angenent 2018-05-26 13:58:41 +01:00
parent 9f2226d968
commit d950bb8ff0
2 changed files with 9 additions and 6 deletions

View File

@ -255,16 +255,17 @@ func WriteMemory(address uint16, value uint8) {
return return
} }
if FakeAuxMemoryWrite {
// If there is no aux memory, then the write is ignored.
return
}
memory := WritePageTable[address>>8] memory := WritePageTable[address>>8]
// If memory is nil, then it's read only. The write is ignored. // If memory is nil, then it's read only. The write is ignored.
if memory != nil { if memory != nil {
memory[uint8(address&0xff)] = value memory[uint8(address&0xff)] = value
} }
if FakeAuxMemoryWrite {
return
}
if system.RunningFunctionalTests && address == 0x200 { if system.RunningFunctionalTests && address == 0x200 {
testNumber := ReadMemory(0x200) testNumber := ReadMemory(0x200)
if testNumber == 0xf0 { if testNumber == 0xf0 {

View File

@ -31,12 +31,14 @@ func TestProdosBoot(t *testing.T) {
utils.RunUntilBreakPoint(t, 0xc600, 2, false, "Boot ROM") utils.RunUntilBreakPoint(t, 0xc600, 2, false, "Boot ROM")
utils.RunUntilBreakPoint(t, 0x0801, 2, false, "Loader") utils.RunUntilBreakPoint(t, 0x0801, 2, false, "Loader")
utils.RunUntilBreakPoint(t, 0x2000, 3, false, "Relocator") utils.RunUntilBreakPoint(t, 0x2000, 3, false, "Kernel Relocator")
utils.RunUntilBreakPoint(t, 0x0080, 1, false, "AUX RAM test") utils.RunUntilBreakPoint(t, 0x0080, 1, false, "AUX RAM test")
utils.RunUntilBreakPoint(t, 0x2932, 1, false, "Relocation done") utils.RunUntilBreakPoint(t, 0x2932, 1, false, "Relocation done")
utils.RunUntilBreakPoint(t, 0x21f3, 1, false, "The first JSR $bf00 - ONLINE - get names of one or all online volumes") utils.RunUntilBreakPoint(t, 0x21f3, 1, false, "The first JSR $bf00 - ONLINE - get names of one or all online volumes")
utils.RunUntilBreakPoint(t, 0xd000, 1, false, "First call to MLI kernel") utils.RunUntilBreakPoint(t, 0xd000, 1, false, "First call to MLI kernel")
// utils.RunUntilBreakPoint(t, 0x0800, 1, false, "BI loader") utils.RunUntilBreakPoint(t, 0x0800, 2, false, "BI loader")
utils.RunUntilBreakPoint(t, 0x2000, 2, false, "BI Relocator")
utils.RunUntilBreakPoint(t, 0xbe00, 52, false, "BI Start")
elapsed := float64(time.Since(t0) / time.Millisecond) elapsed := float64(time.Since(t0) / time.Millisecond)
fmt.Printf("CPU Cycles: %d\n", system.FrameCycles) fmt.Printf("CPU Cycles: %d\n", system.FrameCycles)