Skip to content

Commit 61c9ba5

Browse files
authored
Use RGBDS 0.9.0 (#1159)
1 parent 13621fa commit 61c9ba5

15 files changed

+47
-67
lines changed

.github/workflows/main.yml

+1-1
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.8.0
19+
ref: v0.9.0
2020
repository: gbdev/rgbds
2121

2222
- name: Install rgbds

FAQ.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel
4141

4242
### "ERROR: `UNION` already defined"
4343

44-
Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
44+
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.
4545

4646
### "ERROR: Macro not defined"
4747

48-
Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
48+
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.
4949

5050
### "Expression must be 8-bit"
5151

52-
Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
52+
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.
5353

5454
### "Segmentation fault" from `rgbgfx`
5555

INSTALL.md

+11-11
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.7.0**.
45+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.9.0**.
4646

47-
**Note:** If you already have an installed rgbds older than 0.7.0, you will need to update to 0.7.0. Ignore this if you have never installed rgbds before. If a version newer than 0.7.0 does not work, try downloading 0.7.0.
47+
**Note:** If you already have an installed rgbds older than 0.9.0, you will need to update to 0.9.0. Ignore this if you have never installed rgbds before. If a version newer than 0.9.0 does not work, try downloading 0.9.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.7.0**.
70+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.9.0**.
7171

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

@@ -84,7 +84,7 @@ To install the software required for **pokecrystal**:
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.7.0** from source.
87+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.
8888

8989
### OpenSUSE
9090

@@ -94,7 +94,7 @@ To install the software required for **pokecrystal**:
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.7.0** from source.
97+
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.
9898

9999
### Arch Linux
100100

@@ -104,7 +104,7 @@ To install the software required for **pokecrystal**:
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.7.0** 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 0.9.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.7.0** 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 0.9.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.7.0** 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 0.9.0** from source.
135135

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

@@ -159,12 +159,12 @@ make crystal11
159159

160160
### Build with a local rgbds version
161161

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

164164
```bash
165-
make RGBDS=rgbds-0.7.0/
165+
make RGBDS=rgbds-0.9.0/
166166
```
167167

168168
```bash
169-
make RGBDS=rgbds-0.7.0/ crystal11
169+
make RGBDS=rgbds-0.9.0/ crystal11
170170
```

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ tools:
104104
$(MAKE) -C tools/
105105

106106

107-
RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
107+
RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wtruncation=1
108108
# Create a sym/map for debug purposes if `make` run with `DEBUG=1`
109109
ifeq ($(DEBUG),1)
110110
RGBASMFLAGS += -E
@@ -153,12 +153,12 @@ $(foreach obj, $(pokecrystal11_vc_obj), $(eval $(call DEP,$(obj),$(obj:11_vc.o=.
153153
endif
154154

155155

156-
pokecrystal_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 0 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
157-
pokecrystal11_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
158-
pokecrystal_au_opt = -Cjv -t PM_CRYSTAL -i BYTU -n 0 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
159-
pokecrystal_debug_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 0 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
160-
pokecrystal11_debug_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
161-
pokecrystal11_vc_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
156+
pokecrystal_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 0 -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
157+
pokecrystal11_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
158+
pokecrystal_au_opt = -Cjv -t PM_CRYSTAL -i BYTU -n 0 -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
159+
pokecrystal_debug_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 0 -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
160+
pokecrystal11_debug_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
161+
pokecrystal11_vc_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m MBC3+TIMER+RAM+BATTERY -r 3 -p 0
162162

163163
%.gbc: $$(%_obj) layout.link
164164
$(RGBLINK) -n $*.sym -m $*.map -l layout.link -o $@ $(filter %.o,$^)

docs/design_flaws.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ The offset is translated into a correct bank by `FixPicBank` in [engine/gfx/load
3434
FixPicBank:
3535
; This is a thing for some reason.
3636
37-
DEF PICS_FIX EQU $36
38-
GLOBAL PICS_FIX
37+
EXPORT DEF PICS_FIX EQU $36
3938
4039
push hl
4140
push bc

engine/battle/battle_transition.asm

+1-2
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,7 @@ INCLUDE "gfx/overworld/trainer_battle_dark.pal"
718718

719719
PokeBallTransition:
720720
; 16x16 overlay of a Poke Ball
721-
pusho
722-
opt b.X ; . = 0, X = 1
721+
pusho b.X ; . = 0, X = 1
723722
bigdw %......XXXX......
724723
bigdw %....XXXXXXXX....
725724
bigdw %..XXXX....XXXX..

engine/events/unown_walls.asm

+1-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ DisplayUnownWords:
148148
call CloseWindow
149149
ret
150150

151-
pushc
152-
setcharmap unown
151+
pushc unown
153152

154153
INCLUDE "data/events/unown_walls.asm"
155154

engine/gfx/load_pics.asm

+1-2
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ GetMonBackpic:
247247
FixPicBank:
248248
; This is a thing for some reason.
249249

250-
DEF PICS_FIX EQU $36
251-
EXPORT PICS_FIX
250+
EXPORT DEF PICS_FIX EQU $36
252251

253252
push hl
254253
push bc

engine/pokedex/pokedex.asm

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
const DEXSTATE_UPDATE_UNOWN_MODE
1616
const DEXSTATE_EXIT
1717

18-
DEF POKEDEX_SCX EQU 5
19-
EXPORT POKEDEX_SCX
18+
EXPORT DEF POKEDEX_SCX EQU 5
2019

2120
Pokedex:
2221
ldh a, [hWX]

macros/code.asm

+3-9
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,11 @@ MACRO maskbits
3535
; cp 26
3636
; jr nc, .loop
3737
assert 0 < (\1) && (\1) <= $100, "bitmask must be 8-bit"
38-
DEF x = 1
39-
rept 8
40-
if x + 1 < (\1)
41-
DEF x = (x << 1) | 1
42-
endc
43-
endr
38+
DEF x = (1 << BITWIDTH((\1) - 1)) - 1
4439
if _NARG == 2
45-
and x << (\2)
46-
else
47-
and x
40+
DEF x <<= \2
4841
endc
42+
and x
4943
ENDM
5044

5145
MACRO calc_sine_wave

mobile/mobile_40.asm

+2-4
Original file line numberDiff line numberDiff line change
@@ -1698,8 +1698,7 @@ Function100ae7:
16981698
ld [wcd2b], a
16991699
ret
17001700

1701-
pushc
1702-
setcharmap ascii
1701+
pushc ascii
17031702

17041703
Unknown_100b0a:
17051704
db "tetsuji", 0
@@ -3638,8 +3637,7 @@ Function101826:
36383637
ld [wcd2b], a
36393638
ret
36403639

3641-
pushc
3642-
setcharmap ascii
3640+
pushc ascii
36433641

36443642
Unknown_10186f:
36453643
db .end - @

mobile/mobile_45_stadium.asm

+2-2
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,7 @@ MobilePassword_IncrementJumptable:
477477
inc [hl]
478478
ret
479479

480-
pushc
481-
setcharmap ascii
480+
pushc ascii
482481

483482
Unknown_117a0f:
484483
db "ABCDEFGHIJKLMNOPQRSTUVWXYZ "
@@ -489,6 +488,7 @@ Unknown_117a47:
489488
db "!\"#$%&'()*+ "
490489
db ",-./:;<=>?@ "
491490
db "[\\]^_`\{|}~ "
491+
492492
popc
493493

494494
; everything from here to the end of the bank is related to the

mobile/mobile_46.asm

+7-14
Original file line numberDiff line numberDiff line change
@@ -1482,8 +1482,7 @@ Function118b9a:
14821482
and a
14831483
ret
14841484

1485-
pushc
1486-
setcharmap ascii
1485+
pushc ascii
14871486

14881487
ExchangeDownloadURL:
14891488
db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTJ/exchange/index.txt", 0
@@ -2919,8 +2918,7 @@ Function119694:
29192918
jr nz, .asm_119699
29202919
ret
29212920

2922-
pushc
2923-
setcharmap ascii
2921+
pushc ascii
29242922

29252923
Unknown_1196b8:
29262924
db "Mon"
@@ -3524,8 +3522,7 @@ Function119ac9:
35243522
ld [wBattleTowerRoomMenuJumptableIndex], a
35253523
ret
35263524

3527-
pushc
3528-
setcharmap ascii
3525+
pushc ascii
35293526

35303527
XGameCode:
35313528
db "CGB-BXTJ-00", $0
@@ -3718,8 +3715,7 @@ Function119b6b:
37183715
call CopyBytes
37193716
jp BattleTowerRoomMenu_IncrementJumptable
37203717

3721-
pushc
3722-
setcharmap ascii
3718+
pushc ascii
37233719

37243720
.decodeBase64Character
37253721
cp "+"
@@ -4000,8 +3996,7 @@ BattleTowerRoomMenu_IncrementJumptable:
40003996
inc [hl]
40013997
ret
40023998

4003-
pushc
4004-
setcharmap ascii
3999+
pushc ascii
40054000

40064001
XGameCodePrefix:
40074002
db "X-Game-code:\n"
@@ -4038,8 +4033,7 @@ Function119e4f:
40384033
.loop2
40394034
ld a, [de]
40404035
inc de
4041-
pushc
4042-
setcharmap ascii
4036+
pushc ascii
40434037
cp "\n"
40444038
popc
40454039
jr z, .newline
@@ -4066,8 +4060,7 @@ popc
40664060
ld a, [hli]
40674061
ld [de], a
40684062
inc de
4069-
pushc
4070-
setcharmap ascii
4063+
pushc ascii
40714064
cp "\r"
40724065
popc
40734066
jr z, .finish

rgbdscheck.asm

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
2-
fail "pokecrystal requires rgbds v0.7.0 or newer."
2+
fail "pokecrystal requires rgbds v0.9.0 or newer."
33
ENDC
4-
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 7
5-
fail "pokecrystal requires rgbds v0.7.0 or newer."
4+
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 9
5+
fail "pokecrystal requires rgbds v0.9.0 or newer."
66
ENDC

tools/unnamed.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ def read_string(file):
9090
elif magic == b'RGB9':
9191
obj_ver = 10 + unpack_from('<I', file)[0]
9292

93-
if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20]:
93+
if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21]:
9494
print(f"Error: File '{objfile}' is of an unknown format.", file=sys.stderr)
9595
sys.exit(1)
9696

9797
num_symbols = unpack_from('<I', file)[0]
9898
unpack_from('<I', file) # skip num sections
9999

100-
if obj_ver in [16, 17, 18, 19, 20]:
100+
if obj_ver in [16, 17, 18, 19, 20, 21]:
101101
node_filenames = []
102102
num_nodes = unpack_from('<I', file)[0]
103103
for x in range(num_nodes):
@@ -117,7 +117,7 @@ def read_string(file):
117117
sym_type = symtype(unpack_from('<B', file)[0] & 0x7f)
118118
if sym_type == symtype.IMPORT:
119119
continue
120-
if obj_ver in [16, 17, 18, 19, 20]:
120+
if obj_ver in [16, 17, 18, 19, 20, 21]:
121121
sym_fileno = unpack_from('<I', file)[0]
122122
sym_filename = node_filenames[sym_fileno]
123123
else:

0 commit comments

Comments
 (0)