Closed hoglet67 closed 3 years ago
It seems the stray write happens to RAM TOP + &DE97, and the position changes with memory size.
I've hacked a version of the Matchbox 32016 Co Pro that has 2MB of memory, with an alias at 2MB-4MB.
If the stray write happens, I would expect it to go to &20DE97, which should alias to &DE97.
Booting Pandora to BAS32 does not disturb the value, but allows it to be read
Break, BAS32, !&DE97=&AAAAAAAA,
Break, BAS32, PRINT ~!&DE97 returns AAAAAAAA
Break, Boot Panos, Break, BAS32, PRINT ~!&DE97 returns F8A0974E
Break, Boot Panos, run cworld, Break, BAS32, PRINT ~!&DE97 returns F8A0974E
Break, Boot Panos, run script containing cworld twice, Break, BAS32, PRINT ~!&DE97 returns F8A09700
In PiTubeDirect, the stray write only happens in case (5).
This appears to be the same on the Matchbox.
This suggests a bug in Panos (or more probably the compiled cworld program) rather than a 32016 emulation bug.
Dave
I would like to run this on a real 32K Co Processor, but the memory doesn't alias in the same way, so the stray write is harmless (and leaves no trace)
[ Which, apart from the warning in PiTubeDirect, it's also harmless ]
My 32K Co Pro has 512KB + 128KB = 640KB.
I can reproduce this with my original 32016 Co Processor...
By removing one of the RAM 64K Ram chips (the bottom right one), Panos detects just 512KB, but memory location 8DE97 still works.
You can see the bit affected by this memory chip here:
!&8DE97 = &00000000: PRINT !&8DE97: returns 80008000
!&8DE97 = &AAAAAAAA: PRINT !&8DE97: returns AAAAAAAA
Anyway, to reproduce the "bug", do the following
Break, BAS32, !&8DE97=&AAAAAAAA,
Break, BAS32, PRINT ~!&8DE97 returns AAAAAAAA
Break, Boot Panos, Break, BAS32, PRINT ~!&ADE97 returns AAAAAAAA
Break, Boot Panos, run cworld, Break, BAS32, PRINT ~!&8DE97 returns AAAAAAAA
Break, Boot Panos, run script containing cworld twice, Break, BAS32, PRINT ~!&8DE97 returns AAAAAA00
In case (5) a stray write has occurred, setting &8DE97 to &00.
Closing, as this is not an emulation bug.
Dave
In Panos 1.4 when running cCheck I noticed an out of range write:
Seperately I fixed a disassembly bug that prevented EaPlusRn scaled index addressing instructions being correctly decoded: 4a52f8ac (also caused the disassembler to loose sync) and later found b55c39bb
The write is to: 10DE97
The 1024KB of RAM ends at 0FFFFF
After fixing the disassembly issues (not present in the above debug session log), the write address seems correct:
FP - 292 + R7
= 0xFDFB8 - 292 + 0x10003
= 0x10DE97
But why is R7 so large ???
Is there an earlier bug, or does this happen on real hardware as well?