Skip to content

Instantly share code, notes, and snippets.

@lifehackerhansol
Last active October 1, 2024 09:53
Show Gist options
  • Save lifehackerhansol/71e714574171919986e8a202183146b6 to your computer and use it in GitHub Desktop.
Save lifehackerhansol/71e714574171919986e8a202183146b6 to your computer and use it in GitHub Desktop.
nocash debug register test application
// replace devkitPro/nds-examples/templates/arm9/source/main.c with this file
#include <nds.h>
#include <stdio.h>
#ifdef USE_CHAR_DEBUG
#define REG_NOCASH_DEBUG_CHAR (*(vu32*)0x04FFFA1C)
void nocashMessageByRegister(const char* str)
{
char c;
while ((c = *str++) != 0)
{
REG_NOCASH_DEBUG_CHAR = c;
}
}
#else // USE_CHAR_DEBUG
#define REG_NOCASH_DEBUG_STRING (*(vu32*)0x04FFFA10)
void nocashMessageByRegister(const char* str)
{
REG_NOCASH_DEBUG_STRING = (u32)str;
}
#endif // USE_CHAR_DEBUG
int main(void) {
consoleDemoInit();
nocashMessageByRegister("Hello world from no$gba\n");
iprintf("Hello world from no$gba\n");
while(1) swiWaitForVBlank();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment