Skip to content

Instantly share code, notes, and snippets.

@konsumer
Created January 20, 2013 10:37
Show Gist options
  • Save konsumer/4577804 to your computer and use it in GitHub Desktop.
Save konsumer/4577804 to your computer and use it in GitHub Desktop.
Basic setup for C-based Gameboy rom with splash screen.
GBDK = /opt/gbdk
CC = ${GBDK}/bin/lcc -Wa-l -Wl-m -Wl-j
RGB = /opt/rgbds/rgbfix
BINS = mygame.gb
all: $(BINS)
%.o: %.c
$(CC) -c -o $@ $<
%.s: %.c
$(CC) -S -o $@ $<
%.o: %.s
$(CC) -c -o $@ $<
%.gb: %.o
$(CC) -o $@ $<
%.gbc: %.o
$(CC) -o $@ $< && ${RGB} -vcs -l 0x33 -p 0 $@
clean:
rm -f *.o *.lst *.map *.gb *.gbc *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm
#include <gb/gb.h>
#include <stdio.h>
#include "logo_tile.c"
#include "logo_map.c"
void main() {
// load logo
set_bkg_data(0,255, tiledata);
VBK_REG = 1;
VBK_REG = 0;
set_bkg_tiles(0,0,20,18, tilemap);
SHOW_BKG;
DISPLAY_ON;
waitpad(J_START);
printf(" \n\n\n\n\n\n\n\nYour game goes here.\n");
waitpad(J_START);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment