Skip to content

Commit

Permalink
Use RGBDS 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Dec 25, 2024
1 parent 13621fa commit 772cba1
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@master
with:
path: rgbds
ref: v0.8.0
ref: v0.9.0
repository: gbdev/rgbds

- name: Install rgbds
Expand Down
6 changes: 3 additions & 3 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel

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

Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.

### "ERROR: Macro not defined"

Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.

### "Expression must be 8-bit"

Download [**rgbds 0.7.0**][rgbds] or newer. Older versions will not work.
Download [**rgbds 0.9.0**][rgbds] or newer. Older versions will not work.

### "Segmentation fault" from `rgbgfx`

Expand Down
22 changes: 11 additions & 11 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Run setup and leave the default settings. At the "**Select Packages**" step, cho

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

Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.7.0**.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.9.0**.

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

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

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

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

Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.7.0**.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.9.0**.

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

Expand All @@ -84,7 +84,7 @@ To install the software required for **pokecrystal**:
sudo apt-get install make gcc git
```

Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.

### OpenSUSE

Expand All @@ -94,7 +94,7 @@ To install the software required for **pokecrystal**:
sudo zypper install make gcc git
```

Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source.

### Arch Linux

Expand All @@ -104,7 +104,7 @@ To install the software required for **pokecrystal**:
sudo pacman -S make gcc git rgbds
```

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

### Termux

Expand All @@ -120,7 +120,7 @@ To install **rgbds**:
pkg install rgbds
```

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

### Other distros

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

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

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

Expand Down Expand Up @@ -159,12 +159,12 @@ make crystal11

### Build with a local rgbds version

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`:
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`:

```bash
make RGBDS=rgbds-0.7.0/
make RGBDS=rgbds-0.9.0/
```

