-
Notifications
You must be signed in to change notification settings - Fork 0
Console
The console allows you to perform simple operations that may affect the currently running game.
To overwrite a value in memory, the poke
command can be used to write 8bit, 16bit and 32bit values (24bit values coming soon!)
To write 128 to address 0x1234
:
poke 0x1234 128
This also works with hexvalues:
poke 0x1234 0x80
To read a value in memory, the peek
command can be used.
To read a value at address 0x1234
:
peek 0x1234
0x1234: 16 (0x10)
To find a particular value in memory, the scan command can be used. The scan command is stateful and will only show you results that are in a previous result set.
Given a player currently has 5 lives and we want to override that value, we will first start by scanning for 5:
> scan 5
Found 1234 results
1234 possible results makes it difficult to determine which value is the lives count, so, by altering the live count (by losing a life) we can scan one more time:
> scan 4
Found 32 results
The last scan will only check within the previous result set of 1234 addresses. Losing one more life should bring us really close to finding the address now:
> scan 3
Found 3 results
0xf7a
0x10b
0x12ab
One of these addresses should be the live counter. We can figure out which one is the live counter using the poke command and manually changing the values.
As the scan
command is stateful, it can be useful to reset that state. The clear_scan
command will do this.
> clear_scan
Cleared previous search results
Sometimes, 3 results is too few to be able to get results for a scan
. The threshold for printing results can be changed by using the scan_threshold
command.
Following a previous scan returns 7 results:
> scan 10
Found 8 results
> scan_threshold 8
> scan 10
Found 8 results
0x....
0x....
0x....
etc.
Save the current state of the emulator to load later with load
.
The save command takes no parameters:
>save
Load a previously saved state of the emulator, created with the save
command.
The load command takes no parameters:
>load
Load a script file that may augment the current game.
It is possible to load a Lua script or a Wren script. Loading the same script will reload it, effectively unloading and loading the script.
See the Script API Documentation for examples of how to write a script.
Given a script file called script.wren
and script.lua
>load_script script.wren
Or
>load_script script.lua
Unloads a previously loaded script, loaded using the load_script
command.
Given a script was loaded named script.wren
:
>unload_script script.wren
Exit the emulator immediately
Fairly simple:
>quit