I thought I'd just make a new thread for this. I've been trying for weeks now to debug my cpu core and I just don't know where to go from here. My core passes some of blarg's tests. Here are what each of the tests do:
01-basics: passes
02-implied: passes
03-immediate: Doesn't pass. $6000 = $80 no matter how much time passes. Goes into an infinite BRK instruction after INC instruction is carried out at $03A1
04-zero_page: Doesn't pass. $6000 = $80 no matter how much time passes. Goes into infinite BRK after $03A1
05-zp_xy: Doesn't pass. $6000 = $80 no matter how much time passes.
06-absolute: Doesn't pass. $6000 = $80 no matter how much time passes.
07-abs_xy: Doesn't pass. $6000 = $80 no matter how much time passes.
08-ind_x: Fails but only illegal opcodes are output as being wrong (I'm only testing official opcodes)
09-ind_y: Same as ind_x
10-branches: passes
11-stack: passes
12-jmp_jsr: passes
13-rts: passes
14-rti:passes
15-brk: fails. $6000 = $80 no matter how much time passes.
16-special: fails. $6000 = $80 no matter how much time passes.
I have a debug function written that outputs all instructions like this, but the text file gets so big that I have no idea how it's helpful:
So, what is the best way of going about debugging this CPU core? All of the tests that fail get off track some way or another and never actually print any output ($6000 is always $80, so it's still running) because it gets stuck in an infinite BRK. I have no idea what opcodes to even start looking at.
01-basics: passes
02-implied: passes
03-immediate: Doesn't pass. $6000 = $80 no matter how much time passes. Goes into an infinite BRK instruction after INC instruction is carried out at $03A1
04-zero_page: Doesn't pass. $6000 = $80 no matter how much time passes. Goes into infinite BRK after $03A1
05-zp_xy: Doesn't pass. $6000 = $80 no matter how much time passes.
06-absolute: Doesn't pass. $6000 = $80 no matter how much time passes.
07-abs_xy: Doesn't pass. $6000 = $80 no matter how much time passes.
08-ind_x: Fails but only illegal opcodes are output as being wrong (I'm only testing official opcodes)
09-ind_y: Same as ind_x
10-branches: passes
11-stack: passes
12-jmp_jsr: passes
13-rts: passes
14-rti:passes
15-brk: fails. $6000 = $80 no matter how much time passes.
16-special: fails. $6000 = $80 no matter how much time passes.
I have a debug function written that outputs all instructions like this, but the text file gets so big that I have no idea how it's helpful:
Quote:
E883 78 SEI A:00 X:00 Y:00 P:30 SP:FD CYC: 0
E884 4C B3 EC JMP $ECB3 A:00 X:00 Y:00 P:34 SP:FD CYC: 6
ECB3 8D 24 02 STA $0224 = 00 A:00 X:00 Y:00 P:34 SP:FD CYC: 15
ECB6 A9 00 LDA #$00 A:00 X:00 Y:00 P:34 SP:FD CYC: 27
ECB8 8D 00 20 STA $2000 = 00 A:00 X:00 Y:00 P:36 SP:FD CYC: 33
ECBB 8D 01 20 STA $2001 = 00 A:00 X:00 Y:00 P:36 SP:FD CYC: 45
ECBE 4C 87 E8 JMP $E887 A:00 X:00 Y:00 P:36 SP:FD CYC: 57
E884 4C B3 EC JMP $ECB3 A:00 X:00 Y:00 P:34 SP:FD CYC: 6
ECB3 8D 24 02 STA $0224 = 00 A:00 X:00 Y:00 P:34 SP:FD CYC: 15
ECB6 A9 00 LDA #$00 A:00 X:00 Y:00 P:34 SP:FD CYC: 27
ECB8 8D 00 20 STA $2000 = 00 A:00 X:00 Y:00 P:36 SP:FD CYC: 33
ECBB 8D 01 20 STA $2001 = 00 A:00 X:00 Y:00 P:36 SP:FD CYC: 45
ECBE 4C 87 E8 JMP $E887 A:00 X:00 Y:00 P:36 SP:FD CYC: 57
So, what is the best way of going about debugging this CPU core? All of the tests that fail get off track some way or another and never actually print any output ($6000 is always $80, so it's still running) because it gets stuck in an infinite BRK. I have no idea what opcodes to even start looking at.