1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-02 04:49:44 +00:00
8bitworkshop/presets/nes/skeleton.cc65

60 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-02-14 03:21:24 +00:00
#include <stdlib.h>
#include <string.h>
2019-06-03 14:08:29 +00:00
#include <stdlib.h>
#include <string.h>
// include NESLIB header
2019-02-14 03:21:24 +00:00
#include "neslib.h"
2019-06-03 14:08:29 +00:00
// include CC65 NES Header (PPU)
#include <nes.h>
// link the pattern table into CHR ROM
//#link "chr_generic.s"
2019-02-14 03:21:24 +00:00
2019-06-03 14:08:29 +00:00
// BCD arithmetic support
#include "bcd.h"
//#link "bcd.c"
// VRAM update buffer
#include "vrambuf.h"
//#link "vrambuf.c"
/*{pal:"nes",layout:"nes"}*/
const char PALETTE[32] = {
0x03, // screen color
0x11,0x30,0x27,0x0, // background palette 0
0x1c,0x20,0x2c,0x0, // background palette 1
0x00,0x10,0x20,0x0, // background palette 2
0x06,0x16,0x26,0x0, // background palette 3
0x16,0x35,0x24,0x0, // sprite palette 0
0x00,0x37,0x25,0x0, // sprite palette 1
0x0d,0x2d,0x3a,0x0, // sprite palette 2
0x0d,0x27,0x2a // sprite palette 3
};
// setup PPU and tables
void setup_graphics() {
// clear sprites
oam_clear();
// set palette colors
pal_all(PALETTE);
}
2019-02-14 03:21:24 +00:00
void main(void)
{
setup_graphics();
// draw message
2019-02-14 03:21:24 +00:00
vram_adr(NTADR_A(2,2));
vram_write("HELLO, WORLD!", 12);
// enable rendering
ppu_on_all();
// infinite loop
while(1) {
}
2019-02-14 03:21:24 +00:00
}