diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 06a9932406a..a2c37587323 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/FAQ.md b/FAQ.md index edac707e67b..269cf7d7cfb 100644 --- a/FAQ.md +++ b/FAQ.md @@ -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` diff --git a/INSTALL.md b/INSTALL.md index d5f189f4230..a10dcb22d2a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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. @@ -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). @@ -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 @@ -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 @@ -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 @@ -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 @@ -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). @@ -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 ``` diff --git a/Makefile b/Makefile index 6b6e1263398..e7d666df297 100644 --- a/Makefile +++ b/Makefile @@ -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,$^) diff --git a/docs/design_flaws.md b/docs/design_flaws.md index e67421271fa..a2c29466197 100644 --- a/docs/design_flaws.md +++ b/docs/design_flaws.md @@ -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 diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index 24e9ccee324..12df05011fa 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -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.. diff --git a/engine/events/unown_walls.asm b/engine/events/unown_walls.asm index cfa624c04d0..5c48756372f 100644 --- a/engine/events/unown_walls.asm +++ b/engine/events/unown_walls.asm @@ -148,8 +148,7 @@ DisplayUnownWords: call CloseWindow ret -pushc -setcharmap unown +pushc unown INCLUDE "data/events/unown_walls.asm" diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm index c4b869783d9..dd52d940766 100644 --- a/engine/gfx/load_pics.asm +++ b/engine/gfx/load_pics.asm @@ -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 diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index e3529e00cf1..b7defc1d18f 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -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] diff --git a/macros/code.asm b/macros/code.asm index 6856b1dcba9..7a10f84db4f 100644 --- a/macros/code.asm +++ b/macros/code.asm @@ -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 diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index 2a5654836e8..da14c6a37a6 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -1698,8 +1698,7 @@ Function100ae7: ld [wcd2b], a ret -pushc -setcharmap ascii +pushc ascii Unknown_100b0a: db "tetsuji", 0 @@ -3638,8 +3637,7 @@ Function101826: ld [wcd2b], a ret -pushc -setcharmap ascii +pushc ascii Unknown_10186f: db .end - @ diff --git a/mobile/mobile_45_stadium.asm b/mobile/mobile_45_stadium.asm index 143a0c38ff1..80870d6702e 100644 --- a/mobile/mobile_45_stadium.asm +++ b/mobile/mobile_45_stadium.asm @@ -477,8 +477,7 @@ MobilePassword_IncrementJumptable: inc [hl] ret -pushc -setcharmap ascii +pushc ascii Unknown_117a0f: db "ABCDEFGHIJKLMNOPQRSTUVWXYZ " @@ -489,6 +488,7 @@ Unknown_117a47: db "!\"#$%&'()*+ " db ",-./:;<=>?@ " db "[\\]^_`\{|}~ " + popc ; everything from here to the end of the bank is related to the diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm index ad44ea82aa7..c83850a8a5a 100644 --- a/mobile/mobile_46.asm +++ b/mobile/mobile_46.asm @@ -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 @@ -2919,8 +2918,7 @@ Function119694: jr nz, .asm_119699 ret -pushc -setcharmap ascii +pushc ascii Unknown_1196b8: db "Mon" @@ -3524,8 +3522,7 @@ Function119ac9: ld [wBattleTowerRoomMenuJumptableIndex], a ret -pushc -setcharmap ascii +pushc ascii XGameCode: db "CGB-BXTJ-00", $0 @@ -3718,8 +3715,7 @@ Function119b6b: call CopyBytes jp BattleTowerRoomMenu_IncrementJumptable -pushc -setcharmap ascii +pushc ascii .decodeBase64Character cp "+" @@ -4000,8 +3996,7 @@ BattleTowerRoomMenu_IncrementJumptable: inc [hl] ret -pushc -setcharmap ascii +pushc ascii XGameCodePrefix: db "X-Game-code:\n" @@ -4038,8 +4033,7 @@ Function119e4f: .loop2 ld a, [de] inc de -pushc -setcharmap ascii +pushc ascii cp "\n" popc jr z, .newline @@ -4066,8 +4060,7 @@ popc ld a, [hli] ld [de], a inc de -pushc -setcharmap ascii +pushc ascii cp "\r" popc jr z, .finish diff --git a/rgbdscheck.asm b/rgbdscheck.asm index 1d37444fe29..166b1d72dcc 100644 --- a/rgbdscheck.asm +++ b/rgbdscheck.asm @@ -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 diff --git a/tools/unnamed.py b/tools/unnamed.py index 626862a4ad5..31b5472bf1b 100755 --- a/tools/unnamed.py +++ b/tools/unnamed.py @@ -90,14 +90,14 @@ def read_string(file): elif magic == b'RGB9': obj_ver = 10 + unpack_from('