CPCWiki forum

General Category => Programming => Topic started by: madram on 22:08, 13 November 16

Title: Nasty X-MEM related bug in 21st Century Western Europe
Post by: madram on 22:08, 13 November 16

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 :

Title: Re: Nasty X-MEM related bug in 21st Century Western Europe
Post by: TotO on 12:05, 14 November 16
1- You should load your code into the RAM to program the ROM
2- I can exchange your Winbond chip by a SST to see...
Title: Re: Nasty X-MEM related bug in 21st Century Western Europe
Post by: madram on 14:49, 14 November 16

[size=78%]1.It's not about programming the ROM itself. It's when any program in ROM write &AA in &D555, for display purpose typically.[/size]




2. I can have access to a SST-flavored X-Mem. I'll test it and keep you updated.
Thanks!
Title: Re: Nasty X-MEM related bug in 21st Century Western Europe
Post by: TotO on 14:58, 14 November 16
OK, let me know!
Powered by SMFPacks Menu Editor Mod