Confusing crash Address Error.
Posted: Sun Oct 12, 2014 12:49 am
I've spent all day trying to figure this one out. Basically I've been working on the Synth editor. I added a new table for editing the YM2612's parameters. I haven't yet tied these tables in with the parameters themselves. When I go into the Synth editor to edit the data with the cursor, it works ok at first. But for some reason, if the lower digit goes anywhere between 2-F, it crashes. Setting the higher digit beyond 9 automatically sets both digits to 9F (it's supposed to do this), since the lower digit is in the range of 2-F, it crashes. The RAM viewer in Regen shows that the data is being written to the correct location in RAM, but when the crash occurs a 04 is written to the next byte, and I'm pretty certain that my code doesn't point to that location. That's likely the irrelevant part, as I've investigated deeply into this matter and the code that handles the digits and drawing to screen is pretty much the same and works fine elsewhere. My digit handling code is perfectly fine, it works everywhere else no problem.
The video never updates the new value to the cursor.
I've recorded the event in GENS kmod, and took a look at the debugger and found where the crash occurs and guys this is where my mind gets melted. It occurs in the Frame waiting code (to slow everything down) that takes place in the main loop on a cmp.l instruction. What??? So I tried everything, pushing pulling data to/from the stack, wiping my registers clean. Here's something more confusing, if I remove this frame waiting code from the program... I get bad graphical glitches and even a complete freeze. This frame waiting code has caused me no other issues before. Even more confusing, if I keep the frame waiting code and set it to wait for 0 frames, it works fine, just everything is super fast of course. (still have that crash though)
Anyways the crash goes to the address error vector as defined in the init code. I've checked to make sure I'm doing my .b and .w properly. What the hell is going on?
Does this have to do with interrupts? Am I missing something? Is there any debug tips anyone might have that could help me solve this mess?
The video never updates the new value to the cursor.
I've recorded the event in GENS kmod, and took a look at the debugger and found where the crash occurs and guys this is where my mind gets melted. It occurs in the Frame waiting code (to slow everything down) that takes place in the main loop on a cmp.l instruction. What??? So I tried everything, pushing pulling data to/from the stack, wiping my registers clean. Here's something more confusing, if I remove this frame waiting code from the program... I get bad graphical glitches and even a complete freeze. This frame waiting code has caused me no other issues before. Even more confusing, if I keep the frame waiting code and set it to wait for 0 frames, it works fine, just everything is super fast of course. (still have that crash though)
Anyways the crash goes to the address error vector as defined in the init code. I've checked to make sure I'm doing my .b and .w properly. What the hell is going on?
Does this have to do with interrupts? Am I missing something? Is there any debug tips anyone might have that could help me solve this mess?