When debugging, i add the line
Code:
sta look
to see what value is in the accumulator at that point. When i add that line now, nintendulator halts and says "Bad opcode, CPU locked". What do you think is wrong?
Sounds like the assembler messed up, though I'm not sure how that could be.
Are you making sure to set your assembler to use only 6502 instructions and not 65c02 or 65c816 instructions?
im using P65. On the website it says:
"The P65 assemblers are assemblers for the 6502 microprocessor (such as is used in the Commodore 64, Apple II, and Nintendo Entertainment System). They are designed to be able to support a wide variety of output formats, both to support multiple target platforms and to produce code for emulators."
Does that mean it only uses 6502 instructions?
It works fine in Nestopia and Nintendulator 0.900, but in Nintendulator 0.950 it gives that error.
- Commodore 64 with SuperChip: 65C816
- Apple IIGS: 65C816
- Super NES: 65C816
Anyway, what happens when you step around that line with your debugger?
i dont know how to step around a line with a debugger. The only debugger i know of is the one in Nintendulator. When i comment out that line, it runs. It doesn't do what i want it to, but it doesn't give that error either.
Adding the instruction in also shifts other code. Try lots of different things to narrow it down. Try replacing it with two or three NOPs (depending on whether you're using zero-page or absolute addressing) and see if it still crashes. Try storing to a different location. Try changing it to an LDA, or LDX. This will help you narrow down what the cause is.
THANK YOU ALL FOR YOU HELP!
i was doing something horridly wrong with indirect y addressing. After that was redone, the problem went away!