Author Topic: GE debugging / general speed science / hype  (Read 687 times)

Whiteted

  • Posts: 745
  • Frig 21 or bust
    • GE
    • PD
    • twitch
    • 2018SilverStar
    • 2020SilverStar
    • 2021CommunityContributor
GE debugging / general speed science / hype
« on: July 08, 2018, 07:02:08 pm »
I've been putting a serious amount of time into hunting memory addresses and making lua scripts in Bizhawk to try to understand GE but just recently I've found myself staring hopelessly at graphs of values / time trying to guess how they are produced. So I figured it's time to start poking around actual code, and looked for a debugger.

From what I can gather:
  • Bizhawk's doesn't work for N64
  • Nemu64 is ancient
  • That's it?

Crucially I need to be able to set breakpoints on access to a certain memory address or something similar, so that I can step from what I know about memory to find the bit of code that I'm interested in.

Does anyone have experience with this?

Also RE:hype even without debugging I think my efforts may finally be about to pay off (somewhat off-schedule) so watch this space
Ex Runway 21 consultant
TASpap chief scientist
Positionally top of Yendis' top GE players of 2020 :nesquik:
Noticably absent from Yendis' top GE players of 2021

Wyst3r

  • Posts: 4374
  • Train Strat Master
    • Henrik
    • GE
    • PD
    • twitch
    • 2018SilverStar
Re: GE debugging / general speed science / hype
« Reply #1 on: July 09, 2018, 12:36:29 am »
Been doing alot of this over the years. My best resources/tools thus far:

1. N64 Analyzer - A tool I made myself which is built on top of Mupen64Plus. You enter an address and then the analyzer logs all instructions in one frame, until that address is written. It knows MIPS IV assembly well enough to trace back all instructions involved in calculating the final value. Those instructions are then shown and can be debugged with breakpoints etc...

It’s extremely useful for tracing floating point instructions, which always goes through alot of temporary addresses, making them super tedious to debug with normal tools.

2. Modified Bizhawk - A few years ago I commited some improvements to the BizHawk N64 debugger, making it much faster to use breakpoints. The remaining issue though is that BizHawk is not built to handle mid-frame pausing, making debugging/stepping impossible. Nevertheless, while working on my commit, I did implement and build a custom version of BizHawk with a working debugger, even though it’s a bit hackish and doesn’t support all BizHawk features. Lua scripts don`t work well with it for example.

I still use Nemu sometimes though.

3. Source code online with labels/documentation - The hacking community and others have uploaded text files of the source code, divided into subroutines with labels and documentation of what it does and which parameters it takes. Very incomplete of course but still very useful and interesting.

I will add some links later when I have access to my desktop.

Whiteted

  • Posts: 745
  • Frig 21 or bust
    • GE
    • PD
    • twitch
    • 2018SilverStar
    • 2020SilverStar
    • 2021CommunityContributor
Re: GE debugging / general speed science / hype
« Reply #2 on: July 09, 2018, 07:24:10 am »
Thanks, these all sounds like great tools :grinning:

Quote
A few years ago I commited some improvements to the BizHawk N64 debugger, making it much faster to use breakpoints

Does that mean that the standard Bizhawk does hit breakpoints? Because I couldn't get it to hit a barn door.
Ex Runway 21 consultant
TASpap chief scientist
Positionally top of Yendis' top GE players of 2020 :nesquik:
Noticably absent from Yendis' top GE players of 2021

Wyst3r

  • Posts: 4374
  • Train Strat Master
    • Henrik
    • GE
    • PD
    • twitch
    • 2018SilverStar
Re: GE debugging / general speed science / hype
« Reply #3 on: July 09, 2018, 08:55:05 am »
N64 Analyzer: https://bitbucket.org/Wyst3r/n64analyzer/ - It's written in the ugliest/hastiest way possible, in pure Win32 and with pretty much all code located in the mupen64plus-console-ui main.c file.
Modded Bizhawk (1.11.7): https://www.dropbox.com/s/j8spnxm516h6hr8/BizHawk%201.11.7%20-%20Native%20N64%20Debugger.zip?dl=0

https://gitlab.com/kholdfuzion/Gold007
http://fgfc.ddns.net/PerfectGold/ZoinkDocs/
https://bitbucket.org/mbr/n64libfuncs/wiki/GoldenEye%20007%20(U)%20

Quote
Does that mean that the standard Bizhawk does hit breakpoints? Because I couldn't get it to hit a barn door.

Yeah, I just tested with the latest 2.3 and it works (make sure you type the full address with 0x800 in front). It doesn't actually break at the instruction though, but rather it keeps going until the frame is complete.