Require rgbds v1.0.1

This commit is contained in:
gb-mobile 2026-01-02 21:11:54 -08:00
parent 847d9fb2fb
commit ba1a97aac6
193 changed files with 1067 additions and 1096 deletions

View File

@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@master
with:
path: rgbds
ref: v0.6.1
ref: v1.0.1
repository: gbdev/rgbds
- name: Install rgbds

View File

@ -1 +1 @@
0.6.0
1.0.1

6
FAQ.md
View File

@ -41,15 +41,15 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel
### "ERROR: `UNION` already defined"
Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work.
Download [**rgbds 1.0.1**][rgbds] or newer. Older versions will not work.
### "ERROR: Macro not defined"
Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work.
Download [**rgbds 1.0.1**][rgbds] or newer. Older versions will not work.
### "Expression must be 8-bit"
Download [**rgbds 0.6.0**][rgbds] or newer. Older versions will not work.
Download [**rgbds 1.0.1**][rgbds] or newer. Older versions will not work.
### "Segmentation fault" from `rgbgfx`

View File

@ -42,9 +42,9 @@ Run setup and leave the default settings. At the "**Select Packages**" step, cho
Double click on the text that says "**Skip**" next to each package to select the most recent version to install.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.6.1**.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 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.
**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.
Now open the **Cygwin terminal** and enter the following commands.
@ -67,7 +67,7 @@ Install [**Homebrew**](https://brew.sh/). Follow the official instructions.
Open **Terminal** and prepare to enter commands.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.6.1**.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 1.0.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 0.6.1** from source.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.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 0.6.1** from source.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 1.0.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 0.6.1**.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for Arch Linux to install **rgbds 1.0.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 0.6.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 1.0.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 0.6.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 1.0.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 0.6.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 1.0.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 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`:
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`:
```bash
make RGBDS=rgbds-0.6.1/
make RGBDS=rgbds-1.0.1/
```
```bash
make RGBDS=rgbds-0.6.1/ crystal11
make RGBDS=rgbds-1.0.1/ crystal11
```

View File

@ -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"

View File

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

View File

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

View File

@ -1,74 +1,45 @@
#!/bin/bash
set -euo pipefail
# Install necessary tools
dpkg -s bison &> /dev/null
if [ $? -eq 0 ]; then
echo "bison is installed!"
else
sudo apt-get install -y bison
# 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
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
echo "rgbds already exists! Removing..."
sudo rm -R rgbds
rm -rf rgbds
fi
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
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
make clean
make
cd ..
make install PREFIX="$(pwd)/../rgbds"
popd
# Build the Rom
# Build the ROM using the locally-installed tools
echo "Building pokecrystal..."
make clean
make RGBDS=rgbds/
make RGBDS="$(pwd)/rgbds/bin/"
if [ ! -f "pokecrystal.gbc" ]; then
echo "Something goes wrong during the process."
echo "Build failed: pokecrystal.gbc not produced."
exit 1
fi

View File

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

View File

@ -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)

View File

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

View File

@ -15,4 +15,4 @@ DefaultOptions:
db $00
db $00
.End
assert DefaultOptions.End - DefaultOptions == wOptionsEnd - wOptions
ASSERT DefaultOptions.End - DefaultOptions == wOptionsEnd - wOptions

View File

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

View File

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

View File

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

View File

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

View File

@ -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
ENDC

View File

@ -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
ENDC

View File

@ -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
ENDC

View File

@ -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
ENDC

View File

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

View File

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

View File

@ -11,10 +11,10 @@
const PARTYMENUQUALITY_MOBILE_SELECTION
MACRO partymenuqualities
rept _NARG
REPT _NARG
db PARTYMENUQUALITY_\1
shift
endr
ENDR
db -1 ; end
ENDM

View File

@ -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!"

View File

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

View File

@ -1,7 +1,7 @@
MACRO unownword
for n, CHARLEN(\1)
db CHARSUB(\1, n + 1) - "A" + FIRST_UNOWN_CHAR
endr
ENDR
db -1
ENDM

View File

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

View File

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

View File

@ -1,8 +1,8 @@
MACRO unown_set
rept _NARG
REPT _NARG
db UNOWN_\1
shift
endr
ENDR
db -1
ENDM

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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]

View File

@ -60,10 +60,10 @@ HealMachineAnim:
dw .HallOfFame
MACRO healmachineanimseq
rept _NARG
REPT _NARG
db HEALMACHINESTATE_\1
shift
endr
ENDR
ENDM
.Pokecenter:

View File

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

View File

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

View File

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

View File

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

View File

@ -83,9 +83,9 @@ FindOakRating:
ld a, [hli]
cp c
jr nc, .match
rept 4
REPT 4
inc hl
endr
ENDR
jr .loop
.match

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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]

View File

@ -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]

View File

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

View File

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

View File

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

View File

@ -27,4 +27,4 @@ GetSquareRoot:
.Squares:
for x, 1, NUM_SQUARE_ROOTS + 1
dw x**2
endr
ENDR

View File

@ -2,7 +2,7 @@ EmptyAllSRAMBanks:
for x, NUM_SRAM_BANKS
ld a, x
call .EmptyBank
endr
ENDR
ret
.EmptyBank:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -363,9 +363,9 @@ CheckRepelEffect::
.ok
; to PartyMonLevel
rept 4
REPT 4
dec hl
endr
ENDR
ld a, [wCurPartyLevel]
cp [hl]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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]

View File

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

Some files were not shown because too many files have changed in this diff Show More