libdragon
|
RSP ucode definition. More...
#include <rsp.h>
Data Fields | |
uint8_t * | code |
Pointer to the code segment. | |
void * | code_end |
Pointer past the end of the code segment. | |
uint8_t * | data |
Pointer to the data segment. | |
void * | data_end |
Pointer past the end of the data segment. | |
const char * | name |
Name of the ucode. | |
uint32_t | start_pc |
Initial RSP PC. | |
void(* | crash_handler )(rsp_snapshot_t *state) |
Custom crash handler. | |
void(* | assert_handler )(rsp_snapshot_t *state, uint16_t assert_code) |
Custom assert handler. | |
RSP ucode definition.
This small structure holds the text/data pointers to a RSP ucode program in RDRAM. It also contains the name (for the debugging purposes) and the initial PC (usually 0).
If you're using libdragon's build system (n64.mk), use DEFINE_RSP_UCODE() to initialize one of these.
void(* rsp_ucode_t::crash_handler) (rsp_snapshot_t *state) |
Custom crash handler.
If specified, this function is invoked when a RSP crash happens, while filling the information screen. It can be used to dump custom ucode-specific information.
void(* rsp_ucode_t::assert_handler) (rsp_snapshot_t *state, uint16_t assert_code) |
Custom assert handler.
If specified, this function is invoked when a RSP crash caused by an assert is triggered. This function should display information related to the assert using printf
(max 2 lines).
Normally, the first line will be the assert message associated with the code (eg: "Invalid buffer pointer"), while the optional second line can contain a dump of a few important variables, maybe extracted from the register state (eg: "bufptr=0x00000000 prevptr=0x8003F780"). The assert handler will now which registers to inspect to extract information, given the exact position of the assert in the code.