Find unexecuted code in a NES game
Given a build of a NES game with a labels text file (from ld65) and a CDL output file (from FCEUX or MESEN), this script will find ROM addresses that were not accessed.
nes_unexecuted.py labels.txt file.cdl [show-addr]
where:
labels.txt
is the labels file output from ld65 (use the-Ln
option)file.cdl
is a Code Data Logger file generated with FCEUX or MESENshow-addr
is an optional parameter that tells the script to output specific byte addresses as well as labels.
The output of the tool will show the labels (and optionally specific addresses) where at least one byte was not accessed while the CDL file was logged.
Here's how to use FCEUX to generate the CDL file needed for this tool:
- Open FCEUX and load the NES game
- Debug > Code/Data Logger...
- Code Data Logger window > Reset Log
- Code Data Logger window > Start
- Play the game, covering all relevant scenarios
- Code Data Logger window > Pause
- Code Data Logger window > Save
Here's how to use MESEN to generate the CDL file needed for this tool:
- Open MESEN and load the NES game
- Debug > Debugger
- Debugger > Tools > Code/Data Logger > Reset Log
- Play the game, covering all relevant scenarios
- Debugger > Tools > Code/Data Logger > Save as CDL file...
Thanks to everyone on this NESDev forum post who pointed me in the right direction!
- Matthew Justice matthewjustice
This project is licensed under the MIT License - see the LICENSE file for details