A dungeon delver roguelike using Pathfinder 2nd edition rules
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Returning to GBDK

+3878 -719
-3
.gitmodules
··· 1 - [submodule "gb/include/hardware.inc"] 2 - path = gb/include/hardware.inc 3 - url = https://github.com/gbdev/hardware.inc
+5 -2
gb/.gitignore
··· 1 - obj/ 2 - bin/ 1 + # Created by https://www.toptal.com/developers/gitignore/api/c 2 + # Edit at https://www.toptal.com/developers/gitignore?templates=c 3 + 4 + bin/ 5 + obj/
+54 -47
gb/Makefile
··· 1 - .SUFFIXES: # Suppress a lot of useless default rules, which also provides a nice speedup. 1 + LCC = $(GBDK_HOME)bin/lcc 2 2 3 - # Recursive `wildcard` function. 4 - rwildcard = $(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d)) 3 + ifdef GBC 4 + LCCFLAGS += -Wa-l -Wm-yC 5 + else 6 + #LCCFLAGS += -Wm-yc 7 + endif 5 8 6 - # Program contsants. 7 - RM_RF := rm -rf 8 - MKDIR_P := mkdir -p 9 - ifeq ($(strip $(shell which rm)),) 10 - # Windows *really* tries its hardest to be Special! 11 - RM_RF := -rmdir /s /q 12 - MKDIR_P := -mkdir 9 + ifdef GBDK_DEBUG 10 + LCCFLAGS += -debug -v 11 + endif 12 + 13 + PROJECTNAME = dungeoner 14 + 15 + SRCDIR = src 16 + OBJDIR = obj 17 + RESDIR = res 18 + 19 + ifdef GBC 20 + BINS = $(OBJDIR)/$(PROJECTNAME).gbc 21 + else 22 + BINS = $(OBJDIR)/$(PROJECTNAME).gb 13 23 endif 14 24 15 - RGBDS ?= 16 - ASM := $(RGBDS)rgbasm 17 - LINK := $(RGBDS)rgblink 18 - FIX := $(RGBDS)rgbfix 19 - GFX := $(RGBDS)rgbgfx 25 + CSOURCES = $(foreach dir,$(SRCDIR),$(notdir $(wildcard $(dir)/*.c))) $(foreach dir,$(RESDIR),$(notdir $(wildcard $(dir)/*.c))) 26 + ASMSOURCES = $(foreach dir,$(SRCDIR),$(notdir $(wildcard $(dir)/*.s))) $(foreach dir,$(RESDIR),$(notdir $(wildcard $(dir)/*.s))) 27 + OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o) 28 + 29 + all: prepare $(BINS) 30 + 31 + $(OBJDIR)/%.o: $(SRCDIR)/%.c 32 + $(LCC) $(LCCFLAGS) -c -o $@ $< 33 + 34 + $(OBJDIR)/%.o: $(RESDIR)/%.c 35 + $(LCC) $(LCCFLAGS) -c -o $@ $< 20 36 21 - ROM = bin/$(ROMNAME).$(ROMEXT) 37 + $(OBJDIR)/%.o: $(SRC)/%.s 38 + $(LCC) $(LCCFLAGS) -c -o $@ $< 22 39 23 - # Argument constants 24 - INCDIRS = src/ include/ 25 - WARNINGS = all extra 26 - ASMFLAGS = -p $(PADVALUE) $(addprefix -I,$(INCDIRS)) $(addprefix -W,$(WARNINGS)) 27 - LINKFLAGS = -p $(PADVALUE) 28 - FIXFLAGS = -p $(PADVALUE) -i "$(GAMEID)" -k "$(LICENSEE)" -l $(OLDLIC) -m $(MBC) -n $(VERSION) -r $(SRAMSIZE) -t $(TITLE) 40 + $(OBJDIR)/%.o: $(RESDIR)/%.s 41 + $(LCC) $(LCCFLAGS) -c -o $@ $< 29 42 30 - SRCS = $(call rwildcard,src,*.asm) 43 + $(BINS): $(OBJS) 44 + $(LCC) $(LCCFLAGS) -o $(BINS) $(OBJS) 31 45 32 - include project.mk 46 + prepare: $(SRCDIR) $(OBJDIR) $(RESDIR) $(BINDIR) 33 47 34 - all: $(ROM) 35 - .PHONY: all 48 + $(SRCDIR): 49 + mkdir -p $@ 36 50 37 - clean: 38 - $(RM_RF) bin obj assets 39 - .PHONY: clean 51 + $(OBJDIR): 52 + mkdir -p $@ 40 53 41 - rebuild: 42 - $(MAKE) clean 43 - $(MAKE) all 44 - .PHONY: rebuild 54 + $(RESDIR): 55 + mkdir -p $@ 45 56 46 - VPATH := src 57 + $(BINDIR): 58 + mkdir -p $@ 47 59 48 - bin/%.$(ROMEXT): $(patsubst src/%.asm,obj/%.o,$(SRCS)) 49 - @$(MKDIR_P) "$(@D)" 50 - $(ASM) $(ASMFLAGS) -o obj/build_date.o src/assets/build_date.asm 51 - $(LINK) $(LINKFLAGS) -m bin/$*.map -n bin/$*.sym -o $@ $^ \ 52 - && $(FIX) -v $(FIXFLAGS) $@ 60 + clean: 61 + rm -f $(OBJDIR)/*.* 53 62 54 - obj/%.mk: src/%.asm 55 - @$(MKDIR_P) "$(@D)" 56 - $(ASM) $(ASMFLAGS) -M $@ -MG -MP -MQ $(@:.mk=.o) -MQ $@ -o $(@:.mk=.o) $< 63 + run_bgb: $(BINS) 64 + wine $(BGB) $(BINS) 57 65 58 - obj/%.o: obj/%.mk 59 - @touch $@ 66 + run_mgba: $(BINS) 67 + mgba-qt -6 $(BINS) 60 68 61 - ifeq ($(filter clean,$(MAKECMDGOALS)),) 62 - include $(patsubst src/%.asm,obj/%.mk,$(SRCS)) 63 - endif 69 + run_emulicious: $(BINS) 70 + emulicious
+30
gb/obj/character.sym
··· 1 + ASxxxx Assembler V02.00 + NoICE + SDCC mods (GameBoy) Page 1 2 + Hexadecimal [32-Bits] 3 + 4 + Symbol Table 5 + 6 + .__.$$$. = 00002710 L 7 + .__.ABS. = 00000000 G 8 + .__.CPU. = 00000000 L 9 + .__.H$L. = 00000000 L 10 + 0 _Character_is_valid 00000000 GR 11 + 0 _char_cleric 000001AA GR 12 + 0 _char_fighter 0000016C GR 13 + 0 _char_rogue 0000018B GR 14 + 0 _char_wizard 000001C9 GR 15 + 16 + ASxxxx Assembler V02.00 + NoICE + SDCC mods (GameBoy) Page 2 17 + Hexadecimal [32-Bits] 18 + 19 + Area Table 20 + 21 + 0 _CODE size 1E8 flags 0 22 + 1 _DATA size 0 flags 0 23 + 2 _INITIALIZED size 0 flags 0 24 + 3 _DABS size 0 flags 8 25 + 4 _HOME size 0 flags 0 26 + 5 _GSINIT size 0 flags 0 27 + 6 _GSFINAL size 0 flags 0 28 + 7 _INITIALIZER size 0 flags 0 29 + 8 _CABS size 0 flags 8 30 +
-10
gb/project.mk
··· 1 - PADVALUE := 0xFF 2 - VERSION := 0 3 - GAMEID := DNGR 4 - TITLE := Dungeoner 5 - LICENSEE := HB 6 - OLDLIC := 0x33 7 - MBC := 0x00 8 - SRAMSIZE := 0x00 9 - ROMNAME := dungeoner 10 - ROMEXT := gb
+93
gb/res/cleric_down.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(cleric_down) 8 + 9 + const palette_color_t cleric_down_palettes[4] = { 10 + RGB8(255,255,255), RGB8(239,208,175), RGB8( 60,187,254), RGB8( 7, 10, 5) 11 + 12 + }; 13 + 14 + const uint8_t cleric_down_tiles[160] = { 15 + 0x00,0x00,0x01,0x01, 16 + 0x06,0x07,0x08,0x0f, 17 + 0x0f,0x0f,0x09,0x0f, 18 + 0x0b,0x0c,0x1f,0x12, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x30,0xf0,0x08,0xf8, 22 + 0x78,0xf8,0xc8,0x78, 23 + 0xe8,0x18,0xfc,0x24, 24 + 25 + 0x0f,0x0a,0x07,0x04, 26 + 0x0b,0x0f,0x0c,0x0b, 27 + 0x19,0x17,0x1c,0x1f, 28 + 0x06,0x05,0x03,0x02, 29 + 30 + 0xf8,0x28,0xf0,0x10, 31 + 0xe8,0xf8,0xa8,0xf8, 32 + 0xf8,0xf8,0xac,0xf4, 33 + 0xf8,0xb8,0xc0,0xc0, 34 + 35 + 0x01,0x01,0x06,0x07, 36 + 0x08,0x0f,0x0f,0x0f, 37 + 0x09,0x0f,0x0b,0x0c, 38 + 0x1f,0x12,0x0f,0x0a, 39 + 40 + 0xc0,0xc0,0x30,0xf0, 41 + 0x08,0xf8,0x78,0xf8, 42 + 0xc8,0x78,0xe8,0x18, 43 + 0xfc,0x24,0xf8,0x28, 44 + 45 + 0x07,0x04,0x0b,0x0f, 46 + 0x08,0x0f,0x1d,0x17, 47 + 0x34,0x2f,0x1c,0x1f, 48 + 0x06,0x05,0x03,0x02, 49 + 50 + 0xf0,0x10,0xe8,0xf8, 51 + 0x88,0xf8,0xdc,0xf4, 52 + 0x96,0xfa,0x1c,0xfc, 53 + 0xb0,0xd0,0xe0,0xa0, 54 + 55 + 0x0f,0x0a,0x07,0x04, 56 + 0x0b,0x0f,0x0e,0x0b, 57 + 0x0b,0x0f,0x1e,0x13, 58 + 0x0f,0x0e,0x01,0x01, 59 + 60 + 0xf8,0x28,0xf0,0x10, 61 + 0xe8,0xf8,0x98,0xe8, 62 + 0xcc,0xf4,0x9c,0xfc, 63 + 0xb0,0xd0,0xe0,0xa0 64 + 65 + }; 66 + 67 + const metasprite_t cleric_down_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t cleric_down_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t cleric_down_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const cleric_down_metasprites[3] = { 92 + cleric_down_metasprite0, cleric_down_metasprite1, cleric_down_metasprite2 93 + };
+29
gb/res/cleric_down.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_cleric_down_H 3 + #define METASPRITE_cleric_down_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define cleric_down_TILE_ORIGIN 0 10 + #define cleric_down_TILE_W 8 11 + #define cleric_down_TILE_H 8 12 + #define cleric_down_WIDTH 16 13 + #define cleric_down_HEIGHT 16 14 + #define cleric_down_TILE_COUNT 10 15 + #define cleric_down_PALETTE_COUNT 1 16 + #define cleric_down_COLORS_PER_PALETTE 4 17 + #define cleric_down_TOTAL_COLORS 4 18 + #define cleric_down_PIVOT_X 8 19 + #define cleric_down_PIVOT_Y 8 20 + #define cleric_down_PIVOT_W 16 21 + #define cleric_down_PIVOT_H 16 22 + extern const metasprite_t* const cleric_down_metasprites[3]; 23 + 24 + BANKREF_EXTERN(cleric_down) 25 + 26 + extern const palette_color_t cleric_down_palettes[4]; 27 + extern const uint8_t cleric_down_tiles[160]; 28 + 29 + #endif
+93
gb/res/cleric_left.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(cleric_left) 8 + 9 + const palette_color_t cleric_left_palettes[4] = { 10 + RGB8(255,255,255), RGB8(239,208,175), RGB8( 60,187,254), RGB8( 7, 10, 5) 11 + 12 + }; 13 + 14 + const uint8_t cleric_left_tiles[160] = { 15 + 0x00,0x00,0x03,0x03, 16 + 0x0c,0x0f,0x08,0x0f, 17 + 0x17,0x1f,0x14,0x1f, 18 + 0x0e,0x09,0x0f,0x0a, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x30,0xf0,0x10,0xf0, 22 + 0xf8,0xf8,0x08,0xf8, 23 + 0x08,0xf8,0xe8,0x38, 24 + 25 + 0x0f,0x0a,0x0f,0x08, 26 + 0x07,0x07,0x06,0x07, 27 + 0x05,0x07,0x07,0x06, 28 + 0x07,0x07,0x07,0x05, 29 + 30 + 0xf0,0x50,0xe0,0x20, 31 + 0xe0,0xe0,0x90,0xf0, 32 + 0xe0,0xa0,0x60,0xa0, 33 + 0xf0,0xf0,0x70,0x50, 34 + 35 + 0x03,0x03,0x0c,0x0f, 36 + 0x08,0x0f,0x17,0x1f, 37 + 0x14,0x1f,0x0e,0x09, 38 + 0x0f,0x0a,0x0f,0x0a, 39 + 40 + 0xc0,0xc0,0x30,0xf0, 41 + 0x10,0xf0,0xf8,0xf8, 42 + 0x08,0xf8,0x08,0xf8, 43 + 0xe8,0x38,0xf0,0x50, 44 + 45 + 0x0f,0x08,0x07,0x07, 46 + 0x02,0x03,0x04,0x07, 47 + 0x06,0x07,0x02,0x03, 48 + 0x02,0x03,0x01,0x01, 49 + 50 + 0xe0,0x20,0xe0,0xe0, 51 + 0xa0,0xe0,0xe0,0xa0, 52 + 0xa0,0xe0,0xe0,0xa0, 53 + 0xe0,0x60,0xc0,0x40, 54 + 55 + 0x0f,0x0a,0x0f,0x08, 56 + 0x07,0x07,0x06,0x07, 57 + 0x0c,0x0f,0x1e,0x17, 58 + 0x0a,0x0b,0x07,0x05, 59 + 60 + 0xf0,0x50,0xe0,0x20, 61 + 0xe0,0xe0,0x90,0xf0, 62 + 0x68,0xd8,0x78,0xe8, 63 + 0xb0,0xd0,0x70,0x50 64 + 65 + }; 66 + 67 + const metasprite_t cleric_left_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t cleric_left_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t cleric_left_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const cleric_left_metasprites[3] = { 92 + cleric_left_metasprite0, cleric_left_metasprite1, cleric_left_metasprite2 93 + };
+29
gb/res/cleric_left.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_cleric_left_H 3 + #define METASPRITE_cleric_left_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define cleric_left_TILE_ORIGIN 0 10 + #define cleric_left_TILE_W 8 11 + #define cleric_left_TILE_H 8 12 + #define cleric_left_WIDTH 16 13 + #define cleric_left_HEIGHT 16 14 + #define cleric_left_TILE_COUNT 10 15 + #define cleric_left_PALETTE_COUNT 1 16 + #define cleric_left_COLORS_PER_PALETTE 4 17 + #define cleric_left_TOTAL_COLORS 4 18 + #define cleric_left_PIVOT_X 8 19 + #define cleric_left_PIVOT_Y 8 20 + #define cleric_left_PIVOT_W 16 21 + #define cleric_left_PIVOT_H 16 22 + extern const metasprite_t* const cleric_left_metasprites[3]; 23 + 24 + BANKREF_EXTERN(cleric_left) 25 + 26 + extern const palette_color_t cleric_left_palettes[4]; 27 + extern const uint8_t cleric_left_tiles[160]; 28 + 29 + #endif
+93
gb/res/cleric_up.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(cleric_up) 8 + 9 + const palette_color_t cleric_up_palettes[4] = { 10 + RGB8(255,255,255), RGB8(239,208,175), RGB8( 60,187,254), RGB8( 7, 10, 5) 11 + 12 + }; 13 + 14 + const uint8_t cleric_up_tiles[160] = { 15 + 0x00,0x00,0x01,0x01, 16 + 0x06,0x07,0x08,0x0f, 17 + 0x0f,0x0f,0x08,0x0f, 18 + 0x09,0x0f,0x18,0x17, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x30,0xf0,0x08,0xf8, 22 + 0xf8,0xf8,0x88,0xf8, 23 + 0xc8,0xf8,0x8c,0xf4, 24 + 25 + 0x08,0x0f,0x04,0x07, 26 + 0x0b,0x0f,0x0f,0x0a, 27 + 0x1a,0x17,0x1f,0x1e, 28 + 0x03,0x03,0x00,0x00, 29 + 30 + 0x08,0xf8,0x10,0xf0, 31 + 0xe8,0xf8,0xd8,0x28, 32 + 0x9c,0x74,0x98,0xf8, 33 + 0xb0,0xd0,0xe0,0xa0, 34 + 35 + 0x01,0x01,0x06,0x07, 36 + 0x08,0x0f,0x0f,0x0f, 37 + 0x08,0x0f,0x09,0x0f, 38 + 0x18,0x17,0x08,0x0f, 39 + 40 + 0xc0,0xc0,0x30,0xf0, 41 + 0x08,0xf8,0xf8,0xf8, 42 + 0x88,0xf8,0xc8,0xf8, 43 + 0x8c,0xf4,0x08,0xf8, 44 + 45 + 0x04,0x07,0x0b,0x0f, 46 + 0x08,0x0f,0x1d,0x16, 47 + 0x34,0x2f,0x1c,0x1f, 48 + 0x06,0x05,0x03,0x02, 49 + 50 + 0x10,0xf0,0xe8,0xf8, 51 + 0x88,0x78,0xdc,0x34, 52 + 0x96,0x7a,0x1c,0xfc, 53 + 0xb0,0xd0,0xe0,0xa0, 54 + 55 + 0x08,0x0f,0x04,0x07, 56 + 0x0b,0x0f,0x0d,0x0a, 57 + 0x1c,0x17,0x0c,0x0f, 58 + 0x06,0x05,0x03,0x02, 59 + 60 + 0x08,0xf8,0x10,0xf0, 61 + 0xe8,0xf8,0xf8,0x28, 62 + 0xac,0x74,0xfc,0xbc, 63 + 0xe0,0xe0,0x80,0x80 64 + 65 + }; 66 + 67 + const metasprite_t cleric_up_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t cleric_up_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t cleric_up_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const cleric_up_metasprites[3] = { 92 + cleric_up_metasprite0, cleric_up_metasprite1, cleric_up_metasprite2 93 + };
+29
gb/res/cleric_up.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_cleric_up_H 3 + #define METASPRITE_cleric_up_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define cleric_up_TILE_ORIGIN 0 10 + #define cleric_up_TILE_W 8 11 + #define cleric_up_TILE_H 8 12 + #define cleric_up_WIDTH 16 13 + #define cleric_up_HEIGHT 16 14 + #define cleric_up_TILE_COUNT 10 15 + #define cleric_up_PALETTE_COUNT 1 16 + #define cleric_up_COLORS_PER_PALETTE 4 17 + #define cleric_up_TOTAL_COLORS 4 18 + #define cleric_up_PIVOT_X 8 19 + #define cleric_up_PIVOT_Y 8 20 + #define cleric_up_PIVOT_W 16 21 + #define cleric_up_PIVOT_H 16 22 + extern const metasprite_t* const cleric_up_metasprites[3]; 23 + 24 + BANKREF_EXTERN(cleric_up) 25 + 26 + extern const palette_color_t cleric_up_palettes[4]; 27 + extern const uint8_t cleric_up_tiles[160]; 28 + 29 + #endif
+7
gb/res/dungeon.h
··· 1 + #ifndef DUNGEON_RES_H 2 + #define DUNGEON_RES_H 3 + 4 + #include "dungeon_palettes.h" 5 + #include "dungeon_tiles.h" 6 + 7 + #endif
+5
gb/res/dungeon_palettes.c
··· 1 + #include <gbdk/platform.h> 2 + 3 + const palette_color_t dungeon_palettes[4] = { 4 + RGB8(201,196,201), RGB8(142,141,149), RGB8(123,115,130), RGB8( 0, 0, 0) 5 + };
+8
gb/res/dungeon_palettes.h
··· 1 + #ifndef DUNGEON_PALETTES_H 2 + #define DUNGEON_PALETTES_H 3 + 4 + #include <gbdk/platform.h> 5 + 6 + extern const palette_color_t dungeon_palettes[]; 7 + 8 + #endif
+144
gb/res/dungeon_tiles.c
··· 1 + /* 2 + 3 + DUNGEON_TILES.C 4 + 5 + Tile Source File. 6 + 7 + Info: 8 + Form : All tiles as one unit. 9 + Format : Gameboy 4 color. 10 + Compression : None. 11 + Counter : None. 12 + Tile size : 8 x 8 13 + Tiles : 0 to 56 14 + 15 + Palette colors : None. 16 + SGB Palette : None. 17 + CGB Palette : None. 18 + 19 + Convert to metatiles : No. 20 + 21 + This file was generated by GBTD v2.2 22 + 23 + */ 24 + 25 + /* Start of tile array. */ 26 + const unsigned char dungeon_tiles[] = 27 + { 28 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 29 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 30 + 0x00,0xFF,0x4C,0x80,0x04,0x80,0x18,0x80, 31 + 0x08,0x80,0x50,0x80,0x30,0x80,0x00,0x80, 32 + 0x00,0xFF,0x66,0x00,0x10,0x00,0x00,0x00, 33 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 34 + 0x00,0xFF,0x22,0x01,0x40,0x01,0x68,0x01, 35 + 0x1A,0x01,0x06,0x01,0x00,0x01,0x00,0x01, 36 + 0x00,0x01,0x02,0x01,0x02,0x01,0x04,0x01, 37 + 0x00,0x01,0x02,0x01,0x02,0x01,0x00,0x01, 38 + 0x00,0x01,0x0C,0x01,0x0A,0x01,0x10,0x01, 39 + 0x18,0x01,0x20,0x01,0x32,0x01,0x00,0xFF, 40 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 41 + 0x00,0x00,0x08,0x00,0x66,0x00,0x00,0xFF, 42 + 0x00,0x80,0x00,0x80,0x60,0x80,0x58,0x80, 43 + 0x16,0x80,0x02,0x80,0x44,0x80,0x00,0xFF, 44 + 0x00,0x80,0x40,0x80,0x40,0x80,0x00,0x80, 45 + 0x20,0x80,0x40,0x80,0x40,0x80,0x00,0x80, 46 + 0x80,0x7F,0x00,0xFF,0x1F,0xFF,0x3F,0xFF, 47 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x7F,0xFF, 48 + 0x01,0xFE,0x00,0xFF,0xF8,0xFF,0xFC,0xFF, 49 + 0xFC,0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF, 50 + 0x80,0x7F,0x00,0xFF,0x1F,0xFF,0x3F,0xFF, 51 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x7F,0xFF, 52 + 0x01,0xFE,0x00,0xFF,0xF8,0xFF,0xF0,0xFF, 53 + 0xFC,0xFF,0xC0,0xFF,0x82,0xFF,0xF8,0xFF, 54 + 0x1F,0xE0,0x1F,0xE0,0x1F,0xE0,0x1F,0xE0, 55 + 0x3F,0xC0,0x3F,0xC0,0x3F,0xC0,0x20,0xDF, 56 + 0xBF,0x40,0xBF,0x40,0xBF,0x40,0xBF,0x40, 57 + 0xBF,0x40,0xBF,0x40,0xBF,0x40,0x20,0xDF, 58 + 0xFE,0x01,0xFE,0x01,0xFE,0x01,0xFE,0x01, 59 + 0xFE,0x01,0xFE,0x01,0xFE,0x01,0x00,0xFF, 60 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 61 + 0xFF,0x00,0xFF,0x00,0x0F,0xF0,0x00,0xFF, 62 + 0xFE,0x01,0xFE,0x01,0xFE,0x01,0xFF,0x00, 63 + 0xFF,0x00,0xFF,0x00,0xF0,0x0F,0x00,0xFF, 64 + 0xF8,0x07,0xF8,0x07,0xF8,0x07,0x7C,0x83, 65 + 0x7C,0x83,0x7C,0x83,0x7C,0x83,0x70,0x8F, 66 + 0x80,0x7F,0x00,0xFF,0x1F,0xFF,0x3F,0xFF, 67 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x7F,0xFF, 68 + 0x01,0xFE,0x00,0xFF,0xF8,0xFF,0xFC,0xFF, 69 + 0xFC,0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF, 70 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF, 71 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF, 72 + 0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF, 73 + 0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF, 74 + 0x3E,0xFF,0x3C,0xFF,0x3F,0xFF,0x3F,0xFF, 75 + 0x38,0xFF,0x3F,0xF0,0x10,0xFF,0x10,0xFF, 76 + 0x3C,0xFF,0x00,0xFF,0xFC,0x83,0xFC,0xFF, 77 + 0xFC,0xFF,0x00,0xFF,0xFC,0x03,0x00,0xFF, 78 + 0x0F,0xF0,0x3F,0xC0,0x1F,0xE0,0x1F,0xE0, 79 + 0x1F,0xE0,0x1F,0xE0,0x1F,0xE0,0x1F,0xE0, 80 + 0x80,0x7F,0xFF,0x00,0xFF,0x00,0xFF,0x00, 81 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 82 + 0xFC,0x03,0xFF,0x00,0xFF,0x00,0xFF,0x00, 83 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 84 + 0x7F,0x80,0xFF,0x00,0xFF,0x00,0xFF,0x00, 85 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 86 + 0xFE,0x01,0xFF,0x00,0xFF,0x00,0xFF,0x00, 87 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 88 + 0x00,0xFF,0xF8,0x07,0xF8,0x07,0xFC,0x03, 89 + 0xFC,0x03,0xFC,0x03,0xF8,0x07,0xF8,0x07, 90 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF, 91 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF, 92 + 0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF, 93 + 0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF, 94 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF, 95 + 0x3F,0xFF,0x7F,0xFF,0x3F,0xFF,0x3F,0xFF, 96 + 0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF, 97 + 0xFC,0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF, 98 + 0x1F,0xE0,0x3F,0xC0,0x0F,0xF0,0x00,0xFF, 99 + 0x00,0xFF,0x7F,0xC0,0x3F,0xC0,0x03,0xFC, 100 + 0x00,0xFF,0xFC,0x03,0xFC,0x03,0x04,0xFB, 101 + 0x00,0xFF,0x00,0xFF,0xFE,0x03,0xFC,0x03, 102 + 0x1F,0xE0,0x3F,0xC0,0x3F,0xC0,0x3F,0xC0, 103 + 0x3F,0xC0,0x1F,0xE0,0x00,0xFF,0x00,0xFF, 104 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 105 + 0xFF,0x00,0xFF,0x00,0x00,0xFF,0x07,0xF8, 106 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 107 + 0xFF,0x00,0xFF,0x00,0x00,0xFF,0x00,0xFF, 108 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 109 + 0xFF,0x00,0xFF,0x00,0x00,0xFF,0x00,0xFF, 110 + 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, 111 + 0xFF,0x00,0xFF,0x00,0x00,0xFF,0x00,0xFF, 112 + 0xF8,0x07,0xF8,0x07,0xF8,0x07,0xF8,0x07, 113 + 0xFC,0x03,0xFC,0x03,0x00,0xFF,0x3C,0xC3, 114 + 0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF, 115 + 0x3F,0xFF,0x7F,0xFF,0x3F,0xFF,0x3F,0xFF, 116 + 0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF, 117 + 0xFC,0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF, 118 + 0x01,0xFF,0x03,0xFC,0x3F,0xC0,0x3F,0xC0, 119 + 0x3F,0xC0,0x3F,0xC0,0x7F,0x80,0xFF,0x00, 120 + 0xFC,0xFF,0xFC,0x3F,0xFC,0x0F,0xFC,0x03, 121 + 0xFC,0x03,0xFC,0x03,0xFE,0x01,0xFF,0x00, 122 + 0x00,0xFF,0x3E,0xC1,0x3F,0xC0,0x1F,0xE0, 123 + 0x00,0xFF,0x07,0xF8,0x7F,0x80,0xFF,0x00, 124 + 0x00,0xFF,0x00,0xFF,0xFC,0x03,0xFC,0x03, 125 + 0x00,0xFF,0xF4,0x0B,0xFE,0x01,0xFF,0x00, 126 + 0x1F,0xE0,0x00,0xFF,0x00,0xFF,0x00,0xFF, 127 + 0x00,0xFF,0x80,0x7F,0xDE,0x21,0xFF,0x00, 128 + 0x78,0x87,0x00,0xFF,0x00,0xFF,0x00,0xFF, 129 + 0x00,0xFF,0x08,0xF7,0x1C,0xE3,0xFF,0x00, 130 + 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF, 131 + 0x00,0xFF,0x00,0xFF,0x7C,0x83,0xFF,0x00, 132 + 0x7F,0x80,0x00,0xFF,0x00,0xFF,0x00,0xFF, 133 + 0x00,0xFF,0x00,0xFF,0x1C,0xE3,0xFF,0x00, 134 + 0xFE,0x01,0x00,0xFF,0x00,0xFF,0x00,0xFF, 135 + 0x00,0xFF,0x00,0xFF,0x38,0xC7,0xFF,0x00, 136 + 0xC0,0x3F,0x00,0xFF,0x00,0xFF,0x00,0xFF, 137 + 0x00,0xFF,0x09,0xF6,0x3D,0xC2,0xFF,0x00, 138 + 0x3B,0xFF,0x30,0xFF,0x00,0xFF,0x04,0xFB, 139 + 0x1F,0xE0,0x36,0xC9,0x7F,0x80,0xFF,0x00, 140 + 0x8C,0xFF,0x24,0xFF,0x00,0xFF,0x30,0xCF, 141 + 0xD8,0x27,0xFC,0x03,0x7E,0x81,0xFF,0x00 142 + }; 143 + 144 + /* End of DUNGEON_TILES.C */
+35
gb/res/dungeon_tiles.h
··· 1 + /* 2 + 3 + DUNGEON_TILES.H 4 + 5 + Include File. 6 + 7 + Info: 8 + Form : All tiles as one unit. 9 + Format : Gameboy 4 color. 10 + Compression : None. 11 + Counter : None. 12 + Tile size : 8 x 8 13 + Tiles : 0 to 56 14 + 15 + Palette colors : None. 16 + SGB Palette : None. 17 + CGB Palette : None. 18 + 19 + Convert to metatiles : No. 20 + 21 + This file was generated by GBTD v2.2 22 + 23 + */ 24 + 25 + #ifndef __dungeon_tiles_h_INCLUDE 26 + #define __dungeon_tiles_h_INCLUDE 27 + 28 + /* Bank of tiles. */ 29 + #define dungeon_tilesBank 0 30 + /* Start of tile array. */ 31 + extern const unsigned char dungeon_tiles[]; 32 + 33 + #endif 34 + 35 + /* End of DUNGEON_TILES.H */
+93
gb/res/fighter_down.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(fighter_down) 8 + 9 + const palette_color_t fighter_down_palettes[4] = { 10 + RGB8(255,255,255), RGB8(227, 92, 6), RGB8( 0,169, 0), RGB8( 0, 0, 0) 11 + 12 + }; 13 + 14 + const uint8_t fighter_down_tiles[160] = { 15 + 0x00,0x00,0x01,0x01, 16 + 0x67,0x67,0x79,0x5f, 17 + 0x3f,0x2f,0x1f,0x18, 18 + 0x0f,0x0f,0x1f,0x12, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0xf3,0x73,0xcf,0x7d, 22 + 0xfe,0xfa,0xfc,0x0c, 23 + 0xf8,0xf8,0xfc,0x24, 24 + 25 + 0x0f,0x0a,0x0f,0x0c, 26 + 0x1b,0x1f,0x3c,0x27, 27 + 0x3f,0x2f,0x34,0x37, 28 + 0x07,0x07,0x07,0x04, 29 + 30 + 0xf8,0x28,0xf8,0x18, 31 + 0xe4,0xfc,0x9c,0x7c, 32 + 0x7c,0xe4,0xb8,0xf8, 33 + 0xe0,0xa0,0xc0,0xc0, 34 + 35 + 0x01,0x01,0x67,0x67, 36 + 0x79,0x5f,0x3f,0x2f, 37 + 0x1f,0x18,0x0f,0x0f, 38 + 0x1f,0x12,0x0f,0x0a, 39 + 40 + 0xc0,0xc0,0xf3,0x73, 41 + 0xcf,0x7d,0xfe,0xfa, 42 + 0xfc,0x0c,0xf8,0xf8, 43 + 0xfc,0x24,0xf8,0x28, 44 + 45 + 0x0f,0x0c,0x1b,0x1f, 46 + 0x39,0x2f,0x3c,0x27, 47 + 0x3f,0x27,0x1c,0x1f, 48 + 0x07,0x07,0x07,0x04, 49 + 50 + 0xf8,0x18,0xec,0xfc, 51 + 0xce,0x7a,0x9e,0xf2, 52 + 0x7e,0xf2,0x9c,0xfc, 53 + 0xf0,0xf0,0xf0,0x90, 54 + 55 + 0x0f,0x0a,0x0f,0x0c, 56 + 0x13,0x1f,0x1c,0x1f, 57 + 0x1f,0x13,0x0e,0x0f, 58 + 0x03,0x02,0x01,0x01, 59 + 60 + 0xf8,0x28,0xf8,0x18, 61 + 0xec,0xfc,0x9e,0x72, 62 + 0x7e,0xfa,0x96,0xf6, 63 + 0xf0,0xf0,0xf0,0x90 64 + 65 + }; 66 + 67 + const metasprite_t fighter_down_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t fighter_down_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t fighter_down_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const fighter_down_metasprites[3] = { 92 + fighter_down_metasprite0, fighter_down_metasprite1, fighter_down_metasprite2 93 + };
+29
gb/res/fighter_down.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_fighter_down_H 3 + #define METASPRITE_fighter_down_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define fighter_down_TILE_ORIGIN 0 10 + #define fighter_down_TILE_W 8 11 + #define fighter_down_TILE_H 8 12 + #define fighter_down_WIDTH 16 13 + #define fighter_down_HEIGHT 16 14 + #define fighter_down_TILE_COUNT 10 15 + #define fighter_down_PALETTE_COUNT 1 16 + #define fighter_down_COLORS_PER_PALETTE 4 17 + #define fighter_down_TOTAL_COLORS 4 18 + #define fighter_down_PIVOT_X 8 19 + #define fighter_down_PIVOT_Y 8 20 + #define fighter_down_PIVOT_W 16 21 + #define fighter_down_PIVOT_H 16 22 + extern const metasprite_t* const fighter_down_metasprites[3]; 23 + 24 + BANKREF_EXTERN(fighter_down) 25 + 26 + extern const palette_color_t fighter_down_palettes[4]; 27 + extern const uint8_t fighter_down_tiles[160]; 28 + 29 + #endif
+93
gb/res/fighter_left.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(fighter_left) 8 + 9 + const palette_color_t fighter_left_palettes[4] = { 10 + RGB8(255,255,255), RGB8(227, 92, 6), RGB8( 0,169, 0), RGB8( 0, 0, 0) 11 + 12 + }; 13 + 14 + const uint8_t fighter_left_tiles[160] = { 15 + 0x00,0x00,0x03,0x03, 16 + 0x0f,0x0c,0x0d,0x0b, 17 + 0x1f,0x1f,0x1f,0x10, 18 + 0x0f,0x0f,0x0f,0x0a, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0xf0,0xf0,0xf0,0xb0, 22 + 0xf8,0x78,0xf8,0x88, 23 + 0xf8,0xf8,0xe8,0x38, 24 + 25 + 0x0f,0x0a,0x0f,0x08, 26 + 0x07,0x07,0x0f,0x0d, 27 + 0x1e,0x17,0x0d,0x0f, 28 + 0x07,0x07,0x0f,0x09, 29 + 30 + 0xf0,0x50,0xe0,0x20, 31 + 0xe0,0xe0,0x70,0xd0, 32 + 0x38,0xe8,0xf8,0xe8, 33 + 0xb0,0xf0,0xf0,0x90, 34 + 35 + 0x03,0x03,0x0f,0x0c, 36 + 0x0d,0x0b,0x1f,0x1f, 37 + 0x1f,0x10,0x0f,0x0f, 38 + 0x0f,0x0a,0x0f,0x0a, 39 + 40 + 0xc0,0xc0,0xf0,0xf0, 41 + 0xf0,0xb0,0xf8,0x78, 42 + 0xf8,0x88,0xf8,0xf8, 43 + 0xe8,0x38,0xf0,0x50, 44 + 45 + 0x0f,0x08,0x07,0x07, 46 + 0x03,0x02,0x02,0x03, 47 + 0x03,0x03,0x02,0x03, 48 + 0x03,0x03,0x07,0x04, 49 + 50 + 0xe0,0x20,0xe0,0xe0, 51 + 0xe0,0xa0,0xf0,0xd0, 52 + 0xf0,0x90,0xe0,0xe0, 53 + 0xc0,0xc0,0xc0,0x40, 54 + 55 + 0x0f,0x0a,0x0f,0x08, 56 + 0x07,0x07,0x07,0x05, 57 + 0x07,0x07,0x05,0x07, 58 + 0x07,0x07,0x0f,0x09, 59 + 60 + 0xf0,0x50,0xe0,0x20, 61 + 0xe0,0xe0,0x50,0xf0, 62 + 0xf0,0xd0,0xe0,0x20, 63 + 0xf0,0xf0,0xf0,0x90 64 + 65 + }; 66 + 67 + const metasprite_t fighter_left_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t fighter_left_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t fighter_left_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const fighter_left_metasprites[3] = { 92 + fighter_left_metasprite0, fighter_left_metasprite1, fighter_left_metasprite2 93 + };
+29
gb/res/fighter_left.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_fighter_left_H 3 + #define METASPRITE_fighter_left_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define fighter_left_TILE_ORIGIN 0 10 + #define fighter_left_TILE_W 8 11 + #define fighter_left_TILE_H 8 12 + #define fighter_left_WIDTH 16 13 + #define fighter_left_HEIGHT 16 14 + #define fighter_left_TILE_COUNT 10 15 + #define fighter_left_PALETTE_COUNT 1 16 + #define fighter_left_COLORS_PER_PALETTE 4 17 + #define fighter_left_TOTAL_COLORS 4 18 + #define fighter_left_PIVOT_X 8 19 + #define fighter_left_PIVOT_Y 8 20 + #define fighter_left_PIVOT_W 16 21 + #define fighter_left_PIVOT_H 16 22 + extern const metasprite_t* const fighter_left_metasprites[3]; 23 + 24 + BANKREF_EXTERN(fighter_left) 25 + 26 + extern const palette_color_t fighter_left_palettes[4]; 27 + extern const uint8_t fighter_left_tiles[160]; 28 + 29 + #endif
+93
gb/res/fighter_up.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(fighter_up) 8 + 9 + const palette_color_t fighter_up_palettes[4] = { 10 + RGB8(255,255,255), RGB8(227, 92, 6), RGB8( 0,169, 0), RGB8( 0, 0, 0) 11 + 12 + }; 13 + 14 + const uint8_t fighter_up_tiles[160] = { 15 + 0x00,0x00,0x01,0x01, 16 + 0x67,0x67,0x79,0x5f, 17 + 0x3f,0x2f,0x1f,0x18, 18 + 0x0f,0x0f,0x18,0x17, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0xf3,0x73,0xcf,0x7d, 22 + 0xfe,0xfa,0xfc,0x0c, 23 + 0xf8,0xf8,0x0c,0xf4, 24 + 25 + 0x08,0x0f,0x0d,0x0f, 26 + 0x1f,0x17,0x1c,0x17, 27 + 0x1f,0x17,0x0c,0x0f, 28 + 0x03,0x02,0x01,0x01, 29 + 30 + 0x08,0xf8,0x58,0xf8, 31 + 0xec,0xfc,0x1e,0xf2, 32 + 0xfe,0xfa,0x96,0xf6, 33 + 0xf0,0xf0,0xf0,0x90, 34 + 35 + 0x01,0x01,0x67,0x67, 36 + 0x79,0x5f,0x3f,0x2f, 37 + 0x1f,0x18,0x0f,0x0f, 38 + 0x18,0x17,0x08,0x0f, 39 + 40 + 0xc0,0xc0,0xf3,0x73, 41 + 0xcf,0x7d,0xfe,0xfa, 42 + 0xfc,0x0c,0xf8,0xf8, 43 + 0x0c,0xf4,0x08,0xf8, 44 + 45 + 0x0d,0x0f,0x1b,0x1f, 46 + 0x3c,0x2f,0x3c,0x27, 47 + 0x3f,0x27,0x1c,0x1f, 48 + 0x07,0x07,0x07,0x04, 49 + 50 + 0x58,0xf8,0xec,0xfc, 51 + 0x9e,0xfa,0x1e,0xf2, 52 + 0xfe,0xf2,0x9c,0xfc, 53 + 0xf0,0xf0,0xf0,0x90, 54 + 55 + 0x08,0x0f,0x0d,0x0f, 56 + 0x1b,0x1f,0x3c,0x27, 57 + 0x3f,0x2f,0x34,0x37, 58 + 0x07,0x07,0x07,0x04, 59 + 60 + 0x08,0xf8,0x58,0xf8, 61 + 0xfc,0xf4,0x1c,0xf4, 62 + 0xfc,0xf4,0x98,0xf8, 63 + 0xe0,0xa0,0xc0,0xc0 64 + 65 + }; 66 + 67 + const metasprite_t fighter_up_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t fighter_up_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t fighter_up_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const fighter_up_metasprites[3] = { 92 + fighter_up_metasprite0, fighter_up_metasprite1, fighter_up_metasprite2 93 + };
+29
gb/res/fighter_up.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_fighter_up_H 3 + #define METASPRITE_fighter_up_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define fighter_up_TILE_ORIGIN 0 10 + #define fighter_up_TILE_W 8 11 + #define fighter_up_TILE_H 8 12 + #define fighter_up_WIDTH 16 13 + #define fighter_up_HEIGHT 16 14 + #define fighter_up_TILE_COUNT 10 15 + #define fighter_up_PALETTE_COUNT 1 16 + #define fighter_up_COLORS_PER_PALETTE 4 17 + #define fighter_up_TOTAL_COLORS 4 18 + #define fighter_up_PIVOT_X 8 19 + #define fighter_up_PIVOT_Y 8 20 + #define fighter_up_PIVOT_W 16 21 + #define fighter_up_PIVOT_H 16 22 + extern const metasprite_t* const fighter_up_metasprites[3]; 23 + 24 + BANKREF_EXTERN(fighter_up) 25 + 26 + extern const palette_color_t fighter_up_palettes[4]; 27 + extern const uint8_t fighter_up_tiles[160]; 28 + 29 + #endif
+68
gb/res/goblin_down.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(goblin_down) 8 + 9 + const palette_color_t goblin_down_palettes[4] = { 10 + RGB8(255,255,255), RGB8( 45,237,150), RGB8( 0,182,144), RGB8( 0, 4, 57) 11 + 12 + }; 13 + 14 + const uint8_t goblin_down_tiles[80] = { 15 + 0x03,0x03,0x07,0x04, 16 + 0x3f,0x38,0x6f,0x58, 17 + 0x3f,0x3a,0x0b,0x0e, 18 + 0x05,0x06,0x02,0x03, 19 + 20 + 0x0f,0x0d,0x19,0x16, 21 + 0x19,0x16,0x0f,0x0b, 22 + 0x0f,0x0c,0x07,0x05, 23 + 0x07,0x05,0x05,0x07, 24 + 25 + 0xf0,0xb0,0x98,0x68, 26 + 0x98,0x68,0xf8,0xc8, 27 + 0xf0,0x30,0xc0,0xc0, 28 + 0x00,0x00,0x00,0x00, 29 + 30 + 0x00,0x00,0x03,0x03, 31 + 0x07,0x04,0x3f,0x38, 32 + 0x6f,0x58,0x3f,0x3a, 33 + 0x0b,0x0e,0x05,0x06, 34 + 35 + 0x02,0x03,0x0f,0x0d, 36 + 0x19,0x16,0x19,0x16, 37 + 0x1f,0x13,0x0f,0x0c, 38 + 0x07,0x05,0x05,0x07 39 + 40 + }; 41 + 42 + const metasprite_t goblin_down_metasprite0[] = { 43 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 44 + METASPR_ITEM(0, 8, 0, S_PAL(0) | S_FLIPX), 45 + METASPR_ITEM(8, -8, 1, S_PAL(0)), 46 + METASPR_ITEM(0, 8, 2, S_PAL(0)), 47 + METASPR_TERM 48 + }; 49 + 50 + const metasprite_t goblin_down_metasprite1[] = { 51 + METASPR_ITEM(-8, -8, 3, S_PAL(0)), 52 + METASPR_ITEM(0, 8, 3, S_PAL(0) | S_FLIPX), 53 + METASPR_ITEM(8, -8, 4, S_PAL(0)), 54 + METASPR_ITEM(0, 8, 4, S_PAL(0) | S_FLIPX), 55 + METASPR_TERM 56 + }; 57 + 58 + const metasprite_t goblin_down_metasprite2[] = { 59 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 60 + METASPR_ITEM(0, 8, 0, S_PAL(0) | S_FLIPX), 61 + METASPR_ITEM(8, -8, 2, S_PAL(0) | S_FLIPX), 62 + METASPR_ITEM(0, 8, 1, S_PAL(0) | S_FLIPX), 63 + METASPR_TERM 64 + }; 65 + 66 + const metasprite_t* const goblin_down_metasprites[3] = { 67 + goblin_down_metasprite0, goblin_down_metasprite1, goblin_down_metasprite2 68 + };
+29
gb/res/goblin_down.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_goblin_down_H 3 + #define METASPRITE_goblin_down_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define goblin_down_TILE_ORIGIN 0 10 + #define goblin_down_TILE_W 8 11 + #define goblin_down_TILE_H 8 12 + #define goblin_down_WIDTH 16 13 + #define goblin_down_HEIGHT 16 14 + #define goblin_down_TILE_COUNT 5 15 + #define goblin_down_PALETTE_COUNT 1 16 + #define goblin_down_COLORS_PER_PALETTE 4 17 + #define goblin_down_TOTAL_COLORS 4 18 + #define goblin_down_PIVOT_X 8 19 + #define goblin_down_PIVOT_Y 8 20 + #define goblin_down_PIVOT_W 16 21 + #define goblin_down_PIVOT_H 16 22 + extern const metasprite_t* const goblin_down_metasprites[3]; 23 + 24 + BANKREF_EXTERN(goblin_down) 25 + 26 + extern const palette_color_t goblin_down_palettes[4]; 27 + extern const uint8_t goblin_down_tiles[80]; 28 + 29 + #endif
+93
gb/res/goblin_left.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(goblin_left) 8 + 9 + const palette_color_t goblin_left_palettes[4] = { 10 + RGB8(255,255,255), RGB8( 45,237,150), RGB8( 0,182,144), RGB8( 0, 4, 57) 11 + 12 + }; 13 + 14 + const uint8_t goblin_left_tiles[160] = { 15 + 0x03,0x03,0x07,0x04, 16 + 0x07,0x04,0x07,0x04, 17 + 0x07,0x05,0x0f,0x09, 18 + 0x08,0x0f,0x04,0x07, 19 + 20 + 0xc0,0xc0,0xe0,0x20, 21 + 0xf0,0x10,0xf8,0x78, 22 + 0xd4,0x2c,0x78,0xf8, 23 + 0x20,0xe0,0x40,0xc0, 24 + 25 + 0x03,0x03,0x04,0x07, 26 + 0x04,0x07,0x07,0x04, 27 + 0x07,0x04,0x03,0x02, 28 + 0x03,0x02,0x04,0x07, 29 + 30 + 0xa0,0xe0,0x70,0x90, 31 + 0xd8,0x68,0xb8,0x68, 32 + 0xb8,0x68,0xd0,0x50, 33 + 0xc0,0x40,0x40,0xc0, 34 + 35 + 0x00,0x00,0x03,0x03, 36 + 0x07,0x04,0x07,0x04, 37 + 0x07,0x04,0x07,0x05, 38 + 0x0f,0x09,0x08,0x0f, 39 + 40 + 0x00,0x00,0xc0,0xc0, 41 + 0xe0,0x20,0xf0,0x10, 42 + 0xf8,0x78,0xd4,0x2c, 43 + 0x78,0xf8,0x20,0xe0, 44 + 45 + 0x04,0x07,0x03,0x03, 46 + 0x04,0x07,0x04,0x07, 47 + 0x07,0x04,0x07,0x04, 48 + 0x03,0x02,0x04,0x07, 49 + 50 + 0x40,0xc0,0xa0,0xe0, 51 + 0x70,0x90,0xb0,0x50, 52 + 0xb0,0x50,0xf0,0x50, 53 + 0xe0,0x60,0x40,0xc0, 54 + 55 + 0x03,0x03,0x04,0x07, 56 + 0x04,0x07,0x07,0x04, 57 + 0x07,0x04,0x03,0x02, 58 + 0x07,0x05,0x09,0x0f, 59 + 60 + 0xa0,0xe0,0x70,0x90, 61 + 0xb0,0x50,0xb0,0x50, 62 + 0xf0,0x50,0xa8,0x78, 63 + 0xe8,0xd8,0x30,0x30 64 + 65 + }; 66 + 67 + const metasprite_t goblin_left_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t goblin_left_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t goblin_left_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const goblin_left_metasprites[3] = { 92 + goblin_left_metasprite0, goblin_left_metasprite1, goblin_left_metasprite2 93 + };
+29
gb/res/goblin_left.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_goblin_left_H 3 + #define METASPRITE_goblin_left_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define goblin_left_TILE_ORIGIN 0 10 + #define goblin_left_TILE_W 8 11 + #define goblin_left_TILE_H 8 12 + #define goblin_left_WIDTH 16 13 + #define goblin_left_HEIGHT 16 14 + #define goblin_left_TILE_COUNT 10 15 + #define goblin_left_PALETTE_COUNT 1 16 + #define goblin_left_COLORS_PER_PALETTE 4 17 + #define goblin_left_TOTAL_COLORS 4 18 + #define goblin_left_PIVOT_X 8 19 + #define goblin_left_PIVOT_Y 8 20 + #define goblin_left_PIVOT_W 16 21 + #define goblin_left_PIVOT_H 16 22 + extern const metasprite_t* const goblin_left_metasprites[3]; 23 + 24 + BANKREF_EXTERN(goblin_left) 25 + 26 + extern const palette_color_t goblin_left_palettes[4]; 27 + extern const uint8_t goblin_left_tiles[160]; 28 + 29 + #endif
+68
gb/res/goblin_up.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(goblin_up) 8 + 9 + const palette_color_t goblin_up_palettes[4] = { 10 + RGB8(255,255,255), RGB8( 45,237,150), RGB8( 0,182,144), RGB8( 0, 4, 57) 11 + 12 + }; 13 + 14 + const uint8_t goblin_up_tiles[80] = { 15 + 0x03,0x03,0x07,0x04, 16 + 0x3f,0x38,0x6f,0x58, 17 + 0x3f,0x38,0x0b,0x0c, 18 + 0x05,0x06,0x02,0x03, 19 + 20 + 0x0f,0x0d,0x19,0x16, 21 + 0x19,0x16,0x0f,0x0b, 22 + 0x07,0x04,0x07,0x05, 23 + 0x07,0x05,0x05,0x07, 24 + 25 + 0xf0,0xb0,0x98,0x68, 26 + 0x98,0x68,0xf8,0xc8, 27 + 0xf0,0x30,0xc0,0xc0, 28 + 0x00,0x00,0x00,0x00, 29 + 30 + 0x00,0x00,0x03,0x03, 31 + 0x07,0x04,0x3f,0x38, 32 + 0x6f,0x58,0x3f,0x38, 33 + 0x0b,0x0c,0x05,0x06, 34 + 35 + 0x02,0x03,0x0f,0x0d, 36 + 0x19,0x16,0x19,0x16, 37 + 0x1f,0x13,0x0f,0x0c, 38 + 0x07,0x05,0x05,0x07 39 + 40 + }; 41 + 42 + const metasprite_t goblin_up_metasprite0[] = { 43 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 44 + METASPR_ITEM(0, 8, 0, S_PAL(0) | S_FLIPX), 45 + METASPR_ITEM(8, -8, 1, S_PAL(0)), 46 + METASPR_ITEM(0, 8, 2, S_PAL(0)), 47 + METASPR_TERM 48 + }; 49 + 50 + const metasprite_t goblin_up_metasprite1[] = { 51 + METASPR_ITEM(-8, -8, 3, S_PAL(0)), 52 + METASPR_ITEM(0, 8, 3, S_PAL(0) | S_FLIPX), 53 + METASPR_ITEM(8, -8, 4, S_PAL(0)), 54 + METASPR_ITEM(0, 8, 4, S_PAL(0) | S_FLIPX), 55 + METASPR_TERM 56 + }; 57 + 58 + const metasprite_t goblin_up_metasprite2[] = { 59 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 60 + METASPR_ITEM(0, 8, 0, S_PAL(0) | S_FLIPX), 61 + METASPR_ITEM(8, -8, 2, S_PAL(0) | S_FLIPX), 62 + METASPR_ITEM(0, 8, 1, S_PAL(0) | S_FLIPX), 63 + METASPR_TERM 64 + }; 65 + 66 + const metasprite_t* const goblin_up_metasprites[3] = { 67 + goblin_up_metasprite0, goblin_up_metasprite1, goblin_up_metasprite2 68 + };
+29
gb/res/goblin_up.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_goblin_up_H 3 + #define METASPRITE_goblin_up_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define goblin_up_TILE_ORIGIN 0 10 + #define goblin_up_TILE_W 8 11 + #define goblin_up_TILE_H 8 12 + #define goblin_up_WIDTH 16 13 + #define goblin_up_HEIGHT 16 14 + #define goblin_up_TILE_COUNT 5 15 + #define goblin_up_PALETTE_COUNT 1 16 + #define goblin_up_COLORS_PER_PALETTE 4 17 + #define goblin_up_TOTAL_COLORS 4 18 + #define goblin_up_PIVOT_X 8 19 + #define goblin_up_PIVOT_Y 8 20 + #define goblin_up_PIVOT_W 16 21 + #define goblin_up_PIVOT_H 16 22 + extern const metasprite_t* const goblin_up_metasprites[3]; 23 + 24 + BANKREF_EXTERN(goblin_up) 25 + 26 + extern const palette_color_t goblin_up_palettes[4]; 27 + extern const uint8_t goblin_up_tiles[80]; 28 + 29 + #endif
-102
gb/res/img/dungeon_tiles_floor_tiles.inc
··· 1 - ; DUNGEON_TILES_FLOOR_TILES.INC 2 - ; 3 - ; Include File. 4 - ; 5 - ; Info: 6 - ; Section : Tiles 7 - ; Bank : 0 8 - ; Form : All tiles as one unit. 9 - ; Format : Gameboy 4 color. 10 - ; Compression : None. 11 - ; Counter : None. 12 - ; Tile size : 8 x 8 13 - ; Tiles : 0 to 15 14 - ; 15 - ; Palette colors : Included. 16 - ; SGB Palette : None. 17 - ; CGB Palette : None. 18 - ; 19 - ; Convert to metatiles : No. 20 - ; 21 - ; This file was generated by GBTD v2.2 22 - 23 - 24 - ; Bank of tiles. 25 - dungeon_tiles_floorBank EQU 0 26 - 27 - ; Super Gameboy palette 0 28 - dungeon_tiles_floorSGBPal0c0 EQU 0 29 - dungeon_tiles_floorSGBPal0c1 EQU 0 30 - dungeon_tiles_floorSGBPal0c2 EQU 0 31 - dungeon_tiles_floorSGBPal0c3 EQU 0 32 - 33 - ; Super Gameboy palette 1 34 - dungeon_tiles_floorSGBPal1c0 EQU 6076 35 - dungeon_tiles_floorSGBPal1c1 EQU 8935 36 - dungeon_tiles_floorSGBPal1c2 EQU 6596 37 - dungeon_tiles_floorSGBPal1c3 EQU 5344 38 - 39 - ; Super Gameboy palette 2 40 - dungeon_tiles_floorSGBPal2c0 EQU 6076 41 - dungeon_tiles_floorSGBPal2c1 EQU 8935 42 - dungeon_tiles_floorSGBPal2c2 EQU 6596 43 - dungeon_tiles_floorSGBPal2c3 EQU 5344 44 - 45 - ; Super Gameboy palette 3 46 - dungeon_tiles_floorSGBPal3c0 EQU 6076 47 - dungeon_tiles_floorSGBPal3c1 EQU 8935 48 - dungeon_tiles_floorSGBPal3c2 EQU 6596 49 - dungeon_tiles_floorSGBPal3c3 EQU 5344 50 - 51 - ; Gameboy Color palette 0 52 - dungeon_tiles_floorCGBPal0c0 EQU 26393 53 - dungeon_tiles_floorCGBPal0c1 EQU 18993 54 - dungeon_tiles_floorCGBPal0c2 EQU 16847 55 - dungeon_tiles_floorCGBPal0c3 EQU 0 56 - 57 - ; Gameboy Color palette 1 58 - dungeon_tiles_floorCGBPal1c0 EQU 6076 59 - dungeon_tiles_floorCGBPal1c1 EQU 8935 60 - dungeon_tiles_floorCGBPal1c2 EQU 6596 61 - dungeon_tiles_floorCGBPal1c3 EQU 5344 62 - 63 - ; Gameboy Color palette 2 64 - dungeon_tiles_floorCGBPal2c0 EQU 6076 65 - dungeon_tiles_floorCGBPal2c1 EQU 8935 66 - dungeon_tiles_floorCGBPal2c2 EQU 6596 67 - dungeon_tiles_floorCGBPal2c3 EQU 5344 68 - 69 - ; Gameboy Color palette 3 70 - dungeon_tiles_floorCGBPal3c0 EQU 6076 71 - dungeon_tiles_floorCGBPal3c1 EQU 8935 72 - dungeon_tiles_floorCGBPal3c2 EQU 6596 73 - dungeon_tiles_floorCGBPal3c3 EQU 5344 74 - 75 - ; Gameboy Color palette 4 76 - dungeon_tiles_floorCGBPal4c0 EQU 6076 77 - dungeon_tiles_floorCGBPal4c1 EQU 8935 78 - dungeon_tiles_floorCGBPal4c2 EQU 6596 79 - dungeon_tiles_floorCGBPal4c3 EQU 5344 80 - 81 - ; Gameboy Color palette 5 82 - dungeon_tiles_floorCGBPal5c0 EQU 6076 83 - dungeon_tiles_floorCGBPal5c1 EQU 8935 84 - dungeon_tiles_floorCGBPal5c2 EQU 6596 85 - dungeon_tiles_floorCGBPal5c3 EQU 5344 86 - 87 - ; Gameboy Color palette 6 88 - dungeon_tiles_floorCGBPal6c0 EQU 6076 89 - dungeon_tiles_floorCGBPal6c1 EQU 8935 90 - dungeon_tiles_floorCGBPal6c2 EQU 6596 91 - dungeon_tiles_floorCGBPal6c3 EQU 5344 92 - 93 - ; Gameboy Color palette 7 94 - dungeon_tiles_floorCGBPal7c0 EQU 6076 95 - dungeon_tiles_floorCGBPal7c1 EQU 8935 96 - dungeon_tiles_floorCGBPal7c2 EQU 6596 97 - dungeon_tiles_floorCGBPal7c3 EQU 5344 98 - 99 - ; Start of tile array. 100 - GLOBAL dungeon_tiles_floor 101 - 102 - ; End of DUNGEON_TILES_FLOOR_TILES.INC
+93
gb/res/rogue_down.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(rogue_down) 8 + 9 + const palette_color_t rogue_down_palettes[4] = { 10 + RGB8(255,255,255), RGB8(252,224,170), RGB8(138, 16, 0), RGB8( 7, 10, 5) 11 + 12 + }; 13 + 14 + const uint8_t rogue_down_tiles[160] = { 15 + 0x00,0x00,0x01,0x01, 16 + 0x06,0x07,0x08,0x0f, 17 + 0x0d,0x0f,0x08,0x0f, 18 + 0x0f,0x0f,0x1f,0x12, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x30,0xf0,0x08,0xf8, 22 + 0xd8,0xf8,0x08,0xf8, 23 + 0xf8,0xf8,0xfc,0x24, 24 + 25 + 0x0f,0x0a,0x0c,0x0f, 26 + 0x12,0x1f,0x35,0x3f, 27 + 0x2d,0x3f,0x36,0x37, 28 + 0x04,0x07,0x04,0x07, 29 + 30 + 0xf8,0x28,0x18,0xf8, 31 + 0x24,0xfc,0xdc,0xfc, 32 + 0xe4,0xfc,0xb8,0xf8, 33 + 0xa0,0xe0,0xc0,0xc0, 34 + 35 + 0x01,0x01,0x06,0x07, 36 + 0x08,0x0f,0x0d,0x0f, 37 + 0x08,0x0f,0x0f,0x0f, 38 + 0x1f,0x12,0x0f,0x0a, 39 + 40 + 0xc0,0xc0,0x30,0xf0, 41 + 0x08,0xf8,0xd8,0xf8, 42 + 0x08,0xf8,0xf8,0xf8, 43 + 0xfc,0x24,0xf8,0x28, 44 + 45 + 0x0c,0x0f,0x1a,0x1f, 46 + 0x21,0x3f,0x3c,0x3f, 47 + 0x25,0x3f,0x1e,0x1f, 48 + 0x04,0x07,0x04,0x07, 49 + 50 + 0x18,0xf8,0x2c,0xfc, 51 + 0xc2,0xfe,0x9e,0xfe, 52 + 0xd2,0xfe,0x3c,0xfc, 53 + 0x90,0xf0,0x90,0xf0, 54 + 55 + 0x0f,0x0a,0x0c,0x0f, 56 + 0x12,0x1f,0x1d,0x1f, 57 + 0x13,0x1f,0x0e,0x0f, 58 + 0x02,0x03,0x01,0x01, 59 + 60 + 0xf8,0x28,0x18,0xf8, 61 + 0x24,0xfc,0xd6,0xfe, 62 + 0xda,0xfe,0xb6,0xf6, 63 + 0x90,0xf0,0x90,0xf0 64 + 65 + }; 66 + 67 + const metasprite_t rogue_down_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t rogue_down_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t rogue_down_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const rogue_down_metasprites[3] = { 92 + rogue_down_metasprite0, rogue_down_metasprite1, rogue_down_metasprite2 93 + };
+29
gb/res/rogue_down.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_rogue_down_H 3 + #define METASPRITE_rogue_down_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define rogue_down_TILE_ORIGIN 0 10 + #define rogue_down_TILE_W 8 11 + #define rogue_down_TILE_H 8 12 + #define rogue_down_WIDTH 16 13 + #define rogue_down_HEIGHT 16 14 + #define rogue_down_TILE_COUNT 10 15 + #define rogue_down_PALETTE_COUNT 1 16 + #define rogue_down_COLORS_PER_PALETTE 4 17 + #define rogue_down_TOTAL_COLORS 4 18 + #define rogue_down_PIVOT_X 8 19 + #define rogue_down_PIVOT_Y 8 20 + #define rogue_down_PIVOT_W 16 21 + #define rogue_down_PIVOT_H 16 22 + extern const metasprite_t* const rogue_down_metasprites[3]; 23 + 24 + BANKREF_EXTERN(rogue_down) 25 + 26 + extern const palette_color_t rogue_down_palettes[4]; 27 + extern const uint8_t rogue_down_tiles[160]; 28 + 29 + #endif
+93
gb/res/rogue_left.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(rogue_left) 8 + 9 + const palette_color_t rogue_left_palettes[4] = { 10 + RGB8(255,255,255), RGB8(252,224,170), RGB8(138, 16, 0), RGB8( 7, 10, 5) 11 + 12 + }; 13 + 14 + const uint8_t rogue_left_tiles[160] = { 15 + 0x00,0x00,0x03,0x03, 16 + 0x04,0x07,0x08,0x0f, 17 + 0x0d,0x0f,0x08,0x0f, 18 + 0x0f,0x0f,0x0f,0x0a, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x20,0xe0,0x10,0xf0, 22 + 0x08,0xf8,0x88,0xf8, 23 + 0x08,0xf8,0xa8,0xf8, 24 + 25 + 0x0f,0x0a,0x08,0x0f, 26 + 0x07,0x07,0x0d,0x0f, 27 + 0x15,0x1f,0x0f,0x0f, 28 + 0x04,0x07,0x09,0x0f, 29 + 30 + 0x74,0xdc,0x28,0xe8, 31 + 0xf0,0xf0,0x50,0xf0, 32 + 0x38,0xf8,0xa8,0xf8, 33 + 0xf0,0xf0,0x90,0xf0, 34 + 35 + 0x03,0x03,0x04,0x07, 36 + 0x08,0x0f,0x0d,0x0f, 37 + 0x08,0x0f,0x0f,0x0f, 38 + 0x0f,0x0a,0x0f,0x0a, 39 + 40 + 0xc0,0xc0,0x20,0xe0, 41 + 0x10,0xf0,0x08,0xf8, 42 + 0x88,0xf8,0x08,0xf8, 43 + 0xa8,0xf8,0x74,0xdc, 44 + 45 + 0x08,0x0f,0x07,0x07, 46 + 0x02,0x03,0x03,0x03, 47 + 0x02,0x03,0x03,0x03, 48 + 0x02,0x03,0x04,0x07, 49 + 50 + 0x28,0xe8,0xe0,0xe0, 51 + 0xa0,0xe0,0xd0,0xf0, 52 + 0x90,0xf0,0xe0,0xe0, 53 + 0x40,0xc0,0x40,0xc0, 54 + 55 + 0x0f,0x0a,0x08,0x0f, 56 + 0x07,0x07,0x05,0x07, 57 + 0x05,0x07,0x07,0x07, 58 + 0x05,0x07,0x09,0x0f, 59 + 60 + 0x74,0xdc,0x28,0xe8, 61 + 0xe0,0xe0,0x50,0xf0, 62 + 0x90,0xf0,0x60,0xe0, 63 + 0xf0,0xf0,0x90,0xf0 64 + 65 + }; 66 + 67 + const metasprite_t rogue_left_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t rogue_left_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t rogue_left_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const rogue_left_metasprites[3] = { 92 + rogue_left_metasprite0, rogue_left_metasprite1, rogue_left_metasprite2 93 + };
+29
gb/res/rogue_left.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_rogue_left_H 3 + #define METASPRITE_rogue_left_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define rogue_left_TILE_ORIGIN 0 10 + #define rogue_left_TILE_W 8 11 + #define rogue_left_TILE_H 8 12 + #define rogue_left_WIDTH 16 13 + #define rogue_left_HEIGHT 16 14 + #define rogue_left_TILE_COUNT 10 15 + #define rogue_left_PALETTE_COUNT 1 16 + #define rogue_left_COLORS_PER_PALETTE 4 17 + #define rogue_left_TOTAL_COLORS 4 18 + #define rogue_left_PIVOT_X 8 19 + #define rogue_left_PIVOT_Y 8 20 + #define rogue_left_PIVOT_W 16 21 + #define rogue_left_PIVOT_H 16 22 + extern const metasprite_t* const rogue_left_metasprites[3]; 23 + 24 + BANKREF_EXTERN(rogue_left) 25 + 26 + extern const palette_color_t rogue_left_palettes[4]; 27 + extern const uint8_t rogue_left_tiles[160]; 28 + 29 + #endif
+93
gb/res/rogue_up.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(rogue_up) 8 + 9 + const palette_color_t rogue_up_palettes[4] = { 10 + RGB8(255,255,255), RGB8(252,224,170), RGB8(138, 16, 0), RGB8( 7, 10, 5) 11 + 12 + }; 13 + 14 + const uint8_t rogue_up_tiles[160] = { 15 + 0x00,0x00,0x01,0x01, 16 + 0x06,0x07,0x08,0x0f, 17 + 0x0c,0x0f,0x08,0x0f, 18 + 0x0c,0x0f,0x1b,0x17, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x30,0xf0,0x08,0xf8, 22 + 0x18,0xf8,0x08,0xf8, 23 + 0x98,0xf8,0x6c,0xf4, 24 + 25 + 0x09,0x0f,0x0c,0x0f, 26 + 0x17,0x1f,0x1c,0x1f, 27 + 0x14,0x1f,0x0f,0x0f, 28 + 0x02,0x03,0x01,0x01, 29 + 30 + 0x48,0xf8,0x98,0xf8, 31 + 0xe4,0xfc,0x16,0xfe, 32 + 0x1a,0xfe,0xf6,0xf6, 33 + 0x90,0xf0,0x90,0xf0, 34 + 35 + 0x01,0x01,0x06,0x07, 36 + 0x08,0x0f,0x0c,0x0f, 37 + 0x08,0x0f,0x0c,0x0f, 38 + 0x1b,0x17,0x09,0x0f, 39 + 40 + 0xc0,0xc0,0x30,0xf0, 41 + 0x08,0xf8,0x18,0xf8, 42 + 0x08,0xf8,0x98,0xf8, 43 + 0x6c,0xf4,0x48,0xf8, 44 + 45 + 0x0c,0x0f,0x13,0x1f, 46 + 0x20,0x3f,0x3c,0x3f, 47 + 0x24,0x3f,0x1f,0x1f, 48 + 0x04,0x07,0x04,0x07, 49 + 50 + 0x98,0xf8,0xe4,0xfc, 51 + 0x02,0xfe,0x1e,0xfe, 52 + 0x12,0xfe,0xfc,0xfc, 53 + 0x90,0xf0,0x90,0xf0, 54 + 55 + 0x09,0x0f,0x0c,0x0f, 56 + 0x13,0x1f,0x34,0x3f, 57 + 0x2c,0x3f,0x37,0x37, 58 + 0x04,0x07,0x04,0x07, 59 + 60 + 0x48,0xf8,0x98,0xf8, 61 + 0xf4,0xfc,0x1c,0xfc, 62 + 0x14,0xfc,0xf8,0xf8, 63 + 0xa0,0xe0,0xc0,0xc0 64 + 65 + }; 66 + 67 + const metasprite_t rogue_up_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t rogue_up_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t rogue_up_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const rogue_up_metasprites[3] = { 92 + rogue_up_metasprite0, rogue_up_metasprite1, rogue_up_metasprite2 93 + };
+29
gb/res/rogue_up.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_rogue_up_H 3 + #define METASPRITE_rogue_up_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define rogue_up_TILE_ORIGIN 0 10 + #define rogue_up_TILE_W 8 11 + #define rogue_up_TILE_H 8 12 + #define rogue_up_WIDTH 16 13 + #define rogue_up_HEIGHT 16 14 + #define rogue_up_TILE_COUNT 10 15 + #define rogue_up_PALETTE_COUNT 1 16 + #define rogue_up_COLORS_PER_PALETTE 4 17 + #define rogue_up_TOTAL_COLORS 4 18 + #define rogue_up_PIVOT_X 8 19 + #define rogue_up_PIVOT_Y 8 20 + #define rogue_up_PIVOT_W 16 21 + #define rogue_up_PIVOT_H 16 22 + extern const metasprite_t* const rogue_up_metasprites[3]; 23 + 24 + BANKREF_EXTERN(rogue_up) 25 + 26 + extern const palette_color_t rogue_up_palettes[4]; 27 + extern const uint8_t rogue_up_tiles[160]; 28 + 29 + #endif
+65
gb/res/room.c
··· 1 + /* 2 + Tilemap: 20 x 18, Plain tiles 3 + Exported by Tilemap Studio 4 + */ 5 + 6 + const unsigned char room_tilemap[] = { 7 + 0x32, 0x33, 0x34, 0x34, 0x34, 0x35, 0x34, 0x35, 0x34, 0x34, 0x35, 0x35, 8 + 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x36, 0x37, 0x3e, 0x3f, 0x40, 0x41, 9 + 0x40, 0x41, 0x40, 0x41, 0x40, 0x40, 0x41, 0x41, 0x40, 0x41, 0x40, 0x41, 10 + 0x40, 0x41, 0x42, 0x43, 0x4a, 0x4b, 0x4c, 0x4d, 0x4c, 0x4d, 0x4c, 0x4d, 11 + 0x4c, 0x4c, 0x4d, 0x4d, 0x4c, 0x4d, 0x4c, 0x4d, 0x4c, 0x4d, 0x4e, 0x4f, 12 + 0x56, 0x57, 0x58, 0x59, 0x58, 0x59, 0x58, 0x59, 0x58, 0x58, 0x59, 0x59, 13 + 0x58, 0x59, 0x58, 0x59, 0x58, 0x59, 0x5a, 0x5b, 0x26, 0x27, 0x27, 0x27, 14 + 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 15 + 0x27, 0x27, 0x27, 0x28, 0x2d, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 16 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x29, 17 + 0x2d, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 18 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x29, 0x2d, 0x25, 0x25, 0x25, 19 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 20 + 0x25, 0x25, 0x25, 0x29, 0x2d, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 21 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x29, 22 + 0x2d, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 23 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x29, 0x2d, 0x25, 0x25, 0x25, 24 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 25 + 0x25, 0x25, 0x25, 0x29, 0x2d, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 26 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x29, 27 + 0x2d, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 28 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x29, 0x2d, 0x25, 0x25, 0x25, 29 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 30 + 0x25, 0x25, 0x25, 0x29, 0x2d, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 31 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x29, 32 + 0x2d, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 33 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x29, 0x2d, 0x25, 0x25, 0x25, 34 + 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 35 + 0x25, 0x25, 0x25, 0x29, 0x2c, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 36 + 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2a 37 + }; 38 + 39 + const unsigned int room_len = 360; 40 + 41 + const unsigned char door_tiles[] = { 42 + 0x37, 0x38, 0x39, 0x32, 43 + 0x43, 0x44, 0x45, 0x3e, 44 + 0x4f, 0x50, 0x51, 0x4a, 45 + 0x5b, 0x5c, 0x5d, 0x56, 46 + 0x27, 0x25, 0x25, 0x27 47 + }; 48 + 49 + const unsigned char stair_down_tiles[] = { 50 + 0x37, 0x2e, 0x2f, 0x32, 51 + 0x43, 0x3a, 0x3b, 0x3e, 52 + 0x4f, 0x46, 0x47, 0x4a, 53 + 0x5b, 0x52, 0x53, 0x56, 54 + 0x27, 0x25, 0x25, 0x27 55 + }; 56 + 57 + const unsigned char stair_up_tiles[] = { 58 + 0x34, 0x30, 0x31, 0x32, 59 + 0x43, 0x3c, 0x3d, 0x3e, 60 + 0x4f, 0x48, 0x49, 0x4a, 61 + 0x5b, 0x54, 0x55, 0x56, 62 + 0x27, 0x25, 0x25, 0x27 63 + }; 64 + 65 + const unsigned char other_door[] = { 0x25, 0x25 };
+29
gb/res/room.h
··· 1 + #ifndef ROOM_H 2 + #define ROOM_H 3 + 4 + #define ROOM_TILE_WIDTH 20 5 + #define ROOM_TILE_HEIGHT 18 6 + 7 + extern const unsigned char room_tilemap[]; 8 + extern const unsigned int room_len; 9 + extern const unsigned char door_tiles[]; 10 + extern const unsigned char other_door[]; 11 + extern const unsigned char stair_up_tiles[]; 12 + extern const unsigned char stair_down_tiles[]; 13 + 14 + #define door_tiles_x 8 15 + #define door_tiles_y 0 16 + #define door_tiles_w 4 17 + #define door_tiles_h 5 18 + 19 + #define stair_down_x 2 20 + #define stair_down_y 0 21 + #define stair_down_w 4 22 + #define stair_down_h 5 23 + 24 + #define stair_up_x 14 25 + #define stair_up_y 0 26 + #define stair_up_w 4 27 + #define stair_up_h 5 28 + 29 + #endif
+16
gb/res/window.c
··· 1 + /* 2 + Tilemap: 20 x 4, Plain tiles 3 + Exported by Tilemap Studio 4 + */ 5 + 6 + const unsigned char window_tilemap[] = { 7 + 0x5f, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 8 + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x61, 0x66, 0x5e, 0x5e, 0x5e, 9 + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 10 + 0x5e, 0x5e, 0x5e, 0x62, 0x66, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 11 + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x62, 12 + 0x65, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 13 + 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x63 14 + }; 15 + 16 + const unsigned int window_len = 80;
+7
gb/res/window.h
··· 1 + #ifndef WINDOW_H 2 + #define WINDOW_H 3 + 4 + extern const unsigned char window_tilemap[]; 5 + extern const unsigned int window_len; 6 + 7 + #endif
+48
gb/res/window_tiles.c
··· 1 + /* 2 + 3 + /GIT/DUNGEONER/GB/RES/WINDOW_TILES.C 4 + 5 + Tile Source File. 6 + 7 + Info: 8 + Form : All tiles as one unit. 9 + Format : Gameboy 4 color. 10 + Compression : None. 11 + Counter : None. 12 + Tile size : 8 x 8 13 + Tiles : 0 to 8 14 + 15 + Palette colors : None. 16 + SGB Palette : None. 17 + CGB Palette : None. 18 + 19 + Convert to metatiles : No. 20 + 21 + This file was generated by GBTD v2.2 22 + 23 + */ 24 + 25 + /* Start of tile array. */ 26 + const unsigned char window_tiles[] = 27 + { 28 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 29 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 30 + 0xFF,0xFF,0x80,0x80,0x80,0x80,0x80,0x80, 31 + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 32 + 0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 33 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 34 + 0xFF,0xFF,0x01,0x01,0x01,0x01,0x01,0x01, 35 + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 36 + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 37 + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 38 + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 39 + 0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0xFF, 40 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 41 + 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF, 42 + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 43 + 0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0xFF, 44 + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 45 + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 46 + }; 47 + 48 + /* End of /GIT/DUNGEONER/GB/RES/WINDOW_TILES.C */
+35
gb/res/window_tiles.h
··· 1 + /* 2 + 3 + /GIT/DUNGEONER/GB/RES/WINDOW_TILES.H 4 + 5 + Include File. 6 + 7 + Info: 8 + Form : All tiles as one unit. 9 + Format : Gameboy 4 color. 10 + Compression : None. 11 + Counter : None. 12 + Tile size : 8 x 8 13 + Tiles : 0 to 8 14 + 15 + Palette colors : None. 16 + SGB Palette : None. 17 + CGB Palette : None. 18 + 19 + Convert to metatiles : No. 20 + 21 + This file was generated by GBTD v2.2 22 + 23 + */ 24 + 25 + #ifndef ___git_dungeoner_gb_res_window_tiles_h_INCLUDE 26 + #define ___git_dungeoner_gb_res_window_tiles_h_INCLUDE 27 + 28 + /* Bank of tiles. */ 29 + #define window_tilesBank 0 30 + /* Start of tile array. */ 31 + extern const unsigned char window_tiles[]; 32 + 33 + #endif 34 + 35 + /* End of /GIT/DUNGEONER/GB/RES/WINDOW_TILES.H */
+93
gb/res/wizard_down.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(wizard_down) 8 + 9 + const palette_color_t wizard_down_palettes[4] = { 10 + RGB8(255,255,255), RGB8(252,224,168), RGB8(248, 56, 0), RGB8( 8, 8, 8) 11 + 12 + }; 13 + 14 + const uint8_t wizard_down_tiles[160] = { 15 + 0x00,0x00,0x01,0x01, 16 + 0x06,0x07,0x08,0x0f, 17 + 0x08,0x0f,0x0b,0x0f, 18 + 0x0f,0x0f,0x1f,0x1d, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x30,0xf0,0x08,0xf8, 22 + 0x08,0xf8,0xe8,0xf8, 23 + 0xf8,0xf8,0xfc,0xdc, 24 + 25 + 0x0f,0x0d,0x0f,0x0f, 26 + 0x13,0x1f,0x24,0x3f, 27 + 0x3c,0x2f,0x34,0x37, 28 + 0x04,0x07,0x0b,0x0c, 29 + 30 + 0xf8,0xd8,0xf8,0xf8, 31 + 0xe4,0xfc,0x9c,0xfc, 32 + 0xbc,0xe4,0x38,0xf8, 33 + 0x10,0xf0,0x70,0xf0, 34 + 35 + 0x01,0x01,0x06,0x07, 36 + 0x08,0x0f,0x08,0x0f, 37 + 0x0b,0x0f,0x0f,0x0f, 38 + 0x1f,0x1d,0x0f,0x0d, 39 + 40 + 0xc0,0xc0,0x30,0xf0, 41 + 0x08,0xf8,0x08,0xf8, 42 + 0xe8,0xf8,0xf8,0xf8, 43 + 0xfc,0xdc,0xf8,0xd8, 44 + 45 + 0x0f,0x0f,0x13,0x1f, 46 + 0x20,0x3f,0x24,0x3f, 47 + 0x2c,0x37,0x1c,0x1f, 48 + 0x08,0x0f,0x0b,0x0c, 49 + 50 + 0xf8,0xf8,0xe4,0xfc, 51 + 0x82,0xfe,0x92,0xfe, 52 + 0x1a,0xf6,0x1c,0xfc, 53 + 0x08,0xf8,0x68,0x98, 54 + 55 + 0x0f,0x0d,0x0f,0x0f, 56 + 0x13,0x1f,0x1c,0x1f, 57 + 0x1e,0x13,0x0e,0x0f, 58 + 0x04,0x07,0x07,0x07, 59 + 60 + 0xf8,0xd8,0xf8,0xf8, 61 + 0xe4,0xfc,0x92,0xfe, 62 + 0x9e,0xfa,0x16,0xf6, 63 + 0x10,0xf0,0x68,0x98 64 + 65 + }; 66 + 67 + const metasprite_t wizard_down_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t wizard_down_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t wizard_down_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const wizard_down_metasprites[3] = { 92 + wizard_down_metasprite0, wizard_down_metasprite1, wizard_down_metasprite2 93 + };
+29
gb/res/wizard_down.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_wizard_down_H 3 + #define METASPRITE_wizard_down_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define wizard_down_TILE_ORIGIN 0 10 + #define wizard_down_TILE_W 8 11 + #define wizard_down_TILE_H 8 12 + #define wizard_down_WIDTH 16 13 + #define wizard_down_HEIGHT 16 14 + #define wizard_down_TILE_COUNT 10 15 + #define wizard_down_PALETTE_COUNT 1 16 + #define wizard_down_COLORS_PER_PALETTE 4 17 + #define wizard_down_TOTAL_COLORS 4 18 + #define wizard_down_PIVOT_X 8 19 + #define wizard_down_PIVOT_Y 8 20 + #define wizard_down_PIVOT_W 16 21 + #define wizard_down_PIVOT_H 16 22 + extern const metasprite_t* const wizard_down_metasprites[3]; 23 + 24 + BANKREF_EXTERN(wizard_down) 25 + 26 + extern const palette_color_t wizard_down_palettes[4]; 27 + extern const uint8_t wizard_down_tiles[160]; 28 + 29 + #endif
+93
gb/res/wizard_left.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(wizard_left) 8 + 9 + const palette_color_t wizard_left_palettes[4] = { 10 + RGB8(255,255,255), RGB8(252,224,168), RGB8(248, 56, 0), RGB8( 8, 8, 8) 11 + 12 + }; 13 + 14 + const uint8_t wizard_left_tiles[160] = { 15 + 0x00,0x00,0x03,0x03, 16 + 0x0c,0x0f,0x08,0x0f, 17 + 0x10,0x1f,0x10,0x1f, 18 + 0x1f,0x1f,0x0f,0x0d, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x30,0xf0,0x10,0xf0, 22 + 0x08,0xf8,0x08,0xf8, 23 + 0x08,0xf8,0x88,0xf8, 24 + 25 + 0x0f,0x0d,0x0f,0x0f, 26 + 0x07,0x07,0x0c,0x0f, 27 + 0x1c,0x17,0x0c,0x0f, 28 + 0x04,0x07,0x0c,0x0b, 29 + 30 + 0x88,0xf8,0x08,0xf8, 31 + 0x38,0xf8,0x50,0xf0, 32 + 0x48,0xf8,0x38,0xe8, 33 + 0x10,0xf0,0xd0,0xf0, 34 + 35 + 0x03,0x03,0x0c,0x0f, 36 + 0x08,0x0f,0x10,0x1f, 37 + 0x10,0x1f,0x1f,0x1f, 38 + 0x0f,0x0d,0x0f,0x0d, 39 + 40 + 0xc0,0xc0,0x30,0xf0, 41 + 0x10,0xf0,0x08,0xf8, 42 + 0x08,0xf8,0x08,0xf8, 43 + 0x88,0xf8,0x88,0xf8, 44 + 45 + 0x0f,0x0f,0x07,0x07, 46 + 0x04,0x07,0x05,0x07, 47 + 0x07,0x06,0x05,0x07, 48 + 0x04,0x07,0x04,0x07, 49 + 50 + 0x08,0xf8,0x38,0xf8, 51 + 0x20,0xe0,0xd0,0xf0, 52 + 0x10,0xf0,0xe0,0xe0, 53 + 0x10,0xf0,0x08,0xf8, 54 + 55 + 0x0f,0x0d,0x0f,0x0f, 56 + 0x07,0x07,0x04,0x07, 57 + 0x04,0x07,0x05,0x07, 58 + 0x05,0x07,0x08,0x0f, 59 + 60 + 0x88,0xf8,0x88,0xf8, 61 + 0xb8,0xf8,0x50,0xf0, 62 + 0x90,0xf0,0xa0,0x60, 63 + 0xf0,0xf0,0x10,0xf0 64 + 65 + }; 66 + 67 + const metasprite_t wizard_left_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t wizard_left_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t wizard_left_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const wizard_left_metasprites[3] = { 92 + wizard_left_metasprite0, wizard_left_metasprite1, wizard_left_metasprite2 93 + };
+29
gb/res/wizard_left.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_wizard_left_H 3 + #define METASPRITE_wizard_left_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define wizard_left_TILE_ORIGIN 0 10 + #define wizard_left_TILE_W 8 11 + #define wizard_left_TILE_H 8 12 + #define wizard_left_WIDTH 16 13 + #define wizard_left_HEIGHT 16 14 + #define wizard_left_TILE_COUNT 10 15 + #define wizard_left_PALETTE_COUNT 1 16 + #define wizard_left_COLORS_PER_PALETTE 4 17 + #define wizard_left_TOTAL_COLORS 4 18 + #define wizard_left_PIVOT_X 8 19 + #define wizard_left_PIVOT_Y 8 20 + #define wizard_left_PIVOT_W 16 21 + #define wizard_left_PIVOT_H 16 22 + extern const metasprite_t* const wizard_left_metasprites[3]; 23 + 24 + BANKREF_EXTERN(wizard_left) 25 + 26 + extern const palette_color_t wizard_left_palettes[4]; 27 + extern const uint8_t wizard_left_tiles[160]; 28 + 29 + #endif
+93
gb/res/wizard_up.c
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + 3 + #include <stdint.h> 4 + #include <gbdk/platform.h> 5 + #include <gbdk/metasprites.h> 6 + 7 + BANKREF(wizard_up) 8 + 9 + const palette_color_t wizard_up_palettes[4] = { 10 + RGB8(255,255,255), RGB8(252,224,168), RGB8(248, 56, 0), RGB8( 8, 8, 8) 11 + 12 + }; 13 + 14 + const uint8_t wizard_up_tiles[160] = { 15 + 0x00,0x00,0x01,0x01, 16 + 0x06,0x07,0x08,0x0f, 17 + 0x08,0x0f,0x08,0x0f, 18 + 0x08,0x0f,0x10,0x1f, 19 + 20 + 0x00,0x00,0xc0,0xc0, 21 + 0x30,0xf0,0x08,0xf8, 22 + 0x08,0xf8,0x08,0xf8, 23 + 0x08,0xf8,0x04,0xfc, 24 + 25 + 0x08,0x0f,0x0b,0x0f, 26 + 0x10,0x1f,0x1c,0x1f, 27 + 0x1c,0x17,0x0c,0x0f, 28 + 0x08,0x0f,0x0f,0x0f, 29 + 30 + 0x08,0xf8,0xe8,0xf8, 31 + 0x04,0xfc,0x16,0xfe, 32 + 0x1e,0xfa,0x0e,0xfe, 33 + 0x08,0xf8,0x88,0xf8, 34 + 35 + 0x01,0x01,0x06,0x07, 36 + 0x08,0x0f,0x08,0x0f, 37 + 0x08,0x0f,0x08,0x0f, 38 + 0x10,0x1f,0x08,0x0f, 39 + 40 + 0xc0,0xc0,0x30,0xf0, 41 + 0x08,0xf8,0x08,0xf8, 42 + 0x08,0xf8,0x08,0xf8, 43 + 0x04,0xfc,0x08,0xf8, 44 + 45 + 0x08,0x0f,0x13,0x1f, 46 + 0x20,0x3f,0x28,0x3f, 47 + 0x28,0x3f,0x18,0x1f, 48 + 0x08,0x0f,0x08,0x0f, 49 + 50 + 0x08,0xf8,0xe4,0xfc, 51 + 0x02,0xfe,0x0a,0xfe, 52 + 0x0a,0xfe,0x0c,0xfc, 53 + 0x08,0xf8,0x08,0xf8, 54 + 55 + 0x08,0x0f,0x0b,0x0f, 56 + 0x10,0x1f,0x34,0x3f, 57 + 0x3c,0x2f,0x38,0x3f, 58 + 0x08,0x0f,0x08,0x0f, 59 + 60 + 0x08,0xf8,0xe8,0xf8, 61 + 0x04,0xfc,0x1c,0xfc, 62 + 0x1c,0xf4,0x18,0xf8, 63 + 0x08,0xf8,0xf8,0xf8 64 + 65 + }; 66 + 67 + const metasprite_t wizard_up_metasprite0[] = { 68 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 69 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 70 + METASPR_ITEM(8, -8, 2, S_PAL(0)), 71 + METASPR_ITEM(0, 8, 3, S_PAL(0)), 72 + METASPR_TERM 73 + }; 74 + 75 + const metasprite_t wizard_up_metasprite1[] = { 76 + METASPR_ITEM(-8, -8, 4, S_PAL(0)), 77 + METASPR_ITEM(0, 8, 5, S_PAL(0)), 78 + METASPR_ITEM(8, -8, 6, S_PAL(0)), 79 + METASPR_ITEM(0, 8, 7, S_PAL(0)), 80 + METASPR_TERM 81 + }; 82 + 83 + const metasprite_t wizard_up_metasprite2[] = { 84 + METASPR_ITEM(-8, -8, 0, S_PAL(0)), 85 + METASPR_ITEM(0, 8, 1, S_PAL(0)), 86 + METASPR_ITEM(8, -8, 8, S_PAL(0)), 87 + METASPR_ITEM(0, 8, 9, S_PAL(0)), 88 + METASPR_TERM 89 + }; 90 + 91 + const metasprite_t* const wizard_up_metasprites[3] = { 92 + wizard_up_metasprite0, wizard_up_metasprite1, wizard_up_metasprite2 93 + };
+29
gb/res/wizard_up.h
··· 1 + //AUTOGENERATED FILE FROM png2asset 2 + #ifndef METASPRITE_wizard_up_H 3 + #define METASPRITE_wizard_up_H 4 + 5 + #include <stdint.h> 6 + #include <gbdk/platform.h> 7 + #include <gbdk/metasprites.h> 8 + 9 + #define wizard_up_TILE_ORIGIN 0 10 + #define wizard_up_TILE_W 8 11 + #define wizard_up_TILE_H 8 12 + #define wizard_up_WIDTH 16 13 + #define wizard_up_HEIGHT 16 14 + #define wizard_up_TILE_COUNT 10 15 + #define wizard_up_PALETTE_COUNT 1 16 + #define wizard_up_COLORS_PER_PALETTE 4 17 + #define wizard_up_TOTAL_COLORS 4 18 + #define wizard_up_PIVOT_X 8 19 + #define wizard_up_PIVOT_Y 8 20 + #define wizard_up_PIVOT_W 16 21 + #define wizard_up_PIVOT_H 16 22 + extern const metasprite_t* const wizard_up_metasprites[3]; 23 + 24 + BANKREF_EXTERN(wizard_up) 25 + 26 + extern const palette_color_t wizard_up_palettes[4]; 27 + extern const uint8_t wizard_up_tiles[160]; 28 + 29 + #endif
-5
gb/src/assets/build_date.asm
··· 1 - SECTION "Build date", ROM0 2 - db "Built " 3 - BuildDate:: 4 - db __ISO_8601_UTC__ 5 - db 0
+184
gb/src/character.c
··· 1 + #include "character.h" 2 + #include <stdbool.h> 3 + 4 + bool Character_is_valid(Character ch) { 5 + if (ch.ancestry == DWARF) { 6 + return (ch.heritage <= DWARF_STRONG_BLOODED) || (ch.heritage == VERS_AIUVARIN) || (ch.heritage == VERS_DROMAAR) || (ch.heritage == VERS_CHANGELING) || (ch.heritage == VERS_DRAGONBLOOD) || (ch.heritage == VERS_NEPHILIM); 7 + } else if (ch.ancestry == ELF) { 8 + return ((ch.heritage >= ELF_ANCIENT) && (ch.heritage <= ELF_WOODLAND)) || (ch.heritage == VERS_AIUVARIN) || (ch.heritage == VERS_DROMAAR) || (ch.heritage == VERS_CHANGELING) || (ch.heritage == VERS_DRAGONBLOOD) || (ch.heritage == VERS_NEPHILIM); 9 + } else if (ch.ancestry == GNOME) { 10 + return ((ch.heritage >= GNOME_CHAMELEON) && (ch.heritage <= GNOME_WELLSPRING)) || (ch.heritage == VERS_AIUVARIN) || (ch.heritage == VERS_DROMAAR) || (ch.heritage == VERS_CHANGELING) || (ch.heritage == VERS_DRAGONBLOOD) || (ch.heritage == VERS_NEPHILIM); 11 + } else if (ch.ancestry == GOBLIN) { 12 + return ((ch.heritage >= GOBLIN_CHARHIDE) && (ch.heritage <= GOBLIN_UNBREAKABLE)) || (ch.heritage == VERS_AIUVARIN) || (ch.heritage == VERS_DROMAAR) || (ch.heritage == VERS_CHANGELING) || (ch.heritage == VERS_DRAGONBLOOD) || (ch.heritage == VERS_NEPHILIM); 13 + } else if (ch.ancestry == HALFLING) { 14 + return ((ch.heritage >= HALFLING_GUTSY) && (ch.heritage <= HALFLING_WILDWOOD)) || (ch.heritage == VERS_AIUVARIN) || (ch.heritage == VERS_DROMAAR) || (ch.heritage == VERS_CHANGELING) || (ch.heritage == VERS_DRAGONBLOOD) || (ch.heritage == VERS_NEPHILIM); 15 + } else if (ch.ancestry == HUMAN) { 16 + return (ch.heritage == HUMAN_SKILLED) || (ch.heritage == HUMAN_VERSATILE) || (ch.heritage == VERS_AIUVARIN) || (ch.heritage == VERS_DROMAAR) || (ch.heritage == VERS_CHANGELING) || (ch.heritage == VERS_DRAGONBLOOD) || (ch.heritage == VERS_NEPHILIM); 17 + } else if (ch.ancestry == LESHY) { 18 + return ((ch.heritage >= LESHY_CACTUS) && (ch.heritage <= LESHY_VINE)) || (ch.heritage == VERS_AIUVARIN) || (ch.heritage == VERS_DROMAAR) || (ch.heritage == VERS_CHANGELING) || (ch.heritage == VERS_DRAGONBLOOD) || (ch.heritage == VERS_NEPHILIM); 19 + } else if (ch.ancestry == ORC) { 20 + return ((ch.heritage >= ORC_BADLANDS) && (ch.heritage <= ORC_WINTER)) || (ch.heritage == VERS_AIUVARIN) || (ch.heritage == VERS_DROMAAR) || (ch.heritage == VERS_CHANGELING) || (ch.heritage == VERS_DRAGONBLOOD) || (ch.heritage == VERS_NEPHILIM); 21 + } 22 + 23 + return false; 24 + } 25 + 26 + const Character char_fighter = { 27 + FIGHTER, 28 + HUMAN, 29 + HUMAN_VERSATILE, 30 + { 31 + MOD_POS_4, 32 + MOD_POS_2, 33 + MOD_POS_2, 34 + MOD_POS_1, 35 + MOD_ZERO, 36 + MOD_ZERO 37 + }, 38 + { 39 + true, 40 + false, 41 + true, 42 + true, 43 + true, 44 + false, 45 + true, 46 + false, 47 + false, 48 + false, 49 + false, 50 + false, 51 + false, 52 + false, 53 + true, 54 + false 55 + }, 56 + 2, 57 + { 58 + 2, 59 + 2, 60 + 1 61 + }, 62 + 25, 63 + SIZE_MEDIUM 64 + }; 65 + 66 + const Character char_rogue = { 67 + ROGUE, 68 + ELF, 69 + ELF_WHISPER, 70 + { 71 + MOD_ZERO, 72 + MOD_POS_4, 73 + MOD_POS_2, 74 + MOD_POS_1, 75 + MOD_POS_1, 76 + MOD_POS_1 77 + }, 78 + { 79 + true, 80 + false, 81 + true, 82 + true, 83 + true, 84 + true, 85 + true, 86 + false, 87 + false, 88 + false, 89 + true, 90 + true, 91 + true, 92 + true, 93 + false, 94 + true 95 + }, 96 + 2, 97 + { 98 + 1, 99 + 2, 100 + 2 101 + }, 102 + 30, 103 + SIZE_MEDIUM 104 + }; 105 + 106 + const Character char_cleric = { 107 + CLERIC, 108 + HUMAN, 109 + HUMAN_VERSATILE, 110 + { 111 + MOD_POS_2, 112 + MOD_POS_1, 113 + MOD_ZERO, 114 + MOD_ZERO, 115 + MOD_POS_4, 116 + MOD_POS_2 117 + }, 118 + { 119 + false, 120 + false, 121 + true, 122 + false, 123 + false, 124 + true, 125 + false, 126 + true, 127 + false, 128 + false, 129 + false, 130 + true, 131 + false, 132 + false, 133 + true, 134 + false 135 + }, 136 + 1, 137 + { 138 + 2, 139 + 1, 140 + 2 141 + }, 142 + 25, 143 + SIZE_MEDIUM 144 + }; 145 + 146 + const Character char_wizard = { 147 + WIZARD, 148 + HUMAN, 149 + HUMAN_VERSATILE, 150 + { 151 + MOD_ZERO, 152 + MOD_POS_2, 153 + MOD_POS_2, 154 + MOD_POS_4, 155 + MOD_POS_1, 156 + MOD_ZERO 157 + }, 158 + { 159 + false, 160 + true, 161 + false, 162 + true, 163 + true, 164 + true, 165 + false, 166 + false, 167 + true, 168 + true, 169 + false, 170 + false, 171 + true, 172 + true, 173 + false, 174 + false 175 + }, 176 + 2, 177 + { 178 + 1, 179 + 1, 180 + 2 181 + }, 182 + 25, 183 + SIZE_MEDIUM 184 + };
+133
gb/src/character.h
··· 1 + #ifndef CHARACTER_H 2 + #define CHARACTER_H 3 + 4 + #include <stdbool.h> 5 + #include <stdint.h> 6 + 7 + // : Character Creation Options 8 + // ::: Classes 9 + #define ALCHEMIST 0x00 10 + #define BARBARIAN 0x01 11 + #define BARD 0x02 12 + #define CHAMPION 0x03 13 + #define CLERIC 0x04 14 + #define DRUID 0x05 15 + #define FIGHTER 0x06 16 + #define INVESTIGATOR 0x07 17 + #define MONK 0x08 18 + #define ORACLE 0x09 19 + #define RANGER 0x0a 20 + #define ROGUE 0x0b 21 + #define SORCERER 0x0c 22 + #define SWASHBUCKLER 0x0d 23 + #define WITCH 0x0e 24 + #define WIZARD 0x0f 25 + // ::: Ancestries 26 + #define DWARF 0x00 27 + #define ELF 0x01 28 + #define GNOME 0x02 29 + #define GOBLIN 0x03 30 + #define HALFLING 0x04 31 + #define HUMAN 0x05 32 + #define LESHY 0x06 33 + #define ORC 0x07 34 + // ::: Heritages 35 + // ::::: Dwarf 36 + #define DWARF_ANCIENT_BLOOD 0x00 37 + #define DWARF_DEATH_WARDEN 0x01 38 + #define DWARF_FORGE 0x02 39 + #define DWARF_ROCK 0x03 40 + #define DWARF_STRONG_BLOODED 0x04 41 + // ::::: Elf 42 + #define ELF_ANCIENT 0x05 43 + #define ELF_ARCTIC 0x06 44 + #define ELF_CAVERN 0x07 45 + #define ELF_SEER 0x08 46 + #define ELF_WHISPER 0x09 47 + #define ELF_WOODLAND 0x0a 48 + // ::::: Gnome 49 + #define GNOME_CHAMELEON 0x0b 50 + #define GNOME_FEY_TOUCHED 0x0c 51 + #define GNOME_SENSATE 0x0d 52 + #define GNOME_UMBRAL 0x0e 53 + #define GNOME_WELLSPRING 0x0f 54 + // ::::: Goblin 55 + #define GOBLIN_CHARHIDE 0x10 56 + #define GOBLIN_IRONGUT 0x11 57 + #define GOBLIN_RAZORTOOTH 0x12 58 + #define GOBLIN_SNOW 0x13 59 + #define GOBLIN_UNBREAKABLE 0x14 60 + // ::::: Halfling 61 + #define HALFLING_GUTSY 0x15 62 + #define HALFLING_HILLOCK 0x16 63 + #define HALFLING_NOMADIC 0x17 64 + #define HALFLING_TWILIGHT 0x18 65 + #define HALFLING_WILDWOOD 0x19 66 + // ::::: Human 67 + #define HUMAN_SKILLED 0x1a 68 + #define HUMAN_VERSATILE 0x1b 69 + // ::::: Leshy 70 + #define LESHY_CACTUS 0x1c 71 + #define LESHY_FRUIT 0x1d 72 + #define LESHY_FUNGUS 0x1e 73 + #define LESHY_GOURD 0x1f 74 + #define LESHY_LEAF 0x20 75 + #define LESHY_LOTUS 0x21 76 + #define LESHY_ROOT 0x22 77 + #define LESHY_SEAWEED 0x23 78 + #define LESHY_VINE 0x24 79 + // ::::: Orc 80 + #define ORC_BADLANDS 0x25 81 + #define ORC_BATTLE_READY 0x26 82 + #define ORC_DEEP 0x27 83 + #define ORC_GRAVE 0x28 84 + #define ORC_HOLD_SCARRED 0x29 85 + #define ORC_RAINFALL 0x2a 86 + #define ORC_WINTER 0x2b 87 + // ::::: Versatile 88 + #define VERS_AIUVARIN 0x2c 89 + #define VERS_DROMAAR 0x2d 90 + #define VERS_CHANGELING 0x2e 91 + #define VERS_DRAGONBLOOD 0x2f 92 + #define VERS_NEPHILIM 0x30 93 + // Modifiers 94 + #define MOD_NEG_5 0 95 + #define MOD_NEG_4 1 96 + #define MOD_NEG_3 2 97 + #define MOD_NEG_2 3 98 + #define MOD_NEG_1 4 99 + #define MOD_ZERO 5 100 + #define MOD_POS_1 6 101 + #define MOD_POS_2 7 102 + #define MOD_POS_3 8 103 + #define MOD_POS_4 9 104 + #define MOD_POS_5 10 105 + #define MOD_POS_6 11 106 + #define MOD_POS_7 12 107 + // Size 108 + #define SIZE_TINY 0 109 + #define SIZE_SMALL 1 110 + #define SIZE_MEDIUM 2 111 + #define SIZE_LARGE 3 112 + #define SIZE_HUGE 4 113 + #define SIZE_GARGANTUAN 5 114 + 115 + typedef struct _character { 116 + uint8_t class_val; 117 + uint8_t ancestry; 118 + uint8_t heritage; 119 + uint8_t stats[6]; 120 + bool skills[16]; 121 + uint8_t perception; 122 + uint8_t saves[3]; 123 + uint8_t speed; 124 + uint8_t size; 125 + } Character; 126 + 127 + bool Character_is_valid(Character ch); 128 + extern const Character char_fighter; 129 + extern const Character char_rogue; 130 + extern const Character char_cleric; 131 + extern const Character char_wizard; 132 + 133 + #endif
+89
gb/src/cleric.c
··· 1 + #include "cleric.h" 2 + #include <stdint.h> 3 + #include <gb/metasprites.h> 4 + #include "../res/cleric_down.h" 5 + #include "../res/cleric_up.h" 6 + #include "../res/cleric_left.h" 7 + #include <stdbool.h> 8 + #include <stdlib.h> 9 + #include <gb/gb.h> 10 + 11 + #define CLERIC_SPEED 4 12 + #define FIGHTER_ROGUE_PADDED_TILE_COUNT 24 13 + 14 + uint16_t cleric_x, cleric_y; 15 + extern uint16_t rogue_x, rogue_y; 16 + extern uint8_t fighter_direction, fighter_last_direction; 17 + 18 + uint8_t flip_cleric = false; 19 + 20 + metasprite_t const *cleric_metasprite; 21 + 22 + extern uint8_t three_frame_real_value; 23 + 24 + void setup_cleric(void) { 25 + set_sprite_data(FIGHTER_ROGUE_PADDED_TILE_COUNT, cleric_up_TILE_COUNT, cleric_up_tiles); 26 + set_sprite_palette(FIGHTER_ROGUE_PADDED_TILE_COUNT, cleric_up_PALETTE_COUNT, cleric_up_palettes); 27 + cleric_x = 96 << 4; 28 + cleric_y = 120 << 4; 29 + cleric_metasprite = cleric_up_metasprites[1]; 30 + } 31 + 32 + uint8_t update_cleric(uint8_t last_sprite) { 33 + int16_t dx = (uint16_t)(rogue_x >> 4) - (uint16_t)(cleric_x >> 4); 34 + int16_t dy = (uint16_t)(rogue_y >> 4) - (uint16_t)(cleric_y >> 4); 35 + int16_t dx_abs = abs(dx); 36 + int16_t dy_abs = abs(dy); 37 + 38 + if ((dx_abs > 16) || (dy_abs > 16)) { 39 + uint8_t frame = three_frame_real_value; 40 + 41 + if (frame == 3) { 42 + frame = 1; 43 + } 44 + 45 + if (dx_abs > dy_abs) { 46 + cleric_metasprite = cleric_left_metasprites[frame]; 47 + 48 + if (dx > 0) { 49 + cleric_x += CLERIC_SPEED; 50 + flip_cleric = true; 51 + } else { 52 + cleric_x -= CLERIC_SPEED; 53 + flip_cleric = false; 54 + } 55 + } else { 56 + flip_cleric = false; 57 + 58 + if (dy > 0) { 59 + cleric_y += CLERIC_SPEED; 60 + cleric_metasprite = cleric_down_metasprites[frame]; 61 + } else { 62 + cleric_y -= CLERIC_SPEED; 63 + cleric_metasprite = cleric_up_metasprites[frame]; 64 + } 65 + } 66 + 67 + if (fighter_direction != fighter_last_direction) { 68 + switch (fighter_direction) { 69 + case J_DOWN: 70 + set_sprite_data(FIGHTER_ROGUE_PADDED_TILE_COUNT, cleric_down_TILE_COUNT, cleric_down_tiles); 71 + break; 72 + case J_RIGHT: 73 + flip_cleric = true; 74 + case J_LEFT: 75 + set_sprite_data(FIGHTER_ROGUE_PADDED_TILE_COUNT, cleric_left_TILE_COUNT, cleric_left_tiles); 76 + break; 77 + case J_UP: 78 + set_sprite_data(FIGHTER_ROGUE_PADDED_TILE_COUNT, cleric_up_TILE_COUNT, cleric_up_tiles); 79 + break; 80 + } 81 + } 82 + } 83 + 84 + if (flip_cleric) { 85 + return move_metasprite_flipx(cleric_metasprite, FIGHTER_ROGUE_PADDED_TILE_COUNT, 0, last_sprite, cleric_x >> 4, cleric_y >> 4); 86 + } else { 87 + return move_metasprite_ex(cleric_metasprite, FIGHTER_ROGUE_PADDED_TILE_COUNT, 0, last_sprite, cleric_x >> 4, cleric_y >> 4); 88 + } 89 + }
+9
gb/src/cleric.h
··· 1 + #ifndef CLERIC_H 2 + #define CLERIC_H 3 + 4 + #include <stdint.h> 5 + 6 + uint8_t update_cleric(uint8_t last_sprite); 7 + void setup_cleric(void); 8 + 9 + #endif
-441
gb/src/dungeon.asm
··· 1 - SECTION "DungeonVariables", WRAM0 2 - 3 - dungeon_grid:: ds 512 4 - entrance_id:: db 5 - current_room:: db 6 - current_width:: db 7 - current_height:: db 8 - generated_cells:: ds 512 9 - 10 - SECTION "DungeonCode", ROM0 11 - 12 - BIT_USED_ROOM:: db $01 13 - BIT_ENTRANCE:: db $02 14 - BIT_DOOR_NORTH:: db $04 15 - BIT_DOOR_EAST:: db $08 16 - BIT_DOOR_SOUTH:: db $10 17 - BIT_DOOR_WEST:: db $20 18 - BIT_STAIR_BELOW:: db $40 19 - BIT_STAIR_UP:: db $80 20 - MAX_ROOMS:: dw 512 21 - NEIGHBORS:: db %00111100 22 - 23 - ; Params: 24 - ; Starting Width: B 25 - ; Starting Height: C 26 - InitDungeon:: 27 - ld hl, current_width ; current_width = B 28 - ld [hl], b 29 - ld hl, current_height ; current_height = C 30 - ld [hl], c 31 - ret 32 - 33 - GenerateDungeon:: 34 - ; REG_B = i 35 - ; REG_C = generated_cells_number 36 - ; REG_D = dungeon_area 37 - ld hl, current_width 38 - ld e, [hl] 39 - ld d, 0 40 - ld hl, current_height 41 - ld a, [hl] 42 - call Mul8 43 - ld d, l 44 - ld c, 0 45 - ld b, 0 46 - .LoopCheck 47 - ld a, c 48 - cp a, d 49 - jp nc, .LoopEnd 50 - jp z, .LoopEnd 51 - ld a, b 52 - cp a, 0 53 - jp nz, .LoopCheck2 54 - jp z, .LoopBody 55 - .LoopCheck2 56 - cp a, c 57 - jp nc, .LoopEnd 58 - jp z, .LoopEnd 59 - .LoopBody 60 - cp a, 0 61 - jp nz, .LoopBody2 62 - ld a, c 63 - cp a, 0 64 - jp nz, .LoopBody2 65 - push bc 66 - call rand 67 - ld l, b 68 - ld h, 0 69 - ld c, d 70 - inc c 71 - call Mod8 72 - ld hl, entrance_id 73 - ld [hl], a 74 - pop bc 75 - ld hl, generated_cells+$0 76 - ld [hl], a 77 - ld hl, BIT_ENTRANCE 78 - ld a, [hl] 79 - ld hl, BIT_USED_ROOM 80 - or a, [hl] 81 - ld hl, dungeon_grid 82 - push de 83 - push hl 84 - ld hl, entrance_id 85 - ld e, [hl] 86 - ld d, 0 87 - pop hl 88 - add hl, de 89 - pop de 90 - ld [hl], a 91 - ld c, 1 92 - .LoopBody2 93 - call GenerateRoom 94 - ld hl, dungeon_grid 95 - push de 96 - push hl 97 - ld hl, generated_cells 98 - ld e, b 99 - ld d, 0 100 - add hl, de 101 - ld e, [hl] 102 - ld d, 0 103 - pop hl 104 - add hl, de 105 - pop de 106 - ld a, [hl] 107 - push hl 108 - ld hl, BIT_USED_ROOM 109 - and a, [hl] 110 - pop hl 111 - jp nz, .LoopBody3 112 - ld a, [hl] 113 - push hl 114 - ld hl, BIT_USED_ROOM 115 - or a, [hl] 116 - pop hl 117 - ld [hl], a 118 - .LoopBody3 119 - ld a, c 120 - sub a, 1 121 - ld e, a 122 - ld a, b 123 - cp a, e 124 - jp nz, .LoopBody4 125 - push bc 126 - ld l, d 127 - ld h, 0 128 - ld c, 4 129 - call Mod8 130 - pop bc 131 - push de 132 - ld e, l 133 - ld d, h 134 - ld a, 3 135 - call Mul8 136 - pop de 137 - ld a, c 138 - cp a, l 139 - jp z, .LoopBody4 140 - jp nc, .LoopBody4 141 - jp .LoopEnd 142 - .LoopBody4 143 - inc b 144 - jp .LoopCheck 145 - .LoopEnd 146 - ret 147 - 148 - GenerateRoom:: 149 - ; REG_B = cell_index_queue 150 - ; REG_C = queue_size 151 - ; REG_D = potential_doors 152 - ; REG_E = door 153 - ; REG_H = neighbor_room 154 - ; REG_L = cell_index 155 - ; generated_cells = cells_queue 156 - push de 157 - push bc 158 - call rand 159 - ld hl, NEIGHBORS 160 - ld c, [hl] 161 - inc c 162 - ld b, l 163 - ld h, 0 164 - call Mod8 165 - pop bc 166 - ld d, a 167 - ld hl, generated_cells 168 - ld a, l 169 - add a, b 170 - ld l, a 171 - push de 172 - ld e, [hl] 173 - ld l, e 174 - pop de 175 - ld e, 1 176 - .LoopCheck 177 - ld a, e 178 - push hl 179 - ld hl, NEIGHBORS 180 - cp a, [hl] 181 - pop hl 182 - jp nc, .LoopEnd 183 - jp nz, .LoopEnd 184 - ld a, e 185 - push de 186 - push hl 187 - ld hl, NEIGHBORS 188 - ld e, [hl] 189 - and a, e 190 - pop hl 191 - pop de 192 - cp a, e 193 - jp nz, .LoopContinue 194 - push de 195 - ld e, l 196 - ld hl, dungeon_grid 197 - ld a, l 198 - add a, e 199 - ld l, a 200 - ld a, [hl] 201 - pop de 202 - and a, e 203 - jp nz, .LoopContinue 204 - call GetNeighborRoomIndex 205 - ld a, h 206 - cpl 207 - cp a, 0 208 - jp nz, .LoopContinue 209 - push hl 210 - push de 211 - ld e, h 212 - ld hl, dungeon_grid 213 - ld a, l 214 - add a, e 215 - ld l, a 216 - pop de 217 - ld a, [hl] 218 - ld hl, BIT_USED_ROOM 219 - and a, [hl] 220 - pop hl 221 - jp nz, .LoopContinue 222 - push bc ; b = opposite_door, cache earlier values 223 - call GetOppositeDirectionBit 224 - ld a, e 225 - and a, d 226 - cp a, e 227 - jp nz, .LoopBody2 228 - push hl 229 - push de 230 - ld e, l 231 - ld hl, dungeon_grid 232 - ld a, l 233 - add a, e 234 - ld l, a 235 - pop de 236 - ld a, [hl] 237 - or a, e 238 - ld [hl], a 239 - push de 240 - ld e, h 241 - ld hl, dungeon_grid 242 - ld a, l 243 - add a, e 244 - ld l, a 245 - pop de 246 - ld a, [hl] 247 - or a, b 248 - ld [hl], a 249 - pop hl 250 - .LoopBody2 251 - push hl 252 - push de 253 - ld e, h 254 - ld hl, dungeon_grid 255 - ld a, l 256 - add a, e 257 - ld l, a 258 - pop de 259 - ld a, [hl] 260 - pop hl 261 - cp a, b 262 - jp nz, .LoopContinue 263 - pop bc 264 - push hl 265 - push de 266 - ld e, h 267 - ld hl, generated_cells 268 - ld a, l 269 - add a, c 270 - ld l, a 271 - ld [hl], e 272 - pop de 273 - pop hl 274 - inc c 275 - .LoopContinue 276 - rlc e 277 - jp .LoopCheck 278 - .LoopEnd 279 - pop de 280 - ret 281 - 282 - GetNeighborRoomIndex:: 283 - ; REG_L = current_room => C 284 - ; REG_E = direction => B 285 - push de 286 - push bc 287 - push hl 288 - ld b, e 289 - ld c, l 290 - ld a, b 291 - ld hl, BIT_DOOR_NORTH 292 - cp a, [hl] 293 - jp nz, .FuncBody 294 - ld a, c 295 - ld hl, current_width 296 - sub a, [hl] 297 - ld e, a 298 - jp .FuncBody5 299 - .FuncBody 300 - ld hl, BIT_DOOR_EAST 301 - cp a, [hl] 302 - jp nz, .FuncBody2 303 - ld a, c 304 - inc a 305 - ld e, a 306 - jp .FuncBody5 307 - .FuncBody2 308 - ld hl, BIT_DOOR_SOUTH 309 - cp a, [hl] 310 - jp nz, .FuncBody3 311 - ld a, c 312 - ld hl, current_width 313 - add a, [hl] 314 - ld e, a 315 - jp .FuncBody5 316 - .FuncBody3 317 - ld hl, BIT_DOOR_WEST 318 - cp a, [hl] 319 - jp nz, .FuncBody4 320 - ld a, c 321 - dec a 322 - ld e, a 323 - jp .FuncBody5 324 - .FuncBody4 325 - ld e, -1 326 - .FuncBody5 327 - ld a, b 328 - ld hl, BIT_DOOR_NORTH 329 - cp a, [hl] 330 - jp nz, .FuncBody6 331 - ld a, e 332 - cp a, 0 333 - jp c, .FuncBody6 334 - jp .FuncBody10 335 - .FuncBody6 336 - ld a, b 337 - ld hl, BIT_DOOR_SOUTH 338 - cp a, [hl] 339 - jp nz, .FuncBody7 340 - push de 341 - push bc 342 - ld c, e 343 - ld hl, current_width 344 - ld e, [hl] 345 - ld d, 0 346 - ld hl, current_height 347 - ld a, [hl] 348 - call Mul8 349 - ld d, l 350 - ld a, e 351 - pop bc 352 - cp a, d 353 - pop de 354 - jp nc, .FuncBody7 355 - jp z, .FuncBody7 356 - jp .FuncBody10 357 - .FuncBody7 358 - ld a, b 359 - ld hl, BIT_DOOR_EAST 360 - cp a, [hl] 361 - jp nz, .FuncBody8 362 - push bc 363 - ld hl, current_width 364 - ld c, [hl] 365 - ld l, e 366 - ld h, 0 367 - call Mod8 368 - pop bc 369 - cp a, 0 370 - jp c, .FuncBody8 371 - jp z, .FuncBody8 372 - jp .FuncBody10 373 - .FuncBody8 374 - ld a, b 375 - ld hl, BIT_DOOR_WEST 376 - cp a, [hl] 377 - jp nz, .FuncBody9 378 - push bc 379 - ld hl, current_width 380 - ld c, [hl] 381 - ld l, e 382 - ld h, 0 383 - call Mod8 384 - ld b, a 385 - ld hl, current_width 386 - ld a, [hl] 387 - dec a 388 - ld c, a 389 - ld a, b 390 - cp a, c 391 - pop bc 392 - jp nc, .FuncBody9 393 - jp z, .FuncBody9 394 - jp .FuncBody10 395 - .FuncBody9 396 - ld e, -1 397 - .FuncBody10 398 - pop hl 399 - ld h, e 400 - pop bc 401 - pop de 402 - ret 403 - 404 - GetOppositeDirectionBit:: 405 - push hl 406 - ld a, e 407 - push de 408 - ld hl, BIT_DOOR_NORTH 409 - ld e, [hl] 410 - cp a, e 411 - jp nz, .FuncBody 412 - ld hl, BIT_DOOR_SOUTH 413 - ld b, [hl] 414 - jp .FuncEnd 415 - .FuncBody 416 - ld hl, BIT_DOOR_WEST 417 - ld e, [hl] 418 - cp a, e 419 - jp nz, .FuncBody2 420 - ld hl, BIT_DOOR_EAST 421 - ld b, [hl] 422 - jp .FuncEnd 423 - .FuncBody2 424 - ld hl, BIT_DOOR_SOUTH 425 - ld e, [hl] 426 - cp a, e 427 - jp nz, .FuncBody3 428 - ld hl, BIT_DOOR_NORTH 429 - ld b, [hl] 430 - jp .FuncEnd 431 - .FuncBody3 432 - ld hl, BIT_DOOR_EAST 433 - ld e, [hl] 434 - cp a, e 435 - jp nz, .FuncEnd 436 - ld hl, BIT_DOOR_WEST 437 - ld b, [hl] 438 - .FuncEnd 439 - pop de 440 - pop hl 441 - ret
+144
gb/src/dungeon.c
··· 1 + #include "dungeon.h" 2 + #include <stdint.h> 3 + #include <stdbool.h> 4 + #include <stdlib.h> 5 + #include <rand.h> 6 + #include "utils.h" 7 + 8 + bool room_has_door(Dungeon* dungeon, int room, int direction); 9 + int get_neighbor_room_index(Dungeon* dungeon, int current_room, int direction); 10 + int get_opposite_direction_bit(int direction); 11 + void generate_room(Dungeon* d, unsigned int cell_index_queue, int* cells_queue, unsigned int* queue_size); 12 + int neighbors = BIT_DOOR_NORTH | BIT_DOOR_EAST | BIT_DOOR_SOUTH | BIT_DOOR_WEST; 13 + 14 + void init_dungeon(Dungeon* d, const int width, const int height) { 15 + d->width = width; 16 + d->height = height; 17 + d->grid = (uint8_t*)calloc(width * height, sizeof(uint8_t)); 18 + } 19 + 20 + void generate_dungeon(Dungeon* d) { 21 + unsigned int i, entrance, generated_cells_number; 22 + 23 + int dungeon_area = d->width * d->height; 24 + int* generated_cells = (int*)calloc(dungeon_area, sizeof(int)); 25 + generated_cells_number = 0; 26 + 27 + for (i = 0; (generated_cells_number < dungeon_area) && ((i == 0) || (i < generated_cells_number)); i++) { 28 + if ((i == 0) && (generated_cells_number == 0)) { 29 + entrance = rand_range(0, dungeon_area); 30 + generated_cells[0] = entrance; 31 + d->grid[entrance] = BIT_ENTRANCE | BIT_USED_ROOM; 32 + d->entrance = entrance; 33 + generated_cells_number = 1; 34 + } 35 + 36 + generate_room(d, i, generated_cells, &generated_cells_number); 37 + 38 + if (!(d->grid[generated_cells[i]] & BIT_USED_ROOM)) { 39 + d->grid[generated_cells[i]] |= BIT_USED_ROOM; 40 + } 41 + 42 + if ((i == (generated_cells_number - 1)) && (generated_cells_number < (dungeon_area / 4 * 3))) { 43 + break; 44 + } 45 + } 46 + 47 + free(generated_cells); 48 + } 49 + 50 + void generate_room(Dungeon* d, unsigned int cell_index_queue, int* cells_queue, unsigned int* queue_size) { 51 + int potential_doors = 0; 52 + potential_doors = rand_range(0, neighbors); 53 + unsigned int cell_index = cells_queue[cell_index_queue]; 54 + 55 + int door, opposite_door; 56 + 57 + for (door = 1; door <= neighbors; door <<= 1) { 58 + if (((door & neighbors) != door) || (d->grid[cell_index] & door)) { 59 + continue; 60 + } 61 + 62 + int neighbor_room = get_neighbor_room_index(d, cell_index, door); 63 + 64 + if ((!~neighbor_room) || (d->grid[neighbor_room] & BIT_USED_ROOM)) { 65 + continue; 66 + } 67 + 68 + opposite_door = get_opposite_direction_bit(door); 69 + 70 + if ((door & potential_doors) == door) { 71 + d->grid[cell_index] |= door; 72 + d->grid[neighbor_room] |= opposite_door; 73 + } 74 + 75 + if (d->grid[neighbor_room] == opposite_door) { 76 + cells_queue[*queue_size] = neighbor_room; 77 + (*queue_size) += 1; 78 + } 79 + } 80 + } 81 + 82 + bool room_has_door(Dungeon* dungeon, int room, int direction) { 83 + int needed_bit = direction; 84 + return (dungeon->grid[room] & needed_bit) == needed_bit; 85 + } 86 + 87 + int get_opposite_direction_bit(int direction) { 88 + int opposite_direction = -1; 89 + 90 + switch (direction) { 91 + case BIT_DOOR_NORTH: 92 + opposite_direction = BIT_DOOR_SOUTH; 93 + break; 94 + case BIT_DOOR_WEST: 95 + opposite_direction = BIT_DOOR_EAST; 96 + break; 97 + case BIT_DOOR_SOUTH: 98 + opposite_direction = BIT_DOOR_NORTH; 99 + break; 100 + case BIT_DOOR_EAST: 101 + opposite_direction = BIT_DOOR_WEST; 102 + break; 103 + } 104 + 105 + return opposite_direction; 106 + } 107 + 108 + int get_neighbor_room_index(Dungeon* dungeon, int current_room, int direction) { 109 + int neighbor_room, width, height; 110 + width = dungeon->width; 111 + height = dungeon->height; 112 + 113 + switch (direction) { 114 + case BIT_DOOR_NORTH: 115 + neighbor_room = current_room - width; 116 + break; 117 + case BIT_DOOR_EAST: 118 + neighbor_room = current_room + 1; 119 + break; 120 + case BIT_DOOR_SOUTH: 121 + neighbor_room = current_room + width; 122 + break; 123 + case BIT_DOOR_WEST: 124 + neighbor_room = current_room - 1; 125 + break; 126 + default: 127 + neighbor_room = -1; 128 + } 129 + 130 + if ( 131 + ((direction == BIT_DOOR_NORTH) && (neighbor_room >= 0)) 132 + || ((direction == BIT_DOOR_SOUTH) && (neighbor_room < (width * height))) 133 + || ((direction == BIT_DOOR_EAST) && ((neighbor_room % width) > 0)) 134 + || ((direction == BIT_DOOR_WEST) && ((neighbor_room % width) < (width - 1))) 135 + ) { 136 + return neighbor_room; 137 + } 138 + 139 + return -1; 140 + } 141 + 142 + void free_dungeon(Dungeon* d) { 143 + free(d->grid); 144 + }
+35
gb/src/dungeon.h
··· 1 + #ifndef DUNGEON_H 2 + #define DUNGEON_H 3 + 4 + #include <stdint.h> 5 + 6 + #define BIT_USED_ROOM 0x01 7 + #define BIT_ENTRANCE 0x02 8 + #define BIT_DOOR_NORTH 0x04 9 + #define BIT_DOOR_EAST 0x08 10 + #define BIT_DOOR_SOUTH 0x10 11 + #define BIT_DOOR_WEST 0x20 12 + #define BIT_STAIR_BELOW 0x40 13 + #define BIT_STAIR_UP 0x80 14 + 15 + #define IS_USED(room) ((room & BIT_USED_ROOM) == BIT_USED_ROOM) 16 + #define IS_ENTRANCE(room) ((room & BIT_ENTRANCE) == BIT_ENTRANCE) 17 + #define HAS_NORTH_DOOR(room) ((room & BIT_DOOR_NORTH) == BIT_DOOR_NORTH) 18 + #define HAS_EAST_DOOR(room) ((room & BIT_DOOR_EAST) == BIT_DOOR_EAST) 19 + #define HAS_WEST_DOOR(room) ((room & BIT_DOOR_WEST) == BIT_DOOR_WEST) 20 + #define HAS_SOUTH_DOOR(room) ((room & BIT_DOOR_SOUTH) == BIT_DOOR_SOUTH) 21 + #define HAS_STAIR_DOWN(room) ((room & BIT_STAIR_BELOW) == BIT_STAIR_BELOW) 22 + #define HAS_STAIR_UP(room) ((room & BIT_STAIR_UP) == BIT_STAIR_UP) 23 + 24 + typedef struct _dungeon { 25 + uint8_t* grid; 26 + int entrance; 27 + int width; 28 + int height; 29 + } Dungeon; 30 + 31 + void init_dungeon(Dungeon* d, const int width, const int height); 32 + void generate_dungeon(Dungeon* d); 33 + void free_dungeon(Dungeon* d); 34 + 35 + #endif
+47
gb/src/encounter.c
··· 1 + #include "encounter.h" 2 + #include "monster.h" 3 + #include <gb/gb.h> 4 + #include "utils.h" 5 + #include <stdlib.h> 6 + #include "monsters.h" 7 + #include <stdint.h> 8 + #include <stdbool.h> 9 + #include "../res/goblin_down.h" 10 + #include <gb/emu_debug.h> 11 + 12 + Monster* generate_encounter(UBYTE difficulty, uint8_t* monster_num_ref) { 13 + uint8_t monster_num = 0; 14 + 15 + switch (difficulty) { 16 + case DIFFICULTY_TRIVIAL: 17 + monster_num = 2; 18 + break; 19 + case DIFFICULTY_LOW: 20 + monster_num = 3; 21 + break; 22 + case DIFFICULTY_MODERATE: 23 + monster_num = rand_range(4, 5); 24 + break; 25 + case DIFFICULTY_SEVERE: 26 + monster_num = rand_range(6, 7); 27 + break; 28 + case DIFFICULTY_EXTREME: 29 + monster_num = rand_range(8, 9); 30 + break; 31 + } 32 + 33 + EMU_printf("Monster num: %d\n", monster_num); 34 + 35 + Monster* monsters = (Monster*)calloc(monster_num, sizeof(Monster)); 36 + 37 + for (int i = 0; i < monster_num; i++) { 38 + monsters[i].data = &goblin; 39 + monsters[i].flip_sprite = false; 40 + monsters[i].location[0] = 0; 41 + monsters[i].location[1] = 0; 42 + monsters[i].metasprite = goblin_down_metasprites[1]; 43 + } 44 + 45 + *monster_num_ref = monster_num; 46 + return monsters; 47 + }
+18
gb/src/encounter.h
··· 1 + #ifndef ENCOUNTER_H 2 + #define ENCOUNTER_H 3 + 4 + #include "monster.h" 5 + #include <gb/gb.h> 6 + #include <stdint.h> 7 + 8 + // Difficulty 9 + #define DIFFICULTY_TRIVIAL 0 10 + #define DIFFICULTY_LOW 1 11 + #define DIFFICULTY_MODERATE 2 12 + #define DIFFICULTY_SEVERE 3 13 + #define DIFFICULTY_EXTREME 4 14 + #define DIFFICULTY_NONE 5 15 + 16 + Monster* generate_encounter(UBYTE difficulty, uint8_t* monster_num_ref); 17 + 18 + #endif
+125
gb/src/fighter.c
··· 1 + #include "fighter.h" 2 + #include <stdint.h> 3 + #include <stdbool.h> 4 + #include "../res/fighter_down.h" 5 + #include "../res/fighter_up.h" 6 + #include "../res/fighter_left.h" 7 + #include <gb/gb.h> 8 + #include <stdio.h> 9 + 10 + #define FIGHTER_SPEED 4 11 + 12 + uint8_t fighter_direction = 0, fighter_last_direction = 0; 13 + uint16_t fighter_x, fighter_y; 14 + 15 + uint8_t flip_fighter = false; 16 + 17 + metasprite_t const *fighter_metasprite; 18 + 19 + extern uint8_t joypad_current, joypad_last, three_frame_real_value; 20 + 21 + void setup_fighter(void) { 22 + // set the down tiles in 23 + set_sprite_data(0, fighter_up_TILE_COUNT, fighter_up_tiles); 24 + // Set our color palettes into vram 25 + set_sprite_palette(0, fighter_up_PALETTE_COUNT, fighter_up_palettes); 26 + // Position near the top middle 27 + // Scale the position, since we are using scaled integers 28 + fighter_x = 64 << 4; 29 + fighter_y = 120 << 4; 30 + // Start by facing down 31 + fighter_direction = J_UP; 32 + // Start with the down metasprite 33 + fighter_metasprite = fighter_up_metasprites[1]; 34 + } 35 + 36 + uint8_t update_fighter(void) { 37 + // Save our last direction 38 + // So we can keep track of directional changes 39 + fighter_last_direction = fighter_direction; 40 + uint8_t fighter_moving = false; 41 + fighter_direction = fighter_direction; 42 + 43 + // check if the right joypad button is pressed 44 + if (joypad_current & J_RIGHT) { 45 + fighter_x += FIGHTER_SPEED; 46 + fighter_direction = J_RIGHT; 47 + fighter_moving = true; 48 + } 49 + 50 + // check if the left joypad button is pressed 51 + if (joypad_current & J_LEFT) { 52 + fighter_x -= FIGHTER_SPEED; 53 + fighter_direction = J_LEFT; 54 + fighter_moving = true; 55 + } 56 + 57 + // check if the down joypad button is pressed 58 + if (joypad_current & J_DOWN) { 59 + fighter_y += FIGHTER_SPEED; 60 + fighter_direction = J_DOWN; 61 + fighter_moving = true; 62 + } 63 + 64 + // check if the up joypad button is pressed 65 + if (joypad_current & J_UP) { 66 + fighter_y -= FIGHTER_SPEED; 67 + fighter_direction = J_UP; 68 + fighter_moving = true; 69 + } 70 + 71 + // If the character is moving 72 + if (fighter_moving) { 73 + // If we changed direction 74 + if (fighter_direction != fighter_last_direction) { 75 + switch (fighter_direction) { 76 + case J_DOWN: 77 + set_sprite_data(0, fighter_down_TILE_COUNT, fighter_down_tiles); 78 + break; 79 + case J_RIGHT: 80 + case J_LEFT: 81 + set_sprite_data(0, fighter_left_TILE_COUNT, fighter_left_tiles); 82 + break; 83 + case J_UP: 84 + set_sprite_data(0, fighter_up_TILE_COUNT, fighter_up_tiles); 85 + break; 86 + } 87 + } 88 + 89 + uint8_t frame = three_frame_real_value; 90 + 91 + if (frame == 3) { 92 + frame = 1; 93 + } 94 + 95 + // Change the metasprite the character uses 96 + // We don't have "right" metasprites, so we'll use the left metasprites and flip 97 + switch (fighter_direction) { 98 + case J_DOWN: 99 + fighter_metasprite = fighter_down_metasprites[frame]; 100 + flip_fighter = false; 101 + break; 102 + case J_RIGHT: 103 + fighter_metasprite = fighter_left_metasprites[frame]; 104 + flip_fighter = true; 105 + break; 106 + case J_LEFT: 107 + fighter_metasprite = fighter_left_metasprites[frame]; 108 + flip_fighter = false; 109 + break; 110 + case J_UP: 111 + fighter_metasprite = fighter_up_metasprites[frame]; 112 + flip_fighter = false; 113 + break; 114 + } 115 + } 116 + 117 + // flip along the vertical access if necessary 118 + // Draw the character at the non-scaled position 119 + // Return how many sprites were used 120 + if (flip_fighter) { 121 + return move_metasprite_flipx(fighter_metasprite, 0, 0, 0, fighter_x >> 4, fighter_y >> 4); 122 + } else { 123 + return move_metasprite_ex(fighter_metasprite, 0, 0, 0, fighter_x >> 4, fighter_y >> 4); 124 + } 125 + }
+9
gb/src/fighter.h
··· 1 + #ifndef FIGHTER_H 2 + #define FIGHTER_H 3 + 4 + #include <stdint.h> 5 + 6 + uint8_t update_fighter(void); 7 + void setup_fighter(void); 8 + 9 + #endif
+47
gb/src/goblin.c
··· 1 + #include "goblin.h" 2 + #include <stdint.h> 3 + #include <gb/gb.h> 4 + #include "../res/goblin_down.h" 5 + #include "../res/goblin_up.h" 6 + #include "../res/goblin_left.h" 7 + #include <stdbool.h> 8 + #include "monster.h" 9 + #include <gb/emu_debug.h> 10 + 11 + #define PLAYER_TILE_OFFSET 48 12 + 13 + void setup_goblin(Monster* goblin) { 14 + goblin->metasprite = goblin_down_metasprites[1]; 15 + goblin->direction = J_DOWN; 16 + } 17 + 18 + uint8_t update_goblin(uint8_t last_sprite, Monster* goblin) { 19 + //EMU_printf("Location X: %d (%d), Y: %d (%d)\n", goblin->location[0], goblin->location[0] >> 4, goblin->location[1], goblin->location[1] >> 4); 20 + 21 + uint8_t offset = 0; 22 + 23 + switch (goblin->direction) { 24 + case J_DOWN: 25 + offset = 0; 26 + goblin->flip_sprite = false; 27 + break; 28 + case J_RIGHT: 29 + offset = 24; 30 + goblin->flip_sprite = true; 31 + break; 32 + case J_LEFT: 33 + offset = 24; 34 + goblin->flip_sprite = false; 35 + break; 36 + case J_UP: 37 + offset = 12; 38 + goblin->flip_sprite = false; 39 + break; 40 + } 41 + 42 + if (goblin->flip_sprite) { 43 + return move_metasprite_flipx(goblin->metasprite, PLAYER_TILE_OFFSET, 0, last_sprite, goblin->location[0] >> 4, goblin->location[1] >> 4); 44 + } else { 45 + return move_metasprite_ex(goblin->metasprite, PLAYER_TILE_OFFSET, 0, last_sprite, goblin->location[0] >> 4, goblin->location[1] >> 4); 46 + } 47 + }
+10
gb/src/goblin.h
··· 1 + #ifndef GOBLIN_H 2 + #define GOBLIN_H 3 + 4 + #include <stdint.h> 5 + #include "monster.h" 6 + 7 + void setup_goblin(Monster* goblin); 8 + uint8_t update_goblin(uint8_t last_sprite, Monster* goblin); 9 + 10 + #endif
-36
gb/src/main.asm
··· 1 - INCLUDE "hardware.inc/hardware.inc" 2 - rev_Check_hardware_inc 4.0 3 - 4 - SECTION "Header", ROM0[$100] 5 - 6 - ; This is your ROM's entry point 7 - ; You have 4 bytes of code to do... something 8 - di 9 - jp EntryPoint 10 - 11 - ; Make sure to allocate some space for the header, so no important 12 - ; code gets put there and later overwritten by RGBFIX. 13 - ; RGBFIX is designed to operate over a zero-filled header, so make 14 - ; sure to put zeros regarless of the padding value. (This feature 15 - ; was introduced in RGBDS 0.4.0, but the -MG etc flags were also 16 - ; introduced in that version.) 17 - ds $150 - @, 0 18 - 19 - SECTION "Entry point", ROM0 20 - 21 - EntryPoint: 22 - ; Seed random number generator 23 - ld b, 0 24 - ld c, 10 25 - call srand 26 - 27 - ; Initialize Dungeon 28 - ; ld b, 6 29 - ; ld c, 6 30 - ; call InitDungeon 31 - ; NOTE: Dungeon generation is not verified to work 32 - 33 - jp Done 34 - 35 - Done: 36 - jp Done
+310
gb/src/main.c
··· 1 + #include <gb/gb.h> 2 + #include <stdbool.h> 3 + #include "../res/room.h" 4 + #include "dungeon.h" 5 + #include <stdio.h> 6 + #include <stdint.h> 7 + #include <rand.h> 8 + #include "fighter.h" 9 + #include <gb/metasprites.h> 10 + #include "rogue.h" 11 + #include "cleric.h" 12 + #include "wizard.h" 13 + #include "utils.h" 14 + #include "../res/dungeon.h" 15 + #include <gbdk/emu_debug.h> 16 + #include "encounter.h" 17 + #include "goblin.h" 18 + #include "monster.h" 19 + #include <stdlib.h> 20 + #include "../res/goblin_down.h" 21 + #include "../res/goblin_up.h" 22 + #include "../res/goblin_left.h" 23 + #include "character.h" 24 + #include <gbdk/font.h> 25 + #include "../res/window_tiles.h" 26 + #include "../res/window.h" 27 + 28 + void set_door(int direction) { 29 + switch (direction) { 30 + case BIT_DOOR_NORTH: 31 + set_bkg_tiles(door_tiles_x, door_tiles_y, door_tiles_w, door_tiles_h, door_tiles); 32 + break; 33 + case BIT_DOOR_SOUTH: 34 + set_bkg_tiles(door_tiles_x, 17, 2, 1, other_door); 35 + break; 36 + case BIT_DOOR_WEST: 37 + set_bkg_tiles(0, 10, 1, 2, other_door); 38 + break; 39 + case BIT_DOOR_EAST: 40 + set_bkg_tiles(19, 10, 1, 2, other_door); 41 + break; 42 + case BIT_STAIR_BELOW: 43 + set_bkg_tiles(stair_down_x, stair_down_y, stair_down_w, stair_down_h, stair_down_tiles); 44 + break; 45 + case BIT_STAIR_UP: 46 + set_bkg_tiles(stair_up_x, stair_up_y, stair_up_w, stair_up_h, stair_up_tiles); 47 + break; 48 + } 49 + } 50 + 51 + uint8_t joypad_current = 0; 52 + uint8_t joypad_last = 0; 53 + bool run = true; 54 + uint8_t three_frame_counter = 0; 55 + uint8_t three_frame_real_value = 0; 56 + bool encounter_mode = true; 57 + uint8_t monster_num = 0; 58 + uint8_t encounter_order[] = { 59 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 60 + // 0: null 61 + // 1: fighter 62 + // 2: rogue 63 + // 3: cleric 64 + // 4: wizard 65 + // 5+: goblins in same order as `current_monsters` 66 + }; 67 + uint16_t initiative[] = { 68 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 69 + }; 70 + uint8_t map_offset = 32; 71 + 72 + #define PLAYER_TILE_OFFSET 48 73 + 74 + void update_frame_counter(void) { 75 + three_frame_counter += 2; 76 + three_frame_real_value = three_frame_counter >> 4; 77 + 78 + // Stop & reset if the value is over 4 79 + if (three_frame_real_value >= 4) { 80 + three_frame_real_value = 0; 81 + three_frame_counter = 0; 82 + } 83 + } 84 + 85 + int comp_init(const void* a, const void* b) { 86 + uint8_t index_a = *(const uint8_t*)a; 87 + uint8_t index_b = *(const uint8_t*)b; 88 + 89 + if (initiative[index_a] < initiative[index_b]) return 1; 90 + if (initiative[index_a] > initiative[index_b]) return -1; 91 + return 0; 92 + } 93 + 94 + void roll_initiative(void) { 95 + uint8_t prof = char_fighter.perception; 96 + int bonus; 97 + 98 + if (prof == 0) { 99 + bonus = (int)char_fighter.stats[4] - 5; 100 + } else { 101 + bonus = (int)char_fighter.stats[4] - 4 + (prof << 1); 102 + } 103 + 104 + RollResult result; 105 + result = roll(1, 20, bonus); 106 + initiative[0] = (uint16_t)result.result; 107 + prof = char_rogue.perception; 108 + 109 + if (prof == 0) { 110 + bonus = (int)char_rogue.stats[4] - 5; 111 + } else { 112 + bonus = (int)char_rogue.stats[4] - 4 + (prof << 1); 113 + } 114 + 115 + result = roll(1, 20, bonus); 116 + initiative[1] = (uint16_t)result.result; 117 + prof = char_cleric.perception; 118 + 119 + if (prof == 0) { 120 + bonus = (int)char_cleric.stats[4] - 5; 121 + } else { 122 + bonus = (int)char_cleric.stats[4] - 4 + (prof << 1); 123 + } 124 + 125 + result = roll(1, 20, bonus); 126 + initiative[2] = (uint16_t)result.result; 127 + prof = char_wizard.perception; 128 + 129 + if (prof == 0) { 130 + bonus = (int)char_wizard.stats[4] - 5; 131 + } else { 132 + bonus = (int)char_wizard.stats[4] - 4 + (prof << 1); 133 + } 134 + 135 + result = roll(1, 20, bonus); 136 + initiative[3] = (uint16_t)result.result; 137 + 138 + for (uint8_t i = 0; i < monster_num; i++) { 139 + result = roll(1, 20, 2); 140 + initiative[4 + i] = (uint16_t)result.result; 141 + } 142 + 143 + for (uint8_t i = 0; i < monster_num + 4; i++) { 144 + encounter_order[i] = i + 1; 145 + } 146 + 147 + qsort(encounter_order, (size_t)(monster_num + 4), sizeof(uint8_t), comp_init); 148 + } 149 + 150 + void update_main(Monster* current_monsters) { 151 + joypad_current = joypad(); 152 + 153 + update_frame_counter(); 154 + uint8_t last_sprite = 0; 155 + last_sprite += update_fighter(); 156 + last_sprite += update_rogue(last_sprite); 157 + last_sprite += update_cleric(last_sprite); 158 + last_sprite += update_wizard(last_sprite); 159 + 160 + for (uint8_t i = 0; i < monster_num; i++) { 161 + last_sprite += update_goblin(last_sprite, &current_monsters[i]); 162 + } 163 + 164 + for (uint8_t sprite = 0; sprite < last_sprite; sprite++) { 165 + scroll_sprite(sprite, 0, -map_offset); 166 + } 167 + 168 + hide_sprites_range(last_sprite, MAX_HARDWARE_SPRITES); 169 + 170 + if (joypad_current & J_SELECT) { 171 + run = false; 172 + } 173 + 174 + joypad_last = joypad_current; 175 + } 176 + 177 + void print_room_data(uint8_t room) { 178 + EMU_printf("Room data:\n"); 179 + 180 + if (IS_USED(room)) { 181 + EMU_printf("used, "); 182 + } 183 + 184 + if (IS_ENTRANCE(room)) { 185 + EMU_printf("entrance, "); 186 + } 187 + 188 + if (HAS_NORTH_DOOR(room)) { 189 + EMU_printf("north, "); 190 + } 191 + 192 + if (HAS_EAST_DOOR(room)) { 193 + EMU_printf("east, "); 194 + } 195 + 196 + if (HAS_WEST_DOOR(room)) { 197 + EMU_printf("west, "); 198 + } 199 + 200 + if (HAS_SOUTH_DOOR(room)) { 201 + EMU_printf("south, "); 202 + } 203 + 204 + if (HAS_STAIR_DOWN(room)) { 205 + EMU_printf("stair down, "); 206 + } 207 + 208 + if (HAS_STAIR_UP(room)) { 209 + EMU_printf("stair up, "); 210 + } 211 + 212 + EMU_printf("\n"); 213 + } 214 + 215 + void main(void) { 216 + font_t min_font; 217 + font_init(); 218 + min_font = font_load(font_min); // 36 tiles 219 + font_set(min_font); 220 + 221 + SHOW_BKG; 222 + DISPLAY_ON; 223 + SHOW_SPRITES; 224 + 225 + UWORD seed; 226 + 227 + printf("Push any key (1)\n"); 228 + waitpad(0xff); 229 + waitpadup(); 230 + seed = DIV_REG; 231 + printf("Push any key (2)\n"); 232 + waitpad(0xff); 233 + waitpadup(); 234 + seed |= (UWORD)DIV_REG << 8; 235 + initarand(seed); 236 + 237 + set_bkg_data(37, 57, dungeon_tiles); 238 + set_bkg_tiles(0, 0, ROOM_TILE_WIDTH, ROOM_TILE_HEIGHT, room_tilemap); 239 + 240 + set_win_data(0x5e, 9, window_tiles); 241 + set_win_tiles(0, 0, 20, 4, window_tilemap); 242 + move_win(7, 112); 243 + 244 + SHOW_WIN; 245 + 246 + Dungeon dungeon; 247 + init_dungeon(&dungeon, 6, 6); 248 + generate_dungeon(&dungeon); 249 + uint8_t room = dungeon.grid[dungeon.entrance]; 250 + print_room_data(room); 251 + 252 + if (HAS_NORTH_DOOR(room)) { 253 + set_door(BIT_DOOR_NORTH); 254 + } 255 + 256 + if (HAS_WEST_DOOR(room)) { 257 + set_door(BIT_DOOR_WEST); 258 + } 259 + 260 + if (HAS_EAST_DOOR(room)) { 261 + set_door(BIT_DOOR_EAST); 262 + } 263 + 264 + if (HAS_SOUTH_DOOR(room)) { 265 + set_door(BIT_DOOR_SOUTH); 266 + } 267 + 268 + if (HAS_STAIR_DOWN(room)) { 269 + set_door(BIT_STAIR_BELOW); 270 + } 271 + 272 + if (HAS_STAIR_UP(room)) { 273 + set_door(BIT_STAIR_UP); 274 + } 275 + 276 + setup_fighter(); 277 + setup_rogue(); 278 + setup_cleric(); 279 + setup_wizard(); 280 + Monster* current_monsters = generate_encounter(rand_range(DIFFICULTY_TRIVIAL, DIFFICULTY_NONE), &monster_num); 281 + monster_num = monster_num; 282 + set_sprite_data(PLAYER_TILE_OFFSET, goblin_down_TILE_COUNT, goblin_down_tiles); 283 + set_sprite_palette(PLAYER_TILE_OFFSET, goblin_down_PALETTE_COUNT, goblin_down_palettes); 284 + set_sprite_data(PLAYER_TILE_OFFSET + 12, goblin_up_TILE_COUNT, goblin_up_tiles); 285 + set_sprite_palette(PLAYER_TILE_OFFSET + 12, goblin_up_PALETTE_COUNT, goblin_up_palettes); 286 + set_sprite_data(PLAYER_TILE_OFFSET + 24, goblin_left_TILE_COUNT, goblin_left_tiles); 287 + set_sprite_palette(PLAYER_TILE_OFFSET + 24, goblin_left_PALETTE_COUNT, goblin_left_palettes); 288 + 289 + for (uint8_t i = 0; i < monster_num; i++) { 290 + setup_goblin(&current_monsters[i]); 291 + current_monsters[i].location[0] = (64 + (16 * i)) << 4; 292 + current_monsters[i].location[1] = 64 << 4; 293 + } 294 + 295 + roll_initiative(); 296 + scroll_bkg(0, map_offset); 297 + 298 + while (run) { 299 + update_main(current_monsters); 300 + vsync(); 301 + } 302 + 303 + HIDE_BKG; 304 + HIDE_WIN; 305 + HIDE_SPRITES; 306 + DISPLAY_OFF; 307 + free_dungeon(&dungeon); 308 + free(current_monsters); 309 + EMU_printf("Game closed.\n"); 310 + }
+10
gb/src/metasprite.c
··· 1 + #include "metasprite.h" 2 + #include <gb/metasprites.h> 3 + 4 + const metasprite_t metasprite[] = { 5 + {.dy=-8, .dx=-8, .dtile=0, .props=0}, 6 + {.dy=0, .dx=8, .dtile=2, .props=0}, 7 + {.dy=8, .dx=-8, .dtile=1, .props=0}, 8 + {.dy=0, .dx=8, .dtile=3, .props=0}, 9 + METASPR_TERM 10 + };
+8
gb/src/metasprite.h
··· 1 + #ifndef METASPRITE_H 2 + #define METASPRITE_H 3 + 4 + #include <gb/metasprites.h> 5 + 6 + extern const metasprite_t metasprite[]; 7 + 8 + #endif
+69
gb/src/monster.h
··· 1 + #ifndef MONSTER_H 2 + #define MONSTER_H 3 + 4 + #include <stdint.h> 5 + #include <stdbool.h> 6 + #include <gb/metasprites.h> 7 + 8 + // Size 9 + #define SIZE_TINY 0 10 + #define SIZE_SMALL 1 11 + #define SIZE_MEDIUM 2 12 + #define SIZE_LARGE 3 13 + #define SIZE_HUGE 4 14 + #define SIZE_GARGANTUAN 5 15 + // Type 16 + #define MTYPE_HUMANOID 0 17 + // Subtype 18 + #define MSTYPE_GOBLIN 0 19 + // Modifiers 20 + #define MOD_NEG_5 0 21 + #define MOD_NEG_4 1 22 + #define MOD_NEG_3 2 23 + #define MOD_NEG_2 3 24 + #define MOD_NEG_1 4 25 + #define MOD_ZERO 5 26 + #define MOD_POS_1 6 27 + #define MOD_POS_2 7 28 + #define MOD_POS_3 8 29 + #define MOD_POS_4 9 30 + #define MOD_POS_5 10 31 + #define MOD_POS_6 11 32 + #define MOD_POS_7 12 33 + // Levels 34 + #define LEVEL_NEG_1 0 35 + #define LEVEL_ZERO 1 36 + #define LEVEL_POS(val) (val + 1) 37 + 38 + typedef struct _monster_data { 39 + // 0: Size (unsigned) 40 + // 1: Type (unsigned) 41 + // 2: Subtype (unsigned) 42 + // 3: Perception Mod (signed) 43 + // 4: Strength Mod (signed) 44 + // 5: Dexterity Mod (signed) 45 + // 6: Constitution Mod (signed) 46 + // 7: Intelligence Mod (signed) 47 + // 8: Wisdom Mod (signed) 48 + // 9: Charisma Mod (signed) 49 + // 10: AC (unsigned) 50 + // 11: Fortitude Save (signed) 51 + // 12: Reflex Save (signed) 52 + // 13: Will Save (signed) 53 + // 14: Max HP (unsigned) 54 + // 15: Walking Speed (unsigned) 55 + // 16: Level (unsigned) 56 + uint8_t stats[17]; 57 + uint8_t current_hp; 58 + const char* name; 59 + } MonsterData; 60 + 61 + typedef struct _monster { 62 + MonsterData const *data; 63 + bool flip_sprite; 64 + uint16_t location[2]; 65 + metasprite_t const *metasprite; 66 + uint8_t direction; 67 + } Monster; 68 + 69 + #endif
+33
gb/src/monsters.c
··· 1 + #include "monsters.h" 2 + #include "monster.h" 3 + #include <stdbool.h> 4 + #include <stdlib.h> 5 + 6 + const MonsterData goblin = { 7 + { // Begin Stats 8 + SIZE_SMALL, // Size 9 + MTYPE_HUMANOID, // Type 10 + MSTYPE_GOBLIN, // Subtype 11 + MOD_POS_2, // Perception mod 12 + MOD_ZERO, // Strength mod 13 + MOD_POS_3, // Dexterity mod 14 + MOD_POS_1, // Constitution mod 15 + MOD_ZERO, // Intelligence mod 16 + MOD_NEG_1, // Wisdom mod 17 + MOD_POS_1, // Charisma mod 18 + 16, // AC 19 + MOD_POS_5, // Fortitude save 20 + MOD_POS_7, // Reflex save 21 + MOD_POS_3, // Will save 22 + 6, // Max HP 23 + 25, // Walking speed 24 + LEVEL_NEG_1 // Level 25 + }, // End Stats 26 + 6, // Current HP 27 + "Goblin Warrior", // Name 28 + false, // Flip Sprite 29 + { 30 + 0, 0 // Location (x, y) 31 + }, 32 + NULL // Metasprite (set during setup) 33 + };
+8
gb/src/monsters.h
··· 1 + #ifndef MONSTERS_H 2 + #define MONSTERS_H 3 + 4 + #include "monster.h" 5 + 6 + extern const MonsterData goblin; 7 + 8 + #endif
+96
gb/src/rogue.c
··· 1 + #include "rogue.h" 2 + #include <stdint.h> 3 + #include <stdbool.h> 4 + #include "../res/rogue_down.h" 5 + #include "../res/rogue_up.h" 6 + #include "../res/rogue_left.h" 7 + #include <gb/gb.h> 8 + #include <stdlib.h> 9 + #include <gb/emu_debug.h> 10 + 11 + #define ROGUE_SPEED 4 12 + #define FIGHTER_PADDED_TILE_COUNT 12 13 + 14 + uint16_t rogue_x, rogue_y; 15 + extern uint16_t fighter_x, fighter_y; 16 + extern uint8_t fighter_direction, fighter_last_direction; 17 + 18 + uint8_t flip_rogue = false; 19 + 20 + metasprite_t const *rogue_metasprite; 21 + 22 + extern uint8_t three_frame_real_value; 23 + 24 + void setup_rogue(void) { 25 + // set the down tiles in 26 + set_sprite_data(FIGHTER_PADDED_TILE_COUNT, rogue_up_TILE_COUNT, rogue_up_tiles); 27 + // Set our color palettes into vram 28 + set_sprite_palette(FIGHTER_PADDED_TILE_COUNT, rogue_up_PALETTE_COUNT, rogue_up_palettes); 29 + // Position near the top middle 30 + // Scale the position, since we are using scaled integers 31 + rogue_x = 80 << 4; 32 + rogue_y = 120 << 4; 33 + // Start with the down metasprite 34 + rogue_metasprite = rogue_up_metasprites[1]; 35 + } 36 + 37 + uint8_t update_rogue(uint8_t last_sprite) { 38 + int16_t dx = (uint16_t)(fighter_x >> 4) - (uint16_t)(rogue_x >> 4); 39 + int16_t dy = (uint16_t)(fighter_y >> 4) - (uint16_t)(rogue_y >> 4); 40 + int16_t dx_abs = abs(dx); 41 + int16_t dy_abs = abs(dy); 42 + 43 + if ((dx_abs > 16) || (dy_abs > 16)) { 44 + uint8_t frame = three_frame_real_value; 45 + 46 + if (frame == 3) { 47 + frame = 1; 48 + } 49 + 50 + if (dx_abs > dy_abs) { 51 + rogue_metasprite = rogue_left_metasprites[frame]; 52 + 53 + if (dx > 0) { 54 + rogue_x += ROGUE_SPEED; 55 + flip_rogue = true; 56 + } else { 57 + rogue_x -= ROGUE_SPEED; 58 + flip_rogue = false; 59 + } 60 + } else { 61 + flip_rogue = false; 62 + 63 + if (dy > 0) { 64 + rogue_y += ROGUE_SPEED; 65 + rogue_metasprite = rogue_down_metasprites[frame]; 66 + } else { 67 + rogue_y -= ROGUE_SPEED; 68 + rogue_metasprite = rogue_up_metasprites[frame]; 69 + } 70 + } 71 + 72 + if (fighter_direction != fighter_last_direction) { 73 + switch (fighter_direction) { 74 + case J_DOWN: 75 + set_sprite_data(FIGHTER_PADDED_TILE_COUNT, rogue_down_TILE_COUNT, rogue_down_tiles); 76 + break; 77 + case J_RIGHT: 78 + flip_rogue = true; 79 + case J_LEFT: 80 + set_sprite_data(FIGHTER_PADDED_TILE_COUNT, rogue_left_TILE_COUNT, rogue_left_tiles); 81 + break; 82 + case J_UP: 83 + set_sprite_data(FIGHTER_PADDED_TILE_COUNT, rogue_up_TILE_COUNT, rogue_up_tiles); 84 + break; 85 + } 86 + } 87 + } 88 + // flip along the vertical access if necessary 89 + // Draw the character at the non-scaled position 90 + // Return how many sprites were used 91 + if (flip_rogue) { 92 + return move_metasprite_flipx(rogue_metasprite, FIGHTER_PADDED_TILE_COUNT, 0, last_sprite, rogue_x >> 4, rogue_y >> 4); 93 + } else { 94 + return move_metasprite_ex(rogue_metasprite, FIGHTER_PADDED_TILE_COUNT, 0, last_sprite, rogue_x >> 4, rogue_y >> 4); 95 + } 96 + }
+9
gb/src/rogue.h
··· 1 + #ifndef ROGUE_H 2 + #define ROGUE_H 3 + 4 + #include <stdint.h> 5 + 6 + uint8_t update_rogue(uint8_t last_sprite); 7 + void setup_rogue(void); 8 + 9 + #endif
+32
gb/src/simple_sprite.c
··· 1 + /* 2 + 3 + SIMPLE_SPRITE.C 4 + 5 + Tile Source File. 6 + 7 + Info: 8 + Form : All tiles as one unit. 9 + Format : Gameboy 4 color. 10 + Compression : None. 11 + Counter : None. 12 + Tile size : 8 x 8 13 + Tiles : 0 to 0 14 + 15 + Palette colors : None. 16 + SGB Palette : None. 17 + CGB Palette : None. 18 + 19 + Convert to metatiles : No. 20 + 21 + This file was generated by GBTD v2.2 22 + 23 + */ 24 + 25 + /* Start of tile array. */ 26 + const unsigned char simple_sprite[] = 27 + { 28 + 0x3C,0x3C,0x3C,0x66,0xFF,0xFF,0xFF,0xBD, 29 + 0xFF,0xBD,0xFF,0xFF,0x3C,0x66,0x3C,0x3C 30 + }; 31 + 32 + /* End of SIMPLE_SPRITE.C */
+35
gb/src/simple_sprite.h
··· 1 + /* 2 + 3 + SIMPLE_SPRITE.H 4 + 5 + Include File. 6 + 7 + Info: 8 + Form : All tiles as one unit. 9 + Format : Gameboy 4 color. 10 + Compression : None. 11 + Counter : None. 12 + Tile size : 8 x 8 13 + Tiles : 0 to 0 14 + 15 + Palette colors : None. 16 + SGB Palette : None. 17 + CGB Palette : None. 18 + 19 + Convert to metatiles : No. 20 + 21 + This file was generated by GBTD v2.2 22 + 23 + */ 24 + 25 + #ifndef __simple_sprite_h_INCLUDE 26 + #define __simple_sprite_h_INCLUDE 27 + 28 + /* Bank of tiles. */ 29 + #define simple_spriteBank 0 30 + /* Start of tile array. */ 31 + extern const unsigned char simple_sprite[]; 32 + 33 + #endif 34 + 35 + /* End of SIMPLE_SPRITE.H */
-73
gb/src/utils.asm
··· 1 - SECTION "MathVariables", WRAM0 2 - 3 - randstate:: ds 4 4 - 5 - SECTION "Math", ROM0 6 - ;; From: https://github.com/pinobatch/libbet/blob/master/src/rand.z80#L34-L54 7 - ; Generates a pseudorandom 16-bit integer in BC 8 - ; using the LCG formula from cc65 rand(): 9 - ; x[i + 1] = x[i] * 0x01010101 + 0xB3B3B3B3 10 - ; @return A=B=state bits 31-24 (which have the best entropy), 11 - ; C=state bits 23-16, HL trashed 12 - rand:: 13 - ; Add 0xB3 then multiply by 0x01010101 14 - push hl 15 - push af 16 - ld hl, randstate+0 17 - ld a, [hl] 18 - add a, $B3 19 - ld [hl+], a 20 - adc a, [hl] 21 - ld [hl+], a 22 - adc a, [hl] 23 - ld [hl+], a 24 - ld c, a 25 - adc a, [hl] 26 - ld [hl], a 27 - ld b, a 28 - pop af 29 - pop hl 30 - ret 31 - 32 - ; Sets the random seed to BC. 33 - ; C expects startup code to behave as if srand(1) was called. 34 - ; AHL trashed 35 - srand:: 36 - ld hl,randstate+3 37 - xor a 38 - ld [hl-],a 39 - ld [hl-],a 40 - ld a,b 41 - ld [hl-],a 42 - ld [hl],c 43 - ret 44 - 45 - ; HL = DE * A 46 - Mul8:: 47 - ld hl, 0 48 - ld b, 8 49 - .Loop: 50 - rrca 51 - jp nc, Mul8.Skip 52 - add hl, de 53 - .Skip: 54 - sla e 55 - rl d 56 - jp nz, Mul8.Loop 57 - ret 58 - 59 - ; A = HL % C 60 - ; HL = HL / C 61 - Mod8:: 62 - ld b, 16 63 - .Loop 64 - xor a 65 - add hl, hl 66 - rla 67 - cp c 68 - jp c, Mod8.Exit 69 - inc l 70 - sub c 71 - jr nz, Mod8.Loop 72 - .Exit 73 - ret
+36
gb/src/utils.c
··· 1 + #include "utils.h" 2 + #include <stdbool.h> 3 + #include <rand.h> 4 + #include <stdint.h> 5 + 6 + RollResult roll(unsigned int die_amount, unsigned int die_type, int bonus) { 7 + unsigned int sum = 0; 8 + bool crit_success = false; 9 + bool crit_failure = false; 10 + 11 + for (int i = 0; i < die_amount; i++) { 12 + unsigned int val = rand_range(1, die_type); 13 + 14 + if (val == 20) { 15 + crit_success = true; 16 + } else if (val == 1) { 17 + crit_failure = true; 18 + } 19 + } 20 + 21 + if (bonus > ((int)sum * -1)) { 22 + sum = 0; 23 + crit_success = false; 24 + crit_failure = false; 25 + } 26 + 27 + RollResult r; 28 + r.result = sum + bonus; 29 + r.crit_success = crit_success; 30 + r.crit_failure = crit_failure; 31 + return r; 32 + } 33 + 34 + unsigned int rand_range(unsigned int min, unsigned int max) { 35 + return rand() % (max - min) + min; 36 + }
+16
gb/src/utils.h
··· 1 + #ifndef UTILS_H 2 + #define UTILS_H 3 + 4 + #include <stdbool.h> 5 + #include <stdint.h> 6 + 7 + typedef struct _result { 8 + unsigned int result; 9 + bool crit_success; 10 + bool crit_failure; 11 + } RollResult; 12 + 13 + RollResult roll(unsigned int die_amount, unsigned int die_type, int bonus); 14 + unsigned int rand_range(unsigned int min, unsigned int max); 15 + 16 + #endif
+89
gb/src/wizard.c
··· 1 + #include "wizard.h" 2 + #include <stdint.h> 3 + #include <gb/metasprites.h> 4 + #include "../res/wizard_down.h" 5 + #include "../res/wizard_left.h" 6 + #include "../res/wizard_up.h" 7 + #include <stdbool.h> 8 + #include <stdlib.h> 9 + #include <gb/gb.h> 10 + 11 + #define WIZARD_SPEED 4 12 + #define FRC_PADDED_TILE_COUNT 36 13 + 14 + uint16_t wizard_x, wizard_y; 15 + extern uint16_t cleric_x, cleric_y; 16 + extern uint8_t fighter_direction, fighter_last_direction; 17 + 18 + uint8_t flip_wizard = false; 19 + 20 + metasprite_t const *wizard_metasprite; 21 + 22 + extern uint8_t three_frame_real_value; 23 + 24 + void setup_wizard(void) { 25 + set_sprite_data(FRC_PADDED_TILE_COUNT, wizard_up_TILE_COUNT, wizard_up_tiles); 26 + set_sprite_palette(FRC_PADDED_TILE_COUNT, wizard_up_PALETTE_COUNT, wizard_up_palettes); 27 + wizard_x = 112 << 4; 28 + wizard_y = 120 << 4; 29 + wizard_metasprite = wizard_up_metasprites[1]; 30 + } 31 + 32 + uint8_t update_wizard(uint8_t last_sprite) { 33 + int16_t dx = (uint16_t)(cleric_x >> 4) - (uint16_t)(wizard_x >> 4); 34 + int16_t dy = (uint16_t)(cleric_y >> 4) - (uint16_t)(wizard_y >> 4); 35 + int16_t dx_abs = abs(dx); 36 + int16_t dy_abs = abs(dy); 37 + 38 + if ((dx_abs > 16) || (dy_abs > 16)) { 39 + uint8_t frame = three_frame_real_value; 40 + 41 + if (frame == 3) { 42 + frame = 1; 43 + } 44 + 45 + if (dx_abs > dy_abs) { 46 + wizard_metasprite = wizard_left_metasprites[frame]; 47 + 48 + if (dx > 0) { 49 + wizard_x += WIZARD_SPEED; 50 + flip_wizard = true; 51 + } else { 52 + wizard_x -= WIZARD_SPEED; 53 + flip_wizard = false; 54 + } 55 + } else { 56 + flip_wizard = false; 57 + 58 + if (dy > 0) { 59 + wizard_y += WIZARD_SPEED; 60 + wizard_metasprite = wizard_down_metasprites[frame]; 61 + } else { 62 + wizard_y -= WIZARD_SPEED; 63 + wizard_metasprite = wizard_up_metasprites[frame]; 64 + } 65 + } 66 + 67 + if (fighter_direction != fighter_last_direction) { 68 + switch (fighter_direction) { 69 + case J_DOWN: 70 + set_sprite_data(FRC_PADDED_TILE_COUNT, wizard_down_TILE_COUNT, wizard_down_tiles); 71 + break; 72 + case J_RIGHT: 73 + flip_wizard = true; 74 + case J_LEFT: 75 + set_sprite_data(FRC_PADDED_TILE_COUNT, wizard_left_TILE_COUNT, wizard_left_tiles); 76 + break; 77 + case J_UP: 78 + set_sprite_data(FRC_PADDED_TILE_COUNT, wizard_up_TILE_COUNT, wizard_up_tiles); 79 + break; 80 + } 81 + } 82 + } 83 + 84 + if (flip_wizard) { 85 + return move_metasprite_flipx(wizard_metasprite, FRC_PADDED_TILE_COUNT, 0, last_sprite, wizard_x >> 4, wizard_y >> 4); 86 + } else { 87 + return move_metasprite_ex(wizard_metasprite, FRC_PADDED_TILE_COUNT, 0, last_sprite, wizard_x >> 4, wizard_y >> 4); 88 + } 89 + }
+9
gb/src/wizard.h
··· 1 + #ifndef WIZARD_H 2 + #define WIZARD_H 3 + 4 + #include <stdint.h> 5 + 6 + uint8_t update_wizard(uint8_t last_sprite); 7 + void setup_wizard(void); 8 + 9 + #endif