diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | INSTALL.md | 22 | ||||
-rw-r--r-- | constants/item_constants.asm | 4 | ||||
-rw-r--r-- | data/battle_anims/subanimations.asm | 2 | ||||
-rw-r--r-- | data/events/prizes.asm | 28 | ||||
-rw-r--r-- | data/items/key_items.asm | 191 | ||||
-rw-r--r-- | data/items/marts.asm | 18 | ||||
-rw-r--r-- | data/items/prices.asm | 194 | ||||
-rw-r--r-- | data/items/tm_prices.asm | 79 | ||||
-rw-r--r-- | data/items/vending_prices.asm | 2 | ||||
-rw-r--r-- | data/pokemon/menu_icons.asm | 231 | ||||
-rw-r--r-- | data/trainers/pic_pointers_money.asm | 2 | ||||
-rw-r--r-- | engine/battle/core.asm | 2 | ||||
-rw-r--r-- | engine/items/item_effects.asm | 3 | ||||
-rw-r--r-- | home/names2.asm | 6 | ||||
-rw-r--r-- | layout.link | 2 | ||||
-rw-r--r-- | macros/asserts.asm | 78 | ||||
-rw-r--r-- | macros/data.asm | 8 | ||||
-rw-r--r-- | macros/wram.asm | 51 | ||||
-rw-r--r-- | rgbdscheck.asm | 4 | ||||
-rw-r--r-- | sram.asm | 29 | ||||
-rwxr-xr-x | tools/unnamed.py | 6 | ||||
-rw-r--r-- | wram.asm | 1171 |
23 files changed, 958 insertions, 1177 deletions
diff --git a/.travis.yml b/.travis.yml index 4896c98e..5ff72754 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ install: HOMEBREW_NO_AUTO_UPDATE=1 brew install bison export PATH="/usr/local/opt/bison/bin:$PATH" fi - git clone -b v0.5.0 --depth=1 https://github.com/gbdev/rgbds + git clone -b v0.5.1 --depth=1 https://github.com/gbdev/rgbds sudo make -C rgbds install rm -rf rgbds ) @@ -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** install instructions](https://rgbds.gbdev.io/install/windows) for Windows with Cygwin to install **rgbds 0.5.0**. +Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install/windows) for Windows with Cygwin to install **rgbds 0.5.1**. -**Note:** If you already have an older rgbds, you will need to update to 0.5.0. Ignore this if you have never installed rgbds before. If a version newer than 0.5.0 does not work, try downloading 0.5.0. +**Note:** If you already have an older rgbds, you will need to update to 0.5.1. Ignore this if you have never installed rgbds before. If a version newer than 0.5.1 does not work, try downloading 0.5.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/macos) for macOS to install **rgbds 0.5.0**. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/macos) for macOS to install **rgbds 0.5.1**. Now you're ready to [build **pokered**](#build-pokered). @@ -84,7 +84,7 @@ To install the software required for **pokered**: sudo apt-get install make gcc git ``` -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.0** from source. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source. ### OpenSUSE @@ -94,7 +94,7 @@ To install the software required for **pokered**: sudo zypper install make gcc git ``` -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.0** from source. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source. ### Arch Linux @@ -104,9 +104,9 @@ To install the software required for **pokered**: sudo pacman -S make gcc git ``` -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/arch) for Arch Linux to install **rgbds 0.5.0**. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/arch) for Arch Linux to install **rgbds 0.5.1**. -If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.0** from source. +If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.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/source) to build **rgbds 0.5.0** from source. +If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.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/source) to build **rgbds 0.5.0** from source. +If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source. Now you're ready to [build **pokered**](#build-pokered). @@ -155,8 +155,8 @@ make ### 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.5.0 globally. Instead, you can put its files in a directory within pokered, such as `pokered/rgbds-0.5.0/`. Then specify it when you run `make`: +If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.5.1 globally. Instead, you can put its files in a directory within pokered, such as `pokered/rgbds-0.5.1/`. Then specify it when you run `make`: ```bash -make RGBDS=rgbds-0.5.0/ +make RGBDS=rgbds-0.5.1/ ``` diff --git a/constants/item_constants.asm b/constants/item_constants.asm index bb779fe4..d8a5910f 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -3,7 +3,7 @@ ; - ItemNames (see data/items/names.asm) ; - ItemPrices (see data/items/prices.asm) ; - TechnicalMachinePrices (see data/items/tm_prices.asm) -; - KeyItemBitfield (see data/items/key_items.asm) +; - KeyItemFlags (see data/items/key_items.asm) ; - ItemUsePtrTable (see engine/items/item_effects.asm) const_def const NO_ITEM ; $00 @@ -207,7 +207,7 @@ TM01 EQU const_value add_tm ROCK_SLIDE ; $F8 add_tm TRI_ATTACK ; $F9 add_tm SUBSTITUTE ; $FA -assert NUM_TMS == const_value - TM01, "NUM_TMS ({d:NUM_TMS}) does not match the number of add_tm definitions" +ASSERT NUM_TMS == const_value - TM01, "NUM_TMS ({d:NUM_TMS}) does not match the number of add_tm definitions" NUM_TM_HM EQU NUM_TMS + NUM_HMS diff --git a/data/battle_anims/subanimations.asm b/data/battle_anims/subanimations.asm index 530192f6..54d346a6 100644 --- a/data/battle_anims/subanimations.asm +++ b/data/battle_anims/subanimations.asm @@ -92,7 +92,7 @@ SubanimationPointers: ; subanim type, count ; REPT count ; db frame block id, base coordinate id, frame block mode -; endr +; ENDR subanim: MACRO db (\1 << 5) | \2 diff --git a/data/events/prizes.asm b/data/events/prizes.asm index 684add94..34cd75d7 100644 --- a/data/events/prizes.asm +++ b/data/events/prizes.asm @@ -19,14 +19,14 @@ ENDC PrizeMenuMon1Cost: IF DEF(_RED) - coins 180 - coins 500 + bcd2 180 + bcd2 500 ENDC IF DEF(_BLUE) - coins 120 - coins 750 + bcd2 120 + bcd2 750 ENDC - coins 1200 + bcd2 1200 db "@" PrizeMenuMon2Entries: @@ -43,14 +43,14 @@ ENDC PrizeMenuMon2Cost: IF DEF(_RED) - coins 2800 - coins 5500 - coins 9999 + bcd2 2800 + bcd2 5500 + bcd2 9999 ENDC IF DEF(_BLUE) - coins 2500 - coins 4600 - coins 6500 + bcd2 2500 + bcd2 4600 + bcd2 6500 ENDC db "@" @@ -61,7 +61,7 @@ PrizeMenuTMsEntries: db "@" PrizeMenuTMsCost: - coins 3300 - coins 5500 - coins 7700 + bcd2 3300 + bcd2 5500 + bcd2 7700 db "@" diff --git a/data/items/key_items.asm b/data/items/key_items.asm index 13a69ea4..b0c4b1ad 100644 --- a/data/items/key_items.asm +++ b/data/items/key_items.asm @@ -1,105 +1,86 @@ -key_item_bits: MACRO -_bit = 0 -_byte = 0 -REPT _NARG -_byte = _byte | ((\1) << _bit) -_bit = _bit + 1 -IF _bit == 8 - db _byte -_byte = 0 -_bit = 0 -ENDC -SHIFT -ENDR -IF _bit > 0 - db _byte -ENDC -ENDM - -KeyItemBitfield: - table_width 1, KeyItemBitfield - key_item_bits \ - FALSE, \ ; MASTER_BALL - FALSE, \ ; ULTRA_BALL - FALSE, \ ; GREAT_BALL - FALSE, \ ; POKE_BALL - TRUE, \ ; TOWN_MAP - TRUE, \ ; BICYCLE - TRUE, \ ; SURFBOARD - TRUE, \ ; SAFARI_BALL - TRUE, \ ; POKEDEX - FALSE, \ ; MOON_STONE - FALSE, \ ; ANTIDOTE - FALSE, \ ; BURN_HEAL - FALSE, \ ; ICE_HEAL - FALSE, \ ; AWAKENING - FALSE, \ ; PARLYZ_HEAL - FALSE, \ ; FULL_RESTORE - FALSE, \ ; MAX_POTION - FALSE, \ ; HYPER_POTION - FALSE, \ ; SUPER_POTION - FALSE, \ ; POTION - TRUE, \ ; BOULDERBADGE - TRUE, \ ; CASCADEBADGE - TRUE, \ ; THUNDERBADGE - TRUE, \ ; RAINBOWBADGE - TRUE, \ ; SOULBADGE - TRUE, \ ; MARSHBADGE - TRUE, \ ; VOLCANOBADGE - TRUE, \ ; EARTHBADGE - FALSE, \ ; ESCAPE_ROPE - FALSE, \ ; REPEL - TRUE, \ ; OLD_AMBER - FALSE, \ ; FIRE_STONE - FALSE, \ ; THUNDER_STONE - FALSE, \ ; WATER_STONE - FALSE, \ ; HP_UP - FALSE, \ ; PROTEIN - FALSE, \ ; IRON - FALSE, \ ; CARBOS - FALSE, \ ; CALCIUM - FALSE, \ ; RARE_CANDY - TRUE, \ ; DOME_FOSSIL - TRUE, \ ; HELIX_FOSSIL - TRUE, \ ; SECRET_KEY - TRUE, \ ; UNUSED_ITEM - TRUE, \ ; BIKE_VOUCHER - FALSE, \ ; X_ACCURACY - FALSE, \ ; LEAF_STONE - TRUE, \ ; CARD_KEY - FALSE, \ ; NUGGET - FALSE, \ ; PP_UP_2 - FALSE, \ ; POKE_DOLL - FALSE, \ ; FULL_HEAL - FALSE, \ ; REVIVE - FALSE, \ ; MAX_REVIVE - FALSE, \ ; GUARD_SPEC - FALSE, \ ; SUPER_REPEL - FALSE, \ ; MAX_REPEL - FALSE, \ ; DIRE_HIT - FALSE, \ ; COIN - FALSE, \ ; FRESH_WATER - FALSE, \ ; SODA_POP - FALSE, \ ; LEMONADE - TRUE, \ ; S_S_TICKET - TRUE, \ ; GOLD_TEETH - FALSE, \ ; X_ATTACK - FALSE, \ ; X_DEFEND - FALSE, \ ; X_SPEED - FALSE, \ ; X_SPECIAL - TRUE, \ ; COIN_CASE - TRUE, \ ; OAKS_PARCEL - TRUE, \ ; ITEMFINDER - TRUE, \ ; SILPH_SCOPE - TRUE, \ ; POKE_FLUTE - TRUE, \ ; LIFT_KEY - FALSE, \ ; EXP_ALL - TRUE, \ ; OLD_ROD - TRUE, \ ; GOOD_ROD - TRUE, \ ; SUPER_ROD - FALSE, \ ; PP_UP - FALSE, \ ; ETHER - FALSE, \ ; MAX_ETHER - FALSE, \ ; ELIXER - FALSE ; MAX_ELIXER - assert_table_length (NUM_ITEMS + 7) / 8 +KeyItemFlags: + bit_array KeyItemFlags + dbit FALSE ; MASTER_BALL + dbit FALSE ; ULTRA_BALL + dbit FALSE ; GREAT_BALL + dbit FALSE ; POKE_BALL + dbit TRUE ; TOWN_MAP + dbit TRUE ; BICYCLE + dbit TRUE ; SURFBOARD + dbit TRUE ; SAFARI_BALL + dbit TRUE ; POKEDEX + dbit FALSE ; MOON_STONE + dbit FALSE ; ANTIDOTE + dbit FALSE ; BURN_HEAL + dbit FALSE ; ICE_HEAL + dbit FALSE ; AWAKENING + dbit FALSE ; PARLYZ_HEAL + dbit FALSE ; FULL_RESTORE + dbit FALSE ; MAX_POTION + dbit FALSE ; HYPER_POTION + dbit FALSE ; SUPER_POTION + dbit FALSE ; POTION + dbit TRUE ; BOULDERBADGE + dbit TRUE ; CASCADEBADGE + dbit TRUE ; THUNDERBADGE + dbit TRUE ; RAINBOWBADGE + dbit TRUE ; SOULBADGE + dbit TRUE ; MARSHBADGE + dbit TRUE ; VOLCANOBADGE + dbit TRUE ; EARTHBADGE + dbit FALSE ; ESCAPE_ROPE + dbit FALSE ; REPEL + dbit TRUE ; OLD_AMBER + dbit FALSE ; FIRE_STONE + dbit FALSE ; THUNDER_STONE + dbit FALSE ; WATER_STONE + dbit FALSE ; HP_UP + dbit FALSE ; PROTEIN + dbit FALSE ; IRON + dbit FALSE ; CARBOS + dbit FALSE ; CALCIUM + dbit FALSE ; RARE_CANDY + dbit TRUE ; DOME_FOSSIL + dbit TRUE ; HELIX_FOSSIL + dbit TRUE ; SECRET_KEY + dbit TRUE ; UNUSED_ITEM + dbit TRUE ; BIKE_VOUCHER + dbit FALSE ; X_ACCURACY + dbit FALSE ; LEAF_STONE + dbit TRUE ; CARD_KEY + dbit FALSE ; NUGGET + dbit FALSE ; PP_UP_2 + dbit FALSE ; POKE_DOLL + dbit FALSE ; FULL_HEAL + dbit FALSE ; REVIVE + dbit FALSE ; MAX_REVIVE + dbit FALSE ; GUARD_SPEC + dbit FALSE ; SUPER_REPEL + dbit FALSE ; MAX_REPEL + dbit FALSE ; DIRE_HIT + dbit FALSE ; COIN + dbit FALSE ; FRESH_WATER + dbit FALSE ; SODA_POP + dbit FALSE ; LEMONADE + dbit TRUE ; S_S_TICKET + dbit TRUE ; GOLD_TEETH + dbit FALSE ; X_ATTACK + dbit FALSE ; X_DEFEND + dbit FALSE ; X_SPEED + dbit FALSE ; X_SPECIAL + dbit TRUE ; COIN_CASE + dbit TRUE ; OAKS_PARCEL + dbit TRUE ; ITEMFINDER + dbit TRUE ; SILPH_SCOPE + dbit TRUE ; POKE_FLUTE + dbit TRUE ; LIFT_KEY + dbit FALSE ; EXP_ALL + dbit TRUE ; OLD_ROD + dbit TRUE ; GOOD_ROD + dbit TRUE ; SUPER_ROD + dbit FALSE ; PP_UP + dbit FALSE ; ETHER + dbit FALSE ; MAX_ETHER + dbit FALSE ; ELIXER + dbit FALSE ; MAX_ELIXER + end_bit_array NUM_ITEMS diff --git a/data/items/marts.asm b/data/items/marts.asm index 80d62931..c6a80de5 100644 --- a/data/items/marts.asm +++ b/data/items/marts.asm @@ -1,64 +1,50 @@ ; mart inventories are below ; they are texts -; Viridian ViridianCashierText:: script_mart POKE_BALL, ANTIDOTE, PARLYZ_HEAL, BURN_HEAL -; Pewter PewterCashierText:: script_mart POKE_BALL, POTION, ESCAPE_ROPE, ANTIDOTE, BURN_HEAL, AWAKENING, PARLYZ_HEAL -; Cerulean CeruleanCashierText:: script_mart POKE_BALL, POTION, REPEL, ANTIDOTE, BURN_HEAL, AWAKENING, PARLYZ_HEAL -; Bike shop +BikeShopCashierText:: ; unreferenced script_mart BICYCLE -; Vermilion VermilionCashierText:: script_mart POKE_BALL, SUPER_POTION, ICE_HEAL, AWAKENING, PARLYZ_HEAL, REPEL -; Lavender LavenderCashierText:: script_mart GREAT_BALL, SUPER_POTION, REVIVE, ESCAPE_ROPE, SUPER_REPEL, ANTIDOTE, BURN_HEAL, ICE_HEAL, PARLYZ_HEAL -; Celadon Dept. Store 2F (1) CeladonMart2Clerk1Text:: script_mart GREAT_BALL, SUPER_POTION, REVIVE, SUPER_REPEL, ANTIDOTE, BURN_HEAL, ICE_HEAL, AWAKENING, PARLYZ_HEAL -; Celadon Dept. Store 2F (2) CeladonMart2Clerk2Text:: script_mart TM_DOUBLE_TEAM, TM_REFLECT, TM_RAZOR_WIND, TM_HORN_DRILL, TM_EGG_BOMB, TM_MEGA_PUNCH, TM_MEGA_KICK, TM_TAKE_DOWN, TM_SUBMISSION -; Celadon Dept. Store 4F CeladonMart4ClerkText:: script_mart POKE_DOLL, FIRE_STONE, THUNDER_STONE, WATER_STONE, LEAF_STONE -; Celadon Dept. Store 5F (1) CeladonMart5Clerk1Text:: script_mart X_ACCURACY, GUARD_SPEC, DIRE_HIT, X_ATTACK, X_DEFEND, X_SPEED, X_SPECIAL -; Celadon Dept. Store 5F (2) CeladonMart5Clerk2Text:: script_mart HP_UP, PROTEIN, IRON, CARBOS, CALCIUM -; Fuchsia FuchsiaCashierText:: script_mart ULTRA_BALL, GREAT_BALL, SUPER_POTION, REVIVE, FULL_HEAL, SUPER_REPEL -; unused? +UnusedCashierText:: ; unreferenced script_mart GREAT_BALL, HYPER_POTION, SUPER_POTION, FULL_HEAL, REVIVE -; Cinnabar CinnabarCashierText:: script_mart ULTRA_BALL, GREAT_BALL, HYPER_POTION, MAX_REPEL, ESCAPE_ROPE, FULL_HEAL, REVIVE -; Saffron SaffronCashierText:: script_mart GREAT_BALL, HYPER_POTION, MAX_REPEL, ESCAPE_ROPE, FULL_HEAL, REVIVE -; Indigo IndigoCashierText:: script_mart ULTRA_BALL, GREAT_BALL, FULL_RESTORE, MAX_POTION, FULL_HEAL, REVIVE, MAX_REPEL diff --git a/data/items/prices.asm b/data/items/prices.asm index 3740df8a..6c1c2891 100644 --- a/data/items/prices.asm +++ b/data/items/prices.asm @@ -1,101 +1,101 @@ ItemPrices:: table_width 3, ItemPrices - money 0 ; MASTER_BALL - money 1200 ; ULTRA_BALL - money 600 ; GREAT_BALL - money 200 ; POKE_BALL - money 0 ; TOWN_MAP - money 0 ; BICYCLE - money 0 ; SURFBOARD - money 1000 ; SAFARI_BALL - money 0 ; POKEDEX - money 0 ; MOON_STONE - money 100 ; ANTIDOTE - money 250 ; BURN_HEAL - money 250 ; ICE_HEAL - money 200 ; AWAKENING - money 200 ; PARLYZ_HEAL - money 3000 ; FULL_RESTORE - money 2500 ; MAX_POTION - money 1500 ; HYPER_POTION - money 700 ; SUPER_POTION - money 300 ; POTION - money 0 ; BOULDERBADGE - money 0 ; CASCADEBADGE - money 0 ; THUNDERBADGE - money 0 ; RAINBOWBADGE - money 0 ; SOULBADGE - money 0 ; MARSHBADGE - money 0 ; VOLCANOBADGE - money 0 ; EARTHBADGE - money 550 ; ESCAPE_ROPE - money 350 ; REPEL - money 0 ; OLD_AMBER - money 2100 ; FIRE_STONE - money 2100 ; THUNDER_STONE - money 2100 ; WATER_STONE - money 9800 ; HP_UP - money 9800 ; PROTEIN - money 9800 ; IRON - money 9800 ; CARBOS - money 9800 ; CALCIUM - money 4800 ; RARE_CANDY - money 0 ; DOME_FOSSIL - money 0 ; HELIX_FOSSIL - money 0 ; SECRET_KEY - money 0 ; XXX - money 0 ; BIKE_VOUCHER - money 950 ; X_ACCURACY - money 2100 ; LEAF_STONE - money 0 ; CARD_KEY - money 10000 ; NUGGET - money 9800 ; XXX PP_UP - money 1000 ; POKE_DOLL - money 600 ; FULL_HEAL - money 1500 ; REVIVE - money 4000 ; MAX_REVIVE - money 700 ; GUARD_SPEC - money 500 ; SUPER_REPEL - money 700 ; MAX_REPEL - money 650 ; DIRE_HIT - money 10 ; COIN - money 200 ; FRESH_WATER - money 300 ; SODA_POP - money 350 ; LEMONADE - money 0 ; S_S_TICKET - money 0 ; GOLD_TEETH - money 500 ; X_ATTACK - money 550 ; X_DEFEND - money 350 ; X_SPEED - money 350 ; X_SPECIAL - money 0 ; COIN_CASE - money 0 ; OAKS_PARCEL - money 0 ; ITEMFINDER - money 0 ; SILPH_SCOPE - money 0 ; POKE_FLUTE - money 0 ; LIFT_KEY - money 0 ; EXP_ALL - money 0 ; OLD_ROD - money 0 ; GOOD_ROD - money 0 ; SUPER_ROD - money 0 ; PP_UP - money 0 ; ETHER - money 0 ; MAX_ETHER - money 0 ; ELIXER - money 0 ; MAX_ELIXER + bcd3 0 ; MASTER_BALL + bcd3 1200 ; ULTRA_BALL + bcd3 600 ; GREAT_BALL + bcd3 200 ; POKE_BALL + bcd3 0 ; TOWN_MAP + bcd3 0 ; BICYCLE + bcd3 0 ; SURFBOARD + bcd3 1000 ; SAFARI_BALL + bcd3 0 ; POKEDEX + bcd3 0 ; MOON_STONE + bcd3 100 ; ANTIDOTE + bcd3 250 ; BURN_HEAL + bcd3 250 ; ICE_HEAL + bcd3 200 ; AWAKENING + bcd3 200 ; PARLYZ_HEAL + bcd3 3000 ; FULL_RESTORE + bcd3 2500 ; MAX_POTION + bcd3 1500 ; HYPER_POTION + bcd3 700 ; SUPER_POTION + bcd3 300 ; POTION + bcd3 0 ; BOULDERBADGE + bcd3 0 ; CASCADEBADGE + bcd3 0 ; THUNDERBADGE + bcd3 0 ; RAINBOWBADGE + bcd3 0 ; SOULBADGE + bcd3 0 ; MARSHBADGE + bcd3 0 ; VOLCANOBADGE + bcd3 0 ; EARTHBADGE + bcd3 550 ; ESCAPE_ROPE + bcd3 350 ; REPEL + bcd3 0 ; OLD_AMBER + bcd3 2100 ; FIRE_STONE + bcd3 2100 ; THUNDER_STONE + bcd3 2100 ; WATER_STONE + bcd3 9800 ; HP_UP + bcd3 9800 ; PROTEIN + bcd3 9800 ; IRON + bcd3 9800 ; CARBOS + bcd3 9800 ; CALCIUM + bcd3 4800 ; RARE_CANDY + bcd3 0 ; DOME_FOSSIL + bcd3 0 ; HELIX_FOSSIL + bcd3 0 ; SECRET_KEY + bcd3 0 ; XXX + bcd3 0 ; BIKE_VOUCHER + bcd3 950 ; X_ACCURACY + bcd3 2100 ; LEAF_STONE + bcd3 0 ; CARD_KEY + bcd3 10000 ; NUGGET + bcd3 9800 ; XXX PP_UP + bcd3 1000 ; POKE_DOLL + bcd3 600 ; FULL_HEAL + bcd3 1500 ; REVIVE + bcd3 4000 ; MAX_REVIVE + bcd3 700 ; GUARD_SPEC + bcd3 500 ; SUPER_REPEL + bcd3 700 ; MAX_REPEL + bcd3 650 ; DIRE_HIT + bcd3 10 ; COIN + bcd3 200 ; FRESH_WATER + bcd3 300 ; SODA_POP + bcd3 350 ; LEMONADE + bcd3 0 ; S_S_TICKET + bcd3 0 ; GOLD_TEETH + bcd3 500 ; X_ATTACK + bcd3 550 ; X_DEFEND + bcd3 350 ; X_SPEED + bcd3 350 ; X_SPECIAL + bcd3 0 ; COIN_CASE + bcd3 0 ; OAKS_PARCEL + bcd3 0 ; ITEMFINDER + bcd3 0 ; SILPH_SCOPE + bcd3 0 ; POKE_FLUTE + bcd3 0 ; LIFT_KEY + bcd3 0 ; EXP_ALL + bcd3 0 ; OLD_ROD + bcd3 0 ; GOOD_ROD + bcd3 0 ; SUPER_ROD + bcd3 0 ; PP_UP + bcd3 0 ; ETHER + bcd3 0 ; MAX_ETHER + bcd3 0 ; ELIXER + bcd3 0 ; MAX_ELIXER assert_table_length NUM_ITEMS - money 0 ; FLOOR_B2F - money 0 ; FLOOR_B1F - money 0 ; FLOOR_1F - money 0 ; FLOOR_2F - money 0 ; FLOOR_3F - money 0 ; FLOOR_4F - money 0 ; FLOOR_5F - money 0 ; FLOOR_6F - money 0 ; FLOOR_7F - money 0 ; FLOOR_8F - money 0 ; FLOOR_9F - money 0 ; FLOOR_10F - money 0 ; FLOOR_11F - money 0 ; FLOOR_B4F + bcd3 0 ; FLOOR_B2F + bcd3 0 ; FLOOR_B1F + bcd3 0 ; FLOOR_1F + bcd3 0 ; FLOOR_2F + bcd3 0 ; FLOOR_3F + bcd3 0 ; FLOOR_4F + bcd3 0 ; FLOOR_5F + bcd3 0 ; FLOOR_6F + bcd3 0 ; FLOOR_7F + bcd3 0 ; FLOOR_8F + bcd3 0 ; FLOOR_9F + bcd3 0 ; FLOOR_10F + bcd3 0 ; FLOOR_11F + bcd3 0 ; FLOOR_B4F assert_table_length NUM_ITEMS + NUM_FLOORS diff --git a/data/items/tm_prices.asm b/data/items/tm_prices.asm index 22bcb074..89501e32 100644 --- a/data/items/tm_prices.asm +++ b/data/items/tm_prices.asm @@ -1,29 +1,54 @@ TechnicalMachinePrices: ; In thousands (nybbles). - table_width 1, TechnicalMachinePrices - dn 3, 2 ; TM01, TM02 - dn 2, 1 ; TM03, TM04 - dn 3, 4 ; TM05, TM06 - dn 2, 4 ; TM07, TM08 - dn 3, 4 ; TM09, TM10 - dn 2, 1 ; TM11, TM12 - dn 4, 5 ; TM13, TM14 - dn 5, 5 ; TM15, TM16 - dn 3, 2 ; TM17, TM18 - dn 3, 2 ; TM19, TM20 - dn 5, 5 ; TM21, TM22 - dn 5, 2 ; TM23, TM24 - dn 5, 4 ; TM25, TM26 - dn 5, 2 ; TM27, TM28 - dn 4, 1 ; TM29, TM30 - dn 2, 1 ; TM31, TM32 - dn 1, 2 ; TM33, TM34 - dn 4, 2 ; TM35, TM36 - dn 2, 5 ; TM37, TM38 - dn 2, 4 ; TM39, TM40 - dn 2, 2 ; TM41, TM42 - dn 5, 2 ; TM43, TM44 - dn 2, 4 ; TM45, TM46 - dn 3, 4 ; TM47, TM48 - dn 4, 2 ; TM49, TM50 - assert_table_length (NUM_TMS + 1) / 2 + nybble_array TechnicalMachinePrices + nybble 3 ; TM01 + nybble 2 ; TM02 + nybble 2 ; TM03 + nybble 1 ; TM04 + nybble 3 ; TM05 + nybble 4 ; TM06 + nybble 2 ; TM07 + nybble 4 ; TM08 + nybble 3 ; TM09 + nybble 4 ; TM10 + nybble 2 ; TM11 + nybble 1 ; TM12 + nybble 4 ; TM13 + nybble 5 ; TM14 + nybble 5 ; TM15 + nybble 5 ; TM16 + nybble 3 ; TM17 + nybble 2 ; TM18 + nybble 3 ; TM19 + nybble 2 ; TM20 + nybble 5 ; TM21 + nybble 5 ; TM22 + nybble 5 ; TM23 + nybble 2 ; TM24 + nybble 5 ; TM25 + nybble 4 ; TM26 + nybble 5 ; TM27 + nybble 2 ; TM28 + nybble 4 ; TM29 + nybble 1 ; TM30 + nybble 2 ; TM31 + nybble 1 ; TM32 + nybble 1 ; TM33 + nybble 2 ; TM34 + nybble 4 ; TM35 + nybble 2 ; TM36 + nybble 2 ; TM37 + nybble 5 ; TM38 + nybble 2 ; TM39 + nybble 4 ; TM40 + nybble 2 ; TM41 + nybble 2 ; TM42 + nybble 5 ; TM43 + nybble 2 ; TM44 + nybble 2 ; TM45 + nybble 4 ; TM46 + nybble 3 ; TM47 + nybble 4 ; TM48 + nybble 4 ; TM49 + nybble 2 ; TM50 + end_nybble_array NUM_TMS diff --git a/data/items/vending_prices.asm b/data/items/vending_prices.asm index 131d525d..9680c48d 100644 --- a/data/items/vending_prices.asm +++ b/data/items/vending_prices.asm @@ -1,6 +1,6 @@ vend_item: MACRO db \1 - money \2 + bcd3 \2 ENDM VendingPrices: diff --git a/data/pokemon/menu_icons.asm b/data/pokemon/menu_icons.asm index 80a45e49..d6ed5b35 100644 --- a/data/pokemon/menu_icons.asm +++ b/data/pokemon/menu_icons.asm @@ -1,79 +1,154 @@ MonPartyData: - table_width 1, MonPartyData - dn ICON_GRASS, ICON_GRASS ; Bulbasaur / Ivysaur - dn ICON_GRASS, ICON_MON ; Venusaur / Charmander - dn ICON_MON, ICON_MON ; Charmeleon / Charizard - dn ICON_WATER, ICON_WATER ; Squirtle / Wartortle - dn ICON_WATER, ICON_BUG ; Blastoise / Caterpie - dn ICON_BUG, ICON_BUG ; Metapod / Butterfree - dn ICON_BUG, ICON_BUG ; Weedle / Kakuna - dn ICON_BUG, ICON_BIRD ; Beedrill / Pidgey - dn ICON_BIRD, ICON_BIRD ; Pidgeotto / Pidgeot - dn ICON_QUADRUPED, ICON_QUADRUPED ; Rattata / Raticate - dn ICON_BIRD, ICON_BIRD ; Spearow / Fearow - dn ICON_SNAKE, ICON_SNAKE ; Ekans / Arbok - dn ICON_FAIRY, ICON_FAIRY ; Pikachu / Raichu - dn ICON_MON, ICON_MON ; Sandshrew / Sandslash - dn ICON_MON, ICON_MON ; NidoranF / Nidorina - dn ICON_MON, ICON_MON ; Nidoqueen / NidoranM - dn ICON_MON, ICON_MON ; Nidorino / Nidoking - dn ICON_FAIRY, ICON_FAIRY ; Clefairy / Clefable - dn ICON_QUADRUPED, ICON_QUADRUPED ; Vulpix / Ninetales - dn ICON_FAIRY, ICON_FAIRY ; Jigglypuff / Wigglytuff - dn ICON_MON, ICON_MON ; Zubat / Golbat - dn ICON_GRASS, ICON_GRASS ; Oddish / Gloom - dn ICON_GRASS, ICON_BUG ; Vileplume / Paras - dn ICON_BUG, ICON_BUG ; Parasect / Venonat - dn ICON_BUG, ICON_MON ; Venomoth / Diglett - dn ICON_MON, ICON_MON ; Dugtrio / Meowth - dn ICON_MON, ICON_MON ; Persian / Psyduck - dn ICON_MON, ICON_MON ; Golduck / Mankey - dn ICON_MON, ICON_QUADRUPED ; Primeape / Growlithe - dn ICON_QUADRUPED, ICON_MON ; Arcanine / Poliwag - dn ICON_MON, ICON_MON ; Poliwhirl / Poliwrath - dn ICON_MON, ICON_MON ; Abra / Kadabra - dn ICON_MON, ICON_MON ; Alakazam / Machop - dn ICON_MON, ICON_MON ; Machoke / Machamp - dn ICON_GRASS, ICON_GRASS ; Bellsprout / Weepinbell - dn ICON_GRASS, ICON_WATER ; Victreebel / Tentacool - dn ICON_WATER, ICON_MON ; Tentacruel / Geodude - dn ICON_MON, ICON_MON ; Graveler / Golem - dn ICON_QUADRUPED, ICON_QUADRUPED ; Ponyta / Rapidash - dn ICON_QUADRUPED, ICON_MON ; Slowpoke / Slowbro - dn ICON_BALL, ICON_BALL ; Magnemite / Magneton - dn ICON_BIRD, ICON_BIRD ; Farfetch'd / Doduo - dn ICON_BIRD, ICON_WATER ; Dodrio / Seel - dn ICON_WATER, ICON_MON ; Dewgong / Grimer - dn ICON_MON, ICON_HELIX ; Muk / Shellder - dn ICON_HELIX, ICON_MON ; Cloyster / Gastly - dn ICON_MON, ICON_MON ; Haunter / Gengar - dn ICON_SNAKE, ICON_MON ; Onix / Drowzee - dn ICON_MON, ICON_WATER ; Hypno / Krabby - dn ICON_WATER, ICON_BALL ; Kingler / Voltorb - dn ICON_BALL, ICON_GRASS ; Electrode / Exeggcute - dn ICON_GRASS, ICON_MON ; Exeggutor / Cubone - dn ICON_MON, ICON_MON ; Marowak / Hitmonlee - dn ICON_MON, ICON_MON ; Hitmonchan / Lickitung - dn ICON_MON, ICON_MON ; Koffing / Weezing - dn ICON_QUADRUPED, ICON_MON ; Rhyhorn / Rhydon - dn ICON_FAIRY, ICON_GRASS ; Chansey / Tangela - dn ICON_MON, ICON_WATER ; Kangaskhan / Horsea - dn ICON_WATER, ICON_WATER ; Seadra / Goldeen - dn ICON_WATER, ICON_HELIX ; Seaking / Staryu - dn ICON_HELIX, ICON_MON ; Starmie / Mr.Mime - dn ICON_BUG, ICON_MON ; Scyther / Jynx - dn ICON_MON, ICON_MON ; Electabuzz / Magmar - dn ICON_BUG, ICON_QUADRUPED ; Pinsir / Tauros - dn ICON_WATER, ICON_SNAKE ; Magikarp / Gyarados - dn ICON_WATER, ICON_MON ; Lapras / Ditto - dn ICON_QUADRUPED, ICON_QUADRUPED ; Eevee / Vaporeon - dn ICON_QUADRUPED, ICON_QUADRUPED ; Jolteon / Flareon - dn ICON_MON, ICON_HELIX ; Porygon / Omanyte - dn ICON_HELIX, ICON_HELIX ; Omastar / Kabuto - dn ICON_HELIX, ICON_BIRD ; Kabutops / Aerodactyl - dn ICON_MON, ICON_BIRD ; Snorlax / Articuno - dn ICON_BIRD, ICON_BIRD ; Zapdos / Moltres - dn ICON_SNAKE, ICON_SNAKE ; Dratini / Dragonair - dn ICON_SNAKE, ICON_MON ; Dragonite / Mewtwo - dn ICON_MON, 0 ; Mew / padding - assert_table_length (NUM_POKEMON + 1) / 2 + nybble_array MonPartyData + nybble ICON_GRASS ; Bulbasaur + nybble ICON_GRASS ; Ivysaur + nybble ICON_GRASS ; Venusaur + nybble ICON_MON ; Charmander + nybble ICON_MON ; Charmeleon + nybble ICON_MON ; Charizard + nybble ICON_WATER ; Squirtle + nybble ICON_WATER ; Wartortle + nybble ICON_WATER ; Blastoise + nybble ICON_BUG ; Caterpie + nybble ICON_BUG ; Metapod + nybble ICON_BUG ; Butterfree + nybble ICON_BUG ; Weedle + nybble ICON_BUG ; Kakuna + nybble ICON_BUG ; Beedrill + nybble ICON_BIRD ; Pidgey + nybble ICON_BIRD ; Pidgeotto + nybble ICON_BIRD ; Pidgeot + nybble ICON_QUADRUPED ; Rattata + nybble ICON_QUADRUPED ; Raticate + nybble ICON_BIRD ; Spearow + nybble ICON_BIRD ; Fearow + nybble ICON_SNAKE ; Ekans + nybble ICON_SNAKE ; Arbok + nybble ICON_FAIRY ; Pikachu + nybble ICON_FAIRY ; Raichu + nybble ICON_MON ; Sandshrew + nybble ICON_MON ; Sandslash + nybble ICON_MON ; NidoranF + nybble ICON_MON ; Nidorina + nybble ICON_MON ; Nidoqueen + nybble ICON_MON ; NidoranM + nybble ICON_MON ; Nidorino + nybble ICON_MON ; Nidoking + nybble ICON_FAIRY ; Clefairy + nybble ICON_FAIRY ; Clefable + nybble ICON_QUADRUPED ; Vulpix + nybble ICON_QUADRUPED ; Ninetales + nybble ICON_FAIRY ; Jigglypuff + nybble ICON_FAIRY ; Wigglytuff + nybble ICON_MON ; Zubat + nybble ICON_MON ; Golbat + nybble ICON_GRASS ; Oddish + nybble ICON_GRASS ; Gloom + nybble ICON_GRASS ; Vileplume + nybble ICON_BUG ; Paras + nybble ICON_BUG ; Parasect + nybble ICON_BUG ; Venonat + nybble ICON_BUG ; Venomoth + nybble ICON_MON ; Diglett + nybble ICON_MON ; Dugtrio + nybble ICON_MON ; Meowth + nybble ICON_MON ; Persian + nybble ICON_MON ; Psyduck + nybble ICON_MON ; Golduck + nybble ICON_MON ; Mankey + nybble ICON_MON ; Primeape + nybble ICON_QUADRUPED ; Growlithe + nybble ICON_QUADRUPED ; Arcanine + nybble ICON_MON ; Poliwag + nybble ICON_MON ; Poliwhirl + nybble ICON_MON ; Poliwrath + nybble ICON_MON ; Abra + nybble ICON_MON ; Kadabra + nybble ICON_MON ; Alakazam + nybble ICON_MON ; Machop + nybble ICON_MON ; Machoke + nybble ICON_MON ; Machamp + nybble ICON_GRASS ; Bellsprout + nybble ICON_GRASS ; Weepinbell + nybble ICON_GRASS ; Victreebel + nybble ICON_WATER ; Tentacool + nybble ICON_WATER ; Tentacruel + nybble ICON_MON ; Geodude + nybble ICON_MON ; Graveler + nybble ICON_MON ; Golem + nybble ICON_QUADRUPED ; Ponyta + nybble ICON_QUADRUPED ; Rapidash + nybble ICON_QUADRUPED ; Slowpoke + nybble ICON_MON ; Slowbro + nybble ICON_BALL ; Magnemite + nybble ICON_BALL ; Magneton + nybble ICON_BIRD ; Farfetch'd + nybble ICON_BIRD ; Doduo + nybble ICON_BIRD ; Dodrio + nybble ICON_WATER ; Seel + nybble ICON_WATER ; Dewgong + nybble ICON_MON ; Grimer + nybble ICON_MON ; Muk + nybble ICON_HELIX ; Shellder + nybble ICON_HELIX ; Cloyster + nybble ICON_MON ; Gastly + nybble ICON_MON ; Haunter + nybble ICON_MON ; Gengar + nybble ICON_SNAKE ; Onix + nybble ICON_MON ; Drowzee + nybble ICON_MON ; Hypno + nybble ICON_WATER ; Krabby + nybble ICON_WATER ; Kingler + nybble ICON_BALL ; Voltorb + nybble ICON_BALL ; Electrode + nybble ICON_GRASS ; Exeggcute + nybble ICON_GRASS ; Exeggutor + nybble ICON_MON ; Cubone + nybble ICON_MON ; Marowak + nybble ICON_MON ; Hitmonlee + nybble ICON_MON ; Hitmonchan + nybble ICON_MON ; Lickitung + nybble ICON_MON ; Koffing + nybble ICON_MON ; Weezing + nybble ICON_QUADRUPED ; Rhyhorn + nybble ICON_MON ; Rhydon + nybble ICON_FAIRY ; Chansey + nybble ICON_GRASS ; Tangela + nybble ICON_MON ; Kangaskhan + nybble ICON_WATER ; Horsea + nybble ICON_WATER ; Seadra + nybble ICON_WATER ; Goldeen + nybble ICON_WATER ; Seaking + nybble ICON_HELIX ; Staryu + nybble ICON_HELIX ; Starmie + nybble ICON_MON ; Mr.Mime + nybble ICON_BUG ; Scyther + nybble ICON_MON ; Jynx + nybble ICON_MON ; Electabuzz + nybble ICON_MON ; Magmar + nybble ICON_BUG ; Pinsir + nybble ICON_QUADRUPED ; Tauros + nybble ICON_WATER ; Magikarp + nybble ICON_SNAKE ; Gyarados + nybble ICON_WATER ; Lapras + nybble ICON_MON ; Ditto + nybble ICON_QUADRUPED ; Eevee + nybble ICON_QUADRUPED ; Vaporeon + nybble ICON_QUADRUPED ; Jolteon + nybble ICON_QUADRUPED ; Flareon + nybble ICON_MON ; Porygon + nybble ICON_HELIX ; Omanyte + nybble ICON_HELIX ; Omastar + nybble ICON_HELIX ; Kabuto + nybble ICON_HELIX ; Kabutops + nybble ICON_BIRD ; Aerodactyl + nybble ICON_MON ; Snorlax + nybble ICON_BIRD ; Articuno + nybble ICON_BIRD ; Zapdos + nybble ICON_BIRD ; Moltres + nybble ICON_SNAKE ; Dratini + nybble ICON_SNAKE ; Dragonair + nybble ICON_SNAKE ; Dragonite + nybble ICON_MON ; Mewtwo + nybble ICON_MON ; Mew + end_nybble_array NUM_POKEMON diff --git a/data/trainers/pic_pointers_money.asm b/data/trainers/pic_pointers_money.asm index 3143095c..c60a3ef9 100644 --- a/data/trainers/pic_pointers_money.asm +++ b/data/trainers/pic_pointers_money.asm @@ -1,6 +1,6 @@ pic_money: MACRO dw \1 - money \2 + bcd3 \2 ENDM TrainerPicAndMoneyPointers:: diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 5cb4fa13..8eee39d2 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6308,7 +6308,7 @@ LoadPlayerBackPic: ld de, OldManPicBack .next ld a, BANK(RedPicBack) - assert BANK(RedPicBack) == BANK(OldManPicBack) + ASSERT BANK(RedPicBack) == BANK(OldManPicBack) call UncompressSpriteFromDE predef ScaleSpriteByTwo ld hl, wOAMBuffer diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 38ea37c0..8114db2b 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -2614,9 +2614,10 @@ IsKeyItem_:: jr nc, .checkIfItemIsHM ; if the item is not an HM or TM push af - ld hl, KeyItemBitfield + ld hl, KeyItemFlags ld de, wBuffer ld bc, 15 ; only 11 bytes are actually used + ASSERT 15 >= (NUM_ITEMS + 7) / 8 call CopyData pop af dec a diff --git a/home/names2.asm b/home/names2.asm index cb53154c..7b905fc5 100644 --- a/home/names2.asm +++ b/home/names2.asm @@ -20,11 +20,11 @@ GetName:: ; TM names are separate from item names. ; BUG: This applies to all names instead of just items. - assert NUM_POKEMON_INDEXES < HM01, \ + ASSERT NUM_POKEMON_INDEXES < HM01, \ "A bug in GetName will get TM/HM names for Pokémon above ${x:HM01}." - assert NUM_ATTACKS < HM01, \ + ASSERT NUM_ATTACKS < HM01, \ "A bug in GetName will get TM/HM names for moves above ${x:HM01}." - assert NUM_TRAINERS < HM01, \ + ASSERT NUM_TRAINERS < HM01, \ "A bug in GetName will get TM/HM names for trainers above ${x:HM01}." cp HM01 jp nc, GetMachineName diff --git a/layout.link b/layout.link index 87ab7e0e..1ac07b3f 100644 --- a/layout.link +++ b/layout.link @@ -182,7 +182,7 @@ WRAM0 org $c100 "Sprite State Data" "OAM Buffer" - org $dfff + org $df00 "Stack" VRAM "VRAM" diff --git a/macros/asserts.asm b/macros/asserts.asm index a07bc553..946add28 100644 --- a/macros/asserts.asm +++ b/macros/asserts.asm @@ -38,6 +38,76 @@ x = \1 "{CURRENT_LIST_START}: expected {d:x} entries, got {d:list_index}" ENDM +nybble_array: MACRO +CURRENT_NYBBLE_ARRAY_VALUE = 0 +CURRENT_NYBBLE_ARRAY_LENGTH = 0 +IF _NARG == 1 +REDEF CURRENT_NYBBLE_ARRAY_START EQUS "\1" +ELSE +REDEF CURRENT_NYBBLE_ARRAY_START EQUS "._nybble_array\@" +{CURRENT_NYBBLE_ARRAY_START}: +ENDC +ENDM + +nybble: MACRO + ASSERT 0 <= (\1) && (\1) < $10, "nybbles must be 0-15" +CURRENT_NYBBLE_ARRAY_VALUE = (\1) | (CURRENT_NYBBLE_ARRAY_VALUE << 4) +CURRENT_NYBBLE_ARRAY_LENGTH = CURRENT_NYBBLE_ARRAY_LENGTH + 1 +IF CURRENT_NYBBLE_ARRAY_LENGTH % 2 == 0 + db CURRENT_NYBBLE_ARRAY_VALUE +CURRENT_NYBBLE_ARRAY_VALUE = 0 +ENDC +ENDM + +end_nybble_array: MACRO +IF CURRENT_NYBBLE_ARRAY_LENGTH % 2 + db CURRENT_NYBBLE_ARRAY_VALUE << 4 +ENDC +IF _NARG == 1 +x = \1 + ASSERT x == CURRENT_NYBBLE_ARRAY_LENGTH, \ + "{CURRENT_NYBBLE_ARRAY_START}: expected {d:x} nybbles, got {d:CURRENT_NYBBLE_ARRAY_LENGTH}" +x = (x + 1) / 2 + ASSERT x == @ - {CURRENT_NYBBLE_ARRAY_START}, \ + "{CURRENT_NYBBLE_ARRAY_START}: expected {d:x} bytes" +ENDC +ENDM + +bit_array: MACRO +CURRENT_BIT_ARRAY_VALUE = 0 +CURRENT_BIT_ARRAY_LENGTH = 0 +IF _NARG == 1 +REDEF CURRENT_BIT_ARRAY_START EQUS "\1" +ELSE +REDEF CURRENT_BIT_ARRAY_START EQUS "._bit_array\@" +{CURRENT_BIT_ARRAY_START}: +ENDC +ENDM + +dbit: MACRO + ASSERT (\1) == 0 || (\1) == 1, "bits must be 0 or 1" +CURRENT_BIT_ARRAY_VALUE = CURRENT_BIT_ARRAY_VALUE | ((\1) << (CURRENT_BIT_ARRAY_LENGTH % 8)) +CURRENT_BIT_ARRAY_LENGTH = CURRENT_BIT_ARRAY_LENGTH + 1 +IF CURRENT_BIT_ARRAY_LENGTH % 8 == 0 + db CURRENT_BIT_ARRAY_VALUE +CURRENT_BIT_ARRAY_VALUE = 0 +ENDC +ENDM + +end_bit_array: MACRO +IF CURRENT_BIT_ARRAY_LENGTH % 8 + db CURRENT_BIT_ARRAY_VALUE +ENDC +IF _NARG == 1 +x = \1 + ASSERT x == CURRENT_BIT_ARRAY_LENGTH, \ + "{CURRENT_BIT_ARRAY_START}: expected {d:x} bits, got {d:CURRENT_BIT_ARRAY_LENGTH}" +x = (x + 7) / 8 + ASSERT x == @ - {CURRENT_BIT_ARRAY_START}, \ + "{CURRENT_BIT_ARRAY_START}: expected {d:x} bytes" +ENDC +ENDM + def_grass_wildmons: MACRO ;\1: encounter rate CURRENT_GRASS_WILDMONS_RATE = \1 @@ -48,10 +118,10 @@ ENDM end_grass_wildmons: MACRO IF CURRENT_GRASS_WILDMONS_RATE == 0 - assert 1 == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ + ASSERT 1 == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ "def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected 1 byte" ELSE - assert WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ + ASSERT WILDDATA_LENGTH == @ - {CURRENT_GRASS_WILDMONS_LABEL}, \ "def_grass_wildmons {d:CURRENT_GRASS_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes" ENDC ENDM @@ -66,10 +136,10 @@ ENDM end_water_wildmons: MACRO IF CURRENT_WATER_WILDMONS_RATE == 0 - assert 1 == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ + ASSERT 1 == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ "def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected 1 byte" ELSE - assert WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ + ASSERT WILDDATA_LENGTH == @ - {CURRENT_WATER_WILDMONS_LABEL}, \ "def_water_wildmons {d:CURRENT_WATER_WILDMONS_RATE}: expected {d:WILDDATA_LENGTH} bytes" ENDC ENDM diff --git a/macros/data.asm b/macros/data.asm index fb8ea844..eb5b5564 100644 --- a/macros/data.asm +++ b/macros/data.asm @@ -13,9 +13,6 @@ bcd3: MACRO dn ((\1) / 10) % 10, (\1) % 10 ENDM -coins EQUS "bcd2" -money EQUS "bcd3" - ; used in data/pokemon/base_stats/*.asm tmhm: MACRO ; initialize bytes to 0 @@ -63,8 +60,3 @@ ENDM dab: MACRO dwb \1, BANK(\1) ENDM - -dbbw: MACRO - db \1, \2 - dw \3 -ENDM diff --git a/macros/wram.asm b/macros/wram.asm index 41fd1dad..9d412f2d 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -61,19 +61,19 @@ battle_struct: MACRO ENDM spritestatedata1: MACRO -\1PictureID:: db -\1MovementStatus:: db -\1ImageIndex:: db -\1YStepVector:: db -\1YPixels:: db -\1XStepVector:: db -\1XPixels:: db +\1PictureID:: db +\1MovementStatus:: db +\1ImageIndex:: db +\1YStepVector:: db +\1YPixels:: db +\1XStepVector:: db +\1XPixels:: db \1IntraAnimFrameCounter:: db -\1AnimFrameCounter:: db -\1FacingDirection:: db -\1YAdjusted:: db -\1XAdjusted:: db -\1CollisionData:: db +\1AnimFrameCounter:: db +\1FacingDirection:: db +\1YAdjusted:: db +\1XAdjusted:: db +\1CollisionData:: db ds 3 \1End:: ENDM @@ -81,17 +81,24 @@ ENDM spritestatedata2: MACRO \1WalkAnimationCounter:: db ds 1 -\1YDisplacement:: db -\1XDisplacement:: db -\1MapY:: db -\1MapX:: db -\1MovementByte1:: db -\1GrassPriority:: db -\1MovementDelay:: db -\1OrigFacingDirection:: db +\1YDisplacement:: db +\1XDisplacement:: db +\1MapY:: db +\1MapX:: db +\1MovementByte1:: db +\1GrassPriority:: db +\1MovementDelay:: db +\1OrigFacingDirection:: db ds 3 -\1PictureID:: db -\1ImageBaseOffset:: db +\1PictureID:: db +\1ImageBaseOffset:: db ds 1 \1End:: ENDM + +sprite_oam_struct: MACRO +\1YCoord:: db +\1XCoord:: db +\1TileID:: db +\1Attributes:: db +ENDM diff --git a/rgbdscheck.asm b/rgbdscheck.asm index 59810eac..25277131 100644 --- a/rgbdscheck.asm +++ b/rgbdscheck.asm @@ -1,9 +1,9 @@ MAJOR EQU 0 MINOR EQU 5 -PATCH EQU 0 +PATCH EQU 1 wrong_rgbds: MACRO - fail "pokered requires rgbds v0.5.0 or newer." + fail "pokered requires rgbds v0.5.1 or newer." ENDM IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__) @@ -1,4 +1,4 @@ -SECTION "Sprite Buffers", SRAM ; BANK 0 +SECTION "Sprite Buffers", SRAM sSpriteBuffer0:: ds SPRITEBUFFERSIZE sSpriteBuffer1:: ds SPRITEBUFFERSIZE @@ -9,42 +9,43 @@ sSpriteBuffer2:: ds SPRITEBUFFERSIZE sHallOfFame:: ds HOF_TEAM * HOF_TEAM_CAPACITY -SECTION "Save Data", SRAM ; BANK 1 +SECTION "Save Data", SRAM + ds $598 sPlayerName:: ds NAME_LENGTH -sMainData:: ds wMainDataEnd - wMainDataStart +sMainData:: ds wMainDataEnd - wMainDataStart sSpriteData:: ds wSpriteDataEnd - wSpriteDataStart -sPartyData:: ds wPartyDataEnd - wPartyDataStart -sCurBoxData:: ds wBoxDataEnd - wBoxDataStart -sTileAnimations:: ds 1 -sMainDataCheckSum:: ds 1 +sPartyData:: ds wPartyDataEnd - wPartyDataStart +sCurBoxData:: ds wBoxDataEnd - wBoxDataStart +sTileAnimations:: db +sMainDataCheckSum:: db ; The PC boxes will not fit into one SRAM bank, ; so they use multiple SECTIONs box_n = 0 boxes: MACRO -rept \1 +REPT \1 box_n = box_n + 1 sBox{d:box_n}:: ds wBoxDataEnd - wBoxDataStart -endr +ENDR ENDM -SECTION "Saved Boxes 1", SRAM ; BANK 2 +SECTION "Saved Boxes 1", SRAM ; sBox1 - sBox6 boxes 6 -sBank2AllBoxesChecksum:: ds 1 +sBank2AllBoxesChecksum:: db sBank2IndividualBoxChecksums:: ds 6 -SECTION "Saved Boxes 2", SRAM ; BANK 3 +SECTION "Saved Boxes 2", SRAM ; sBox7 - sBox12 boxes 6 -sBank3AllBoxesChecksum:: ds 1 +sBank3AllBoxesChecksum:: db sBank3IndividualBoxChecksums:: ds 6 ; All 12 boxes fit 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/tools/unnamed.py b/tools/unnamed.py index e4634541..c5544437 100755 --- a/tools/unnamed.py +++ b/tools/unnamed.py @@ -82,14 +82,14 @@ for objfile in objects: elif magic == b'RGB9': obj_ver = 10 + unpack_file("<I", f)[0] - if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17]: + if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17, 18]: print("Error: File '%s' is of an unknown format." % objfile, file=stderr) exit(1) num_symbols = unpack_file("<I", f)[0] unpack_file("<I", f) # skip num sections - if obj_ver in [16, 17]: + if obj_ver in [16, 17, 18]: node_filenames = [] num_nodes = unpack_file("<I", f)[0] for x in range(num_nodes): @@ -109,7 +109,7 @@ for objfile in objects: sym_type = symtype(unpack_file("<B", f)[0] & 0x7f) if sym_type == symtype.IMPORT: continue - if obj_ver in [16, 17]: + if obj_ver in [16, 17, 18]: sym_fileno = unpack_file("<I", f)[0] sym_filename = node_filenames[sym_fileno] else: @@ -8,11 +8,9 @@ INCLUDE "vram.asm" SECTION "WRAM", WRAM0 -wUnusedC000:: - ds 1 +wUnusedC000:: db -wSoundID:: - ds 1 +wSoundID:: db wMuteAudioAndPauseMusic:: ; bit 7: whether sound has been muted @@ -23,14 +21,11 @@ wMuteAudioAndPauseMusic:: ; Store 0 to resume music. ds 1 -wDisableChannelOutputWhenSfxEnds:: - ds 1 +wDisableChannelOutputWhenSfxEnds:: db -wStereoPanning:: - ds 1 +wStereoPanning:: db -wSavedVolume:: - ds 1 +wSavedVolume:: db wChannelCommandPointers:: ds 16 @@ -117,35 +112,25 @@ wChannelVolumes:: ; also includes fade for hardware channels that support it ds 8 -wMusicWaveInstrument:: - ds 1 +wMusicWaveInstrument:: db -wSfxWaveInstrument:: - ds 1 +wSfxWaveInstrument:: db -wMusicTempo:: - ds 2 +wMusicTempo:: dw -wSfxTempo:: - ds 2 +wSfxTempo:: dw -wSfxHeaderPointer:: - ds 2 +wSfxHeaderPointer:: dw -wNewSoundID:: - ds 1 +wNewSoundID:: db -wAudioROMBank:: - ds 1 +wAudioROMBank:: db -wAudioSavedROMBank:: - ds 1 +wAudioSavedROMBank:: db -wFrequencyModifier:: - ds 1 +wFrequencyModifier:: db -wTempoModifier:: - ds 1 +wTempoModifier:: db ds 13 @@ -177,9 +162,9 @@ wSpriteStateData1:: ; - F wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1 ; player is struct 0 ; wSprite02StateData1 - wSprite15StateData1 -for n, 1, NUM_SPRITESTATEDATA_STRUCTS +FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS wSprite{02d:n}StateData1:: spritestatedata1 wSprite{02d:n}StateData1 -endr +ENDR wSpriteStateData2:: ; more data for all sprites on the current map @@ -204,14 +189,14 @@ wSpriteStateData2:: ; - F wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2 ; player is struct 0 ; wSprite02StateData2 - wSprite15StateData2 -for n, 1, NUM_SPRITESTATEDATA_STRUCTS +FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS wSprite{02d:n}StateData2:: spritestatedata2 wSprite{02d:n}StateData2 -endr +ENDR ; The high byte of a pointer to anywhere within wSpriteStateData1 can be incremented ; to reach within wSpriteStateData2, and vice-versa for decrementing. -assert HIGH(wSpriteStateData1) + 1 == HIGH(wSpriteStateData2) -assert LOW(wSpriteStateData1) == 0 +ASSERT HIGH(wSpriteStateData1) + 1 == HIGH(wSpriteStateData2) +ASSERT LOW(wSpriteStateData1) == 0 wSpriteDataEnd:: @@ -221,9 +206,9 @@ SECTION "OAM Buffer", WRAM0 wOAMBuffer:: ; buffer for OAM data. Copied to OAM by DMA ; wOAMBufferSprite00 - wOAMBufferSprite39 -for n, NUM_SPRITE_OAM_STRUCTS -wOAMBufferSprite{02d:n}:: ds 4 -endr +FOR n, NUM_SPRITE_OAM_STRUCTS +wOAMBufferSprite{02d:n}:: sprite_oam_struct wOAMBufferSprite{02d:n} +ENDR wOAMBufferEnd:: wTileMap:: @@ -263,10 +248,8 @@ wRedrawRowOrColumnSrcTiles:: ds SCREEN_WIDTH * 2 ; coordinates of the position of the cursor for the top menu item (id 0) -wTopMenuItemY:: - ds 1 -wTopMenuItemX:: - ds 1 +wTopMenuItemY:: db +wTopMenuItemX:: db wCurrentMenuItem:: ; the id of the currently selected menu item @@ -312,8 +295,7 @@ wBattleAndStartSavedMenuItem:: ; a sub-menu is shown. It's reset at the start of each battle. ds 1 -wPlayerMoveListIndex:: - ds 1 +wPlayerMoveListIndex:: db wPlayerMonNumber:: ; index in party of currently battling mon @@ -345,8 +327,7 @@ wMenuWatchMovingOutOfBounds:: ; allows the caller to scroll the entire menu up or down when this happens. ds 1 -wTradeCenterPointerTableIndex:: - ds 1 +wTradeCenterPointerTableIndex:: db ds 1 @@ -422,16 +403,13 @@ wCheckFor180DegreeTurn:: ds 1 -wMissableObjectIndex:: - ds 1 +wMissableObjectIndex:: db -wPredefID:: - ds 1 +wPredefID:: db wPredefRegisters:: ds 6 -wTrainerHeaderFlagBit:: - ds 1 +wTrainerHeaderFlagBit:: db ds 1 @@ -481,14 +459,11 @@ wBoostExpByExpAll:: wAnimationType:: ; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon... -wNPCMovementDirections:: - ds 1 +wNPCMovementDirections:: db -wDexRatingNumMonsOwned:: - ds 1 +wDexRatingNumMonsOwned:: db -wDexRatingText:: - ds 1 +wDexRatingText:: db wSlotMachineSavedROMBank:: ; ROM back to return to when the player is done with the slot machine @@ -496,8 +471,7 @@ wSlotMachineSavedROMBank:: ds 26 -wAnimPalette:: - ds 1 +wAnimPalette:: db ds 29 @@ -520,8 +494,7 @@ ENDU ds 10 -wRLEByteCount:: - ds 1 +wRLEByteCount:: db wAddedToParty:: ; 0 = not added @@ -541,19 +514,15 @@ wCanEvolveFlags:: ; Other methods of evolution simply set it by calling TryEvolvingMon. ds 1 -wForceEvolution:: - ds 1 +wForceEvolution:: db ; if [wAILayer2Encouragement] != 1, the second AI layer is not applied -wAILayer2Encouragement:: - ds 1 +wAILayer2Encouragement:: db ds 1 ; current HP of player and enemy substitutes -wPlayerSubstituteHP:: - ds 1 -wEnemySubstituteHP:: - ds 1 +wPlayerSubstituteHP:: db +wEnemySubstituteHP:: db wTestBattlePlayerSelectedMove:: ; The player's selected move during a test battle. @@ -566,13 +535,10 @@ wMoveMenuType:: ; 0=regular, 1=mimic, 2=above message box (relearn, heal pp..) ds 1 -wPlayerSelectedMove:: - ds 1 -wEnemySelectedMove:: - ds 1 +wPlayerSelectedMove:: db +wEnemySelectedMove:: db -wLinkBattleRandomNumberListIndex:: - ds 1 +wLinkBattleRandomNumberListIndex:: db wAICount:: ; number of times remaining that AI action can occur @@ -580,8 +546,7 @@ wAICount:: ds 2 -wEnemyMoveListIndex:: - ds 1 +wEnemyMoveListIndex:: db wLastSwitchInEnemyMonHP:: ; The enemy mon's HP when it was switched in or when the current player mon @@ -593,15 +558,12 @@ wTotalPayDayMoney:: ; total amount of money made using Pay Day during the current battle ds 3 -wSafariEscapeFactor:: - ds 1 -wSafariBaitFactor:: - ds 1 +wSafariEscapeFactor:: db +wSafariBaitFactor:: db ds 1 -wTransformedEnemyMonOriginalDVs:: - ds 2 +wTransformedEnemyMonOriginalDVs:: dw wMonIsDisobedient:: ds 1 @@ -629,8 +591,7 @@ wLowHealthAlarmDisabled:: ; battle. ds 1 -wPlayerMonMinimized:: - ds 1 +wPlayerMonMinimized:: db ds 13 @@ -646,72 +607,51 @@ wEnemyBideAccumulatedDamage:: wInGameTradeGiveMonSpecies:: -wPlayerMonUnmodifiedLevel:: - ds 1 +wPlayerMonUnmodifiedLevel:: db wInGameTradeTextPointerTablePointer:: -wPlayerMonUnmodifiedMaxHP:: - ds 2 +wPlayerMonUnmodifiedMaxHP:: dw wInGameTradeTextPointerTableIndex:: -wPlayerMonUnmodifiedAttack:: - ds 1 -wInGameTradeGiveMonName:: - ds 1 -wPlayerMonUnmodifiedDefense:: - ds 2 -wPlayerMonUnmodifiedSpeed:: - ds 2 -wPlayerMonUnmodifiedSpecial:: - ds 2 +wPlayerMonUnmodifiedAttack:: db +wInGameTradeGiveMonName:: db +wPlayerMonUnmodifiedDefense:: dw +wPlayerMonUnmodifiedSpeed:: dw +wPlayerMonUnmodifiedSpecial:: dw ; stat modifiers for the player's current pokemon ; value can range from 1 - 13 ($1 to $D) ; 7 is normal wPlayerMonStatMods:: -wPlayerMonAttackMod:: - ds 1 -wPlayerMonDefenseMod:: - ds 1 -wPlayerMonSpeedMod:: - ds 1 -wPlayerMonSpecialMod:: - ds 1 +wPlayerMonAttackMod:: db +wPlayerMonDefenseMod:: db +wPlayerMonSpeedMod:: db +wPlayerMonSpecialMod:: db wInGameTradeReceiveMonName:: -wPlayerMonAccuracyMod:: - ds 1 -wPlayerMonEvasionMod:: - ds 1 +wPlayerMonAccuracyMod:: db +wPlayerMonEvasionMod:: db ds 2 wPlayerMonStatModsEnd:: ds 1 -wEnemyMonUnmodifiedLevel:: - ds 1 -wEnemyMonUnmodifiedMaxHP:: - ds 2 -wEnemyMonUnmodifiedAttack:: - ds 2 -wEnemyMonUnmodifiedDefense:: - ds 1 +wEnemyMonUnmodifiedLevel:: db +wEnemyMonUnmodifiedMaxHP:: dw +wEnemyMonUnmodifiedAttack:: dw +wEnemyMonUnmodifiedDefense:: db -wInGameTradeMonNick:: - ds 1 +wInGameTradeMonNick:: db -wEnemyMonUnmodifiedSpeed:: - ds 2 -wEnemyMonUnmodifiedSpecial:: - ds 1 +wEnemyMonUnmodifiedSpeed:: dw +wEnemyMonUnmodifiedSpecial:: db -wEngagedTrainerClass:: - ds 1 +wEngagedTrainerClass:: db wEngagedTrainerSet:: ; ds 1 @@ -720,21 +660,14 @@ wEngagedTrainerSet:: ; 7 is normal wEnemyMonStatMods:: -wEnemyMonAttackMod:: - ds 1 -wEnemyMonDefenseMod:: - ds 1 -wEnemyMonSpeedMod:: - ds 1 -wEnemyMonSpecialMod:: - ds 1 -wEnemyMonAccuracyMod:: - ds 1 -wEnemyMonEvasionMod:: - ds 1 +wEnemyMonAttackMod:: db +wEnemyMonDefenseMod:: db +wEnemyMonSpeedMod:: db +wEnemyMonSpecialMod:: db +wEnemyMonAccuracyMod:: db +wEnemyMonEvasionMod:: db -wInGameTradeReceiveMonSpecies:: - ds 1 +wInGameTradeReceiveMonSpecies:: db ds 1 wEnemyMonStatModsEnd:: @@ -875,8 +808,7 @@ wWhichTrade:: wTrainerSpriteOffset:: -wUnusedCD3D:: - ds 1 +wUnusedCD3D:: db wHUDPokeballGfxOffsetX:: ; difference in X between the next ball and the current one @@ -920,8 +852,7 @@ wPlayerSpinWhileMovingUpOrDownAnimMaxY:: wHiddenObjectFunctionRomBank:: -wTrainerEngageDistance:: - ds 1 +wTrainerEngageDistance:: db wHUDGraphicsTiles:: ; 3 bytes @@ -954,8 +885,7 @@ wPlayerSpinWhileMovingUpOrDownAnimFrameDelay:: wHiddenObjectIndex:: -wTrainerFacingDirection:: - ds 1 +wTrainerFacingDirection:: db wHoFMonOrPlayer:: ; show mon or show player? @@ -970,8 +900,7 @@ wHiddenObjectY:: wTrainerScreenY:: -wOptionsCancelCursorX:: - ds 1 +wOptionsCancelCursorX:: db wDayCarePerLevelCost:: ; 2-byte BCD number (always set to $100) @@ -991,41 +920,34 @@ wNumFieldMoves:: wSlotMachineWheel1BottomTile:: -wTrainerScreenX:: - ds 1 +wTrainerScreenX:: db ; a lot of the uses for these values use more than the said address wHoFTeamNo:: wSlotMachineWheel1MiddleTile:: -wFieldMovesLeftmostXCoord:: - ds 1 +wFieldMovesLeftmostXCoord:: db wLastFieldMoveID:: ; unused -wSlotMachineWheel1TopTile:: - ds 1 +wSlotMachineWheel1TopTile:: db -wSlotMachineWheel2BottomTile:: - ds 1 +wSlotMachineWheel2BottomTile:: db -wSlotMachineWheel2MiddleTile:: - ds 1 +wSlotMachineWheel2MiddleTile:: db wTempCoins1:: ; 2 bytes ; temporary variable used to add payout amount to the player's coins -wSlotMachineWheel2TopTile:: - ds 1 +wSlotMachineWheel2TopTile:: db wBattleTransitionSpiralDirection:: ; 0 = outward, 1 = inward -wSlotMachineWheel3BottomTile:: - ds 1 +wSlotMachineWheel3BottomTile:: db wSlotMachineWheel3MiddleTile:: @@ -1070,8 +992,7 @@ wCutTile:: wSlotMachineWheel2SlipCounter:: ; wheel 2 can "slip" while this is non-zero -wTradedEnemyMonOT:: - ds 1 +wTradedEnemyMonOT:: db wSavedPlayerScreenY:: @@ -1094,8 +1015,7 @@ wWhichAnimationOffsets:: ; 0 = cut animation, 1 = boulder dust animation ds 9 -wTradedEnemyMonOTID:: - ds 2 +wTradedEnemyMonOTID:: dw wStandingOnWarpPadOrHole:: ; 0 = neither @@ -1104,14 +1024,11 @@ wStandingOnWarpPadOrHole:: wOAMBaseTile:: -wGymTrashCanIndex:: - ds 1 +wGymTrashCanIndex:: db -wSymmetricSpriteOAMAttributes:: - ds 1 +wSymmetricSpriteOAMAttributes:: db -wMonPartySpriteSpecies:: - ds 1 +wMonPartySpriteSpecies:: db wLeftGBMonSpecies:: ; in the trade animation, the mon that leaves the left gameboy @@ -1204,16 +1121,14 @@ wLearningMovesFromDayCare:: wChangeMonPicEnemyTurnSpecies:: -wHPBarMaxHP:: - ds 1 +wHPBarMaxHP:: db wNamingScreenSubmitName:: ; non-zero when the player has chosen to submit the name wChangeMonPicPlayerTurnSpecies:: -wEvoNewSpecies:: - ds 1 +wEvoNewSpecies:: db wAlphabetCase:: ; 0 = upper case @@ -1221,34 +1136,27 @@ wAlphabetCase:: wEvoMonTileOffset:: -wHPBarOldHP:: - ds 1 +wHPBarOldHP:: db -wEvoCancelled:: - ds 1 +wEvoCancelled:: db wNamingScreenLetter:: -wHPBarNewHP:: - ds 2 -wHPBarDelta:: - ds 1 +wHPBarNewHP:: dw +wHPBarDelta:: db -wHPBarTempHP:: - ds 2 +wHPBarTempHP:: dw ds 11 -wHPBarHPDifference:: - ds 1 +wHPBarHPDifference:: db ds 7 wAIItem:: ; the item that the AI used ds 1 -wUsedItemOnWhichPokemon:: - ds 1 +wUsedItemOnWhichPokemon:: db wAnimSoundID:: ; sound ID during battle animations @@ -1296,8 +1204,7 @@ wTextPredefFlag:: ; to the current map's bank ds 1 -wPredefParentBank:: - ds 1 +wPredefParentBank:: db wSpriteIndex:: ds 1 @@ -1311,20 +1218,17 @@ wNPCMovementScriptSpriteOffset:: ; sprite offset of sprite being controlled by NPC movement script ds 1 -wScriptedNPCWalkCounter:: - ds 1 +wScriptedNPCWalkCounter:: db ds 1 -wGBC:: - ds 1 +wGBC:: db wOnSGB:: ; if running on SGB, it's 1, else it's 0 ds 1 -wDefaultPaletteCommand:: - ds 1 +wDefaultPaletteCommand:: db wPlayerHPBarColor:: @@ -1332,8 +1236,7 @@ wWholeScreenPaletteMonSpecies:: ; species of the mon whose palette is used for the whole screen ds 1 -wEnemyHPBarColor:: - ds 1 +wEnemyHPBarColor:: db ; 0: green ; 1: yellow @@ -1341,8 +1244,7 @@ wEnemyHPBarColor:: wPartyMenuHPBarColors:: ds 6 -wStatusScreenHPBarColor:: - ds 1 +wStatusScreenHPBarColor:: db ds 7 @@ -1350,8 +1252,7 @@ wCopyingSGBTileData:: wWhichPartyMenuHPBar:: -wPalPacket:: - ds 1 +wPalPacket:: db wPartyMenuBlkPacket:: ; $30 bytes @@ -1365,8 +1266,7 @@ wcf4b:: ; storage buffer for various strings ds 2 -wGainBoostedExp:: - ds 1 +wGainBoostedExp:: db ds 17 @@ -1379,16 +1279,14 @@ wGymLeaderName:: wItemList:: ds 16 -wListPointer:: - ds 2 +wListPointer:: dw wUnusedCF8D:: ; 2 bytes ; used to store pointers, but never read ds 2 -wItemPrices:: - ds 2 +wItemPrices:: dw wcf91:: ds 1 ; used with a lot of things (too much to list here) @@ -1421,11 +1319,9 @@ wMoveMonType:: ; 3 = move from party to daycare ds 1 -wItemQuantity:: - ds 1 +wItemQuantity:: db -wMaxItemQuantity:: - ds 1 +wMaxItemQuantity:: db ; LoadMonData copies mon data here wLoadedMon:: party_struct wLoadedMon @@ -1457,11 +1353,9 @@ wAudioFadeOutControl:: ; audio, it zeroes this variable and starts playing the sound ID stored in it. ds 1 -wAudioFadeOutCounterReloadValue:: - ds 1 +wAudioFadeOutCounterReloadValue:: db -wAudioFadeOutCounter:: - ds 1 +wAudioFadeOutCounter:: db wLastMusicSoundID:: ; This is used to determine whether the default music is already playing when @@ -1482,36 +1376,22 @@ wUpdateSpritesEnabled:: ; other values aren't used ds 1 -wEnemyMoveNum:: - ds 1 -wEnemyMoveEffect:: - ds 1 -wEnemyMovePower:: - ds 1 -wEnemyMoveType:: - ds 1 -wEnemyMoveAccuracy:: - ds 1 -wEnemyMoveMaxPP:: - ds 1 -wPlayerMoveNum:: - ds 1 -wPlayerMoveEffect:: - ds 1 -wPlayerMovePower:: - ds 1 -wPlayerMoveType:: - ds 1 -wPlayerMoveAccuracy:: - ds 1 -wPlayerMoveMaxPP:: - ds 1 +wEnemyMoveNum:: db +wEnemyMoveEffect:: db +wEnemyMovePower:: db +wEnemyMoveType:: db +wEnemyMoveAccuracy:: db +wEnemyMoveMaxPP:: db +wPlayerMoveNum:: db +wPlayerMoveEffect:: db +wPlayerMovePower:: db +wPlayerMoveType:: db +wPlayerMoveAccuracy:: db +wPlayerMoveMaxPP:: db -wEnemyMonSpecies2:: - ds 1 -wBattleMonSpecies2:: - ds 1 +wEnemyMonSpecies2:: db +wBattleMonSpecies2:: db wEnemyMonNick:: ds NAME_LENGTH @@ -1525,13 +1405,11 @@ wBattleMonNick:: ds NAME_LENGTH wBattleMon:: battle_struct wBattleMon -wTrainerClass:: - ds 1 +wTrainerClass:: db ds 1 -wTrainerPicPointer:: - ds 2 +wTrainerPicPointer:: dw ds 1 wTempMoveNameBuffer:: @@ -1545,8 +1423,7 @@ wTrainerBaseMoney:: ; money received after battle = base money × level of highest-level enemy mon ds 2 -wMissableObjectCounter:: - ds 1 +wMissableObjectCounter:: db ds 1 @@ -1603,8 +1480,7 @@ wCriticalHitOrOHKO:: ; $ff = failed OHKO ds 1 -wMoveMissed:: - ds 1 +wMoveMissed:: db wPlayerStatsToDouble:: ; always 0 @@ -1650,22 +1526,17 @@ wEnemyStatsToHalve:: ; always 0 ds 1 -wEnemyBattleStatus1:: - ds 1 -wEnemyBattleStatus2:: - ds 1 -wEnemyBattleStatus3:: - ds 1 +wEnemyBattleStatus1:: db +wEnemyBattleStatus2:: db +wEnemyBattleStatus3:: db wPlayerNumAttacksLeft:: ; when the player is attacking multiple times, the number of attacks left ds 1 -wPlayerConfusedCounter:: - ds 1 +wPlayerConfusedCounter:: db -wPlayerToxicCounter:: - ds 1 +wPlayerToxicCounter:: db wPlayerDisabledMove:: ; high nibble: which move is disabled (1-4) @@ -1678,11 +1549,9 @@ wEnemyNumAttacksLeft:: ; when the enemy is attacking multiple times, the number of attacks left ds 1 -wEnemyConfusedCounter:: - ds 1 +wEnemyConfusedCounter:: db -wEnemyToxicCounter:: - ds 1 +wEnemyToxicCounter:: db wEnemyDisabledMove:: ; high nibble: which move is disabled (1-4) @@ -1709,11 +1578,9 @@ wEscapedFromBattle:: wAmountMoneyWon:: ; 3-byte BCD number -wObjectToHide:: - ds 1 +wObjectToHide:: db -wObjectToShow:: - ds 1 +wObjectToShow:: db ds 1 @@ -1742,10 +1609,8 @@ wSavedListScrollOffset:: ds 2 ; base coordinates of frame block -wBaseCoordX:: - ds 1 -wBaseCoordY:: - ds 1 +wBaseCoordX:: db +wBaseCoordY:: db ; low health alarm counter/enable ; high bit = enable, others = timer to cycle frequencies @@ -1755,8 +1620,7 @@ wFBTileCounter:: ; counts how many tiles of the current frame block have been drawn ds 1 -wMovingBGTilesCounter2:: - ds 1 +wMovingBGTilesCounter2:: db wSubAnimFrameDelay:: ; duration of each frame of the current subanimation in terms of screen refreshes @@ -1794,8 +1658,7 @@ wNewSlotMachineBallTile:: wCoordAdjustmentAmount:: ; how much to add to the X/Y coord -wUnusedD08A:: - ds 1 +wUnusedD08A:: db wSpiralBallsBaseX:: @@ -1814,16 +1677,13 @@ wSubAnimTransform:: ; 04: reverse the subanimation ds 1 -wEndBattleWinTextPointer:: - ds 2 +wEndBattleWinTextPointer:: dw -wEndBattleLoseTextPointer:: - ds 2 +wEndBattleLoseTextPointer:: dw ds 2 -wEndBattleTextRomBank:: - ds 1 +wEndBattleTextRomBank:: db ds 1 @@ -1843,8 +1703,7 @@ wSubAnimSubEntryAddr:: ds 2 -wOutwardSpiralTileMapPointer:: - ds 1 +wOutwardSpiralTileMapPointer:: db wPartyMenuAnimMonEnabled:: @@ -1852,8 +1711,7 @@ wTownMapSpriteBlinkingEnabled:: ; non-zero when enabled. causes nest locations to blink on and off. ; the town selection cursor will blink regardless of what this value is -wUnusedD09B:: - ds 1 +wUnusedD09B:: db wFBDestAddr:: ; current destination address in OAM for frame blocks (big endian) @@ -1892,14 +1750,10 @@ wSlideMonUpBottomRowLeftTile:: wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank -wSpriteCurPosX:: - ds 1 -wSpriteCurPosY:: - ds 1 -wSpriteWidth:: - ds 1 -wSpriteHeight:: - ds 1 +wSpriteCurPosX:: db +wSpriteCurPosY:: db +wSpriteWidth:: db +wSpriteHeight:: db wSpriteInputCurByte:: ; current input byte ds 1 @@ -1918,10 +1772,8 @@ wSpriteLoadFlags:: ; bit 0 determines used buffer (0 -> sSpriteBuffer1, 1 -> sSpriteBuffer2) ; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation) ds 1 -wSpriteUnpackMode:: - ds 1 -wSpriteFlipped:: - ds 1 +wSpriteUnpackMode:: db +wSpriteFlipped:: db wSpriteInputPtr:: ; pointer to next input byte @@ -1941,11 +1793,9 @@ wSpriteDecodeTable1Ptr:: wd0b5:: ds 1 ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things -wNameListType:: - ds 1 +wNameListType:: db -wPredefBank:: - ds 1 +wPredefBank:: db wMonHeader:: @@ -1955,39 +1805,26 @@ wMonHIndex:: ds 1 wMonHBaseStats:: -wMonHBaseHP:: - ds 1 -wMonHBaseAttack:: - ds 1 -wMonHBaseDefense:: - ds 1 -wMonHBaseSpeed:: - ds 1 -wMonHBaseSpecial:: - ds 1 +wMonHBaseHP:: db +wMonHBaseAttack:: db +wMonHBaseDefense:: db +wMonHBaseSpeed:: db +wMonHBaseSpecial:: db wMonHTypes:: -wMonHType1:: - ds 1 -wMonHType2:: - ds 1 +wMonHType1:: db +wMonHType2:: db -wMonHCatchRate:: - ds 1 -wMonHBaseEXP:: - ds 1 -wMonHSpriteDim:: - ds 1 -wMonHFrontSprite:: - ds 2 -wMonHBackSprite:: - ds 2 +wMonHCatchRate:: db +wMonHBaseEXP:: db +wMonHSpriteDim:: db +wMonHFrontSprite:: dw +wMonHBackSprite:: dw wMonHMoves:: ds NUM_MOVES -wMonHGrowthRate:: - ds 1 +wMonHGrowthRate:: db wMonHLearnset:: ; bit field @@ -2002,26 +1839,22 @@ wSavedTileAnimations:: ds 2 -wDamage:: - ds 2 +wDamage:: dw ds 2 -wRepelRemainingSteps:: - ds 1 +wRepelRemainingSteps:: db wMoves:: ; list of moves for FormatMovesString ds NUM_MOVES -wMoveNum:: - ds 1 +wMoveNum:: db wMovesString:: ds 56 -wUnusedD119:: - ds 1 +wUnusedD119:: db wWalkBikeSurfStateCopy:: ; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything @@ -2073,24 +1906,19 @@ wNumRunAttempts:: ; number of times the player has tried to run from battle ds 1 -wEvolutionOccurred:: - ds 1 +wEvolutionOccurred:: db -wVBlankSavedROMBank:: - ds 1 +wVBlankSavedROMBank:: db ds 1 -wIsKeyItem:: - ds 1 +wIsKeyItem:: db -wTextBoxID:: - ds 1 +wTextBoxID:: db wCurrentMapScriptFlags:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value -wCurEnemyLVL:: - ds 1 +wCurEnemyLVL:: db wItemListPointer:: ; pointer to list of items terminated by $FF @@ -2100,11 +1928,9 @@ wListCount:: ; number of entries in a list ds 1 -wLinkState:: - ds 1 +wLinkState:: db -wTwoOptionMenuID:: - ds 1 +wTwoOptionMenuID:: db wChosenMenuItem:: ; the id of the menu item the player ultimately chose @@ -2137,22 +1963,17 @@ wGymGateTileBlock:: ; a horizontal or vertical gate block ds 1 -wSavedSpriteScreenY:: - ds 1 +wSavedSpriteScreenY:: db -wSavedSpriteScreenX:: - ds 1 +wSavedSpriteScreenX:: db -wSavedSpriteMapY:: - ds 1 +wSavedSpriteMapY:: db -wSavedSpriteMapX:: - ds 1 +wSavedSpriteMapX:: db ds 5 -wWhichPrize:: - ds 1 +wWhichPrize:: db wIgnoreInputCounter:: ; counts downward each frame @@ -2167,26 +1988,20 @@ wNumberOfNoRandomBattleStepsLeft:: ; after a battle, you have at least 3 steps before a random battle can occur ds 1 -wPrize1:: - ds 1 -wPrize2:: - ds 1 -wPrize3:: - ds 1 +wPrize1:: db +wPrize2:: db +wPrize3:: db ds 1 wSerialRandomNumberListBlock:: ; the first 7 bytes are the preamble -wPrize1Price:: - ds 2 +wPrize1Price:: dw -wPrize2Price:: - ds 2 +wPrize2Price:: dw -wPrize3Price:: - ds 2 +wPrize3Price:: dw ds 1 @@ -2204,16 +2019,13 @@ wPseudoItemID:: ; that case, this would be ESCAPE_ROPE. ds 1 -wUnusedD153:: - ds 1 +wUnusedD153:: db ds 2 -wEvoStoneItemID:: - ds 1 +wEvoStoneItemID:: db -wSavedNPCMovementDirections2Index:: - ds 1 +wSavedNPCMovementDirections2Index:: db wPlayerName:: ds NAME_LENGTH @@ -2226,21 +2038,21 @@ wPartySpecies:: ds PARTY_LENGTH + 1 wPartyMons:: ; wPartyMon1 - wPartyMon6 -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}:: party_struct wPartyMon{d:n} -endr +ENDR wPartyMonOT:: ; wPartyMon1OT - wPartyMon6OT -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}OT:: ds NAME_LENGTH -endr +ENDR wPartyMonNicks:: ; wPartyMon1Nick - wPartyMon6Nick -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wPartyMon{d:n}Nick:: ds NAME_LENGTH -endr +ENDR wPartyMonNicksEnd:: wPartyDataEnd:: @@ -2257,8 +2069,7 @@ wPokedexSeen:: wPokedexSeenEnd:: -wNumBagItems:: - ds 1 +wNumBagItems:: db wBagItems:: ; item, quantity ds BAG_ITEM_CAPACITY * 2 @@ -2295,22 +2106,18 @@ wLetterPrintingDelayFlags:: ; bit 1: If 0, no delay. ds 1 -wPlayerID:: - ds 2 +wPlayerID:: dw -wMapMusicSoundID:: - ds 1 +wMapMusicSoundID:: db -wMapMusicROMBank:: - ds 1 +wMapMusicROMBank:: db wMapPalOffset:: ; offset subtracted from FadePal4 to get the background and object palettes for the current map ; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4 ds 1 -wCurMap:: - ds 1 +wCurMap:: db wCurrentTileBlockMapViewPointer:: ; pointer to the upper left corner of the current view in the tile block map @@ -2320,24 +2127,19 @@ wYCoord:: ; player's position on the current map ds 1 -wXCoord:: - ds 1 +wXCoord:: db wYBlockCoord:: ; player's y position (by block) ds 1 -wXBlockCoord:: - ds 1 +wXBlockCoord:: db -wLastMap:: - ds 1 +wLastMap:: db -wUnusedD366:: - ds 1 +wUnusedD366:: db -wCurMapTileset:: - ds 1 +wCurMapTileset:: db wCurMapHeight:: ; blocks @@ -2347,114 +2149,79 @@ wCurMapWidth:: ; blocks ds 1 -wMapDataPtr:: - ds 2 +wMapDataPtr:: dw -wMapTextPtr:: - ds 2 +wMapTextPtr:: dw -wMapScriptPtr:: - ds 2 +wMapScriptPtr:: dw wMapConnections:: ; connection byte ds 1 -wMapConn1Ptr:: - ds 1 +wMapConn1Ptr:: db -wNorthConnectionStripSrc:: - ds 2 +wNorthConnectionStripSrc:: dw -wNorthConnectionStripDest:: - ds 2 +wNorthConnectionStripDest:: dw -wNorthConnectionStripWidth:: - ds 1 +wNorthConnectionStripWidth:: db -wNorthConnectedMapWidth:: - ds 1 +wNorthConnectedMapWidth:: db -wNorthConnectedMapYAlignment:: - ds 1 +wNorthConnectedMapYAlignment:: db -wNorthConnectedMapXAlignment:: - ds 1 +wNorthConnectedMapXAlignment:: db -wNorthConnectedMapViewPointer:: - ds 2 +wNorthConnectedMapViewPointer:: dw -wMapConn2Ptr:: - ds 1 +wMapConn2Ptr:: db -wSouthConnectionStripSrc:: - ds 2 +wSouthConnectionStripSrc:: dw -wSouthConnectionStripDest:: - ds 2 +wSouthConnectionStripDest:: dw -wSouthConnectionStripWidth:: - ds 1 +wSouthConnectionStripWidth:: db -wSouthConnectedMapWidth:: - ds 1 +wSouthConnectedMapWidth:: db -wSouthConnectedMapYAlignment:: - ds 1 +wSouthConnectedMapYAlignment:: db -wSouthConnectedMapXAlignment:: - ds 1 +wSouthConnectedMapXAlignment:: db -wSouthConnectedMapViewPointer:: - ds 2 +wSouthConnectedMapViewPointer:: dw -wMapConn3Ptr:: - ds 1 +wMapConn3Ptr:: db -wWestConnectionStripSrc:: - ds 2 +wWestConnectionStripSrc:: dw -wWestConnectionStripDest:: - ds 2 +wWestConnectionStripDest:: dw -wWestConnectionStripHeight:: - ds 1 +wWestConnectionStripHeight:: db -wWestConnectedMapWidth:: - ds 1 +wWestConnectedMapWidth:: db -wWestConnectedMapYAlignment:: - ds 1 +wWestConnectedMapYAlignment:: db -wWestConnectedMapXAlignment:: - ds 1 +wWestConnectedMapXAlignment:: db -wWestConnectedMapViewPointer:: - ds 2 +wWestConnectedMapViewPointer:: dw -wMapConn4Ptr:: - ds 1 +wMapConn4Ptr:: db -wEastConnectionStripSrc:: - ds 2 +wEastConnectionStripSrc:: dw -wEastConnectionStripDest:: - ds 2 +wEastConnectionStripDest:: dw -wEastConnectionStripHeight:: - ds 1 +wEastConnectionStripHeight:: db -wEastConnectedMapWidth:: - ds 1 +wEastConnectedMapWidth:: db -wEastConnectedMapYAlignment:: - ds 1 +wEastConnectedMapYAlignment:: db -wEastConnectedMapXAlignment:: - ds 1 +wEastConnectedMapXAlignment:: db -wEastConnectedMapViewPointer:: - ds 2 +wEastConnectedMapViewPointer:: dw wSpriteSet:: ; sprite set for the current map (11 sprite picture ID's) @@ -2464,8 +2231,7 @@ wSpriteSetID:: ; sprite set ID for the current map ds 1 -wObjectDataPointerTemp:: - ds 2 +wObjectDataPointerTemp:: dw ds 2 @@ -2505,10 +2271,8 @@ wNumSprites:: ; these two variables track the X and Y offset in blocks from the last special warp used ; they don't seem to be used for anything -wYOffsetSinceLastSpecialWarp:: - ds 1 -wXOffsetSinceLastSpecialWarp:: - ds 1 +wYOffsetSinceLastSpecialWarp:: db +wXOffsetSinceLastSpecialWarp:: db wMapSpriteData:: ; two bytes per sprite (movement byte 2, text ID) @@ -2548,15 +2312,13 @@ wPlayerDirection:: ; if the player is not moving, the last the direction in which the player moved ds 1 -wTilesetBank:: - ds 1 +wTilesetBank:: db wTilesetBlocksPtr:: ; maps blocks (4x4 tiles) to tiles ds 2 -wTilesetGfxPtr:: - ds 2 +wTilesetGfxPtr:: dw wTilesetCollisionPtr:: ; list of all walkable tiles @@ -2565,13 +2327,11 @@ wTilesetCollisionPtr:: wTilesetTalkingOverTiles:: ds 3 -wGrassTile:: - ds 1 +wGrassTile:: db ds 4 -wNumBoxItems:: - ds 1 +wNumBoxItems:: db wBoxItems:: ; item, quantity ds PC_ITEM_CAPACITY * 2 @@ -2586,8 +2346,7 @@ wNumHoFTeams:: ; number of HOF teams ds 1 -wUnusedD5A3:: - ds 1 +wUnusedD5A3:: db wPlayerCoins:: ds 2 ; BCD @@ -2610,215 +2369,119 @@ wMissableObjectList:: wGameProgressFlags:: ; $c8 bytes -wOaksLabCurScript:: - ds 1 -wPalletTownCurScript:: - ds 1 - ds 1 -wBluesHouseCurScript:: - ds 1 -wViridianCityCurScript:: - ds 1 - ds 2 -wPewterCityCurScript:: - ds 1 -wRoute3CurScript:: - ds 1 -wRoute4CurScript:: - ds 1 - ds 1 -wViridianGymCurScript:: - ds 1 -wPewterGymCurScript:: - ds 1 -wCeruleanGymCurScript:: - ds 1 -wVermilionGymCurScript:: - ds 1 -wCeladonGymCurScript:: - ds 1 -wRoute6CurScript:: - ds 1 -wRoute8CurScript:: - ds 1 -wRoute24CurScript:: - ds 1 -wRoute25CurScript:: - ds 1 -wRoute9CurScript:: - ds 1 -wRoute10CurScript:: - ds 1 -wMtMoon1FCurScript:: - ds 1 -wMtMoonB2FCurScript:: - ds 1 -wSSAnne1FRoomsCurScript:: - ds 1 -wSSAnne2FRoomsCurScript:: - ds 1 -wRoute22CurScript:: - ds 1 - ds 1 -wRedsHouse2FCurScript:: - ds 1 -wViridianMartCurScript:: - ds 1 -wRoute22GateCurScript:: - ds 1 -wCeruleanCityCurScript:: - ds 1 +wOaksLabCurScript:: db +wPalletTownCurScript:: db + ds 1 +wBluesHouseCurScript:: db +wViridianCityCurScript:: db + ds 2 +wPewterCityCurScript:: db +wRoute3CurScript:: db +wRoute4CurScript:: db + ds 1 +wViridianGymCurScript:: db +wPewterGymCurScript:: db +wCeruleanGymCurScript:: db +wVermilionGymCurScript:: db +wCeladonGymCurScript:: db +wRoute6CurScript:: db +wRoute8CurScript:: db +wRoute24CurScript:: db +wRoute25CurScript:: db +wRoute9CurScript:: db +wRoute10CurScript:: db +wMtMoon1FCurScript:: db +wMtMoonB2FCurScript:: db +wSSAnne1FRoomsCurScript:: db +wSSAnne2FRoomsCurScript:: db +wRoute22CurScript:: db + ds 1 +wRedsHouse2FCurScript:: db +wViridianMartCurScript:: db +wRoute22GateCurScript:: db +wCeruleanCityCurScript:: db ds 7 -wSSAnneBowCurScript:: - ds 1 -wViridianForestCurScript:: - ds 1 -wMuseum1FCurScript:: - ds 1 -wRoute13CurScript:: - ds 1 -wRoute14CurScript:: - ds 1 -wRoute17CurScript:: - ds 1 -wRoute19CurScript:: - ds 1 -wRoute21CurScript:: - ds 1 -wSafariZoneGateCurScript:: - ds 1 -wRockTunnelB1FCurScript:: - ds 1 -wRockTunnel1FCurScript:: - ds 1 - ds 1 -wRoute11CurScript:: - ds 1 -wRoute12CurScript:: - ds 1 -wRoute15CurScript:: - ds 1 -wRoute16CurScript:: - ds 1 -wRoute18CurScript:: - ds 1 -wRoute20CurScript:: - ds 1 -wSSAnneB1FRoomsCurScript:: - ds 1 -wVermilionCityCurScript:: - ds 1 -wPokemonTower2FCurScript:: - ds 1 -wPokemonTower3FCurScript:: - ds 1 -wPokemonTower4FCurScript:: - ds 1 -wPokemonTower5FCurScript:: - ds 1 -wPokemonTower6FCurScript:: - ds 1 -wPokemonTower7FCurScript:: - ds 1 -wRocketHideoutB1FCurScript:: - ds 1 -wRocketHideoutB2FCurScript:: - ds 1 -wRocketHideoutB3FCurScript:: - ds 1 -wRocketHideoutB4FCurScript:: - ds 2 -wRoute6GateCurScript:: - ds 1 -wRoute8GateCurScript:: - ds 2 -wCinnabarIslandCurScript:: - ds 1 -wPokemonMansion1FCurScript:: - ds 2 -wPokemonMansion2FCurScript:: - ds 1 -wPokemonMansion3FCurScript:: - ds 1 -wPokemonMansionB1FCurScript:: - ds 1 -wVictoryRoad2FCurScript:: - ds 1 -wVictoryRoad3FCurScript:: - ds 1 - ds 1 -wFightingDojoCurScript:: - ds 1 -wSilphCo2FCurScript:: - ds 1 -wSilphCo3FCurScript:: - ds 1 -wSilphCo4FCurScript:: - ds 1 -wSilphCo5FCurScript:: - ds 1 -wSilphCo6FCurScript:: - ds 1 -wSilphCo7FCurScript:: - ds 1 -wSilphCo8FCurScript:: - ds 1 -wSilphCo9FCurScript:: - ds 1 -wHallOfFameCurScript:: - ds 1 -wChampionsRoomCurScript:: - ds 1 -wLoreleisRoomCurScript:: - ds 1 -wBrunosRoomCurScript:: - ds 1 -wAgathasRoomCurScript:: - ds 1 -wCeruleanCaveB1FCurScript:: - ds 1 -wVictoryRoad1FCurScript:: - ds 1 - ds 1 -wLancesRoomCurScript:: - ds 1 +wSSAnneBowCurScript:: db +wViridianForestCurScript:: db +wMuseum1FCurScript:: db +wRoute13CurScript:: db +wRoute14CurScript:: db +wRoute17CurScript:: db +wRoute19CurScript:: db +wRoute21CurScript:: db +wSafariZoneGateCurScript:: db +wRockTunnelB1FCurScript:: db +wRockTunnel1FCurScript:: db + ds 1 +wRoute11CurScript:: db +wRoute12CurScript:: db +wRoute15CurScript:: db +wRoute16CurScript:: db +wRoute18CurScript:: db +wRoute20CurScript:: db +wSSAnneB1FRoomsCurScript:: db +wVermilionCityCurScript:: db +wPokemonTower2FCurScript:: db +wPokemonTower3FCurScript:: db +wPokemonTower4FCurScript:: db +wPokemonTower5FCurScript:: db +wPokemonTower6FCurScript:: db +wPokemonTower7FCurScript:: db +wRocketHideoutB1FCurScript:: db +wRocketHideoutB2FCurScript:: db +wRocketHideoutB3FCurScript:: db +wRocketHideoutB4FCurScript:: db + ds 1 +wRoute6GateCurScript:: db +wRoute8GateCurScript:: db + ds 1 +wCinnabarIslandCurScript:: db +wPokemonMansion1FCurScript:: db + ds 1 +wPokemonMansion2FCurScript:: db +wPokemonMansion3FCurScript:: db +wPokemonMansionB1FCurScript:: db +wVictoryRoad2FCurScript:: db +wVictoryRoad3FCurScript:: db + ds 1 +wFightingDojoCurScript:: db +wSilphCo2FCurScript:: db +wSilphCo3FCurScript:: db +wSilphCo4FCurScript:: db +wSilphCo5FCurScript:: db +wSilphCo6FCurScript:: db +wSilphCo7FCurScript:: db +wSilphCo8FCurScript:: db +wSilphCo9FCurScript:: db +wHallOfFameCurScript:: db +wChampionsRoomCurScript:: db +wLoreleisRoomCurScript:: db +wBrunosRoomCurScript:: db +wAgathasRoomCurScript:: db +wCeruleanCaveB1FCurScript:: db +wVictoryRoad1FCurScript:: db + ds 1 +wLancesRoomCurScript:: db ds 4 -wSilphCo10FCurScript:: - ds 1 -wSilphCo11FCurScript:: - ds 1 - ds 1 -wFuchsiaGymCurScript:: - ds 1 -wSaffronGymCurScript:: - ds 1 - ds 1 -wCinnabarGymCurScript:: - ds 1 -wGameCornerCurScript:: - ds 1 -wRoute16Gate1FCurScript:: - ds 1 -wBillsHouseCurScript:: - ds 1 -wRoute5GateCurScript:: - ds 1 -wPowerPlantCurScript:: -wRoute7GateCurScript:: -; overload - ds 1 - ds 1 -wSSAnne2FCurScript:: - ds 1 -wSeafoamIslandsB3FCurScript:: - ds 1 -wRoute23CurScript:: - ds 1 -wSeafoamIslandsB4FCurScript:: - ds 1 -wRoute18Gate1FCurScript:: - ds 1 - +wSilphCo10FCurScript:: db +wSilphCo11FCurScript:: db + ds 1 +wFuchsiaGymCurScript:: db +wSaffronGymCurScript:: db + ds 1 +wCinnabarGymCurScript:: db +wGameCornerCurScript:: db +wRoute16Gate1FCurScript:: db +wBillsHouseCurScript:: db +wRoute5GateCurScript:: db +wPowerPlantCurScript:: ; overload +wRoute7GateCurScript:: db + ds 1 +wSSAnne2FCurScript:: db +wSeafoamIslandsB3FCurScript:: db +wRoute23CurScript:: db +wSeafoamIslandsB4FCurScript:: db +wRoute18Gate1FCurScript:: db ds 78 wGameProgressFlagsEnd:: @@ -2827,8 +2490,7 @@ wGameProgressFlagsEnd:: wObtainedHiddenItemsFlags:: ds 14 -wObtainedHiddenCoinsFlags:: - ds 2 +wObtainedHiddenCoinsFlags:: dw wWalkBikeSurfState:: ; $00 = walking @@ -2859,34 +2521,29 @@ wEnemyMonOrTrainerClass:: ; trainer classes start at OPP_ID_OFFSET ds 1 -wPlayerJumpingYScreenCoordsIndex:: - ds 1 +wPlayerJumpingYScreenCoordsIndex:: db -wRivalStarter:: - ds 1 +wRivalStarter:: db ds 1 -wPlayerStarter:: - ds 1 +wPlayerStarter:: db wBoulderSpriteIndex:: ; sprite index of the boulder the player is trying to push ds 1 -wLastBlackoutMap:: - ds 1 +wLastBlackoutMap:: db wDestinationMap:: ; destination map (for certain types of special warps, not ordinary walking) ds 1 -wUnusedD71B:: - ds 1 +wUnusedD71B:: db wTileInFrontOfBoulderAndBoulderCollisionResult:: ; used to store the tile in front of the boulder when trying to push a boulder -; also used to store the result of the collision check ($ff for a collision and $00 for no collision) +; also used to store the result of the collision check ($ff for a collision and $00 FOR no collision) ds 1 wDungeonWarpDestinationMap:: @@ -2897,8 +2554,7 @@ wWhichDungeonWarp:: ; which dungeon warp within the source map was used ds 1 -wUnusedD71F:: - ds 1 +wUnusedD71F:: db ds 8 @@ -2986,7 +2642,7 @@ wFlags_D733:: ; bit 1: prevent music from changing when entering new map ; bit 2: skip the joypad check in CheckWarpsNoCollision (used for the forced warp down the waterfall in the Seafoam Islands) ; bit 3: trainer wants to battle -; bit 4: use variable [wCurMapScript] instead of the provided index for next frame's map script (used to start battle when talking to trainers) +; bit 4: use variable [wCurMapScript] instead of the provided index FOR next frame's map script (used to start battle when talking to trainers) ; bit 7: used fly out of battle ds 1 @@ -3005,32 +2661,25 @@ wd736:: ; bit 7: player sprite spinning due to spin tiles (Rocket hideout / Viridian Gym) ds 1 -wCompletedInGameTradeFlags:: - ds 2 +wCompletedInGameTradeFlags:: dw ds 2 -wWarpedFromWhichWarp:: - ds 1 +wWarpedFromWhichWarp:: db -wWarpedFromWhichMap:: - ds 1 +wWarpedFromWhichMap:: db ds 2 -wCardKeyDoorY:: - ds 1 +wCardKeyDoorY:: db -wCardKeyDoorX:: - ds 1 +wCardKeyDoorX:: db ds 2 -wFirstLockTrashCanIndex:: - ds 1 +wFirstLockTrashCanIndex:: db -wSecondLockTrashCanIndex:: - ds 1 +wSecondLockTrashCanIndex:: db ds 2 @@ -3066,27 +2715,26 @@ wEnemyPartySpecies:: ds PARTY_LENGTH + 1 wEnemyMons:: ; wEnemyMon1 - wEnemyMon6 -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wEnemyMon{d:n}:: party_struct wEnemyMon{d:n} -endr +ENDR wEnemyMonOT:: ; wEnemyMon1OT - wEnemyMon6OT -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wEnemyMon{d:n}OT:: ds NAME_LENGTH -endr +ENDR wEnemyMonNicks:: ; wEnemyMon1Nick - wEnemyMon6Nick -for n, 1, PARTY_LENGTH + 1 +FOR n, 1, PARTY_LENGTH + 1 wEnemyMon{d:n}Nick:: ds NAME_LENGTH -endr +ENDR ENDU -wTrainerHeaderPtr:: - ds 2 +wTrainerHeaderPtr:: dw ds 6 @@ -3094,8 +2742,7 @@ wOpponentAfterWrongAnswer:: ; the trainer the player must face after getting a wrong answer in the Cinnabar ; gym quiz -wUnusedDA38:: - ds 1 +wUnusedDA38:: db wCurMapScript:: ; index of current map script, mostly used as index for function pointer array @@ -3104,22 +2751,15 @@ wCurMapScript:: ds 7 -wPlayTimeHours:: - ds 1 -wPlayTimeMaxed:: - ds 1 -wPlayTimeMinutes:: - ds 1 -wPlayTimeSeconds:: - ds 1 -wPlayTimeFrames:: - ds 1 +wPlayTimeHours:: db +wPlayTimeMaxed:: db +wPlayTimeMinutes:: db +wPlayTimeSeconds:: db +wPlayTimeFrames:: db -wSafariZoneGameOver:: - ds 1 +wSafariZoneGameOver:: db -wNumSafariBalls:: - ds 1 +wNumSafariBalls:: db wDayCareInUse:: @@ -3143,21 +2783,21 @@ wBoxSpecies:: ds MONS_PER_BOX + 1 wBoxMons:: ; wBoxMon1 - wBoxMon20 -for n, 1, MONS_PER_BOX + 1 +FOR n, 1, MONS_PER_BOX + 1 wBoxMon{d:n}:: box_struct wBoxMon{d:n} -endr +ENDR wBoxMonOT:: ; wBoxMon1OT - wBoxMon20OT -for n, 1, MONS_PER_BOX + 1 +FOR n, 1, MONS_PER_BOX + 1 wBoxMon{d:n}OT:: ds NAME_LENGTH -endr +ENDR wBoxMonNicks:: ; wBoxMon1Nick - wBoxMon20Nick -for n, 1, MONS_PER_BOX + 1 +FOR n, 1, MONS_PER_BOX + 1 wBoxMon{d:n}Nick:: ds NAME_LENGTH -endr +ENDR wBoxMonNicksEnd:: wBoxDataEnd:: @@ -3165,7 +2805,10 @@ wBoxDataEnd:: SECTION "Stack", WRAM0 +; the stack grows downward + ds $100 - 1 wStack:: + ds 1 INCLUDE "sram.asm" |