diff --git a/FAQ.md b/FAQ.md index aa5615c4049..c219603400e 100644 --- a/FAQ.md +++ b/FAQ.md @@ -8,6 +8,7 @@ - [I can't build the ROM, `make` just prints an error!](#i-cant-build-the-rom-make-just-prints-an-error) - [`gcc`: command not found](#gcc-command-not-found) - ["ERROR: `UNION` already defined"](#error-union-already-defined) + - ["ERROR: Macro not defined"](#error-macro-not-defined) - ["Expression must be 8-bit"](#expression-must-be-8-bit) - ["Segmentation fault" from `rgbgfx`](#segmentation-fault-from-rgbgfx) - ["Section is too big" or "Unable to place section in bank"](#section-is-too-big-or-unable-to-place-section-in-bank) @@ -41,6 +42,10 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel Download [**rgbds 0.4.0**][rgbds] or newer. Older versions will not work. +### "ERROR: Macro not defined" + +Download [**rgbds 0.4.0**][rgbds] or newer. Older versions will not work. + ### "Expression must be 8-bit" Download [**rgbds 0.4.0**][rgbds] or newer. Older versions will not work. diff --git a/INSTALL.md b/INSTALL.md index d3a10e5dbae..9f3d7c4c4ea 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -87,7 +87,7 @@ To install **rgbds**: ```bash sudo apt-get install pkg-config flex bison libpng-dev git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds -sudo make -C rgbds CFLAGS=-O2 install +sudo make -C rgbds install ``` ### OpenSUSE @@ -103,7 +103,7 @@ To install **rgbds**: ```bash sudo zypper install pkg-config flex bison libpng16-devel git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds -sudo make -C rgbds CFLAGS=-O2 install +sudo make -C rgbds install ``` ### Arch Linux @@ -121,7 +121,7 @@ Alternatively, to install **rgbds** manually: ```bash sudo pacman -S pkg-config flex bison libpng git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds -sudo make -C rgbds CFLAGS=-O2 install +sudo make -C rgbds install ``` ### Termux @@ -158,7 +158,7 @@ To install **rgbds**: ```bash git clone -b v0.4.0 --depth=1 https://github.com/rednex/rgbds -sudo make -C rgbds CFLAGS=-O2 install +sudo make -C rgbds install ``` Now you're ready to [build **pokecrystal**](#build-pokecrystal). diff --git a/Makefile b/Makefile index 0fd96513fd6..1981685935a 100644 --- a/Makefile +++ b/Makefile @@ -66,16 +66,17 @@ tools: $(MAKE) -C tools/ -$(crystal_obj): RGBASMFLAGS = -$(crystal11_obj): RGBASMFLAGS = -D _CRYSTAL11 -$(crystal_au_obj): RGBASMFLAGS = -D _CRYSTAL11 -D _CRYSTAL_AU +RGBASMFLAGS = -L -Weverything +$(crystal_obj): RGBASMFLAGS += +$(crystal11_obj): RGBASMFLAGS += -D _CRYSTAL11 +$(crystal_au_obj): RGBASMFLAGS += -D _CRYSTAL11 -D _CRYSTAL_AU # The dep rules have to be explicit or else missing files won't be reported. # As a side effect, they're evaluated immediately instead of when the rule is invoked. # It doesn't look like $(shell) can be deferred so there might not be a better way. define DEP $1: $2 $$(shell tools/scan_includes $2) - $$(RGBASM) $$(RGBASMFLAGS) -L -o $$@ $$< + $$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$< endef # Build tools when building the rom. diff --git a/constants.asm b/constants.asm index 467163d8f0f..758b3abcc4c 100644 --- a/constants.asm +++ b/constants.asm @@ -1,4 +1,4 @@ -if __RGBDS_MINOR__ < 4 +if __RGBDS_MAJOR__ <= 0 && __RGBDS_MINOR__ < 4 fail "pokecrystal requires rgbds 0.4.0 or newer." endc diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index 1009177ff57..d221b74458e 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -750,13 +750,13 @@ Script_AskWaterfall: EscapeRopeFunction: call FieldMoveJumptableReset ld a, $1 - jr dig_incave + jr EscapeRopeOrDig DigFunction: call FieldMoveJumptableReset ld a, $2 -dig_incave +EscapeRopeOrDig: ld [wBuffer2], a .loop ld hl, .DigTable diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index 7f2fc8fa133..aa29d413ba8 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -241,21 +241,21 @@ LoadTrainerClassPaletteAsNthBGPal: ld a, [wTrainerClass] call GetTrainerPalettePointer ld a, e - jr got_palette_pointer_8bd7 + jr LoadNthMiddleBGPal LoadMonPaletteAsNthBGPal: ld a, [wCurPartySpecies] call _GetMonPalettePointer ld a, e bit 7, a - jr z, got_palette_pointer_8bd7 + jr z, LoadNthMiddleBGPal and $7f inc hl inc hl inc hl inc hl -got_palette_pointer_8bd7 +LoadNthMiddleBGPal: push hl ld hl, wBGPals1 ld de, 1 palettes diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm index bf8e697788d..6367bffe6a4 100644 --- a/engine/gfx/load_pics.asm +++ b/engine/gfx/load_pics.asm @@ -247,7 +247,7 @@ FixPicBank: ; This is a thing for some reason. PICS_FIX EQU $36 -GLOBAL PICS_FIX +EXPORT PICS_FIX push hl push bc diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index 24228d97f3c..6f500bc374e 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -16,7 +16,7 @@ const DEXSTATE_EXIT POKEDEX_SCX EQU 5 -GLOBAL POKEDEX_SCX +EXPORT POKEDEX_SCX Pokedex: ldh a, [hWX]