```bash
make RGBDS=rgbds-0.7.0/ crystal11
make RGBDS=rgbds-0.9.0/ crystal11
```
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ $(foreach obj, $(pokecrystal11_vc_obj), $(eval $(call DEP,$(obj),$(obj:11_vc.o=.
endif


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

%.gbc: $$(%_obj) layout.link
$(RGBLINK) -n $*.sym -m $*.map -l layout.link -o $@ $(filter %.o,$^)
Expand Down
3 changes: 1 addition & 2 deletions docs/design_flaws.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ The offset is translated into a correct bank by `FixPicBank` in [engine/gfx/load
FixPicBank:
; This is a thing for some reason.
DEF PICS_FIX EQU $36
GLOBAL PICS_FIX
EXPORT DEF PICS_FIX EQU $36
push hl
push bc
Expand Down
3 changes: 1 addition & 2 deletions engine/battle/battle_transition.asm
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@ INCLUDE "gfx/overworld/trainer_battle_dark.pal"

PokeBallTransition:
; 16x16 overlay of a Poke Ball
pusho
opt b.X ; . = 0, X = 1
pusho b.X ; . = 0, X = 1
bigdw %......XXXX......
bigdw %....XXXXXXXX....
bigdw %..XXXX....XXXX..
Expand Down
3 changes: 1 addition & 2 deletions engine/events/unown_walls.asm
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ DisplayUnownWords:
call CloseWindow
ret

pushc
setcharmap unown
pushc unown

INCLUDE "data/events/unown_walls.asm"

Expand Down
3 changes: 1 addition & 2 deletions engine/gfx/load_pics.asm
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ GetMonBackpic:
FixPicBank:
; This is a thing for some reason.

DEF PICS_FIX EQU $36
EXPORT PICS_FIX
EXPORT DEF PICS_FIX EQU $36

push hl
push bc
Expand Down
3 changes: 1 addition & 2 deletions engine/pokedex/pokedex.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
const DEXSTATE_UPDATE_UNOWN_MODE
const DEXSTATE_EXIT

DEF POKEDEX_SCX EQU 5
EXPORT POKEDEX_SCX
EXPORT DEF POKEDEX_SCX EQU 5

Pokedex:
ldh a, [hWX]
Expand Down
12 changes: 3 additions & 9 deletions macros/code.asm
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,11 @@ MACRO maskbits
; cp 26
; jr nc, .loop
assert 0 < (\1) && (\1) <= $100, "bitmask must be 8-bit"
DEF x = 1
rept 8
if x + 1 < (\1)
DEF x = (x << 1) | 1
endc
endr
DEF x = (1 << BITWIDTH((\1) - 1)) - 1
if _NARG == 2
and x << (\2)
else
and x
DEF x <<= \2
endc
and x
ENDM

MACRO calc_sine_wave
Expand Down
6 changes: 2 additions & 4 deletions mobile/mobile_40.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1698,8 +1698,7 @@ Function100ae7:
ld [wcd2b], a
ret

pushc
setcharmap ascii
pushc ascii

Unknown_100b0a:
db "tetsuji", 0
Expand Down Expand Up @@ -3638,8 +3637,7 @@ Function101826:
ld [wcd2b], a
ret

pushc
setcharmap ascii
pushc ascii

Unknown_10186f:
db .end - @
Expand Down
4 changes: 2 additions & 2 deletions mobile/mobile_45_stadium.asm
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ MobilePassword_IncrementJumptable:
inc [hl]
ret

pushc
setcharmap ascii
pushc ascii

Unknown_117a0f:
db "ABCDEFGHIJKLMNOPQRSTUVWXYZ "
Expand All @@ -489,6 +488,7 @@ Unknown_117a47:
db "!\"#$%&'()*+ "
db ",-./:;<=>?@ "
db "[\\]^_`\{|}~ "

popc

; everything from here to the end of the bank is related to the
Expand Down
21 changes: 7 additions & 14 deletions mobile/mobile_46.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,7 @@ Function118b9a:
and a
ret

pushc
setcharmap ascii
pushc ascii

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

pushc
setcharmap ascii
pushc ascii

Unknown_1196b8:
db "Mon"
Expand Down Expand Up @@ -3524,8 +3522,7 @@ Function119ac9:
ld [wBattleTowerRoomMenuJumptableIndex], a
ret

pushc
setcharmap ascii
pushc ascii

XGameCode:
db "CGB-BXTJ-00", $0
Expand Down Expand Up @@ -3718,8 +3715,7 @@ Function119b6b:
call CopyBytes
jp BattleTowerRoomMenu_IncrementJumptable

pushc
setcharmap ascii
pushc ascii

.decodeBase64Character
cp "+"
Expand Down Expand Up @@ -4000,8 +3996,7 @@ BattleTowerRoomMenu_IncrementJumptable:
inc [hl]
ret

pushc
setcharmap ascii
pushc ascii

XGameCodePrefix:
db "X-Game-code:\n"
Expand Down Expand Up @@ -4038,8 +4033,7 @@ Function119e4f:
.loop2
ld a, [de]
inc de
pushc
setcharmap ascii
pushc ascii
cp "\n"
popc
jr z, .newline
Expand All @@ -4066,8 +4060,7 @@ popc
ld a, [hli]
ld [de], a
inc de
pushc
setcharmap ascii
pushc ascii
cp "\r"
popc
jr z, .finish
Expand Down
6 changes: 3 additions & 3 deletions rgbdscheck.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
fail "pokecrystal requires rgbds v0.7.0 or newer."
fail "pokecrystal requires rgbds v0.9.0 or newer."
ENDC
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 7
fail "pokecrystal requires rgbds v0.7.0 or newer."
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 9
fail "pokecrystal requires rgbds v0.9.0 or newer."
ENDC
6 changes: 3 additions & 3 deletions tools/unnamed.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ def read_string(file):
elif magic == b'RGB9':
obj_ver = 10 + unpack_from('<I', file)[0]

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

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

if obj_ver in [16, 17, 18, 19, 20]:
if obj_ver in [16, 17, 18, 19, 20, 21]:
node_filenames = []
num_nodes = unpack_from('<I', file)[0]
for x in range(num_nodes):
Expand All @@ -117,7 +117,7 @@ def read_string(file):
sym_type = symtype(unpack_from('<B', file)[0] & 0x7f)
if sym_type == symtype.IMPORT:
continue
if obj_ver in [16, 17, 18, 19, 20]:
if obj_ver in [16, 17, 18, 19, 20, 21]:
sym_fileno = unpack_from('<I', file)[0]
sym_filename = node_filenames[sym_fileno]
else:
Expand Down

0 comments on commit 772cba1

Please sign in to comment.