Last active
October 1, 2024 09:53
-
-
Save lifehackerhansol/71e714574171919986e8a202183146b6 to your computer and use it in GitHub Desktop.
nocash debug register test application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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