Skip to content

Commit d2c9e2d

Browse files
authored
Use features of RGBDS 1.0.0 (#138)
1 parent 7ab16e4 commit d2c9e2d

File tree

104 files changed

+617
-616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+617
-616
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@master
1717
with:
1818
path: rgbds
19-
ref: v0.9.3
19+
ref: v1.0.0
2020
repository: gbdev/rgbds
2121

2222
- name: Install rgbds

.rgbds-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.3
1+
1.0.0

INSTALL.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ Run setup and leave the default settings. At the "**Select Packages**" step, cho
4242

4343
Double click on the text that says "**Skip**" next to each package to select the most recent version to install.
4444

45-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.9.3**.
45+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 1.0.0**.
4646

47-
**Note:** If you already have an installed rgbds older than 0.9.3, you will need to update to 0.9.3. Ignore this if you have never installed rgbds before. If a version newer than 0.9.3 does not work, try downloading 0.9.3.
47+
**Note:** If you already have an installed rgbds older than 1.0.0, you will need to update to 1.0.0. Ignore this if you have never installed rgbds before. If a version newer than 1.0.0 does not work, try downloading 1.0.0.
4848

4949
Now open the **Cygwin terminal** and enter the following commands.
5050

@@ -67,7 +67,7 @@ Install [**Homebrew**](https://brew.sh/). Follow the official instructions.
6767

6868
Open **Terminal** and prepare to enter commands.
6969

70-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.9.3**.
70+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 1.0.0**.
7171

7272
Now you're ready to [build **pokegold**](#build-pokegold).
7373

@@ -84,7 +84,7 @@ To install the software required for **pokegold**:
8484
sudo apt-get install make gcc git
8585
```
8686

87-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
87+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
8888

8989
### OpenSUSE
9090

@@ -94,7 +94,7 @@ To install the software required for **pokegold**:
9494
sudo zypper install make gcc git
9595
```
9696

97-
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
97+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
9898

9999
### Arch Linux
100100

@@ -104,7 +104,7 @@ To install the software required for **pokegold**:
104104
sudo pacman -S make gcc git rgbds
105105
```
106106

107-
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
107+
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
108108

109109
### Termux
110110

@@ -120,7 +120,7 @@ To install **rgbds**:
120120
pkg install rgbds
121121
```
122122

123-
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
123+
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
124124

125125
### Other distros
126126

@@ -131,7 +131,7 @@ If your distro is not listed here, try to find the required software in its repo
131131
- `git`
132132
- `rgbds`
133133

134-
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.3** from source.
134+
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.0** from source.
135135

136136
Now you're ready to [build **pokegold**](#build-pokegold).
137137

@@ -165,12 +165,12 @@ make
165165

166166
### Build with a local rgbds version
167167

168-
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.9.3 globally. Instead, you can put its files in a directory within pokegold, such as `pokegold/rgbds-0.9.3/`. Then specify it when you run `make`:
168+
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 1.0.0 globally. Instead, you can put its files in a directory within pokegold, such as `pokegold/rgbds-1.0.0/`. Then specify it when you run `make`:
169169

170170
```bash
171-
make RGBDS=rgbds-0.9.3/ gold
171+
make RGBDS=rgbds-1.0.0/ gold
172172
```
173173

174174
```bash
175-
make RGBDS=rgbds-0.9.3/ silver
175+
make RGBDS=rgbds-1.0.0/ silver
176176
```

Makefile

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ RGBFIX ?= $(RGBDS)rgbfix
5656
RGBGFX ?= $(RGBDS)rgbgfx
5757
RGBLINK ?= $(RGBDS)rgblink
5858

59+
RGBASMFLAGS ?= -Weverything -Wtruncation=1
60+
RGBLINKFLAGS ?= -Weverything -Wtruncation=1
61+
RGBFIXFLAGS ?= -Weverything
62+
RGBGFXFLAGS ?= -Weverything
63+
5964

6065
### Build targets
6166

@@ -107,7 +112,7 @@ tools:
107112
$(MAKE) -C tools/
108113

109114

110-
RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wtruncation=1
115+
RGBASMFLAGS += -Q8 -P includes.asm
111116
# Create a sym/map for debug purposes if `make` run with `DEBUG=1`
112117
ifeq ($(DEBUG),1)
113118
RGBASMFLAGS += -E
@@ -171,16 +176,17 @@ $(foreach obj, $(silver_vc_excl_obj), \
171176
endif
172177

173178

174-
pokegold_opt = -cjsv -t POKEMON_GLD -i AAUE -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
175-
pokesilver_opt = -cjsv -t POKEMON_SLV -i AAXE -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
176-
pokegold_debug_opt = -cjsv -t POKEMON_GLD -i AAUE -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
177-
pokesilver_debug_opt = -cjsv -t POKEMON_SLV -i AAXE -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
178-
pokegold_vc_opt = -cjsv -t POKEMON_GLD -i AAUE -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
179-
pokesilver_vc_opt = -cjsv -t POKEMON_SLV -i AAXE -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
179+
RGBFIXFLAGS += -cjsv -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
180+
pokegold.gbc: RGBFIXFLAGS += -t POKEMON_GLD -i AAUE
181+
pokesilver.gbc: RGBFIXFLAGS += -t POKEMON_SLV -i AAXE
182+
pokegold_debug.gbc: RGBFIXFLAGS += -t POKEMON_GLD -i AAUE
183+
pokesilver_debug.gbc: RGBFIXFLAGS += -t POKEMON_SLV -i AAXE
184+
pokegold_vc.gbc: RGBFIXFLAGS += -t POKEMON_GLD -i AAUE
185+
pokesilver_vc.gbc: RGBFIXFLAGS += -t POKEMON_SLV -i AAXE
180186

181187
%.gbc: $$(%_obj) layout.link
182-
$(RGBLINK) -n $*.sym -m $*.map -l layout.link -o $@ $(filter %.o,$^)
183-
$(RGBFIX) $($*_opt) $@
188+
$(RGBLINK) $(RGBLINKFLAGS) -l layout.link -n $*.sym -m $*.map -o $@ $(filter %.o,$^)
189+
$(RGBFIX) $(RGBFIXFLAGS) $@
184190
tools/stadium $@
185191

186192

@@ -196,52 +202,52 @@ include gfx/lz.mk
196202
### Pokemon and trainer sprite rules
197203

198204
define PIC
199-
$1/back.2bpp: rgbgfx += --columns
205+
$1/back.2bpp: RGBGFXFLAGS += --columns
200206
$1/back.2bpp: $1/back.png $1/normal.gbcpal
201-
$$(RGBGFX) $$(rgbgfx) --colors gbc:$$(word 2,$$^) -o $$@ $$<
202-
$1/front.2bpp: rgbgfx += --columns
207+
$$(RGBGFX) $$(RGBGFXFLAGS) --colors gbc:$$(word 2,$$^) -o $$@ $$<
208+
$1/front.2bpp: RGBGFXFLAGS += --columns
203209
$1/front.2bpp: $1/front.png $1/normal.gbcpal
204-
$$(RGBGFX) $$(rgbgfx) --colors gbc:$$(word 2,$$^) -o $$@ $$<
210+
$$(RGBGFX) $$(RGBGFXFLAGS) --colors gbc:$$(word 2,$$^) -o $$@ $$<
205211
$1/normal.gbcpal: $1/front.gbcpal $1/back.gbcpal
206212
tools/gbcpal $$(tools/gbcpal) $$@ $$^
207213
endef
208214
$(foreach pic, $(wildcard gfx/pokemon/*/front.png),\
209215
$(eval $(call PIC,$(pic:/front.png=))))
210216

211217
define PIC_GS
212-
$1/back.2bpp: rgbgfx += --columns
218+
$1/back.2bpp: RGBGFXFLAGS += --columns
213219
$1/back.2bpp: $1/back.png $1/normal.gbcpal
214-
$$(RGBGFX) $$(rgbgfx) --colors gbc:$$(word 2,$$^) -o $$@ $$<
215-
$1/front_gold.2bpp: rgbgfx += --columns
220+
$$(RGBGFX) $$(RGBGFXFLAGS) --colors gbc:$$(word 2,$$^) -o $$@ $$<
221+
$1/front_gold.2bpp: RGBGFXFLAGS += --columns
216222
$1/front_gold.2bpp: $1/front_gold.png $1/normal.gbcpal
217-
$$(RGBGFX) $$(rgbgfx) --colors gbc:$$(word 2,$$^) -o $$@ $$<
218-
$1/front_silver.2bpp: rgbgfx += --columns
223+
$$(RGBGFX) $$(RGBGFXFLAGS) --colors gbc:$$(word 2,$$^) -o $$@ $$<
224+
$1/front_silver.2bpp: RGBGFXFLAGS += --columns
219225
$1/front_silver.2bpp: $1/front_silver.png $1/normal.gbcpal
220-
$$(RGBGFX) $$(rgbgfx) --colors gbc:$$(word 2,$$^) -o $$@ $$<
226+
$$(RGBGFX) $$(RGBGFXFLAGS) --colors gbc:$$(word 2,$$^) -o $$@ $$<
221227
$1/normal.gbcpal: $1/front_gold.gbcpal $1/front_silver.gbcpal $1/back.gbcpal
222228
tools/gbcpal $$(tools/gbcpal) $$@ $$^
223229
endef
224230
$(foreach pic, $(wildcard gfx/pokemon/*/front_gold.png),\
225231
$(eval $(call PIC_GS,$(pic:/front_gold.png=))))
226232

227-
gfx/trainers/%.2bpp: rgbgfx += --columns
233+
gfx/trainers/%.2bpp: RGBGFXFLAGS += --columns
228234
gfx/trainers/%.2bpp: gfx/trainers/%.png gfx/trainers/%.gbcpal
229-
$(RGBGFX) $(rgbgfx) --colors gbc:$(word 2,$^) -o $@ $<
235+
$(RGBGFX) $(RGBGFXFLAGS) --colors gbc:$(word 2,$^) -o $@ $<
230236

231237
# A few back sprites have different compression settings for Gold and Silver
232238
gfx/pokemon/%/back_gold.2bpp: gfx/pokemon/%/back.2bpp ; cp -f $^ $@
233239
gfx/pokemon/%/back_silver.2bpp: gfx/pokemon/%/back.2bpp ; cp -f $^ $@
234240

235241
# Egg does not have a back sprite, so it only uses egg.gbcpal
236242
gfx/pokemon/egg/egg.2bpp: gfx/pokemon/egg/egg.png gfx/pokemon/egg/egg.gbcpal
237-
gfx/pokemon/egg/egg.2bpp: rgbgfx += --columns --colors gbc:$(word 2,$^)
243+
gfx/pokemon/egg/egg.2bpp: RGBGFXFLAGS += --columns --colors gbc:$(word 2,$^)
238244

239245
# Unown letters share one normal.gbcpal
240246
unown_pngs := $(wildcard gfx/pokemon/unown_*/front.png) $(wildcard gfx/pokemon/unown_*/back.png)
241247
$(foreach png, $(unown_pngs),\
242248
$(eval $(png:.png=.2bpp): $(png) gfx/pokemon/unown/normal.gbcpal))
243-
gfx/pokemon/unown_%/back.2bpp: rgbgfx += --colors gbc:$(word 2,$^)
244-
gfx/pokemon/unown_%/front.2bpp: rgbgfx += --colors gbc:$(word 2,$^)
249+
gfx/pokemon/unown_%/back.2bpp: RGBGFXFLAGS += --colors gbc:$(word 2,$^)
250+
gfx/pokemon/unown_%/front.2bpp: RGBGFXFLAGS += --colors gbc:$(word 2,$^)
245251
gfx/pokemon/unown/normal.gbcpal: $(subst .png,.gbcpal,$(unown_pngs))
246252
tools/gbcpal $(tools/gbcpal) $@ $^
247253

@@ -264,8 +270,8 @@ gfx/intro/fire1.2bpp: gfx/intro/charizard1.2bpp gfx/intro/charizard2_top.2bpp gf
264270
gfx/intro/fire2.2bpp: gfx/intro/charizard2_bottom.2bpp gfx/intro/charizard3.2bpp ; cat $^ > $@
265271
gfx/intro/fire3.2bpp: gfx/intro/fire.2bpp gfx/intro/unused_blastoise_venusaur.2bpp ; cat $^ > $@
266272

267-
gfx/new_game/shrink1.2bpp: rgbgfx += --columns
268-
gfx/new_game/shrink2.2bpp: rgbgfx += --columns
273+
gfx/new_game/shrink1.2bpp: RGBGFXFLAGS += --columns
274+
gfx/new_game/shrink2.2bpp: RGBGFXFLAGS += --columns
269275

270276
gfx/mail/dragonite.1bpp: tools/gfx += --remove-whitespace
271277
gfx/mail/large_note.1bpp: tools/gfx += --remove-whitespace
@@ -275,10 +281,10 @@ gfx/mail/litebluemail_border.1bpp: tools/gfx += --remove-whitespace
275281

276282
gfx/pokedex/pokedex.2bpp: tools/gfx += --trim-whitespace
277283
gfx/pokedex/pokedex_sgb.2bpp: tools/gfx += --trim-whitespace
278-
gfx/pokedex/question_mark.2bpp: rgbgfx += --columns
284+
gfx/pokedex/question_mark.2bpp: RGBGFXFLAGS += --columns
279285
gfx/pokedex/slowpoke.2bpp: tools/gfx += --trim-whitespace
280286

281-
gfx/pokegear/pokegear.2bpp: rgbgfx += --trim-end 2
287+
gfx/pokegear/pokegear.2bpp: RGBGFXFLAGS += --trim-end 2
282288
gfx/pokegear/pokegear_sprites.2bpp: tools/gfx += --trim-whitespace
283289

284290
gfx/mystery_gift/mystery_gift.2bpp: tools/gfx += --remove-whitespace
@@ -319,16 +325,16 @@ gfx/battle_anims/rocks.2bpp: tools/gfx += --remove-whitespace
319325
gfx/battle_anims/skyattack.2bpp: tools/gfx += --remove-whitespace
320326
gfx/battle_anims/status.2bpp: tools/gfx += --remove-whitespace
321327

322-
gfx/player/chris.2bpp: rgbgfx += --columns
323-
gfx/player/chris_back.2bpp: rgbgfx += --columns
328+
gfx/player/chris.2bpp: RGBGFXFLAGS += --columns
329+
gfx/player/chris_back.2bpp: RGBGFXFLAGS += --columns
324330

325331
gfx/trainer_card/leaders.2bpp: tools/gfx += --trim-whitespace
326332

327333
gfx/overworld/chris_fish.2bpp: tools/gfx += --trim-whitespace
328334

329335
gfx/sprites/big_onix.2bpp: tools/gfx += --remove-whitespace --remove-xflip
330336

331-
gfx/battle/dude.2bpp: rgbgfx += --columns
337+
gfx/battle/dude.2bpp: RGBGFXFLAGS += --columns
332338

333339
gfx/font/unused_bold_font.1bpp: tools/gfx += --trim-whitespace
334340

@@ -341,12 +347,12 @@ gfx/sgb/silver_border.sgb.tilemap: gfx/sgb/silver_border.bin ; tr < $< -d '\000'
341347
### Catch-all graphics rules
342348

343349
%.2bpp: %.png
344-
$(RGBGFX) --colors dmg=e4 $(rgbgfx) -o $@ $<
350+
$(RGBGFX) --colors dmg $(RGBGFXFLAGS) -o $@ $<
345351
$(if $(tools/gfx),\
346352
tools/gfx $(tools/gfx) -o $@ $@ || $$($(RM) $@ && false))
347353

348354
%.1bpp: %.png
349-
$(RGBGFX) --colors dmg=e4 $(rgbgfx) --depth 1 -o $@ $<
355+
$(RGBGFX) --colors dmg $(RGBGFXFLAGS) --depth 1 -o $@ $<
350356
$(if $(tools/gfx),\
351357
tools/gfx $(tools/gfx) --depth 1 -o $@ $@ || $$($(RM) $@ && false))
352358

data/maps/attributes.asm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MACRO connection
3737
DEF _tgt = 0
3838
endc
3939

40-
if !STRCMP("\1", "north")
40+
if "\1" === "north"
4141
DEF _blk = \3_WIDTH * (\3_HEIGHT - 3) + _src
4242
DEF _map = _tgt
4343
DEF _win = (\3_WIDTH + 6) * \3_HEIGHT + 1
@@ -48,7 +48,7 @@ MACRO connection
4848
DEF _len = \3_WIDTH
4949
endc
5050

51-
elif !STRCMP("\1", "south")
51+
elif "\1" === "south"
5252
DEF _blk = _src
5353
DEF _map = (CURRENT_MAP_WIDTH + 6) * (CURRENT_MAP_HEIGHT + 3) + _tgt
5454
DEF _win = \3_WIDTH + 7
@@ -59,7 +59,7 @@ MACRO connection
5959
DEF _len = \3_WIDTH
6060
endc
6161

62-
elif !STRCMP("\1", "west")
62+
elif "\1" === "west"
6363
DEF _blk = (\3_WIDTH * _src) + \3_WIDTH - 3
6464
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt
6565
DEF _win = (\3_WIDTH + 6) * 2 - 6
@@ -70,7 +70,7 @@ MACRO connection
7070
DEF _len = \3_HEIGHT
7171
endc
7272

73-
elif !STRCMP("\1", "east")
73+
elif "\1" === "east"
7474
DEF _blk = (\3_WIDTH * _src)
7575
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt + CURRENT_MAP_WIDTH + 3
7676
DEF _win = \3_WIDTH + 7

data/pokemon/unown_words.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MACRO unownword
22
for n, CHARLEN(\1)
3-
db STRCHAR(\1, n) - "A" + FIRST_UNOWN_CHAR
3+
db CHARVAL(STRCHAR(\1, n)) - 'A' + FIRST_UNOWN_CHAR
44
endr
55
db -1
66
ENDM

engine/battle/anim_hp_bar.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ HPBarAnim_UpdateHPRemaining:
257257
.loaded_de
258258
push hl
259259
add hl, de
260-
ld a, " "
260+
ld a, ' '
261261
ld [hli], a
262262
ld [hli], a
263263
ld [hld], a

engine/battle/battle_transition.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ DEF BATTLETRANSITION_NO_CAVE EQU $10
55
DEF BATTLETRANSITION_NO_CAVE_STRONGER EQU $18
66
DEF BATTLETRANSITION_FINISH EQU $20
77

8-
DEF BATTLETRANSITION_SQUARE EQU "8" ; $fe
9-
DEF BATTLETRANSITION_BLACK EQU "9" ; $ff
8+
DEF BATTLETRANSITION_SQUARE EQU '8' ; $fe
9+
DEF BATTLETRANSITION_BLACK EQU '9' ; $ff
1010

1111
DoBattleTransition:
1212
call .InitGFX

0 commit comments

Comments
 (0)