From a1b95e9ccf9bd7b316adf21952e43e03f2bf3746 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Tue, 19 Nov 2024 17:52:36 +1300 Subject: Implement memory device The memory device is fully implemented, with 3MB of heap memory. This commit is a bit messy, additional changes are: - The program memory and program counter in each Bedrock struct have been moved to a dedicated struct to prevent a name collision with the memory device - The run_bg and debug functions have been moved to core.c and debug.c - The blank screen colour has been changed back to black - No second program runs on the sub screen by default - The number of Bedrock instances to run has been parameterized --- arm9/source/debug.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 arm9/source/debug.c (limited to 'arm9/source/debug.c') diff --git a/arm9/source/debug.c b/arm9/source/debug.c new file mode 100644 index 0000000..eae5192 --- /dev/null +++ b/arm9/source/debug.c @@ -0,0 +1,24 @@ +#include +#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