Skip to content
Chris Sawczuk edited this page Apr 9, 2017 · 7 revisions

The console allows you to perform simple operations that may affect the currently running game.

Available console commands

poke [address] [value]

To overwrite a value in memory, the poke command can be used to write 8bit, 16bit and 32bit values (24bit values coming soon!)

Example

To write 128 to address 0x1234:

poke 0x1234 128

This also works with hexvalues:

poke 0x1234 0x80

peek [address]

To read a value in memory, the peek command can be used.

Example

To read a value at address 0x1234:

peek 0x1234
0x1234: 16 (0x10)

scan [value]

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.

Example

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.


clear_scan

As the scan command is stateful, it can be useful to reset that state. The clear_scan command will do this.

Example

> clear_scan
Cleared previous search results

scan_threshold [new-threshold]

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.

Example

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

Save the current state of the emulator to load later with load.

Example

The save command takes no parameters:

>save

load

Load a previously saved state of the emulator, created with the save command.

Example

The load command takes no parameters:

>load

load_script [script file]

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.

Example

Given a script file called script.wren and script.lua

>load_script script.wren

Or

>load_script script.lua

unload_script [script name]

Unloads a previously loaded script, loaded using the load_script command.

Example

Given a script was loaded named script.wren:

>unload_script script.wren

quit

Exit the emulator immediately

Example

Fairly simple:

>quit