Repository: mrombout/gbdk_playground Branch: master Commit: a4a21eb70cc8 Files: 103 Total size: 109.6 KB Directory structure: gitextract_gw1x939_/ ├── .gitignore ├── README.md ├── background/ │ ├── Makefile │ ├── README.md │ ├── background.c │ ├── bg_data.c │ ├── bg_data.pcx │ ├── bg_data_map.c │ └── docs.sh ├── beep/ │ ├── Makefile │ ├── README.md │ └── beep.c ├── big_sprite/ │ ├── Makefile │ ├── README.md │ ├── big_sprite.c │ ├── docs.sh │ ├── sprite.c │ └── sprite.h ├── big_sprite_animation/ │ ├── Makefile │ ├── README.md │ ├── big_sprite_animation.c │ ├── cards.c │ ├── cards.gbr │ └── cards.h ├── blank/ │ ├── Makefile │ ├── README.md │ ├── blank.c │ └── docs.sh ├── color/ │ ├── Makefile │ ├── README.md │ ├── bg_data.c │ ├── bg_data_map.c │ └── color.c ├── detect_gb/ │ ├── Makefile │ ├── README.md │ └── detect_gb.c ├── docs/ │ └── res/ │ └── readme_c.jst ├── drawing/ │ ├── Makefile │ ├── README.md │ └── drawing.c ├── font/ │ ├── Makefile │ ├── README.md │ └── font.c ├── hello_world/ │ ├── Makefile │ ├── README.md │ ├── docs.sh │ └── hello_world.c ├── huge_sprite/ │ ├── Makefile │ ├── README.md │ ├── bg.h │ ├── docs.sh │ ├── huge_sprite.c │ └── sprite.h ├── input_state/ │ ├── Makefile │ ├── README.md │ └── input_state.c ├── input_wait/ │ ├── Makefile │ ├── README.md │ └── input_wait.c ├── link/ │ ├── Makefile │ ├── README.md │ └── link.c ├── move_sprite/ │ ├── Makefile │ ├── README.md │ ├── move_sprite.c │ ├── ufo.c │ ├── ufo.gbr │ └── ufo.h ├── save_ram/ │ ├── Makefile │ ├── README.md │ └── save_ram.c ├── simple_shmup/ │ ├── Makefile │ ├── README.md │ ├── backgrounds.gbr │ ├── bank2.c │ ├── bank3.c │ ├── bg_tile.c │ ├── bg_tile.h │ ├── bg_title.c │ ├── bg_title_map.c │ ├── make.bat │ ├── simple_shmup.c │ ├── spr_tiles.c │ ├── spr_tiles.h │ └── sprites.gbr ├── small_sprite/ │ ├── Makefile │ ├── README.md │ ├── small_sprite.c │ ├── sprite.c │ ├── sprite.gbr │ └── sprite.h └── window/ ├── Makefile ├── README.md ├── bg.c ├── bg.pcx ├── bg_map.c ├── border.c ├── border.gbr ├── border.h ├── main.c ├── window.c ├── window.gbm └── window.h ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ *.c~ *.un~ *.lst *.o *.sym *.asm *.ihx *.map *.noi # Binaries *.gb ================================================ FILE: README.md ================================================ # GBDK Playground It has 16 kB of RAM, man. ## Build Requirements Make sure to set the `GBDKDIR` environment variable pointing to your GBDK installation directory. The Makefile relies on this variable to locate the GBDK compiler and tools. ## Samples | [Blank](blank) | [Hello World](hello_world) | [Small Sprite](small_sprite) | | :--------------------------------: | :--------------------------------------------: | :----------------------------------------------: | | [![](blank/screenshot.png)](blank) | [![](hello_world/screenshot.png)](hello_world) | [![](small_sprite/screenshot.png)](small_sprite) | | Minimum required code | Print `Hello World!` | Render small 8x8 sprite | | [Big Sprite](big_sprite) | [Big Sprite Animation](big_sprite_animation) | [Input State](input_state) | | :------------------------------------------: | :--------------------------------------------------------------: | :--------------------------------------------: | | [![](big_sprite/screenshot.png)](big_sprite) | [![](big_sprite_animation/screenshot.gif)](big_sprite_animation) | [![](input_state/screenshot.png)](input_state) | | Render big 16x16 sprite | Animate big 16x16 sprite | Read joypad state | | [Input Wait](input_wait) | [Move Sprite](move_sprite) | [Background](background) | | :------------------------------------------: | :--------------------------------------------: | :------------------------------------------: | | [![](input_wait/screenshot.png)](input_wait) | [![](move_sprite/screenshot.gif)](move_sprite) | [![](background/screenshot.png)](background) | | Wait for button input | Move a sprite using joypad | Render a full-screen background | | [Window](window) | [Beep](beep) | [Simple SHMUP](simple_shmup) | | :----------------------------------: | :------------------------------: | :----------------------------------------------: | | [![](window/screenshot.png)](window) | [![](beep/screenshot.png)](beep) | [![](simple_shmup/screenshot.png)](simple_shmup) | | Renders a window | Make a sound | Very simple SHMUP | | [Huge Sprite](huge_sprite) | [Drawing](drawing) | [Detect GB Type](detect_gb) | | :--------------------------------------------: | :------------------------------------: | :----------------------------------------: | | [![](huge_sprite/screenshot.png)](huge_sprite) | [![](drawing/screenshot.png)](drawing) | [![](detect_gb/screenshot.png)](detect_gb) | | Renders a huge 40x64 sprite | Built-in drawing functions | Detect which GB is being used | | [Save RAM](save_ram) | [Font](font) | [Link](link) | | :--------------------------------------: | :------------------------------: | :--------------------------------: | | [![](save_ram/screenshot.png)](save_ram) | [![](font/screenshot.png)](font) | [![](link/screenshot.png)](link) | | Save/load variables | Load a new font | Send/Receive data using link cable | | [Color](color) | More coming soon... | | :--------------------------------: | :----------------------------------------------------------------: | | [![](color/screenshot.png)](color) | [![](docs/res/more_coming_soon.png)](https://gbdev.io/list.html#c) | | Use palettes for Game Boy Color | Contributions are welcome! | ================================================ FILE: background/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wl-m BIN = background.gb OBJS = background.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: background/README.md ================================================ # Background
Renders a full-screen background image. ## Source ```c #include #include "bg_data.c" #include "bg_data.map" void main() { ``` First load the tile patterns in the Background Tile Pattern table. This means that we load all the 8x8 images that make up our picture (131 of them to be exact). ```c set_bkg_data(0, 131, tiledata); VBK_REG = 1; VBK_REG = 0; ``` Then we set the tile pattern in the background tile table. The variable `tilemap` contains an array of tile numbers that reference to the the tiles we loaded previously using `set_bkg_data`. Our image is `20` tiles wide and `18` tiles high, thus having a total of 360 tiles. How is that possible when we only loaded `131` tiles? Well, that is because some in the image are identical. So instead the tile is only saved once in the `tiledata` variable and reused multiple times in the `tilemap` variable. ```c set_bkg_tiles(0, 0, 20, 18, tilemap); ``` In order for the background to actually show up we call `SHOW_BKG`. ```c SHOW_BKG; DISPLAY_ON; } ``` ================================================ FILE: background/background.c ================================================ // # Background //
// // Renders a full-screen background image. // // ## Source #include #include "bg_data.c" #include "bg_data_map.c" void main() { // First load the tile patterns in the Background Tile Pattern table. This // means that we load all the 8x8 images that make up our picture (131 of them // to be exact). set_bkg_data(0, 131, tiledata); VBK_REG = 1; VBK_REG = 0; // Then we set the tile pattern in the background tile table. The variable // `tilemap` contains an array of tile numbers that reference to the the tiles // we loaded previously using `set_bkg_data`. // // Our image is `20` tiles wide and `18` tiles high, thus having a total of 360 // tiles. How is that possible when we only loaded `131` tiles? // // Well, that is because some in the image are identical. So instead the tile // is only saved once in the `tiledata` variable and reused multiple times in // the `tilemap` variable. set_bkg_tiles(0, 0, 20, 18, tilemap); // In order for the background to actually show up we call `SHOW_BKG`. SHOW_BKG; DISPLAY_ON; } ================================================ FILE: background/bg_data.c ================================================ /* Advanced PCX to GameBoy converter v2.15 Tiles data Original PCX File : "BG_DATA.PCX" Number of Tiles : 131 TileMap Size : 20x18 */ unsigned const char tiledata[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xDF,0xDF,0xC1,0xC1,0xC0,0xC0,0xC0,0xC0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x3F,0x0F,0x0F,0x01,0x01,0x00,0x00,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0x1F,0x1F, 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,0xFE,0xFE,0xF8,0xF8, 0xFE,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xF0,0xC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xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFE,0xFE, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xC0,0xC0,0x80,0x80, 0xFF,0xFF,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFF,0xFF,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x0C,0x0C,0x18,0x18, 0x01,0x01,0x03,0x03,0x07,0x07,0x07,0x07,0x0F,0x0F,0x0F,0x0F,0x1F,0x1F,0x1F,0x1F, 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x02,0x02,0x06,0x06,0x0C,0x0C,0x08,0x08,0x18,0x18,0x30,0x30,0x20,0x20,0x20,0x20, 0x0C,0x0C,0x18,0x18,0x10,0x10,0x20,0x20,0x60,0x60,0x40,0x40,0xC0,0xC0,0x80,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x02,0x02,0x04,0x04, 0x30,0x30,0x20,0x20,0x60,0x60,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06, 0x40,0x40,0xC0,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0x01,0x02,0x02,0x06,0x06,0x08,0x08,0x18,0x18,0x30,0x30,0x60,0x60,0x40,0x40, 0x08,0x08,0x18,0x18,0x30,0x30,0x60,0x60,0x40,0x40,0xC0,0xC0,0x80,0x80,0x00,0x00, 0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x07,0x07,0x07,0x07, 0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, 0x04,0x04,0x08,0x08,0x08,0x08,0x10,0x10,0x30,0x30,0x20,0x20,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x01,0x03,0x03,0x02,0x02,0x06,0x06,0x04,0x04,0x08,0x08,0x18,0x18, 0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x02,0x02,0x02,0x06,0x06,0x04,0x04,0x0C,0x0C,0x18,0x18,0x10,0x10,0x20,0x20, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x20,0x20,0x18,0x18, 0x07,0x07,0x07,0x07,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, 0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01, 0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40,0xC0,0xC0,0x80,0x80,0x80,0x80,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02, 0x60,0x60,0x40,0x40,0x40,0x40,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x0C,0x0C,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x60,0x60,0x18,0x18,0x04,0x04,0x03,0x03, 0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F, 0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, 0x02,0x02,0x06,0x06,0x0C,0x0C,0x08,0x08,0x18,0x18,0x30,0x30,0x20,0x20,0x40,0x40, 0x02,0x02,0x06,0x06,0x0C,0x0C,0x08,0x08,0x18,0x18,0x10,0x10,0x10,0x10,0x20,0x20, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0x80,0x60,0x60,0x30,0x30,0x18,0x18,0x0E,0x0E,0x01,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x60,0x60, 0x1F,0x1F,0x1F,0x1F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x04,0x04, 0x40,0x40,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x40,0x40,0x40,0x40,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x1C,0x1C,0x06,0x06,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xC0,0xC0,0x70,0x70,0x1C,0x1C,0x07,0x07,0x01,0x01,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x60,0x60, 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x1F,0x1F,0x1F,0x1F, 0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40,0x40,0x40, 0x0C,0x0C,0x08,0x08,0x10,0x10,0x10,0x10,0x30,0x30,0x60,0x60,0x40,0x40,0x40,0x40, 0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x02,0x02,0x04,0x04,0x04,0x04,0x08,0x08, 0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x04,0x04,0x04,0x04,0x08,0x08,0x10,0x10, 0x00,0x00,0x00,0x00,0x0E,0x0E,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x40,0x40,0x30,0x30,0x08,0x08, 0x1F,0x1F,0x1F,0x1F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, 0x08,0x08,0x10,0x10,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x02,0x02, 0x10,0x10,0x20,0x20,0x60,0x60,0x40,0x40,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00, 0x0E,0x0E,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x80,0x80,0x60,0x60,0x38,0x38,0x0C,0x0C,0x07,0x07,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xE0,0xE0,0x30,0x30, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x03,0x03,0x03,0x03,0x03, 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xE0,0xE0,0xE0,0xE0, 0x02,0x02,0x04,0x04,0x08,0x08,0x18,0x18,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x40, 0x18,0x18,0x06,0x06,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x20,0x20,0x1C,0x1C,0x06,0x06,0x03,0x03, 0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x02,0x02,0x02,0x04,0x04,0x08,0x08,0x08,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x78,0x78,0x07,0x07, 0xC0,0xC0,0x60,0x60,0x30,0x30,0x08,0x08,0x0E,0x0E,0x03,0x03,0x01,0x01,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F, 0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, 0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0xC0,0xC0,0x40,0x40,0x60,0x60,0x30,0x30,0x0C,0x0C,0x02,0x02,0x03,0x03,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xE0,0xE0, 0x18,0x18,0x0E,0x0E,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0xE0,0xE0,0x38,0x38,0x0E,0x0E,0x03,0x03,0x00,0x00, 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x1F,0x1F,0x1F,0x1F,0x0F,0x0F,0x0F,0x0F, 0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x80, 0x02,0x02,0x04,0x04,0x08,0x08,0x18,0x18,0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40, 0x38,0x38,0x0C,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x38,0x38,0x06,0x06,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 0x07,0x07,0x07,0x07,0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x00,0x00, 0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x01,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x0F,0x0F, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x1F,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0xF0,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFC,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xFE,0xFE, 0xFF,0xFF,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x1F,0x1F,0x1F,0x1F, 0xFF,0xFF,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFC,0xFC,0xFD,0xFD, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x1F,0x1F,0x7F,0x7F,0xFF,0xFF, 0x00,0x00,0x03,0x03,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x80,0x80,0xF8,0xF8,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xFC,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x0F,0x0F,0x0F,0x0F,0x07,0x07,0x07,0x07,0x03,0x03,0x01,0x01,0xE1,0xE1,0xF8,0xF8}; ================================================ FILE: background/bg_data_map.c ================================================ /* Advanced PCX to GameBoy converter v2.15 TileMap data Original PCX File : "BG_DATA.PCX" Number of Tiles : 131 TileMap Size : 20x18 */ unsigned const char tilemap[] = { 0x01,0x02,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x06,0x07, 0x08,0x00,0x09,0x0A,0x0B,0x0C,0x0D,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x0E,0x0F,0x10,0x11,0x12,0x13, 0x14,0x00,0x00,0x12,0x15,0x00,0x00,0x16,0x17,0x17,0x18,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x1A,0x04, 0x1B,0x00,0x00,0x1C,0x00,0x00,0x00,0x1D,0x00,0x00,0x1E,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x04, 0x04,0x21,0x22,0x23,0x00,0x00,0x24,0x00,0x00,0x12,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x04,0x04, 0x04,0x27,0x28,0x00,0x00,0x29,0x2A,0x00,0x00,0x2B,0x2C,0x2D,0x00,0x00,0x00,0x00,0x00,0x2E,0x04,0x04, 0x04,0x2F,0x00,0x00,0x30,0x31,0x00,0x00,0x32,0x33,0x00,0x34,0x35,0x00,0x00,0x00,0x00,0x36,0x04,0x04, 0x04,0x37,0x00,0x00,0x38,0x00,0x00,0x00,0x39,0x00,0x00,0x00,0x3A,0x3B,0x3C,0x00,0x00,0x3D,0x04,0x04, 0x04,0x3E,0x00,0x3F,0x40,0x00,0x00,0x3F,0x41,0x00,0x00,0x00,0x00,0x00,0x42,0x43,0x44,0x45,0x04,0x04, 0x04,0x3E,0x00,0x46,0x00,0x00,0x00,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x04,0x04, 0x04,0x3E,0x48,0x49,0x00,0x00,0x4A,0x49,0x4B,0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4D,0x04,0x04, 0x04,0x3E,0x4E,0x00,0x00,0x4F,0x50,0x00,0x00,0x51,0x52,0x53,0x00,0x00,0x00,0x00,0x00,0x54,0x04,0x04, 0x04,0x55,0x00,0x00,0x00,0x56,0x00,0x00,0x00,0x00,0x00,0x57,0x58,0x00,0x00,0x00,0x00,0x59,0x04,0x04, 0x04,0x2F,0x00,0x00,0x5A,0x2A,0x5B,0x5C,0x00,0x00,0x00,0x00,0x00,0x5D,0x44,0x00,0x00,0x00,0x5E,0x04, 0x04,0x5F,0x00,0x32,0x60,0x00,0x00,0x3A,0x61,0x62,0x00,0x00,0x00,0x00,0x63,0x64,0x62,0x00,0x65,0x04, 0x04,0x66,0x00,0x67,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0x6A,0x6B,0x04, 0x04,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x00,0x00,0x7B, 0x7C,0x7D,0x7E,0x7F,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x80,0x81,0x82}; ================================================ FILE: background/docs.sh ================================================ docco -t ../docs/res/readme_c.jst -o ./ background.c mv background.html README.md ================================================ FILE: beep/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wl-m BIN = beep.gb OBJS = beep.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: beep/README.md ================================================ # Beep ![](screenshot.png) Demonstrates how to play a simple SFX sound. ================================================ FILE: beep/beep.c ================================================ #include #include void main() { NR50_REG = 0xFF; NR51_REG = 0xFF; NR52_REG = 0x80; gotogxy(1, 1); gprintf("====== Beep ======"); gotogxy(2, 3); gprintf("Press any button"); while(1) { UBYTE joypad_state = joypad(); if(joypad_state) { NR10_REG = 0x38U; NR11_REG = 0x70U; NR12_REG = 0xE0U; NR13_REG = 0x0AU; NR14_REG = 0xC6U; NR51_REG |= 0x11; delay(200); } } } ================================================ FILE: big_sprite/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wl-m BIN = big_sprite.gb OBJS = big_sprite.o sprite.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: big_sprite/README.md ================================================ # Big Sprite
Renders a big sprite of 16x16. Since the Game Boy hardware does not directly support sprites that large ## Source Start by including `gb/gb.h` this file defines most important functions you are going to need when develop Game Boy games. ```c #include ``` The `sprite.c` file defines the sprite data in the form of an unsigned char array. Most of the time you want to generate this file using tools such as GBTD. ```c #include "sprite.c" void main() { ``` Set the sprite size to 8x16 pixels, two tiles one above the other. Internally sets bit 2 of the LCDC register to 1. ```c SPRITES_8x16; ``` Loads the tile patterns stored in `sprite` into the Sprite Tile Pattern table. * first parameter `0` determines at which position we should start loading. * second parameter `4` determines how many tiles we want to loading * third parameter `sprite` sets the variable to load from This means that we are loading 4 tiles starting at 0 from the variable sprite. ```c set_sprite_data(0, 4, sprite); ``` Tell sprite `0` to display sprite `0`. Since we are loading 8x16 tiles this will make sprite 0 show tile `0` and tile `1`. ```c set_sprite_tile(0, 0); ``` Finally move a sprite to a position that we can see. ```c move_sprite(0, 75, 75); ``` We want to display a 16x16 sprite. Unfortunately the Game Boy hardware does not directly support a sprite that large. So in order to have a sprite of that size we are simply displaying two 8x16 tiles next to each other! Since we've already loaded our entire sprite in line 16 we can now simply tell sprite `1` to display our second sprite. Again, since we are displaying 8x16 tiles this statement will display tile `2` and tile `3`. ```c set_sprite_tile(1, 2); ``` In order to form the illusion of a bigger sprite we display the second tile directly next to the other simply by offsetting the position 8 pixels to the right. ```c move_sprite(1, 75 + 8, 75); ``` As always, in order for the sprites to display we need to call `SHOW_SPRITES` once. ```c SHOW_SPRITES; } ``` ================================================ FILE: big_sprite/big_sprite.c ================================================ // # Big Sprite //
// // Renders a big sprite of 16x16. Since the Game Boy hardware does not directly // support sprites that large // // ## Source // Start by including `gb/gb.h` this file defines most important functions you // are going to need when develop Game Boy games. #include // The `sprite.c` file defines the sprite data in the form of an unsigned char // array. Most of the time you want to generate this file using tools such as // GBTD. #include "sprite.h" void main() { // Set the sprite size to 8x16 pixels, two tiles one above the other. Internally // sets bit 2 of the LCDC register to 1. SPRITES_8x16; // Loads the tile patterns stored in `sprite` into the Sprite Tile Pattern // table. // // * first parameter `0` determines at which position we should start loading. // * second parameter `4` determines how many tiles we want to loading // * third parameter `sprite` sets the variable to load from // // This means that we are loading 4 tiles starting at 0 from the variable // sprite. set_sprite_data(0, 4, sprite); // Tell sprite `0` to display sprite `0`. Since we are loading 8x16 tiles this // will make sprite 0 show tile `0` and tile `1`. set_sprite_tile(0, 0); // Finally move a sprite to a position that we can see. move_sprite(0, 75, 75); // We want to display a 16x16 sprite. Unfortunately the Game Boy hardware does // not directly support a sprite that large. So in order to have a sprite of // that size we are simply displaying two 8x16 tiles next to each other! // // Since we've already loaded our entire sprite in line 16 we can now simply // tell sprite `1` to display our second sprite. Again, since we are displaying // 8x16 tiles this statement will display tile `2` and tile `3`. set_sprite_tile(1, 2); // In order to form the illusion of a bigger sprite we display the second tile // directly next to the other simply by offsetting the position 8 pixels to the // right. move_sprite(1, 75 + 8, 75); // As always, in order for the sprites to display we need to call // `SHOW_SPRITES` once. SHOW_SPRITES; } ================================================ FILE: big_sprite/docs.sh ================================================ docco -t ../docs/res/readme_c.jst -o ./ big_sprite.c mv big_sprite.html README.md ================================================ FILE: big_sprite/sprite.c ================================================ /* SPRITE.C Tile Source File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 16 x 16 Tiles : 0 to 0 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Start of tile array. */ unsigned char sprite[] = { 0xFF,0xFF,0x80,0x80,0x80,0x80,0x81,0x81, 0x83,0x83,0x87,0x87,0x81,0x81,0x81,0x81, 0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81, 0x83,0x83,0x87,0x87,0x80,0x80,0xFF,0xFF, 0xFF,0xFF,0x01,0x01,0xC1,0xC1,0xC1,0xC1, 0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1, 0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1, 0xE1,0xE1,0xF1,0xF1,0x01,0x01,0xFF,0xFF }; /* End of SPRITE.C */ ================================================ FILE: big_sprite/sprite.h ================================================ /* SPRITE.H Include File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 16 x 16 Tiles : 0 to 0 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Bank of tiles. */ #define spriteBank 0 /* Start of tile array. */ extern unsigned char sprite[]; /* End of SPRITE.H */ ================================================ FILE: big_sprite_animation/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wl-m BIN = big_sprite_animation.gb OBJS = big_sprite_animation.o cards.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: big_sprite_animation/README.md ================================================ # Big Sprite Animation ![](screenshot.gif) Renders a big 16x16 animated sprite of 2 frames using a delay of 500. ================================================ FILE: big_sprite_animation/big_sprite_animation.c ================================================ #include #include "cards.h" void main() { SPRITES_8x16; set_sprite_data(0, 8, cards); set_sprite_tile(0, 0); move_sprite(0, 75, 75); set_sprite_tile(1, 2); move_sprite(1, 75 + 8, 75); SHOW_SPRITES; while(1) { set_sprite_tile(0, 4); set_sprite_tile(1, 6); delay(500); set_sprite_tile(0, 0); set_sprite_tile(1, 2); delay(500); } } ================================================ FILE: big_sprite_animation/cards.c ================================================ /* CARDS.C Tile Source File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 16 x 16 Tiles : 0 to 1 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Start of tile array. */ unsigned char cards[] = { 0xFF,0xFF,0x80,0x80,0x80,0x80,0x81,0x81, 0x83,0x83,0x87,0x87,0x81,0x81,0x81,0x81, 0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81, 0x83,0x83,0x87,0x87,0x80,0x80,0xFF,0xFF, 0xFF,0xFF,0x01,0x01,0xC1,0xC1,0xC1,0xC1, 0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1, 0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1, 0xE1,0xE1,0xF1,0xF1,0x01,0x01,0xFF,0xFF, 0xFF,0xFF,0x80,0x80,0x83,0x83,0x87,0x87, 0x8E,0x8E,0x8C,0x8C,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x81,0x81,0x83,0x83, 0x87,0x87,0x8F,0x8F,0x80,0x80,0xFF,0xFF, 0xFF,0xFF,0x01,0x01,0xC1,0xC1,0xE1,0xE1, 0x71,0x71,0x31,0x31,0x31,0x31,0x31,0x31, 0x71,0x71,0xE1,0xE1,0xC1,0xC1,0x81,0x81, 0xF1,0xF1,0xF1,0xF1,0x01,0x01,0xFF,0xFF }; /* End of CARDS.C */ ================================================ FILE: big_sprite_animation/cards.h ================================================ /* CARDS.H Include File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 16 x 16 Tiles : 0 to 1 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Bank of tiles. */ #define cardsBank 0 /* Start of tile array. */ extern unsigned char cards[]; /* End of CARDS.H */ ================================================ FILE: blank/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wl-m BIN = blank.gb OBJS = blank.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: blank/README.md ================================================ # Blank
This example contains the minimal amount of code needed to create a working Game Boy game. Though not a very exciting one. ## Source All a GBDK game needs to compile and run (any C-program, in fact) is a main function. This is the entry point into your program. ```c void main() { } ``` ================================================ FILE: blank/blank.c ================================================ // # Blank //
// // This example contains the minimal amount of code needed to create a working // Game Boy game. Though not a very exciting one. // // ## Source // All a GBDK game needs to compile and run (any C-program, in fact) is a main // function. This is the entry point into your program. void main() { } ================================================ FILE: blank/docs.sh ================================================ docco -t ../docs/res/readme_c.jst -o ./ blank.c mv blank.html README.md ================================================ FILE: color/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wm-yC BIN = color.gbc OBJS = color.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: color/README.md ================================================ # Color ![](screenshot.png) Demonstrates how to use palettes and create a Game Boy Color ROM. ================================================ FILE: color/bg_data.c ================================================ /* Advanced PCX to GameBoy converter v2.15 Tiles data Original PCX File : "BG_DATA.PCX" Number of Tiles : 131 TileMap Size : 20x18 */ unsigned const char tiledata[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xDF,0xDF,0xC1,0xC1,0xC0,0xC0,0xC0,0xC0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x3F,0x0F,0x0F,0x01,0x01,0x00,0x00,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0x1F,0x1F, 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,0xFE,0xFE,0xF8,0xF8, 0xFE,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xF0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x07,0x07,0x07,0x07,0x0F,0x0F, 0xE0,0xE0,0xE0,0xE0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8, 0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x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00,0x00,0x00,0x00, 0xFF,0xFF,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x0C,0x0C,0x18,0x18, 0x01,0x01,0x03,0x03,0x07,0x07,0x07,0x07,0x0F,0x0F,0x0F,0x0F,0x1F,0x1F,0x1F,0x1F, 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x02,0x02,0x06,0x06,0x0C,0x0C,0x08,0x08,0x18,0x18,0x30,0x30,0x20,0x20,0x20,0x20, 0x0C,0x0C,0x18,0x18,0x10,0x10,0x20,0x20,0x60,0x60,0x40,0x40,0xC0,0xC0,0x80,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x02,0x02,0x04,0x04, 0x30,0x30,0x20,0x20,0x60,0x60,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06, 0x40,0x40,0xC0,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0x01,0x02,0x02,0x06,0x06,0x08,0x08,0x18,0x18,0x30,0x30,0x60,0x60,0x40,0x40, 0x08,0x08,0x18,0x18,0x30,0x30,0x60,0x60,0x40,0x40,0xC0,0xC0,0x80,0x80,0x00,0x00, 0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x07,0x07,0x07,0x07, 0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, 0x04,0x04,0x08,0x08,0x08,0x08,0x10,0x10,0x30,0x30,0x20,0x20,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x01,0x03,0x03,0x02,0x02,0x06,0x06,0x04,0x04,0x08,0x08,0x18,0x18, 0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x02,0x02,0x02,0x06,0x06,0x04,0x04,0x0C,0x0C,0x18,0x18,0x10,0x10,0x20,0x20, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x20,0x20,0x18,0x18, 0x07,0x07,0x07,0x07,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, 0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01, 0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40,0xC0,0xC0,0x80,0x80,0x80,0x80,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02, 0x60,0x60,0x40,0x40,0x40,0x40,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x0C,0x0C,0x02,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x60,0x60,0x18,0x18,0x04,0x04,0x03,0x03, 0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F, 0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, 0x02,0x02,0x06,0x06,0x0C,0x0C,0x08,0x08,0x18,0x18,0x30,0x30,0x20,0x20,0x40,0x40, 0x02,0x02,0x06,0x06,0x0C,0x0C,0x08,0x08,0x18,0x18,0x10,0x10,0x10,0x10,0x20,0x20, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0x80,0x60,0x60,0x30,0x30,0x18,0x18,0x0E,0x0E,0x01,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x60,0x60, 0x1F,0x1F,0x1F,0x1F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x04,0x04, 0x40,0x40,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x40,0x40,0x40,0x40,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x1C,0x1C,0x06,0x06,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xC0,0xC0,0x70,0x70,0x1C,0x1C,0x07,0x07,0x01,0x01,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x60,0x60, 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x1F,0x1F,0x1F,0x1F, 0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40,0x40,0x40, 0x0C,0x0C,0x08,0x08,0x10,0x10,0x10,0x10,0x30,0x30,0x60,0x60,0x40,0x40,0x40,0x40, 0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x02,0x02,0x04,0x04,0x04,0x04,0x08,0x08, 0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x04,0x04,0x04,0x04,0x08,0x08,0x10,0x10, 0x00,0x00,0x00,0x00,0x0E,0x0E,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x40,0x40,0x30,0x30,0x08,0x08, 0x1F,0x1F,0x1F,0x1F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, 0x08,0x08,0x10,0x10,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x02,0x02, 0x10,0x10,0x20,0x20,0x60,0x60,0x40,0x40,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00, 0x0E,0x0E,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x80,0x80,0x60,0x60,0x38,0x38,0x0C,0x0C,0x07,0x07,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xE0,0xE0,0x30,0x30, 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x03,0x03,0x03,0x03,0x03, 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xE0,0xE0,0xE0,0xE0, 0x02,0x02,0x04,0x04,0x08,0x08,0x18,0x18,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x40, 0x18,0x18,0x06,0x06,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x20,0x20,0x1C,0x1C,0x06,0x06,0x03,0x03, 0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x02,0x02,0x02,0x04,0x04,0x08,0x08,0x08,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x78,0x78,0x07,0x07, 0xC0,0xC0,0x60,0x60,0x30,0x30,0x08,0x08,0x0E,0x0E,0x03,0x03,0x01,0x01,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F, 0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0, 0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0xC0,0xC0,0x40,0x40,0x60,0x60,0x30,0x30,0x0C,0x0C,0x02,0x02,0x03,0x03,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xE0,0xE0, 0x18,0x18,0x0E,0x0E,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0xE0,0xE0,0x38,0x38,0x0E,0x0E,0x03,0x03,0x00,0x00, 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x1F,0x1F,0x1F,0x1F,0x0F,0x0F,0x0F,0x0F, 0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x80, 0x02,0x02,0x04,0x04,0x08,0x08,0x18,0x18,0x10,0x10,0x20,0x20,0x20,0x20,0x40,0x40, 0x38,0x38,0x0C,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x38,0x38,0x06,0x06,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 0x07,0x07,0x07,0x07,0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x00,0x00, 0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x01,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x0F,0x0F, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x3F,0xFF,0xFF,0xFF,0xFF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F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x80,0x80,0xF8,0xF8,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xFC,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x0F,0x0F,0x0F,0x0F,0x07,0x07,0x07,0x07,0x03,0x03,0x01,0x01,0xE1,0xE1,0xF8,0xF8}; ================================================ FILE: color/bg_data_map.c ================================================ /* Advanced PCX to GameBoy converter v2.15 TileMap data Original PCX File : "BG_DATA.PCX" Number of Tiles : 131 TileMap Size : 20x18 */ unsigned const char tilemap[] = { 0x01,0x02,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x06,0x07, 0x08,0x00,0x09,0x0A,0x0B,0x0C,0x0D,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x0E,0x0F,0x10,0x11,0x12,0x13, 0x14,0x00,0x00,0x12,0x15,0x00,0x00,0x16,0x17,0x17,0x18,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x1A,0x04, 0x1B,0x00,0x00,0x1C,0x00,0x00,0x00,0x1D,0x00,0x00,0x1E,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x04, 0x04,0x21,0x22,0x23,0x00,0x00,0x24,0x00,0x00,0x12,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x04,0x04, 0x04,0x27,0x28,0x00,0x00,0x29,0x2A,0x00,0x00,0x2B,0x2C,0x2D,0x00,0x00,0x00,0x00,0x00,0x2E,0x04,0x04, 0x04,0x2F,0x00,0x00,0x30,0x31,0x00,0x00,0x32,0x33,0x00,0x34,0x35,0x00,0x00,0x00,0x00,0x36,0x04,0x04, 0x04,0x37,0x00,0x00,0x38,0x00,0x00,0x00,0x39,0x00,0x00,0x00,0x3A,0x3B,0x3C,0x00,0x00,0x3D,0x04,0x04, 0x04,0x3E,0x00,0x3F,0x40,0x00,0x00,0x3F,0x41,0x00,0x00,0x00,0x00,0x00,0x42,0x43,0x44,0x45,0x04,0x04, 0x04,0x3E,0x00,0x46,0x00,0x00,0x00,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x04,0x04, 0x04,0x3E,0x48,0x49,0x00,0x00,0x4A,0x49,0x4B,0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4D,0x04,0x04, 0x04,0x3E,0x4E,0x00,0x00,0x4F,0x50,0x00,0x00,0x51,0x52,0x53,0x00,0x00,0x00,0x00,0x00,0x54,0x04,0x04, 0x04,0x55,0x00,0x00,0x00,0x56,0x00,0x00,0x00,0x00,0x00,0x57,0x58,0x00,0x00,0x00,0x00,0x59,0x04,0x04, 0x04,0x2F,0x00,0x00,0x5A,0x2A,0x5B,0x5C,0x00,0x00,0x00,0x00,0x00,0x5D,0x44,0x00,0x00,0x00,0x5E,0x04, 0x04,0x5F,0x00,0x32,0x60,0x00,0x00,0x3A,0x61,0x62,0x00,0x00,0x00,0x00,0x63,0x64,0x62,0x00,0x65,0x04, 0x04,0x66,0x00,0x67,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0x6A,0x6B,0x04, 0x04,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x00,0x00,0x7B, 0x7C,0x7D,0x7E,0x7F,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x80,0x81,0x82}; ================================================ FILE: color/color.c ================================================ #include #include // Include cgb functions // Background taken from 'background' example #include "bg_data.c" #include "bg_data_map.c" // Sprite taken from 'small_sprite' example const unsigned char sprite[] = { 0x7E,0x7E,0x99,0x99,0x81,0x81,0xA5,0xA5, 0x81,0x81,0xDB,0xDB,0xC3,0xC3,0x3C,0x3C }; // These palettes replace the default palette with the appropriate colors. See cgb.h for more defined colors. UWORD bkgPalette[] = { RGB_PURPLE, RGB_BLACK, RGB_ORANGE, RGB_BROWN }; UWORD sprPalette[] = { RGB_GREEN, RGB_BLUE, RGB_RED, RGB_YELLOW }; void main(void){ set_bkg_palette(0, 1, bkgPalette); // UBYTE first_palette, UBYTE nb_palettes, UWORD *rgb_data set_bkg_data(0, 131, tiledata); set_bkg_tiles(0, 0, 20, 18, tilemap); SHOW_BKG; set_sprite_palette(0, 1, sprPalette); // UBYTE first_palette, UBYTE nb_palettes, UWORD *rgb_data set_sprite_data(0, 1, sprite); set_sprite_tile(0, 0); move_sprite(0, 50, 50); SHOW_SPRITES; DISPLAY_ON; } ================================================ FILE: detect_gb/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wl-m BIN = detect_gb.gb OBJS = detect_gb.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: detect_gb/README.md ================================================ # Detect GB ![](screenshot.png) Detect which GB is being used/emulated. ================================================ FILE: detect_gb/detect_gb.c ================================================ #include #include extern UBYTE _cpu; void main() { switch (_cpu) { case 0x01: printf("DMG or SGB"); break; case 0xFF: printf("POCKET or SGB2"); break; case 0x11: printf("COLOR"); break; default: printf("OTHER"); break; } } ================================================ FILE: docs/res/readme_c.jst ================================================ <% for (var i = 0, l = sections.length; i <% var section = sections[i]; %> <%= section.docsText %> <% if (!(/^\s*$/).test(section.codeText)) { %> ```c <%= section.codeText %> ``` <% } %> <% } %> ================================================ FILE: drawing/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wl-m BIN = drawing.gb OBJS = drawing.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: drawing/README.md ================================================ # Drawing ![](screenshot.png) Demonstrates built-in GBDK drawing functions. Operate the D-Pad to use the plot function to draw on the screen. Press the A Button to change plot point colors (Black, White, Dark Gray, Light Gray). Press the B button to clear the screen. ================================================ FILE: drawing/drawing.c ================================================ #include #include uint8_t x = 1, y = 1, i = 3, j, f; void main() { color(BLACK, WHITE, SOLID); // forecolor, backcolor, mode [Colors: WHITE (0), LTGREY (1), DKGREY(2), BLACK (3)] circle(100, 60, 30, M_FILL); // x, y, radius, style (M_FILL or M_NOFILL) line(40, 40, 50, 50); // x1, y1, x2, y2 box(120, 125, 125, 135, M_NOFILL); // x1, y1, x2, y2, style (M_FILL or M_NOFILL) plot_point(3, 4); // Plot a single pixel on the screen gotogxy(18, 15); // Places you at these coordinates gprintf("Hi"); // When using the drawing library you must use gprintf instead of printf while (1) { if (joypad() == J_UP && y != 0) y--; if (joypad() == J_DOWN && y != 143) y++; if (joypad() == J_LEFT && x != 0) x--; if (joypad() == J_RIGHT && x != 159) x++; if (joypad() == J_A) { // Change colors waitpadup(); i++; if (i > 3) i = 0; } if (joypad() == J_B) { // Function to 'clear' the screen for (j = 0; j < 20; j++) { // GB screen is 20 columns wide and 18 columns tall for (f = 0; f < 18; f++) { gotogxy(j, f); wrtchr(' '); // Use wrtchr to place a character when using the drawing library } } } plot(x, y, i, SOLID); // Draws a pixel on the screen (x, y, color, mode) delay(10); } } ================================================ FILE: font/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m BIN = font.gb OBJS = font.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: font/README.md ================================================ # Font ![](screenshot.png) Demonstrates how to switch from the default font. Be careful when using/loading fonts as they are loaded into VRAM and may overwrite tiles you're using. Built-in fonts include: font_spect, font_italic, font_ibm, font_min. ================================================ FILE: font/font.c ================================================ #include #include #include void main(void) { font_init(); // Initialize font font_set(font_load(font_spect)); // Set and load the font printf("New font!"); } ================================================ FILE: hello_world/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m BIN = hello_world.gb OBJS = hello_world.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: hello_world/README.md ================================================ # Hello World
Prints `Hello World!` to the screen using GBDK's `printf` function. ## Source Includes ``. This file contains all Gameboy specific functions. It's the one you're going to use the most. ```c #include ``` Includes `` it contains funtions for basic file/console input and output. ```c #include ``` A C program always starts by calling the `main()` function. If you are unfamiliar with this I suggest reading up on C first. ```c void main() { ``` Prints the string `Hello World!` to the screen. Internally it uses the background layer to do so as you can see in the VRAM of your favorite emulator. ```c printf("Hello World!"); ``` Using `\n` you can create a new line. In this case it is used to create some space between the previous sentence and the next. ```c printf("\n\nPress Start"); } ``` ================================================ FILE: hello_world/docs.sh ================================================ docco -t ../docs/res/readme_c.jst -o ./ hello_world.c mv hello_world.html README.md ================================================ FILE: hello_world/hello_world.c ================================================ // # Hello World //
// // Prints `Hello World!` to the screen using GBDK's `printf` function. // // ## Source // Includes ``. This file contains all Gameboy specific functions. // It's the one you're going to use the most. #include // Includes `` it contains funtions for basic file/console input and //output. #include // A C program always starts by calling the `main()` function. If you are // unfamiliar with this I suggest reading up on C first. void main() { // Prints the string `Hello World!` to the screen. Internally it uses the // background layer to do so as you can see in the VRAM of your favorite // emulator. printf("Hello World!"); // Using `\n` you can create a new line. In this case it is used to create some // space between the previous sentence and the next. printf("\n\nPress Start"); } ================================================ FILE: huge_sprite/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m BIN = huge_sprite.gb OBJS = huge_sprite.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: huge_sprite/README.md ================================================ # Huge Sprite
Render a huge 40x64 sprite that can be moved around with the D-pad. ## Source ```c #include #include #include "sprite.h" #include "bg.h" #define SPR_WIDTH 8 #define SPR_HEIGHT 5 #define TOTAL_SPR SPR_WIDTH * SPR_HEIGHT uint8_t x = 64; uint8_t y = 96; void render_huge_sprite() { uint8_t i, j; uint8_t sprite_index; set_sprite_tile(0, 1); for(i = 0; i < SPR_WIDTH; ++i) { for(j = 0; j < SPR_HEIGHT; ++j) { sprite_index = i * SPR_HEIGHT + j; set_sprite_tile(sprite_index, sprite_index); move_sprite(sprite_index, x + (j * 8), y + (i * 8)); } } } void load_background() { set_bkg_data(0, 2, bg_tile_data); set_bkg_tiles(0, 0, 20, 18, bg_map_data); } void move_huge_sprite(uint8_t nx, uint8_t ny) { uint8_t i, lx, ly; lx = 0; ly = 0; for(i = 0; i < 40; i++) { if(lx == 40) { lx = 0; ly += 8; } move_sprite(i, nx + lx, ny + ly); lx += 8; } } void move_right() { move_huge_sprite(++x, y); } void move_left() { move_huge_sprite(--x, y); } void main() { SPRITES_8x8; set_sprite_data(0, 40, sprite_tile_data); render_huge_sprite(); load_background(); SHOW_SPRITES; SHOW_BKG; while(1) { if(joypad() & J_RIGHT) { move_right(); } if(joypad() & J_LEFT) { move_left(); } delay(10); } } ``` ================================================ FILE: huge_sprite/bg.h ================================================ // /////////////////////// // // // // // File Attributes // // // // // /////////////////////// // Filename: bg.png // Pixel Width: 144px // Pixel Height: 160px // WARNING: Width of input image padded 3px to 144px // ///////////////// // // // // // Constants // // // // // ///////////////// const int bg_tile_map_size = 0x0168; const int bg_tile_map_width = 0x12; const int bg_tile_map_height = 0x14; const int bg_tile_data_size = 0x20; const int bg_tile_count = 0x0168; // //////////////// // // // // // Map Data // // // // // //////////////// const unsigned char bg_map_data[] ={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01 }; // ///////////////// // // // // // Tile Data // // // // // ///////////////// const unsigned char bg_tile_data[] ={ 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x01,0x01, 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00 }; ================================================ FILE: huge_sprite/docs.sh ================================================ docco -t ../docs/res/readme_c.jst -o ./ huge_sprite.c -c "" mv huge_sprite.html README.md ================================================ FILE: huge_sprite/huge_sprite.c ================================================ // # Huge Sprite //
// // Render a huge 40x64 sprite that can be moved around with the D-pad. // // ## Source #include #include #include "sprite.h" #include "bg.h" #define SPR_WIDTH 8 #define SPR_HEIGHT 5 #define TOTAL_SPR SPR_WIDTH * SPR_HEIGHT uint8_t x = 64; uint8_t y = 96; void render_huge_sprite() { uint8_t i, j; uint8_t sprite_index; set_sprite_tile(0, 1); for(i = 0; i < SPR_WIDTH; ++i) { for(j = 0; j < SPR_HEIGHT; ++j) { sprite_index = i * SPR_HEIGHT + j; set_sprite_tile(sprite_index, sprite_index); move_sprite(sprite_index, x + (j * 8), y + (i * 8)); } } } void load_background() { set_bkg_data(0, 2, bg_tile_data); set_bkg_tiles(0, 0, 20, 18, bg_map_data); } void move_huge_sprite(uint8_t nx, uint8_t ny) { uint8_t i, lx, ly; lx = 0; ly = 0; for(i = 0; i < 40; i++) { if(lx == 40) { lx = 0; ly += 8; } move_sprite(i, nx + lx, ny + ly); lx += 8; } } void move_right() { move_huge_sprite(++x, y); } void move_left() { move_huge_sprite(--x, y); } void main() { SPRITES_8x8; set_sprite_data(0, 40, sprite_tile_data); render_huge_sprite(); load_background(); SHOW_SPRITES; SHOW_BKG; while(1) { wait_vbl_done(); if(joypad() & J_RIGHT) { move_right(); } if(joypad() & J_LEFT) { move_left(); } delay(10); } } ================================================ FILE: huge_sprite/sprite.h ================================================ // /////////////////////// // // // // // File Attributes // // // // // /////////////////////// // Filename: sprite.png // Pixel Width: 40px // Pixel Height: 64px // ///////////////// // // // // // Constants // // // // // ///////////////// const int sprite_tile_map_size = 0x28; const int sprite_tile_map_width = 0x05; const int sprite_tile_map_height = 0x08; const int sprite_tile_data_size = 0x0280; const int sprite_tile_count = 0x28; // //////////////// // // // // // Map Data // // // // // //////////////// const unsigned char sprite_map_data[] ={ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }; // ///////////////// // // // // // Tile Data // // // // // ///////////////// const unsigned char sprite_tile_data[] ={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x1F,0x1F, 0x00,0x00,0x01,0x01,0x0F,0x0F,0x1F,0x1F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x3F,0x3F,0xFF,0xFF,0xFF,0xFF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,0xFF,0x1F,0xFF,0x1F, 0x0F,0x10,0x19,0x26,0x10,0x2F,0x3F,0x40,0x3F,0x40,0xFF,0x80,0x7F,0x80,0x3E,0x41, 0xFD,0x02,0xFE,0x01,0xFF,0x00,0x4F,0xB0,0xC3,0x7C,0x08,0xF7,0x9F,0xE0,0xBE,0xC1, 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFC,0x03,0x33,0xCC,0x4F,0xB0,0xBF,0xC0, 0xB7,0x48,0xB7,0x48,0xFF,0x00,0x9F,0x78,0x77,0xF8,0x17,0xE8,0x9F,0x60,0x4F,0xB0, 0xFF,0x1F,0xFF,0x1F,0xFF,0x1F,0xEF,0x1F,0xFF,0x1F,0xEF,0x1F,0xFF,0x1F,0xFF,0x1F, 0x06,0x19,0x00,0x03,0x01,0x01,0x00,0x01,0x01,0x00,0x01,0x02,0x01,0x02,0x03,0x00, 0x3C,0xC3,0x3C,0xC3,0xBC,0xC3,0x1E,0xE1,0xA0,0x5F,0xFF,0x00,0xFF,0x00,0xFF,0x00, 0x7F,0x80,0xFF,0x00,0xFE,0x01,0xFF,0x00,0x04,0xFB,0xEF,0x10,0xFF,0x00,0xEF,0x10, 0xBF,0x40,0x3F,0xC0,0x9F,0x60,0x1F,0xE0,0x4F,0xB0,0x40,0xBF,0x5F,0xAF,0xDF,0x2F, 0xFF,0x1F,0xFF,0x1F,0xFF,0x1F,0xFF,0x1F,0xFF,0x1F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF}; ================================================ FILE: input_state/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m BIN = input_state.gb OBJS = input_state.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: input_state/README.md ================================================ # Input State ![](screenshot.png) Prints the pressed button every 100ms. ================================================ FILE: input_state/input_state.c ================================================ #include #include void main(void) { while(1) { switch(joypad()) { case J_LEFT: printf("Left!\n"); break; case J_RIGHT: printf("Right!\n"); break; case J_UP: printf("Up!\n"); break; case J_DOWN: printf("Down!\n"); break; case J_START: printf("Start!\n"); break; case J_SELECT: printf("Select!\n"); break; case J_A: printf("A!\n"); break; case J_B: printf("B!\n"); break; } delay(100); } } ================================================ FILE: input_wait/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m BIN = input_wait.gb OBJS = input_wait.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: input_wait/README.md ================================================ # Input Wait ![](screenshot.png) Demonstrates how to wait for key pressed and releases. ================================================ FILE: input_wait/input_wait.c ================================================ #include #include void main() { while(1) { printf("Press Start\n\n"); waitpad(J_START); printf("Please hold down A!\n\n"); waitpad(J_A); printf("Holding down A!\n\n"); waitpadup(); printf("Tired already?\n\n\n"); } } ================================================ FILE: link/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m BIN = link.gb OBJS = link.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: link/README.md ================================================ # Link ![](screenshot.png) Demonstrates how to use the Link Cable to send and receive bytes. ================================================ FILE: link/link.c ================================================ #include #include void main(void) { printf("A: Send\nB: Receive\n\n"); _io_out = 1; while (1) { if (joypad() == J_A) { waitpadup(); send_byte(); // send _io_out printf("Sending...\n"); while (_io_status == IO_SENDING); // Wait for Send if (_io_status == IO_IDLE) // If IO status returns to Idle then success printf("Sent %d\n", (int)_io_out); else printf("Error\n"); // Else print error code _io_out++; } if (joypad() == J_B) { waitpadup(); receive_byte(); // receive _io_in printf("Receiving...\n"); while (_io_status == IO_RECEIVING); // Wait for Receive if (_io_status == IO_IDLE) // If IO status returns to Idle then success printf("Received %d\n", (int)_io_in); else printf("Error\n"); // Else print error } } } ================================================ FILE: move_sprite/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m BIN = move_sprite.gb OBJS = move_sprite.o ufo.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: move_sprite/README.md ================================================ # Move Sprite ![](screenshot.gif) Demonstrates how to move a sprite using the d-pad. ================================================ FILE: move_sprite/move_sprite.c ================================================ #include #include "ufo.h" void main() { int x = 55; int y = 75; SPRITES_8x8; set_sprite_data(0, 0, ufo); set_sprite_tile(0, 0); move_sprite(0, x, y); SHOW_SPRITES; while(1) { if(joypad() & J_RIGHT) { x++; move_sprite(0, x, y); delay(10); } if(joypad() & J_LEFT) { x--; move_sprite(0, x, y); delay(10); } if(joypad() & J_UP) { y--; move_sprite(0, x, y); delay(10); } if(joypad() & J_DOWN) { y++; move_sprite(0, x, y); delay(10); } } } ================================================ FILE: move_sprite/ufo.c ================================================ /* UFO.C Tile Source File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 0 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Start of tile array. */ unsigned char ufo[] = { 0x5A,0x3C,0xE3,0x42,0x7C,0x99,0xEB,0xA5, 0xFB,0xA5,0x66,0x99,0xE7,0x42,0x5A,0x3C }; /* End of UFO.C */ ================================================ FILE: move_sprite/ufo.h ================================================ /* UFO.H Include File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 0 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Bank of tiles. */ #define ufoBank 0 /* Start of tile array. */ extern unsigned char ufo[]; /* End of UFO.H */ ================================================ FILE: save_ram/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m -Wl-yt3 -Wl-yo4 -Wl-ya4 BIN = save_ram.gb OBJS = save_ram.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: save_ram/README.md ================================================ # Save RAM ![](screenshot.png) Demonstrates how to load and save variables. Using Save RAM requires additional compiler arguments. ================================================ FILE: save_ram/save_ram.c ================================================ #include #include char *saved = (char *)0xa000; // Pointer to memory address int *num = (int *)0xa001; void main() { ENABLE_RAM_MBC1; // Enable RAM if (saved[0] != 's') { // Check to see if the variable's ever been saved before num[0]=0; // Assign the variable an initial value saved[0] = 's'; // Assign saved an 's' value so the if statement isn't executed on next load } printf("The value of num is: %d\n", num[0]); num[0]++; // Increment so on next load there's a new number DISABLE_RAM_MBC1; // Disable RAM } ================================================ FILE: simple_shmup/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m -Wl-j LDFLAGS= -Wl-yt0x01 -Wl-yo4 BIN = simple_shmup.gb OBJS = simple_shmup.o bank2.o bank3.o all: $(BIN) $(BIN): $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ simple_shmup.o: simple_shmup.c $(CC) $(CFLAGS) -c -o $@ $< bank2.o: bank2.c $(CC) $(CFLAGS) -Wf-bo2 -c -o $@ $< bank3.o: bank3.c $(CC) $(CFLAGS) -Wf-bo3 -c -o $@ $< clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: simple_shmup/README.md ================================================ # Simple SHMUP ![](screenshot.png) A simple side-scrolling shoot 'em up game. This example uses several small sprites, a scrolling background and a full-screen image. Tutorial: [How to write a simple side scrolling game in GBDK](https://pastebin.com/F3tHLj68) by Jason ================================================ FILE: simple_shmup/bank2.c ================================================ #include #include #include const UBYTE badguy_ai[] = { 32, 32, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 50, 50, 51, 51, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 58, 59, 59, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 62, 62, 62, 62, 61, 61, 61, 61, 60, 60, 60, 59, 59, 59, 58, 58, 57, 57, 56, 56, 55, 55, 54, 54, 53, 53, 52, 52, 51, 50, 50, 49, 49, 48, 47, 47, 46, 45, 44, 44, 43, 42, 42, 41, 40, 39, 39, 38, 37, 36, 36, 35, 34, 33, 33, 32, 31, 30, 29, 29, 28, 27, 26, 26, 25, 24, 23, 23, 22, 21, 20, 20, 19, 18, 18, 17, 16, 16, 15, 14, 14, 13, 12, 12, 11, 11, 10, 9, 9, 8, 8, 7, 7, 6, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 29, 30 }; UBYTE playing, joypad_state; UBYTE player_x, player_y; UBYTE badguy_x, badguy_y, badguy_z, badguy_offset; UBYTE player_shot_x, player_shot_y, player_shot_z; void update_graphics(void) { disable_interrupts(); scroll_bkg(1, 0); move_sprite(0, player_x, player_y); move_sprite(1, badguy_x, badguy_y); move_sprite(2, player_shot_x, player_shot_y); enable_interrupts(); } void update_joypad(void) { joypad_state = joypad(); if(joypad_state & J_LEFT) { if(player_x > 8) player_x--; } if(joypad_state & J_RIGHT) { if(player_x < 160) player_x++; } if(joypad_state & J_UP) { if(player_y > 16) player_y--; } if(joypad_state & J_DOWN) { if(player_y < 152) player_y++; } if(joypad_state & J_A) { if(player_shot_z == 0) { player_shot_z = 1; player_shot_x = player_x; player_shot_y = player_y; } } if(player_shot_z == 1) { player_shot_x = player_shot_x + 2; if(player_shot_x > 240) { player_shot_x = 250; player_shot_y = 250; player_shot_z = 0; } } } void update_badguy(void) { badguy_x = badguy_x - 1; if(badguy_x > 240) { badguy_offset = rand(); while(badguy_offset > 134) { badguy_offset = rand(); } badguy_x = 239; } badguy_y = badguy_offset + badguy_ai[badguy_z]; badguy_z++; } void collision_detection(void) { if(player_shot_y > badguy_y - 4) { if(player_shot_y < badguy_y + 4) { if(player_shot_x > badguy_x - 4) { if(player_shot_x < badguy_x + 4) { player_shot_z = 0; player_shot_x = 250; player_shot_y = 250; badguy_x = 255; } } } } if(player_y > badguy_y - 4) { if(player_y < badguy_y + 4) { if(player_x > badguy_x - 4) { if(player_x < badguy_x + 4) { playing = 0; delay(1000); } } } } } void do_gameplay(void) { playing = 1; player_x = GRAPHICS_WIDTH / 2; player_y = GRAPHICS_HEIGHT / 2; while(playing == 1) { update_joypad(); update_badguy(); collision_detection(); delay(10); } } ================================================ FILE: simple_shmup/bank3.c ================================================ #include #include #include "bg_title.c" #include "bg_title_map.c" #include "bg_tile.c" #include "spr_tiles.c" const UBYTE gamemap[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; const UWORD bgpal[] = { RGB(0, 0, 0), RGB(10, 10, 10), RGB(20, 20, 20), RGB(30, 30, 30), }; const UWORD spritepal[] = { RGB(0, 0, 0), RGB(10, 10, 10), RGB(20, 20, 20), RGB(30, 30, 30), }; void draw_title_screen(void) { wait_vbl_done(); DISPLAY_OFF; set_bkg_data(0, 255, bg_title_tiledata); set_bkg_tiles(0, 0, 20, 18, bg_title_tilemap); SHOW_BKG; HIDE_WIN; HIDE_SPRITES; wait_vbl_done(); DISPLAY_ON; waitpad(255); } void load_game_tiles(void) { wait_vbl_done(); DISPLAY_OFF; set_bkg_data(0, 1, BGTile); set_bkg_tiles(0, 0, 32, 32, gamemap); set_bkg_palette(0, 1, &bgpal[0]); set_sprite_data(0, 3, SpriteTiles); set_sprite_tile(0, 0); set_sprite_tile(1, 1); set_sprite_tile(2, 2); SPRITES_8x8; SHOW_SPRITES; SHOW_BKG; DISPLAY_ON; } ================================================ FILE: simple_shmup/bg_tile.c ================================================ /* BG_TILE.C Tile Source File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 0 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Start of tile array. */ const unsigned char BGTile[] = { 0xFF,0xFF,0xFB,0xFB,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0x7F,0x7F,0xF7,0xF7,0xFF,0xFF }; /* End of BG_TILE.C */ ================================================ FILE: simple_shmup/bg_tile.h ================================================ /* BG_TILE.H Include File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 0 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Bank of tiles. */ #define BGTileBank 0 /* Start of tile array. */ extern unsigned char BGTile[]; /* End of BG_TILE.H */ ================================================ FILE: simple_shmup/bg_title.c ================================================ /* Advanced PCX to GameBoy converter v2.15 Tiles data Original PCX File : "BG.PCX" Number of Tiles : 159 TileMap Size : 20x18 */ const unsigned char bg_title_tiledata[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF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, 0xFC,0xFC,0x3F,0x3F,0x3F,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x78,0x78,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xF8,0xF8,0xFE,0xFE,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x7F,0x7F,0x0F,0x0F,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; ================================================ FILE: simple_shmup/bg_title_map.c ================================================ /* Advanced PCX to GameBoy converter v2.15 TileMap data Original PCX File : "BG.PCX" Number of Tiles : 159 TileMap Size : 20x18 */ const unsigned char bg_title_tilemap[] = { 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x01,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x04,0x05,0x06,0x05,0x05,0x05,0x07,0x05,0x08,0x07,0x05,0x05,0x09,0x01,0x01,0x01, 0x01,0x01,0x01,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x01,0x01, 0x01,0x01,0x01,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x01,0x01, 0x01,0x01,0x28,0x29,0x2A,0x2B,0x01,0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x01,0x01, 0x01,0x01,0x37,0x38,0x39,0x3A,0x01,0x3B,0x3C,0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,0x45,0x01,0x01, 0x01,0x01,0x01,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x48,0x4E,0x4F,0x50,0x51,0x48,0x52,0x01,0x01, 0x01,0x01,0x01,0x53,0x54,0x48,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,0x3F,0x01,0x01, 0x01,0x01,0x01,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x62,0x69,0x6A,0x6B,0x6C,0x01,0x01,0x01, 0x01,0x6D,0x01,0x6E,0x6F,0x62,0x70,0x71,0x72,0x73,0x74,0x75,0x01,0x76,0x62,0x77,0x78,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x79,0x01,0x01,0x01,0x7A,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x7B,0x7C,0x01,0x01,0x01,0x01,0x01,0x7D,0x01,0x01,0x01,0x7E,0x7F,0x80,0x01,0x01,0x01,0x01,0x01,0x01, 0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x01,0x01,0x8A,0x8B,0x8C,0x8D,0x8E,0x83,0x84,0x8F,0x90, 0x91,0x92,0x93,0x01,0x94,0x95,0x96,0x97,0x98,0x01,0x01,0x94,0x99,0x9A,0x9B,0x9C,0x93,0x01,0x9D,0x9E}; ================================================ FILE: simple_shmup/make.bat ================================================ echo off lcc -Wa-l -Wl-m -Wl-j -c -o simple_shmup.o simple_shmup.c lcc -Wa-l -Wl-m -Wl-j -Wf-bo2 -c -o bank2.o bank2.c lcc -Wa-l -Wl-m -Wl-j -Wf-bo3 -c -o bank3.o bank3.c lcc -Wa-l -Wl-m -Wl-j -Wl-yt0x01 -Wl-yo4 -o simple_shmup.gb simple_shmup.o bank2.o bank3.o rem -Wl-yp0x143=0x80 ================================================ FILE: simple_shmup/simple_shmup.c ================================================ #include #include #include // bank 0 void vblint(void); // bank 2 void update_graphics(void); void do_gameplay(void); void update_joypad(void); void update_badguy(void); void collision_detection(void); // bank 3 void draw_title_screen(void); void load_game_tiles(void); fixed seed; // main void main(void) { seed.b.l = DIV_REG; SWITCH_ROM_MBC1(3); draw_title_screen(); seed.b.h = DIV_REG; initrand(seed.w); load_game_tiles(); disable_interrupts(); add_VBL(vblint); SWITCH_ROM_MBC1(2); enable_interrupts(); do_gameplay(); reset(); } void vblint(void) { SWITCH_ROM_MBC1(2); update_graphics(); } ================================================ FILE: simple_shmup/spr_tiles.c ================================================ /* SPR_TILES.C Tile Source File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 2 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Start of tile array. */ const unsigned char SpriteTiles[] = { 0x40,0x40,0xE0,0xA0,0xFE,0x80,0xC8,0xB8, 0x8C,0xF4,0x96,0xEA,0xA9,0xD7,0xFF,0xFF, 0x02,0x40,0xC5,0xA3,0xE5,0xBB,0xF5,0xAB, 0xF5,0xAB,0xF5,0xAB,0xFD,0xBB,0x42,0x42, 0x00,0x00,0x00,0x18,0x18,0x3C,0x3C,0x66, 0x3C,0x66,0x18,0x3C,0x00,0x18,0x00,0x00 }; /* End of SPR_TILES.C */ ================================================ FILE: simple_shmup/spr_tiles.h ================================================ /* SPR_TILES.H Include File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 2 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Bank of tiles. */ #define SpriteTilesBank 0 /* Start of tile array. */ extern unsigned char SpriteTiles[]; /* End of SPR_TILES.H */ ================================================ FILE: small_sprite/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc AS = $(LCC) -c CC = $(LCC) -Wa-l -Wl-m BIN = small_sprite.gb OBJS = small_sprite.o sprite.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: small_sprite/README.md ================================================ # Small Sprite ![](screenshot.png) Renders a small 8x8 sprite to the screen. ================================================ FILE: small_sprite/small_sprite.c ================================================ #include #include "sprite.h" void main() { SPRITES_8x8; set_sprite_data(0, 8, sprite); set_sprite_tile(0, 0); move_sprite(0, 50, 50); SHOW_SPRITES; } ================================================ FILE: small_sprite/sprite.c ================================================ /* SPRITE.C Tile Source File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 0 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Start of tile array. */ unsigned char sprite[] = { 0x7E,0x7E,0x99,0x99,0x81,0x81,0xA5,0xA5, 0x81,0x81,0xDB,0xDB,0xC3,0xC3,0x3C,0x3C }; /* End of SPRITE.C */ ================================================ FILE: small_sprite/sprite.h ================================================ /* SPRITE.H Include File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 0 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Bank of tiles. */ #define spriteBank 0 /* Start of tile array. */ extern unsigned char sprite[]; /* End of SPRITE.H */ ================================================ FILE: window/Makefile ================================================ LCC = $(GBDKDIR)bin/lcc CC = $(LCC) -Wa-l -Wl-m BIN = window.gb OBJS = main.o all: $(BIN) $(BIN): $(OBJS) $(CC) -o $(BIN) $(OBJS) clean: rm -f *.o *.lst *.sym *.asm *.gb *.ihx *.noi *.map ================================================ FILE: window/README.md ================================================ # Window ![](screenshot.png) Demonstrates the use of the window layer along with the background layer. Both use similar API. ================================================ FILE: window/bg.c ================================================ /* Advanced PCX to GameBoy converter v2.15 Tiles data Original PCX File : "BG.PCX" Number of Tiles : 152 TileMap Size : 20x18 */ const unsigned char bg_tiledata[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFC,0xFF,0xFE,0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF,0xFE,0xFF, 0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF, 0x3E,0xFF,0x3E,0xFF,0x3E,0xFF,0x3E,0xFF,0x3E,0xFF,0x3F,0xFF,0x1F,0xFF,0x3F,0xFF, 0x3F,0xFF,0x7F,0xFF,0x7F,0xFF,0xFD,0xFF,0xFA,0xFF,0xF9,0xFF,0xD4,0xFF,0xAA,0xFF, 0x00,0xFF,0x80,0xFF,0x00,0xFF,0x80,0xFF,0x80,0xFF,0x20,0xFF,0x40,0xFF,0x20,0xFF, 0x00,0xFF,0x00,0xFF,0x02,0xFF,0x00,0xFF,0x23,0xFF,0x01,0xFF,0x20,0xFF,0x15,0xFF, 0x80,0xFF,0x00,0xFF,0x81,0xFF,0x81,0xFF,0x04,0xFF,0x84,0xFF,0x88,0xFF,0x40,0xFF, 0x9E,0xFF,0x82,0xFF,0x3B,0xFE,0x12,0xFF,0x00,0xFF,0x04,0xFB,0x00,0xFF,0x40,0xFF, 0xFC,0x03,0xED,0x12,0xBC,0x43,0xEE,0x11,0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,0x17,0xEF,0x17,0xEF,0x2B,0xD7,0x8B,0xF7, 0x0F,0xFF,0x07,0xFF,0x0F,0xFF,0x07,0xFF,0x0F,0xFF,0x0F,0xFF,0x5F,0xFF,0x0F,0xF7, 0xAB,0xD7,0xCB,0xF7,0xDB,0xE7,0x4B,0xF7,0xCD,0xF3,0xC5,0xFB,0xC9,0x77,0xED,0xF3, 0x1F,0xFE,0x0F,0xFF,0x1B,0xFF,0x0F,0xFF,0x1F,0xFF,0x1F,0xFF,0x3F,0xFF,0x1F,0xEF, 0xE5,0xFB,0xF5,0xFB,0xF5,0xFB,0xF5,0xFB,0xE4,0xFB,0xF2,0xFD,0xF2,0xFD,0xF0,0xFF, 0x3F,0xFF,0x1F,0xFF,0x1F,0xFF,0x1F,0xFF,0x5F,0xFF,0x3F,0xFF,0x3F,0xFF,0x1F,0xFF, 0xF2,0xFD,0xF8,0xFF,0xF8,0xFF,0xFA,0xFD,0xF8,0xFF,0xF8,0xFF,0xF9,0xFE,0xFC,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0x7F,0xFF,0x7F,0xFF}; ================================================ FILE: window/bg_map.c ================================================ /* Advanced PCX to GameBoy converter v2.15 TileMap data Original PCX File : "BG.PCX" Number of Tiles : 152 TileMap Size : 20x18 */ const unsigned char bg_tilemap[] = { 0x01,0x01,0x02,0x03,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x03,0x03, 0x01,0x01,0x11,0x03,0x03,0x12,0x13,0x03,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x0F,0x1C,0x1D,0x03, 0x1E,0x1F,0x20,0x03,0x03,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x0F,0x2C,0x2D,0x2E, 0x03,0x03,0x03,0x03,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x0F,0x3B,0x0F,0x3C, 0x3D,0x3E,0x3F,0x03,0x40,0x41,0x42,0x43,0x44,0x45,0x0F,0x46,0x47,0x48,0x49,0x4A,0x0F,0x4B,0x0F,0x4C, 0x4D,0x4E,0x4F,0x03,0x50,0x51,0x52,0x53,0x54,0x55,0x0F,0x0F,0x56,0x57,0x58,0x59,0x0F,0x5A,0x5B,0x5C, 0x5D,0x5E,0x5F,0x03,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x0F,0x0F,0x6B,0x03,0x03, 0x6C,0x6D,0x6E,0x03,0x6F,0x70,0x71,0x72,0x0F,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x03,0x7C, 0x7D,0x7E,0x7F,0x03,0x03,0x03,0x80,0x03,0x81,0x82,0x83,0x84,0x85,0x86,0x03,0x03,0x03,0x03,0x03,0x87, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x88,0x89,0x8A,0x01,0x8B,0x8C,0x01,0x01,0x01,0x01,0x01,0x01, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x8D,0x8E,0x01,0x01,0x8F,0x90,0x01,0x01,0x01,0x01,0x01,0x01, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x91,0x01,0x01,0x01,0x01,0x92,0x01,0x01,0x01,0x01,0x01,0x01, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x93,0x01,0x01,0x01,0x01,0x94,0x01,0x01,0x01,0x01,0x01,0x01, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x95,0x01,0x01,0x01,0x01,0x96,0x97,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}; ================================================ FILE: window/border.c ================================================ /* BORDER.C Tile Source File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 8 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Start of tile array. */ const unsigned char border[] = { 0x00,0x00,0x1F,0x1F,0x20,0x20,0x4F,0x4F, 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, 0x4F,0x4F,0x20,0x20,0x1F,0x1F,0x00,0x00, 0x00,0x00,0xF8,0xF8,0x04,0x04,0xF2,0xF2, 0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A, 0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A, 0xF2,0xF2,0x04,0x04,0xF8,0xF8,0x00,0x00, 0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00, 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, 0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A, 0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; /* End of BORDER.C */ ================================================ FILE: window/border.h ================================================ /* BORDER.H Include File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter : None. Tile size : 8 x 8 Tiles : 0 to 8 Palette colors : None. SGB Palette : None. CGB Palette : None. Convert to metatiles : No. This file was generated by GBTD v2.2 */ /* Bank of tiles. */ #define borderBank 0 /* Start of tile array. */ extern unsigned char border[]; /* End of BORDER.H */ ================================================ FILE: window/main.c ================================================ #include #include "bg.c" #include "bg_map.c" #include "border.c" #include "window.c" void main() { set_bkg_data(0, 152, bg_tiledata); set_bkg_tiles(0, 0, 20, 18, bg_tilemap); SHOW_BKG; set_win_data(152, 9, border); set_win_tiles(0, 0, 20, 4, window); move_win(7, 112); SHOW_WIN; } ================================================ FILE: window/window.c ================================================ /* WINDOW.C Map Source File. Info: Section : Bank : 0 Map size : 20 x 4 Tile set : P:\Homebrew\GB\gbdk_playground\window\border.gbr Plane count : 1 plane (8 bits) Plane order : Tiles are continues Tile offset : 152 Split data : No This file was generated by GBMB v1.8 */ #define windowWidth 20 #define windowHeight 4 #define windowBank 0 const unsigned char window[] = { 0x98,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C, 0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9A, 0x9E,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0x9F, 0x9E,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0, 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0x9F, 0x99,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D, 0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9B }; /* End of WINDOW.C */ ================================================ FILE: window/window.h ================================================ /* WINDOW.H Map Include File. Info: Section : Bank : 0 Map size : 20 x 4 Tile set : P:\Homebrew\GB\gbdk_playground\window\border.gbr Plane count : 1 plane (8 bits) Plane order : Tiles are continues Tile offset : 152 Split data : No This file was generated by GBMB v1.8 */ #define windowWidth 20 #define windowHeight 4 #define windowBank 0 extern unsigned char window[]; /* End of WINDOW.H */