Recently, I have started using a debugger to better understand the runtime behaviour of Snowboard Kids 2. Debuggers are useful not only for tracking down crashes, but also for validating assumptions: when a function is called, what its inputs look like, and what effect it has on the game鈥檚 state. For example, if we suspect that a particular function loads character data, we can set a breakpoint and observe whether it fires during the character selection screen. We can then inspect its inputs and begin forming theories about how characters map to variables and data structures in the code.All of this is incredibly helpful, and in hindsight I probably should have started doing it much sooner. There was, however, a fair amount of friction getting started. Debugging an N64 game is not hard, exactly, but it鈥檚 very different from using a debugger in a typical Java, Go, or even modern C++ project. Documentation (especially around using a debugger with an emulator) is surprisingly thin.Since it鈥檚 Christmas, I thought I would write down what I have learned so far and apply it to a concrete, seasonally-appropriate problem. In particular, this post uses a debugger-driven workflow to answer a specific question: how does Snowboard Kids 2 decide which level overlay to load, and how does that process select Jingle Town?The ProblemDebuggers are powerful tools, and (when they work) can feel almost magical. When we step through code in a debugger, we are not directly stepping through what the CPU executes. CPUs operate on low-level instructions such as jal, addiu, and lw, not on C statements like i++. Similarly, the variables we inspect do not truly have names; they are simply addresses in memory. A simple assignment like i = 0 might compile to something like sw zero, 0x18(sp), which stores a 32-bit value at an offset from the stack pointer.Debuggers bridge this gap by relying on metadata embedded in the binary. This metadata maps machine instructions and memory locations back to sour...
First seen: 2025-12-29 03:59
Last seen: 2025-12-29 12:00