main.c (1123B)
1#include <gb/gb.h> 2#include <stdint.h> 3#include <gb/gbdecompress.h> 4#include <stdbool.h> 5 6// Include graphics data 7#include "monalisa_tiles_comp.h" 8#include "monalisa_map.h" 9 10// The map tiles were exported from GBTD with compression enabled 11// using this updated version of GBTD: https://github.com/untoxa/GBTD_GBMB 12// Size was 4096 bytes -> 3493 bytes 13 14void main(void) 15{ 16 // Decompress the map tiles into the background tile vram. 17 // 18 // Notice that the number of tiles isn't specified. The amount 19 // of data to decompress is embedded in the compressed data. 20 // 21 // Note: For non-compressed data the equivalent would be: set_bkg_data(0, 253u, monalisa_tiles) 22 // 23 gb_decompress_bkg_data(0, monalisa_tiles_comp); // first tile, pointer to comrpessed data 24 25 // Now set the map and turn the background on 26 set_bkg_tiles(0,0, monalisa_mapWidth, monalisa_mapHeight, monalisa_mapPLN0); 27 SHOW_BKG; 28 29 // Loop forever 30 while(1) { 31 32 // Main loop processing goes here 33 34 // Done processing, yield CPU and wait for start of next frame 35 wait_vbl_done(); 36 } 37} 38 39 40 41