libc8
CHIP-8 utility library
|
#include "../chip8.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_QUIT 1 |
#define | DEBUG_CONTINUE 2 |
#define | DEBUG_STEP 3 |
#define | DEBUG_HELP_STRING "Available commands:\n\break [ADDRESS]: Add breakpoint to PC or ADDRESS, if given\n\rmbreak [ADDRESS]: Remove breakpoint at PC or ADDRESS, if given\n\continue: Exit debug mode until next breakpoint or completion\n\help: Print this help string\n\load PATH: Load program state from PATH\n\next: Step to the next instruction\n\print [ATTRIBUTE]: Print current value of ATTRIBUTE\n\save PATH: Save program state to the given file\n\set ATTRIBUTE VALUE: Set the given attribute to the given value\n\quit: Terminate the program\n\\n\Available attributes to print:\n\PC: Program counter\n\SP: Stack pointer\n\DT: Delay timer\n\ST: Sound timer\n\I: I address\n\K: Register to store next keypress\n\V[x]: All register values or value of Vx, if given\n\stack: All stack values\n\$[address]: Value at given address\n\\n\If no argument is given to print, it will print all of the above attributes\n\except for address values.\n" |
Functions | |
int | debug_repl (c8_t *) |
Debug command line loop. More... | |
int | has_breakpoint (c8_t *, uint16_t) |
Check if breakpoint exists at address pc. More... | |
Stuff related to debug mode.
#define DEBUG_CONTINUE 2 |
#define DEBUG_HELP_STRING "Available commands:\n\break [ADDRESS]: Add breakpoint to PC or ADDRESS, if given\n\rmbreak [ADDRESS]: Remove breakpoint at PC or ADDRESS, if given\n\continue: Exit debug mode until next breakpoint or completion\n\help: Print this help string\n\load PATH: Load program state from PATH\n\next: Step to the next instruction\n\print [ATTRIBUTE]: Print current value of ATTRIBUTE\n\save PATH: Save program state to the given file\n\set ATTRIBUTE VALUE: Set the given attribute to the given value\n\quit: Terminate the program\n\\n\Available attributes to print:\n\PC: Program counter\n\SP: Stack pointer\n\DT: Delay timer\n\ST: Sound timer\n\I: I address\n\K: Register to store next keypress\n\V[x]: All register values or value of Vx, if given\n\stack: All stack values\n\$[address]: Value at given address\n\\n\If no argument is given to print, it will print all of the above attributes\n\except for address values.\n" |
#define DEBUG_QUIT 1 |
#define DEBUG_STEP 3 |
int debug_repl | ( | c8_t * | c8 | ) |
Debug command line loop.
This function parses user commands from stdin and prints the result until one of the following conditions is met:
DEBUG_CONTINUE
)DEBUG_QUIT
)DEBUG_STEP
)c8 | the current CHIP-8 state |
DEBUG_CONTINUE
, DEBUG_STEP
, or DEBUG_QUIT