Hi everyone
This post is to talk about a debugger tool I hacked together for SNES ROMs. I explain it in more detail on my blog so I will copy and paste for you :/
Hello fellow SNES lovers, this post is to discuss my SNES Code Visualiser, otherwise know as SCV. This code was hacked together very quickly, just to show an idea - it's not a finished product and I'd love to hear suggestions for improvements.
OOkay. While I was doing some FZero hacking a while back I kept wishing there was a specific debugging tool that existed to assist me. So I decided to hack Snes9x to add a very unique type of debugger. In fact (and please correct me if I'm wrong) I do not believe any debugger, for any platform, has this functionality - at least, I have never seen it.
So what is it? Basically I started thinking about what it would be like to plot the CPU program counter. I figured it would look like a 'pulse', and I even had a cool name for it, I called it the program counter pulse. In slow motion, I imagined seeing the PC going across the screen, following the same paths again and again. And occasionally new paths would be seen as player input forced different branch and jump logic to become true.
It was that point that stuck to me. What if we could visually identify specific code, as it happens?
The way I have achieved this is by taking advantage of the small ROM page size of the SNES. 16-bit addressing means page size is limited to 2^15 bytes when loROM is being used and 2^16 bytes with hiROM. If you assume the worst case scenario of hiROM, you can actually visually represent every single byte on the page in a neat 256 x 256 pixel square (256*256=2^16)!
To show you how effective this can be, I'm going to run you through an example usage, to find some really arcane code. Since F-Zero is my favourite, let's find the code that is executed everytime a car jumps onto and over a ramp.
Now keep in mind, the old way this would have worked is probably by tracing through the ROM over a couple of days, writing comments on a disassembled listing of the ROM, until you grasp the mechanics of the program enough to isolate events like jumping on a ramp. With this debugger, you can isolate the code in less than one minute.
Please see my blog which has screenshots of the process and more information http://fzerovs.blogspot.com
I will release the source code in the next day or so. I'm really interested in hearing your thoughts on this, because you guys seem to be the only ones still interested in SNES! It's a strange passion and most people just don't care so it's really great to be able to contact people like you guys!
Michael
This post is to talk about a debugger tool I hacked together for SNES ROMs. I explain it in more detail on my blog so I will copy and paste for you :/
Hello fellow SNES lovers, this post is to discuss my SNES Code Visualiser, otherwise know as SCV. This code was hacked together very quickly, just to show an idea - it's not a finished product and I'd love to hear suggestions for improvements.
OOkay. While I was doing some FZero hacking a while back I kept wishing there was a specific debugging tool that existed to assist me. So I decided to hack Snes9x to add a very unique type of debugger. In fact (and please correct me if I'm wrong) I do not believe any debugger, for any platform, has this functionality - at least, I have never seen it.
So what is it? Basically I started thinking about what it would be like to plot the CPU program counter. I figured it would look like a 'pulse', and I even had a cool name for it, I called it the program counter pulse. In slow motion, I imagined seeing the PC going across the screen, following the same paths again and again. And occasionally new paths would be seen as player input forced different branch and jump logic to become true.
It was that point that stuck to me. What if we could visually identify specific code, as it happens?
The way I have achieved this is by taking advantage of the small ROM page size of the SNES. 16-bit addressing means page size is limited to 2^15 bytes when loROM is being used and 2^16 bytes with hiROM. If you assume the worst case scenario of hiROM, you can actually visually represent every single byte on the page in a neat 256 x 256 pixel square (256*256=2^16)!
To show you how effective this can be, I'm going to run you through an example usage, to find some really arcane code. Since F-Zero is my favourite, let's find the code that is executed everytime a car jumps onto and over a ramp.
Now keep in mind, the old way this would have worked is probably by tracing through the ROM over a couple of days, writing comments on a disassembled listing of the ROM, until you grasp the mechanics of the program enough to isolate events like jumping on a ramp. With this debugger, you can isolate the code in less than one minute.
Please see my blog which has screenshots of the process and more information http://fzerovs.blogspot.com
I will release the source code in the next day or so. I'm really interested in hearing your thoughts on this, because you guys seem to be the only ones still interested in SNES! It's a strange passion and most people just don't care so it's really great to be able to contact people like you guys!
Michael