From 8535023423b9b21e362424820bb8564ff48e398e Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Tue, 13 Apr 2021 17:43:15 +0200 Subject: Initial program example Blit 3 pixels to the screen. source: https://www.coranac.com/tonc/text/first.htm --- src/main.c | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 64f6234..655373b 100644 --- a/src/main.c +++ b/src/main.c @@ -1,33 +1,12 @@ -#include -#include -#include -#include -#include -#include -#include +int main() +{ + *(unsigned int*)0x04000000 = 0x0403; -//--------------------------------------------------------------------------------- -// Program entry point -//--------------------------------------------------------------------------------- -int main(void) { -//--------------------------------------------------------------------------------- + ((unsigned short*)0x06000000)[120+80*240] = 0x001F; + ((unsigned short*)0x06000000)[136+80*240] = 0x03E0; + ((unsigned short*)0x06000000)[120+96*240] = 0x7C00; + while(1); - // the vblank interrupt must be enabled for VBlankIntrWait() to work - // since the default dispatcher handles the bios flags no vblank handler - // is required - irqInit(); - irqEnable(IRQ_VBLANK); - - consoleDemoInit(); - - // ansi escape sequence to set print co-ordinates - // /x1b[line;columnH - iprintf("\x1b[10;10HHello World!\n"); - - while (1) { - VBlankIntrWait(); - } + return 0; } - - -- cgit v1.2.1