Debug utilities for SNES development. More...
#include <snes/types.h>Go to the source code of this file.
Macros | |
| #define | SNES_ASSERT(cond) |
| Runtime assertion — breaks in emulator if condition is false. | |
| #define | SNES_BREAK() |
| Breakpoint — WDM $00 (luna assert channel / Mesen2 debugger halt). | |
| #define | SNES_NOCASH(msg) |
| Send a debug message to emulator console. | |
Functions | |
| void | consoleMesenBreakpoint (void) |
| Trigger an emulator breakpoint (WDM $00). | |
| void | consoleNocashMessage (const char *msg) |
| Send a debug message to the Nocash debug console. | |
Debug utilities for SNES development.
Provides breakpoints, Nocash debug messages, and runtime assertions for use with emulators (luna, Mesen2, no$sns).
Add debug to LIB_MODULES:
| #define SNES_ASSERT | ( | cond | ) |
Runtime assertion — breaks in emulator if condition is false.
When NDEBUG is defined, assertions compile to nothing. Otherwise, a failed assertion triggers a Mesen2 breakpoint.
| cond | Condition that must be true |
| #define SNES_BREAK | ( | ) |
Breakpoint — WDM $00 (luna assert channel / Mesen2 debugger halt).
| #define SNES_NOCASH | ( | msg | ) |
Send a debug message to emulator console.
| msg | Const string literal |
| void consoleMesenBreakpoint | ( | void | ) |
Trigger an emulator breakpoint (WDM $00).
Emits a WDM $00 instruction — luna captures it as an assert/WDM event (fails the test harness run); Mesen2 recognizes it as a breakpoint. (Function name kept for source compatibility.) Has no effect on real hardware (WDM is a 2-byte NOP on 65816).
| void consoleNocashMessage | ( | const char * | msg | ) |
Send a debug message to the Nocash debug console.
Writes a null-terminated string byte-by-byte to the debug register at $21FC. Visible in luna's nocash log, Mesen2's debug console and no$sns.
| msg | Null-terminated string to display |