Console

From VO-EM Wiki
Jump to: navigation, search

The console exposes features of the VO-EM device that are useful for debugging your programs and understanding how the device works. You can access the console output viewer page while a ROM is loaded using the ` key. You can input console commands at any time, however it is not recommended that you input console commands before loading a ROM.

List of Commands

All supported commands are recorded in this section. You may, through shenanigans, find some other commands that are unlisted but understood by the console. Use any such commands at your own risk, as they are not intended for the end user.

add_breakpoint

Syntax:

add_breakpoint [hex address] 

Adds a breakpoint at the specified address. If breakpoints are enabled, the debug player will pause execution whenever the PC is equal to the breakpoint +4. The reason it is +4 is because the PC will always be pointing at the next address to be executed.

Breakpoints allow you to pause execution at points of interest, rather than having to manually step through your program all the way to your chosen point.

It may be useful to use a -l command when assembling your program with dasm in order to determine where breakpoints should be placed.

breakpoints

Syntax:

Breakpoints [option]

Available options:

on     - enables breakpoints
off    - disables breakpoints
list   - lists all currently set breakpoints

help

Syntax:

help [command name (optional)]

Typing help by itself will provide you with a list of all available commands.

Typing help following by the name of a command will display the notes and usage instructions of that command.

pause

Syntax:

pause

The same as clicking the | | button. Pauses execution.

peek

Syntax:

peek [hex address]

Reads a 1-byte value at the given address. Not terribly useful, since it's more efficient to just use the Memory status page.

poke

Syntax:

poke [target hex address] [1-byte hex values]

Writes all given values sequentially starting from the target address. For example, "poke 8000 01 02 03 04" will write "01 02 03 04" to the four bytes starting from 0x8000. Poking read only addresses may cause your execution to crash. For example, if you try to alter a value in cartridge ROM, you may find yourself instead switching cartridge ROM banks unexpectedly.

You can poke addresses more conveniently by clicking the value you wish to alter in the Memory status page.

Poke performs essentially the same functionality as a gameshark or other runtime hex editor. You can use it to perform minor changes to your game on the fly - for example, try poking new colours into palette memory to test different colours on your graphics.

remove_breakpoint

Syntax:

remove_breakpoint [hex address]

Clears a breakpoint at the given address if one was set.

save_log

Syntax:

save_log [filename]

Saves a plain-text (.txt) record of all console input and output from this session.

set_register

Syntax:

set_register [register number] [value in hex]

Sets the indicated register to the supplied value. Doesn't work on r0. Takes place immediately.