Re: [cc65-devel] c64 - getting seemingly random chars on screen
cc65 - a freeware C compiler for 6502 based systems
Brought to you by:
gpz
|
From: Michael P. <mp...@bl...> - 2021-03-03 16:59:51
|
On Tue, 2 Mar 2021, Michael Parson wrote: > On 2021-03-02 17:44, Michael Parson wrote: >> On Tue, 2 Mar 2021, gr...@gm... wrote: >>> I'd use watchpoints on the entire screen, like >>> >>> . watch store 0400 07e7 >>> . x >>> >>> (assuming your screen memory is at 0400) >>> >>> then when the first wrong character pops up break into the monitor >>> again, and you'll see a list of writes to the screen. find out which >>> one wrote the wrong character, and you know where it happens. >> >> Thanks, I'll give that a shot. > > Took a few tries, but here's where it happens: > > #1 (Stop on store 057c) 006 020 > .C:222d 91 D1 STA ($D1),Y - A:4A X:09 Y:14 SP:ee ..-....C > 84639134 > .C:222f AD 86 02 LDA $0286 - A:4A X:09 Y:14 SP:ee ..-....C > 84639134 > > Right when the piece I clicked on turned red, I also got a red 'I' > > 222d is in the middle of the subroutine starting at 2229: > > .C:2229 05 C7 ORA $C7 > .C:222b A4 D3 LDY $D3 > .C:222d 91 D1 STA ($D1),Y > .C:222f AD 86 02 LDA $0286 > .C:2232 91 F3 STA ($F3),Y > .C:2234 60 RTS > > Which, according to the generated label file, is '.putchar' > > There should only be 1 character being put to the screen at that time, > the red version of whatever character I clicked on, which is happening, > just that the extra & erroneous character shows up too. OK, put together a stripped down version. No score keeping, no stdio.h calls, no filesystem access, just the basic gameplay. All screen manipulation should be going through conio. Since this is a C-64 test, I even removed the asm bits and used a POKE to kick back into uppercase/PETSCII mode. I'd still prefer a cross-platform 'safe' way to do that. https://github.com/mparson/gridgame/blob/main/c64/minimal.c Still getting the same behavior. For grins, I compiled it for C-128, also got the errant chars. -- Michael Parson Pflugerville, TX |