-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.c
More file actions
34 lines (26 loc) · 707 Bytes
/
hello.c
File metadata and controls
34 lines (26 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* Basic NESLib Boilerplate */
#include "neslib/neslib.h"
#include "neshelper.h"
#pragma bss-name (push,"ZEROPAGE")
#pragma data-name (push,"ZEROPAGE")
u8 oam_off;
#pragma data-name(pop)
#pragma bss-name (pop)
const u8 text[] = "Hello Boilerplate";
const u8 palette[] = { 0x02, 0x11, 0x14, 0x30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
void screenSetup(void) {
/* Turn of the screen */
ppu_off();
/* Setup the palette */
pal_bg(palette);
}
void main (void) {
/* Setup Screen */
screenSetup();
vram_adr(NTADR_A(7,14)); /* Starting point */
vram_write(text, sizeof(text)); /* Write text to the starting point */
ppu_on_all(); /* Activate PPU */
while (1) {
/* Game Loop */
}
}