Enable rgbds warnings and remove CFLAGS=-O2 (default is now -O3)

This commit is contained in:
Rangi 2020-04-04 17:46:36 -04:00
parent 95e48ef992
commit 3144b54bd1
8 changed files with 24 additions and 18 deletions

5
FAQ.md
View File

@ -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.

View File

@ -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).

View File

@ -45,8 +45,8 @@ RGBLINK ?= $(RGBDS)rgblink
.SECONDARY:
all: crystal
crystal: pokecrystal.gbc
crystal11: pokecrystal11.gbc
crystal: pokecrystal.gbc
crystal11: pokecrystal11.gbc
crystal-au: pokecrystal-au.gbc
clean:
@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -16,7 +16,7 @@
const DEXSTATE_EXIT
POKEDEX_SCX EQU 5
GLOBAL POKEDEX_SCX
EXPORT POKEDEX_SCX
Pokedex:
ldh a, [hWX]