gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit a3f9fde586c6de3bbc8012a2d99442f3582745bd parent c46ca807c4eeb106cd373cf19bfd5335cd2bed23 Author: Toxa <untoxa@mail.ru> Date: Sat, 4 Sep 2021 23:23:38 +0300 SMS/GG: gb_decompress(); gb_decompress() now returns decompressed size for all targets Diffstat:
22 files changed, 1118 insertions(+), 65 deletions(-)
diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/Makefile b/gbdk-lib/examples/cross-platform/gbdecompress/Makefile @@ -0,0 +1,104 @@ +# If you move this project you can change the directory +# to match your GBDK root directory (ex: GBDK_HOME = "C:/GBDK/" +GBDK_HOME = ../../../ +LCC = $(GBDK_HOME)bin/lcc +PNG2ASSET = $(GBDK_HOME)/bin/png2asset + +# Set platforms to build here, spaced separated. (These are in the separate Makefile.targets) +# They can also be built/cleaned individually: "make gg" and "make gg-clean" +# Possible are: gb gbc pocket sms gg +TARGETS=gb pocket sms gg + +# Configure platform specific LCC flags here: +LCCFLAGS_gb = -Wl-yt0x1B # Set an MBC for banking (1B-ROM+MBC5+RAM+BATT) +LCCFLAGS_pocket = -Wl-yt0x1B # Usually the same as required for .gb +LCCFLAGS_gbc = -Wl-yt0x1B -Wm-yc # Same as .gb with: -Wm-yc (gb & gbc) or Wm-yC (gbc exclusive) +LCCFLAGS_sms = +LCCFLAGS_gg = + +LCCFLAGS += $(LCCFLAGS_$(EXT)) # This adds the current platform specific LCC Flags + +LCCFLAGS += -Wl-j -Wm-yoA -Wm-ya4 -autobank -Wb-ext=.rel -Wb-v # MBC + Autobanking related flags +# LCCFLAGS += -debug # Uncomment to enable debug output +# LCCFLAGS += -v # Uncomment for lcc verbose output + +# Add directory where platform specific meta tile sprites get converted into (obj/<platform ext>/src) +# So they can be included with "#include <res/somefile.h>" +CFLAGS += -I$(OBJDIR) + +# You can set the name of the ROM file here +PROJECTNAME = gbdecompress + +SRCDIR = src +OBJDIR = obj/$(EXT) +RESOBJSRC = obj/$(EXT)/res +RESDIR = res +BINDIR = build/$(EXT) +MKDIRS = $(OBJDIR) $(BINDIR) $(RESOBJSRC) # See bottom of Makefile for directory auto-creation + +BINS = $(OBJDIR)/$(PROJECTNAME).$(EXT) +# For png2asset: converting metasprite source pngs -> .c -> .o +METAPNGS = $(foreach dir,$(RESDIR),$(notdir $(wildcard $(dir)/*.png))) +METASRCS = $(METAPNGS:%.png=$(RESOBJSRC)/%.c) +METAOBJS = $(METASRCS:$(RESOBJSRC)/%.c=$(OBJDIR)/%.o) + +CSOURCES = $(foreach dir,$(SRCDIR),$(notdir $(wildcard $(dir)/*.c))) $(foreach dir,$(RESDIR),$(notdir $(wildcard $(dir)/*.c))) +ASMSOURCES = $(foreach dir,$(SRCDIR),$(notdir $(wildcard $(dir)/*.s))) +OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o) + + +# Builds all targets sequentially +all: $(TARGETS) + +# Use png2asset to convert the png into C formatted metasprite data +# -sh 48 : Sets sprite height to 48 (width remains automatic) +# -spr8x16 : Use 8x16 hardware sprites +# -c ... : Set C output file +# Convert metasprite .pngs in res/ -> .c files in obj/<platform ext>/src/ +$(RESOBJSRC)/%.c: $(RESDIR)/%.png + $(PNG2ASSET) $< -sh 48 -spr8x16 -noflip -c $@ + +# Compile the Metasprite pngs that were converted to .c files +# .c files in obj/<platform ext>/src/ -> .o files in obj/ +$(OBJDIR)/%.o: $(RESOBJSRC)/%.c + $(LCC) $(CFLAGS) -c -o $@ $< + +# Compile .c files in "src/" to .o object files +$(OBJDIR)/%.o: $(SRCDIR)/%.c + $(LCC) $(CFLAGS) -c -o $@ $< + +# Compile .c files in "res/" to .o object files +$(OBJDIR)/%.o: $(RESDIR)/%.c + $(LCC) $(CFLAGS) -c -o $@ $< + +# Compile .s assembly files in "src/" to .o object files +$(OBJDIR)/%.o: $(SRCDIR)/%.s + $(LCC) $(CFLAGS) -c -o $@ $< + +# If needed, compile .c files i n"src/" to .s assembly files +# (not required if .c is compiled directly to .o) +$(OBJDIR)/%.s: $(SRCDIR)/%.c + $(LCC) $(CFLAGS) -S -o $@ $< + +# Convert and build MetaSprites first so they're available when compiling the main sources +$(OBJS): $(METAOBJS) + +# Link the compiled object files into a .gb ROM file +$(BINS): $(OBJS) + $(LCC) $(LCCFLAGS) $(CFLAGS) -o $(BINDIR)/$(PROJECTNAME).$(EXT) $(METAOBJS) $(OBJS) + +clean: + @echo Cleaning + @for target in $(TARGETS); do \ + $(MAKE) $$target-clean; \ + done + +# Include available build targets +include Makefile.targets + + +# create necessary directories after Makefile is parsed but before build +# info prevents the command from being pasted into the makefile +ifneq ($(strip $(EXT)),) # Only make the directories if EXT has been set by a target +$(info $(shell mkdir -p $(MKDIRS))) +endif diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/Makefile.targets b/gbdk-lib/examples/cross-platform/gbdecompress/Makefile.targets @@ -0,0 +1,44 @@ + +# Platform specific flags for compiling (only populate if they're both present) +ifneq ($(strip $(PORT)),) +ifneq ($(strip $(PLAT)),) +CFLAGS += -m$(PORT):$(PLAT) -D_PLAT_$(PLAT) +endif +endif + +# Called by the individual targets below to build a ROM +build-target: $(BINS) + +clean-target: + rm -rf $(OBJDIR) + rm -rf $(BINDIR) + +gb-clean: + ${MAKE} clean-target EXT=gb +gb: + ${MAKE} build-target PORT=gbz80 PLAT=gb EXT=gb + + +gbc-clean: + ${MAKE} clean-target EXT=gbc +gbc: + ${MAKE} build-target PORT=gbz80 PLAT=gb EXT=gbc + + +pocket-clean: + ${MAKE} clean-target EXT=pocket +pocket: + ${MAKE} build-target PORT=gbz80 PLAT=ap EXT=pocket + + +sms-clean: + ${MAKE} clean-target EXT=sms +sms: + ${MAKE} build-target PORT=z80 PLAT=sms EXT=sms + + +gg-clean: + ${MAKE} clean-target EXT=gg +gg: + ${MAKE} build-target PORT=z80 PLAT=gg EXT=gg + diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/Readme.md b/gbdk-lib/examples/cross-platform/gbdecompress/Readme.md @@ -0,0 +1,8 @@ + +GBDecompress +============ + +Demonstrates using gbdecompress to load a compressed tile set into vram. + +The tileset was compressed during export from GBTD by checking the +GB-compress checkbox in the export settings panel. diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/res/monalisa.gbm b/gbdk-lib/examples/cross-platform/gbdecompress/res/monalisa.gbm Binary files differ. diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/res/monalisa_tiles.gbr b/gbdk-lib/examples/cross-platform/gbdecompress/res/monalisa_tiles.gbr Binary files differ. diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/src/main.c b/gbdk-lib/examples/cross-platform/gbdecompress/src/main.c @@ -0,0 +1,43 @@ +#include <gbdk/platform.h> +#include <gbdk/gbdecompress.h> + +#include <stdint.h> + +// Include graphics data +#include "monalisa_tiles_comp.h" +#include "monalisa_map.h" + +// The map tiles were exported from GBTD with compression enabled +// using this updated version of GBTD: https://github.com/untoxa/GBTD_GBMB +// Size was 4096 bytes -> 3493 bytes + +uint8_t buffer[4096]; + +void main(void) +{ + // Decompress the map tiles into the background tile vram. + // + // Notice that the number of tiles isn't specified. The amount + // of data to decompress is embedded in the compressed data. + // + // Note: For non-compressed data the equivalent would be: set_bkg_data(0, 253u, monalisa_tiles) + // + set_bkg_data(0, gb_decompress(monalisa_tiles_comp, buffer) >> 4, buffer); + + // Now set the map and turn the background on + set_bkg_tiles(0,0, monalisa_mapWidth, monalisa_mapHeight, monalisa_mapPLN0); + SHOW_BKG; + + // Loop forever + while(1) { + + // Main loop processing goes here + + // Done processing, yield CPU and wait for start of next frame + wait_vbl_done(); + } +} + + + + diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/src/monalisa_map.c b/gbdk-lib/examples/cross-platform/gbdecompress/src/monalisa_map.c @@ -0,0 +1,66 @@ +/* + + MONALISA_MAP.C + + Map Source File. + + Info: + Section : + Bank : 0 + Map size : 20 x 18 + Tile set : monalisa_tiles.gbr + Plane count : 1 plane (8 bits) + Plane order : Planes are continues + Tile offset : 0 + Split data : No + + This file was generated by GBMB v1.8 + +*/ + +#define monalisa_mapWidth 20 +#define monalisa_mapHeight 18 +#define monalisa_mapBank 0 + +#define monalisa_map monalisa_mapPLN0 +const unsigned char monalisa_mapPLN0[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02, + 0x03,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x06,0x07, + 0x08,0x09,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x0C,0x0D,0x0E, + 0x0F,0x10,0x11,0x12,0x00,0x00,0x00,0x00,0x00,0x00, + 0x13,0x14,0x00,0x00,0x00,0x00,0x15,0x16,0x00,0x17, + 0x18,0x19,0x1A,0x1B,0x1C,0x13,0x00,0x00,0x00,0x00, + 0x1D,0x1E,0x1F,0x20,0x21,0x00,0x22,0x23,0x24,0x25, + 0x26,0x27,0x1A,0x28,0x29,0x2A,0x2B,0x00,0x00,0x00, + 0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35, + 0x36,0x37,0x1A,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E, + 0x3F,0x40,0x41,0x41,0x42,0x43,0x44,0x45,0x46,0x47, + 0x48,0x49,0x1A,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50, + 0x51,0x52,0x41,0x53,0x54,0x55,0x56,0x57,0x58,0x59, + 0x5A,0x5B,0x1A,0x1A,0x5C,0x5D,0x5E,0x5F,0x60,0x61, + 0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x1A,0x69,0x6A, + 0x6B,0x6C,0x1A,0x1A,0x6D,0x6E,0x6F,0x70,0x71,0x72, + 0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x1A,0x7A,0x7B, + 0x7C,0x7D,0x7E,0x1A,0x7F,0x80,0x81,0x82,0x83,0x84, + 0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E, + 0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98, + 0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0x00, + 0x00,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA, + 0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0x00,0x00, + 0x00,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB, + 0xBC,0xBD,0xBE,0xBF,0xC0,0x1A,0xC1,0xC2,0xC3,0x00, + 0xC4,0xC5,0xC6,0xC7,0x1A,0x1A,0x1A,0xC8,0xC9,0xCA, + 0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4, + 0xD5,0xD6,0x1A,0x1A,0xD7,0xD8,0x1A,0xD9,0xDA,0xDB, + 0xDC,0xDD,0xDE,0xDF,0x1A,0xE0,0xE1,0xE2,0xE3,0xE4, + 0xE5,0x1A,0x1A,0xE6,0xE7,0xE8,0x1A,0xE9,0xEA,0xEB, + 0xEC,0xED,0xEE,0xEF,0xF0,0x1A,0x1A,0x1A,0xF1,0xF2, + 0x1A,0x1A,0x1A,0xF3,0xF4,0x1A,0x1A,0x1A,0xF5,0xF6, + 0xF7,0xF8,0xF9,0xFA,0xFB,0x1A,0x1A,0x1A,0x1A,0x1A, + 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0xFC +}; + +/* End of MONALISA_MAP.C */ diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/src/monalisa_map.h b/gbdk-lib/examples/cross-platform/gbdecompress/src/monalisa_map.h @@ -0,0 +1,32 @@ +/* + + MONALISA_MAP.H + + Map Include File. + + Info: + Section : + Bank : 0 + Map size : 20 x 18 + Tile set : monalisa_tiles.gbr + Plane count : 1 plane (8 bits) + Plane order : Planes are continues + Tile offset : 0 + Split data : No + + This file was generated by GBMB v1.8 + +*/ +#ifndef __monalisa_map_h_INCLUDE +#define __monalisa_map_h_INCLUDE + +#define monalisa_mapWidth 20 +#define monalisa_mapHeight 18 +#define monalisa_mapBank 0 + +#define monalisa_map monalisa_mapPLN0 +extern const unsigned char monalisa_mapPLN0[]; + +#endif + +/* End of MONALISA_MAP.H */ diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/src/monalisa_tiles_comp.c b/gbdk-lib/examples/cross-platform/gbdecompress/src/monalisa_tiles_comp.c @@ -0,0 +1,467 @@ +/* + + MONALISA_TILES_COMP.C + + Tile Source File. + + Info: + Form : All tiles as one unit. + Format : Gameboy 4 color. + Compression : GB-Compress. + Counter : None. + Tile size : 8 x 8 + Tiles : 0 to 252 + + Palette colors : Included. + 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 monalisa_tiles_comp[] = +{ + 0x1D,0x00,0xC1,0x02,0x01,0x8B,0xE0,0xFF, + 0xC3,0x10,0x2F,0x11,0xFF,0x8B,0xD0,0xFF, + 0xC2,0x0D,0xF2,0x54,0x8C,0xF0,0xFF,0xC2, + 0x00,0x00,0xE0,0x89,0xB1,0xFF,0xE9,0x01, + 0x02,0x01,0x02,0x07,0x08,0x07,0x02,0x0F, + 0x20,0x1F,0x6A,0x3F,0x82,0x7D,0xA1,0xFE, + 0xAB,0x54,0x01,0xFE,0xAF,0x50,0xAF,0xFF, + 0x0D,0xFF,0x2F,0xFF,0x81,0x7F,0x2A,0xFF, + 0xA0,0x5F,0x0A,0xFF,0xA8,0x57,0xFF,0xFF, + 0xDD,0x02,0xFF,0xD0,0x57,0xFF,0xFF,0xFF, + 0x5D,0xFF,0x3F,0xFF,0x15,0xFF,0xE0,0xF8, + 0xDA,0xFC,0xFF,0xFE,0xDF,0x08,0xFF,0x84, + 0x60,0xFF,0xCA,0x80,0x80,0x00,0x80,0xE0, + 0xD0,0xE0,0xE0,0xF0,0xF0,0xF8,0x8B,0x50, + 0xFF,0xD8,0x01,0x00,0x01,0x00,0x1A,0x0F, + 0x00,0x1F,0x09,0x3E,0x64,0x18,0xE6,0x38, + 0x0C,0x70,0xE8,0x70,0x50,0xE0,0x1E,0xE0, + 0xC0,0x00,0x80,0x8A,0x2B,0xFF,0xC5,0xD0, + 0x2F,0x45,0x00,0x2B,0x00,0x89,0x39,0xFF, + 0xCF,0xBF,0xFF,0x1D,0xFF,0x8F,0x7F,0x61, + 0x1F,0xC3,0x3F,0x79,0x07,0xBA,0x07,0x18, + 0x07,0x85,0x97,0xFF,0xC3,0x7F,0xFF,0xFF, + 0xFF,0x83,0x8C,0xFF,0xC5,0x5F,0xFF,0xF8, + 0xFC,0xFE,0xFC,0x02,0xFE,0x8C,0x80,0xFF, + 0xC0,0x40,0x83,0xFC,0xFF,0xC6,0x80,0x40, + 0x80,0xE0,0x80,0x80,0xC0,0x84,0x71,0xFF, + 0xC9,0x00,0x00,0x00,0x90,0x00,0x10,0x00, + 0xB3,0x00,0x51,0x8A,0xC1,0xFE,0xE3,0x05, + 0x00,0x3F,0x00,0x5F,0x00,0x02,0x01,0x02, + 0x01,0x04,0x03,0x06,0x01,0x07,0x0B,0x19, + 0x07,0x1B,0x07,0x1D,0x07,0xD8,0xE0,0xF4, + 0xC0,0xD8,0xE0,0x70,0xC0,0xD8,0xE0,0xB4, + 0xC0,0x98,0xE0,0x85,0xC0,0xFF,0x84,0xA6, + 0xFE,0x83,0xA2,0xFE,0xD2,0x00,0x00,0x00, + 0xB0,0x0F,0x5A,0x05,0xBC,0x03,0x1E,0x01, + 0xBD,0x02,0x55,0x00,0xAF,0x00,0x01,0x00, + 0x83,0x7C,0xFF,0xCB,0xBF,0xFF,0x9F,0x7F, + 0x0F,0xFF,0xEF,0x1F,0xCF,0x3F,0x67,0x1F, + 0x0F,0xFF,0xFF,0xCA,0xE0,0xF1,0xC0,0xFF, + 0xE0,0xF7,0xE0,0xE5,0xFA,0xEF,0xF0,0xFD, + 0xF2,0xFE,0xF1,0xC0,0x00,0x40,0x00,0xEE, + 0x00,0x45,0x00,0xFF,0x00,0x75,0x00,0xDF, + 0x20,0xFD,0x00,0x55,0xAA,0x77,0x80,0x9D, + 0xE2,0x0E,0xF1,0xE4,0xFB,0xCA,0xF5,0xE0, + 0xFF,0x0A,0xF5,0x7D,0x82,0xBD,0x40,0x5D, + 0xA2,0xBF,0x40,0x15,0xEA,0xBF,0x40,0x1D, + 0xE2,0xBF,0x40,0xD5,0xC0,0x00,0xD5,0x00, + 0x7F,0x80,0xF7,0x00,0xD5,0x2A,0xDF,0x00, + 0xFD,0x02,0x7B,0x04,0xA8,0x00,0x54,0x00, + 0xFE,0x00,0x83,0xC8,0xFF,0xC5,0xFF,0x00, + 0xC1,0x3E,0xBB,0x44,0x83,0xF0,0xFD,0xDB, + 0xC0,0x00,0xD0,0x00,0x5C,0xA0,0xF4,0x00, + 0xFC,0x00,0xDC,0x00,0x17,0x0F,0x1D,0x07, + 0x17,0x2F,0x2D,0x17,0x4B,0x3F,0x61,0x1F, + 0x4A,0x3F,0x65,0x1F,0x83,0x3C,0xFF,0xCB, + 0x8A,0xE0,0x01,0xC0,0x94,0xEB,0xAC,0xD0, + 0x84,0xFB,0x24,0xD9,0x85,0xF0,0xFE,0xFF, + 0x40,0x00,0x10,0xE0,0x70,0x00,0x98,0xE0, + 0x30,0xC0,0x00,0x00,0x04,0x00,0x3F,0x00, + 0x6F,0x10,0xC1,0x3E,0x8D,0x70,0xBC,0x63, + 0xB0,0x41,0xAB,0x00,0x45,0x00,0xFD,0x02, + 0xFE,0x01,0x0A,0xFF,0x60,0x1F,0x2A,0xFF, + 0x8B,0x74,0xCF,0x3F,0xEF,0x1F,0x0F,0xFF, + 0xA7,0x5F,0x8F,0xFF,0x27,0xDF,0x4F,0xBF, + 0x67,0x1F,0xF0,0xFF,0xFA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F2,0x08, + 0x54,0x00,0xE8,0x84,0x10,0xFE,0xC5,0x05, + 0x00,0x03,0x00,0x01,0x00,0x83,0x2C,0xFE, + 0x83,0x28,0xFE,0xCF,0xCF,0x3F,0x6F,0x1F, + 0xCF,0x3F,0xA7,0x5F,0xFA,0xFF,0xFA,0xFD, + 0xFA,0xFF,0xFC,0xFF,0x83,0xFC,0xFF,0xCB, + 0xFC,0xFF,0xFB,0xFC,0xA0,0xFF,0x8A,0x75, + 0xA0,0xFF,0x0B,0xF4,0x85,0x5C,0xFF,0xC7, + 0xFF,0x00,0x00,0xFF,0x2B,0xD4,0x01,0xFE, + 0x83,0x50,0xFF,0xC1,0xA8,0x57,0x83,0xF0, + 0xFF,0xCE,0x70,0x80,0xB0,0x40,0x10,0xE0, + 0xB0,0x40,0x18,0xE0,0xBC,0x40,0x1F,0xE0, + 0xFD,0x8E,0x41,0xFC,0xC0,0x55,0x84,0xEA, + 0xFC,0xC4,0x07,0x00,0x05,0x00,0x0F,0x84, + 0x70,0xFD,0xF2,0x55,0x00,0xC0,0x00,0x44, + 0x00,0xEF,0x00,0x55,0x00,0xFF,0x00,0x55, + 0x00,0xBF,0x00,0x5F,0x00,0x8A,0xFF,0x20, + 0xDF,0x8A,0xFF,0xA8,0x57,0x82,0xFF,0xA0, + 0xDF,0x0E,0xFF,0x10,0xFF,0x82,0xFF,0x22, + 0xDD,0x80,0xFF,0x20,0xDF,0x82,0xFF,0x08, + 0xF7,0xA0,0xFF,0x08,0xF7,0x02,0x84,0xB8, + 0xFE,0x85,0xE0,0xFE,0xC7,0x20,0xFF,0x28, + 0xD7,0xAA,0xFF,0x02,0xFD,0x83,0x6C,0xFF, + 0xD3,0x20,0xFF,0x88,0x77,0x00,0xFF,0x22, + 0xDD,0xAA,0xFF,0x00,0xFF,0x2A,0xFF,0x00, + 0xFF,0x2B,0xFF,0x20,0xDF,0x83,0xF8,0xFF, + 0x83,0xB0,0xFC,0xC2,0xFF,0xFF,0x77,0x86, + 0xC0,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0x0F,0xFF,0xAF,0x88,0x08,0xFE,0x83, + 0x48,0xF8,0x83,0xD5,0xF7,0x85,0xDC,0xFB, + 0xCE,0xF9,0xFE,0xD3,0xFC,0xFA,0xFF,0xC3, + 0xFC,0xE6,0xF8,0x3C,0xC0,0x9A,0xE0,0xD4, + 0x84,0x72,0xF7,0xC4,0x7B,0x80,0x44,0x00, + 0xAA,0x86,0x90,0xF8,0x83,0x14,0xF7,0xC2, + 0xFF,0x00,0x54,0x84,0xF0,0xFF,0xC0,0xA0, + 0x86,0x07,0xF7,0xC2,0xBD,0x02,0x47,0x84, + 0x88,0xF8,0xC8,0x23,0x00,0x04,0x00,0x0B, + 0x00,0x01,0x00,0x7F,0x84,0x88,0xFF,0xD9, + 0x95,0x7F,0x0A,0xFF,0x88,0x7F,0x2E,0xFF, + 0x84,0x7F,0xFF,0xFF,0xCF,0xFF,0xFF,0xFF, + 0x07,0xFF,0x2F,0xFF,0x8D,0x7F,0x2F,0xFF, + 0x95,0x7F,0x89,0x74,0xFE,0x83,0xF8,0xFD, + 0xC5,0x5F,0xFF,0xAE,0xFF,0x06,0xFD,0x83, + 0xE8,0xFC,0xF7,0xE8,0xFF,0x2B,0xD4,0xA7, + 0xF8,0x03,0xFC,0x39,0xFE,0x1C,0xFF,0xBA, + 0xFF,0x02,0xFD,0x55,0xAA,0xF4,0x00,0xFF, + 0x00,0x17,0x00,0xF5,0x0A,0xFD,0x00,0x7C, + 0x83,0xD6,0x01,0xF8,0x07,0x5B,0x04,0xDD, + 0x22,0xDF,0x00,0x10,0xEF,0x7A,0x85,0x5C, + 0xA3,0xBE,0x41,0x14,0xEB,0xBA,0x45,0x00, + 0xFF,0xEA,0x15,0x83,0x78,0xF9,0xC5,0x24, + 0xFB,0x0E,0xF1,0xA4,0xFB,0x83,0x90,0xFD, + 0xC1,0xFE,0x01,0x85,0x90,0xFB,0x83,0xD4, + 0xFC,0x83,0x70,0xF9,0xC9,0x22,0xDD,0xAE, + 0xFF,0x00,0xFF,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5F,0xA0,0xF6,0x01,0x75, + 0x8A,0xEF,0x10,0xDD,0x22,0x55,0x00,0x04, + 0xFB,0xEB,0x14,0x40,0xBF,0xBA,0x45,0x10, + 0xEF,0xEA,0x15,0xC0,0x3F,0x5A,0x05,0x88, + 0xFF,0x28,0xD7,0x8A,0x84,0x8C,0xFA,0xC1, + 0x8A,0xF5,0x83,0x64,0xFA,0x83,0x30,0xF9, + 0x83,0xDC,0xFE,0x85,0x3C,0xFB,0xC7,0xA8, + 0x57,0xDF,0xA0,0x2D,0xD0,0x85,0xFA,0x83, + 0x5C,0xFD,0x83,0x00,0xFF,0xC9,0xA2,0x5D, + 0x54,0xAB,0x5E,0x01,0xDD,0x22,0x5F,0x00, + 0x83,0xFC,0xF6,0xC1,0x11,0xEE,0x83,0x30, + 0xFC,0xCD,0x02,0xFD,0x28,0xFF,0xA8,0x57, + 0x03,0xFF,0xE9,0x17,0xDB,0x27,0xF9,0x07, + 0x83,0x68,0xFA,0x85,0xF0,0xFE,0x83,0x8D, + 0xF5,0xD4,0xF7,0xFF,0xF8,0xFF,0xDB,0xFC, + 0xF9,0xFE,0xF1,0xFC,0xF6,0xF8,0xCC,0xF0, + 0xE6,0xF8,0xCC,0xF0,0x58,0xA0,0xF0,0x86, + 0x2A,0xF5,0x83,0xFA,0xF5,0xC2,0x00,0x00, + 0x03,0x86,0x38,0xF8,0x83,0x48,0xF9,0x83, + 0xD0,0xFD,0x83,0x40,0xFD,0x83,0xC4,0xFB, + 0xE3,0x29,0xFE,0xAA,0x55,0xD0,0x2F,0xEB, + 0x14,0xFA,0xFF,0x40,0xFF,0x8D,0xF2,0xFF, + 0x00,0x45,0xBA,0xB4,0x40,0x6D,0x82,0x18, + 0x07,0xAA,0xFF,0x3E,0xC1,0x52,0xAF,0xFF, + 0x00,0xFC,0x03,0x61,0x1F,0x85,0xD4,0xFE, + 0xC6,0x2F,0xDF,0xFF,0xFF,0xA7,0x5F,0xBF, + 0x84,0x90,0xF5,0xC3,0xFF,0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C8,0xFF,0xFF, + 0xEA,0xFF,0xC1,0xFF,0xEA,0xFF,0xD0,0x83, + 0xB0,0xFA,0xC6,0xFF,0xFA,0xFF,0xD2,0xFD, + 0xA9,0xFE,0x83,0x10,0xFD,0x83,0x30,0xF9, + 0x83,0x98,0xFB,0xDA,0x28,0xD7,0xAD,0x02, + 0xD7,0x00,0x9D,0xE2,0x8B,0x74,0x25,0xFA, + 0x22,0xDD,0x03,0xFE,0x20,0xDF,0xA8,0xFF, + 0x42,0xFD,0xFA,0xFF,0x54,0xFF,0xFE,0x84, + 0x00,0xFA,0xC5,0x57,0xFF,0x44,0xBB,0x2F, + 0xD0,0x83,0xA8,0xF3,0xC1,0x05,0xFA,0x83, + 0xCC,0xF6,0xC9,0x02,0xFD,0x04,0xFB,0xAB, + 0x54,0x55,0xAA,0xBF,0x40,0x83,0x30,0xF5, + 0xCF,0x48,0xB7,0xAA,0x55,0x43,0xBF,0x29, + 0xD7,0x43,0xBF,0xD9,0x07,0x53,0xAF,0xF9, + 0x07,0x85,0xB0,0xFA,0x8B,0xC8,0xFB,0xC0, + 0x7F,0x86,0xA4,0xF7,0x83,0x80,0xF6,0xFF, + 0xF8,0xFF,0xFA,0xFF,0xF9,0xFF,0x82,0xFF, + 0x20,0xDF,0xA3,0xFF,0x09,0xF7,0xAA,0xFF, + 0x44,0xFF,0xEE,0xFF,0x44,0xFF,0x80,0xFF, + 0x0A,0xF5,0xA8,0xFF,0x82,0x7D,0x88,0xFF, + 0x02,0xFD,0x38,0xFF,0x52,0xFD,0x45,0xBA, + 0x7F,0x80,0x0D,0xF2,0xFA,0x05,0x01,0xFE, + 0xEA,0x15,0x84,0x7B,0xAA,0x55,0x6A,0x80, + 0xFF,0x00,0x5D,0xA2,0xBE,0x41,0x40,0xBF, + 0x83,0xAC,0xF5,0xC5,0x88,0x77,0x0F,0x00, + 0xFE,0x01,0x83,0x14,0xFA,0xCE,0x44,0xBB, + 0x98,0x67,0x08,0xFF,0x29,0xD7,0x0B,0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xC4,0x0D,0xFF,0xBF,0xFF,0x15,0x8A,0x28, + 0xF7,0x85,0xF8,0xFD,0xC6,0xFF,0xFF,0xED, + 0xFF,0xFF,0xFF,0x50,0x86,0x88,0xFF,0x83, + 0x64,0xF5,0xC6,0x81,0xFF,0xFE,0xFF,0x01, + 0xFF,0xA2,0x84,0x4C,0xF8,0xC2,0x50,0xFF, + 0xEA,0x83,0xFC,0xFF,0xC2,0xFF,0xD0,0xFF, + 0x00 +}; + +/* End of MONALISA_TILES_COMP.C */ diff --git a/gbdk-lib/examples/cross-platform/gbdecompress/src/monalisa_tiles_comp.h b/gbdk-lib/examples/cross-platform/gbdecompress/src/monalisa_tiles_comp.h @@ -0,0 +1,107 @@ +/* + + MONALISA_TILES_COMP.H + + Include File. + + Info: + Form : All tiles as one unit. + Format : Gameboy 4 color. + Compression : GB-Compress. + Counter : None. + Tile size : 8 x 8 + Tiles : 0 to 252 + + Palette colors : Included. + SGB Palette : None. + CGB Palette : None. + + Convert to metatiles : No. + + This file was generated by GBTD v2.2 + +*/ + +#ifndef __monalisa_tiles_comp_h_INCLUDE +#define __monalisa_tiles_comp_h_INCLUDE + +/* Bank of tiles. */ +#define monalisa_tiles_compBank 0 + +/* Super Gameboy palette 0 */ +#define monalisa_tiles_compSGBPal0c0 0 +#define monalisa_tiles_compSGBPal0c1 0 +#define monalisa_tiles_compSGBPal0c2 18432 +#define monalisa_tiles_compSGBPal0c3 749 + +/* Super Gameboy palette 1 */ +#define monalisa_tiles_compSGBPal1c0 6076 +#define monalisa_tiles_compSGBPal1c1 8935 +#define monalisa_tiles_compSGBPal1c2 6596 +#define monalisa_tiles_compSGBPal1c3 5344 + +/* Super Gameboy palette 2 */ +#define monalisa_tiles_compSGBPal2c0 6076 +#define monalisa_tiles_compSGBPal2c1 8935 +#define monalisa_tiles_compSGBPal2c2 6596 +#define monalisa_tiles_compSGBPal2c3 5344 + +/* Super Gameboy palette 3 */ +#define monalisa_tiles_compSGBPal3c0 6076 +#define monalisa_tiles_compSGBPal3c1 8935 +#define monalisa_tiles_compSGBPal3c2 6596 +#define monalisa_tiles_compSGBPal3c3 5344 + +/* Gameboy Color palette 0 */ +#define monalisa_tiles_compCGBPal0c0 4228 +#define monalisa_tiles_compCGBPal0c1 11627 +#define monalisa_tiles_compCGBPal0c2 20083 +#define monalisa_tiles_compCGBPal0c3 30653 + +/* Gameboy Color palette 1 */ +#define monalisa_tiles_compCGBPal1c0 6076 +#define monalisa_tiles_compCGBPal1c1 8935 +#define monalisa_tiles_compCGBPal1c2 6596 +#define monalisa_tiles_compCGBPal1c3 5344 + +/* Gameboy Color palette 2 */ +#define monalisa_tiles_compCGBPal2c0 6076 +#define monalisa_tiles_compCGBPal2c1 8935 +#define monalisa_tiles_compCGBPal2c2 6596 +#define monalisa_tiles_compCGBPal2c3 5344 + +/* Gameboy Color palette 3 */ +#define monalisa_tiles_compCGBPal3c0 6076 +#define monalisa_tiles_compCGBPal3c1 8935 +#define monalisa_tiles_compCGBPal3c2 6596 +#define monalisa_tiles_compCGBPal3c3 5344 + +/* Gameboy Color palette 4 */ +#define monalisa_tiles_compCGBPal4c0 6076 +#define monalisa_tiles_compCGBPal4c1 8935 +#define monalisa_tiles_compCGBPal4c2 6596 +#define monalisa_tiles_compCGBPal4c3 5344 + +/* Gameboy Color palette 5 */ +#define monalisa_tiles_compCGBPal5c0 6076 +#define monalisa_tiles_compCGBPal5c1 8935 +#define monalisa_tiles_compCGBPal5c2 6596 +#define monalisa_tiles_compCGBPal5c3 5344 + +/* Gameboy Color palette 6 */ +#define monalisa_tiles_compCGBPal6c0 6076 +#define monalisa_tiles_compCGBPal6c1 8935 +#define monalisa_tiles_compCGBPal6c2 6596 +#define monalisa_tiles_compCGBPal6c3 5344 + +/* Gameboy Color palette 7 */ +#define monalisa_tiles_compCGBPal7c0 6076 +#define monalisa_tiles_compCGBPal7c1 8935 +#define monalisa_tiles_compCGBPal7c2 6596 +#define monalisa_tiles_compCGBPal7c3 5344 +/* Start of tile array. */ +extern const unsigned char monalisa_tiles_comp[]; + +#endif + +/* End of MONALISA_TILES_COMP.H */ diff --git a/gbdk-lib/include/gbdk/bcd.h b/gbdk-lib/include/gb/bcd.h diff --git a/gbdk-lib/include/gb/gbdecompress.h b/gbdk-lib/include/gb/gbdecompress.h @@ -16,7 +16,7 @@ @see gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data */ -void gb_decompress(const uint8_t * sour, uint8_t * dest) __preserves_regs(b, c); +uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) __preserves_regs(b, c); /** gb-decompress background tiles into VRAM diff --git a/gbdk-lib/include/gbdk/bcd.h b/gbdk-lib/include/gbdk/bcd.h @@ -1,61 +1,12 @@ -#ifndef __BCD_H_INCLUDE -#define __BCD_H_INCLUDE - -#include <stdint.h> -#include <asm/types.h> - -/** @file bcd.h - Support for working with BCD (Binary Coded Decimal) - - See the example BCD project for additional details. -*/ - -// macro for creating BCD constants -#define BCD_HEX(v) ((BCD)(v)) - -/** Converts an integer value into BCD format - - A maximum of 8 digits may be used -*/ -#define MAKE_BCD(v) BCD_HEX(0x ## v) - -typedef uint32_t BCD; - -/** Converts integer __i__ into BCD format (Binary Coded Decimal) - @param i Numeric value to convert - @param value Pointer to a BCD variable to store the converted result -*/ -void uint2bcd(uint16_t i, BCD * value); - -/** Adds two numbers in BCD format: __sour__ += __value__ - @param sour Pointer to a BCD value to add to (and where the result is stored) - @param value Pointer to the BCD value to add to __sour__ -*/ -void bcd_add(BCD * sour, const BCD * value); - -/** Subtracts two numbers in BCD format: __sour__ -= __value__ - @param sour Pointer to a BCD value to subtract from (and where the result is stored) - @param value Pointer to the BCD value to subtract from __sour__ -*/ -void bcd_sub(BCD * sour, const BCD * value); - -/** Convert a BCD number into an asciiz (null terminated) string and return the length - @param bcd Pointer to BCD value to convert - @param tile_offset Optional per-character offset value to add (use 0 for none) - @param buffer Buffer to store the result in - - Returns: Length in characters (always 8) - - __buffer__ should be large enough to store the converted string - (9 bytes: 8 characters + 1 for terminator) - - There are a couple different ways to use __tile_offset__. - For example: - \li It can be the Index of the Font Tile '0' in VRAM to - allow the buffer to be used directly with @ref set_bkg_tiles. - \li It can also be set to the ascii value for character '0' - so that the buffer is a normal string that can be passed to @ref printf. -*/ -uint8_t bcd2text(const BCD * bcd, uint8_t tile_offset, uint8_t * buffer); - +#ifndef __GBDK_BCD_H_INCLUDE +#define __GBDK_BCD_H_INCLUDE + +#if defined(__TARGET_gb) || defined(__TARGET_ap) + #include <gb/bcd.h> +#elif defined(__TARGET_sms) || defined(__TARGET_gg) + #error Not implemented yet +#else + #error Unrecognized port #endif + +#endif + diff --git a/gbdk-lib/include/gbdk/gbdecompress.h b/gbdk-lib/include/gbdk/gbdecompress.h @@ -0,0 +1,12 @@ +#ifndef __GB_DECOMPRESS_H_INCLUDE +#define __GB_DECOMPRESS_H_INCLUDE + +#if defined(__TARGET_gb) || defined(__TARGET_ap) + #include <gb/gbdecompress.h> +#elif defined(__TARGET_sms) || defined(__TARGET_gg) + #include <sms/gbdecompress.h> +#else + #error Unrecognized port +#endif + +#endif + diff --git a/gbdk-lib/include/gbdk/platform.h b/gbdk-lib/include/gbdk/platform.h @@ -1,5 +1,5 @@ -#ifndef __PLATFORM_H_INVCLUDE -#define __PLATFORM_H_INVCLUDE +#ifndef __PLATFORM_H_INCLUDE +#define __PLATFORM_H_INCLUDE #if defined(__TARGET_gb) || defined(__TARGET_ap) #include <gb/gb.h> diff --git a/gbdk-lib/include/sms/gbdecompress.h b/gbdk-lib/include/sms/gbdecompress.h @@ -0,0 +1,61 @@ +/** @file gb/gbdecompress.h + + GB-Compress decompressor + Compatible with the compression used in GBTD +*/ + +#ifndef __GBDECOMPRESS_H_INCLUDE +#define __GBDECOMPRESS_H_INCLUDE + +#include <stdint.h> + +/** gb-decompress data from sour into dest + + @param sour Pointer to source gb-compressed data + @param dest Pointer to destination buffer/address + + @see gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data + */ +uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) __z88dk_callee __preserves_regs(b, c); + +#if 0 +/** gb-decompress background tiles into VRAM + + @param first_tile Index of the first tile to write + @param sour Pointer to (gb-compressed 2 bpp) source Tile Pattern data. + + Note: This function avoids writes during modes 2 & 3 + + @see gb_decompress_bkg, gb_decompress_win_data, gb_decompress_sprite_data +*/ +void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t * sour) __z88dk_callee __preserves_regs(b, c); + + +/** gb-decompress window tiles into VRAM + + @param first_tile Index of the first tile to write + @param sour Pointer to (gb-compressed 2 bpp) source Tile Pattern data. + + This is the same as @ref gb_decompress_bkg_data, since the Window Layer and + Background Layer share the same Tile pattern data. + + Note: This function avoids writes during modes 2 & 3 + + @see gb_decompress, gb_decompress_bkg_data, gb_decompress_sprite_data + */ +void gb_decompress_win_data(uint8_t first_tile, const uint8_t * sour) __z88dk_callee __preserves_regs(b, c); + + +/** gb-decompress sprite tiles into VRAM + + @param first_tile Index of the first tile to write + @param sour Pointer to source compressed data + + Note: This function avoids writes during modes 2 & 3 + + @see gb_decompress, gb_decompress_bkg_data, gb_decompress_win_data + */ +void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t * sour) __z88dk_callee __preserves_regs(b, c); +#endif + +#endif + diff --git a/gbdk-lib/libc/targets/gbz80/gb_decompress.s b/gbdk-lib/libc/targets/gbz80/gb_decompress.s @@ -1,6 +1,11 @@ ; GB-Deompress routine ; Compatible with GBTD + .include "global.s" + + .title "GB Decompress" + .module GBDecompress + .area _CODE _gb_decompress:: @@ -16,6 +21,7 @@ _gb_decompress:: ; hl = source; de = dest gb_decompress:: push bc + push de 1$: ld a,(hl+) ; load command or a @@ -90,5 +96,13 @@ gb_decompress:: jr nz,8$ jr 1$ ; next command 9$: + pop hl + ld a, e + sub l + ld e, a + ld a, d + sbc h + ld d, a pop bc + ret diff --git a/gbdk-lib/libc/targets/gbz80/gb_decompress_tiles.s b/gbdk-lib/libc/targets/gbz80/gb_decompress_tiles.s @@ -1,8 +1,11 @@ - .include "global.s" - ; GB-Decompress tiledata directly to VRAM ; Compatible with GBTD + .include "global.s" + + .title "GB Decompress" + .module GBDecompress + .macro WRAP_VRAM regH, ?loc bit 3, regH jr z, loc diff --git a/gbdk-lib/libc/targets/z80/gb_decompress.s b/gbdk-lib/libc/targets/z80/gb_decompress.s @@ -0,0 +1,90 @@ +; GB-Deompress routine +; Compatible with GBTD + + .include "global.s" + + .title "GB Decompress" + .module GBDecompress + + .area _CODE + +; hl = source; de = dest +_gb_decompress:: + pop hl + pop de + ex (sp), hl + ex de, hl + push bc + push de +1$: + ld a, (hl) ; load command + inc hl + or a + jr z, 9$ ; exit, if last byte + bit 7, a + jr nz, 5$ ; string functions + bit 6, a + jr nz, 3$ + ; RLE byte + and #63 ; calc counter + inc a + ld b, a + ld a, (hl) + inc hl +2$: + ld (de), a + inc de + dec b + jr nz, 2$ + jr 1$ ; next command +3$: ; RLE word + and #63 + inc a + ld c, (hl) ; load word into bc + inc hl + ld b, (hl) + inc hl + ex de, hl +4$: + ld (hl), c + inc hl + ld (hl), b + inc hl + dec a + jr nz, 4$ + ex de, hl + jr 1$ ; next command +5$: + bit 6, a + jr nz, 7$ + ; string repeat + and #63 + inc a + push hl + ld c, (hl) + inc hl + ld b, (hl) + ld h, d + ld l, e + add hl, bc + ld c, a + ld b, #0 + ldir + pop hl + inc hl + inc hl + jr 1$ ; next command +7$: ; string copy + and #63 + inc a + ld c, a + ld b, #0 + ldir + jr 1$ ; next command +9$: + pop hl + ex de, hl + or a ; clear carry flag + sbc hl, de + pop bc + ret diff --git a/gbdk-lib/libc/targets/z80/gg/Makefile b/gbdk-lib/libc/targets/z80/gg/Makefile @@ -28,6 +28,8 @@ ASSRC = set_interrupts.s \ delay.s \ memset_small.s \ far_ptr.s \ + gb_decompress.s \ + heap.s \ __sdcc_bcall.s \ crt0.s diff --git a/gbdk-lib/libc/targets/z80/heap.s b/gbdk-lib/libc/targets/z80/heap.s @@ -0,0 +1,44 @@ +;-------------------------------------------------------------------------- +; heap.s +; +; Copyright (C) 2001, Michael Hope +; +; This library is free software; you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the +; Free Software Foundation; either version 2, or (at your option) any +; later version. +; +; This library is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this library; see the file COPYING. If not, write to the +; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +; MA 02110-1301, USA. +; +; As a special exception, if you link this library with other files, +; some of which are compiled with SDCC, to produce an executable, +; this library does not by itself cause the resulting executable to +; be covered by the GNU General Public License. This exception does +; not however invalidate any other reasons why the executable file +; might be covered by the GNU General Public License. +;-------------------------------------------------------------------------- + +; Just stubs - not copyrightable + + ;; Stubs that hook the heap in + .globl ___sdcc_heap_init + + .area _GSINIT + call ___sdcc_heap_init + + .area _HEAP +___sdcc_heap:: + ;; For now just allocate 2k of heap. + .ds 2047 + + .area _HEAP_END +___sdcc_heap_end:: + .ds 1 diff --git a/gbdk-lib/libc/targets/z80/sms/Makefile b/gbdk-lib/libc/targets/z80/sms/Makefile @@ -28,6 +28,8 @@ ASSRC = set_interrupts.s \ delay.s \ memset_small.s \ far_ptr.s \ + gb_decompress.s \ + heap.s \ __sdcc_bcall.s \ crt0.s
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.