Last active
January 8, 2022 17:27
-
-
Save mkiisoft/11012059e958b33b175cb2ae757d54b1 to your computer and use it in GitHub Desktop.
Game Boy Color Flutter ROM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ROM: https://s3-us-west-2.amazonaws.com/s.cdpn.io/2399829/flutter.gb | |
*/ | |
/* | |
LOGO.H | |
Include File. | |
Info: | |
Form : All tiles as one unit. | |
Format : Gameboy 4 color. | |
Compression : None. | |
Counter : None. | |
Tile size : 8 x 16 | |
Tiles : 0 to 23 | |
Palette colors : Included. | |
SGB Palette : None. | |
CGB Palette : 1 Byte per entry. | |
Convert to metatiles : No. | |
This file was generated by GBTD v2.2 | |
*/ | |
/* Bank of tiles. */ | |
#define LogoBank 0 | |
/* Super Gameboy palette 0 */ | |
#define LogoSGBPal0c0 6076 | |
#define LogoSGBPal0c1 8935 | |
#define LogoSGBPal0c2 6596 | |
#define LogoSGBPal0c3 5344 | |
/* Super Gameboy palette 1 */ | |
#define LogoSGBPal1c0 6076 | |
#define LogoSGBPal1c1 8935 | |
#define LogoSGBPal1c2 6596 | |
#define LogoSGBPal1c3 5344 | |
/* Super Gameboy palette 2 */ | |
#define LogoSGBPal2c0 6076 | |
#define LogoSGBPal2c1 8935 | |
#define LogoSGBPal2c2 6596 | |
#define LogoSGBPal2c3 5344 | |
/* Super Gameboy palette 3 */ | |
#define LogoSGBPal3c0 6076 | |
#define LogoSGBPal3c1 8935 | |
#define LogoSGBPal3c2 6596 | |
#define LogoSGBPal3c3 5344 | |
/* Gameboy Color palette 0 */ | |
#define LogoCGBPal0c0 32767 | |
#define LogoCGBPal0c1 32233 | |
#define LogoCGBPal0c2 31376 | |
#define LogoCGBPal0c3 28992 | |
/* Gameboy Color palette 1 */ | |
#define LogoCGBPal1c0 31614 | |
#define LogoCGBPal1c1 32767 | |
#define LogoCGBPal1c2 31450 | |
#define LogoCGBPal1c3 32767 | |
/* Gameboy Color palette 2 */ | |
#define LogoCGBPal2c0 32767 | |
#define LogoCGBPal2c1 15855 | |
#define LogoCGBPal2c2 15855 | |
#define LogoCGBPal2c3 15855 | |
/* Gameboy Color palette 3 */ | |
#define LogoCGBPal3c0 32767 | |
#define LogoCGBPal3c1 21140 | |
#define LogoCGBPal3c2 21140 | |
#define LogoCGBPal3c3 21140 | |
/* Gameboy Color palette 4 */ | |
#define LogoCGBPal4c0 32767 | |
#define LogoCGBPal4c1 26425 | |
#define LogoCGBPal4c2 26425 | |
#define LogoCGBPal4c3 26425 | |
/* Gameboy Color palette 5 */ | |
#define LogoCGBPal5c0 32767 | |
#define LogoCGBPal5c1 32767 | |
#define LogoCGBPal5c2 32767 | |
#define LogoCGBPal5c3 32767 | |
/* Gameboy Color palette 6 */ | |
#define LogoCGBPal6c0 6076 | |
#define LogoCGBPal6c1 8935 | |
#define LogoCGBPal6c2 6596 | |
#define LogoCGBPal6c3 5344 | |
/* Gameboy Color palette 7 */ | |
#define LogoCGBPal7c0 6076 | |
#define LogoCGBPal7c1 8935 | |
#define LogoCGBPal7c2 6596 | |
#define LogoCGBPal7c3 5344 | |
extern unsigned char BgColor[]; | |
/* CGBpalette entries. */ | |
extern unsigned char LogoCGB[]; | |
/* Start of tile array. */ | |
extern unsigned char Logo[]; | |
/* End of LOGO.H */ | |
/* | |
LOGO.C | |
Tile Source File. | |
Info: | |
Form : All tiles as one unit. | |
Format : Gameboy 4 color. | |
Compression : None. | |
Counter : None. | |
Tile size : 8 x 16 | |
Tiles : 0 to 23 | |
Palette colors : Included. | |
SGB Palette : None. | |
CGB Palette : 1 Byte per entry. | |
Convert to metatiles : No. | |
This file was generated by GBTD v2.2 | |
*/ | |
unsigned char BgColor[] = { | |
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | |
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF | |
}; | |
/* CGBpalette entries. */ | |
unsigned char LogoCGB[] = | |
{ | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 | |
}; | |
/* Start of tile array. */ | |
unsigned char Logo[] = | |
{ | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x07, | |
0x00,0x0F,0x00,0x1F,0x00,0x3F,0x00,0x7F, | |
0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x07, | |
0x00,0x0F,0x00,0x1F,0x00,0x3F,0x00,0x7F, | |
0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFE, | |
0x00,0xFC,0x00,0xF8,0x00,0xF0,0x00,0xE0, | |
0x00,0x3F,0x00,0x1F,0x00,0x0F,0x00,0x06, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0xC1,0x02,0x81,0x07,0x00,0x0F,0x00, | |
0x1F,0x00,0x3F,0x00,0x7F,0x00,0x7F,0x00, | |
0x3F,0x00,0x1F,0x00,0x0F,0x00,0x07,0x00, | |
0x03,0x01,0x01,0x01,0x00,0x00,0x00,0x00, | |
0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFE, | |
0x00,0xFC,0x00,0xF8,0x00,0xF0,0x00,0xE0, | |
0x00,0xC0,0x00,0x80,0x00,0x00,0x00,0x00, | |
0x00,0x1F,0x00,0x3F,0x00,0x7F,0x00,0xFF, | |
0x00,0xC0,0x00,0x80,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0xFC,0x00,0xF8,0x00,0xF0,0x00,0xE0, | |
0x00,0xFF,0x00,0xFF,0x00,0xFF,0x80,0x7E, | |
0xC0,0x3C,0xE0,0x18,0xF0,0x00,0xF8,0x08, | |
0xFC,0x1C,0xFE,0x3E,0xFF,0x7F,0xFF,0xFF, | |
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F, | |
0x00,0xC0,0x00,0x80,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80, | |
0xC0,0xC0,0xE0,0xE0,0xF0,0xF0,0xF8,0xF8, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00, | |
0xFF,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, | |
0xC0,0x00,0xC0,0x00,0xFF,0x00,0xFF,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x00, | |
0x98,0x00,0x18,0x00,0x18,0x00,0x19,0x00, | |
0x19,0x00,0x19,0x00,0x19,0x00,0x19,0x00, | |
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, | |
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, | |
0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x19,0x00,0x19,0x00,0x19,0x00,0x19,0x00, | |
0x19,0x00,0x19,0x00,0x18,0x00,0x18,0x00, | |
0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x81,0x00, | |
0x81,0x00,0x81,0x00,0x81,0x00,0x81,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x06,0x00,0x06,0x00,0x06,0x00,0x9F,0x00, | |
0x9F,0x00,0x86,0x00,0x86,0x00,0x86,0x00, | |
0x81,0x00,0x81,0x00,0x81,0x00,0x81,0x00, | |
0x81,0x00,0xC3,0x00,0xE7,0x00,0x7D,0x00, | |
0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x86,0x00,0x86,0x00,0x86,0x00,0x86,0x00, | |
0x86,0x00,0x86,0x00,0x83,0x00,0x83,0x00, | |
0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x03,0x00,0x03,0x00,0x03,0x00,0xCF,0x00, | |
0xCF,0x00,0x03,0x00,0x03,0x00,0x03,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00, | |
0xE1,0x00,0x03,0x00,0x06,0x00,0x06,0x00, | |
0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00, | |
0x03,0x00,0x03,0x00,0x41,0x00,0xC1,0x00, | |
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x06,0x00,0x07,0x00,0x07,0x00,0x06,0x00, | |
0x06,0x00,0x06,0x00,0xA6,0x00,0xE3,0x00, | |
0xC1,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00, | |
0xF0,0x00,0x18,0x00,0x0C,0x00,0x0C,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0xCE,0x00, | |
0xDE,0x00,0xD8,0x00,0xF0,0x00,0xE0,0x00, | |
0x0C,0x00,0xFC,0x00,0xFC,0x00,0x00,0x00, | |
0x00,0x00,0x0C,0x00,0x0C,0x00,0xF8,0x00, | |
0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, | |
0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00, | |
0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 | |
}; | |
/* End of LOGO.C */ | |
#include <gb/gb.h> | |
#include <gb/cgb.h> | |
#include <stdio.h> | |
#include "logo.h" | |
const UWORD logoPalette[] = { | |
LogoCGBPal0c0, | |
LogoCGBPal0c1, | |
LogoCGBPal0c2, | |
LogoCGBPal0c3, | |
}; | |
const UWORD letterPalette[] = { | |
LogoCGBPal2c0, | |
LogoCGBPal2c1, | |
LogoCGBPal2c2, | |
LogoCGBPal2c3, | |
}; | |
const UWORD letterPaletteFadeOne[] = { | |
LogoCGBPal3c0, | |
LogoCGBPal3c1, | |
LogoCGBPal3c2, | |
LogoCGBPal3c3, | |
}; | |
const UWORD letterPaletteFadeTwo[] = { | |
LogoCGBPal4c0, | |
LogoCGBPal4c1, | |
LogoCGBPal4c2, | |
LogoCGBPal4c3, | |
}; | |
const UWORD letterPaletteFadeThree[] = { | |
LogoCGBPal5c0, | |
LogoCGBPal5c1, | |
LogoCGBPal5c2, | |
LogoCGBPal5c3, | |
}; | |
const UWORD bgPallete[] = { | |
RGB_WHITE, | |
RGB_WHITE, | |
RGB_WHITE, | |
RGB_WHITE | |
}; | |
void main() { | |
UINT8 i = 0; | |
UINT8 j = 0; | |
SPRITES_8x16; | |
set_sprite_data(0, 48, Logo); | |
set_bkg_data(0, 1, BgColor); | |
for(i = 0; i < 32; i += 4){ | |
for(j = 0; j < 32; j += 4){ | |
set_bkg_tiles(i, j, 8, 16, BgColor); | |
} | |
} | |
set_bkg_palette(0, 1, bgPallete); | |
/* Flutter Logo */ | |
set_sprite_palette(0, 1, logoPalette); | |
set_sprite_tile(0, 0); | |
set_sprite_tile(1, 2); | |
set_sprite_tile(2, 4); | |
set_sprite_tile(3, 6); | |
set_sprite_tile(4, 8); | |
set_sprite_tile(5, 10); | |
set_sprite_tile(6, 12); | |
set_sprite_tile(7, 14); | |
set_sprite_prop(0, 0); | |
set_sprite_prop(1, 0); | |
set_sprite_prop(2, 0); | |
set_sprite_prop(3, 0); | |
set_sprite_prop(4, 0); | |
set_sprite_prop(5, 0); | |
set_sprite_prop(6, 0); | |
set_sprite_prop(7, 0); | |
move_sprite(0, 72, 56); | |
move_sprite(1, 80, 56); | |
move_sprite(2, 72, 72); | |
move_sprite(3, 80, 72); | |
move_sprite(4, 88, 56); | |
move_sprite(5, 96, 56); | |
move_sprite(6, 88, 72); | |
move_sprite(7, 96, 72); | |
/* Flutter Letters */ | |
set_sprite_palette(2, 1, letterPalette); | |
set_sprite_tile(8, 16); | |
set_sprite_tile(9, 18); | |
set_sprite_tile(10, 20); | |
set_sprite_tile(11, 22); | |
set_sprite_tile(12, 24); | |
set_sprite_tile(13, 26); | |
set_sprite_tile(14, 28); | |
set_sprite_tile(15, 30); | |
set_sprite_tile(16, 32); | |
set_sprite_tile(17, 34); | |
set_sprite_tile(18, 36); | |
set_sprite_tile(19, 38); | |
set_sprite_tile(20, 40); | |
set_sprite_tile(21, 42); | |
set_sprite_tile(22, 44); | |
set_sprite_tile(23, 46); | |
set_sprite_prop(8, 2); | |
set_sprite_prop(9, 2); | |
set_sprite_prop(10, 2); | |
set_sprite_prop(11, 2); | |
set_sprite_prop(12, 2); | |
set_sprite_prop(13, 2); | |
set_sprite_prop(14, 2); | |
set_sprite_prop(15, 2); | |
set_sprite_prop(16, 2); | |
set_sprite_prop(17, 2); | |
set_sprite_prop(18, 2); | |
set_sprite_prop(19, 2); | |
set_sprite_prop(20, 2); | |
set_sprite_prop(21, 2); | |
set_sprite_prop(22, 2); | |
set_sprite_prop(23, 2); | |
move_sprite(8, 72 - 12, 94); | |
move_sprite(9, 80 - 12, 94); | |
move_sprite(10, 72 - 12, 110); | |
move_sprite(11, 80 - 12, 110); | |
move_sprite(12, 88 - 12, 94); | |
move_sprite(13, 96 - 12, 94); | |
move_sprite(14, 88 - 12, 110); | |
move_sprite(15, 96 - 12, 110); | |
move_sprite(16, 72 + 20, 94); | |
move_sprite(17, 80 + 20, 94); | |
move_sprite(18, 72 + 20, 110); | |
move_sprite(19, 80 + 20, 110); | |
move_sprite(20, 88 + 20, 94); | |
move_sprite(21, 96 + 20, 94); | |
move_sprite(22, 88 + 20, 110); | |
move_sprite(23, 96 + 20, 110); | |
SHOW_SPRITES; | |
SHOW_BKG; | |
} | |
/* | |
Makefile | |
*/ | |
all: | |
/path/gbdk/bin/lcc -Wa-l -Wl-m -Wl-j -c -o main.o main.c | |
/path/gbdk/bin/lcc -Wa-l -Wl-m -Wl-j -c -o logo.o logo.c | |
/path/gbdk/bin/lcc -Wa-l -Wl-m -Wl-j -Wl-yp0x143=0x80 -o main.gb main.o logo.o | |
/* | |
GBDK: http://gbdk.sourceforge.net/ | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment