Hi,
I am writing a NES emulator in Swift just for fun (yes I have read the sticky) and have implemented the CPU part and Mapper 0, no PPU or APU yet.
I want to test the instructions so I have loaded nestest.nes and set PC to 0xC000, it runs about 20 or so instructions before finding an opcode it doesn't know. This bit I can probably fix, but I thought it is probably better to first change all my logs to match those in the existing log file I found (this was hard to track down). I have started doing that and am having a dumb moment, I don't understand a part of the log file. What is the "= 74", "= 52", "= 73" mean after the STX instructions? Isn't this STX mean store what is found at memory location $00 in the X register? In my memory model there is nothing stored at location 0, and the subsequent log of the X register shows it is 0. Can anyone help me understand what is happening here?
Cheers,
Brett
I am writing a NES emulator in Swift just for fun (yes I have read the sticky) and have implemented the CPU part and Mapper 0, no PPU or APU yet.
I want to test the instructions so I have loaded nestest.nes and set PC to 0xC000, it runs about 20 or so instructions before finding an opcode it doesn't know. This bit I can probably fix, but I thought it is probably better to first change all my logs to match those in the existing log file I found (this was hard to track down). I have started doing that and am having a dumb moment, I don't understand a part of the log file. What is the "= 74", "= 52", "= 73" mean after the STX instructions? Isn't this STX mean store what is found at memory location $00 in the X register? In my memory model there is nothing stored at location 0, and the subsequent log of the X register shows it is 0. Can anyone help me understand what is happening here?
Cheers,
Brett
Code:
C000 4C F5 C5 JMP $C5F5 A:00 X:00 Y:00 P:24 SP:FD CPUC:0
READ $C000
READ $C001
READ $C002
C5F5 A2 00 LDX #$00 A:00 X:00 Y:00 P:24 SP:FD CPUC:3
READ $C5F5
READ $C5F6
C5F7 86 00 STX $00 = 74 A:00 X:00 Y:00 P:26 SP:FD CPUC:5
READ $C5F7
READ $C5F8
WRITE $0000
C5F9 86 10 STX $10 = 52 A:00 X:00 Y:00 P:26 SP:FD CPUC:8
READ $C5F9
READ $C5FA
WRITE $0010
C5FB 86 11 STX $11 = 73 A:00 X:00 Y:00 P:26 SP:FD CPUC:11
READ $C5FB
READ $C5FC
WRITE $0011
READ $C000
READ $C001
READ $C002
C5F5 A2 00 LDX #$00 A:00 X:00 Y:00 P:24 SP:FD CPUC:3
READ $C5F5
READ $C5F6
C5F7 86 00 STX $00 = 74 A:00 X:00 Y:00 P:26 SP:FD CPUC:5
READ $C5F7
READ $C5F8
WRITE $0000
C5F9 86 10 STX $10 = 52 A:00 X:00 Y:00 P:26 SP:FD CPUC:8
READ $C5F9
READ $C5FA
WRITE $0010
C5FB 86 11 STX $11 = 73 A:00 X:00 Y:00 P:26 SP:FD CPUC:11
READ $C5FB
READ $C5FC
WRITE $0011