News: 11 March 2016 - Forum Rules

Author Topic: Geiger's SNES9X Tracing Issue?  (Read 3653 times)

justin3009

  • Hero Member
  • *****
  • Posts: 1664
  • Welp
    • View Profile
Geiger's SNES9X Tracing Issue?
« on: March 19, 2015, 02:23:18 pm »
I'm not sure if it's because I'm doing something wrong or if it's another quark in Geiger's debugger.

I'm messing with Super Mario RPG still trying to apply the bank swap code to the sprites while on the overworld.. and I can't trace anything that has to do with it.  I went ahead and did a manual search as it's definitely using the same general concept and found the address of the bank code I need to change..only it seems that it cannot be read, written off into a log, used as a breakpoint or ANYTHING within Geiger's.

The address was at C09C9A.  I even tried tracing using SA1 tracing and it STILL didn't find it yet the code is CLEARLY loading.

I assume it's just another odd bug in the debugger but I want to confirm it.

Edit: Not even BSNES can catch it either.  NO$SNS got it but it makes it incredibly hard to follow when trying to step forward or back to see how it's catching the results.  Tracing doesn't really help either.

Edit 2: How annoying.  It seems it's skipping the ENTIRETY of C0:8000+ for tracing.  It acts like it's not even there, yet it clearly loads the code when it's needed.
« Last Edit: March 19, 2015, 08:51:51 pm by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

assassin

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • My Barren Webpage
Re: Geiger's SNES9X Tracing Issue?
« Reply #1 on: March 20, 2015, 04:22:41 pm »
sure it's not running in Bank 80h?

justin3009

  • Hero Member
  • *****
  • Posts: 1664
  • Welp
    • View Profile
Re: Geiger's SNES9X Tracing Issue?
« Reply #2 on: March 20, 2015, 05:07:19 pm »
Yep yep!  It's definitely in $C0.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

darkmoon2321

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: Geiger's SNES9X Tracing Issue?
« Reply #3 on: March 20, 2015, 05:25:18 pm »
It looks like something unusual is going on here.  I don't really have much experience with this particular game, but typically LOROM games would have their banks start with $8000, and bank $C0 is something I would expect from a HIROM game, not really a LOROM one.  I ran a trace and was able to find a piece of code above C0/8000 (C0/8785), but most of the code in the C0 block is below $8000 as you mentioned.

When I set a breakpoint for C0/9C9A, it stopped at C0/1C97 instead:

$C0/1C97 8F 52 31 00 STA $003152[$00:3152]   A:5900 X:241C Y:26B6 D:0000 DB:DD S:1FFC P:envMxdiZc HC:0726 VC:254 FC:41 I:00

This sort of makes sense, as in a LOROM game 00/0000 to 00/7FFF would be a mirror of 00/8000 to 00/FFFF.  What I don't understand is why the trace sometimes shows the program counter both above and below $8000 for a LOROM game.  It's as if Geiger's debugger is getting confused as to whether this game is LOROM or HIROM.  How did you determine the C0/9C9A address?  Did you find the code in a hex editor?  The game seems to be pretty buggy for me, I'm running v1.51ep10r1 of the debugger.

justin3009

  • Hero Member
  • *****
  • Posts: 1664
  • Welp
    • View Profile
Re: Geiger's SNES9X Tracing Issue?
« Reply #4 on: March 20, 2015, 06:16:15 pm »
Yep, I had to manually search for it in a hex editor to find it.  They weren't using the same routine as the menu code but they were using the same bank system and loading the graphics and such from the same area.  That was my first tip, when it just wouldn't read the graphics no matter what I did.  I searched for a similar bit on how it handled banks and sure enough, it was there.  Went from there and it just.. yeah.  I didn't think this could happen.

And that's what I thought too. It feels like it can't decipher if it's HiROM or LoROM.  It's really, really weird.  Even BSNES cannot break onto the code either which is worrisome.  No$SNES got it but I can't seem to figure out exactly what's going on with that debugger.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Revenant

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Geiger's SNES9X Tracing Issue?
« Reply #5 on: March 21, 2015, 02:08:40 am »
The correct address is $C01C97, not $C09C97. SA-1 games do not mirror the lower half of banks C0-FF the same way normal LoROM carts do; the "LoROM / HiROM" distinction is pretty much meaningless for SA-1 games because the SA-1 maps ROM in both 32k and 64k segments to different parts of the address space.

justin3009

  • Hero Member
  • *****
  • Posts: 1664
  • Welp
    • View Profile
Re: Geiger's SNES9X Tracing Issue?
« Reply #6 on: March 21, 2015, 09:41:09 am »
Using that address though loads the completely wrong area, which is what the big problem is.  The area that 'needs' to actually be seen can be seen in the hex editor itself, but upon tracing it's inaccessible no matter what.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Revenant

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Geiger's SNES9X Tracing Issue?
« Reply #7 on: March 21, 2015, 02:06:38 pm »
That's because Geiger's debugger is broken.

I think the only reason it won't display or break on $C01C97 is that the game is marked as being LoROM, so it completely ignores the lower half of banks $C0-FF, even though SA-1 games use a completely different address mapping.
« Last Edit: March 21, 2015, 02:14:01 pm by Revenant »

justin3009

  • Hero Member
  • *****
  • Posts: 1664
  • Welp
    • View Profile
Re: Geiger's SNES9X Tracing Issue?
« Reply #8 on: March 21, 2015, 02:22:51 pm »
That's what I thought the problem was.  bSNES can't help either and No$SNS really doesn't do me any good when I can't really 'see' what the heck is going on.  This is really, really frustrating to crack without knowing what's going on and it's absolutely necessary to allow more graphics.

Edit: Was able to figure out what was wrong with my code at least, thankfully, so this isn't so much needed anymore but it's REALLY an annoying bug regardless!
« Last Edit: March 21, 2015, 02:50:03 pm by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'