libc8
CHIP-8 utility library
|
#include "debug.h"
#include "../chip8.h"
#include "..//font.h"
#include "..//decode.h"
#include "exception.h"
#include "util.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Data Structures | |
union | ArgValue |
Stores an argument's value (string or int) More... | |
struct | arg_t |
Represents an argument for a command with a type and value. More... | |
struct | cmd_t |
Represents a command with an ID, argument ID, and associated argument. More... | |
Enumerations | |
enum | Command { CMD_NONE = -1 , CMD_ADD_BREAKPOINT = 0 , CMD_RM_BREAKPOINT , CMD_CONTINUE , CMD_NEXT , CMD_SET , CMD_LOAD , CMD_SAVE , CMD_PRINT , CMD_HELP , CMD_QUIT , CMD_LOADFLAGS , CMD_SAVEFLAGS } |
Represents command types. More... | |
enum | Argument { ARG_NONE = -1 , ARG_SP = 0 , ARG_DT , ARG_ST , ARG_PC , ARG_I , ARG_VK , ARG_STACK , ARG_BG , ARG_FG , ARG_SFONT , ARG_BFONT , ARG_QUIRKS , ARG_V , ARG_R , ARG_ADDR , ARG_FILE } |
Represents argument types. More... | |
Functions | |
int | debug_repl (c8_t *c8) |
Debug command line loop. More... | |
int | has_breakpoint (c8_t *c8, uint16_t pc) |
Check if breakpoint exists at address pc. More... | |
Variables | |
const char * | args [] |
const char * | cmds [] |
Stuff related to debug mode.
enum Argument |
enum Command |
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
int has_breakpoint | ( | c8_t * | c8, |
uint16_t | pc | ||
) |
Check if breakpoint exists at address pc.
c8 | c8_t to check breakpoints of |
pc | address to check for breakpoint at |
const char* args[] |
These are string values of all possible argument, ordered to match the Argument enumerator.
const char* cmds[] |
These are string values of all possible commands, ordered to match the Command enumerator.