I'm trying to modify Microchess (Daryl Rictor's modified version) to run from ROM on my 6502 board. RAM is 32Kbytes from $0000 to $7FFF, ROM is from $C000 to FFFF (16k).
I've changed both of the assembly origin (*=) directives so MC is based at $C000, and replaced the ACIA routines with dummy routines that just JSR to the monitor ROM. This was enough to get MC (mostly) running, but it seems to be getting stuck in a loop while it draws the board. Here's where it's getting stuck:
Code: Select all
ADC #$08 ; point y to beginning of next row
TAY ;
CPY #$80 ; was that the last row?
BEQ POUT8 ; yes, print the LED values
; for some reason the beq pout8 never fires
BNE POUT1 ; no, do new row
The monitor ROM doesn't touch X or Y, but all the UART comms routines clobber the accumulator and the flags. The code I've inserted into MC does a PHA, then the JSR, then a PLA and an RTS, so register clobbering shouldn't be an issue...
Has anyone got any suggestions? I was going to step through the code with my logic analyser, but I can't get a decent connection to the data bus (damn test clips)...
Thanks.