1
Terminal Support
Simon Gellis edited this page 2025-12-11 17:59:12 +00:00
Lemur has a built-in terminal for debugging. Games can write arbitrary text to it, by writing one byte at a time to address 0x02000030. This address does nothing on hardware, but writing messages still takes precious CPU time, so be sure not to leave any log lines around in your final game.
The terminal is available in the menu under Tools > Terminal. You can also pass the flag --terminal to the emulator to open it at startup.
Below are some utility methods.
volatile unsigned char* const STDOUT = (unsigned char*) 0x02000030;
int putchar(int ch) {
*STDOUT = ch;
return ch;
}
int puts(const char *str) {
while (*str != 0) {
*STDOUT = *str;
str++;
}
*STDOUT = '\n';
return 0;
}