functions.md

March 21, 2023 ยท View on GitHub

These are the most useful functions:

Exec: Abbreviation used in exec files

C++: name of the function in C++

Addr./Val.: Address in ROM (OS version 2.1.2) (or value if it is not a function)

ExecC++Addr./Val.Explanation
#Cvoid LCD_ClearScreen();0x800394C0Clears the VRAM
#Rvoid LCD_Refresh();0x8003733ECopys VRAM content to the screen
uint16_t *LCD_GetVRAMAddress();0x8002E154Function, that returns the VRAM address
#V0x8C000000The actual VRAM address (in OS version 2.1.2)
void LCD_GetSize(int *width, int *height);0x8002E140Stores the size of the screen in the variables pointed to
#X320The actual width of the screen
#Y528The actual height of the screen
#Sint Debug_SetCursorPosition(int x, int y);0x8002E430Sets the cursor for PrintString
#Gvoid Debug_GetCursorPosition(int *x, int *y);0x8002E448Gets the cursor position
#Wint Debug_WaitKey();0x80094380Waits until clear is pressed (some other keys also work)
#PSbool Debug_PrintString(const char *string, bool invert);0x8002DA0CPrints the string at the cursor position
#PNvoid Debug_PrintNumberHex_Nibble(uint8_t value, int x, int y);0x80094466prints a hex nibble
#PBvoid Debug_PrintNumberHex_Byte(uint8_t value, int x, int y);0x800944A0prints a hex byte
#PWvoid Debug_PrintNumberHex_Word(uint16_t value, int x, int y);0x800944C8prints a hex word
#PL / #PDvoid Debug_PrintNumberHex_Dword(uint32_t value, int x, int y);0x80094514prints a hex long/dword
#PFvoid Debug_Printf(int x, int y, bool invert, int zero, const char *format, ...);0x8002DBC8prints the format string
void LCD_VRAMBackup();0x8002D3FABacks up the VRAM
void LCD_VRAMRestore();0x8002D41ARestores the VRAM

You can find all functions in the .hpp files in /sdk/include/. Their adresses are in /sdk/os/