Skip to content

Commit

Permalink
Enable rgbds warnings and remove CFLAGS=-O2 (default is now -O3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Apr 6, 2020
1 parent 95e48ef commit ade498a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 16 deletions.
5 changes: 5 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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).
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion constants.asm
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions engine/events/overworld.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions engine/gfx/color.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engine/gfx/load_pics.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engine/pokedex/pokedex.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const DEXSTATE_EXIT

POKEDEX_SCX EQU 5
GLOBAL POKEDEX_SCX
EXPORT POKEDEX_SCX

Pokedex:
ldh a, [hWX]
Expand Down

0 comments on commit ade498a

Please sign in to comment.