#include <nds.h> #include "core.h" void debug_stacks(Bedrock *br) { u8 i; printf("\nP:0x%04x I:0x%02x", PC, MEM[PC]); printf("\nW:"); for (i=0; i<WST.p; i++) { printf("%02x ", WST.mem[i]); } printf("\nR:"); for (i=0; i<RST.p; i++) { printf("%02x ", RST.mem[i]); } printf("\n"); } void debug_assert(Bedrock *br) { if (WST.mem[0] == 0xff && WST.p == 1 && RST.p == 0) { printf("."); } else { printf("X"); } }