Jump to content
NHL'94 Forums

How to: NHL 94' [SNES] ROM / RAM Hacking School - Trace Logging


McMarkis

Recommended Posts

Trace Logging


In this tutorial we will be taking the RAM values we found in the finding RAM values tutorial , and tracing where the code in the ROM, is writing to that RAM value. Confused?
Basically we are tracing whenever the Away teams goalie (CPU) is being pulled because of a powerplay, or in the 3rd period when the CPU is losing by 1 or 2 goals.

Setup emulator and launch the game:


  • This builds on the first tutorial, so I assume you already have the MESEN2 emulator installed and know how to launch the rom.
  • Get the game to a position where you are winning by 1 or 2 goals in the third period with close to 1:20 minutes left. Then make a save state and pause the game.
  • File ==>Save State ==>Select an empty slot

image.png

Launch the Trace Logger:


Now were going to add a trace condition to Log writes for the Away Goalies Ram Address $17AC

  • Click Debug ==> Trace Logger

image.png

image.png

This looks confusing, but the only thing you really need to understand here is the trace condition.

  • #1 in the screen shot (Condtion) needs to copied from here and pasted in. IsWrite && MemAddress >= $017AC && MemAddress  <=$017AD
    • What this is doing is anytime a write (IsWrite) is happening to RAM (MemAddress) greater than or equal to (>=) $017AC and (&&) less than (<=) $017AD; log it to the trace window. $017AC + $017AB contains the Away teams goalie.
  • #2 in the screen shot (Clear log) needs to be pressed to clear the log before you start the game again.
  • #3 allows you to save the log file to your computer if you want. (Not required for this example)

Now we are going to play the game again and make sure the CPU has the puck and is over the center ice line with less than 1 minute left. This will cause the CPU to pull its goalie and we should see a trace in the log appear.

image.png

If everything goes according to plan, you should see some traces show in the Trace log window when the goalie gets pulled.

  • #1 in the screen shot is the RAM value for the away goalie we were talking about $17AC
  • #2 in the screen shot is the new value it was set to FF 00; this means Pulled goalie in the game.
  • #3 in the screen shot is the location in the ROM .sfc file that code executed to set the RAM value.
    • This one is a little tricker to understand. We can now look at the decompiled rom and see exactly what game code was running that sets this value. We will cover this in a more advanced topic.
      image.png

Homework:


  • You now have the general knowledge to find RAM values in the emulator and then trace them to find the exact location in the ROM where that logic is.
  • Use what you have learned to try and find other RAM values that you may be interested in. Maybe try and find the game clock ticking down in RAM.
  • If this didn't work for you, just restore the save state and try again.
Edited by McMarkis
  • Love 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...