summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-04-13 17:34:33 +0200
committerBad Diode <bd@badd10de.dev>2021-04-13 17:34:33 +0200
commit2809b83ee4d0fde8ebb406d4cdd39d142840254c (patch)
tree10d24f2b7ec1cbc6ef25a0c6b2760892602e0b69 /src/main.c
downloadgba-experiments-2809b83ee4d0fde8ebb406d4cdd39d142840254c.tar.gz
gba-experiments-2809b83ee4d0fde8ebb406d4cdd39d142840254c.zip
Initial commit of gba template compilation with custom Makefile
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..64f6234
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,33 @@
1#include <gba_console.h>
2#include <gba_video.h>
3#include <gba_interrupt.h>
4#include <gba_systemcalls.h>
5#include <gba_input.h>
6#include <stdio.h>
7#include <stdlib.h>
8
9//---------------------------------------------------------------------------------
10// Program entry point
11//---------------------------------------------------------------------------------
12int main(void) {
13//---------------------------------------------------------------------------------
14
15
16 // the vblank interrupt must be enabled for VBlankIntrWait() to work
17 // since the default dispatcher handles the bios flags no vblank handler
18 // is required
19 irqInit();
20 irqEnable(IRQ_VBLANK);
21
22 consoleDemoInit();
23
24 // ansi escape sequence to set print co-ordinates
25 // /x1b[line;columnH
26 iprintf("\x1b[10;10HHello World!\n");
27
28 while (1) {
29 VBlankIntrWait();
30 }
31}
32
33