diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f2879fab..44317b8b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@master with: path: rgbds - ref: v1.0.1 + ref: v0.6.1 repository: gbdev/rgbds - name: Install rgbds diff --git a/.rgbds-version b/.rgbds-version index 7dea76edb..a918a2aa1 100644 --- a/.rgbds-version +++ b/.rgbds-version @@ -1 +1 @@ -1.0.1 +0.6.0 diff --git a/FAQ.md b/FAQ.md index 950f9eec6..546fae9a0 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 1.0.1**][rgbds] or newer. Older versions will not work. +Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work. ### "ERROR: Macro not defined" -Download [**rgbds 1.0.1**][rgbds] or newer. Older versions will not work. +Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work. ### "Expression must be 8-bit" -Download [**rgbds 1.0.1**][rgbds] or newer. Older versions will not work. +Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work. ### "Segmentation fault" from `rgbgfx` diff --git a/INSTALL.md b/INSTALL.md index b16a1c8ca..0d2daa56b 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 1.0.1**. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.6.1**. -**Note:** If you already have an installed rgbds older than 1.0.1, you will need to update to 1.0.1. Ignore this if you have never installed rgbds before. If a version newer than 1.0.1 does not work, try downloading 1.0.1. +**Note:** If you already have an installed rgbds older than 0.6.0, you will need to update to 0.6.0 or 0.6.1. Ignore this if you have never installed rgbds before. If a version newer than 0.6.1 does not work, try downloading 0.6.1. 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 1.0.1**. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.6.1**. 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 1.0.1** from source. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.6.1** 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 1.0.1** from source. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.6.1** from source. ### Arch Linux @@ -104,9 +104,9 @@ To install the software required for **pokecrystal**: sudo pacman -S make gcc git rgbds ``` -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Arch Linux to install **rgbds 1.0.1**. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Arch Linux to install **rgbds 0.6.1**. -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.1** 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.6.1** from source. ### Termux @@ -122,7 +122,7 @@ To install **rgbds**: sudo apt 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 1.0.1** 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.6.1** from source. ### Other distros @@ -133,7 +133,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 1.0.1** 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.6.1** from source. Now you're ready to [build **pokecrystal**](#build-pokecrystal). @@ -161,12 +161,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 1.0.1 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-1.0.1/`. 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.6.1 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-0.6.1/`. Then specify it when you run `make`: ```bash -make RGBDS=rgbds-1.0.1/ +make RGBDS=rgbds-0.6.1/ ``` ```bash -make RGBDS=rgbds-1.0.1/ crystal11 +make RGBDS=rgbds-0.6.1/ crystal11 ``` diff --git a/audio.asm b/audio.asm index 2e139c615..06d122d68 100644 --- a/audio.asm +++ b/audio.asm @@ -80,7 +80,7 @@ INCLUDE "audio/music/celadoncity.asm" INCLUDE "audio/music/wildpokemonvictory.asm" INCLUDE "audio/music/successfulcapture.asm" -ASSERT BANK(Music_WildPokemonVictory) == BANK(Music_SuccessfulCapture) +assert BANK(Music_WildPokemonVictory) == BANK(Music_SuccessfulCapture) INCLUDE "audio/music/gymleadervictory.asm" INCLUDE "audio/music/mtmoonsquare.asm" @@ -91,7 +91,7 @@ INCLUDE "audio/music/profoak.asm" INCLUDE "audio/music/lookrival.asm" INCLUDE "audio/music/aftertherivalfight.asm" -ASSERT BANK(Music_LookRival) == BANK(Music_AfterTheRivalFight) +assert BANK(Music_LookRival) == BANK(Music_AfterTheRivalFight) INCLUDE "audio/music/surf.asm" INCLUDE "audio/music/nationalpark.asm" @@ -101,7 +101,7 @@ INCLUDE "audio/music/unioncave.asm" INCLUDE "audio/music/johtowildbattle.asm" INCLUDE "audio/music/johtowildbattlenight.asm" -ASSERT BANK(Music_JohtoWildBattle) == BANK(Music_JohtoWildBattleNight) +assert BANK(Music_JohtoWildBattle) == BANK(Music_JohtoWildBattleNight) INCLUDE "audio/music/johtotrainerbattle.asm" INCLUDE "audio/music/lookyoungster.asm" @@ -118,7 +118,7 @@ INCLUDE "audio/music/lookhiker.asm" INCLUDE "audio/music/lookrocket.asm" INCLUDE "audio/music/rockettheme.asm" -ASSERT BANK(Music_LookRocket) == BANK(Music_RocketTheme) +assert BANK(Music_LookRocket) == BANK(Music_RocketTheme) INCLUDE "audio/music/mainmenu.asm" INCLUDE "audio/music/lookkimonogirl.asm" diff --git a/audio/engine.asm b/audio/engine.asm index afdcb3dc2..38e989440 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -427,9 +427,9 @@ UpdateChannels: ; hl << 4 ; each wavepattern is $f bytes long ; so seeking is done in $10s -REPT 4 +rept 4 add hl, hl -ENDR +endr ld de, WaveSamples add hl, de ; load wavepattern into rWave_0-rWave_f diff --git a/audio/sfx.asm b/audio/sfx.asm index 369f8e878..83dd5f6d6 100644 --- a/audio/sfx.asm +++ b/audio/sfx.asm @@ -22,7 +22,7 @@ Sfx_ReadText: Sfx_ReadText2: channel_count 1 channel 5, Sfx_ReadText_Ch5 - ASSERT Sfx_ReadText_Ch5 == Sfx_ReadText2_Ch5 + assert Sfx_ReadText_Ch5 == Sfx_ReadText2_Ch5 Sfx_Poison: channel_count 1 @@ -468,7 +468,7 @@ Sfx_Unknown5F: channel 6, Sfx_Unknown5F_Ch6 Sfx_Sandstorm: channel 8, Sfx_Sandstorm_Ch8 - ASSERT Sfx_Sandstorm_Ch8 == Sfx_Unknown5F_Ch8 + assert Sfx_Sandstorm_Ch8 == Sfx_Unknown5F_Ch8 Sfx_HangUp: channel_count 1 @@ -492,10 +492,10 @@ Sfx_DexFanfare5079: channel 6, Sfx_LevelUp_Ch6 channel 7, Sfx_LevelUp_Ch7 channel 8, Sfx_LevelUp_Ch8 - ASSERT Sfx_LevelUp_Ch5 == Sfx_DexFanfare5079_Ch5 - ASSERT Sfx_LevelUp_Ch6 == Sfx_DexFanfare5079_Ch6 - ASSERT Sfx_LevelUp_Ch7 == Sfx_DexFanfare5079_Ch7 - ASSERT Sfx_LevelUp_Ch8 == Sfx_DexFanfare5079_Ch8 + assert Sfx_LevelUp_Ch5 == Sfx_DexFanfare5079_Ch5 + assert Sfx_LevelUp_Ch6 == Sfx_DexFanfare5079_Ch6 + assert Sfx_LevelUp_Ch7 == Sfx_DexFanfare5079_Ch7 + assert Sfx_LevelUp_Ch8 == Sfx_DexFanfare5079_Ch8 Sfx_LevelUp_Ch5: Sfx_DexFanfare5079_Ch5: diff --git a/build.sh b/build.sh index 7d70ba6d9..3a19ce9a9 100644 --- a/build.sh +++ b/build.sh @@ -1,45 +1,74 @@ #!/bin/bash -set -euo pipefail -# Install necessary tools (idempotent; reruns safely) -sudo apt-get update -y -sudo apt-get install -y \ - bison \ - pkg-config \ - libpng-dev \ - g++ \ - make \ - gcc \ - git \ - curl - -# Get RGBDS v1.0.1 (source tarball via GitHub tarball endpoint) -if [ -d "rgbds-src" ]; then - rm -rf rgbds-src +# Install necessary tools +dpkg -s bison &> /dev/null +if [ $? -eq 0 ]; then + echo "bison is installed!" +else + sudo apt-get install -y bison fi + +dpkg -s pkg-config &> /dev/null +if [ $? -eq 0 ]; then + echo "pkg-config is installed!" +else + sudo apt-get install -y pkg-config +fi + +dpkg -s libpng-dev &> /dev/null +if [ $? -eq 0 ]; then + echo "libpng-dev is installed!" +else + sudo apt-get install -y libpng-dev +fi + +dpkg -s g++ &> /dev/null +if [ $? -eq 0 ]; then + echo "g++ is installed!" +else + sudo apt-get install -y g++ +fi + +dpkg -s make &> /dev/null +if [ $? -eq 0 ]; then + echo "make is installed!" +else + sudo apt-get install -y make +fi + +dpkg -s gcc &> /dev/null +if [ $? -eq 0 ]; then + echo "gcc is installed!" +else + sudo apt-get install -y gcc +fi + +dpkg -s git &> /dev/null +if [ $? -eq 0 ]; then + echo "git is installed!" +else + sudo apt-get install -y git +fi + +# Get RGBDS-0.6.1 if [ -d "rgbds" ]; then - rm -rf rgbds + echo "rgbds already exists! Removing..." + sudo rm -R rgbds fi - -echo "Downloading RGBDS v1.0.1 source..." -curl -L -o rgbds.tar.gz https://github.com/gbdev/rgbds/tarball/v1.0.1 # :contentReference[oaicite:1]{index=1} -mkdir -p rgbds-src -tar -xzf rgbds.tar.gz -C rgbds-src --strip-components=1 -rm rgbds.tar.gz - -echo "Building and installing RGBDS locally..." -pushd rgbds-src +echo "Getting the latest RGBDS compatible version!" +curl -Lo rgbds-0.6.1.tar.gz https://github.com/gbdev/rgbds/releases/download/v0.6.1/rgbds-0.6.1.tar.gz +tar xvfz rgbds-0.6.1.tar.gz +rm rgbds-0.6.1.tar.gz +echo "Building rgbds..." +cd rgbds make clean make -make install PREFIX="$(pwd)/../rgbds" -popd +cd .. -# Build the ROM using the locally-installed tools +# Build the Rom echo "Building pokecrystal..." make clean -make RGBDS="$(pwd)/rgbds/bin/" - +make RGBDS=rgbds/ if [ ! -f "pokecrystal.gbc" ]; then - echo "Build failed: pokecrystal.gbc not produced." - exit 1 + echo "Something goes wrong during the process." fi diff --git a/charmap.asm b/charmap.asm index 4815e9382..b1f6d5b9f 100644 --- a/charmap.asm +++ b/charmap.asm @@ -424,7 +424,7 @@ pushc DEF PRINTABLE_ASCII EQUS " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz\{|}~" for i, STRLEN("{PRINTABLE_ASCII}") charmap STRSUB("{PRINTABLE_ASCII}", i + 1, 1), i + $20 - ENDR + endr charmap "\t", $09 charmap "\n", $0a charmap "\r", $0d diff --git a/constants/battle_anim_constants.asm b/constants/battle_anim_constants.asm index 9baec86ad..919f8d236 100644 --- a/constants/battle_anim_constants.asm +++ b/constants/battle_anim_constants.asm @@ -713,7 +713,7 @@ DEF NUM_BATTLEANIMFRAMESETS EQU const_value const BATTLEANIMOAMSET_D7 DEF NUM_BATTLEANIMOAMSETS EQU const_value -ASSERT NUM_BATTLEANIMOAMSETS <= FIRST_OAM_CMD, \ +assert NUM_BATTLEANIMOAMSETS <= FIRST_OAM_CMD, \ "BATTLEANIMOAMSET_* constants overlap oam*_command constants" ; BattleBGEffects indexes (see engine/battle_anims/bg_effects.asm) diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index 9d4e96ee7..1d6871e68 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -150,7 +150,7 @@ DEF NUM_BATTLE_VARS EQU const_value const ENEMY_COUNTER_MOVE const PLAYER_LAST_MOVE const ENEMY_LAST_MOVE -ASSERT const_value % 2 == 0 +assert const_value % 2 == 0 DEF NUM_BATTLE_VAR_LOCATION_PAIRS EQU const_value / 2 ; status condition bit flags diff --git a/data/default_options.asm b/data/default_options.asm index d535d1004..76de34387 100644 --- a/data/default_options.asm +++ b/data/default_options.asm @@ -15,4 +15,4 @@ DefaultOptions: db $00 db $00 .End - ASSERT DefaultOptions.End - DefaultOptions == wOptionsEnd - wOptions + assert DefaultOptions.End - DefaultOptions == wOptionsEnd - wOptions diff --git a/data/events/odd_eggs.asm b/data/events/odd_eggs.asm index 659f5fb97..c79d29666 100644 --- a/data/events/odd_eggs.asm +++ b/data/events/odd_eggs.asm @@ -31,7 +31,7 @@ DEF prob_total = 0 prob 10 prob 1 assert_table_length NUM_ODD_EGGS - ASSERT prob_total == 100, "OddEggProbabilities do not sum to 100%!" + assert prob_total == 100, "OddEggProbabilities do not sum to 100%!" OddEggs: table_width NICKNAMED_MON_STRUCT_LENGTH, OddEggs diff --git a/data/events/unown_walls.asm b/data/events/unown_walls.asm index ffbbc2baa..6e28b5f1c 100644 --- a/data/events/unown_walls.asm +++ b/data/events/unown_walls.asm @@ -1,18 +1,18 @@ MACRO unownwall for n, CHARLEN(\1) DEF x = CHARSUB(\1, n + 1) - IF x == "-" + if x == "-" db $64 - ELIF x >= "Y" + elif x >= "Y" db 2 * (x - "Y") + $60 - ELIF x >= "Q" + elif x >= "Q" db 2 * (x - "Q") + $40 - ELIF x >= "I" + elif x >= "I" db 2 * (x - "I") + $20 - ELSE + else db 2 * (x - "A") - ENDC - ENDR + endc + endr db -1 ; end ENDM diff --git a/data/growth_rates.asm b/data/growth_rates.asm index fd0018d00..dfbb5ffa5 100644 --- a/data/growth_rates.asm +++ b/data/growth_rates.asm @@ -1,11 +1,11 @@ MACRO growth_rate ; [1]/[2]*n**3 + [3]*n**2 + [4]*n - [5] dn \1, \2 - IF \3 < 0 + if \3 < 0 db -\3 | $80 ; signed magnitude - ELSE + else db \3 - ENDC + endc db \4, \5 ENDM diff --git a/data/maps/attributes.asm b/data/maps/attributes.asm index d2a226b77..2ad2d4cf2 100644 --- a/data/maps/attributes.asm +++ b/data/maps/attributes.asm @@ -25,65 +25,65 @@ MACRO connection ; (x offset for east/west, y offset for north/south) ; LEGACY: Support for old connection macro - IF _NARG == 6 + if _NARG == 6 connection \1, \2, \3, (\4) - (\5) - ELSE + else ; Calculate tile offsets for source (current) and target maps DEF _src = 0 DEF _tgt = (\4) + MAP_CONNECTION_PADDING_WIDTH - IF _tgt < 0 + if _tgt < 0 DEF _src = -_tgt DEF _tgt = 0 - ENDC + endc - IF !STRCMP("\1", "north") + if !STRCMP("\1", "north") DEF _blk = \3_WIDTH * (\3_HEIGHT - MAP_CONNECTION_PADDING_WIDTH) + _src DEF _map = _tgt DEF _win = (\3_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * \3_HEIGHT + 1 DEF _y = \3_HEIGHT * 2 - 1 DEF _x = (\4) * -2 DEF _len = CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH - (\4) - IF _len > \3_WIDTH + if _len > \3_WIDTH DEF _len = \3_WIDTH - ENDC + endc - ELIF !STRCMP("\1", "south") + elif !STRCMP("\1", "south") DEF _blk = _src DEF _map = (CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * (CURRENT_MAP_HEIGHT + MAP_CONNECTION_PADDING_WIDTH) + _tgt DEF _win = \3_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2 + 1 DEF _y = 0 DEF _x = (\4) * -2 DEF _len = CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH - (\4) - IF _len > \3_WIDTH + if _len > \3_WIDTH DEF _len = \3_WIDTH - ENDC + endc - ELIF !STRCMP("\1", "west") + elif !STRCMP("\1", "west") DEF _blk = (\3_WIDTH * _src) + \3_WIDTH - MAP_CONNECTION_PADDING_WIDTH DEF _map = (CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * _tgt DEF _win = (\3_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * 2 - MAP_CONNECTION_PADDING_WIDTH * 2 DEF _y = (\4) * -2 DEF _x = \3_WIDTH * 2 - 1 DEF _len = CURRENT_MAP_HEIGHT + MAP_CONNECTION_PADDING_WIDTH - (\4) - IF _len > \3_HEIGHT + if _len > \3_HEIGHT DEF _len = \3_HEIGHT - ENDC + endc - ELIF !STRCMP("\1", "east") + elif !STRCMP("\1", "east") DEF _blk = (\3_WIDTH * _src) DEF _map = (CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * _tgt + CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH DEF _win = \3_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2 + 1 DEF _y = (\4) * -2 DEF _x = 0 DEF _len = CURRENT_MAP_HEIGHT + MAP_CONNECTION_PADDING_WIDTH - (\4) - IF _len > \3_HEIGHT + if _len > \3_HEIGHT DEF _len = \3_HEIGHT - ENDC + endc - ELSE - FAIL "Invalid direction for 'connection'." - ENDC + else + fail "Invalid direction for 'connection'." + endc map_id \3 dw \2_Blocks + _blk @@ -93,7 +93,7 @@ MACRO connection db _y, _x dw wOverworldMapBlocks + _win - ENDC + endc ENDM diff --git a/data/mobile/postcode_formats.asm b/data/mobile/postcode_formats.asm index d8784e2b9..7df6be000 100644 --- a/data/mobile/postcode_formats.asm +++ b/data/mobile/postcode_formats.asm @@ -1,4 +1,4 @@ -IF DEF(_CRYSTAL_AU) ; AU build +if DEF(_CRYSTAL_AU) ; AU build Zipcode_CharPool_Formats: dw Zipcode_CharPools_Format0 ;________________________________ @@ -15,7 +15,7 @@ Zipcode_CharPools_Format0: ; 0-9 0-9 0-9 0-9 -ELIF DEF(_CRYSTAL_EU) ; EU build +elif DEF(_CRYSTAL_EU) ; EU build Zipcode_CharPool_Formats: dw Zipcode_CharPools_Format0 dw Zipcode_CharPools_Format1 @@ -129,7 +129,7 @@ Zipcode_CharPools_Format15: ; 0-9 0-9 0-9 0-9 0-9 db CHARPOOL_0_TO_9 -ELSE ; US build +else ; US build Zipcode_CharPool_Formats: dw Zipcode_CharPools_Format0 dw Zipcode_CharPools_Format1 @@ -147,4 +147,4 @@ Zipcode_CharPools_Format0: ; 0-9 0-9 0-9 0-9 0-9 db CHARPOOL_0_TO_9 db CHARPOOL_0_TO_9 db CHARPOOL_0_TO_9 -ENDC \ No newline at end of file +endc \ No newline at end of file diff --git a/data/mobile/prefecture_to_country_pairs.asm b/data/mobile/prefecture_to_country_pairs.asm index 20b2c7b56..a71ffe95c 100644 --- a/data/mobile/prefecture_to_country_pairs.asm +++ b/data/mobile/prefecture_to_country_pairs.asm @@ -1,4 +1,4 @@ -IF DEF(_CRYSTAL_AU) ; AU build. +if DEF(_CRYSTAL_AU) ; AU build. PrefectureToCountry: db 0 ; AU-NSW db 0 ; AU-QLD @@ -32,7 +32,7 @@ PrefectureToCountry: -ELIF DEF(_CRYSTAL_EU) ; EU build. +elif DEF(_CRYSTAL_EU) ; EU build. PrefectureToCountry: db 0 ; EU-AD db 1 ; EU-AL @@ -81,7 +81,7 @@ PrefectureToCountry: -ELSE ; US build. +else ; US build. PrefectureToCountry: db 0 ; US-AL db 0 ; US-AK @@ -146,4 +146,4 @@ PrefectureToCountry: db 1 ; CA-NT db 1 ; CA-NU db 1 ; CA-YT -ENDC \ No newline at end of file +endc \ No newline at end of file diff --git a/data/mobile/prefecture_to_postcode_pairs.asm b/data/mobile/prefecture_to_postcode_pairs.asm index 257393961..64438dc89 100644 --- a/data/mobile/prefecture_to_postcode_pairs.asm +++ b/data/mobile/prefecture_to_postcode_pairs.asm @@ -1,4 +1,4 @@ -IF DEF(_CRYSTAL_AU) ; AU build. +if DEF(_CRYSTAL_AU) ; AU build. PrefectureZipcodeFormat: db 0 ; AU-NSW db 0 ; AU-QLD @@ -35,7 +35,7 @@ ZipcodeFormatLengths: -ELIF DEF(_CRYSTAL_EU) ; EU build. +elif DEF(_CRYSTAL_EU) ; EU build. PrefectureZipcodeFormat: db 0 ; EU-AD db 2 ; EU-AL @@ -102,7 +102,7 @@ ZipcodeFormatLengths: -ELSE ; US build. +else ; US build. PrefectureZipcodeFormat: db 0 ; US-AL db 0 ; US-AK @@ -171,4 +171,4 @@ PrefectureZipcodeFormat: ZipcodeFormatLengths: db 5 ; 0: 0-9 0-9 0-9 0-9 0-9 db 7 ; 1: A-Z 0-9 A-Z 0-9 A-Z 0-9 -ENDC \ No newline at end of file +endc \ No newline at end of file diff --git a/data/mobile/prefectures_list.asm b/data/mobile/prefectures_list.asm index cc909ec93..57c71a435 100644 --- a/data/mobile/prefectures_list.asm +++ b/data/mobile/prefectures_list.asm @@ -1,4 +1,4 @@ -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) Prefectures: ; Quick and dirty solution for the margin offset. In this list, strings must be left-aligned. db "AU-ACT@" ; Australian Capital Territory db "AU-NSW@" ; New South Wales @@ -26,7 +26,7 @@ Prefectures: ; Quick and dirty solution for the margin offset. In this list, str db "NZ-WKO@" ; Waikato LastPrefecture: db "NZ-WTC@" ; West Coast -ELIF DEF(_CRYSTAL_EU) +elif DEF(_CRYSTAL_EU) Prefectures: db "EU-AD@" ; Andorra db "EU-AL@" ; Albania @@ -68,7 +68,7 @@ Prefectures: db "EU-SK@" ; Slovakia db "EU-SM@" ; San Marino LastPrefecture: db "EU-UA@" ; Ukraine -ELSE +else Prefectures: db "US-AL@" ;Alabama db "US-AK@" ;Alaska @@ -133,4 +133,4 @@ Prefectures: db "CA-QC@" ; Quebec db "CA-SK@" ; Saskatchewan LastPrefecture: db "CA-YT@" ; Yukon -ENDC \ No newline at end of file +endc \ No newline at end of file diff --git a/data/moves/moves.asm b/data/moves/moves.asm index 29f306494..f2d3c07d4 100644 --- a/data/moves/moves.asm +++ b/data/moves/moves.asm @@ -8,7 +8,7 @@ MACRO move db \5 percent ; accuracy db \6 ; pp db \7 percent ; effect chance - ASSERT \6 <= 40, "PP must be 40 or less" + assert \6 <= 40, "PP must be 40 or less" ENDM Moves: diff --git a/data/moves/tmhm_moves.asm b/data/moves/tmhm_moves.asm index 2de191182..a26276d4f 100644 --- a/data/moves/tmhm_moves.asm +++ b/data/moves/tmhm_moves.asm @@ -8,20 +8,20 @@ TMHMMoves: ; TMs for n, 1, NUM_TMS + 1 db TM{02d:n}_MOVE -ENDR +endr assert_table_length NUM_TMS ; HMs for n, 1, NUM_HMS + 1 db HM{02d:n}_MOVE -ENDR +endr assert_table_length NUM_TMS + NUM_HMS ; Move tutors DEF n = 1 for n, 1, NUM_TUTORS + 1 db MT{02d:n}_MOVE -ENDR +endr assert_table_length NUM_TM_HM_TUTOR db 0 ; end diff --git a/data/party_menu_qualities.asm b/data/party_menu_qualities.asm index 001dc20a3..01141236a 100644 --- a/data/party_menu_qualities.asm +++ b/data/party_menu_qualities.asm @@ -11,10 +11,10 @@ const PARTYMENUQUALITY_MOBILE_SELECTION MACRO partymenuqualities - REPT _NARG + rept _NARG db PARTYMENUQUALITY_\1 shift - ENDR + endr db -1 ; end ENDM diff --git a/data/phone/text/buena.asm b/data/phone/text/buena.asm index 78001d736..72ce8fccb 100644 --- a/data/phone/text/buena.asm +++ b/data/phone/text/buena.asm @@ -469,16 +469,16 @@ BuenaPhoneFavoriteSlotMachineAnswerText: para "CORNER tomorrow." line "It's been a while." -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) para "Some machines pays" line "out a lot." -ELSE +else para "You see, I have my" line "favorite machine…" para "It pays out a lot," line "I kid you not!" -ENDC +endc para "Huh? Nuh-uh, it's" line "my secret!" diff --git a/data/pokemon/base_stats.asm b/data/pokemon/base_stats.asm index b3ec9c01e..093a002ab 100644 --- a/data/pokemon/base_stats.asm +++ b/data/pokemon/base_stats.asm @@ -3,22 +3,22 @@ MACRO tmhm ; initialize bytes to 0 for n, (NUM_TM_HM_TUTOR + 7) / 8 DEF _tm{d:n} = 0 - ENDR + endr ; set bits of bytes - REPT _NARG - IF DEF(\1_TMNUM) + rept _NARG + if DEF(\1_TMNUM) DEF n = (\1_TMNUM - 1) / 8 DEF i = (\1_TMNUM - 1) % 8 DEF _tm{d:n} |= 1 << i - ELSE - FAIL "\1 is not a TM, HM, or tutor move" - ENDC + else + fail "\1 is not a TM, HM, or tutor move" + endc shift - ENDR + endr ; output bytes for n, (NUM_TM_HM_TUTOR + 7) / 8 db _tm{d:n} - ENDR + endr ENDM BaseData:: diff --git a/data/pokemon/unown_words.asm b/data/pokemon/unown_words.asm index ef4f193e9..f6acb4a97 100644 --- a/data/pokemon/unown_words.asm +++ b/data/pokemon/unown_words.asm @@ -1,7 +1,7 @@ MACRO unownword for n, CHARLEN(\1) db CHARSUB(\1, n + 1) - "A" + FIRST_UNOWN_CHAR -ENDR +endr db -1 ENDM diff --git a/data/types/names.asm b/data/types/names.asm index 8ed3f8b5d..2f83ba464 100644 --- a/data/types/names.asm +++ b/data/types/names.asm @@ -14,9 +14,9 @@ TypeNames: dw Steel assert_table_length UNUSED_TYPES -REPT UNUSED_TYPES_END - UNUSED_TYPES - 1 ; discount CURSE_TYPE +rept UNUSED_TYPES_END - UNUSED_TYPES - 1 ; discount CURSE_TYPE dw Normal -ENDR +endr dw CurseType assert_table_length UNUSED_TYPES_END diff --git a/data/wild/roammon_maps.asm b/data/wild/roammon_maps.asm index 7b06aea3b..d473e31ac 100644 --- a/data/wild/roammon_maps.asm +++ b/data/wild/roammon_maps.asm @@ -4,10 +4,10 @@ MACRO roam_map map_id \1 db _NARG - 1 - REPT _NARG - 1 + rept _NARG - 1 map_id \2 shift - ENDR + endr db 0 DEF list_index += 1 ENDM diff --git a/data/wild/unlocked_unowns.asm b/data/wild/unlocked_unowns.asm index 29a78eb0a..4c0d83842 100644 --- a/data/wild/unlocked_unowns.asm +++ b/data/wild/unlocked_unowns.asm @@ -1,8 +1,8 @@ MACRO unown_set -REPT _NARG +rept _NARG db UNOWN_\1 shift -ENDR +endr db -1 ENDM diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm index f46f3e8d2..a003495e4 100644 --- a/engine/battle/ai/scoring.asm +++ b/engine/battle/ai/scoring.asm @@ -1817,9 +1817,9 @@ AI_Smart_FlameWheel: ld a, [wEnemyMonStatus] bit FRZ, a ret z -REPT 5 +rept 5 dec [hl] -ENDR +endr ret AI_Smart_Curse: @@ -3213,9 +3213,9 @@ AI_Risky: jr nc, .nextmove pop hl -REPT 5 +rept 5 dec [hl] -ENDR +endr push hl .nextmove diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index ff31ae4ad..74c5304ee 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -385,9 +385,9 @@ StartTrainerBattle_SpinToBlack: ld e, a ld d, 0 ld hl, .spin_quadrants -REPT 5 +rept 5 add hl, de -ENDR +endr ld a, [hli] cp -1 jr z, .end diff --git a/engine/battle/core.asm b/engine/battle/core.asm index c5a6094db..3be061e70 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -3597,9 +3597,9 @@ NewEnemyMonStatus: ld [wLastEnemyCounterMove], a ld [wLastEnemyMove], a ld hl, wEnemySubStatus1 -REPT 4 +rept 4 ld [hli], a -ENDR +endr ld [hl], a ld [wEnemyDisableCount], a ld [wEnemyFuryCutterCount], a @@ -4078,9 +4078,9 @@ NewBattleMonStatus: ld [wLastEnemyCounterMove], a ld [wLastPlayerMove], a ld hl, wPlayerSubStatus1 -REPT 4 +rept 4 ld [hli], a -ENDR +endr ld [hl], a ld hl, wPlayerUsedMoves ld [hli], a @@ -7784,7 +7784,7 @@ HandleSafariAngerEatingStatus: ; unreferenced .angry dec hl - ASSERT wSafariMonEating - 1 == wSafariMonAngerCount + assert wSafariMonEating - 1 == wSafariMonAngerCount ld a, [hl] and a ret z diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 9001760b1..4051f497b 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -2229,10 +2229,10 @@ GetFailureResultText: ld hl, wCurDamage ld a, [hli] ld b, [hl] -REPT 3 +rept 3 srl a rr b -ENDR +endr ld [hl], b dec hl ld [hli], a @@ -3388,7 +3388,7 @@ DoEnemyDamage: ld [wHPBuffer2 + 1], a sbc b ld [wEnemyMonHP], a -IF DEF(_DEBUG) +if DEF(_DEBUG) push af ld a, BANK(sSkipBattle) call OpenSRAM @@ -3403,9 +3403,9 @@ IF DEF(_DEBUG) push af .debug_skip pop af -ELSE +else jr nc, .no_underflow -ENDC +endc ld a, [wHPBuffer2 + 1] ld [hli], a diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 4f8b23268..d2b252f22 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -250,11 +250,11 @@ BattleAnim_ClearOAM: .loop ld a, [hl] and ~(PALETTE_MASK | VRAM_BANK_1) ; zeros out the palette bits - ASSERT PAL_BATTLE_OB_ENEMY == 0 + assert PAL_BATTLE_OB_ENEMY == 0 ld [hli], a -REPT SPRITEOAMSTRUCT_LENGTH - 1 +rept SPRITEOAMSTRUCT_LENGTH - 1 inc hl -ENDR +endr dec c jr nz, .loop ret @@ -687,9 +687,9 @@ BattleAnimCmd_5GFX: push hl ld l, a ld h, 0 -REPT 4 +rept 4 add hl, hl -ENDR +endr ld de, vTiles0 tile BATTLEANIM_BASE_TILE add hl, de ld a, [wBattleAnimByte] @@ -1234,9 +1234,9 @@ BattleAnimCmd_Cry: ld e, a ld d, 0 ld hl, .CryData -REPT 4 +rept 4 add hl, de -ENDR +endr ldh a, [rSVBK] push af diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm index 34f9c229e..ca22fcf87 100644 --- a/engine/battle_anims/core.asm +++ b/engine/battle_anims/core.asm @@ -31,9 +31,9 @@ InitBattleAnimation: ld e, a ld d, 0 ld hl, BattleAnimObjects -REPT BATTLEANIMOBJ_LENGTH +rept BATTLEANIMOBJ_LENGTH add hl, de -ENDR +endr ld e, l ld d, h ld hl, BATTLEANIMSTRUCT_INDEX diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm index 95f92c761..21b07e2a6 100644 --- a/engine/debug/color_picker.asm +++ b/engine/debug/color_picker.asm @@ -113,13 +113,13 @@ DebugColor_InitTrainerColor: ret DebugColor_InitColor: -REPT 3 +rept 3 ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes) call GetFarByte ld [de], a inc de inc hl -ENDR +endr ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes) call GetFarByte ld [de], a @@ -899,11 +899,11 @@ DebugColor_LoadPalettes_White_Col1_Col2_Black: ld [hli], a ld a, HIGH(PALRGB_WHITE) ld [hli], a -REPT 4 +rept 4 ld a, [de] inc de ld [hli], a -ENDR +endr xor a ld [hli], a ld [hli], a @@ -1135,16 +1135,16 @@ DebugColor_DrawAttributeSwatch: _DebugColor_DrawSwatch: ; Fills a 4x3 box at de with byte a. add hl, de -REPT 4 +rept 4 ld [hli], a -ENDR -REPT 2 +endr +rept 2 ld bc, SCREEN_WIDTH - 4 add hl, bc -REPT 4 +rept 4 ld [hli], a -ENDR -ENDR +endr +endr ret DebugTileset_LoadRGBMeter: diff --git a/engine/debug/debug_room.asm b/engine/debug/debug_room.asm index 2de67862f..245f31d9b 100644 --- a/engine/debug/debug_room.asm +++ b/engine/debug/debug_room.asm @@ -1358,7 +1358,7 @@ DebugRoom_BoxAddresses: table_width 3, DebugRoom_BoxAddresses for n, 1, NUM_BOXES + 1 dba sBox{d:n} -ENDR +endr assert_table_length NUM_BOXES DebugRoomMenu_RTCEdit: diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index d568667c0..7772de34f 100644 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -405,7 +405,7 @@ ValidateBTParty: ; unreferenced for x, $ff, NUM_POKEMON, -1 jr z, .invalid cp x -ENDR +endr jr nz, .valid .invalid @@ -1323,10 +1323,10 @@ BattleTowerAction_EggTicket: ; this adventurous piece of code uses a hardcoded amount of dec hl to reverse the pointer in hl to point to the second-last non-terminator character of String_MysteryJP. ; it then overwrites it and the last character with terminators, in order to prevent this specific odd egg from triggering this check ever again. ; why it was chosen to blank the last two characters specifically is a mystery. -DEF String_MysteryJP_AMOUNT_CHARS equ 3 ; "ODD" -REPT (PLAYER_NAME_LENGTH - ((PLAYER_NAME_LENGTH - String_MysteryJP_AMOUNT_CHARS) + (String_MysteryJP_AMOUNT_CHARS / 2))) +def String_MysteryJP_AMOUNT_CHARS equ 3 ; "ODD" +rept (PLAYER_NAME_LENGTH - ((PLAYER_NAME_LENGTH - String_MysteryJP_AMOUNT_CHARS) + (String_MysteryJP_AMOUNT_CHARS / 2))) dec hl -ENDR +endr ld a, "@" ld [hli], a ld [hli], a diff --git a/engine/events/battle_tower/load_trainer.asm b/engine/events/battle_tower/load_trainer.asm index 7ce0a6900..a558ae1fb 100644 --- a/engine/events/battle_tower/load_trainer.asm +++ b/engine/events/battle_tower/load_trainer.asm @@ -27,15 +27,15 @@ LoadOpponentTrainerAndPokemon: ldh a, [hRandomAdd] add b ld b, a ; b contains the nr of the trainer -IF DEF(_CRYSTAL11) +if DEF(_CRYSTAL11) maskbits BATTLETOWER_NUM_UNIQUE_TRAINERS cp BATTLETOWER_NUM_UNIQUE_TRAINERS -ELSE +else ; BUG: Crystal 1.0 used the wrong constant here, so only the first ; 21 trainers in BattleTowerTrainers can be sampled. maskbits BATTLETOWER_NUM_UNIQUE_MON cp BATTLETOWER_NUM_UNIQUE_MON -ENDC +endc jr nc, .resample ld b, a diff --git a/engine/events/buena.asm b/engine/events/buena.asm index a83b65713..91f73ca72 100644 --- a/engine/events/buena.asm +++ b/engine/events/buena.asm @@ -45,7 +45,7 @@ BuenasPassword: db NUM_PASSWORDS_PER_CATEGORY for x, NUM_PASSWORDS_PER_CATEGORY db x -ENDR +endr db -1 .PlacePasswordChoices: @@ -264,7 +264,7 @@ Buena_PrizeMenu: db NUM_BUENA_PRIZES for x, NUM_BUENA_PRIZES db x + 1 -ENDR +endr db -1 .PrintPrizeItem: diff --git a/engine/events/bug_contest/judging.asm b/engine/events/bug_contest/judging.asm index 690bba9be..3b4e9f1c6 100644 --- a/engine/events/bug_contest/judging.asm +++ b/engine/events/bug_contest/judging.asm @@ -68,7 +68,7 @@ ContestJudging_ThirdPlaceScoreText: LoadContestantName: ; If a = 1, get your name. - ASSERT BUG_CONTEST_PLAYER == 1 + assert BUG_CONTEST_PLAYER == 1 dec a jr z, .player ; Find the pointer for the trainer class of the Bug Catching Contestant whose ID is in a. @@ -212,11 +212,11 @@ DetermineContestWinners: CopyTempContestant: ; Could've just called CopyBytes. ld de, wBugContestTempWinnerID -REPT BUG_CONTESTANT_SIZE - 1 +rept BUG_CONTESTANT_SIZE - 1 ld a, [de] inc de ld [hli], a -ENDR +endr ld a, [de] inc de ld [hl], a diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm index e430d1de1..6e50fadd5 100644 --- a/engine/events/celebi.asm +++ b/engine/events/celebi.asm @@ -60,9 +60,9 @@ CelebiShrineEvent: ld c, 4 .OAMloop: ld [hli], a ; tile id -REPT SPRITEOAMSTRUCT_LENGTH - 1 +rept SPRITEOAMSTRUCT_LENGTH - 1 inc hl -ENDR +endr inc a dec c jr nz, .OAMloop diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm index 97968ac99..001122fb9 100644 --- a/engine/events/elevator.asm +++ b/engine/events/elevator.asm @@ -38,7 +38,7 @@ Elevator:: inc hl ld [de], a inc de - ASSERT wCurElevatorCount + 1 == wCurElevatorFloors + assert wCurElevatorCount + 1 == wCurElevatorFloors .loop ld a, [wElevatorPointerBank] call GetFarByte diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index ad0bd4d13..6e94f1693 100644 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -374,9 +374,9 @@ FlyToAnim: ld c, 4 .OAMloop ld [hli], a ; tile id -REPT SPRITEOAMSTRUCT_LENGTH - 1 +rept SPRITEOAMSTRUCT_LENGTH - 1 inc hl -ENDR +endr inc a dec c jr nz, .OAMloop diff --git a/engine/events/fish.asm b/engine/events/fish.asm index e6744d985..df8d80a63 100644 --- a/engine/events/fish.asm +++ b/engine/events/fish.asm @@ -11,9 +11,9 @@ Fish: call GetFishGroupIndex ld hl, FishGroups -REPT FISHGROUP_DATA_LENGTH +rept FISHGROUP_DATA_LENGTH add hl, de -ENDR +endr call .Fish pop hl @@ -73,9 +73,9 @@ ENDR ld e, [hl] ld d, 0 ld hl, TimeFishGroups -REPT 4 +rept 4 add hl, de -ENDR +endr ld a, [wTimeOfDay] maskbits NUM_DAYTIMES diff --git a/engine/events/fruit_trees.asm b/engine/events/fruit_trees.asm index 188575afb..ea0d0f4d8 100644 --- a/engine/events/fruit_trees.asm +++ b/engine/events/fruit_trees.asm @@ -61,9 +61,9 @@ PickedFruitTree: ResetFruitTrees: xor a ld hl, wFruitTreeFlags -REPT (NUM_FRUIT_TREES + 7) / 8 - 1 +rept (NUM_FRUIT_TREES + 7) / 8 - 1 ld [hli], a -ENDR +endr ld [hl], a ld hl, wDailyFlags1 set DAILYFLAGS1_ALL_FRUIT_TREES_F, [hl] diff --git a/engine/events/heal_machine_anim.asm b/engine/events/heal_machine_anim.asm index a6345145d..a6f049646 100644 --- a/engine/events/heal_machine_anim.asm +++ b/engine/events/heal_machine_anim.asm @@ -60,10 +60,10 @@ HealMachineAnim: dw .HallOfFame MACRO healmachineanimseq - REPT _NARG + rept _NARG db HEALMACHINESTATE_\1 shift - ENDR + endr ENDM .Pokecenter: diff --git a/engine/events/lucky_number.asm b/engine/events/lucky_number.asm index a6dbf40b7..375b817b8 100644 --- a/engine/events/lucky_number.asm +++ b/engine/events/lucky_number.asm @@ -195,7 +195,7 @@ CheckForLuckyNumberWinners: table_width 3, CheckForLuckyNumberWinners.BoxBankAddresses for n, 1, NUM_BOXES + 1 dba sBox{d:n} -ENDR +endr assert_table_length NUM_BOXES .LuckyNumberMatchPartyText: diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm index 0b04f981c..c8408ba23 100644 --- a/engine/events/mom_phone.asm +++ b/engine/events/mom_phone.asm @@ -196,9 +196,9 @@ GetItemFromMom: .GetFromList1: ld l, a ld h, 0 -REPT 3 ; multiply hl by 8 +rept 3 ; multiply hl by 8 add hl, hl -ENDR +endr add hl, de ret diff --git a/engine/events/print_unown.asm b/engine/events/print_unown.asm index ac609455a..d9b99e807 100644 --- a/engine/events/print_unown.asm +++ b/engine/events/print_unown.asm @@ -75,11 +75,11 @@ _UnownPrinter: ldh a, [hJoyPressed] vc_patch Forbid_printing_Unown -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) and NO_INPUT -ELSE +else and A_BUTTON -ENDC +endc vc_patch_end jr nz, .pressed_a diff --git a/engine/events/print_unown_2.asm b/engine/events/print_unown_2.asm index 2db74fff3..aae80b11c 100644 --- a/engine/events/print_unown_2.asm +++ b/engine/events/print_unown_2.asm @@ -99,5 +99,5 @@ UnownPrinter_GBPrinterRectangle: for y, 7 for x, 7 - 1, -1, -1 dw wGameboyPrinter2bppSource tile (x * 7 + y) -ENDR -ENDR +endr +endr diff --git a/engine/events/prof_oaks_pc.asm b/engine/events/prof_oaks_pc.asm index a26a9bc12..b272e3fb5 100644 --- a/engine/events/prof_oaks_pc.asm +++ b/engine/events/prof_oaks_pc.asm @@ -83,9 +83,9 @@ FindOakRating: ld a, [hli] cp c jr nc, .match -REPT 4 +rept 4 inc hl -ENDR +endr jr .loop .match diff --git a/engine/games/card_flip.asm b/engine/games/card_flip.asm index d7b596fbe..3109454b6 100644 --- a/engine/games/card_flip.asm +++ b/engine/games/card_flip.asm @@ -2,7 +2,7 @@ DEF CARDFLIP_LIGHT_OFF EQU "♂" ; $ef DEF CARDFLIP_LIGHT_ON EQU "♀" ; $f5 DEF CARDFLIP_DECK_SIZE EQUS "(wDeckEnd - wDeck)" - ASSERT wDiscardPileEnd - wDiscardPile == wDeckEnd - wDeck + assert wDiscardPileEnd - wDiscardPile == wDeckEnd - wDeck MemoryGameGFX: ; Graphics for an unused Game Corner @@ -1338,13 +1338,13 @@ CardFlip_UpdateCursorOAM: .OAMData: MACRO cardflip_cursor - IF _NARG >= 5 + if _NARG >= 5 dbpixel \1, \2, \3, \4 dw \5 - ELSE + else dbpixel \1, \2 dw \3 - ENDC + endc ENDM cardflip_cursor 11, 2, .Impossible diff --git a/engine/games/memory_game.asm b/engine/games/memory_game.asm index e0f21bc9b..8be4e51c4 100644 --- a/engine/games/memory_game.asm +++ b/engine/games/memory_game.asm @@ -90,9 +90,9 @@ _MemoryGame: xor a ld [wMemoryGameCounter], a ld hl, wMemoryGameLastMatches -REPT 4 +rept 4 ld [hli], a -ENDR +endr ld [hl], a ld [wMemoryGameNumCardsMatched], a .InitBoardTilemapAndCursorObject: diff --git a/engine/games/slot_machine.asm b/engine/games/slot_machine.asm index eb94f604c..3a42172b9 100644 --- a/engine/games/slot_machine.asm +++ b/engine/games/slot_machine.asm @@ -266,9 +266,9 @@ AnimateSlotReelIcons: ; unreferenced ld a, [hl] xor $20 ; alternate between $00-$1f and $20-$3f ld [hli], a ; tile id -REPT SPRITEOAMSTRUCT_LENGTH - 1 +rept SPRITEOAMSTRUCT_LENGTH - 1 inc hl -ENDR +endr dec c jr nz, .loop ret @@ -1916,9 +1916,9 @@ Slots_PayoutText: hlcoord 18, 17 ld [hl], "▼" ld hl, .SlotsLinedUpText -REPT 4 +rept 4 inc bc -ENDR +endr ret .SlotsLinedUpText: diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm index 815d9949b..5d422a81f 100644 --- a/engine/games/unown_puzzle.asm +++ b/engine/games/unown_puzzle.asm @@ -113,10 +113,10 @@ InitUnownPuzzlePiecePositions: .PuzzlePieceInitialPositions: MACRO initpuzcoord - REPT _NARG / 2 + rept _NARG / 2 db \1 puzcoord \2 shift 2 - ENDR + endr ENDM initpuzcoord 0,0, 0,1, 0,2, 0,3, 0,4, 0,5 initpuzcoord 1,0, 1,5 @@ -440,9 +440,9 @@ GetUnownPuzzleCoordData: add hl, de ld a, [wUnownPuzzleCursorPosition] ld e, a -REPT 6 +rept 6 add hl, de -ENDR +endr ret UnownPuzzle_CheckCurrentTileOccupancy: @@ -723,7 +723,7 @@ ConvertLoadedPuzzlePieces: .EnlargedTiles: for x, 16 db ((x & %1000) * %11000) + ((x & %0100) * %1100) + ((x & %0010) * %110) + ((x & %0001) * %11) -ENDR +endr UnownPuzzle_AddPuzzlePieceBorders: ld hl, PuzzlePieceBorderData @@ -740,9 +740,9 @@ UnownPuzzle_AddPuzzlePieceBorders: ld l, a call .LoadGFX pop hl -REPT 4 +rept 4 inc hl -ENDR +endr pop af dec a jr nz, .loop diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index 7d7fbdd23..2ae8b0335 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -778,9 +778,9 @@ GetMonNormalOrShinyPalettePointer: call CheckShininess pop hl ret nc -REPT 4 +rept 4 inc hl -ENDR +endr ret PushSGBPals: @@ -1005,9 +1005,9 @@ PushSGBBorderPalsAndWait: call SGBDelayCycles ld a, $10 ldh [rJOYP], a -REPT 6 +rept 6 ldh a, [rJOYP] -ENDR +endr call SGBDelayCycles call SGBDelayCycles ld a, $30 @@ -1283,9 +1283,9 @@ LoadMapPals: maskbits NUM_DAYTIMES cp NITE_F jr c, .morn_day -REPT 4 +rept 4 inc hl -ENDR +endr .morn_day ld de, wBGPals1 palette PAL_BG_ROOF color 1 ld bc, 4 diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm index 0061fef98..c4b869783 100644 --- a/engine/gfx/load_pics.asm +++ b/engine/gfx/load_pics.asm @@ -114,7 +114,7 @@ GetFrontpicPointer: ld d, BANK(UnownPicPointers) .ok ; These are assumed to be at the same address in their respective banks. - ASSERT PokemonPicPointers == UnownPicPointers + assert PokemonPicPointers == UnownPicPointers ld hl, PokemonPicPointers dec a ld bc, 6 @@ -208,7 +208,7 @@ GetMonBackpic: push de ; These are assumed to be at the same address in their respective banks. - ASSERT PokemonPicPointers == UnownPicPointers + assert PokemonPicPointers == UnownPicPointers ld hl, PokemonPicPointers ld a, b ld d, BANK(PokemonPicPointers) @@ -480,10 +480,10 @@ LoadOrientedFrontpic: inc de ld b, a xor a -REPT 8 +rept 8 rr b rla -ENDR +endr ld [hli], a dec c jr nz, .right_loop diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index 118deda92..775dcaab9 100644 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -315,9 +315,9 @@ GetIcon: ; Load icon graphics into VRAM starting from tile hl. ; One tile is 16 bytes long. -REPT 4 +rept 4 add hl, hl -ENDR +endr ld de, vTiles0 add hl, de diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm index 2d8f2b529..ba8e90fcb 100644 --- a/engine/gfx/pic_animation.asm +++ b/engine/gfx/pic_animation.asm @@ -47,10 +47,10 @@ AnimateMon_HOF: ret MACRO pokeanim - REPT _NARG + rept _NARG db (PokeAnim_\1_SetupCommand - PokeAnim_SetupCommands) / 2 shift - ENDR + endr db (PokeAnim_Finish_SetupCommand - PokeAnim_SetupCommands) / 2 ENDM @@ -537,8 +537,8 @@ MACRO poke_anim_box for y, 1, \1 + 1 for x, 7 - \1, 7 db y * 7 + x - ENDR - ENDR + endr + endr ENDM PokeAnim_ConvertAndApplyBitmask: diff --git a/engine/gfx/sgb_layouts.asm b/engine/gfx/sgb_layouts.asm index f48fefa1d..69615a616 100644 --- a/engine/gfx/sgb_layouts.asm +++ b/engine/gfx/sgb_layouts.asm @@ -299,9 +299,9 @@ SGBLayoutJumptable: .SGB_GSIntro: ld b, 0 ld hl, .BlkPacketTable_GSIntro -REPT 4 +rept 4 add hl, bc -ENDR +endr ld e, [hl] inc hl ld d, [hl] diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index cd35db21f..d04851e60 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -809,10 +809,10 @@ HeavyBallMultiplier: ld b, h ld c, l -REPT 4 +rept 4 srl b rr c -ENDR +endr call .subbc srl b @@ -2403,9 +2403,9 @@ BattleRestorePP: push hl push de push bc -REPT NUM_MOVES + 2 ; wBattleMonPP - wBattleMonMoves +rept NUM_MOVES + 2 ; wBattleMonPP - wBattleMonMoves inc de -ENDR +endr ld bc, MON_PP - MON_MOVES add hl, bc ld a, [hl] diff --git a/engine/items/mart.asm b/engine/items/mart.asm index 12d4c6a6f..8149fd709 100644 --- a/engine/items/mart.asm +++ b/engine/items/mart.asm @@ -102,7 +102,7 @@ LoadMartPointer: ld a, d ld [wMartPointer + 1], a ld hl, wCurMartCount - ASSERT wCurMartCount + 1 == wCurMartItems + assert wCurMartCount + 1 == wCurMartItems xor a ld bc, 16 call ByteFill diff --git a/engine/link/link.asm b/engine/link/link.asm index 4c4b620c4..6c4e725fd 100644 --- a/engine/link/link.asm +++ b/engine/link/link.asm @@ -28,7 +28,7 @@ LinkCommunications: call SetTradeRoomBGPals call WaitBGMap2 ld hl, wLinkByteTimeout - ASSERT LOW(SERIAL_LINK_BYTE_TIMEOUT) == 0 + assert LOW(SERIAL_LINK_BYTE_TIMEOUT) == 0 xor a ; LOW(SERIAL_LINK_BYTE_TIMEOUT) ld [hli], a ld [hl], HIGH(SERIAL_LINK_BYTE_TIMEOUT) @@ -68,11 +68,11 @@ Gen2ToGen1LinkComms: ld de, MUSIC_NONE call PlayMusic vc_patch Wireless_net_delay_5 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld c, 26 -ELSE +else ld c, 3 -ENDC +endc vc_patch_end call DelayFrames xor a @@ -234,11 +234,11 @@ Gen2ToGen2LinkComms: ld de, MUSIC_NONE call PlayMusic vc_patch Wireless_net_delay_8 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld c, 26 -ELSE +else ld c, 3 -ENDC +endc vc_patch_end call DelayFrames xor a @@ -621,7 +621,7 @@ FixDataForLinkTransfer: jr nz, .preamble_loop ; Initialize random seed, making sure special bytes are omitted - ASSERT wLinkBattleRNPreamble + SERIAL_RN_PREAMBLE_LENGTH == wLinkBattleRNs + assert wLinkBattleRNPreamble + SERIAL_RN_PREAMBLE_LENGTH == wLinkBattleRNs ld b, SERIAL_RNS_LENGTH .rn_loop call Random @@ -634,9 +634,9 @@ FixDataForLinkTransfer: ; Clear the patch list ld hl, wPlayerPatchLists ld a, SERIAL_PREAMBLE_BYTE -REPT SERIAL_PATCH_PREAMBLE_LENGTH +rept SERIAL_PATCH_PREAMBLE_LENGTH ld [hli], a -ENDR +endr ld b, SERIAL_PATCH_LIST_LENGTH xor a .clear_loop @@ -2199,11 +2199,11 @@ GetIncompatibleMonName: EnterTimeCapsule: vc_patch Wireless_net_delay_6 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld c, 26 -ELSE +else ld c, 10 -ENDC +endc vc_patch_end call DelayFrames ld a, $4 @@ -2428,11 +2428,11 @@ CheckLinkTimeout_Gen2: ld [wPlayerLinkAction], a ld hl, wLinkTimeoutFrames vc_patch Wireless_net_delay_9 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld a, $3 -ELSE +else ld a, 1 -ENDC +endc vc_patch_end ld [hli], a ld [hl], 50 @@ -2495,11 +2495,11 @@ Link_CheckCommunicationError: .AcknowledgeSerial: vc_patch Wireless_net_delay_7 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld b, 26 -ELSE +else ld b, 10 -ENDC +endc vc_patch_end .loop call DelayFrame diff --git a/engine/link/mystery_gift.asm b/engine/link/mystery_gift.asm index d58f29503..a92b712cd 100644 --- a/engine/link/mystery_gift.asm +++ b/engine/link/mystery_gift.asm @@ -38,16 +38,16 @@ DoMysteryGift: farcall StageDataForMysteryGift call ClearMysteryGiftTrainer vc_patch Infrared_stage_party_data -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) farcall StagePartyDataForMysteryGift call ClearMysteryGiftTrainer nop -ELSE +else ld a, 2 ld [wMysteryGiftMessageCount], a ld a, wMysteryGiftPartnerDataEnd - wMysteryGiftPartnerData ld [wMysteryGiftStagedDataLength], a -ENDC +endc vc_patch_end ldh a, [rIE] @@ -258,11 +258,11 @@ ENDC ld de, sMysteryGiftPartnerName ld bc, NAME_LENGTH call CopyBytes - ASSERT sMysteryGiftPartnerName + NAME_LENGTH == sMysteryGiftUnusedFlag + assert sMysteryGiftPartnerName + NAME_LENGTH == sMysteryGiftUnusedFlag ld a, TRUE ld [de], a inc de - ASSERT sMysteryGiftUnusedFlag + 1 == sMysteryGiftTrainer + assert sMysteryGiftUnusedFlag + 1 == sMysteryGiftTrainer ld hl, wMysteryGiftTrainer ld bc, wMysteryGiftTrainerEnd - wMysteryGiftTrainer call CopyBytes @@ -271,7 +271,7 @@ ENDC ExchangeMysteryGiftData: vc_hook Infrared_ExchangeMysteryGiftData_start vc_patch Infrared_ExchangeMysteryGiftData_function -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld d, $ef .loop dec d @@ -288,7 +288,7 @@ IF DEF(_CRYSTAL11_VC) cp MG_OKAY jr nz, ExchangeMysteryGiftData ret -ELSE +else di farcall ClearChannels call InitializeIRCommunicationInterrupts @@ -297,7 +297,7 @@ ELSE call BeginIRCommunication call InitializeIRCommunicationRoles ldh a, [hMGStatusFlags] -ENDC +endc vc_patch_end cp MG_CANCELED jp z, EndOrContinueMysteryGiftIRCommunication @@ -1279,9 +1279,9 @@ MysteryGift_UpdateJoypad: ld a, R_BUTTONS ldh [rJOYP], a ; Wait for input to stabilize. -REPT 6 +rept 6 ldh a, [rJOYP] -ENDR +endr ; Buttons take the lo nybble. cpl and $f @@ -1356,7 +1356,7 @@ UnlockMysteryGift: inc a jr nz, .ok ld [hld], a - ASSERT sMysteryGiftUnlocked - 1 == sMysteryGiftItem + assert sMysteryGiftUnlocked - 1 == sMysteryGiftItem ld [hl], a .ok jp CloseSRAM @@ -1380,8 +1380,8 @@ BackupMysteryGift: ld a, [hli] ld [de], a inc de - ASSERT sMysteryGiftItem + 1 == sMysteryGiftUnlocked - ASSERT sBackupMysteryGiftItem + 1 == sNumDailyMysteryGiftPartnerIDs + assert sMysteryGiftItem + 1 == sMysteryGiftUnlocked + assert sBackupMysteryGiftItem + 1 == sNumDailyMysteryGiftPartnerIDs ld a, [hl] ld [de], a jp CloseSRAM @@ -1395,8 +1395,8 @@ RestoreMysteryGift: ld a, [hli] ld [de], a inc de - ASSERT sBackupMysteryGiftItem + 1 == sNumDailyMysteryGiftPartnerIDs - ASSERT sMysteryGiftItem + 1 == sMysteryGiftUnlocked + assert sBackupMysteryGiftItem + 1 == sNumDailyMysteryGiftPartnerIDs + assert sMysteryGiftItem + 1 == sMysteryGiftUnlocked ld a, [hl] ld [de], a jp CloseSRAM @@ -1653,18 +1653,18 @@ DoNameCardSwap: ld b, 8 .dec_y_loop dec [hl] -REPT SPRITEOAMSTRUCT_LENGTH +rept SPRITEOAMSTRUCT_LENGTH inc hl -ENDR +endr dec b jr nz, .dec_y_loop ld hl, wShadowOAMSprite08YCoord ld b, 8 .inc_y_loop inc [hl] -REPT SPRITEOAMSTRUCT_LENGTH +rept SPRITEOAMSTRUCT_LENGTH inc hl -ENDR +endr dec b jr nz, .inc_y_loop dec c diff --git a/engine/math/get_square_root.asm b/engine/math/get_square_root.asm index 5cf34f19b..5a4dd3f82 100644 --- a/engine/math/get_square_root.asm +++ b/engine/math/get_square_root.asm @@ -27,4 +27,4 @@ GetSquareRoot: .Squares: for x, 1, NUM_SQUARE_ROOTS + 1 dw x**2 -ENDR +endr diff --git a/engine/menus/empty_sram.asm b/engine/menus/empty_sram.asm index 6b3fe9851..3c060d806 100644 --- a/engine/menus/empty_sram.asm +++ b/engine/menus/empty_sram.asm @@ -2,7 +2,7 @@ EmptyAllSRAMBanks: for x, NUM_SRAM_BANKS ld a, x call .EmptyBank -ENDR +endr ret .EmptyBank: diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm index cf83b00a5..9434e4b86 100644 --- a/engine/menus/intro_menu.asm +++ b/engine/menus/intro_menu.asm @@ -103,11 +103,11 @@ InitSRAMZipcode: call CloseSRAM ret -IF DEF(_DEBUG) +if DEF(_DEBUG) DebugRoom: ; unreferenced farcall _DebugRoom ret -ENDC +endc ResetWRAM: xor a @@ -193,7 +193,7 @@ _ResetWRAM: ld hl, sMysteryGiftItem xor a ld [hli], a - ASSERT sMysteryGiftItem + 1 == sMysteryGiftUnlocked + assert sMysteryGiftItem + 1 == sMysteryGiftUnlocked dec a ; -1 ld [hl], a call CloseSRAM @@ -210,9 +210,9 @@ _ResetWRAM: ld [wCoins], a ld [wCoins + 1], a -IF START_MONEY >= $10000 +if START_MONEY >= $10000 ld a, HIGH(START_MONEY >> 8) -ENDC +endc ld [wMoney], a ld a, HIGH(START_MONEY) ; mid ld [wMoney + 1], a @@ -623,11 +623,11 @@ Continue_DisplayPokedexNumCaught: ret z push hl ld hl, wPokedexCaught -IF NUM_POKEMON % 8 +if NUM_POKEMON % 8 ld b, NUM_POKEMON / 8 + 1 -ELSE +else ld b, NUM_POKEMON / 8 -ENDC +endc call CountSetBits pop hl ld de, wNumSetBits @@ -1315,14 +1315,14 @@ UpdateTitleTrailSprite: ; unreferenced .TitleTrailCoords: MACRO trail_coords - REPT _NARG / 2 + rept _NARG / 2 DEF _dx = 4 - IF \1 == 0 && \2 == 0 + if \1 == 0 && \2 == 0 DEF _dx = 0 - ENDC + endc dbpixel \1, \2, _dx, 0 shift 2 - ENDR + endr ENDM ; frame 0 y, x; frame 1 y, x trail_coords 11, 10, 0, 0 diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 029afba86..b6ab7dd12 100644 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -71,9 +71,9 @@ MainMenu: db "MYSTERY GIFT@" db "MOBILE@" db "MOBILE STADIUM@" -IF DEF(_DEBUG) +if DEF(_DEBUG) db "DEBUG ROOM@" -ENDC +endc .Jumptable: ; entries correspond to MAINMENUITEM_* constants @@ -83,9 +83,9 @@ ENDC dw MainMenu_MysteryGift dw MainMenu_Mobile dw MainMenu_MobileStudium -IF DEF(_DEBUG) +if DEF(_DEBUG) dw MainMenu_DebugRoom -ENDC +endc MainMenuItems: ; entries correspond to MAINMENU_* constants @@ -101,9 +101,9 @@ MainMenuItems: db MAINMENUITEM_CONTINUE db MAINMENUITEM_NEW_GAME db MAINMENUITEM_OPTION -IF DEF(_DEBUG) +if DEF(_DEBUG) db MAINMENUITEM_DEBUG_ROOM -ENDC +endc db -1 ; MAINMENU_MOBILE_MYSTERY @@ -113,9 +113,9 @@ ENDC db MAINMENUITEM_OPTION db MAINMENUITEM_MYSTERY_GIFT db MAINMENUITEM_MOBILE -IF DEF(_DEBUG) +if DEF(_DEBUG) db MAINMENUITEM_DEBUG_ROOM -ENDC +endc db -1 ; MAINMENU_MOBILE @@ -124,9 +124,9 @@ ENDC db MAINMENUITEM_NEW_GAME db MAINMENUITEM_OPTION db MAINMENUITEM_MOBILE -IF DEF(_DEBUG) +if DEF(_DEBUG) db MAINMENUITEM_DEBUG_ROOM -ENDC +endc db -1 ; MAINMENU_MOBILE_STUDIUM @@ -136,9 +136,9 @@ ENDC db MAINMENUITEM_OPTION db MAINMENUITEM_MOBILE db MAINMENUITEM_MOBILE_STUDIUM -IF DEF(_DEBUG) +if DEF(_DEBUG) db MAINMENUITEM_DEBUG_ROOM -ENDC +endc db -1 ; MAINMENU_MYSTERY_MOBILE_STUDIUM @@ -149,9 +149,9 @@ ENDC db MAINMENUITEM_MYSTERY_GIFT db MAINMENUITEM_MOBILE db MAINMENUITEM_MOBILE_STUDIUM -IF DEF(_DEBUG) +if DEF(_DEBUG) db MAINMENUITEM_DEBUG_ROOM -ENDC +endc db -1 ; MAINMENU_MYSTERY @@ -160,9 +160,9 @@ ENDC db MAINMENUITEM_NEW_GAME db MAINMENUITEM_OPTION db MAINMENUITEM_MYSTERY_GIFT -IF DEF(_DEBUG) +if DEF(_DEBUG) db MAINMENUITEM_DEBUG_ROOM -ENDC +endc db -1 ; MAINMENU_MYSTERY_STUDIUM @@ -172,9 +172,9 @@ ENDC db MAINMENUITEM_OPTION db MAINMENUITEM_MYSTERY_GIFT db MAINMENUITEM_MOBILE_STUDIUM -IF DEF(_DEBUG) +if DEF(_DEBUG) db MAINMENUITEM_DEBUG_ROOM -ENDC +endc db -1 ; MAINMENU_STUDIUM @@ -183,9 +183,9 @@ ENDC db MAINMENUITEM_NEW_GAME db MAINMENUITEM_OPTION db MAINMENUITEM_MOBILE_STUDIUM -IF DEF(_DEBUG) +if DEF(_DEBUG) db MAINMENUITEM_DEBUG_ROOM -ENDC +endc db -1 MainMenu_GetWhichMenu: diff --git a/engine/menus/menu_2.asm b/engine/menus/menu_2.asm index 7db6e83cd..e229f3609 100644 --- a/engine/menus/menu_2.asm +++ b/engine/menus/menu_2.asm @@ -209,7 +209,7 @@ FindApricornsInBag: ld hl, wKurtApricornCount xor a ld [hli], a - ASSERT wKurtApricornCount + 1 == wKurtApricornItems + assert wKurtApricornCount + 1 == wKurtApricornItems dec a ld bc, 10 call ByteFill diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index b8fe52a98..6645d79f2 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -275,7 +275,7 @@ NamingScreen_InitText: NamingScreen_ApplyTextInputMode: call NamingScreen_IsTargetBox jr nz, .not_box - ASSERT BoxNameInputLower - NameInputLower == BoxNameInputUpper - NameInputUpper + assert BoxNameInputLower - NameInputLower == BoxNameInputUpper - NameInputUpper ld hl, BoxNameInputLower - NameInputLower add hl, de ld d, h diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 694dd8cbe..62501cb75 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -916,9 +916,9 @@ GetBoxAddress: ld e, a ld d, 0 ld hl, BoxAddresses -REPT 5 +rept 5 add hl, de -ENDR +endr ld a, [hli] push af ld a, [hli] @@ -1115,7 +1115,7 @@ BoxAddresses: for n, 1, NUM_BOXES + 1 db BANK(sBox{d:n}) ; aka BANK(sBox{d:n}End) dw sBox{d:n}, sBox{d:n}End -ENDR +endr assert_table_length NUM_BOXES Checksum: diff --git a/engine/menus/savemenu_copytilemapatonce.asm b/engine/menus/savemenu_copytilemapatonce.asm index 01a7c0aa2..2f30b7c7e 100644 --- a/engine/menus/savemenu_copytilemapatonce.asm +++ b/engine/menus/savemenu_copytilemapatonce.asm @@ -55,7 +55,7 @@ SaveMenu_CopyTilemapAtOnce: ld c, LOW(rSTAT) .loop -REPT SCREEN_WIDTH / 2 +rept SCREEN_WIDTH / 2 pop de ; if in v/hblank, wait until not in v/hblank .loop\@ @@ -67,7 +67,7 @@ REPT SCREEN_WIDTH / 2 inc l ld [hl], d inc l -ENDR +endr ld de, BG_MAP_WIDTH - SCREEN_WIDTH add hl, de diff --git a/engine/menus/start_menu.asm b/engine/menus/start_menu.asm index 1a5f61f3f..25d3db992 100644 --- a/engine/menus/start_menu.asm +++ b/engine/menus/start_menu.asm @@ -259,9 +259,9 @@ StartMenu:: cp $ff jr z, .none call .GetMenuAccountTextPointer -REPT 4 +rept 4 inc hl -ENDR +endr ld a, [hli] ld d, [hl] ld e, a @@ -279,9 +279,9 @@ ENDR ld a, [hli] ld h, [hl] ld l, a -REPT 6 +rept 6 add hl, de -ENDR +endr ret .SetUpMenuItems: diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index 84569b894..8b79c6d0e 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -314,9 +314,9 @@ TrainerCard_Page2_3_InitObjectsAndStrings: ld c, 4 .loop call TrainerCard_Page2_3_PlaceLeadersFaces -REPT 4 +rept 4 inc hl -ENDR +endr dec c jr nz, .loop hlcoord 2, 13 @@ -324,9 +324,9 @@ ENDR ld c, 4 .loop2 call TrainerCard_Page2_3_PlaceLeadersFaces -REPT 4 +rept 4 inc hl -ENDR +endr dec c jr nz, .loop2 xor a diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index 0403e1c44..304bd061e 100644 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -454,19 +454,19 @@ ConstructCreditsTilemap: ld c, 4 xor a .inner_loop -REPT 3 +rept 3 ld [hli], a inc a -ENDR +endr ld [hl], a inc a add hl, de dec c jr nz, .inner_loop pop hl -REPT 4 +rept 4 inc hl -ENDR +endr dec b jr nz, .outer_loop ret @@ -475,10 +475,10 @@ DrawCreditsBorder: ld c, SCREEN_WIDTH / 4 .loop push af -REPT 3 +rept 3 ld [hli], a inc a -ENDR +endr ld [hli], a pop af dec c diff --git a/engine/movie/evolution_animation.asm b/engine/movie/evolution_animation.asm index bed72b820..44b2bcf07 100644 --- a/engine/movie/evolution_animation.asm +++ b/engine/movie/evolution_animation.asm @@ -346,9 +346,9 @@ EvolutionAnimation: ld a, [hl] or b ld [hli], a ; attributes -REPT SPRITEOAMSTRUCT_LENGTH - 1 +rept SPRITEOAMSTRUCT_LENGTH - 1 inc hl -ENDR +endr dec c jr nz, .loop6 pop bc diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 949b856dd..caad2971b 100644 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -1312,19 +1312,19 @@ CrystalIntro_UnownFade: ; Fade between black and white. for hue, 32 RGB hue, hue, hue -ENDR +endr .BlackLBlueFade: ; Fade between black and light blue. for hue, 32 RGB 0, hue / 2, hue -ENDR +endr .BlackBlueFade: ; Fade between black and blue. for hue, 32 RGB 0, 0, hue -ENDR +endr Intro_Scene20_AppearUnown: ; Spawn the palette for the nth Unown @@ -1394,9 +1394,9 @@ Intro_FadeUnownWordPals: ld d, 0 ld hl, wBGPals2 add hl, de -REPT 4 +rept 4 inc hl -ENDR +endr ld a, [wIntroSceneTimer] add a ld c, a @@ -1439,19 +1439,19 @@ ENDR .FastFadePalettes: DEF hue = 31 -REPT 8 +rept 8 RGB hue, hue, hue DEF hue -= 1 RGB hue, hue, hue DEF hue -= 2 -ENDR +endr .SlowFadePalettes: DEF hue = 31 -REPT 16 +rept 16 RGB hue, hue, hue DEF hue -= 1 -ENDR +endr Intro_LoadTilemap: ldh a, [rSVBK] diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 79ef6cdb8..16d56ab53 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -353,9 +353,9 @@ AnimateTitleCrystal: ld a, [hl] add 2 ld [hli], a ; y -REPT SPRITEOAMSTRUCT_LENGTH - 1 +rept SPRITEOAMSTRUCT_LENGTH - 1 inc hl -ENDR +endr dec c jr nz, .loop diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm index ac4ef1767..23978d049 100644 --- a/engine/overworld/decorations.asm +++ b/engine/overworld/decorations.asm @@ -139,7 +139,7 @@ Deco_FillTempWithMinusOne: xor a ld hl, wNumOwnedDecoCategories ld [hli], a - ASSERT wNumOwnedDecoCategories + 1 == wOwnedDecoCategories + assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories ld a, -1 ld bc, 16 call ByteFill @@ -168,7 +168,7 @@ CheckAllDecorationFlags: AppendDecoIndex: ld hl, wNumOwnedDecoCategories inc [hl] - ASSERT wNumOwnedDecoCategories + 1 == wOwnedDecoCategories + assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories ld e, [hl] ld d, 0 add hl, de @@ -362,7 +362,7 @@ PopulateDecoCategoryMenu: ld hl, wNumOwnedDecoCategories ld e, [hl] dec [hl] - ASSERT wNumOwnedDecoCategories + 1 == wOwnedDecoCategories + assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories ld d, 0 add hl, de ld [hl], -1 diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index d606f07ae..7b669e660 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -414,9 +414,9 @@ RunSceneScript: ld a, [hli] ld h, [hl] ld l, a -REPT SCENE_SCRIPT_SIZE +rept SCENE_SCRIPT_SIZE add hl, de -ENDR +endr call GetMapScriptsBank call GetFarWord diff --git a/engine/overworld/map_object_action.asm b/engine/overworld/map_object_action.asm index 9d1ebc271..916131f05 100644 --- a/engine/overworld/map_object_action.asm +++ b/engine/overworld/map_object_action.asm @@ -276,7 +276,7 @@ SetFacingBoulderDust: ld a, FACING_BOULDER_DUST_1 jr z, .ok inc a - ASSERT FACING_BOULDER_DUST_1 + 1 == FACING_BOULDER_DUST_2 + assert FACING_BOULDER_DUST_1 + 1 == FACING_BOULDER_DUST_2 .ok ld [hl], a ret diff --git a/engine/overworld/overworld.asm b/engine/overworld/overworld.asm index e3591a0d4..d8b9f7d4c 100644 --- a/engine/overworld/overworld.asm +++ b/engine/overworld/overworld.asm @@ -571,9 +571,9 @@ GetUsedSprite: pop bc ld l, c ld h, $0 -REPT 4 +rept 4 add hl, hl -ENDR +endr pop de add hl, de ld d, h @@ -603,9 +603,9 @@ ENDR and $7f ld l, a ld h, 0 -REPT 4 +rept 4 add hl, hl -ENDR +endr ld a, l add LOW(vTiles0) ld l, a diff --git a/engine/overworld/time.asm b/engine/overworld/time.asm index 85ac2e50c..2003910b3 100644 --- a/engine/overworld/time.asm +++ b/engine/overworld/time.asm @@ -25,7 +25,7 @@ NextCallReceiveDelay: ld hl, .ReceiveCallDelays add hl, de ld a, [hl] -IF DEF(_DEBUG) +if DEF(_DEBUG) ld h, a ld a, BANK(sDebugTimeCyclesSinceLastCall) call OpenSRAM @@ -38,7 +38,7 @@ IF DEF(_DEBUG) ld h, a .debug_ok ld a, h -ENDC +endc jp RestartReceiveCallDelay .ReceiveCallDelays: @@ -111,17 +111,17 @@ CheckDailyResetTimer:: ld [hli], a ; wSwarmFlags ld [hl], a ; wSwarmFlags + 1 ld hl, wDailyRematchFlags -REPT 4 +rept 4 ld [hli], a -ENDR +endr ld hl, wDailyPhoneItemFlags -REPT 4 +rept 4 ld [hli], a -ENDR +endr ld hl, wDailyPhoneTimeOfDayFlags -REPT 4 +rept 4 ld [hli], a -ENDR +endr ld hl, wKenjiBreakTimer ld a, [hl] and a diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm index 6e455b371..89d8437a1 100644 --- a/engine/overworld/warp_connection.asm +++ b/engine/overworld/warp_connection.asm @@ -177,7 +177,7 @@ EnterMapWarp: ld a, [wPrevMapGroup] cp GROUP_MOUNT_MOON_SQUARE jr nz, .not_mt_moon_square_or_tin_tower_roof - ASSERT GROUP_MOUNT_MOON_SQUARE == GROUP_TIN_TOWER_ROOF + assert GROUP_MOUNT_MOON_SQUARE == GROUP_TIN_TOWER_ROOF ld a, [wPrevMapNumber] cp MAP_MOUNT_MOON_SQUARE ret z diff --git a/engine/overworld/wildmons.asm b/engine/overworld/wildmons.asm index 36ac5b422..f9b072d7a 100644 --- a/engine/overworld/wildmons.asm +++ b/engine/overworld/wildmons.asm @@ -363,9 +363,9 @@ CheckRepelEffect:: .ok ; to PartyMonLevel -REPT 4 +rept 4 dec hl -ENDR +endr ld a, [wCurPartyLevel] cp [hl] diff --git a/engine/phone/phonering_copytilemapatonce.asm b/engine/phone/phonering_copytilemapatonce.asm index 1c39efe30..029c2958c 100644 --- a/engine/phone/phonering_copytilemapatonce.asm +++ b/engine/phone/phonering_copytilemapatonce.asm @@ -58,7 +58,7 @@ PhoneRing_CopyTilemapAtOnce: ld c, LOW(rSTAT) .loop -REPT SCREEN_WIDTH / 2 +rept SCREEN_WIDTH / 2 pop de ; if in v/hblank, wait until not in v/hblank .loop\@ @@ -70,7 +70,7 @@ REPT SCREEN_WIDTH / 2 inc l ld [hl], d inc l -ENDR +endr ld de, BG_MAP_WIDTH - SCREEN_WIDTH add hl, de diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index 8a1769498..063803cb8 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -896,9 +896,9 @@ Pokedex_UnownModeUpdateCursorGfx: ld e, a ld d, 0 ld hl, UnownModeLetterAndCursorCoords + 2 -REPT 4 +rept 4 add hl, de -ENDR +endr ld a, [hli] ld h, [hl] ld l, a @@ -1329,9 +1329,9 @@ Pokedex_DrawUnownModeBG: jr z, .done push af ld hl, UnownModeLetterAndCursorCoords -REPT 4 +rept 4 add hl, de -ENDR +endr ld a, [hli] ld h, [hl] ld l, a @@ -1496,7 +1496,7 @@ Pokedex_PrintListing: push af ld a, [de] ld [wTempSpecies], a ; also sets wNamedObjectIndex - ASSERT wTempSpecies == wNamedObjectIndex + assert wTempSpecies == wNamedObjectIndex push de push hl call .PrintEntry @@ -1864,9 +1864,9 @@ Pokedex_PlaceTypeString: ld e, a ld d, 0 ld hl, PokedexTypeSearchStrings -REPT POKEDEX_TYPE_STRING_LENGTH +rept POKEDEX_TYPE_STRING_LENGTH add hl, de -ENDR +endr ld e, l ld d, h pop hl diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/pokedex_2.asm index ef0db8c4b..1a2fc18ff 100644 --- a/engine/pokedex/pokedex_2.asm +++ b/engine/pokedex/pokedex_2.asm @@ -262,9 +262,9 @@ GetDexEntryPagePointer: cp "@" jr nz, .loop1 ; skip height and weight -REPT 4 +rept 4 inc hl -ENDR +endr ; if c != 1: skip entry dec c jr z, .done diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 3c7caf3eb..8f094388e 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -1007,7 +1007,7 @@ PokegearPhone_UpdateCursor: for y, PHONE_DISPLAY_HEIGHT hlcoord 1, 4 + y * 2 ld [hl], a -ENDR +endr hlcoord 1, 4 ld a, [wPokegearPhoneCursorPosition] ld bc, 2 * SCREEN_WIDTH diff --git a/engine/pokegear/radio.asm b/engine/pokegear/radio.asm index 8b46dd102..3ee68bf8d 100644 --- a/engine/pokegear/radio.asm +++ b/engine/pokegear/radio.asm @@ -232,9 +232,9 @@ OaksPKMNTalk4: .done ; Point hl to the list of morning Pokémon., skipping percentages -REPT 4 +rept 4 inc hl -ENDR +endr ; Generate a number, either 0, 1, or 2, to choose a time of day. .loop2 call Random @@ -705,9 +705,9 @@ PokedexShow2: pop hl pop af call CopyDexEntryPart2 -REPT 4 +rept 4 inc hl -ENDR +endr ld a, l ld [wPokedexShowPointerAddr], a ld a, h diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 740735080..8103b38e0 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -1394,9 +1394,9 @@ MACRO copy_box_data jr .loop\@ .done\@ - IF \1 + if \1 call CloseSRAM - ENDC + endc ld a, -1 ld [de], a ld a, [wBillsPCTempBoxCount] @@ -1472,11 +1472,11 @@ BillsPC_UpdateSelectionCursor: inc hl ld [de], a ; y inc de -REPT SPRITEOAMSTRUCT_LENGTH - 1 +rept SPRITEOAMSTRUCT_LENGTH - 1 ld a, [hli] ld [de], a inc de -ENDR +endr jr .loop .OAM: @@ -1520,11 +1520,11 @@ BillsPC_UpdateInsertCursor: inc hl ld [de], a ; y inc de -REPT SPRITEOAMSTRUCT_LENGTH - 1 +rept SPRITEOAMSTRUCT_LENGTH - 1 ld a, [hli] ld [de], a inc de -ENDR +endr jr .loop .OAM: @@ -2155,7 +2155,7 @@ GetBoxPointer: table_width 3, GetBoxPointer.BoxBankAddresses for n, 1, NUM_BOXES + 1 dba sBox{d:n} -ENDR +endr assert_table_length NUM_BOXES BillsPC_ApplyPalettes: @@ -2271,7 +2271,7 @@ _ChangeBox_MenuHeader: db NUM_BOXES for x, NUM_BOXES db x + 1 -ENDR +endr db -1 .PrintBoxNames: @@ -2362,7 +2362,7 @@ GetBoxCount: table_width 3, GetBoxCount.BoxBankAddresses for n, 1, NUM_BOXES + 1 dba sBox{d:n} -ENDR +endr assert_table_length NUM_BOXES BillsPC_PrintBoxName: diff --git a/engine/pokemon/bills_pc_top.asm b/engine/pokemon/bills_pc_top.asm index ac2f4cb96..fa5833aef 100644 --- a/engine/pokemon/bills_pc_top.asm +++ b/engine/pokemon/bills_pc_top.asm @@ -368,5 +368,5 @@ LoadBoxMonListing: ; unreferenced table_width 3, LoadBoxMonListing.BoxAddresses for n, 1, NUM_BOXES + 1 dba sBox{d:n} -ENDR +endr assert_table_length NUM_BOXES diff --git a/engine/pokemon/mail.asm b/engine/pokemon/mail.asm index 428a892d4..55e6b03fb 100644 --- a/engine/pokemon/mail.asm +++ b/engine/pokemon/mail.asm @@ -323,7 +323,7 @@ InitMail: ; initialize wMailboxCount from sMailboxCount ld hl, wMailboxCount ld [hli], a - ASSERT wMailboxCount + 1 == wMailboxItems + assert wMailboxCount + 1 == wMailboxItems and a jr z, .done ; if no mail, we're done diff --git a/engine/pokemon/mail_2.asm b/engine/pokemon/mail_2.asm index c7f699290..022411535 100644 --- a/engine/pokemon/mail_2.asm +++ b/engine/pokemon/mail_2.asm @@ -68,11 +68,11 @@ ReadAnyMail: and A_BUTTON | B_BUTTON | START jr z, .loop vc_patch Forbid_printing_mail -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) and NO_INPUT -ELSE +else and START -ENDC +endc vc_patch_end jr nz, .pressed_start ret diff --git a/engine/pokemon/move_mon.asm b/engine/pokemon/move_mon.asm index 1532dcf1a..4701705f3 100644 --- a/engine/pokemon/move_mon.asm +++ b/engine/pokemon/move_mon.asm @@ -117,29 +117,29 @@ GeneratePartyMonStats: and a jr nz, .randomlygeneratemoves ld de, wEnemyMonMoves -REPT NUM_MOVES - 1 +rept NUM_MOVES - 1 ld a, [de] inc de ld [hli], a -ENDR +endr ld a, [de] ld [hl], a jr .next .randomlygeneratemoves xor a -REPT NUM_MOVES - 1 +rept NUM_MOVES - 1 ld [hli], a -ENDR +endr ld [hl], a ld [wSkipMovesBeforeLevelUp], a predef FillMoves .next pop de -REPT NUM_MOVES +rept NUM_MOVES inc de -ENDR +endr ; Initialize ID. ld a, [wPlayerID] @@ -222,9 +222,9 @@ ENDR call FillPP pop de pop hl -REPT NUM_MOVES +rept NUM_MOVES inc de -ENDR +endr ; Initialize happiness. ld a, BASE_HAPPINESS diff --git a/engine/pokemon/search_owned.asm b/engine/pokemon/search_owned.asm index b8159537a..2edb987eb 100644 --- a/engine/pokemon/search_owned.asm +++ b/engine/pokemon/search_owned.asm @@ -223,7 +223,7 @@ CheckOwnMon: ld hl, wPlayerName ; BUG: CheckOwnMon only checks the first five letters of OT names (see docs/bugs_and_glitches.md) -REPT NAME_LENGTH_JAPANESE - 2 +rept NAME_LENGTH_JAPANESE - 2 ld a, [de] cp [hl] jr nz, .notfound @@ -231,7 +231,7 @@ REPT NAME_LENGTH_JAPANESE - 2 jr z, .found inc hl inc de -ENDR +endr ld a, [de] cp [hl] @@ -255,7 +255,7 @@ SearchBoxAddressTable: table_width 3, SearchBoxAddressTable for n, 1, NUM_BOXES + 1 dba sBox{d:n} -ENDR +endr assert_table_length NUM_BOXES UpdateOTPointer: diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm index e5e897952..2b9e0e8a8 100644 --- a/engine/pokemon/stats_screen.asm +++ b/engine/pokemon/stats_screen.asm @@ -185,10 +185,10 @@ EggStatsJoypad: .check bit A_BUTTON_F, a jr nz, .quit -IF DEF(_DEBUG) +if DEF(_DEBUG) cp START jr z, .hatch -ENDC +endc and D_DOWN | D_UP | A_BUTTON | B_BUTTON jp StatsScreen_JoypadAction @@ -197,7 +197,7 @@ ENDC call StatsScreen_SetJumptableIndex ret -IF DEF(_DEBUG) +if DEF(_DEBUG) .hatch ld a, [wMonType] or a @@ -228,7 +228,7 @@ IF DEF(_DEBUG) .HatchSoonString: db "▶HATCH SOON!@" -ENDC +endc StatsScreen_LoadPage: call StatsScreen_LoadGFX @@ -1010,7 +1010,7 @@ EggStatsScreen: ld de, FiveQMarkString hlcoord 11, 5 call PlaceString -IF DEF(_DEBUG) +if DEF(_DEBUG) ld de, .PushStartString hlcoord 8, 17 call PlaceString @@ -1020,7 +1020,7 @@ IF DEF(_DEBUG) db "▶PUSH START.@" .placed_push_start -ENDC +endc ld a, [wTempMonHappiness] ; egg status ld de, EggSoonString cp $6 diff --git a/engine/rtc/restart_clock.asm b/engine/rtc/restart_clock.asm index 2aa2c36f0..450d89a81 100644 --- a/engine/rtc/restart_clock.asm +++ b/engine/rtc/restart_clock.asm @@ -11,9 +11,9 @@ RestartClock_GetWraparoundTime: ld e, a ld d, 0 ld hl, .WrapAroundTimes -REPT 4 +rept 4 add hl, de -ENDR +endr ld e, [hl] inc hl ld d, [hl] diff --git a/engine/tilesets/tileset_anims.asm b/engine/tilesets/tileset_anims.asm index 8b4864e8b..ca2a86a75 100644 --- a/engine/tilesets/tileset_anims.asm +++ b/engine/tilesets/tileset_anims.asm @@ -323,11 +323,11 @@ ScrollTileLeft: ld l, e ld c, LEN_2BPP_TILE / 4 .loop -REPT 4 +rept 4 ld a, [hl] rlca ld [hli], a -ENDR +endr dec c jr nz, .loop ret @@ -337,11 +337,11 @@ ScrollTileRight: ld l, e ld c, LEN_2BPP_TILE / 4 .loop -REPT 4 +rept 4 ld a, [hl] rrca ld [hli], a -ENDR +endr dec c jr nz, .loop ret @@ -888,13 +888,13 @@ WriteTile: ld [hl], e inc hl ld [hl], d -REPT (LEN_2BPP_TILE - 2) / 2 +rept (LEN_2BPP_TILE - 2) / 2 pop de inc hl ld [hl], e inc hl ld [hl], d -ENDR +endr ; Restore the stack pointer from bc ld h, b diff --git a/engine/tilesets/timeofday_pals.asm b/engine/tilesets/timeofday_pals.asm index ee209929b..214d2f743 100644 --- a/engine/tilesets/timeofday_pals.asm +++ b/engine/tilesets/timeofday_pals.asm @@ -175,9 +175,9 @@ FillWhiteBGColor: ld [hli], a ld a, d ld [hli], a -REPT 6 +rept 6 inc hl -ENDR +endr dec c jr nz, .loop diff --git a/gfx/pokegear/town_map_palette_map.asm b/gfx/pokegear/town_map_palette_map.asm index f32b9e9ba..dc70c6da5 100644 --- a/gfx/pokegear/town_map_palette_map.asm +++ b/gfx/pokegear/town_map_palette_map.asm @@ -7,10 +7,10 @@ const PAL_TOWNMAP_POI_MTN ; 5 MACRO townmappals - REPT _NARG / 2 + rept _NARG / 2 dn PAL_TOWNMAP_\2, PAL_TOWNMAP_\1 shift 2 - ENDR + endr ENDM ; gfx/pokegear/town_map.png diff --git a/gfx/sgb/pal_packets.asm b/gfx/sgb/pal_packets.asm index 011ff8e62..b54e6f89b 100644 --- a/gfx/sgb/pal_packets.asm +++ b/gfx/sgb/pal_packets.asm @@ -82,15 +82,15 @@ PalPacket_GamefreakLogo: PalPacket_Pal01: sgb_pal01 RGB 31, 31, 31 -REPT 6 +rept 6 RGB 00, 00, 00 -ENDR +endr db 0 PalPacket_Pal23: sgb_pal23 RGB 31, 31, 31 -REPT 6 +rept 6 RGB 00, 00, 00 -ENDR +endr db 0 diff --git a/gfx/tileset_palette_maps.asm b/gfx/tileset_palette_maps.asm index be285c5e6..678eb1837 100644 --- a/gfx/tileset_palette_maps.asm +++ b/gfx/tileset_palette_maps.asm @@ -2,10 +2,10 @@ MACRO tilepal ; used in gfx/tilesets/*_palette_map.asm ; vram bank, pals DEF x = \1 << OAM_TILE_BANK - REPT (_NARG - 1) / 2 + rept (_NARG - 1) / 2 dn (x | PAL_BG_\3), (x | PAL_BG_\2) shift 2 - ENDR + endr ENDM TilesetKantoPalMap: @@ -110,6 +110,6 @@ INCLUDE "gfx/tilesets/battle_tower_outside_palette_map.asm" MapGroupPalettes: ; unreferenced ; entries correspond to MAPGROUP_* constants -REPT NUM_MAP_GROUPS +rept NUM_MAP_GROUPS db PAL_BG_ROOF -ENDR +endr diff --git a/gfx/tilesets/aerodactyl_word_room_palette_map.asm b/gfx/tilesets/aerodactyl_word_room_palette_map.asm index 1d47b0e6d..5ebde24ba 100644 --- a/gfx/tilesets/aerodactyl_word_room_palette_map.asm +++ b/gfx/tilesets/aerodactyl_word_room_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/battle_tower_inside_palette_map.asm b/gfx/tilesets/battle_tower_inside_palette_map.asm index e68890c1f..1abce2a16 100644 --- a/gfx/tilesets/battle_tower_inside_palette_map.asm +++ b/gfx/tilesets/battle_tower_inside_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, YELLOW, RED, BROWN, BROWN, BROWN, RED, RED tilepal 0, WATER, RED, RED, RED, RED, GRAY, RED, WATER -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, WATER, GRAY, WATER, WATER, WATER, ROOF, ROOF tilepal 1, YELLOW, YELLOW, GRAY, GRAY, WATER, WATER, RED, RED diff --git a/gfx/tilesets/battle_tower_outside_palette_map.asm b/gfx/tilesets/battle_tower_outside_palette_map.asm index b3e59fbfb..dfc74a9c0 100644 --- a/gfx/tilesets/battle_tower_outside_palette_map.asm +++ b/gfx/tilesets/battle_tower_outside_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 0, WATER, GRAY, GRAY, GRAY, BROWN, BROWN, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, RED, WATER, WATER, ROOF, ROOF, ROOF, ROOF, ROOF tilepal 1, RED, RED, RED, ROOF, RED, WATER, WATER, WATER diff --git a/gfx/tilesets/beta_word_room_palette_map.asm b/gfx/tilesets/beta_word_room_palette_map.asm index 1d47b0e6d..5ebde24ba 100644 --- a/gfx/tilesets/beta_word_room_palette_map.asm +++ b/gfx/tilesets/beta_word_room_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/cave_palette_map.asm b/gfx/tilesets/cave_palette_map.asm index e9f0ed8f1..73c09ebe5 100644 --- a/gfx/tilesets/cave_palette_map.asm +++ b/gfx/tilesets/cave_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, GRAY, GRAY, GREEN, BROWN, BROWN, BROWN tilepal 1, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/champions_room_palette_map.asm b/gfx/tilesets/champions_room_palette_map.asm index 16c8cca0c..551a09351 100644 --- a/gfx/tilesets/champions_room_palette_map.asm +++ b/gfx/tilesets/champions_room_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, BROWN, BROWN, GRAY, GRAY, BROWN, BROWN tilepal 0, GRAY, GRAY, RED, WATER, WATER, ROOF, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, WATER, WATER, WATER, WATER, WATER, WATER, WATER, WATER tilepal 1, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY diff --git a/gfx/tilesets/dark_cave_palette_map.asm b/gfx/tilesets/dark_cave_palette_map.asm index e9f0ed8f1..73c09ebe5 100644 --- a/gfx/tilesets/dark_cave_palette_map.asm +++ b/gfx/tilesets/dark_cave_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, GRAY, GRAY, GREEN, BROWN, BROWN, BROWN tilepal 1, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/elite_four_room_palette_map.asm b/gfx/tilesets/elite_four_room_palette_map.asm index aa7cca344..b20f49195 100644 --- a/gfx/tilesets/elite_four_room_palette_map.asm +++ b/gfx/tilesets/elite_four_room_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, WATER, GREEN, GREEN, BROWN, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, WATER, RED, WATER, WATER, ROOF, ROOF -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, ROOF, RED, RED, RED, ROOF, ROOF, GREEN tilepal 1, GREEN, GRAY, GREEN, GREEN, GREEN, GREEN, WATER, GREEN diff --git a/gfx/tilesets/facility_palette_map.asm b/gfx/tilesets/facility_palette_map.asm index 3cac6400e..f79f9c01b 100644 --- a/gfx/tilesets/facility_palette_map.asm +++ b/gfx/tilesets/facility_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, GRAY, BROWN, ROOF tilepal 0, ROOF, ROOF, GRAY, BROWN, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, WATER, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 1, BROWN, BROWN, GRAY, GRAY, RED, RED, BROWN, BROWN diff --git a/gfx/tilesets/forest_palette_map.asm b/gfx/tilesets/forest_palette_map.asm index b645e3d46..696788084 100644 --- a/gfx/tilesets/forest_palette_map.asm +++ b/gfx/tilesets/forest_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, BROWN, BROWN, RED, YELLOW, GREEN, BROWN, YELLOW tilepal 1, YELLOW, BROWN, BROWN, BROWN, GREEN, GREEN, GREEN, GREEN diff --git a/gfx/tilesets/game_corner_palette_map.asm b/gfx/tilesets/game_corner_palette_map.asm index d92481ba0..34bb9f6f0 100644 --- a/gfx/tilesets/game_corner_palette_map.asm +++ b/gfx/tilesets/game_corner_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, RED, ROOF, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, GRAY, WATER, ROOF, ROOF, WATER, WATER -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, YELLOW, RED, YELLOW, RED, GREEN, GREEN, BROWN, ROOF tilepal 1, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, BROWN diff --git a/gfx/tilesets/gate_palette_map.asm b/gfx/tilesets/gate_palette_map.asm index 69315a6bf..7854d3a81 100644 --- a/gfx/tilesets/gate_palette_map.asm +++ b/gfx/tilesets/gate_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, GRAY, GRAY, WATER, WATER, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY tilepal 1, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GREEN, GREEN diff --git a/gfx/tilesets/ho_oh_word_room_palette_map.asm b/gfx/tilesets/ho_oh_word_room_palette_map.asm index 1d47b0e6d..5ebde24ba 100644 --- a/gfx/tilesets/ho_oh_word_room_palette_map.asm +++ b/gfx/tilesets/ho_oh_word_room_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/house_palette_map.asm b/gfx/tilesets/house_palette_map.asm index f8fed4bda..ce7b988b7 100644 --- a/gfx/tilesets/house_palette_map.asm +++ b/gfx/tilesets/house_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, RED, RED, BROWN, BROWN, GREEN, YELLOW, BROWN, BROWN tilepal 0, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, WATER, RED, RED, RED, RED, BROWN, WATER, WATER tilepal 1, GREEN, GREEN, GREEN, GREEN, WATER, WATER, BROWN, BROWN diff --git a/gfx/tilesets/ice_path_palette_map.asm b/gfx/tilesets/ice_path_palette_map.asm index c5d37fd3f..985844071 100644 --- a/gfx/tilesets/ice_path_palette_map.asm +++ b/gfx/tilesets/ice_path_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, GRAY, GRAY, WATER, WATER, WATER, WATER tilepal 0, WATER, WATER, WATER, WATER, WATER, WATER, WATER, WATER -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF tilepal 1, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF diff --git a/gfx/tilesets/johto_modern_palette_map.asm b/gfx/tilesets/johto_modern_palette_map.asm index bd28e015a..f2af7a92d 100644 --- a/gfx/tilesets/johto_modern_palette_map.asm +++ b/gfx/tilesets/johto_modern_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, BROWN, BROWN, GRAY, BROWN, GRAY, GRAY, GRAY tilepal 0, WATER, GRAY, GRAY, GRAY, BROWN, BROWN, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, BROWN, BROWN, RED, GREEN, GREEN, GRAY, ROOF tilepal 1, RED, RED, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF diff --git a/gfx/tilesets/johto_palette_map.asm b/gfx/tilesets/johto_palette_map.asm index 402afb323..62fbd2d00 100644 --- a/gfx/tilesets/johto_palette_map.asm +++ b/gfx/tilesets/johto_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 0, WATER, GRAY, GRAY, GRAY, BROWN, BROWN, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, RED, RED, RED, RED, RED tilepal 1, RED, RED, RED, RED, RED, RED, RED, RED diff --git a/gfx/tilesets/kabuto_word_room_palette_map.asm b/gfx/tilesets/kabuto_word_room_palette_map.asm index 1d47b0e6d..5ebde24ba 100644 --- a/gfx/tilesets/kabuto_word_room_palette_map.asm +++ b/gfx/tilesets/kabuto_word_room_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/kanto_palette_map.asm b/gfx/tilesets/kanto_palette_map.asm index 1ddf98451..e3e497fb9 100644 --- a/gfx/tilesets/kanto_palette_map.asm +++ b/gfx/tilesets/kanto_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GREEN, GREEN, GREEN, ROOF, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, GRAY, BROWN, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, BROWN, BROWN, RED, BROWN, ROOF, ROOF, ROOF tilepal 1, ROOF, ROOF, YELLOW, YELLOW, YELLOW, GRAY, BROWN, GRAY diff --git a/gfx/tilesets/lab_palette_map.asm b/gfx/tilesets/lab_palette_map.asm index c815737fc..24399c6ea 100644 --- a/gfx/tilesets/lab_palette_map.asm +++ b/gfx/tilesets/lab_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, ROOF, ROOF, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, WATER tilepal 1, WATER, WATER, WATER, WATER, WATER, WATER, WATER, WATER diff --git a/gfx/tilesets/lighthouse_palette_map.asm b/gfx/tilesets/lighthouse_palette_map.asm index 732fb16c2..5f80e3a4d 100644 --- a/gfx/tilesets/lighthouse_palette_map.asm +++ b/gfx/tilesets/lighthouse_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, YELLOW, YELLOW, ROOF, ROOF, ROOF, ROOF, GRAY, GRAY tilepal 0, RED, RED, GREEN, GREEN, ROOF, ROOF, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, ROOF, GRAY, GRAY, BROWN, BROWN, RED tilepal 1, RED, RED, RED, BROWN, RED, RED, RED, RED diff --git a/gfx/tilesets/mansion_palette_map.asm b/gfx/tilesets/mansion_palette_map.asm index 7b26cb70d..2bd27ad22 100644 --- a/gfx/tilesets/mansion_palette_map.asm +++ b/gfx/tilesets/mansion_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, GREEN, WATER, BROWN, BROWN tilepal 0, BROWN, GREEN, BROWN, BROWN, WATER, WATER, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, YELLOW, GRAY, GRAY, GRAY, GRAY, GRAY, YELLOW, YELLOW tilepal 1, YELLOW, YELLOW, YELLOW, YELLOW, RED, RED, WATER, WATER diff --git a/gfx/tilesets/mart_palette_map.asm b/gfx/tilesets/mart_palette_map.asm index f5eb5d5d8..991510d12 100644 --- a/gfx/tilesets/mart_palette_map.asm +++ b/gfx/tilesets/mart_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, RED, YELLOW, YELLOW, YELLOW, ROOF, ROOF tilepal 0, ROOF, ROOF, ROOF, ROOF, RED, RED, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, GRAY, GRAY, GREEN, GREEN, GREEN, GREEN, GRAY tilepal 1, GRAY, GREEN, GREEN, RED, RED, WATER, WATER, ROOF diff --git a/gfx/tilesets/omanyte_word_room_palette_map.asm b/gfx/tilesets/omanyte_word_room_palette_map.asm index 1d47b0e6d..5ebde24ba 100644 --- a/gfx/tilesets/omanyte_word_room_palette_map.asm +++ b/gfx/tilesets/omanyte_word_room_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/park_palette_map.asm b/gfx/tilesets/park_palette_map.asm index 6df547368..f9c65ef89 100644 --- a/gfx/tilesets/park_palette_map.asm +++ b/gfx/tilesets/park_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, BROWN, BROWN, GRAY, GRAY, GRAY, BROWN tilepal 0, BROWN, BROWN, GRAY, GRAY, GRAY, GRAY, GRAY, WATER -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, WATER, WATER, GRAY, RED, GREEN, BROWN, GRAY, GRAY tilepal 1, GRAY, GRAY, GRAY, GRAY, GREEN, GREEN, GREEN, GREEN diff --git a/gfx/tilesets/players_house_palette_map.asm b/gfx/tilesets/players_house_palette_map.asm index 06ffa66b5..5d089835b 100644 --- a/gfx/tilesets/players_house_palette_map.asm +++ b/gfx/tilesets/players_house_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, BROWN, BROWN, BROWN, RED, GREEN, WATER, WATER tilepal 1, BROWN, BROWN, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN diff --git a/gfx/tilesets/players_room_palette_map.asm b/gfx/tilesets/players_room_palette_map.asm index 9a3af5a53..1c0cb1f08 100644 --- a/gfx/tilesets/players_room_palette_map.asm +++ b/gfx/tilesets/players_room_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, GREEN tilepal 0, GREEN, YELLOW, YELLOW, GRAY, GRAY, BROWN, YELLOW, YELLOW -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, GRAY, GRAY, GRAY, GRAY, GREEN tilepal 1, GREEN, RED, RED, GRAY, GRAY, RED, RED, RED diff --git a/gfx/tilesets/pokecenter_palette_map.asm b/gfx/tilesets/pokecenter_palette_map.asm index 7e9274483..78508b59e 100644 --- a/gfx/tilesets/pokecenter_palette_map.asm +++ b/gfx/tilesets/pokecenter_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, RED, RED, RED, RED, RED, RED, GRAY, GRAY tilepal 0, YELLOW, YELLOW, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, RED, GRAY, WATER, WATER, WATER, ROOF, ROOF tilepal 1, GRAY, GRAY, GRAY, GRAY, GRAY, WATER, WATER, WATER diff --git a/gfx/tilesets/pokecom_center_palette_map.asm b/gfx/tilesets/pokecom_center_palette_map.asm index fbc1e0b03..75ee649f9 100644 --- a/gfx/tilesets/pokecom_center_palette_map.asm +++ b/gfx/tilesets/pokecom_center_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, RED, RED, WATER, WATER, WATER, WATER, GRAY, GRAY tilepal 0, YELLOW, YELLOW, WATER, WATER, GRAY, GRAY, YELLOW, YELLOW -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, GRAY, GRAY, WATER, RED, RED, WATER, WATER tilepal 1, WATER, WATER, WATER, WATER, WATER, WATER, GRAY, WATER diff --git a/gfx/tilesets/port_palette_map.asm b/gfx/tilesets/port_palette_map.asm index 8782ea4a6..6bfdf4686 100644 --- a/gfx/tilesets/port_palette_map.asm +++ b/gfx/tilesets/port_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF tilepal 0, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF, ROOF -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, WATER, WATER, GRAY, GRAY, RED, BROWN, BROWN tilepal 1, BROWN, BROWN, GRAY, GRAY, RED, RED, RED, BROWN diff --git a/gfx/tilesets/radio_tower_palette_map.asm b/gfx/tilesets/radio_tower_palette_map.asm index c41cfdab8..3530f7479 100644 --- a/gfx/tilesets/radio_tower_palette_map.asm +++ b/gfx/tilesets/radio_tower_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, RED, RED, WATER, WATER, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, YELLOW, YELLOW, YELLOW, YELLOW, YELLOW, YELLOW, YELLOW, YELLOW tilepal 1, YELLOW, YELLOW, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY diff --git a/gfx/tilesets/ruins_of_alph_palette_map.asm b/gfx/tilesets/ruins_of_alph_palette_map.asm index 1d47b0e6d..5ebde24ba 100644 --- a/gfx/tilesets/ruins_of_alph_palette_map.asm +++ b/gfx/tilesets/ruins_of_alph_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/tower_palette_map.asm b/gfx/tilesets/tower_palette_map.asm index 485de6d49..6e3c10115 100644 --- a/gfx/tilesets/tower_palette_map.asm +++ b/gfx/tilesets/tower_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, RED tilepal 1, RED, RED, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/traditional_house_palette_map.asm b/gfx/tilesets/traditional_house_palette_map.asm index 2fb0f6e03..5daa0da6b 100644 --- a/gfx/tilesets/traditional_house_palette_map.asm +++ b/gfx/tilesets/traditional_house_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, BROWN, BROWN, BROWN, BROWN, GREEN, GREEN, GREEN, BROWN tilepal 0, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, WATER, BROWN -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, BROWN, WATER, WATER, RED, GRAY, GRAY, GRAY tilepal 1, BROWN, BROWN, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN diff --git a/gfx/tilesets/train_station_palette_map.asm b/gfx/tilesets/train_station_palette_map.asm index b299e5381..f52f5bbe7 100644 --- a/gfx/tilesets/train_station_palette_map.asm +++ b/gfx/tilesets/train_station_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, WATER, GREEN, GREEN, WATER, BROWN, BROWN, BROWN, GREEN tilepal 0, BROWN, BROWN, GRAY, GRAY, GREEN, GREEN, WATER, WATER -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, WATER, WATER, WATER, WATER, GRAY, GRAY, GRAY, GRAY tilepal 1, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, RED, GRAY diff --git a/gfx/tilesets/underground_palette_map.asm b/gfx/tilesets/underground_palette_map.asm index 01512d121..6b9b5546d 100644 --- a/gfx/tilesets/underground_palette_map.asm +++ b/gfx/tilesets/underground_palette_map.asm @@ -11,9 +11,9 @@ tilepal 0, GRAY, GRAY, GRAY, BROWN, BROWN, BROWN, BROWN, GRAY tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, GRAY, GRAY, RED, WATER, WATER, WATER, WATER, RED tilepal 1, RED, GRAY, WATER, WATER, WATER, WATER, GRAY, GRAY diff --git a/gfx/tilesets/unused_museum_palette_map.asm b/gfx/tilesets/unused_museum_palette_map.asm index 371184bd8..cfbe6dbcd 100644 --- a/gfx/tilesets/unused_museum_palette_map.asm +++ b/gfx/tilesets/unused_museum_palette_map.asm @@ -14,9 +14,9 @@ tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY tilepal 0, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY -REPT 16 +rept 16 db $ff -ENDR +endr tilepal 1, WATER, RED, YELLOW, YELLOW, RED, GREEN, GREEN, BROWN tilepal 1, BROWN, BROWN, GRAY, GRAY, GRAY, GRAY, GRAY, GRAY diff --git a/home/audio.asm b/home/audio.asm index e243d2de7..6f7be3ebd 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -143,9 +143,9 @@ PlayCry:: ld [MBC3RomBank], a ld hl, PokemonCries -REPT MON_CRY_LENGTH +rept MON_CRY_LENGTH add hl, de -ENDR +endr ld e, [hl] inc hl diff --git a/home/flag.asm b/home/flag.asm index 78a06e2a4..76e08e260 100644 --- a/home/flag.asm +++ b/home/flag.asm @@ -45,10 +45,10 @@ FlagAction:: and 7 ; shift de right by three bits (get the index within memory) -REPT 3 +rept 3 srl d rr e -ENDR +endr add hl, de ; implement a decoder diff --git a/home/joypad.asm b/home/joypad.asm index 3c859aa58..9612427eb 100644 --- a/home/joypad.asm +++ b/home/joypad.asm @@ -58,9 +58,9 @@ UpdateJoypad:: ld a, R_BUTTONS ldh [rJOYP], a ; Wait for input to stabilize. -REPT 6 +rept 6 ldh a, [rJOYP] -ENDR +endr ; Buttons take the lo nybble. cpl and $f diff --git a/home/map.asm b/home/map.asm index b81c49ae8..14786eece 100644 --- a/home/map.asm +++ b/home/map.asm @@ -161,24 +161,24 @@ LoadMetatiles:: ld h, a ; copy the 4x4 metatile -REPT METATILE_WIDTH - 1 -REPT METATILE_WIDTH +rept METATILE_WIDTH - 1 +rept METATILE_WIDTH ld a, [hli] ld [de], a inc de -ENDR +endr ld a, e add SURROUNDING_WIDTH - METATILE_WIDTH ld e, a jr nc, .next\@ inc d .next\@ -ENDR -REPT METATILE_WIDTH +endr +rept METATILE_WIDTH ld a, [hli] ld [de], a inc de -ENDR +endr ; Next metatile pop hl ld de, METATILE_WIDTH @@ -659,9 +659,9 @@ GetWarpDestCoords:: ld a, [hli] ld h, [hl] ld l, a -REPT 3 ; get to the warp coords +rept 3 ; get to the warp coords inc hl -ENDR +endr ld a, [wWarpNumber] dec a ld c, a @@ -1146,7 +1146,7 @@ UnmaskObject:: ld [hl], 0 ; unmasked ret -IF DEF(_DEBUG) +if DEF(_DEBUG) ComputeROMXChecksum:: ldh a, [hROMBank] push af @@ -1166,7 +1166,7 @@ ComputeROMXChecksum:: pop af rst Bankswitch ret -ENDC +endc ScrollMapUp:: hlcoord 0, 0 @@ -2297,7 +2297,7 @@ LoadMapTileset:: DummyEndPredef:: ; Unused function at the end of PredefPointers. -REPT 16 +rept 16 nop -ENDR +endr ret diff --git a/home/map_objects.asm b/home/map_objects.asm index fb6ebe9cc..328556596 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -458,9 +458,9 @@ GetSpriteMovementFunction:: ld hl, SpriteMovementData + SPRITEMOVEATTR_MOVEMENT ld e, a ld d, 0 -REPT NUM_SPRITEMOVEDATA_FIELDS +rept NUM_SPRITEMOVEDATA_FIELDS add hl, de -ENDR +endr ld a, [hl] ret @@ -470,9 +470,9 @@ GetInitialFacing:: ld e, a ld d, 0 ld hl, SpriteMovementData + SPRITEMOVEATTR_FACING -REPT NUM_SPRITEMOVEDATA_FIELDS +rept NUM_SPRITEMOVEDATA_FIELDS add hl, de -ENDR +endr ld a, BANK(SpriteMovementData) call GetFarByte add a @@ -508,9 +508,9 @@ CopySpriteMovementData:: ld e, a ld d, 0 ld hl, SpriteMovementData + SPRITEMOVEATTR_FACING -REPT NUM_SPRITEMOVEDATA_FIELDS +rept NUM_SPRITEMOVEDATA_FIELDS add hl, de -ENDR +endr ld b, h ld c, l pop de diff --git a/home/menu.asm b/home/menu.asm index 61575fbf8..126198809 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -783,9 +783,9 @@ ClearWindowData:: .ClearMenuData: ld bc, wMenuMetadataEnd - wMenuMetadata - ASSERT wMenuMetadataEnd - wMenuMetadata == wMenuHeaderEnd - wMenuHeader - ASSERT wMenuMetadataEnd - wMenuMetadata == wMenuDataEnd - wMenuData - ASSERT wMenuMetadataEnd - wMenuMetadata == wMoreMenuDataEnd - wMoreMenuData + assert wMenuMetadataEnd - wMenuMetadata == wMenuHeaderEnd - wMenuHeader + assert wMenuMetadataEnd - wMenuMetadata == wMenuDataEnd - wMenuData + assert wMenuMetadataEnd - wMenuMetadata == wMoreMenuDataEnd - wMoreMenuData xor a call ByteFill ret diff --git a/home/palettes.asm b/home/palettes.asm index c21e1507d..de742b732 100644 --- a/home/palettes.asm +++ b/home/palettes.asm @@ -32,10 +32,10 @@ ForceUpdateCGBPals:: ld c, LOW(rBGPD) ld b, 8 / 2 .bgp -REPT (1 palettes) * 2 +rept (1 palettes) * 2 ld a, [hli] ldh [c], a -ENDR +endr dec b jr nz, .bgp @@ -48,10 +48,10 @@ ENDR ld c, LOW(rOBPD) ld b, 8 / 2 .obp -REPT (1 palettes) * 2 +rept (1 palettes) * 2 ld a, [hli] ldh [c], a -ENDR +endr dec b jr nz, .obp @@ -262,9 +262,9 @@ CopyPals:: ld [hl], d inc hl ; next pal color -REPT PAL_COLOR_SIZE +rept PAL_COLOR_SIZE srl b -ENDR +endr ; source pop de ; done pal? diff --git a/home/pokemon.asm b/home/pokemon.asm index b41d6ba76..d14e80b0c 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -166,9 +166,9 @@ LoadCry:: rst Bankswitch ld hl, PokemonCries -REPT MON_CRY_LENGTH +rept MON_CRY_LENGTH add hl, bc -ENDR +endr ld e, [hl] inc hl diff --git a/home/serial.asm b/home/serial.asm index 7b7fd400d..628d5d592 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -193,7 +193,7 @@ Serial_ExchangeByte:: jr nz, .non_serial_interrupts_enabled ; a == 0 - ASSERT LOW(SERIAL_LINK_BYTE_TIMEOUT) == 0 + assert LOW(SERIAL_LINK_BYTE_TIMEOUT) == 0 ld [wLinkByteTimeout], a ld a, HIGH(SERIAL_LINK_BYTE_TIMEOUT) ld [wLinkByteTimeout + 1], a @@ -319,11 +319,11 @@ WaitLinkTransfer:: jr z, .loop vc_patch Wireless_net_delay_1 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld b, 26 -ELSE +else ld b, 10 -ENDC +endc vc_patch_end .receive call DelayFrame @@ -332,11 +332,11 @@ ENDC jr nz, .receive vc_patch Wireless_net_delay_2 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld b, 26 -ELSE +else ld b, 10 -ENDC +endc vc_patch_end .acknowledge call DelayFrame diff --git a/home/sram.asm b/home/sram.asm index c0bf986a3..6999f7ed8 100644 --- a/home/sram.asm +++ b/home/sram.asm @@ -2,7 +2,7 @@ OpenSRAM:: ; if invalid bank, sram is disabled cp NUM_SRAM_BANKS jr c, .valid -IF DEF(_DEBUG) +if DEF(_DEBUG) push af push bc ld b, 1 @@ -17,7 +17,7 @@ IF DEF(_DEBUG) ld [sOpenedInvalidSRAM], a pop bc pop af -ENDC +endc jr CloseSRAM .valid: diff --git a/home/text.asm b/home/text.asm index 45801ca4f..da66edf6b 100644 --- a/home/text.asm +++ b/home/text.asm @@ -187,23 +187,23 @@ NextChar:: CheckDict:: MACRO dict - ASSERT CHARLEN(\1) == 1 - IF \1 == 0 + assert CHARLEN(\1) == 1 + if \1 == 0 and a - ELSE + else cp \1 - ENDC - IF ISCONST(\2) + endc + if ISCONST(\2) ; Replace a character with another one jr nz, .not\@ ld a, \2 .not\@: - ELIF !STRCMP(STRSUB("\2", 1, 1), ".") + elif !STRCMP(STRSUB("\2", 1, 1), ".") ; Locals can use a short jump jr z, \2 - ELSE + else jp z, \2 - ENDC + endc ENDM dict "", MobileScriptChar diff --git a/home/tilemap.asm b/home/tilemap.asm index e44958d1c..8f8d339df 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -115,7 +115,7 @@ _CopyTilemapAtOnce: ld c, LOW(rSTAT) .loop -REPT SCREEN_WIDTH / 2 +rept SCREEN_WIDTH / 2 pop de ; if in v/hblank, wait until not in v/hblank .loop\@ @@ -127,7 +127,7 @@ REPT SCREEN_WIDTH / 2 inc l ld [hl], d inc l -ENDR +endr ld de, BG_MAP_WIDTH - SCREEN_WIDTH add hl, de diff --git a/home/video.asm b/home/video.asm index 32531fd9d..8cda11d71 100644 --- a/home/video.asm +++ b/home/video.asm @@ -45,7 +45,7 @@ UpdateBGMapBuffer:: .next ; Copy a pair of 16x8 blocks (one 16x16 block) -REPT 2 +rept 2 ; Get our BG Map address pop bc @@ -71,7 +71,7 @@ REPT 2 ld a, [de] inc de ld [bc], a -ENDR +endr ; We've done 2 16x8 blocks ldh a, [hBGMapTileCount] @@ -241,13 +241,13 @@ DEF THIRD_HEIGHT EQU SCREEN_HEIGHT / 3 .row ; Copy a row of 20 tiles -REPT SCREEN_WIDTH / 2 - 1 +rept SCREEN_WIDTH / 2 - 1 pop de ld [hl], e inc l ld [hl], d inc l -ENDR +endr pop de ld [hl], e inc l @@ -304,7 +304,7 @@ Serve1bppRequest:: .next -REPT 3 +rept 3 pop de ld [hl], e inc l @@ -314,7 +314,7 @@ REPT 3 inc l ld [hl], d inc l -ENDR +endr pop de ld [hl], e inc l @@ -389,13 +389,13 @@ _Serve2bppRequest:: .next -REPT 7 +rept 7 pop de ld [hl], e inc l ld [hl], d inc l -ENDR +endr pop de ld [hl], e inc l diff --git a/lib/mobile/mail.asm b/lib/mobile/mail.asm index 272ebaa45..b428fcbf9 100644 --- a/lib/mobile/mail.asm +++ b/lib/mobile/mail.asm @@ -1824,9 +1824,9 @@ Function114b55: .asm_114b8c pop hl xor a -REPT NAME_LENGTH_JAPANESE +rept NAME_LENGTH_JAPANESE ld [hli], a -ENDR +endr jr .asm_114b82 .asm_114b96 @@ -2096,9 +2096,9 @@ Function114cd9: call Function114d99 pop hl push hl -REPT 4 +rept 4 inc hl -ENDR +endr ld a, [hld] cp b jr c, .asm_114d2d @@ -4321,9 +4321,9 @@ Function1158c2: ld e, [hl] inc hl ld d, [hl] -REPT 4 +rept 4 inc de -ENDR +endr ld [hl], d dec hl ld [hl], e @@ -4936,9 +4936,9 @@ Function115c49: ld c, a ld a, [$dc1a] ld b, a -REPT 4 +rept 4 dec bc -ENDR +endr .asm_115c8c ld a, [de] cp $d diff --git a/lib/mobile/main.asm b/lib/mobile/main.asm index bebad4621..1a86018a7 100644 --- a/lib/mobile/main.asm +++ b/lib/mobile/main.asm @@ -2695,9 +2695,9 @@ Function1111fe: push de push bc push hl -REPT 4 +rept 4 inc hl -ENDR +endr ld a, [hli] ld [wc833], a ld a, [hli] @@ -8518,9 +8518,9 @@ Function1136c1: ld a, [hli] ld h, [hl] ld l, a -REPT 4 +rept 4 inc hl -ENDR +endr ld a, h ld [wMobileSDK_PacketBuffer + 198], a ld a, l @@ -9194,9 +9194,9 @@ Function113d66: ld c, a ld a, [wMobileSDK_PacketBuffer + 202] ld b, a -REPT 4 +rept 4 dec bc -ENDR +endr ld a, b or c jr z, .asm_113dae diff --git a/macros/asserts.asm b/macros/asserts.asm index a2e85cfac..f0fa52a96 100644 --- a/macros/asserts.asm +++ b/macros/asserts.asm @@ -2,39 +2,39 @@ MACRO table_width DEF CURRENT_TABLE_WIDTH = \1 - IF _NARG == 2 + if _NARG == 2 REDEF CURRENT_TABLE_START EQUS "\2" - ELSE + else REDEF CURRENT_TABLE_START EQUS "._table_width\@" {CURRENT_TABLE_START}: - ENDC + endc ENDM MACRO assert_table_length DEF x = \1 - ASSERT x * CURRENT_TABLE_WIDTH == @ - {CURRENT_TABLE_START}, \ + assert x * CURRENT_TABLE_WIDTH == @ - {CURRENT_TABLE_START}, \ "{CURRENT_TABLE_START}: expected {d:x} entries, each {d:CURRENT_TABLE_WIDTH} bytes" ENDM MACRO list_start DEF list_index = 0 - IF _NARG == 1 + if _NARG == 1 REDEF CURRENT_LIST_START EQUS "\1" - ELSE + else REDEF CURRENT_LIST_START EQUS "._list_start\@" {CURRENT_LIST_START}: - ENDC + endc ENDM MACRO li - ASSERT !STRIN(\1, "@"), STRCAT("String terminator \"@\" in list entry: ", \1) + assert !STRIN(\1, "@"), STRCAT("String terminator \"@\" in list entry: ", \1) db \1, "@" DEF list_index += 1 ENDM MACRO assert_list_length DEF x = \1 - ASSERT x == list_index, \ + assert x == list_index, \ "{CURRENT_LIST_START}: expected {d:x} entries, got {d:list_index}" ENDM @@ -47,7 +47,7 @@ MACRO def_grass_wildmons ENDM MACRO end_grass_wildmons - ASSERT GRASS_WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ + assert GRASS_WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ "def_grass_wildmons {CURRENT_GRASS_WILDMONS_MAP}: expected {d:GRASS_WILDDATA_LENGTH} bytes" ENDM @@ -60,6 +60,6 @@ MACRO def_water_wildmons ENDM MACRO end_water_wildmons - ASSERT WATER_WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ + assert WATER_WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ "def_water_wildmons {CURRENT_WATER_WILDMONS_MAP}: expected {d:WATER_WILDDATA_LENGTH} bytes" ENDM diff --git a/macros/code.asm b/macros/code.asm index fc6305a46..6856b1dcb 100644 --- a/macros/code.asm +++ b/macros/code.asm @@ -34,18 +34,18 @@ MACRO maskbits ; maskbits 26 ; cp 26 ; jr nc, .loop - ASSERT 0 < (\1) && (\1) <= $100, "bitmask must be 8-bit" + assert 0 < (\1) && (\1) <= $100, "bitmask must be 8-bit" DEF x = 1 - REPT 8 - IF x + 1 < (\1) + rept 8 + if x + 1 < (\1) DEF x = (x << 1) | 1 - ENDC - ENDR - IF _NARG == 2 + endc + endr + if _NARG == 2 and x << (\2) - ELSE + else and x - ENDC + endc ENDM MACRO calc_sine_wave @@ -68,11 +68,11 @@ MACRO calc_sine_wave ld e, a ld a, d ld d, 0 -IF _NARG == 1 +if _NARG == 1 ld hl, \1 -ELSE +else ld hl, .sinetable\@ -ENDC +endc add hl, de add hl, de ld e, [hl] @@ -89,8 +89,8 @@ ENDC and a jr nz, .multiply\@ ret -IF _NARG == 0 +if _NARG == 0 .sinetable\@ sine_table 32 -ENDC +endc ENDM diff --git a/macros/const.asm b/macros/const.asm index ad9426de4..4b7acdda1 100644 --- a/macros/const.asm +++ b/macros/const.asm @@ -1,16 +1,16 @@ ; Enumerate constants MACRO const_def - IF _NARG >= 1 + if _NARG >= 1 DEF const_value = \1 - ELSE + else DEF const_value = 0 - ENDC - IF _NARG >= 2 + endc + if _NARG >= 2 DEF const_inc = \2 - ELSE + else DEF const_inc = 1 - ENDC + endc ENDM MACRO const @@ -24,25 +24,25 @@ MACRO shift_const ENDM MACRO const_skip - IF _NARG >= 1 + if _NARG >= 1 DEF const_value += const_inc * (\1) - ELSE + else DEF const_value += const_inc - ENDC + endc ENDM MACRO const_next - IF (const_value > 0 && \1 < const_value) || (const_value < 0 && \1 > const_value) - FAIL "const_next cannot go backwards from {const_value} to \1" - ELSE + if (const_value > 0 && \1 < const_value) || (const_value < 0 && \1 > const_value) + fail "const_next cannot go backwards from {const_value} to \1" + else DEF const_value = \1 - ENDC + endc ENDM MACRO rb_skip - IF _NARG == 1 + if _NARG == 1 rsset _RS + \1 - ELSE + else rsset _RS + 1 - ENDC + endc ENDM diff --git a/macros/coords.asm b/macros/coords.asm index f095f6410..e899e68e7 100644 --- a/macros/coords.asm +++ b/macros/coords.asm @@ -6,11 +6,11 @@ DEF decoord EQUS "coord de," MACRO coord ; register, x, y[, origin] - IF _NARG < 4 + if _NARG < 4 ld \1, (\3) * SCREEN_WIDTH + (\2) + wTilemap - ELSE + else ld \1, (\3) * SCREEN_WIDTH + (\2) + \4 - ENDC + endc ENDM DEF hlbgcoord EQUS "bgcoord hl," @@ -19,37 +19,37 @@ DEF debgcoord EQUS "bgcoord de," MACRO bgcoord ; register, x, y[, origin] - IF _NARG < 4 + if _NARG < 4 ld \1, (\3) * BG_MAP_WIDTH + (\2) + vBGMap0 - ELSE + else ld \1, (\3) * BG_MAP_WIDTH + (\2) + \4 - ENDC + endc ENDM MACRO dwcoord ; x, y - REPT _NARG / 2 + rept _NARG / 2 dw (\2) * SCREEN_WIDTH + (\1) + wTilemap shift 2 - ENDR + endr ENDM MACRO ldcoord_a ; x, y[, origin] - IF _NARG < 3 + if _NARG < 3 ld [(\2) * SCREEN_WIDTH + (\1) + wTilemap], a - ELSE + else ld [(\2) * SCREEN_WIDTH + (\1) + \3], a - ENDC + endc ENDM MACRO lda_coord ; x, y[, origin] - IF _NARG < 3 + if _NARG < 3 ld a, [(\2) * SCREEN_WIDTH + (\1) + wTilemap] - ELSE + else ld a, [(\2) * SCREEN_WIDTH + (\1) + \3] - ENDC + endc ENDM MACRO menu_coords diff --git a/macros/data.asm b/macros/data.asm index 6180c5f94..5962ec16c 100644 --- a/macros/data.asm +++ b/macros/data.asm @@ -26,7 +26,7 @@ DEF percent EQUS "* $ff / 100" DEF out_of EQUS "* $100 /" MACRO assert_power_of_2 - ASSERT (\1) & ((\1) - 1) == 0, "\1 must be a power of 2" + assert (\1) & ((\1) - 1) == 0, "\1 must be a power of 2" ENDM ; Constant data (db, dw, dl) macros @@ -42,17 +42,17 @@ MACRO dbw ENDM MACRO dn ; nybbles - REPT _NARG / 2 + rept _NARG / 2 db ((\1) << 4) | (\2) shift 2 - ENDR + endr ENDM MACRO dc ; "crumbs" - REPT _NARG / 4 + rept _NARG / 4 db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4) shift 4 - ENDR + endr ENDM MACRO dt ; three-byte (big-endian) @@ -68,17 +68,17 @@ MACRO bigdw ; big-endian word ENDM MACRO dba ; dbw bank, address - REPT _NARG + rept _NARG dbw BANK(\1), \1 shift - ENDR + endr ENDM MACRO dab ; dwb address, bank - REPT _NARG + rept _NARG dwb \1, BANK(\1) shift - ENDR + endr ENDM MACRO dba_pic ; dbw bank, address @@ -87,15 +87,15 @@ MACRO dba_pic ; dbw bank, address ENDM MACRO bcd - REPT _NARG + rept _NARG dn ((\1) % 100) / 10, (\1) % 10 shift - ENDR + endr ENDM MACRO sine_table ; \1 samples of sin(x) from x=0 to x<0.5 turns (pi radians) for x, \1 dw sin(x * 0.5 / (\1)) - ENDR + endr ENDM diff --git a/macros/gfx.asm b/macros/gfx.asm index e47fd9c34..630b131cd 100644 --- a/macros/gfx.asm +++ b/macros/gfx.asm @@ -1,18 +1,18 @@ ; Graphics macros MACRO assert_valid_rgb - REPT _NARG - ASSERT 0 <= (\1) && (\1) <= 31, "RGB channel must be 0-31" + rept _NARG + assert 0 <= (\1) && (\1) <= 31, "RGB channel must be 0-31" shift - ENDR + endr ENDM MACRO RGB - REPT _NARG / 3 + rept _NARG / 3 assert_valid_rgb \1, \2, \3 dw palred (\1) + palgreen (\2) + palblue (\3) shift 3 - ENDR + endr ENDM DEF palred EQUS "(1 << 0) *" @@ -32,23 +32,23 @@ DEF tile EQUS "+ LEN_2BPP_TILE *" DEF middle_colors EQUS "PAL_COLOR_SIZE, PAL_COLOR_SIZE * 2" MACRO dbpixel - IF _NARG >= 4 + if _NARG >= 4 ; x tile, y tile, x pixel, y pixel db \1 * TILE_WIDTH + \3, \2 * TILE_WIDTH + \4 - ELSE + else ; x tile, y tile db \1 * TILE_WIDTH, \2 * TILE_WIDTH - ENDC + endc ENDM MACRO ldpixel - IF _NARG >= 5 + if _NARG >= 5 ; register, x tile, y tile, x pixel, y pixel lb \1, \2 * TILE_WIDTH + \4, \3 * TILE_WIDTH + \5 - ELSE + else ; register, x tile, y tile lb \1, \2 * TILE_WIDTH, \3 * TILE_WIDTH - ENDC + endc ENDM DEF depixel EQUS "ldpixel de," diff --git a/macros/legacy.asm b/macros/legacy.asm index 02ccf6045..68310da68 100644 --- a/macros/legacy.asm +++ b/macros/legacy.asm @@ -50,11 +50,11 @@ MACRO noise ENDM MACRO notetype - IF _NARG >= 2 + if _NARG >= 2 note_type \1, \2 >> 4, \2 & $0f - ELSE + else note_type \1 - ENDC + endc ENDM MACRO pitchoffset @@ -74,11 +74,11 @@ ENDM DEF unknownmusic0xde EQUS "sound_duty" MACRO sound_duty db duty_cycle_pattern_cmd - IF _NARG == 4 + if _NARG == 4 db \1 | (\2 << 2) | (\3 << 4) | (\4 << 6) - ELSE + else db \1 - ENDC + endc ENDM DEF togglesfx EQUS "toggle_sfx" diff --git a/macros/ram.asm b/macros/ram.asm index cde82a4c1..b2dc70125 100644 --- a/macros/ram.asm +++ b/macros/ram.asm @@ -106,17 +106,17 @@ MACRO box ; \1Mon1 - \1Mon20 for n, 1, MONS_PER_BOX + 1 \1Mon{d:n}:: box_struct \1Mon{d:n} - ENDR + endr \1MonOTs:: ; \1Mon1OT - \1Mon20OT for n, 1, MONS_PER_BOX + 1 \1Mon{d:n}OT:: ds NAME_LENGTH - ENDR + endr \1MonNicknames:: ; \1Mon1Nickname - \1Mon20Nickname for n, 1, MONS_PER_BOX + 1 \1Mon{d:n}Nickname:: ds MON_NAME_LENGTH - ENDR + endr \1MonNicknamesEnd:: \1End:: ds 2 ; padding @@ -185,7 +185,7 @@ MACRO battle_tower_struct for n, 1, BATTLETOWER_PARTY_LENGTH + 1 \1Mon{d:n}:: party_struct \1Mon{d:n} \1Mon{d:n}Name:: ds MON_NAME_LENGTH - ENDR + endr \1TrainerData:: ds EASY_CHAT_MESSAGE_LENGTH * 3 \1TrainerEnd:: ENDM @@ -240,7 +240,7 @@ MACRO hall_of_fame ; \1Mon1 - \1Mon6 for n, 1, PARTY_LENGTH + 1 \1Mon{d:n}:: hof_mon \1Mon{d:n} - ENDR + endr \1End:: db ENDM diff --git a/macros/scripts/audio.asm b/macros/scripts/audio.asm index 02a85ffa6..5375380d7 100644 --- a/macros/scripts/audio.asm +++ b/macros/scripts/audio.asm @@ -1,11 +1,11 @@ MACRO channel_count - ASSERT 0 < (\1) && (\1) <= NUM_MUSIC_CHANS, \ + assert 0 < (\1) && (\1) <= NUM_MUSIC_CHANS, \ "channel_count must be 1-{d:NUM_MUSIC_CHANS}" DEF _num_channels = \1 - 1 ENDM MACRO channel - ASSERT 0 < (\1) && (\1) <= NUM_CHANNELS, \ + assert 0 < (\1) && (\1) <= NUM_CHANNELS, \ "channel id must be 1-{d:NUM_CHANNELS}" dn (_num_channels << 2), \1 - 1 ; channel id dw \2 ; address @@ -26,21 +26,21 @@ ENDM MACRO square_note db \1 ; length - IF \3 < 0 + if \3 < 0 dn \2, %1000 | (\3 * -1) ; volume envelope - ELSE + else dn \2, \3 ; volume envelope - ENDC + endc dw \4 ; frequency ENDM MACRO noise_note db \1 ; length - IF \3 < 0 + if \3 < 0 dn \2, %1000 | (\3 * -1) ; volume envelope - ELSE + else dn \2, \3 ; volume envelope - ENDC + endc db \4 ; frequency ENDM @@ -50,7 +50,7 @@ DEF FIRST_MUSIC_CMD EQU const_value const octave_cmd ; $d0 MACRO octave - ASSERT 1 <= (\1) && (\1) <= 8, "octave must be 1-8" + assert 1 <= (\1) && (\1) <= 8, "octave must be 1-8" db octave_cmd + 8 - (\1) ; octave ENDM @@ -60,13 +60,13 @@ ENDM MACRO note_type db note_type_cmd db \1 ; note length - IF _NARG >= 2 - IF \3 < 0 + if _NARG >= 2 + if \3 < 0 dn \2, %1000 | (\3 * -1) ; volume envelope - ELSE + else dn \2, \3 ; volume envelope - ENDC - ENDC + endc + endc ENDM ; only valid on the noise channel @@ -95,21 +95,21 @@ ENDM const volume_envelope_cmd ; $dc MACRO volume_envelope db volume_envelope_cmd - IF \2 < 0 + if \2 < 0 dn \1, %1000 | (\2 * -1) ; volume envelope - ELSE + else dn \1, \2 ; volume envelope - ENDC + endc ENDM const pitch_sweep_cmd ; $dd MACRO pitch_sweep db pitch_sweep_cmd - IF \2 < 0 + if \2 < 0 dn \1, %1000 | (\2 * -1) ; pitch sweep - ELSE + else dn \1, \2 ; pitch sweep - ENDC + endc ENDM const duty_cycle_pattern_cmd ; $de @@ -134,11 +134,11 @@ ENDM MACRO vibrato db vibrato_cmd db \1 ; delay - IF _NARG > 2 + if _NARG > 2 dn \2, \3 ; extent, rate - ELSE + else db \2 ; LEGACY: Support for 1-arg extent - ENDC + endc ENDM const unknownmusic0xe2_cmd ; $e2 @@ -150,9 +150,9 @@ ENDM const toggle_noise_cmd ; $e3 MACRO toggle_noise db toggle_noise_cmd - IF _NARG > 0 + if _NARG > 0 db \1 ; drum kit - ENDC + endc ENDM const force_stereo_panning_cmd ; $e4 @@ -164,11 +164,11 @@ ENDM const volume_cmd ; $e5 MACRO volume db volume_cmd - IF _NARG > 1 + if _NARG > 1 dn \1, \2 ; left volume, right volume - ELSE + else db \1 ; LEGACY: Support for 1-arg volume - ENDC + endc ENDM const pitch_offset_cmd ; $e6 @@ -232,9 +232,9 @@ ENDM const sfx_toggle_noise_cmd ; $f0 MACRO sfx_toggle_noise db sfx_toggle_noise_cmd - IF _NARG > 0 + if _NARG > 0 db \1 ; drum kit - ENDC + endc ENDM const music0xf1_cmd ; $f1 diff --git a/macros/scripts/battle_anims.asm b/macros/scripts/battle_anims.asm index a0799e5e2..9410f015e 100644 --- a/macros/scripts/battle_anims.asm +++ b/macros/scripts/battle_anims.asm @@ -3,25 +3,25 @@ DEF FIRST_BATTLE_ANIM_CMD EQU const_value MACRO anim_wait - ASSERT (\1) < FIRST_BATTLE_ANIM_CMD, "anim_wait argument must be less than {FIRST_BATTLE_ANIM_CMD}" + assert (\1) < FIRST_BATTLE_ANIM_CMD, "anim_wait argument must be less than {FIRST_BATTLE_ANIM_CMD}" db \1 ENDM const anim_obj_command ; $d0 MACRO anim_obj db anim_obj_command - IF _NARG <= 4 + if _NARG <= 4 db \1 ; object db \2 ; x db \3 ; y db \4 ; param - ELSE + else ; LEGACY: Support the tile+offset format db \1 ; object db (\2) * TILE_WIDTH + (\3) ; x_tile, x db (\4) * TILE_WIDTH + (\5) ; y_tile, y db \6 ; param - ENDC + endc ENDM const anim_1gfx_command ; $d1 diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index eb40f9820..f22df1827 100644 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -187,36 +187,36 @@ ENDM const loadvar_command ; $1e MACRO loadvar - IF STRIN("\1", "VAR_") != 1 + if STRIN("\1", "VAR_") != 1 ; LEGACY: Support for the old name of "loadmem" loadmem \1, \2 - ELSE + else db loadvar_command db \1 ; variable_id db \2 ; value - ENDC + endc ENDM const giveitem_command ; $1f MACRO giveitem - IF _NARG == 1 + if _NARG == 1 giveitem \1, 1 - ELSE + else db giveitem_command db \1 ; item db \2 ; quantity - ENDC + endc ENDM const takeitem_command ; $20 MACRO takeitem - IF _NARG == 1 + if _NARG == 1 takeitem \1, 1 - ELSE + else db takeitem_command db \1 ; item db \2 ; quantity - ENDC + endc ENDM const checkitem_command ; $21 @@ -296,23 +296,23 @@ ENDM const givepoke_command ; $2d MACRO givepoke - IF _NARG == 2 + if _NARG == 2 givepoke \1, \2, NO_ITEM, FALSE - ELIF _NARG == 3 + elif _NARG == 3 givepoke \1, \2, \3, FALSE - ELIF _NARG == 5 + elif _NARG == 5 givepoke \1, \2, \3, TRUE, \4, \5 - ELSE + else db givepoke_command db \1 ; pokemon db \2 ; level db \3 ; item db \4 ; trainer - IF \4 + if \4 dw \5 ; nickname_pointer dw \6 ; ot_name_pointer - ENDC - ENDC + endc + endc ENDM const giveegg_command ; $2e @@ -478,12 +478,12 @@ ENDM const refreshscreen_command ; $48 MACRO refreshscreen - IF _NARG == 0 + if _NARG == 0 refreshscreen 0 - ELSE + else db refreshscreen_command db \1 ; dummy - ENDC + endc ENDM const closetext_command ; $49 @@ -984,13 +984,13 @@ ENDM const verbosegiveitem_command ; $9e MACRO verbosegiveitem - IF _NARG == 1 + if _NARG == 1 verbosegiveitem \1, 1 - ELSE + else db verbosegiveitem_command db \1 ; item db \2 ; quantity - ENDC + endc ENDM const verbosegiveitemvar_command ; $9f diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm index 73024e88f..1181ba543 100644 --- a/macros/scripts/maps.asm +++ b/macros/scripts/maps.asm @@ -1,6 +1,6 @@ MACRO map_id ;\1: map id - ASSERT DEF(GROUP_\1) && DEF(MAP_\1), \ + assert DEF(GROUP_\1) && DEF(MAP_\1), \ "Missing 'map_const \1' in constants/map_constants.asm" db GROUP_\1, MAP_\1 ENDM @@ -25,11 +25,11 @@ MACRO scene_script ;\2: scene id constant dw \1 dw 0 ; filler - IF _NARG == 2 + if _NARG == 2 scene_const \2 - ELSE + else const_skip - ENDC + endc DEF {_NUM_SCENE_SCRIPTS} += 1 ENDM @@ -126,9 +126,9 @@ MACRO object_event db \<11> dw \<12>, \<13> ; the dummy PlayerObjectTemplate object_event has no def_object_events - IF DEF(_NUM_OBJECT_EVENTS) + if DEF(_NUM_OBJECT_EVENTS) DEF {_NUM_OBJECT_EVENTS} += 1 - ENDC + endc ENDM MACRO trainer @@ -147,11 +147,11 @@ ENDM MACRO itemball ;\1: item: from constants/item_constants.asm ;\2: quantity: default 1 - IF _NARG == 1 + if _NARG == 1 itemball \1, 1 - ELSE + else db \1, \2 - ENDC + endc ENDM MACRO hiddenitem diff --git a/macros/scripts/movement.asm b/macros/scripts/movement.asm index 47e8bbd21..b5fc59bc4 100644 --- a/macros/scripts/movement.asm +++ b/macros/scripts/movement.asm @@ -110,11 +110,11 @@ ENDM const movement_step_sleep ; $3e MACRO step_sleep - IF \1 <= 8 + if \1 <= 8 db movement_step_sleep + \1 - 1 - ELSE + else db movement_step_sleep + 8, \1 - ENDC + endc ENDM const_skip 8 ; all step_sleep values diff --git a/macros/scripts/oam_anims.asm b/macros/scripts/oam_anims.asm index c5fa0768a..2bd751cfb 100644 --- a/macros/scripts/oam_anims.asm +++ b/macros/scripts/oam_anims.asm @@ -3,14 +3,14 @@ MACRO oamframe db \1 ; duration DEF x = \2 - ASSERT !(x & (1 << (OAM_X_FLIP + 1) | 1 << (OAM_Y_FLIP + 1))), \ + assert !(x & (1 << (OAM_X_FLIP + 1) | 1 << (OAM_Y_FLIP + 1))), \ "oamframe duration overflows into X/Y flip bits" - IF _NARG > 2 - REPT _NARG - 2 + if _NARG > 2 + rept _NARG - 2 DEF x |= 1 << (\3 + 1) shift - ENDR - ENDC + endr + endc db x ; flags ENDM diff --git a/macros/scripts/pic_anims.asm b/macros/scripts/pic_anims.asm index 3dd684b73..45320460b 100644 --- a/macros/scripts/pic_anims.asm +++ b/macros/scripts/pic_anims.asm @@ -1,11 +1,11 @@ MACRO frame - IF _NARG <= 2 + if _NARG <= 2 db \1 ; index db \2 ; duration - ELSE + else ; LEGACY: Support for the old name of "oamanim" oamanim \# - ENDC + endc ENDM const_def -1, -1 diff --git a/macros/vc.asm b/macros/vc.asm index 2a9c4bf65..b104cb524 100644 --- a/macros/vc.asm +++ b/macros/vc.asm @@ -1,29 +1,29 @@ ; Virtual Console macros MACRO vc_hook - IF DEF(_CRYSTAL11_VC) + if DEF(_CRYSTAL11_VC) .VC_\1:: - ENDC + endc ENDM MACRO vc_patch - IF DEF(_CRYSTAL11_VC) - ASSERT !DEF(CURRENT_VC_PATCH), "Already started a vc_patch" + if DEF(_CRYSTAL11_VC) + assert !DEF(CURRENT_VC_PATCH), "Already started a vc_patch" DEF CURRENT_VC_PATCH EQUS "\1" .VC_{CURRENT_VC_PATCH}:: - ENDC + endc ENDM MACRO vc_patch_end - IF DEF(_CRYSTAL11_VC) - ASSERT DEF(CURRENT_VC_PATCH), "No vc_patch started" + if DEF(_CRYSTAL11_VC) + assert DEF(CURRENT_VC_PATCH), "No vc_patch started" .VC_{CURRENT_VC_PATCH}_End:: PURGE CURRENT_VC_PATCH - ENDC + endc ENDM MACRO vc_assert - IF DEF(_CRYSTAL11_VC) - ASSERT \# - ENDC + if DEF(_CRYSTAL11_VC) + assert \# + endc ENDM diff --git a/main.asm b/main.asm index e4f75d164..441028298 100644 --- a/main.asm +++ b/main.asm @@ -661,9 +661,9 @@ INCLUDE "engine/pokemon/european_mail.asm" SECTION "Debug Room", ROMX -IF DEF(_DEBUG) +if DEF(_DEBUG) INCLUDE "engine/debug/debug_room.asm" -ENDC +endc SECTION "Battle Tower Text", ROMX @@ -700,8 +700,8 @@ SECTION "Stadium 2 Checksums", ROMX[$7DE0], BANK[$7F] ; Pokémon Stadium Gold and Silver was the third Stadium release for N64.) ; This SECTION reserves space for those checksums. ; If it is removed, also remove the "tools/stadium" command in the Makefile. -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) INCBIN "mobile/stadium/stadium2_au.bin" -ELSE +else INCBIN "mobile/stadium/stadium2.bin" -ENDC \ No newline at end of file +endc \ No newline at end of file diff --git a/maps/CeladonCity.asm b/maps/CeladonCity.asm index 7e6a34b72..a9c29002b 100644 --- a/maps/CeladonCity.asm +++ b/maps/CeladonCity.asm @@ -89,11 +89,11 @@ CeladonCityPoliwrathText: done CeladonCityTeacher1Text: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "I lost at the" line "machines." done -ELSE +else text "I lost at the slot" line "machines again…" @@ -103,7 +103,7 @@ ELSE para "You should check" line "them out too." done -ENDC +endc CeladonCityGramps1Text: text "GRIMER have been" @@ -217,17 +217,17 @@ CeladonCityMansionSignText: done CeladonCityGameCornerSignText: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "The Game Area for" line "Grown-ups--CELADON" cont "GAME CORNER" done -ELSE +else text "The Playground for" line "Everybody--CELADON" cont "GAME CORNER" done -ENDC +endc CeladonCityTrainerTipsText: text "TRAINER TIPS" diff --git a/maps/CeladonGameCorner.asm b/maps/CeladonGameCorner.asm index 62e439b44..37686168c 100644 --- a/maps/CeladonGameCorner.asm +++ b/maps/CeladonGameCorner.asm @@ -163,12 +163,12 @@ CeladonGameCornerPokefanMText: done CeladonGameCornerTeacherText: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "The weather" line "outside is very" cont "nice." done -ELSE +else text "It's this machine" line "I want." @@ -178,15 +178,15 @@ ELSE para "should pay out" line "today." done -ENDC +endc CeladonGameCornerFishingGuruText: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "This machine looks" line "the same as the" cont "others." done -ELSE +else text "I think this slot" line "machine will pay" cont "out…" @@ -194,10 +194,10 @@ ELSE para "The odds vary" line "among machines." done -ENDC +endc CeladonGameCornerFisherText1: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "Whoa!" para "What? You want to" @@ -206,7 +206,7 @@ IF DEF(_CRYSTAL_AU) para "Here, take my" line "coins." done -ELSE +else text "Gahahaha!" para "The coins just" @@ -218,7 +218,7 @@ ELSE para "I'll share my luck" line "with you!" done -ENDC +endc CeladonGameCornerFisherText2: text "Gahahaha!" @@ -240,11 +240,11 @@ CeladonGameCornerFisherNoCoinCaseText: done CeladonGameCornerFisherFullCoinCaseText: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "Your COIN CASE is" line "full." done -ELSE +else text "Hey, your COIN" line "CASE is full, kid." @@ -252,18 +252,18 @@ ELSE line "a winning streak" cont "too." done -ENDC +endc CeladonGymGuideText: text "Hey! CHAMP in" line "making!" para "Are you playing" -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) line "too?" -ELSE +else line "the slots too?" -ENDC +endc para "I'm trying to get" line "enough coins for a" @@ -274,19 +274,19 @@ ENDC done CeladonGameCornerGrampsText: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "Is there any" line "difference between" cont "these lines?" done -ELSE +else text "Hmmm… The odds are" line "surely better for" para "PIKACHU's line," line "but… What to do?" done -ENDC +endc CeladonGameCornerPoster1Text: text "Hey!" diff --git a/maps/CeladonGameCornerPrizeRoom.asm b/maps/CeladonGameCornerPrizeRoom.asm index ee21fd8fa..fd1c90a2d 100644 --- a/maps/CeladonGameCornerPrizeRoom.asm +++ b/maps/CeladonGameCornerPrizeRoom.asm @@ -214,11 +214,11 @@ CeladonGameCornerPrizeRoomGentlemanText: done CeladonGameCornerPrizeRoomPharmacistText: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "I don't want to" line "lose my coins." done -ELSE +else text "Whew…" para "I've got to stay" @@ -228,7 +228,7 @@ ELSE line "cool, or I'll lose" cont "all my money…" done -ENDC +endc CeladonPrizeRoom_PrizeVendorIntroText: text "Welcome!" diff --git a/maps/GoldenrodGameCorner.asm b/maps/GoldenrodGameCorner.asm index f0dbce186..d80723168 100644 --- a/maps/GoldenrodGameCorner.asm +++ b/maps/GoldenrodGameCorner.asm @@ -364,29 +364,29 @@ GoldenrodGameCornerPrizeVendorNoCoinCaseText: done GoldenrodGameCornerPharmacistText: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "This machine looks" line "the same as the" cont "others." done -ELSE +else text "I always play this" line "slot machine. It" para "pays out more than" line "others, I think." done -ENDC +endc GoldenrodGameCornerPokefanM1Text: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "These machines" line "seem different" para "from the ones at" line "CELADON CITY!" done -ELSE +else text "I just love this" line "new slot machine." @@ -394,28 +394,28 @@ ELSE line "challenge than the" cont "ones in CELADON." done -ENDC +endc GoldenrodGameCornerCooltrainerMText: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "Nothing is certain" line "in this area." done -ELSE +else text "Life is a gamble." line "I'm going to flip" cont "cards till I drop!" done -ENDC +endc GoldenrodGameCornerPokefanFText: text "Card flip…" -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) para "Different from the" line "other machines." done -ELSE +else para "I prefer it over" line "the slots because" @@ -425,7 +425,7 @@ ELSE para "But the payout is" line "much lower." done -ENDC +endc GoldenrodGameCornerCooltrainerFText: text "I won't quit until" @@ -444,12 +444,12 @@ GoldenrodGameCornerGentlemanText: done GoldenrodGameCornerPokefanM2Text: -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) text "COIN CASE? I threw" line "it away in the" cont "UNDERGROUND." done -ELSE +else text "I couldn't win at" line "the slots, and I" @@ -462,7 +462,7 @@ ELSE para "COIN CASE in the" line "UNDERGROUND." done -ENDC +endc MoveTutorInsideText: text "Wahahah! The coins" diff --git a/mobile/currency_finder.asm b/mobile/currency_finder.asm index b280fd3fe..7d11754ae 100644 --- a/mobile/currency_finder.asm +++ b/mobile/currency_finder.asm @@ -8,7 +8,7 @@ WriteCurrencyName:: ; Input: none. wPrefecture should be set to the prefecture of the user. ; Output: HL = the address of the string to use for the currency. DetermineCurrencyName: -IF DEF(_CRYSTAL_EU) +if DEF(_CRYSTAL_EU) ; EU region. ld a, [wPrefecture] ; Loads the Prefectures index (starts at 0) selected by the player. The Prefectures list is stored into mobile_12.asm dec a ; Beware: it the value is 0, dec will underflow and default to the default value @@ -116,10 +116,10 @@ IF DEF(_CRYSTAL_EU) ret z ld hl, String_Currency_Cents ; Default case. Anything that uses Cents doesn't need to be added into this check list. -ELSE +else ; AU and US regions. Cents in all cases. ld hl, String_Currency_Cents -ENDC +endc ret ; Input: HL = the address to copy from. diff --git a/mobile/fixed_words.asm b/mobile/fixed_words.asm index f9ab9101f..4b84e06c5 100644 --- a/mobile/fixed_words.asm +++ b/mobile/fixed_words.asm @@ -304,9 +304,9 @@ CopyMobileEZChatToC608: ; sla c ; rl b ; add hl, bc -REPT EZCHAT_WORD_LENGTH + 3 ; fuck it, do (bc * 11) this way +rept EZCHAT_WORD_LENGTH + 3 ; fuck it, do (bc * 11) this way add hl, bc -ENDR +endr ; got word address ld bc, EZCHAT_WORD_LENGTH .copy_string @@ -1027,12 +1027,12 @@ EZChatString_ChatExplanationBottom: ; Explanation commands string db "RESET QUIT  OK@";"ぜんぶけす やめる   けってい@" ; ezchat categories defines -DEF EZCHAT_CATEGORIES_ROWS EQU 5 -DEF EZCHAT_CATEGORIES_COLUMNS EQU 2 -DEF EZCHAT_DISPLAYED_CATEGORIES EQU (EZCHAT_CATEGORIES_ROWS * EZCHAT_CATEGORIES_COLUMNS) -DEF EZCHAT_NUM_CATEGORIES EQU 15 -DEF EZCHAT_NUM_EXTRA_ROWS EQU ((EZCHAT_NUM_CATEGORIES + 1 - EZCHAT_DISPLAYED_CATEGORIES) / 2) -DEF EZCHAT_EMPTY_VALUE EQU ((EZCHAT_NUM_EXTRA_ROWS << 5) | (EZCHAT_DISPLAYED_CATEGORIES - 1)) +def EZCHAT_CATEGORIES_ROWS EQU 5 +def EZCHAT_CATEGORIES_COLUMNS EQU 2 +def EZCHAT_DISPLAYED_CATEGORIES EQU (EZCHAT_CATEGORIES_ROWS * EZCHAT_CATEGORIES_COLUMNS) +def EZCHAT_NUM_CATEGORIES EQU 15 +def EZCHAT_NUM_EXTRA_ROWS EQU ((EZCHAT_NUM_CATEGORIES + 1 - EZCHAT_DISPLAYED_CATEGORIES) / 2) +def EZCHAT_EMPTY_VALUE EQU ((EZCHAT_NUM_EXTRA_ROWS << 5) | (EZCHAT_DISPLAYED_CATEGORIES - 1)) const_def EZCHAT_DISPLAYED_CATEGORIES const EZCHAT_CATEGORY_CANC @@ -4768,9 +4768,9 @@ MACRO macro_11f220 db \1 ; 12 words per page (0-based indexing) DEF x = \1 / (EZCHAT_WORD_COUNT * 2) ; 12 MENU_WIDTH to 8 - IF \1 % (EZCHAT_WORD_COUNT * 2) == 0 ; 12 MENU_WIDTH to 8 + if \1 % (EZCHAT_WORD_COUNT * 2) == 0 ; 12 MENU_WIDTH to 8 DEF x = x + -1 - ENDC + endc db x ENDM macro_11f220 18 ; 01: Types diff --git a/mobile/mobile_12.asm b/mobile/mobile_12.asm index 61216e267..1afe3e9ed 100644 --- a/mobile/mobile_12.asm +++ b/mobile/mobile_12.asm @@ -98,22 +98,22 @@ InitMobileProfile: call GetNthString ld d, h ld e, l - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 5 ; Default gender position in MOBILE menu - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 5 ; Default gender position in MOBILE menu - ELSE + else hlcoord 9, 5 ; Default gender position in MOBILE menu - ENDC + endc call PlaceString .asm_48113 - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 7 ; Default age position in MOBILE menu - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 7 ; Default age position in MOBILE menu - ELSE + else hlcoord 9, 7 ; Default age position in MOBILE menu - ENDC + endc call Function487ec ld a, [wPrefecture] dec a @@ -121,13 +121,13 @@ InitMobileProfile: call GetNthString ld d, h ld e, l - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 15 - REGION_CODE_STRING_LENGTH, 9 ; Default Prefectures position in MOBILE menu - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 14 - REGION_CODE_STRING_LENGTH, 9 ; Default Prefectures position in MOBILE menu - ELSE + else hlcoord 14 - REGION_CODE_STRING_LENGTH, 9 ; Default Prefectures position in MOBILE menu - ENDC + endc call PlaceString call DisplayZipCodeRightAlign hlcoord 0, 14 ; 'Personal Info' box position @@ -225,37 +225,37 @@ Mobile12_ClearBlankUserParameters: bit 0, d jr nz, .asm_481c1 lb bc, 1, 8 - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 5 ; Gender position - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 5 ; Gender position - ELSE + else hlcoord 9, 5 ; Gender position - ENDC + endc call ClearBox .asm_481c1 bit 1, d jr nz, .asm_481ce lb bc, 1, 8 - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 7 ; Age position ; Don't change - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 7 ; Age position ; Don't change - ELSE + else hlcoord 9, 7 ; Age position ; Don't change - ENDC + endc call ClearBox .asm_481ce bit 2, d jr nz, .asm_481db lb bc, 1, 8 - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 9 ; prefecture position - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 9 ; prefecture position - ELSE + else hlcoord 9, 9 ; prefecture position - ENDC + endc call ClearBox .asm_481db bit 3, d @@ -264,13 +264,13 @@ Mobile12_ClearBlankUserParameters: bit 0, a jr nz, .asm_481f8 lb bc, 1, 9 - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 11 ; Zip code location - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 11 ; Zip code location - ELSE + else hlcoord 9, 11 ; Zip code location - ENDC + endc call ClearBox jr .asm_48201 .asm_481f1 @@ -361,7 +361,7 @@ GenderPressed: ld hl, MenuHeader_0x484f1 call LoadMenuHeader call SetCursorParameters_Gender - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 2 ; Gender menu position ld b, $4 ld c, $9 @@ -370,7 +370,7 @@ GenderPressed: ld de, String_484fb call PlaceString hlcoord 11, 6 ; Position of Female Gender string in Gender menu - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 2 ; Gender menu position ld b, $4 ld c, $9 @@ -379,7 +379,7 @@ GenderPressed: ld de, String_484fb call PlaceString hlcoord 11, 6 ; Position of Female Gender string in Gender menu - ELSE + else hlcoord 9, 2 ; Gender menu position ld b, $4 ld c, $9 @@ -388,7 +388,7 @@ GenderPressed: ld de, String_484fb call PlaceString hlcoord 11, 6 ; Position of Female Gender string in Gender menu - ENDC + endc ld de, String_484ff call PlaceString call WaitBGMap @@ -418,13 +418,13 @@ GenderPressed: .asm_482f1 ld d, h ld e, l - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 5 ; Gender position - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 5 ; Gender position - ELSE + else hlcoord 9, 5 ; Gender position - ENDC + endc call PlaceString hlcoord 8, 5 ; Placement of Gender Colon Text ld de, Colon @@ -443,19 +443,19 @@ RegionCodePressed: call LoadMenuHeader ld hl, MenuHeader_0x48513 call LoadMenuHeader - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 15 - REGION_CODE_STRING_LENGTH, 0 ld b, 12 ld c, REGION_CODE_STRING_LENGTH + 3 - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 14 - REGION_CODE_STRING_LENGTH, 0 ld b, 12 ld c, REGION_CODE_STRING_LENGTH + 4 - ELSE + else hlcoord 14 - REGION_CODE_STRING_LENGTH, 0 ld b, 12 ld c, REGION_CODE_STRING_LENGTH + 4 - ENDC + endc call DisplayBlankGoldenBox ; This has to do with some display. ld a, [wMenuCursorPosition] ld b, a @@ -595,19 +595,19 @@ SavePrefectureAndDisplayIt: ld e, l ld b, $2 ld c, $8 - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 8 ; ??? Clears the surrounding tiles when prefecture is selected, needs to be moved with preferectures call ClearBox hlcoord 15 - REGION_CODE_STRING_LENGTH, 9 ; Prefectures position when selected - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 8 ; ??? Clears the surrounding tiles when prefecture is selected, needs to be moved with preferectures call ClearBox hlcoord 14 - REGION_CODE_STRING_LENGTH, 9 ; Prefectures position when selected - ELSE + else hlcoord 9, 8 ; ??? Clears the surrounding tiles when prefecture is selected, needs to be moved with preferectures call ClearBox hlcoord 14 - REGION_CODE_STRING_LENGTH, 9 ; Prefectures position when selected - ENDC + endc call PlaceString ret @@ -694,35 +694,35 @@ MobileProfileString: db " Mobile Profile@" MobileString_Gender: db "Gender@" MobileString_Age: db "Age@" MobileString_Address: db "Address@" - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) MobileString_ZipCode: db "Postcode@" - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) MobileString_ZipCode: db "Postcode@" - ELSE + else MobileString_ZipCode: db "Zip Code@" - ENDC + endc MobileString_OK: db "OK@" MobileString_ProfileChanged: db "Profile Changed@" MobileDesc_Gender: db "Boy or girl?@" MobileDesc_Age: db "How old are you?@" MobileDesc_Address: db "Where do you live?@" - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) MobileDesc_ZipCode: db "Your post code?@" - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) MobileDesc_ZipCode: db "Your post code?@" - ELSE + else MobileDesc_ZipCode: db "Your zip code?@" - ENDC + endc MenuHeader_0x484f1: db MENU_BACKUP_TILES ; flags -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) menu_coords 6, 2, SCREEN_WIDTH - 1, 7 ; For clearing the Gender box -ELIF DEF(_CRYSTAL_EU) +elif DEF(_CRYSTAL_EU) menu_coords 6, 2, SCREEN_WIDTH - 1, 7 ; For clearing the Gender box -ELSE +else menu_coords 6, 2, SCREEN_WIDTH - 1, 7 ; For clearing the Gender box -ENDC +endc dw MenuData_0x484f9 db 1 ; default option @@ -733,7 +733,7 @@ Strings_484fb: String_484fb: db "Boy @" String_484ff: db "Girl@" - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) MenuHeader_0x48504: db MENU_BACKUP_TILES ; flags menu_coords 12 - REGION_CODE_STRING_LENGTH, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1 ; For clearing the Address Box @@ -743,16 +743,16 @@ MenuHeader_0x48509: menu_coords 6, 5, SCREEN_WIDTH - 1, 8 ; For clearing the Age Box MenuHeader_ZipCodeEditBox: - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) db MENU_BACKUP_TILES ; flags menu_coords 8 - ZIPCODE_LENGTH, 10, SCREEN_WIDTH - 1, TEXTBOX_Y - 0 ; For clearing the Zip Code box - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) db MENU_BACKUP_TILES ; flags menu_coords 12 - ZIPCODE_LENGTH, 10, SCREEN_WIDTH - 1, TEXTBOX_Y - 0 ; For clearing the Zip Code box - ELSE + else db MENU_BACKUP_TILES ; flags menu_coords 11 - ZIPCODE_LENGTH, 10, SCREEN_WIDTH - 1, TEXTBOX_Y - 0 ; For clearing the Zip Code box - ENDC + endc ;Bounding of left side ; bounding of top ; bounding of right side ; bounding of bottom MenuHeader_0x48513: @@ -760,7 +760,7 @@ MenuHeader_0x48513: menu_coords 16 - REGION_CODE_STRING_LENGTH, 1, 18, 12 ; The placement of the text in the address box dw MenuData_0x4851b db 1 ; default option - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) MenuHeader_0x48504: db MENU_BACKUP_TILES ; flags menu_coords 12 - REGION_CODE_STRING_LENGTH, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1 ; For clearing the Address Box @@ -780,7 +780,7 @@ MenuHeader_0x48513: menu_coords 15 - REGION_CODE_STRING_LENGTH, 1, 18, 12 ; The placement of the text in the address box dw MenuData_0x4851b db 1 ; default option - ELSE + else MenuHeader_0x48504: db MENU_BACKUP_TILES ; flags menu_coords 12 - REGION_CODE_STRING_LENGTH, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1 ; For clearing the Address Box @@ -800,7 +800,7 @@ MenuHeader_0x48513: menu_coords 15 - REGION_CODE_STRING_LENGTH, 1, 18, 12 ; The placement of the text in the address box dw MenuData_0x4851b db 1 ; default option - ENDC + endc MenuData_0x4851b: db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_RIGHT | SCROLLINGMENU_ENABLE_LEFT | SCROLLINGMENU_CALL_FUNCTION1_CANCEL ; flags @@ -814,10 +814,10 @@ MenuData_0x4851b: .Items: db NUM_REGION_CODES - 1 ; The number of locations in the prefectures list (-1 because it starts at 0) DEF x = 0 -REPT NUM_REGION_CODES - 1 ; The number of locations in the prefectures list (-1 because it starts at 0) +rept NUM_REGION_CODES - 1 ; The number of locations in the prefectures list (-1 because it starts at 0) db x DEF x = x + 1 -ENDR +endr db -1 DisplayInitializedMobileProfileLayout: ; Clears the 4 top lines, displays the "Mobile Profile" title, and displays an empty golden box. @@ -960,13 +960,13 @@ SetCursorParameters_Gender: ld hl, w2DMenuCursorInitY ld a, 4 ld [hli], a - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) ld a, 10 ; x axis position of the gender cursor - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) ld a, 10 ; x axis position of the gender cursor - ELSE + else ld a, 10 ; x axis position of the gender cursor - ENDC + endc ld [hli], a ; init x ld a, 2 ld [hli], a ; num rows @@ -1014,7 +1014,7 @@ AgePressed: push af ld a, $1 ldh [hInMenu], a - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 8, 6 ; Age menu position ld b, $1 ld c, $a @@ -1039,7 +1039,7 @@ AgePressed: ld [hl], $11 .asm_487b7 hlcoord 9, 7 ; Age position - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 8, 6 ; Age menu position ld b, $1 ld c, $a @@ -1064,7 +1064,7 @@ AgePressed: ld [hl], $11 .asm_487b7 hlcoord 9, 7 ; Age position - ELSE + else hlcoord 8, 6 ; Age menu position ld b, $1 ld c, $a @@ -1089,7 +1089,7 @@ AgePressed: ld [hl], $11 .asm_487b7 hlcoord 9, 7 ; Age position - ENDC + endc call Function487ec ld c, 10 call DelayFrames @@ -1108,13 +1108,13 @@ AgePressed: .asm_487da ld a, [wAge] call ExitMenu - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 9, 7 ; Age position - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 9, 7 ; Age position - ELSE + else hlcoord 9, 7 ; Age position - ENDC + endc call Function487ec pop af ldh [hInMenu], a @@ -1134,9 +1134,9 @@ Function487ec: ld de, wAge call Function487ff pop hl -REPT 4 +rept 4 inc hl -ENDR +endr ld de, String_4880d call PlaceString ret @@ -1221,7 +1221,7 @@ Function4880e: cp $64 jr z, .asm_48898 jr z, .asm_488a7 - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 10, 6 ; Age menu up arrow position ld [hl], $10 hlcoord 10, 8 ; Age menu down arrow position @@ -1244,7 +1244,7 @@ Function4880e: ld [hl], $11 .asm_488a7 hlcoord 9, 7 ; Age position - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 10, 6 ; Age menu up arrow position ld [hl], $10 hlcoord 10, 8 ; Age menu down arrow position @@ -1267,7 +1267,7 @@ Function4880e: ld [hl], $11 .asm_488a7 hlcoord 9, 7 ; Age position - ELSE + else hlcoord 10, 6 ; Age menu up arrow position ld [hl], $10 hlcoord 10, 8 ; Age menu down arrow position @@ -1290,7 +1290,7 @@ Function4880e: ld [hl], $11 .asm_488a7 hlcoord 9, 7 ; Age position - ENDC + endc call Function487ec call WaitBGMap ld a, $1 @@ -1324,16 +1324,16 @@ ZipCodePressed: call TellNowTellLaterMenu jp c, ReturnToMobileProfileMenu - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 8, 12 ; Clearing the potential "Tell Later" text. lb bc, 1, 10 - ZIPCODE_LENGTH; Determines the size of the clearing box - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 8, 12 ; Clearing the potential "Tell Later" text. lb bc, 1, 10 - ZIPCODE_LENGTH ; Determines the size of the clearing box - ELSE + else hlcoord 8, 12 ; Clearing the potential "Tell Later" text. lb bc, 1, 10 - ZIPCODE_LENGTH ; Determines the size of the clearing box - ENDC + endc call ClearBox hlcoord 8, 11 ; Placement of Colon Text ld de, Colon @@ -1346,25 +1346,25 @@ ZipCodePressed: ld a, TRUE ldh [hInMenu], a - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 12 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 6; Zip Code Menu width call DisplayBlankGoldenBox hlcoord 13 - ZIPCODE_LENGTH, 11 ; Zip Code Position - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 16 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 2; Zip Code Menu width call DisplayBlankGoldenBox hlcoord 17 - ZIPCODE_LENGTH, 11 ; Zip Code Position - ELSE + else hlcoord 15 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 3; Zip Code Menu width call DisplayBlankGoldenBox hlcoord 16 - ZIPCODE_LENGTH, 11 ; Zip Code Position - ENDC + endc call DisplayZipCode call WaitBGMap ; Backup of the zip code, in case the player cancels. @@ -1404,7 +1404,7 @@ ZipCodePressed: ZipCodeEditMenu: - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 13 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu ld a, ZIPCODE_LENGTH ld c, a @@ -1412,7 +1412,7 @@ ZipCodeEditMenu: ld a, " " call ByteFill ; fill bc bytes with the value of a, starting at hl ld b, e - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 17 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu ld a, ZIPCODE_LENGTH ld c, a @@ -1420,7 +1420,7 @@ ZipCodeEditMenu: ld a, " " call ByteFill ; fill bc bytes with the value of a, starting at hl ld b, e - ELSE + else hlcoord 8 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu ld a, ZIPCODE_LENGTH ld c, a @@ -1428,7 +1428,7 @@ ZipCodeEditMenu: ld a, " " call ByteFill ; fill bc bytes with the value of a, starting at hl ld b, e - ENDC + endc push bc call JoyTextDelay ldh a, [hJoyDown] @@ -1464,16 +1464,16 @@ asm_48972: ld e, d ld d, $0 ld b, $71; Y. Supposed to be $70 with GFX_underscore. - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) ld c, (20 - ZIPCODE_LENGTH + 1) * 8; X. - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) ld c, (19 - ZIPCODE_LENGTH + 1) * 8; X. - ELSE + else ld c, (16 - ZIPCODE_LENGTH + 1) * 8; X. - ENDC - IF DEF(_CRYSTAL_EU) + endc + if DEF(_CRYSTAL_EU) call Mobile12_MoveAndBlinkCursor - ENDC + endc ;farcall Mobile22_MoveAndBlinkCursor pop de pop af @@ -1492,13 +1492,13 @@ asm_48972: ld [wd002], a .regular_blinking - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 13 - ZIPCODE_LENGTH, 11 ; Zip code location - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 17 - ZIPCODE_LENGTH, 11 ; Zip code location - ELSE + else hlcoord 16 - ZIPCODE_LENGTH, 11 ; Zip code location - ENDC + endc ld b, $0 ld c, d add hl, bc @@ -1550,9 +1550,9 @@ asm_48972: pop af -REPT 4 +rept 4 pop bc ; Flush the stack that was holding the previous value of the zip code. -ENDR +endr .quit_zip_code_edit_menu push af @@ -1568,16 +1568,16 @@ ENDR pop af call ExitMenu call DisplayZipCodeRightAlign - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 13, 11 ; Location of a clear box to clear any excess characters if 'Tell Now' is selected, but cannot overlap the position of the zip code itself, because otherwise it will clear that too. ld a, 10 - ZIPCODE_LENGTH; Determines the size of the clearing box - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 17, 11 ; Location of a clear box to clear any excess characters if 'Tell Now' is selected, but cannot overlap the position of the zip code itself, because otherwise it will clear that too. ld a, 10 - ZIPCODE_LENGTH ; Determines the size of the clearing box - ELSE + else hlcoord 16, 11 ; Location of a clear box to clear any excess characters if 'Tell Now' is selected, but cannot overlap the position of the zip code itself, because otherwise it will clear that too. ld a, 10 - ZIPCODE_LENGTH ; Determines the size of the clearing box - ENDC + endc add b ; We increase the clearbox width, in case the zipcode has been shifted to the right. ld c, a ld b, 1 @@ -1593,16 +1593,16 @@ DisplayZipCodeRightAlign: push de ; We first clear the area. - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 13 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu ld a, ZIPCODE_LENGTH - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 17 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu ld a, ZIPCODE_LENGTH - ELSE + else hlcoord 16 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu ld a, ZIPCODE_LENGTH - ENDC + endc ld c, a ld b, 0 ld a, " " @@ -1610,13 +1610,13 @@ DisplayZipCodeRightAlign: ld b, e ; Aligning to the right, based on wZipcodeFormatLength. - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 13 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 17 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu - ELSE + else hlcoord 16 - ZIPCODE_LENGTH, 11 ; Zip Code Position in MOBILE menu - ENDC + endc ld a, [wZipcodeFormatLength] ld b, a ld a, ZIPCODE_LENGTH @@ -1811,13 +1811,13 @@ InputZipcodeCharacters: ; Function48ab5. Zip code menu controls. jr nz, .press_right ; If we reach this line, it means the player didn't press any button this frame. - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 13 - ZIPCODE_LENGTH, 11 ; Zip Code Location - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 17 - ZIPCODE_LENGTH, 11 ; Zip Code Location - ELSE + else hlcoord 16 - ZIPCODE_LENGTH, 11 ; Zip Code Location - ENDC + endc call DisplayZipCode ld a, [wd002] bit 7, a @@ -1839,19 +1839,19 @@ InputZipcodeCharacters: ; Function48ab5. Zip code menu controls. .no_underflow push de push af - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 12 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 6; Zip Code Menu width - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 16 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 2; Zip Code Menu width - ELSE + else hlcoord 15 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 3; Zip Code Menu width - ENDC + endc call DisplayBlankGoldenBox pop af pop de @@ -1872,19 +1872,19 @@ InputZipcodeCharacters: ; Function48ab5. Zip code menu controls. .press_right push de - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 12 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 6; Zip Code Menu width - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 16 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 2; Zip Code Menu width - ELSE + else hlcoord 15 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 3; Zip Code Menu width - ENDC + endc call DisplayBlankGoldenBox pop de ld a, [wZipcodeFormatLength] @@ -1919,19 +1919,19 @@ InputZipcodeCharacters: ; Function48ab5. Zip code menu controls. .press_left push de - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 12 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 6; Zip Code Menu width - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 16 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 2; Zip Code Menu width - ELSE + else hlcoord 15 - ZIPCODE_LENGTH, 10 ld b, $1 ; Zip Code Menu starting point ld c, ZIPCODE_LENGTH + 3; Zip Code Menu width - ENDC + endc call DisplayBlankGoldenBox pop de pop af @@ -2017,13 +2017,13 @@ Zipcode_GetCharPoolLengthForGivenCharSlot: DisplayZipCodeAfterChange: push af - IF DEF(_CRYSTAL_AU) + if DEF(_CRYSTAL_AU) hlcoord 13 - ZIPCODE_LENGTH, 11 ; Zip code location - ELIF DEF(_CRYSTAL_EU) + elif DEF(_CRYSTAL_EU) hlcoord 17 - ZIPCODE_LENGTH, 11 ; Zip code location - ELSE + else hlcoord 16 - ZIPCODE_LENGTH, 11 ; Zip code location - ENDC + endc call DisplayZipCode ld a, $1 and a diff --git a/mobile/mobile_12_2.asm b/mobile/mobile_12_2.asm index 92b7146f3..d7735e65c 100644 --- a/mobile/mobile_12_2.asm +++ b/mobile/mobile_12_2.asm @@ -176,7 +176,7 @@ MobileCheckOwnMonAnywhere: table_width 3, MobileCheckOwnMonAnywhere.BoxAddresses for n, 1, NUM_BOXES + 1 dba sBox{d:n} -ENDR +endr assert_table_length NUM_BOXES .AdvanceOTName: diff --git a/mobile/mobile_22.asm b/mobile/mobile_22.asm index 5eaa059bd..ceb010879 100644 --- a/mobile/mobile_22.asm +++ b/mobile/mobile_22.asm @@ -2344,9 +2344,9 @@ Function89efd: ld a, $ff ld [hli], a xor a -REPT 4 +rept 4 ld [hli], a -ENDR +endr ld [hl], a .asm_89f09 ld hl, wd012 diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index 3968bebc4..bf4e824f3 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -1589,11 +1589,11 @@ _LinkBattleSendReceiveAction: vc_hook Wireless_end_exchange vc_patch Wireless_net_delay_3 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld b, 26 -ELSE +else ld b, 10 -ENDC +endc vc_patch_end .receive call DelayFrame @@ -1603,11 +1603,11 @@ ENDC vc_hook Wireless_start_send_zero_bytes vc_patch Wireless_net_delay_4 -IF DEF(_CRYSTAL11_VC) +if DEF(_CRYSTAL11_VC) ld b, 26 -ELSE +else ld b, 10 -ENDC +endc vc_patch_end .acknowledge call DelayFrame @@ -2409,11 +2409,11 @@ MACRO macro_100fc0 ; address, size[, OT address] db ($80 * (\1 >= SRAM_End)) | (BANK(\1) * (\1 < SRAM_End)) dw \1, \2 - IF _NARG == 3 + if _NARG == 3 dw \3 - ELSE + else dw NULL - ENDC + endc ENDM Unknown_100fc0: @@ -2451,9 +2451,9 @@ Unknown_10102c: Function101050: call Function10107d ld a, [wOTPartyCount] -REPT 2 ; ??? +rept 2 ; ??? ld hl, wc608 -ENDR +endr ld bc, wc7bb - wc608 call Function1010de ld hl, wc7bb diff --git a/mobile/mobile_41.asm b/mobile/mobile_41.asm index b4a5cd5aa..e1a936efb 100644 --- a/mobile/mobile_41.asm +++ b/mobile/mobile_41.asm @@ -694,9 +694,9 @@ _MobilePrintNum:: push af call .Function1062b2 call .Function1062ff -REPT 4 +rept 4 inc de -ENDR +endr pop af dec a jr nz, .digit_loop diff --git a/mobile/mobile_45_stadium.asm b/mobile/mobile_45_stadium.asm index cfacd4deb..d964ded06 100644 --- a/mobile/mobile_45_stadium.asm +++ b/mobile/mobile_45_stadium.asm @@ -132,10 +132,10 @@ Call_045_767b: ; REMARK: ; the following code overwrites the odd egg's ot's last 2 non-terminator characters with terminators in order to prevent the code at 46:BattleTowerAction_EggTicket from deleting a second egg ticket -DEF Odd_NUM_CHARS equ 3 ; "ODD" -REPT Odd_NUM_CHARS / 2 +def Odd_NUM_CHARS equ 3 ; "ODD" +rept Odd_NUM_CHARS / 2 inc hl -ENDR +endr ld a, "@" ld [hl+], a ld [hl], a diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm index 153f867cd..ccc63ba85 100644 --- a/mobile/mobile_46.asm +++ b/mobile/mobile_46.asm @@ -2044,60 +2044,60 @@ Function118b9a: pushc setcharmap ascii -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) ExchangeDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTU/exchange/index.txt", 0 -ELIF DEF(_CRYSTAL_EU) +elif DEF(_CRYSTAL_EU) ExchangeDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTP/exchange/index.txt", 0 -ELSE +else ExchangeDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTE/exchange/index.txt", 0 -ENDC +endc -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) BattleDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTU/battle/index.txt", 0 -ELIF DEF(_CRYSTAL_EU) +elif DEF(_CRYSTAL_EU) BattleDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTP/battle/index.txt", 0 -ELSE +else BattleDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTE/battle/index.txt", 0 -ENDC +endc -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) NewsDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTU/news/index.txt", 0 -ELIF DEF(_CRYSTAL_EU) +elif DEF(_CRYSTAL_EU) NewsDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTP/news/index.txt", 0 -ELSE +else NewsDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTE/news/index.txt", 0 -ENDC +endc -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) StadiumDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTU/POKESTA/menu.cgb", 0 -ELIF DEF(_CRYSTAL_EU) +elif DEF(_CRYSTAL_EU) StadiumDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTP/POKESTA/menu.cgb", 0 -ELSE +else StadiumDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTE/POKESTA/menu.cgb", 0 -ENDC +endc -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) OddEggDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTU/tamago/index.txt", 0 -ELIF DEF(_CRYSTAL_EU) +elif DEF(_CRYSTAL_EU) OddEggDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTP/tamago/index.txt", 0 -ELSE +else OddEggDownloadURL: db "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTE/tamago/index.txt", 0 -ENDC +endc popc @@ -3271,9 +3271,9 @@ Function119471: ld a, $10 cp b jr z, .asm_119536 -REPT 4 +rept 4 inc hl -ENDR +endr jr .asm_11957a .asm_119536 ld a, [hli] @@ -4131,16 +4131,16 @@ Function119ac9: ld [wBattleTowerRoomMenuJumptableIndex], a ret -IF DEF(_CRYSTAL_AU) +if DEF(_CRYSTAL_AU) XGameCode: INCBIN "data/mobile/x-game-code-aus.txt" -ELIF DEF(_CRYSTAL_EU) +elif DEF(_CRYSTAL_EU) XGameCode: INCBIN "data/mobile/x-game-code-eur.txt" -ELSE +else XGameCode: INCBIN "data/mobile/x-game-code.txt" -ENDC +endc XGameResult: INCBIN "data/mobile/x-game-result.txt" @@ -5887,17 +5887,17 @@ Function11a88c: Unknown_11a89a: for x, 16 bcd x % 100, x / 100 -ENDR +endr Unknown_11a8ba: for x, 0, 16**2, 16 bcd x % 100, x / 100 -ENDR +endr Unknown_11a8da: for x, 0, 16**3, 16**2 bcd x % 100, x / 100 -ENDR +endr BattleTowerRoomMenu_WriteMessage: jumptable .Jumptable, wc31a diff --git a/mobile/mobile_5f.asm b/mobile/mobile_5f.asm index 031008f4a..6480bdc14 100644 --- a/mobile/mobile_5f.asm +++ b/mobile/mobile_5f.asm @@ -1656,12 +1656,12 @@ Function17da31: Unknown_17da8c: for x, 8 db 1 << x -ENDR +endr Unknown_17da94: for x, 8 db ~(1 << x) -ENDR +endr Function17da9c: ld a, [wcd31] @@ -3007,10 +3007,10 @@ MACRO inc_crash_check_pointer_farcall push af ld a, $1 ldh [rSVBK], a - REPT _NARG + rept _NARG farcall \1 shift - ENDR + endr pop af ldh [rSVBK], a ret diff --git a/mobile/mobile_menu.asm b/mobile/mobile_menu.asm index 056d0a010..f6d958316 100644 --- a/mobile/mobile_menu.asm +++ b/mobile/mobile_menu.asm @@ -853,8 +853,8 @@ MobileMenu_FillBGArea: jr nz, MobileMenu_FillBGArea ret -IF DEF(_DEBUG) +if DEF(_DEBUG) MainMenu_DebugRoom: farcall _DebugRoom ret -ENDC +endc diff --git a/ram/hram.asm b/ram/hram.asm index e396557e2..af43f8b2d 100644 --- a/ram/hram.asm +++ b/ram/hram.asm @@ -170,9 +170,9 @@ hDMATransfer:: db hMobile:: db hSystemBooted:: db -IF DEF(_DEBUG) +if DEF(_DEBUG) hDebugRoomMenuPage:: -ENDC +endc hClockResetTrigger:: db ds 19 diff --git a/ram/sram.asm b/ram/sram.asm index 47a171b54..f872b9068 100644 --- a/ram/sram.asm +++ b/ram/sram.asm @@ -9,27 +9,27 @@ sPartyMail:: ; sPartyMon1Mail - sPartyMon6Mail for n, 1, PARTY_LENGTH + 1 sPartyMon{d:n}Mail:: mailmsg sPartyMon{d:n}Mail -ENDR +endr sPartyMailBackup:: ; sPartyMon1MailBackup - sPartyMon6MailBackup for n, 1, PARTY_LENGTH + 1 sPartyMon{d:n}MailBackup:: mailmsg sPartyMon{d:n}MailBackup -ENDR +endr sMailboxCount:: db sMailboxes:: ; sMailbox1 - sMailbox10 for n, 1, MAILBOX_CAPACITY + 1 sMailbox{d:n}:: mailmsg sMailbox{d:n} -ENDR +endr sMailboxCountBackup:: db sMailboxesBackup:: ; sMailbox1Backup - sMailbox10Backup for n, 1, MAILBOX_CAPACITY + 1 sMailbox{d:n}Backup:: mailmsg sMailbox{d:n}Backup -ENDR +endr sMysteryGiftData:: sMysteryGiftItem:: db @@ -74,13 +74,13 @@ sBackupCheckValue2:: db ; loaded with SAVE_CHECK_VALUE_2, used to check save cor sStackTop:: dw -IF DEF(_DEBUG) +if DEF(_DEBUG) sRTCHaltCheckValue:: dw sSkipBattle:: db sDebugTimeCyclesSinceLastCall:: db sOpenedInvalidSRAM:: db sIsBugMon:: db -ENDC +endc SECTION "Save", SRAM @@ -120,7 +120,7 @@ sLinkBattleRecord:: ; sLinkBattleRecord1 - sLinkBattleRecord5 for n, 1, NUM_LINK_BATTLE_RECORDS + 1 sLinkBattleRecord{d:n}:: link_battle_record sLinkBattleRecord{d:n} -ENDR +endr sLinkBattleStatsEnd:: @@ -130,7 +130,7 @@ sHallOfFame:: ; sHallOfFame1 - sHallOfFame30 for n, 1, NUM_HOF_TEAMS + 1 sHallOfFame{d:n}:: hall_of_fame sHallOfFame{d:n} -ENDR +endr sHallOfFameEnd:: @@ -180,10 +180,10 @@ SECTION "SRAM Battle Tower", SRAM ; so they use multiple SECTIONs DEF box_n = 0 MACRO boxes - REPT \1 + rept \1 DEF box_n += 1 sBox{d:box_n}:: box sBox{d:box_n} - ENDR + endr ENDM SECTION "Boxes 1-7", SRAM @@ -197,7 +197,7 @@ SECTION "Boxes 8-14", SRAM boxes 7 ; All 14 boxes fit exactly within 2 SRAM banks - ASSERT box_n == NUM_BOXES, \ + assert box_n == NUM_BOXES, \ "boxes: Expected {d:NUM_BOXES} total boxes, got {d:box_n}" diff --git a/ram/wram.asm b/ram/wram.asm index 85a26ddda..f0f04dbe7 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -15,7 +15,7 @@ wAudio:: ; wChannel1 - wChannel8 for n, 1, NUM_CHANNELS + 1 wChannel{d:n}:: channel_struct wChannel{d:n} -ENDR +endr ds 1 @@ -215,7 +215,7 @@ for n, 1, NUM_SPRITE_ANIM_STRUCTS + 1 ; field 0: index ; fields 1-3: loaded from SpriteAnimSeqData wSpriteAnim{d:n}:: sprite_anim_struct wSpriteAnim{d:n} -ENDR +endr wSpriteAnimationStructsEnd:: NEXTU @@ -306,7 +306,7 @@ wShadowOAM:: ; wShadowOAMSprite00 - wShadowOAMSprite39 for n, NUM_SPRITE_OAM_STRUCTS wShadowOAMSprite{02d:n}:: sprite_oam_struct wShadowOAMSprite{02d:n} -ENDR +endr wShadowOAMEnd:: @@ -754,13 +754,13 @@ wDexListingCursorBackup:: db wBackupDexListingCursor:: db wBackupDexListingPage:: db wDexCurLocation:: db -IF DEF(_CRYSTAL11) +if DEF(_CRYSTAL11) wPokedexStatus:: db wPokedexDataEnd:: -ELSE +else wPokedexDataEnd:: ds 1 -ENDC +endc ds 2 NEXTU @@ -987,19 +987,19 @@ wLinkPlayerData:: ; wLinkPlayerPartyMon1 - wLinkPlayerPartyMon6 for n, 1, PARTY_LENGTH + 1 wLinkPlayerPartyMon{d:n}:: party_struct wLinkPlayerPartyMon{d:n} -ENDR +endr wLinkPlayerPartyMonOTs:: ; wLinkPlayerPartyMon1OT - wLinkPlayerPartyMon6OT for n, 1, PARTY_LENGTH + 1 wLinkPlayerPartyMon{d:n}OT:: ds NAME_LENGTH -ENDR +endr wLinkPlayerPartyMonNicknames:: ; wLinkPlayerPartyMon1Nickname - wLinkPlayerPartyMon6Nickname for n, 1, PARTY_LENGTH + 1 wLinkPlayerPartyMon{d:n}Nickname:: ds MON_NAME_LENGTH -ENDR +endr NEXTU ; time capsule party data @@ -1007,19 +1007,19 @@ wTimeCapsulePlayerData:: ; wTimeCapsulePartyMon1 - wTimeCapsulePartyMon6 for n, 1, PARTY_LENGTH + 1 wTimeCapsulePartyMon{d:n}:: red_party_struct wTimeCapsulePartyMon{d:n} -ENDR +endr wTimeCapsulePartyMonOTs:: ; wTimeCapsulePartyMon1OT - wTimeCapsulePartyMon6OT for n, 1, PARTY_LENGTH + 1 wTimeCapsulePartyMon{d:n}OT:: ds NAME_LENGTH -ENDR +endr wTimeCapsulePartyMonNicknames:: ; wTimeCapsulePartyMon1Nickname - wTimeCapsulePartyMon6Nickname for n, 1, PARTY_LENGTH + 1 wTimeCapsulePartyMon{d:n}Nickname:: ds MON_NAME_LENGTH -ENDR +endr ENDU @@ -1034,7 +1034,7 @@ wLinkOTPartyMonTypes:: ; wLinkOTPartyMon1Type - wLinkOTPartyMon6Type for n, 1, PARTY_LENGTH + 1 wLinkOTPartyMon{d:n}Type:: dw -ENDR +endr SECTION UNION "Overworld Map", WRAM0 @@ -1299,7 +1299,7 @@ wccb9:: ds 1 wccba:: ds 90 -IF DEF(_DEBUG) +if DEF(_DEBUG) SECTION UNION "Overworld Map", WRAM0 ; debug room RTC values @@ -1338,7 +1338,7 @@ NEXTU wDebugRoomGBID:: dw ENDU -ENDC +endc SECTION "Video", WRAM0 @@ -1614,14 +1614,14 @@ wCreditsLYOverride:: db NEXTU ; pokedex wPrevDexEntryJumptableIndex:: db -IF DEF(_CRYSTAL11) +if DEF(_CRYSTAL11) wPrevDexEntryBackup:: db -ELSE +else ; BUG: Crystal 1.0 reused the same byte in WRAM for ; wPokedexStatus and wPrevDexEntryBackup. wPokedexStatus:: wPrevDexEntryBackup:: db -ENDC +endc wUnusedPokedexByte:: db NEXTU @@ -2552,7 +2552,7 @@ wTilesetAnim:: dw ; bank 3f ds 2 ; unused wTilesetPalettes:: dw ; bank 3f wTilesetEnd:: - ASSERT wTilesetEnd - wTileset == TILESET_LENGTH + assert wTilesetEnd - wTileset == TILESET_LENGTH wEvolvableFlags:: flag_array PARTY_LENGTH @@ -2792,7 +2792,7 @@ wBaseGrowthRate:: db wBaseEggGroups:: db wBaseTMHM:: flag_array NUM_TM_HM_TUTOR wCurBaseDataEnd:: - ASSERT wCurBaseDataEnd - wCurBaseData == BASE_DATA_SIZE + assert wCurBaseDataEnd - wCurBaseData == BASE_DATA_SIZE wCurDamage:: dw @@ -2863,19 +2863,19 @@ wOTPartyMons:: ; wOTPartyMon1 - wOTPartyMon6 for n, 1, PARTY_LENGTH + 1 wOTPartyMon{d:n}:: party_struct wOTPartyMon{d:n} -ENDR +endr wOTPartyMonOTs:: ; wOTPartyMon1OT - wOTPartyMon6OT for n, 1, PARTY_LENGTH + 1 wOTPartyMon{d:n}OT:: ds NAME_LENGTH -ENDR +endr wOTPartyMonNicknames:: ; wOTPartyMon1Nickname - wOTPartyMon6Nickname for n, 1, PARTY_LENGTH + 1 wOTPartyMon{d:n}Nickname:: ds MON_NAME_LENGTH -ENDR +endr wOTPartyDataEnd:: NEXTU @@ -3040,7 +3040,7 @@ wPlayerStruct:: object_struct wPlayer ; player is object struct 0 ; wObjectStruct1 - wObjectStruct12 for n, 1, NUM_OBJECT_STRUCTS wObject{d:n}Struct:: object_struct wObject{d:n} -ENDR +endr wCmdQueue:: ds CMDQUEUE_CAPACITY * CMDQUEUE_ENTRY_SIZE @@ -3051,7 +3051,7 @@ wPlayerObject:: map_object wPlayer ; player is map object 0 ; wMap1Object - wMap15Object for n, 1, NUM_OBJECTS wMap{d:n}Object:: map_object wMap{d:n} -ENDR +endr wObjectMasks:: ds NUM_OBJECTS @@ -3417,19 +3417,19 @@ wPartyMons:: ; wPartyMon1 - wPartyMon6 for n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}:: party_struct wPartyMon{d:n} -ENDR +endr wPartyMonOTs:: ; wPartyMon1OT - wPartyMon6OT for n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}OT:: ds NAME_LENGTH -ENDR +endr wPartyMonNicknames:: ; wPartyMon1Nickname - wPartyMon6Nickname for n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}Nickname:: ds MON_NAME_LENGTH -ENDR +endr wPartyMonNicknamesEnd:: ds 22 @@ -3654,13 +3654,13 @@ wActiveAnimObjects:: ; wAnimObject1 - wAnimObject10 for n, 1, NUM_ANIM_OBJECTS + 1 wAnimObject{d:n}:: battle_anim_struct wAnimObject{d:n} -ENDR +endr wActiveBGEffects:: ; wBGEffect1 - wBGEffect5 for n, 1, NUM_BG_EFFECTS + 1 wBGEffect{d:n}:: battle_bg_effect wBGEffect{d:n} -ENDR +endr wLastAnimObjectIndex:: db diff --git a/rgbdscheck.asm b/rgbdscheck.asm index 8579c02ec..5e8f85405 100644 --- a/rgbdscheck.asm +++ b/rgbdscheck.asm @@ -2,7 +2,7 @@ MAJOR EQU 0 MINOR EQU 6 PATCH EQU 0 -WRONG_RGBDS EQUS "fail \"pokecrystal requires rgbds v1.0.1 or newer.\"" +WRONG_RGBDS EQUS "fail \"pokecrystal requires rgbds v0.6.0 or newer.\"" IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__) WRONG_RGBDS diff --git a/tools/free_space.awk b/tools/free_space.awk index 9a336e538..168fde85d 100755 --- a/tools/free_space.awk +++ b/tools/free_space.awk @@ -51,11 +51,11 @@ rom_bank && toupper($0) ~ /^[ \t]*EMPTY$/ { register_bank(16384) } rom_bank && toupper($0) ~ /^[ \t]*SLACK:[ \t]/ { - # Old (rgbds <=1.0.1) end-of-bank free space + # Old (rgbds <=0.6.0) end-of-bank free space register_bank_str($2) } rom_bank && toupper($0) ~ /^[ \t]*TOTAL EMPTY:[ \t]/ { - # New (rgbds >=1.0.1) total free space + # New (rgbds >=0.6.1) total free space register_bank_str($3) }