The Tic-Tac-Toe debugging thread
Moderator: Moderators
-
CartCollector
- Posts: 122
- Joined: Mon Oct 30, 2006 8:32 pm
The Tic-Tac-Toe debugging thread
I'm starting new project (Tic-Tac-Toe) and it gives me a flash of grey for one frame and then nothing when I load it into an emulator (Nestopia even says "CPU jam!"). Why won't it load? Download the file here.
Last edited by CartCollector on Sat Jun 09, 2007 9:32 pm, edited 2 times in total.
-
CartCollector
- Posts: 122
- Joined: Mon Oct 30, 2006 8:32 pm
-
CartCollector
- Posts: 122
- Joined: Mon Oct 30, 2006 8:32 pm
I now have a new problem. For some reason, my joypad-reading routine always shows that A is pressed (#%10000000). Why? Newest build available here.
I dont have nesasm but I was able to mostly convert it to CA65 and could reproduce the problem.
I believe this is because of the ROL call later in the PadLoop
From the 6502 simulator docs.
ROL shifts all bits left one position. The Carry is put in bit 0, and bit 7 becomes the carry.
Looks like you had a carry flag set when entering the subroutine so the next call to ORA P1Pad always sets the bit.
I was able to fix it by adding "CLC" right after entering the subroutine(right after the "ReadPad:" line)
Al
I believe this is because of the ROL call later in the PadLoop
From the 6502 simulator docs.
ROL shifts all bits left one position. The Carry is put in bit 0, and bit 7 becomes the carry.
Looks like you had a carry flag set when entering the subroutine so the next call to ORA P1Pad always sets the bit.
I was able to fix it by adding "CLC" right after entering the subroutine(right after the "ReadPad:" line)
Al