I had a pretty hard time debugging a crash in incoming Orgams feature.
The offending code was accidentally unlocking X-Mem software write protection (with manual switch set to 'free').
Or so I thought.
My X-Mem use W29C040 chip (which use &100-bytes page). Each command sequence begins with:
- Write &AA to &5555
- Write &55 to &AAAA
- Write n to &5555 (command n)
The problem here is that the crash intervenes at the first write, defeating the purpose of the sequence.
We can reproduce this issue with:
ld c,1 ; rom xxxxxx01
call &b90f
ld hl,&d555
ld (hl),&aa
ret ; isn't reached
Or, if monogams is installed in ROM 4*n+1, the trace session will crash :
BRK
ld hl,&d555
ld (hl),&aa
This is very inconvenant, because this means than any ROM at such position writing &aa to this screen address will crash.
Known workarounds :
- Hardware write protection (X-Mem onboard switch)
- Put offending ROM in even numbered ROM