From cd1065b7a92fead9513a28ada44c170fcb74ea9c Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Wed, 25 Dec 2024 21:24:21 -0500 Subject: [PATCH 01/10] Use RGBDS 0.9.0 (#482) --- .github/workflows/main.yml | 2 +- INSTALL.md | 20 ++++++++++---------- Makefile | 12 ++++++------ engine/battle/animations.asm | 3 +-- rgbdscheck.asm | 6 +++--- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5142216..55ec218d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@master with: path: rgbds - ref: v0.8.0 + ref: v0.9.0 repository: gbdev/rgbds - name: Install rgbds diff --git a/INSTALL.md b/INSTALL.md index 101ea8e2..372337d0 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -42,9 +42,9 @@ Run setup and leave the default settings. At the "**Select Packages**" step, cho Double click on the text that says "**Skip**" next to each package to select the most recent version to install. -Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.7.0**. +Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.9.0**. -**Note:** If you already have an installed rgbds older than 0.7.0, you will need to update to 0.7.0. Ignore this if you have never installed rgbds before. If a version newer than 0.7.0 does not work, try downloading 0.7.0. +**Note:** If you already have an installed rgbds older than 0.9.0, you will need to update to 0.9.0. Ignore this if you have never installed rgbds before. If a version newer than 0.9.0 does not work, try downloading 0.9.0. Now open the **Cygwin terminal** and enter the following commands. @@ -67,7 +67,7 @@ Install [**Homebrew**](https://brew.sh/). Follow the official instructions. Open **Terminal** and prepare to enter commands. -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.7.0**. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.9.0**. Now you're ready to [build **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#building-from-source) to build **rgbds 0.7.0** from source. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source. ### OpenSUSE @@ -94,7 +94,7 @@ To install the software required for **pokered**: sudo zypper install make gcc git ``` -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source. ### Arch Linux @@ -104,7 +104,7 @@ To install the software required for **pokered**: sudo pacman -S make gcc git rgbds ``` -If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source. +If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source. ### Termux @@ -120,7 +120,7 @@ To install **rgbds**: 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.7.0** from source. +If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source. ### Other distros @@ -131,7 +131,7 @@ If your distro is not listed here, try to find the required software in its repo - `git` - `rgbds` -If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source. +If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.9.0** from source. Now you're ready to [build **pokered**](#build-pokered). @@ -153,8 +153,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.7.0 globally. Instead, you can put its files in a directory within pokered, such as `pokered/rgbds-0.7.0/`. Then specify it when you run `make`: +If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.9.0 globally. Instead, you can put its files in a directory within pokered, such as `pokered/rgbds-0.9.0/`. Then specify it when you run `make`: ```bash -make RGBDS=rgbds-0.7.0/ +make RGBDS=rgbds-0.9.0/ ``` diff --git a/Makefile b/Makefile index 30cfd4f8..e53fce45 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ tools: $(MAKE) -C tools/ -RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1 +RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wtruncation=1 # Create a sym/map for debug purposes if `make` run with `DEBUG=1` ifeq ($(DEBUG),1) RGBASMFLAGS += -E @@ -141,11 +141,11 @@ pokered_vc_pad = 0x00 pokeblue_vc_pad = 0x00 pokeblue_debug_pad = 0xff -pokered_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON RED" -pokeblue_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON BLUE" -pokeblue_debug_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON BLUE" -pokered_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON RED" -pokeblue_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON BLUE" +pokered_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON RED" +pokeblue_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON BLUE" +pokeblue_debug_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON BLUE" +pokered_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON RED" +pokeblue_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC3+RAM+BATTERY -r 03 -t "POKEMON BLUE" %.gbc: $$(%_obj) layout.link $(RGBLINK) -p $($*_pad) -d -m $*.map -n $*.sym -l layout.link -o $@ $(filter %.o,$^) diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index c0835680..83f30ee2 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -1743,8 +1743,7 @@ AnimationMinimizeMon: MinimizedMonSprite: ; 8x5 partial tile graphic -pusho -opt b.X ; . = 0, X = 1 +pusho b.X ; . = 0, X = 1 db %...XX... db %..XXXX.. db %.XXXXXX. diff --git a/rgbdscheck.asm b/rgbdscheck.asm index 55fea288..7cc7b0d0 100644 --- a/rgbdscheck.asm +++ b/rgbdscheck.asm @@ -1,6 +1,6 @@ IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__) - fail "pokered requires rgbds v0.7.0 or newer." + fail "pokered requires rgbds v0.9.0 or newer." ENDC -IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 7 - fail "pokered requires rgbds v0.7.0 or newer." +IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 9 + fail "pokered requires rgbds v0.9.0 or newer." ENDC From cd647df3b551cea154317a572ace9052727aa72b Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:52:24 -0500 Subject: [PATCH 02/10] Don't pass redundant label names to `table_width` and `list_start` (#484) --- data/battle/stat_mod_names.asm | 2 +- data/battle/stat_names.asm | 2 +- data/battle_anims/base_coords.asm | 2 +- data/battle_anims/frame_blocks.asm | 2 +- data/battle_anims/subanimations.asm | 2 +- data/credits/credits_text.asm | 2 +- data/events/hidden_coins.asm | 2 +- data/events/hidden_item_coords.asm | 2 +- data/events/trades.asm | 2 +- data/growth_rates.asm | 2 +- data/items/names.asm | 2 +- data/items/prices.asm | 2 +- data/maps/hide_show_data.asm | 4 ++-- data/maps/map_header_banks.asm | 2 +- data/maps/map_header_pointers.asm | 2 +- data/maps/songs.asm | 2 +- data/maps/sprite_sets.asm | 6 ++--- data/maps/town_map_entries.asm | 2 +- data/moves/animations.asm | 2 +- data/moves/effects_pointers.asm | 2 +- data/moves/moves.asm | 2 +- data/moves/names.asm | 2 +- data/moves/sfx.asm | 2 +- data/moves/tmhm_moves.asm | 2 +- data/pokemon/base_stats.asm | 2 +- data/pokemon/cries.asm | 2 +- data/pokemon/dex_entries.asm | 2 +- data/pokemon/dex_order.asm | 2 +- data/pokemon/evos_moves.asm | 2 +- data/pokemon/names.asm | 2 +- data/pokemon/palettes.asm | 2 +- data/sgb/sgb_palettes.asm | 2 +- data/sprites/sprites.asm | 2 +- data/tilemaps.asm | 2 +- data/tilesets/tileset_headers.asm | 2 +- data/tilesets/warp_tile_ids.asm | 2 +- data/trainers/ai_pointers.asm | 2 +- data/trainers/move_choices.asm | 2 +- data/trainers/name_pointers.asm | 2 +- data/trainers/names.asm | 2 +- data/trainers/parties.asm | 2 +- data/trainers/pic_pointers_money.asm | 2 +- data/types/names.asm | 2 +- data/wild/grass_water.asm | 2 +- data/yes_no_menu_strings.asm | 2 +- engine/battle/battle_transitions.asm | 2 +- macros/asserts.asm | 35 ++++++++++++++++++---------- scripts/CeruleanBadgeHouse.asm | 4 ++-- 48 files changed, 74 insertions(+), 63 deletions(-) diff --git a/data/battle/stat_mod_names.asm b/data/battle/stat_mod_names.asm index 287e87e3..63c956d7 100644 --- a/data/battle/stat_mod_names.asm +++ b/data/battle/stat_mod_names.asm @@ -2,7 +2,7 @@ ; The relevant move effect IDs correspond to the stats StatModTextStrings: - list_start StatModTextStrings + list_start li "ATTACK" li "DEFENSE" li "SPEED" diff --git a/data/battle/stat_names.asm b/data/battle/stat_names.asm index 413ab991..30401a99 100644 --- a/data/battle/stat_names.asm +++ b/data/battle/stat_names.asm @@ -1,7 +1,7 @@ ; Stats that vitamins can raise or lower VitaminStats: - list_start VitaminStats + list_start li "HEALTH" li "ATTACK" li "DEFENSE" diff --git a/data/battle_anims/base_coords.asm b/data/battle_anims/base_coords.asm index 109a06e8..72efb04a 100644 --- a/data/battle_anims/base_coords.asm +++ b/data/battle_anims/base_coords.asm @@ -1,5 +1,5 @@ FrameBlockBaseCoords: - table_width 2, FrameBlockBaseCoords + table_width 2 db $10, $68 ; BASECOORD_00 db $10, $70 ; BASECOORD_01 db $10, $78 ; BASECOORD_02 diff --git a/data/battle_anims/frame_blocks.asm b/data/battle_anims/frame_blocks.asm index 549c1c3c..0e0de32f 100644 --- a/data/battle_anims/frame_blocks.asm +++ b/data/battle_anims/frame_blocks.asm @@ -1,5 +1,5 @@ FrameBlockPointers: - table_width 2, FrameBlockPointers + table_width 2 dw FrameBlock00 dw FrameBlock01 dw FrameBlock02 diff --git a/data/battle_anims/subanimations.asm b/data/battle_anims/subanimations.asm index 74097e22..33a4a2f2 100644 --- a/data/battle_anims/subanimations.asm +++ b/data/battle_anims/subanimations.asm @@ -1,5 +1,5 @@ SubanimationPointers: - table_width 2, SubanimationPointers + table_width 2 dw Subanim_0Star dw Subanim_0StarTwice dw Subanim_0StarThrice diff --git a/data/credits/credits_text.asm b/data/credits/credits_text.asm index 37ba04bd..58c8e55e 100644 --- a/data/credits/credits_text.asm +++ b/data/credits/credits_text.asm @@ -1,6 +1,6 @@ CreditsTextPointers: ; entries correspond to CRED_* constants - table_width 2, CreditsTextPointers + table_width 2 dw CredVersion dw CredTajiri dw CredTaOota diff --git a/data/events/hidden_coins.asm b/data/events/hidden_coins.asm index 1fa5af23..b3244da2 100644 --- a/data/events/hidden_coins.asm +++ b/data/events/hidden_coins.asm @@ -3,7 +3,7 @@ MACRO hidden_coin ENDM HiddenCoinCoords: - table_width 3, HiddenCoinCoords + table_width 3 ; map id, x, y hidden_coin GAME_CORNER, 0, 8 hidden_coin GAME_CORNER, 1, 16 diff --git a/data/events/hidden_item_coords.asm b/data/events/hidden_item_coords.asm index 04f0c2f4..3f45a1ed 100644 --- a/data/events/hidden_item_coords.asm +++ b/data/events/hidden_item_coords.asm @@ -3,7 +3,7 @@ MACRO hidden_item ENDM HiddenItemCoords: - table_width 3, HiddenItemCoords + table_width 3 ; map id, x, y hidden_item VIRIDIAN_FOREST, 1, 18 hidden_item VIRIDIAN_FOREST, 16, 42 diff --git a/data/events/trades.asm b/data/events/trades.asm index b230a918..f4963bde 100644 --- a/data/events/trades.asm +++ b/data/events/trades.asm @@ -1,6 +1,6 @@ TradeMons: ; entries correspond to TRADE_FOR_* constants - table_width 3 + NAME_LENGTH, TradeMons + table_width 3 + NAME_LENGTH ; give mon, get mon, dialog id, nickname ; The two instances of TRADE_DIALOGSET_EVOLUTION are a leftover ; from the Japanese Blue trades, which used species that evolve. diff --git a/data/growth_rates.asm b/data/growth_rates.asm index aaba27a8..a4f7b5d1 100644 --- a/data/growth_rates.asm +++ b/data/growth_rates.asm @@ -11,7 +11,7 @@ ENDM GrowthRateTable: ; entries correspond to GROWTH_* (see constants/pokemon_data_constants.asm) - table_width 4, GrowthRateTable + table_width 4 growth_rate 1, 1, 0, 0, 0 ; Medium Fast growth_rate 3, 4, 10, 0, 30 ; Slightly Fast growth_rate 3, 4, 20, 0, 70 ; Slightly Slow diff --git a/data/items/names.asm b/data/items/names.asm index 44a21c38..bab26efc 100644 --- a/data/items/names.asm +++ b/data/items/names.asm @@ -1,5 +1,5 @@ ItemNames:: - list_start ItemNames + list_start li "MASTER BALL" li "ULTRA BALL" li "GREAT BALL" diff --git a/data/items/prices.asm b/data/items/prices.asm index d01c0b7e..aefd1078 100644 --- a/data/items/prices.asm +++ b/data/items/prices.asm @@ -1,5 +1,5 @@ ItemPrices:: - table_width 3, ItemPrices + table_width 3 bcd3 0 ; MASTER_BALL bcd3 1200 ; ULTRA_BALL bcd3 600 ; GREAT_BALL diff --git a/data/maps/hide_show_data.asm b/data/maps/hide_show_data.asm index e3ece942..08d21511 100644 --- a/data/maps/hide_show_data.asm +++ b/data/maps/hide_show_data.asm @@ -2,7 +2,7 @@ MapHSPointers: ; entries correspond to map ids - table_width 2, MapHSPointers + table_width 2 dw PalletTownHS dw ViridianCityHS dw PewterCityHS @@ -259,7 +259,7 @@ NoHS: MissableObjects: ; entries correspond to HS_* constants (see constants/hide_show_constants) - table_width 3, MissableObjects + table_width 3 ; format: map id, object id, HIDE/SHOW PalletTownHS: diff --git a/data/maps/map_header_banks.asm b/data/maps/map_header_banks.asm index 87ec01cf..de7ae84b 100644 --- a/data/maps/map_header_banks.asm +++ b/data/maps/map_header_banks.asm @@ -1,6 +1,6 @@ ; see also MapHeaderPointers MapHeaderBanks:: - table_width 1, MapHeaderBanks + table_width 1 db BANK(PalletTown_h) db BANK(ViridianCity_h) db BANK(PewterCity_h) diff --git a/data/maps/map_header_pointers.asm b/data/maps/map_header_pointers.asm index 44457ce6..8d9eba2e 100644 --- a/data/maps/map_header_pointers.asm +++ b/data/maps/map_header_pointers.asm @@ -1,6 +1,6 @@ ; see also MapHeaderBanks MapHeaderPointers:: - table_width 2, MapHeaderPointers + table_width 2 dw PalletTown_h dw ViridianCity_h dw PewterCity_h diff --git a/data/maps/songs.asm b/data/maps/songs.asm index 111b87b8..bb62b552 100644 --- a/data/maps/songs.asm +++ b/data/maps/songs.asm @@ -1,5 +1,5 @@ MapSongBanks:: - table_width 2, MapSongBanks + table_width 2 db MUSIC_PALLET_TOWN, BANK(Music_PalletTown) ; PALLET_TOWN db MUSIC_CITIES1, BANK(Music_Cities1) ; VIRIDIAN_CITY db MUSIC_CITIES1, BANK(Music_Cities1) ; PEWTER_CITY diff --git a/data/maps/sprite_sets.asm b/data/maps/sprite_sets.asm index 0bf49db6..7b2a4e87 100644 --- a/data/maps/sprite_sets.asm +++ b/data/maps/sprite_sets.asm @@ -1,7 +1,7 @@ ; Valid sprite IDs for each outdoor map. MapSpriteSets: - table_width 1, MapSpriteSets + table_width 1 db SPRITESET_PALLET_VIRIDIAN ; PALLET_TOWN db SPRITESET_PALLET_VIRIDIAN ; VIRIDIAN_CITY db SPRITESET_PEWTER_CERULEAN ; PEWTER_CITY @@ -47,7 +47,7 @@ MapSpriteSets: ; #3: sprite set ID if on the west or north side ; #4: sprite set ID if on the east or south side SplitMapSpriteSets: - table_width 4, SplitMapSpriteSets + table_width 4 db NORTH_SOUTH, 37, SPRITESET_PEWTER_CERULEAN, SPRITESET_PALLET_VIRIDIAN ; SPLITSET_ROUTE_2 db NORTH_SOUTH, 50, SPRITESET_PEWTER_CERULEAN, SPRITESET_LAVENDER ; SPLITSET_ROUTE_10 db EAST_WEST, 57, SPRITESET_VERMILION, SPRITESET_SILENCE_BRIDGE ; SPLITSET_ROUTE_11 @@ -63,7 +63,7 @@ SplitMapSpriteSets: assert_table_length NUM_SPLIT_SETS SpriteSets: - table_width SPRITE_SET_LENGTH, SpriteSets + table_width SPRITE_SET_LENGTH ; SPRITESET_PALLET_VIRIDIAN db SPRITE_BLUE diff --git a/data/maps/town_map_entries.asm b/data/maps/town_map_entries.asm index 78b7ff62..c93ba57b 100644 --- a/data/maps/town_map_entries.asm +++ b/data/maps/town_map_entries.asm @@ -5,7 +5,7 @@ ENDM ; the appearance of towns and routes in the town map ExternalMapEntries: - table_width 3, ExternalMapEntries + table_width 3 ; x, y, name external_map 2, 11, PalletTownName external_map 2, 8, ViridianCityName diff --git a/data/moves/animations.asm b/data/moves/animations.asm index e9fdc34c..bd362c53 100644 --- a/data/moves/animations.asm +++ b/data/moves/animations.asm @@ -1,5 +1,5 @@ AttackAnimationPointers: - table_width 2, AttackAnimationPointers + table_width 2 dw PoundAnim dw KarateChopAnim dw DoubleSlapAnim diff --git a/data/moves/effects_pointers.asm b/data/moves/effects_pointers.asm index 63350efc..fc7c08c5 100644 --- a/data/moves/effects_pointers.asm +++ b/data/moves/effects_pointers.asm @@ -1,6 +1,6 @@ MoveEffectPointerTable: ; entries correspond to *_EFFECT constants - table_width 2, MoveEffectPointerTable + table_width 2 dw SleepEffect ; EFFECT_01 dw PoisonEffect ; POISON_SIDE_EFFECT1 dw DrainHPEffect ; DRAIN_HP_EFFECT diff --git a/data/moves/moves.asm b/data/moves/moves.asm index e59ed007..f435ab6b 100644 --- a/data/moves/moves.asm +++ b/data/moves/moves.asm @@ -10,7 +10,7 @@ ENDM Moves: ; Characteristics of each move. - table_width MOVE_LENGTH, Moves + table_width MOVE_LENGTH move POUND, NO_ADDITIONAL_EFFECT, 40, NORMAL, 100, 35 move KARATE_CHOP, NO_ADDITIONAL_EFFECT, 50, NORMAL, 100, 25 move DOUBLESLAP, TWO_TO_FIVE_ATTACKS_EFFECT, 15, NORMAL, 85, 10 diff --git a/data/moves/names.asm b/data/moves/names.asm index e9591619..025172d5 100644 --- a/data/moves/names.asm +++ b/data/moves/names.asm @@ -1,5 +1,5 @@ MoveNames:: - list_start MoveNames + list_start li "POUND" li "KARATE CHOP" li "DOUBLESLAP" diff --git a/data/moves/sfx.asm b/data/moves/sfx.asm index c3f01f4e..f1466ac1 100644 --- a/data/moves/sfx.asm +++ b/data/moves/sfx.asm @@ -1,5 +1,5 @@ MoveSoundTable: - table_width 3, MoveSoundTable + table_width 3 ; ID, pitch mod, tempo mod db SFX_POUND, $00, $80 ; POUND db SFX_BATTLE_0C, $10, $80 ; KARATE_CHOP diff --git a/data/moves/tmhm_moves.asm b/data/moves/tmhm_moves.asm index 6b279f5a..ee9b37f8 100644 --- a/data/moves/tmhm_moves.asm +++ b/data/moves/tmhm_moves.asm @@ -2,7 +2,7 @@ ; define constants for the item IDs and for the corresponding move values. TechnicalMachines: - table_width 1, TechnicalMachines + table_width 1 FOR n, 1, NUM_TMS + 1 db TM{02d:n}_MOVE diff --git a/data/pokemon/base_stats.asm b/data/pokemon/base_stats.asm index 691e75b0..76f7a0bd 100644 --- a/data/pokemon/base_stats.asm +++ b/data/pokemon/base_stats.asm @@ -1,5 +1,5 @@ BaseStats:: - table_width BASE_DATA_SIZE, BaseStats + table_width BASE_DATA_SIZE INCLUDE "data/pokemon/base_stats/bulbasaur.asm" INCLUDE "data/pokemon/base_stats/ivysaur.asm" INCLUDE "data/pokemon/base_stats/venusaur.asm" diff --git a/data/pokemon/cries.asm b/data/pokemon/cries.asm index 290f5625..eab1818e 100644 --- a/data/pokemon/cries.asm +++ b/data/pokemon/cries.asm @@ -4,7 +4,7 @@ MACRO mon_cry ENDM CryData:: - table_width 3, CryData + table_width 3 ; base cry, pitch, length mon_cry SFX_CRY_11, $00, $80 ; Rhydon mon_cry SFX_CRY_03, $00, $80 ; Kangaskhan diff --git a/data/pokemon/dex_entries.asm b/data/pokemon/dex_entries.asm index ceb431b7..58e815ac 100644 --- a/data/pokemon/dex_entries.asm +++ b/data/pokemon/dex_entries.asm @@ -1,5 +1,5 @@ PokedexEntryPointers: - table_width 2, PokedexEntryPointers + table_width 2 dw RhydonDexEntry dw KangaskhanDexEntry dw NidoranMDexEntry diff --git a/data/pokemon/dex_order.asm b/data/pokemon/dex_order.asm index 32e7a79b..7c47ddcc 100644 --- a/data/pokemon/dex_order.asm +++ b/data/pokemon/dex_order.asm @@ -1,5 +1,5 @@ PokedexOrder: - table_width 1, PokedexOrder + table_width 1 db DEX_RHYDON db DEX_KANGASKHAN db DEX_NIDORAN_M diff --git a/data/pokemon/evos_moves.asm b/data/pokemon/evos_moves.asm index d900dde6..6a6704f9 100644 --- a/data/pokemon/evos_moves.asm +++ b/data/pokemon/evos_moves.asm @@ -9,7 +9,7 @@ ; - db 0 ; no more level-up moves EvosMovesPointerTable: - table_width 2, EvosMovesPointerTable + table_width 2 dw RhydonEvosMoves dw KangaskhanEvosMoves dw NidoranMEvosMoves diff --git a/data/pokemon/names.asm b/data/pokemon/names.asm index 56aa9f5d..5d447c92 100644 --- a/data/pokemon/names.asm +++ b/data/pokemon/names.asm @@ -1,5 +1,5 @@ MonsterNames:: - table_width NAME_LENGTH - 1, MonsterNames + table_width NAME_LENGTH - 1 db "RHYDON@@@@" db "KANGASKHAN" db "NIDORAN♂@@" diff --git a/data/pokemon/palettes.asm b/data/pokemon/palettes.asm index 4aec84ea..f0485e16 100644 --- a/data/pokemon/palettes.asm +++ b/data/pokemon/palettes.asm @@ -1,5 +1,5 @@ MonsterPalettes: - table_width 1, MonsterPalettes + table_width 1 db PAL_MEWMON ; MISSINGNO db PAL_GREENMON ; BULBASAUR db PAL_GREENMON ; IVYSAUR diff --git a/data/sgb/sgb_palettes.asm b/data/sgb/sgb_palettes.asm index eb6bc584..d8016d64 100644 --- a/data/sgb/sgb_palettes.asm +++ b/data/sgb/sgb_palettes.asm @@ -1,6 +1,6 @@ SuperPalettes: ; entries correspond to PAL_* constants - table_width 2 * 4, SuperPalettes + table_width 2 * 4 RGB 31,29,31, 21,28,11, 20,26,31, 03,02,02 ; PAL_ROUTE RGB 31,29,31, 25,28,27, 20,26,31, 03,02,02 ; PAL_PALLET RGB 31,29,31, 17,26,03, 20,26,31, 03,02,02 ; PAL_VIRIDIAN diff --git a/data/sprites/sprites.asm b/data/sprites/sprites.asm index 612ce10c..3c923e2d 100644 --- a/data/sprites/sprites.asm +++ b/data/sprites/sprites.asm @@ -5,7 +5,7 @@ MACRO overworld_sprite ENDM SpriteSheetPointerTable: - table_width 4, SpriteSheetPointerTable + table_width 4 ; graphics, tile count overworld_sprite RedSprite, 12 ; SPRITE_RED overworld_sprite BlueSprite, 12 ; SPRITE_BLUE diff --git a/data/tilemaps.asm b/data/tilemaps.asm index 3e1033be..ba67fae0 100644 --- a/data/tilemaps.asm +++ b/data/tilemaps.asm @@ -5,7 +5,7 @@ ENDM TileIDListPointerTable: ; entries correspond to TILEMAP_* constants (see constants/gfx_constants.asm) - table_width 3, TileIDListPointerTable + table_width 3 ; tilemap pointer, width, height tile_ids MonTiles, 7, 7 tile_ids SlideDownMonTiles_7x5, 7, 5 diff --git a/data/tilesets/tileset_headers.asm b/data/tilesets/tileset_headers.asm index a8500ef2..30db7b95 100644 --- a/data/tilesets/tileset_headers.asm +++ b/data/tilesets/tileset_headers.asm @@ -7,7 +7,7 @@ MACRO tileset ENDM Tilesets: - table_width 12, Tilesets + table_width 12 ; name, 3 counter tiles, grass tile, animations tileset Overworld, -1, -1, -1, $52, TILEANIM_WATER_FLOWER tileset RedsHouse1, -1, -1, -1, -1, TILEANIM_NONE diff --git a/data/tilesets/warp_tile_ids.asm b/data/tilesets/warp_tile_ids.asm index 823b4b36..3a4cdbd7 100644 --- a/data/tilesets/warp_tile_ids.asm +++ b/data/tilesets/warp_tile_ids.asm @@ -1,5 +1,5 @@ WarpTileIDPointers: - table_width 2, WarpTileIDPointers + table_width 2 dw .OverworldWarpTileIDs dw .RedsHouse1WarpTileIDs dw .MartWarpTileIDs diff --git a/data/trainers/ai_pointers.asm b/data/trainers/ai_pointers.asm index a2c6975b..eaab9a7a 100644 --- a/data/trainers/ai_pointers.asm +++ b/data/trainers/ai_pointers.asm @@ -1,5 +1,5 @@ TrainerAIPointers: - table_width 3, TrainerAIPointers + table_width 3 ; one entry per trainer class ; first byte, number of times (per Pokémon) it can occur ; next two bytes, pointer to AI subroutine for trainer class diff --git a/data/trainers/move_choices.asm b/data/trainers/move_choices.asm index 3741f06b..1624b326 100644 --- a/data/trainers/move_choices.asm +++ b/data/trainers/move_choices.asm @@ -8,7 +8,7 @@ ENDM ; move choice modification methods that are applied for each trainer class TrainerClassMoveChoiceModifications: - list_start TrainerClassMoveChoiceModifications + list_start move_choices ; YOUNGSTER move_choices 1 ; BUG CATCHER move_choices 1 ; LASS diff --git a/data/trainers/name_pointers.asm b/data/trainers/name_pointers.asm index 914fe9d4..9bcce418 100644 --- a/data/trainers/name_pointers.asm +++ b/data/trainers/name_pointers.asm @@ -2,7 +2,7 @@ TrainerNamePointers: ; These are only used for trainers' defeat speeches. ; They were originally shortened variants of the trainer class names ; in the Japanese versions, but are now redundant with TrainerNames. - table_width 2, TrainerNamePointers + table_width 2 dw .YoungsterName dw .BugCatcherName dw .LassName diff --git a/data/trainers/names.asm b/data/trainers/names.asm index dc6ded77..d7c5677c 100644 --- a/data/trainers/names.asm +++ b/data/trainers/names.asm @@ -1,5 +1,5 @@ TrainerNames:: - list_start TrainerNames + list_start li "YOUNGSTER" li "BUG CATCHER" li "LASS" diff --git a/data/trainers/parties.asm b/data/trainers/parties.asm index b2ad5e08..cf5eb151 100644 --- a/data/trainers/parties.asm +++ b/data/trainers/parties.asm @@ -1,5 +1,5 @@ TrainerDataPointers: - table_width 2, TrainerDataPointers + table_width 2 dw YoungsterData dw BugCatcherData dw LassData diff --git a/data/trainers/pic_pointers_money.asm b/data/trainers/pic_pointers_money.asm index 4515d880..f300fb29 100644 --- a/data/trainers/pic_pointers_money.asm +++ b/data/trainers/pic_pointers_money.asm @@ -4,7 +4,7 @@ MACRO pic_money ENDM TrainerPicAndMoneyPointers:: - table_width 5, TrainerPicAndMoneyPointers + table_width 5 ; pic pointer, base reward money ; money received after battle = base money × level of last enemy mon pic_money YoungsterPic, 1500 diff --git a/data/types/names.asm b/data/types/names.asm index 87da5c5f..8fbcacb6 100644 --- a/data/types/names.asm +++ b/data/types/names.asm @@ -1,5 +1,5 @@ TypeNames: - table_width 2, TypeNames + table_width 2 dw .Normal dw .Fighting diff --git a/data/wild/grass_water.asm b/data/wild/grass_water.asm index a09fdce6..f15bed50 100644 --- a/data/wild/grass_water.asm +++ b/data/wild/grass_water.asm @@ -1,5 +1,5 @@ WildDataPointers: - table_width 2, WildDataPointers + table_width 2 dw NothingWildMons ; PALLET_TOWN dw NothingWildMons ; VIRIDIAN_CITY dw NothingWildMons ; PEWTER_CITY diff --git a/data/yes_no_menu_strings.asm b/data/yes_no_menu_strings.asm index 82c3a3a5..445bf830 100644 --- a/data/yes_no_menu_strings.asm +++ b/data/yes_no_menu_strings.asm @@ -5,7 +5,7 @@ ENDM TwoOptionMenuStrings: ; entries correspond to *_MENU constants - table_width 5, TwoOptionMenuStrings + table_width 5 ; width, height, blank line before first menu item?, text pointer two_option_menu 4, 3, FALSE, .YesNoMenu two_option_menu 6, 3, FALSE, .NorthWestMenu diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 85d2177e..fe731c5d 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -77,7 +77,7 @@ DEF NUM_BATTLE_TRANSITION_BITS EQU const_value ; bit 1: set if enemy is at least 3 levels higher than player ; bit 2: set if dungeon map BattleTransitions: - table_width 2, BattleTransitions + table_width 2 dw BattleTransition_DoubleCircle ; %000 dw BattleTransition_Spiral ; %001 dw BattleTransition_Circle ; %010 diff --git a/macros/asserts.asm b/macros/asserts.asm index bc5b2582..7fb7f96b 100644 --- a/macros/asserts.asm +++ b/macros/asserts.asm @@ -1,13 +1,29 @@ ; Macros to verify assumptions about the data or code +MACRO _redef_current_label + IF DEF(\1) + PURGE \1 + ENDC + IF _NARG == 3 + (\3) + DEF \1 EQUS "\<_NARG>" + ELIF DEF(..) + IF .. - @ == 0 + DEF \1 EQUS "{..}" + ENDC + ELIF DEF(.) + if . - @ == 0 + DEF \1 EQUS "{.}" + ENDC + ENDC + if !DEF(\1) + DEF \1 EQUS \2 + {\1}: + ENDC +ENDM + MACRO table_width DEF CURRENT_TABLE_WIDTH = \1 - IF _NARG == 2 - REDEF CURRENT_TABLE_START EQUS "\2" - ELSE - REDEF CURRENT_TABLE_START EQUS "._table_width\@" - {CURRENT_TABLE_START}: - ENDC + _redef_current_label CURRENT_TABLE_START, "._table_width\@", 2, \# ENDM MACRO assert_table_length @@ -24,12 +40,7 @@ ENDM MACRO list_start DEF list_index = 0 - IF _NARG == 1 - REDEF CURRENT_LIST_START EQUS "\1" - ELSE - REDEF CURRENT_LIST_START EQUS "._list_start\@" - {CURRENT_LIST_START}: - ENDC + _redef_current_label CURRENT_LIST_START, "._list_start\@", 1, \# ENDM MACRO li diff --git a/scripts/CeruleanBadgeHouse.asm b/scripts/CeruleanBadgeHouse.asm index 54186523..1c7e0200 100644 --- a/scripts/CeruleanBadgeHouse.asm +++ b/scripts/CeruleanBadgeHouse.asm @@ -53,7 +53,7 @@ CeruleanBadgeHouseMiddleAgedManText: jp TextScriptEnd .BadgeItemList: - table_width 1, .BadgeItemList + table_width 1 db NUM_BADGES ; # db BOULDERBADGE db CASCADEBADGE @@ -79,7 +79,7 @@ CeruleanBadgeHouseMiddleAgedManText: text_end CeruleanBadgeHouseBadgeTextPointers: - table_width 2, CeruleanBadgeHouseBadgeTextPointers + table_width 2 dw CeruleanBadgeHouseBoulderBadgeText dw CeruleanBadgeHouseCascadeBadgeText dw CeruleanBadgeHouseThunderBadgeText From 0d4562d1b855bfa7965349e1a92deac0f5b89a27 Mon Sep 17 00:00:00 2001 From: vulcandth Date: Fri, 27 Dec 2024 12:10:13 -0600 Subject: [PATCH 03/10] Use exported constants for VC patch (#483) --- Makefile | 6 +-- includes.asm | 7 ++++ tools/make_patch.c | 22 +++++------ vc/pokeblue.constants.asm | 75 +++++++++++++++++------------------ vc/pokeblue.patch.template | 42 ++++++++++---------- vc/pokered.constants.asm | 80 ++++++++++++++++++-------------------- vc/pokered.patch.template | 48 +++++++++++------------ 7 files changed, 136 insertions(+), 144 deletions(-) diff --git a/Makefile b/Makefile index e53fce45..08c4dd9b 100644 --- a/Makefile +++ b/Makefile @@ -97,7 +97,7 @@ $(pokeblue_debug_obj): RGBASMFLAGS += -D _BLUE -D _DEBUG $(pokered_vc_obj): RGBASMFLAGS += -D _RED -D _RED_VC $(pokeblue_vc_obj): RGBASMFLAGS += -D _BLUE -D _BLUE_VC -%.patch: vc/%.constants.sym %_vc.gbc %.gbc vc/%.patch.template +%.patch: %_vc.gbc %.gbc vc/%.patch.template tools/make_patch $*_vc.sym $^ $@ rgbdscheck.o: rgbdscheck.asm @@ -125,10 +125,6 @@ $(foreach obj, $(pokeblue_debug_obj), $(eval $(call DEP,$(obj),$(obj:_blue_debug $(foreach obj, $(pokered_vc_obj), $(eval $(call DEP,$(obj),$(obj:_red_vc.o=.asm)))) $(foreach obj, $(pokeblue_vc_obj), $(eval $(call DEP,$(obj),$(obj:_blue_vc.o=.asm)))) -# Dependencies for VC files that need to run scan_includes -%.constants.sym: %.constants.asm $(shell tools/scan_includes %.constants.asm) $(preinclude_deps) | rgbdscheck.o - $(RGBASM) $(RGBASMFLAGS) $< > $@ - endif diff --git a/includes.asm b/includes.asm index 8808e1d0..f83b76e4 100644 --- a/includes.asm +++ b/includes.asm @@ -50,3 +50,10 @@ INCLUDE "constants/tileset_constants.asm" INCLUDE "constants/event_constants.asm" INCLUDE "constants/text_constants.asm" INCLUDE "constants/menu_constants.asm" + +IF DEF(_RED_VC) +INCLUDE "vc/pokered.constants.asm" +ENDC +IF DEF(_BLUE_VC) +INCLUDE "vc/pokeblue.constants.asm" +ENDC diff --git a/tools/make_patch.c b/tools/make_patch.c index 77a30683..d96bf216 100644 --- a/tools/make_patch.c +++ b/tools/make_patch.c @@ -1,5 +1,5 @@ #define PROGRAM_NAME "make_patch" -#define USAGE_OPTS "labels.sym constants.sym patched.gbc original.gbc vc.patch.template vc.patch" +#define USAGE_OPTS "values.sym patched.gbc original.gbc vc.patch.template vc.patch" #include "common.h" @@ -113,13 +113,14 @@ void parse_symbol_value(char *input, int *restrict bank, int *restrict address) } } -void parse_symbols(const char *filename, struct Symbol **symbols) { +struct Symbol *parse_symbols(const char *filename) { FILE *file = xfopen(filename, 'r'); struct Buffer *buffer = buffer_create(1); enum { SYM_PRE, SYM_VALUE, SYM_SPACE, SYM_NAME } state = SYM_PRE; int bank = 0; int address = 0; + struct Symbol *symbols = NULL; for (;;) { int c = getc(file); @@ -127,7 +128,7 @@ void parse_symbols(const char *filename, struct Symbol **symbols) { if (state == SYM_NAME) { // The symbol name has ended; append the buffered symbol buffer_append(buffer, &(char []){'\0'}); - symbol_append(symbols, buffer->data, bank, address); + symbol_append(&symbols, buffer->data, bank, address); } // Skip to the next line, ignoring anything after the symbol value and name state = SYM_PRE; @@ -156,6 +157,7 @@ void parse_symbols(const char *filename, struct Symbol **symbols) { fclose(file); buffer_free(buffer); + return symbols; } int strfind(const char *s, const char *list[], int count) { @@ -443,20 +445,18 @@ bool verify_completeness(FILE *restrict orig_rom, FILE *restrict new_rom, struct } int main(int argc, char *argv[]) { - if (argc != 7) { + if (argc != 6) { usage_exit(1); } - struct Symbol *symbols = NULL; - parse_symbols(argv[1], &symbols); - parse_symbols(argv[2], &symbols); + struct Symbol *symbols = parse_symbols(argv[1]); - FILE *new_rom = xfopen(argv[3], 'r'); - FILE *orig_rom = xfopen(argv[4], 'r'); - struct Buffer *patches = process_template(argv[5], argv[6], new_rom, orig_rom, symbols); + FILE *new_rom = xfopen(argv[2], 'r'); + FILE *orig_rom = xfopen(argv[3], 'r'); + struct Buffer *patches = process_template(argv[4], argv[5], new_rom, orig_rom, symbols); if (!verify_completeness(orig_rom, new_rom, patches)) { - fprintf(stderr, PROGRAM_NAME ": Warning: Not all ROM differences are defined by \"%s\"\n", argv[6]); + fprintf(stderr, PROGRAM_NAME ": Warning: Not all ROM differences are defined by \"%s\"\n", argv[5]); } symbol_free(symbols); diff --git a/vc/pokeblue.constants.asm b/vc/pokeblue.constants.asm index 41c0d8fd..e55bcca0 100644 --- a/vc/pokeblue.constants.asm +++ b/vc/pokeblue.constants.asm @@ -1,69 +1,64 @@ ; These are all the asm constants needed to make the blue_vc patch. -MACRO vc_const - DEF x = \1 - PRINTLN "{02x:x} \1" ; same format as rgblink's .sym file -ENDM - ; [FPA 001 Begin] - vc_const "M" - vc_const "E" - vc_const "G" - vc_const "A" - vc_const "P" - vc_const "S" - vc_const "L" - vc_const "F" - vc_const "X" - vc_const MEGA_PUNCH +EXPORT DEF M_CHAR EQU "M" +EXPORT DEF E_CHAR EQU "E" +EXPORT DEF G_CHAR EQU "G" +EXPORT DEF A_CHAR EQU "A" +EXPORT DEF P_CHAR EQU "P" +EXPORT DEF S_CHAR EQU "S" +EXPORT DEF L_CHAR EQU "L" +EXPORT DEF F_CHAR EQU "F" +EXPORT DEF X_CHAR EQU "X" +EXPORT MEGA_PUNCH ; [FPA 001 End] - vc_const EXPLOSION +EXPORT EXPLOSION ; [FPA 002 Begin] - vc_const "U" - vc_const "I" - vc_const GUILLOTINE +EXPORT DEF U_CHAR EQU "U" +EXPORT DEF I_CHAR EQU "I" +EXPORT GUILLOTINE ; [FPA 002 End] - vc_const "K" - vc_const MEGA_KICK +EXPORT DEF K_CHAR EQU "K" +EXPORT MEGA_KICK ; [FPA 004 Begin] - vc_const "B" - vc_const "Z" - vc_const BLIZZARD +EXPORT DEF B_CHAR EQU "B" +EXPORT DEF Z_CHAR EQU "Z" +EXPORT BLIZZARD ; [FPA 005 Begin] - vc_const BUBBLEBEAM +EXPORT BUBBLEBEAM ; [FPA 005 End] - vc_const HYPER_BEAM +EXPORT HYPER_BEAM ; [FPA 006 Begin] - vc_const "H" - vc_const "Y" +EXPORT DEF H_CHAR EQU "H" +EXPORT DEF Y_CHAR EQU "Y" ; [FPA 007 Begin] - vc_const "T" - vc_const "N" - vc_const THUNDERBOLT +EXPORT DEF T_CHAR EQU "T" +EXPORT DEF N_CHAR EQU "N" +EXPORT THUNDERBOLT ; [FPA 008 Begin] - vc_const "R" - vc_const REFLECT +EXPORT DEF R_CHAR EQU "R" +EXPORT REFLECT ; [FPA 009 Begin] - vc_const SELFDESTRUCT +EXPORT SELFDESTRUCT ; [FPA 010 Begin] - vc_const "D" - vc_const DREAM_EATER +EXPORT DEF D_CHAR EQU "D" +EXPORT DREAM_EATER ; [FPA 011 Begin] - vc_const "O" - vc_const SPORE +EXPORT DEF O_CHAR EQU "O" +EXPORT SPORE ; [FPA 012 Begin] - vc_const "C" - vc_const ROCK_SLIDE +EXPORT DEF C_CHAR EQU "C" +EXPORT ROCK_SLIDE diff --git a/vc/pokeblue.patch.template b/vc/pokeblue.patch.template index b49dff33..0bd83a07 100644 --- a/vc/pokeblue.patch.template +++ b/vc/pokeblue.patch.template @@ -167,7 +167,7 @@ MotionBlur0 = 27 ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == || == == == == == } -ConditionValueC = {dws_ "M" "E" "G" "A" "P" MEGA_PUNCH 00 "S" "E" "L" "F" MEGA_PUNCH 00 "E" "X" "P" "L" MEGA_PUNCH } +ConditionValueC = {dws_ M_CHAR E_CHAR G_CHAR A_CHAR P_CHAR MEGA_PUNCH 00 S_CHAR E_CHAR L_CHAR F_CHAR MEGA_PUNCH 00 E_CHAR X_CHAR P_CHAR L_CHAR MEGA_PUNCH } [FPA 001 End@Stop_reducing_move_anim_flashing_Mega_Punch_Explosion] Mode = 3 @@ -176,7 +176,7 @@ Address = {HEX @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == || == == == == == } -ConditionValueC = {dws_ "M" "E" "G" "A" "P" MEGA_PUNCH 00 "E" "X" "P" "L" EXPLOSION 00 "E" "X" "P" "L" MEGA_PUNCH } +ConditionValueC = {dws_ M_CHAR E_CHAR G_CHAR A_CHAR P_CHAR MEGA_PUNCH 00 E_CHAR X_CHAR P_CHAR L_CHAR EXPLOSION 00 E_CHAR X_CHAR P_CHAR L_CHAR MEGA_PUNCH } @@ -193,7 +193,7 @@ MotionBlur1 = 8 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "G" "U" "I" "L" GUILLOTINE } +ConditionValueC = {dws_ G_CHAR U_CHAR I_CHAR L_CHAR GUILLOTINE } [FPA 002 End@Stop_reducing_move_anim_flashing_Guillotine] Mode = 3 @@ -202,7 +202,7 @@ Address = {HEX @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID} ConditionValueB = {dws_ == == == == == || == == == == == == } -ConditionValueC = {dws_ "G" "U" "I" "L" GUILLOTINE 00 "M" "E" "G" "A" "K" MEGA_KICK } +ConditionValueC = {dws_ G_CHAR U_CHAR I_CHAR L_CHAR GUILLOTINE 00 M_CHAR E_CHAR G_CHAR A_CHAR K_CHAR MEGA_KICK } @@ -217,7 +217,7 @@ MotionBlur0 = 25 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "M" "E" "G" "A" "K" MEGA_KICK } +ConditionValueC = {dws_ M_CHAR E_CHAR G_CHAR A_CHAR K_CHAR MEGA_KICK } @@ -232,7 +232,7 @@ MotionBlur0 = 25 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "B" "L" "I" "Z" BLIZZARD } +ConditionValueC = {dws_ B_CHAR L_CHAR I_CHAR Z_CHAR BLIZZARD } ;rsm160334 @@ -246,7 +246,7 @@ MotionBlur0 = 27 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "B" "U" "B" "B" BUBBLEBEAM } +ConditionValueC = {dws_ B_CHAR U_CHAR B_CHAR B_CHAR BUBBLEBEAM } [FPA 005 End@Stop_reducing_move_anim_flashing_Bubblebeam_Hyper_Beam_Blizzard] Mode = 3 @@ -255,7 +255,7 @@ Address = {HEX @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == || == == == == == || == == == == == } -ConditionValueC = {dws_ "B" "U" "B" "B" BUBBLEBEAM 00 "H" "Y" "P" "E" HYPER_BEAM 00 "B" "L" "I" "Z" BLIZZARD } +ConditionValueC = {dws_ B_CHAR U_CHAR B_CHAR B_CHAR BUBBLEBEAM 00 H_CHAR Y_CHAR P_CHAR E_CHAR HYPER_BEAM 00 B_CHAR L_CHAR I_CHAR Z_CHAR BLIZZARD } ;rsm163356 @@ -271,7 +271,7 @@ MotionBlur1 = 5 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "H" "Y" "P" "E" HYPER_BEAM } +ConditionValueC = {dws_ H_CHAR Y_CHAR P_CHAR E_CHAR HYPER_BEAM } @@ -286,7 +286,7 @@ MotionBlur0 = 30 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "T" "H" "U" "N" THUNDERBOLT } +ConditionValueC = {dws_ T_CHAR H_CHAR U_CHAR N_CHAR THUNDERBOLT } [FPA 007 End@Stop_reducing_move_anim_flashing_Thunderbolt] @@ -296,7 +296,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "T" "H" "U" "N" THUNDERBOLT } +ConditionValueC = {dws_ T_CHAR H_CHAR U_CHAR N_CHAR THUNDERBOLT } ;rsm134518 @@ -312,7 +312,7 @@ MotionBlur1 = 5 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "R" "E" "F" "L" REFLECT } +ConditionValueC = {dws_ R_CHAR E_CHAR F_CHAR L_CHAR REFLECT } [FPA 008 End@Stop_reducing_move_anim_flashing_Reflect] Mode = 3 @@ -321,7 +321,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "R" "E" "F" "L" REFLECT } +ConditionValueC = {dws_ R_CHAR E_CHAR F_CHAR L_CHAR REFLECT } @@ -337,7 +337,7 @@ MotionBlur0 = 27 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "S" "E" "L" "F" SELFDESTRUCT} +ConditionValueC = {dws_ S_CHAR E_CHAR L_CHAR F_CHAR SELFDESTRUCT} [FPA 009 End@Stop_reducing_move_anim_flashing_Self_Destruct] Mode = 3 @@ -346,7 +346,7 @@ Address = {HEX @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == || == == == == == } -ConditionValueC = {dws_ "S" "E" "L" "F" MEGA_PUNCH 00 "S" "E" "L" "F" SELFDESTRUCT} +ConditionValueC = {dws_ S_CHAR E_CHAR L_CHAR F_CHAR MEGA_PUNCH 00 S_CHAR E_CHAR L_CHAR F_CHAR SELFDESTRUCT} ;rsm150211 ;No156 @@ -361,7 +361,7 @@ MotionBlur1 = 7 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "D" "R" "E" "A" DREAM_EATER } +ConditionValueC = {dws_ D_CHAR R_CHAR E_CHAR A_CHAR DREAM_EATER } ;[FPA 010 End] ;Mode = 3 @@ -385,7 +385,7 @@ MotionBlur1 = 8 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "S" "P" "O" "R" SPORE } +ConditionValueC = {dws_ S_CHAR P_CHAR O_CHAR R_CHAR SPORE } [FPA 011 End@Stop_reducing_move_anim_flashing_Spore] Mode = 3 @@ -394,7 +394,7 @@ Address = {hex @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "S" "P" "O" "R" SPORE } +ConditionValueC = {dws_ S_CHAR P_CHAR O_CHAR R_CHAR SPORE } ;rsm012224 ;No12 @@ -407,7 +407,7 @@ MotionBlur0 = 27 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "R" "O" "C" "K" ROCK_SLIDE } +ConditionValueC = {dws_ R_CHAR O_CHAR C_CHAR K_CHAR ROCK_SLIDE } [FPA 012 End@Stop_reducing_move_anim_flashing_Rock_Slide_Dream_Eater] Mode = 3 @@ -416,7 +416,7 @@ Address = {hex @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == || == == == == == } -ConditionValueC = {dws_ "R" "O" "C" "K" ROCK_SLIDE 00 "D" "R" "E" "A" DREAM_EATER } +ConditionValueC = {dws_ R_CHAR O_CHAR C_CHAR K_CHAR ROCK_SLIDE 00 D_CHAR R_CHAR E_CHAR A_CHAR DREAM_EATER } @@ -433,4 +433,4 @@ MotionBlur0 = 28 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "E" "X" "P" "L" EXPLOSION } \ No newline at end of file +ConditionValueC = {dws_ E_CHAR X_CHAR P_CHAR L_CHAR EXPLOSION } \ No newline at end of file diff --git a/vc/pokered.constants.asm b/vc/pokered.constants.asm index 8ae18a13..aec40f11 100644 --- a/vc/pokered.constants.asm +++ b/vc/pokered.constants.asm @@ -1,72 +1,66 @@ ; These are all the asm constants needed to make the red_vc patch. -MACRO vc_const - DEF x = \1 - PRINTLN "{02x:x} \1" ; same format as rgblink's .sym file -ENDM - ; [FPA 001 Begin] - vc_const "M" - vc_const "E" - vc_const "G" - vc_const "A" - vc_const "P" - vc_const "S" - vc_const "L" - vc_const "F" - vc_const "D" - vc_const "X" - vc_const MEGA_PUNCH +EXPORT DEF M_CHAR EQU "M" +EXPORT DEF E_CHAR EQU "E" +EXPORT DEF G_CHAR EQU "G" +EXPORT DEF A_CHAR EQU "A" +EXPORT DEF P_CHAR EQU "P" +EXPORT DEF S_CHAR EQU "S" +EXPORT DEF L_CHAR EQU "L" +EXPORT DEF F_CHAR EQU "F" +EXPORT DEF D_CHAR EQU "D" +EXPORT DEF X_CHAR EQU "X" +EXPORT MEGA_PUNCH ; [FPA 002 Begin] - vc_const "U" - vc_const "I" - vc_const GUILLOTINE +EXPORT DEF U_CHAR EQU "U" +EXPORT DEF I_CHAR EQU "I" +EXPORT GUILLOTINE ; [FPA 003 Begin] - vc_const "K" - vc_const MEGA_KICK +EXPORT DEF K_CHAR EQU "K" +EXPORT MEGA_KICK ; [FPA 004 Begin] - vc_const "B" - vc_const BUBBLEBEAM +EXPORT DEF B_CHAR EQU "B" +EXPORT BUBBLEBEAM ; [FPA 005 Begin] - vc_const "H" - vc_const "Y" - vc_const HYPER_BEAM +EXPORT DEF H_CHAR EQU "H" +EXPORT DEF Y_CHAR EQU "Y" +EXPORT HYPER_BEAM ; [FPA 006 Begin] - vc_const "T" - vc_const "N" - vc_const THUNDERBOLT +EXPORT DEF T_CHAR EQU "T" +EXPORT DEF N_CHAR EQU "N" +EXPORT THUNDERBOLT ; [FPA 007 Begin] - vc_const "R" - vc_const "F" - vc_const REFLECT +EXPORT DEF R_CHAR EQU "R" +EXPORT REFLECT ; [FPA 008 Begin] - vc_const DREAM_EATER +EXPORT DREAM_EATER ; [FPA 008 End] - vc_const "Z" - vc_const BLIZZARD +EXPORT DEF Z_CHAR EQU "Z" +EXPORT BLIZZARD ; [FPA 009 Begin] - vc_const "O" - vc_const SPORE +EXPORT DEF O_CHAR EQU "O" +EXPORT SPORE ; [FPA 010 Begin] - vc_const "C" - vc_const ROCK_SLIDE +EXPORT DEF C_CHAR EQU "C" +EXPORT ROCK_SLIDE ; [FPA 010 End] - vc_const SELFDESTRUCT - vc_const EXPLOSION +EXPORT SELFDESTRUCT +EXPORT EXPLOSION ; [FPA conf Begin] - vc_const CONFUSION +EXPORT CONFUSION ; [FPA phy Begin] - vc_const PSYCHIC_M +EXPORT PSYCHIC_M diff --git a/vc/pokered.patch.template b/vc/pokered.patch.template index 08fba1a6..af07afd4 100644 --- a/vc/pokered.patch.template +++ b/vc/pokered.patch.template @@ -194,7 +194,7 @@ MotionBlur1 = 21 ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == == || == == == == == } -ConditionValueC = {dws_ "M" "E" "G" "A" "P" MEGA_PUNCH 00 "S" "E" "L" "F" "D" MEGA_PUNCH 00 "E" "X" "P" "L" MEGA_PUNCH } +ConditionValueC = {dws_ M_CHAR E_CHAR G_CHAR A_CHAR P_CHAR MEGA_PUNCH 00 S_CHAR E_CHAR L_CHAR F_CHAR D_CHAR MEGA_PUNCH 00 E_CHAR X_CHAR P_CHAR L_CHAR MEGA_PUNCH } [FPA 001 End@Stop_reducing_move_anim_flashing_Mega_Punch] @@ -204,7 +204,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "M" "E" "G" "A" "P" MEGA_PUNCH } +ConditionValueC = {dws_ M_CHAR E_CHAR G_CHAR A_CHAR P_CHAR MEGA_PUNCH } ;rsm032916 @@ -220,7 +220,7 @@ MotionBlur1 = 8 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "G" "U" "I" "L" GUILLOTINE } +ConditionValueC = {dws_ G_CHAR U_CHAR I_CHAR L_CHAR GUILLOTINE } [FPA 002 End@Stop_reducing_move_anim_flashing_Guillotine] Mode = 3 @@ -229,7 +229,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "G" "U" "I" "L" GUILLOTINE } +ConditionValueC = {dws_ G_CHAR U_CHAR I_CHAR L_CHAR GUILLOTINE } ;rsm041307 @@ -245,7 +245,7 @@ MotionBlur1 = 21 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "M" "E" "G" "A" "K" MEGA_KICK } +ConditionValueC = {dws_ M_CHAR E_CHAR G_CHAR A_CHAR K_CHAR MEGA_KICK } ;rsm001929 @@ -259,7 +259,7 @@ MotionBlur0 = 30 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "B" "U" "B" "B" BUBBLEBEAM } +ConditionValueC = {dws_ B_CHAR U_CHAR B_CHAR B_CHAR BUBBLEBEAM } [FPA 004 End@Stop_reducing_move_anim_flashing_Bubblebeam_Mega_Kick] Mode = 3 @@ -268,7 +268,7 @@ Address = {hex @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID} ConditionValueB = {dws_ == == == == == || == == == == == == } -ConditionValueC = {dws_ "B" "U" "B" "B" BUBBLEBEAM 00 "M" "E" "G" "A" "K" MEGA_KICK } +ConditionValueC = {dws_ B_CHAR U_CHAR B_CHAR B_CHAR BUBBLEBEAM 00 M_CHAR E_CHAR G_CHAR A_CHAR K_CHAR MEGA_KICK } ;rsm103658 @@ -284,7 +284,7 @@ MotionBlur1 = 5 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "H" "Y" "P" "E" HYPER_BEAM } +ConditionValueC = {dws_ H_CHAR Y_CHAR P_CHAR E_CHAR HYPER_BEAM } [FPA 005 End@Stop_reducing_move_anim_flashing_Hyper_Beam] Mode = 3 @@ -293,7 +293,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "H" "Y" "P" "E" HYPER_BEAM } +ConditionValueC = {dws_ H_CHAR Y_CHAR P_CHAR E_CHAR HYPER_BEAM } ;rsm133358 @@ -307,7 +307,7 @@ MotionBlur0 = 30 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "T" "H" "U" "N" THUNDERBOLT } +ConditionValueC = {dws_ T_CHAR H_CHAR U_CHAR N_CHAR THUNDERBOLT } [FPA 006 End@Stop_reducing_move_anim_flashing_Thunderbolt] @@ -317,7 +317,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "T" "H" "U" "N" THUNDERBOLT } +ConditionValueC = {dws_ T_CHAR H_CHAR U_CHAR N_CHAR THUNDERBOLT } ;rsm152340 ;no159 reflect @@ -332,7 +332,7 @@ MotionBlur1 = 5 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "R" "E" "F" "L" REFLECT } +ConditionValueC = {dws_ R_CHAR E_CHAR F_CHAR L_CHAR REFLECT } [FPA 007 End@Stop_reducing_move_anim_flashing_Reflect] Mode = 3 @@ -341,7 +341,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "R" "E" "F" "L" REFLECT } +ConditionValueC = {dws_ R_CHAR E_CHAR F_CHAR L_CHAR REFLECT } ;rsm171812 ;no156 dream eater @@ -356,7 +356,7 @@ MotionBlur1 = 7 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "D" "R" "E" "A" DREAM_EATER } +ConditionValueC = {dws_ D_CHAR R_CHAR E_CHAR A_CHAR DREAM_EATER } [FPA 008 End@Stop_reducing_move_anim_flashing_Blizzard] Mode = 3 @@ -365,7 +365,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4} {dws/ wAnimationID} ConditionValueB = {dws_ == == == == == } {dws/ == } -ConditionValueC = {dws_ "B" "L" "I" "Z" "Z" } {dws/ BLIZZARD } +ConditionValueC = {dws_ B_CHAR L_CHAR I_CHAR Z_CHAR Z_CHAR } {dws/ BLIZZARD } ;rsm174650 ;no36 spore @@ -380,7 +380,7 @@ MotionBlur1 = 8 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "S" "P" "O" "R" SPORE } +ConditionValueC = {dws_ S_CHAR P_CHAR O_CHAR R_CHAR SPORE } ;rsm152115 @@ -394,7 +394,7 @@ MotionBlur0 = 27 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "R" "O" "C" "K" ROCK_SLIDE } +ConditionValueC = {dws_ R_CHAR O_CHAR C_CHAR K_CHAR ROCK_SLIDE } [FPA 010 End@Stop_reducing_move_anim_flashing] Mode = 3 @@ -403,7 +403,7 @@ Address = {HEX @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == || == == == == == || == == == == == || == == == == == == || == == == == == == || == == == == == == || == == == == == || == == == == == } -ConditionValueC = {dws_ "D" "R" "E" "A" DREAM_EATER 00 "R" "O" "C" "K" ROCK_SLIDE 00 "S" "P" "O" "R" SPORE 00 "S" "E" "L" "F" "D" MEGA_PUNCH 00 "S" "E" "L" "F" "D" SELFDESTRUCT 00 "C" "O" "N" "F" "S" CONFUSION 00 "E" "X" "P" "L" EXPLOSION 00 "E" "X" "P" "L" MEGA_PUNCH } +ConditionValueC = {dws_ D_CHAR R_CHAR E_CHAR A_CHAR DREAM_EATER 00 R_CHAR O_CHAR C_CHAR K_CHAR ROCK_SLIDE 00 S_CHAR P_CHAR O_CHAR R_CHAR SPORE 00 S_CHAR E_CHAR L_CHAR F_CHAR D_CHAR MEGA_PUNCH 00 S_CHAR E_CHAR L_CHAR F_CHAR D_CHAR SELFDESTRUCT 00 C_CHAR O_CHAR N_CHAR F_CHAR S_CHAR CONFUSION 00 E_CHAR X_CHAR P_CHAR L_CHAR EXPLOSION 00 E_CHAR X_CHAR P_CHAR L_CHAR MEGA_PUNCH } ;explosion @@ -417,7 +417,7 @@ MotionBlur0 = 28 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wAnimationID} ConditionValueB = {dws_ == == == == == } -ConditionValueC = {dws_ "E" "X" "P" "L" EXPLOSION } +ConditionValueC = {dws_ E_CHAR X_CHAR P_CHAR L_CHAR EXPLOSION } ;No56 self-destruct @@ -430,7 +430,7 @@ MotionBlur0 = 23 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "S" "E" "L" "F" "D" SELFDESTRUCT} +ConditionValueC = {dws_ S_CHAR E_CHAR L_CHAR F_CHAR D_CHAR SELFDESTRUCT} ;No131 blizzard @@ -443,7 +443,7 @@ MotionBlur0 = 26 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "B" "L" "I" "Z" "Z" BLIZZARD } +ConditionValueC = {dws_ B_CHAR L_CHAR I_CHAR Z_CHAR Z_CHAR BLIZZARD } ;confusion @@ -456,7 +456,7 @@ MotionBlur1 = 21 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "C" "O" "N" "F" "S" CONFUSION } +ConditionValueC = {dws_ C_CHAR O_CHAR N_CHAR F_CHAR S_CHAR CONFUSION } ;phychic [FPA phy Begin@Reduce_move_anim_flashing_Psychic] @@ -468,7 +468,7 @@ MotionBlur1 = 21 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "P" "S" "Y" "C" "I" PSYCHIC_M } +ConditionValueC = {dws_ P_CHAR S_CHAR Y_CHAR C_CHAR I_CHAR PSYCHIC_M } [FPA phy End@Stop_reducing_move_anim_flashing_Psychic] Mode = 3 @@ -477,6 +477,6 @@ Address = {hex @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+5 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "P" "S" "Y" "C" "I" PSYCHIC_M } +ConditionValueC = {dws_ P_CHAR S_CHAR Y_CHAR C_CHAR I_CHAR PSYCHIC_M } From f023c68417ff0b14db1ab28ecff67f8d123ede44 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Fri, 27 Dec 2024 20:27:34 -0500 Subject: [PATCH 04/10] Use `EFFECT_1E` --- engine/battle/core.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 51d0c1b8..a951a072 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -4447,7 +4447,7 @@ CalculateDamage: ; Multi-hit attacks may or may not have 0 bp. cp TWO_TO_FIVE_ATTACKS_EFFECT jr z, .skipbp - cp $1e + cp EFFECT_1E jr z, .skipbp ; Calculate OHKO damage based on remaining HP. From 96fc617c69bca4fe717bd590e03bdd1fae1349e4 Mon Sep 17 00:00:00 2001 From: Engezerstorung <154867622+Engezerstorung@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:08:12 +0100 Subject: [PATCH 05/10] Correct wTileMapBackup declared space (#487) --- constants/gfx_constants.asm | 7 +++++++ engine/items/town_map.asm | 24 ++++++++++++------------ home/overworld.asm | 32 ++++++++++++++------------------ ram/wram.asm | 15 +++++++++++++-- 4 files changed, 46 insertions(+), 32 deletions(-) diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 79d9647f..08cf8dc7 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -10,6 +10,13 @@ DEF SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels DEF BG_MAP_WIDTH EQU 32 ; tiles DEF BG_MAP_HEIGHT EQU 32 ; tiles +DEF BLOCK_WIDTH EQU 4 ; tiles +DEF BLOCK_HEIGHT EQU BLOCK_WIDTH ; tiles +DEF SCREEN_BLOCK_WIDTH EQU 6 ; blocks +DEF SCREEN_BLOCK_HEIGHT EQU 5 ; blocks +DEF SURROUNDING_WIDTH EQU SCREEN_BLOCK_WIDTH * BLOCK_WIDTH ; tiles +DEF SURROUNDING_HEIGHT EQU SCREEN_BLOCK_HEIGHT * BLOCK_HEIGHT ; tiles + DEF SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE ; HP bar diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index 9c8aea39..cac6f2dd 100644 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -18,9 +18,9 @@ DisplayTownMap: hlcoord 1, 0 ld de, wNameBuffer call PlaceString - ld hl, wShadowOAM - ld de, wTileMapBackup - ld bc, $10 + ld hl, wShadowOAMSprite00 + ld de, wShadowOAMBackupSprite00 + ld bc, 4 * 4 call CopyData ld hl, vSprites tile BIRD_BASE_TILE ld de, TownMapCursor @@ -63,8 +63,8 @@ DisplayTownMap: ld de, wNameBuffer call PlaceString ld hl, wShadowOAMSprite04 - ld de, wTileMapBackup + 16 - ld bc, $10 + ld de, wShadowOAMBackupSprite04 + ld bc, 4 * 4 call CopyData .inputLoop call TownMapSpriteBlinkingAnimation @@ -366,8 +366,8 @@ DrawPlayerOrBirdSprite: cp "@" jr nz, .loop ld hl, wShadowOAM - ld de, wTileMapBackup - ld bc, $a0 + ld de, wShadowOAMBackup + ld bc, NUM_SPRITE_OAM_STRUCTS * 4 jp CopyData DisplayWildLocations: @@ -414,8 +414,8 @@ DisplayWildLocations: call DrawPlayerOrBirdSprite .done ld hl, wShadowOAM - ld de, wTileMapBackup - ld bc, $a0 + ld de, wShadowOAMBackup + ld bc, NUM_SPRITE_OAM_STRUCTS * 4 jp CopyData AreaUnknownText: @@ -602,15 +602,15 @@ TownMapSpriteBlinkingAnimation:: cp 50 jr nz, .done ; show sprites when the counter reaches 50 - ld hl, wTileMapBackup + ld hl, wShadowOAMBackup ld de, wShadowOAM - ld bc, $90 + ld bc, (NUM_SPRITE_OAM_STRUCTS - 4) * 4 call CopyData xor a jr .done .hideSprites ld hl, wShadowOAM - ld b, $24 + ld b, NUM_SPRITE_OAM_STRUCTS - 4 ld de, $4 .hideSpritesLoop ld [hl], $a0 diff --git a/home/overworld.asm b/home/overworld.asm index 80638815..9ca60c48 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1357,12 +1357,12 @@ LoadCurrentMapView:: ld e, a ld a, [wCurrentTileBlockMapViewPointer + 1] ld d, a - ld hl, wTileMapBackup - ld b, $05 + ld hl, wSurroundingTiles + ld b, SCREEN_BLOCK_HEIGHT .rowLoop ; each loop iteration fills in one row of tile blocks push hl push de - ld c, $06 + ld c, SCREEN_BLOCK_WIDTH .rowInnerLoop ; loop to draw each tile block of the current row push bc push de @@ -1391,7 +1391,7 @@ LoadCurrentMapView:: .noCarry ; update tile map pointer to next row's address pop hl - ld a, $60 + ld a, SURROUNDING_WIDTH * BLOCK_HEIGHT add l ld l, a jr nc, .noCarry2 @@ -1399,19 +1399,19 @@ LoadCurrentMapView:: .noCarry2 dec b jr nz, .rowLoop - ld hl, wTileMapBackup - ld bc, $0 + ld hl, wSurroundingTiles + ld bc, 0 .adjustForYCoordWithinTileBlock ld a, [wYBlockCoord] and a jr z, .adjustForXCoordWithinTileBlock - ld bc, $30 + ld bc, SURROUNDING_WIDTH * 2 add hl, bc .adjustForXCoordWithinTileBlock ld a, [wXBlockCoord] and a jr z, .copyToVisibleAreaBuffer - ld bc, $2 + ld bc, BLOCK_WIDTH / 2 add hl, bc .copyToVisibleAreaBuffer decoord 0, 0 ; base address for the tiles that are directly transferred to VRAM during V-blank @@ -1424,7 +1424,7 @@ LoadCurrentMapView:: inc de dec c jr nz, .rowInnerLoop2 - ld a, $04 + ld a, SURROUNDING_WIDTH - SCREEN_WIDTH add l ld l, a jr nc, .noCarry3 @@ -1755,7 +1755,7 @@ ScheduleColumnRedrawHelper:: ld a, [hl] ld [de], a inc de - ld a, 19 + ld a, SCREEN_WIDTH - 1 add l ld l, a jr nc, .noCarry @@ -1796,22 +1796,18 @@ DrawTileBlock:: ld d, h ld e, l ; de = address of the tile block's tiles pop hl - ld c, $04 ; 4 loop iterations + ld c, BLOCK_HEIGHT ; 4 loop iterations .loop ; each loop iteration, write 4 tile numbers push bc +REPT BLOCK_WIDTH - 1 ld a, [de] ld [hli], a inc de - ld a, [de] - ld [hli], a - inc de - ld a, [de] - ld [hli], a - inc de +ENDR ld a, [de] ld [hl], a inc de - ld bc, $15 + ld bc, SURROUNDING_WIDTH - (BLOCK_WIDTH - 1) add hl, bc pop bc dec c diff --git a/ram/wram.asm b/ram/wram.asm index 66a2d332..06568710 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -161,6 +161,19 @@ UNION ; (e.g. if menus are drawn on top) wTileMapBackup:: ds SCREEN_WIDTH * SCREEN_HEIGHT +NEXTU +; buffer for the blocks surrounding the player (6 columns by 5 rows of 4x4-tile blocks) +wSurroundingTiles:: ds SURROUNDING_WIDTH * SURROUNDING_HEIGHT + +NEXTU +; buffer for temporarily saving and restoring shadow OAM +wShadowOAMBackup:: +; wShadowOAMBackupSprite00 - wShadowOAMBackupSprite39 +FOR n, NUM_SPRITE_OAM_STRUCTS +wShadowOAMBackupSprite{02d:n}:: sprite_oam_struct wShadowOAMBackupSprite{02d:n} +ENDR +wShadowOAMBackupEnd:: + NEXTU ; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer wSerialPartyMonsPatchList:: ds 200 @@ -169,8 +182,6 @@ wSerialPartyMonsPatchList:: ds 200 wSerialEnemyMonsPatchList:: ds 200 ENDU - ds 80 - SECTION "Overworld Map", WRAM0 From b708f7e7f0e802631d6e79c53380597c9e1cfad5 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Tue, 28 Jan 2025 12:46:28 -0500 Subject: [PATCH 06/10] Comment on size of union --- ram/wram.asm | 1 + 1 file changed, 1 insertion(+) diff --git a/ram/wram.asm b/ram/wram.asm index 06568710..aa36c188 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -156,6 +156,7 @@ SECTION "Tilemap", WRAM0 ; buffer for tiles that are visible on screen (20 columns by 18 rows) wTileMap:: ds SCREEN_WIDTH * SCREEN_HEIGHT +; This union spans 480 bytes. UNION ; buffer for temporarily saving and restoring current screen's tiles ; (e.g. if menus are drawn on top) From afb899016938d03911eaafb85c7caa1c67680210 Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Tue, 28 Jan 2025 23:31:15 -0500 Subject: [PATCH 07/10] Miscellaneous cleanup (#488) Co-authored-by: SatoMew --- data/predef_pointers.asm | 2 +- engine/battle/animations.asm | 4 ++-- engine/battle/core.asm | 1 + engine/battle/trainer_ai.asm | 4 ++-- engine/debug/debug_party.asm | 9 +++++---- engine/events/evolve_trade.asm | 4 ++-- engine/events/hidden_objects/vermilion_gym_trash.asm | 2 +- engine/events/in_game_trades.asm | 2 +- engine/items/item_effects.asm | 12 ++++++------ engine/link/cable_club.asm | 6 +++--- engine/movie/intro.asm | 12 ++++++++---- engine/movie/title.asm | 2 +- engine/pokemon/evos_moves.asm | 4 +++- engine/slots/slot_machine.asm | 4 ++-- home/pokemon.asm | 6 +++++- home/text.asm | 2 +- home/yes_no.asm | 2 +- scripts/HallOfFame.asm | 2 +- 18 files changed, 46 insertions(+), 34 deletions(-) diff --git a/data/predef_pointers.asm b/data/predef_pointers.asm index e960d49b..ebf81847 100644 --- a/data/predef_pointers.asm +++ b/data/predef_pointers.asm @@ -61,7 +61,7 @@ PredefPointers:: add_predef BattleTransition add_predef CopyTileIDsFromList add_predef PlayIntro - add_predef GetMoveSoundB + add_predef GetIntroMoveSound add_predef FlashScreen add_predef GetTileAndCoordsInFrontOfPlayer add_predef StatusScreen diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 83f30ee2..a6d12012 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -2187,8 +2187,8 @@ AnimCopyRowRight: jr nz, AnimCopyRowRight ret -; get the sound of the move id in b -GetMoveSoundB: +; only used by the unreferenced PlayIntroMoveSound +GetIntroMoveSound: ld a, b call GetMoveSound ld b, a diff --git a/engine/battle/core.asm b/engine/battle/core.asm index a951a072..4e68b5c5 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2015,6 +2015,7 @@ DisplayBattleMenu:: call DisplayTextBoxID ; handle menu input if it's not the old man tutorial ld a, [wBattleType] + ASSERT BATTLE_TYPE_OLD_MAN == 1 dec a jp nz, .handleBattleMenuInput ; the following happens for the old man tutorial diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index ccd4e804..6092fc8e 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -635,7 +635,7 @@ AICureStatus: res BADLY_POISONED, [hl] ret -AIUseXAccuracy: ; unused +AIUseXAccuracy: ; unreferenced call AIPlayRestoringSFX ld hl, wEnemyBattleStatus2 set USING_X_ACCURACY, [hl] @@ -649,7 +649,7 @@ AIUseGuardSpec: ld a, GUARD_SPEC jp AIPrintItemUse -AIUseDireHit: ; unused +AIUseDireHit: ; unreferenced call AIPlayRestoringSFX ld hl, wEnemyBattleStatus2 set GETTING_PUMPED, [hl] diff --git a/engine/debug/debug_party.asm b/engine/debug/debug_party.asm index c16fe97b..e51f0697 100644 --- a/engine/debug/debug_party.asm +++ b/engine/debug/debug_party.asm @@ -92,7 +92,7 @@ IF DEF(_DEBUG) ; Get some debug items. ld hl, wNumBagItems - ld de, DebugItemsList + ld de, DebugNewGameItemsList .items_loop ld a, [de] cp -1 @@ -116,9 +116,10 @@ IF DEF(_DEBUG) ; Rival chose Squirtle, ; Player chose Charmander. ld hl, wRivalStarter + ASSERT wRivalStarter + 2 == wPlayerStarter ld a, STARTER2 ld [hli], a - inc hl ; hl = wPlayerStarter + inc hl ld a, STARTER1 ld [hl], a @@ -134,7 +135,7 @@ DebugSetPokedexEntries: ld [hl], %01111111 ret -DebugItemsList: +DebugNewGameItemsList: db BICYCLE, 1 db FULL_RESTORE, 99 db FULL_HEAL, 99 @@ -148,7 +149,7 @@ DebugItemsList: db LIFT_KEY, 1 db -1 ; end -DebugUnusedList: +DebugUnusedList: ; unreferenced db -1 ; end ELSE ret diff --git a/engine/events/evolve_trade.asm b/engine/events/evolve_trade.asm index 56069fac..8daf2b05 100644 --- a/engine/events/evolve_trade.asm +++ b/engine/events/evolve_trade.asm @@ -1,4 +1,4 @@ -EvolveTradeMon: +InGameTrade_CheckForTradeEvo: ; Verify the TradeMon's species name before ; attempting to initiate a trade evolution. @@ -34,7 +34,7 @@ EvolveTradeMon: ld a, [wPartyCount] dec a ld [wWhichPokemon], a - ld a, $1 + ld a, TRUE ld [wForceEvolution], a ld a, LINK_STATE_TRADING ld [wLinkState], a diff --git a/engine/events/hidden_objects/vermilion_gym_trash.asm b/engine/events/hidden_objects/vermilion_gym_trash.asm index 92fb1406..28cb15a6 100644 --- a/engine/events/hidden_objects/vermilion_gym_trash.asm +++ b/engine/events/hidden_objects/vermilion_gym_trash.asm @@ -47,7 +47,7 @@ GymTrashScript: add hl, de ld a, [hli] -; There is a bug in this code. It should calculate a value in the range [0, 3] +; Bug: This code should calculate a value in the range [0, 3], ; but if the mask and random number don't have any 1 bits in common, then ; the result of the AND will be 0. When 1 is subtracted from that, the value ; will become $ff. This will result in 255 being added to hl, which will cause diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm index ce4ffe3c..228c6bf8 100644 --- a/engine/events/in_game_trades.asm +++ b/engine/events/in_game_trades.asm @@ -137,7 +137,7 @@ InGameTrade_DoTrade: ld [wMonDataLocation], a call AddPartyMon call InGameTrade_CopyDataToReceivedMon - callfar EvolveTradeMon + callfar InGameTrade_CheckForTradeEvo call ClearScreen call InGameTrade_RestoreScreen farcall RedrawMapView diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 9643412c..6c87bde0 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -468,7 +468,7 @@ ItemUseBall: push hl -; If the Pokémon is transformed, the Pokémon is assumed to be a Ditto. +; Bug: If the Pokémon is transformed, the Pokémon is assumed to be a Ditto. ; This is a bug because a wild Pokémon could have used Transform via ; Mirror Move even though the only wild Pokémon that knows Transform is Ditto. ld hl, wEnemyBattleStatus3 @@ -774,7 +774,7 @@ ItemUseEvoStone: jr c, .canceledItemUse ld a, b ld [wCurPartySpecies], a - ld a, $01 + ld a, TRUE ld [wForceEvolution], a ld a, SFX_HEAL_AILMENT call PlaySoundWaitForCurrent @@ -2077,10 +2077,10 @@ ItemUsePPRestore: ret .fullyRestorePP ld a, [hl] ; move PP -; Note that this code has a bug. It doesn't mask out the upper two bits, which -; are used to count how many PP Ups have been used on the move. So, Max Ethers -; and Max Elixirs will not be detected as having no effect on a move with full -; PP if the move has had any PP Ups used on it. +; Bug: This code doesn't mask out the upper two bits, which are used to count +; how many PP Ups have been used on the move. +; So, Max Ethers and Max Elixirs will not be detected as having no effect on +; a move with full PP if the move has had any PP Ups used on it. cp b ; does current PP equal max PP? ret z jr .storeNewAmount diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index 92a1b596..2bf36f18 100644 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -57,8 +57,8 @@ CableClub_DoBattleOrTradeAgain: ld [hli], a dec b jr nz, .zeroPlayerDataPatchListLoop - ld hl, wGrassRate - ld bc, wTrainerHeaderPtr - wGrassRate + ld hl, wLinkEnemyTrainerName + ld bc, wTrainerHeaderPtr - wLinkEnemyTrainerName .zeroEnemyPartyLoop xor a ld [hli], a @@ -818,7 +818,7 @@ TradeCenter_Trade: ld a, [wPartyCount] dec a ld [wWhichPokemon], a - ld a, $1 + ld a, TRUE ld [wForceEvolution], a ld a, [wTradingWhichEnemyMon] ld hl, wEnemyPartySpecies diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 552b1358..facbfbaf 100644 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -275,9 +275,8 @@ CopyTileIDsFromList_ZeroBaseTileID: ld c, 0 predef_jump CopyTileIDsFromList -PlayMoveSoundB: -; unused - predef GetMoveSoundB +PlayIntroMoveSound: ; unreferenced + predef GetIntroMoveSound ld a, b jp PlaySound @@ -325,6 +324,7 @@ PlayShootingStar: call DelayFrames farcall AnimateShootingStar push af + ; A `call LoadPresentsGraphic` here was removed in localization pop af jr c, .next ; skip the delay if the user interrupted the animation ld c, 40 @@ -356,7 +356,11 @@ IntroDrawBlackBars: ld c, BG_MAP_WIDTH * 4 jp IntroPlaceBlackTiles -EmptyFunc2: +LoadPresentsGraphic: ; unreferenced + ; This routine loaded the "PRESENTS" text graphic (tiles + ; $67, $68, $69, $6A, $6B, and $6C from gamefreak_presents.2bpp) + ; at coordinates (11, 7) in the Japanese versions. + ; It was dummied out in the English localization. ret IntroNidorinoAnimation0: diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 3c7ca27d..77e4ac38 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -1,4 +1,4 @@ -CopyDebugName: ; unused +CopyDebugName: ld bc, NAME_LENGTH jp CopyData diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index 268e522a..be23f508 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -94,8 +94,10 @@ Evolution_PartyMonLoop: ; loop over party mons jr .doEvolution .checkItemEvo ld a, [hli] + ; Bug: Wild encounters can cause stone evolutions without + ; having any stones available. This was fixed in Yellow. ld b, a ; evolution item - ld a, [wCurItem] + ld a, [wCurItem] ; same as [wCurPartySpecies] cp b ; was the evolution item in this entry used? jp nz, .nextEvoEntry1 ; if not, go to the next evolution entry .checkLevel diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index 1ed24a1a..ec72b79a 100644 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -298,8 +298,8 @@ SlotMachine_StopWheel1Early: cp HIGH(SLOTSCHERRY) jr nz, .stopWheel ret -; It looks like this was intended to make the wheel stop when a 7 symbol was -; visible, but it has a bug and so the wheel stops randomly. +; Bug: This looks intended to make the wheel stop when a +; 7 symbol was visible, but instead the wheel stops randomly. .sevenAndBarMode ld c, $3 .loop diff --git a/home/pokemon.asm b/home/pokemon.asm index 7cc5f2d1..afa0d129 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -114,7 +114,11 @@ LoadFrontSpriteByMonIndex:: cp NUM_POKEMON + 1 jr c, .validDexNumber ; dex >#151 invalid .invalidDexNumber - ld a, RHYDON ; $1 + ; This is the so-called "Rhydon trap" or "Rhydon glitch" + ; to fail-safe invalid dex numbers + ; (see https://glitchcity.wiki/wiki/Rhydon_trap + ; or https://bulbapedia.bulbagarden.net/wiki/Rhydon_glitch) + ld a, RHYDON ld [wCurPartySpecies], a ret .validDexNumber diff --git a/home/text.asm b/home/text.asm index da884125..112956da 100644 --- a/home/text.asm +++ b/home/text.asm @@ -111,7 +111,7 @@ NextChar:: inc de jp PlaceNextChar -NullChar:: ; unused +NullChar:: ld b, h ld c, l pop hl diff --git a/home/yes_no.asm b/home/yes_no.asm index 3f5a5a45..8d995832 100644 --- a/home/yes_no.asm +++ b/home/yes_no.asm @@ -26,7 +26,7 @@ YesNoChoicePokeCenter:: lb bc, 8, 12 jr DisplayYesNoChoice -WideYesNoChoice:: ; unused +WideYesNoChoice:: ; unreferenced call SaveScreenTilesToBuffer1 ld a, WIDE_YES_NO_MENU ld [wTwoOptionMenuID], a diff --git a/scripts/HallOfFame.asm b/scripts/HallOfFame.asm index ed3d2a73..91be3996 100644 --- a/scripts/HallOfFame.asm +++ b/scripts/HallOfFame.asm @@ -33,7 +33,7 @@ HallOfFameResetEventsAndSaveScript: res BIT_NO_MAP_MUSIC, [hl] assert wStatusFlags7 + 1 == wElite4Flags inc hl - set BIT_UNUSED_BEAT_ELITE_4, [hl] ; debug, unused? + set BIT_UNUSED_BEAT_ELITE_4, [hl] ; unused xor a ; SCRIPT_*_DEFAULT ld hl, wLoreleisRoomCurScript ld [hli], a ; wLoreleisRoomCurScript From ec37f6117da6c550e70f466118731e8f752e3afb Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Tue, 28 Jan 2025 23:31:27 -0500 Subject: [PATCH 08/10] Consistently capitalize `ASSERT` directives (#489) --- data/moves/moves.asm | 2 +- engine/battle/core.asm | 4 ++-- engine/battle/effects.asm | 4 ++-- engine/events/poison.asm | 2 +- engine/items/item_effects.asm | 2 +- engine/items/town_map.asm | 2 +- engine/menus/main_menu.asm | 14 +++++++------- engine/movie/oak_speech/init_player_data.asm | 2 +- engine/movie/title.asm | 4 ++-- engine/overworld/player_state.asm | 2 +- engine/pokemon/evos_moves.asm | 2 +- engine/slots/slot_machine.asm | 2 +- home/list_menu.asm | 4 ++-- home/text_script.asm | 2 +- scripts/HallOfFame.asm | 2 +- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/data/moves/moves.asm b/data/moves/moves.asm index f435ab6b..ac638721 100644 --- a/data/moves/moves.asm +++ b/data/moves/moves.asm @@ -5,7 +5,7 @@ MACRO move db \4 ; type db \5 percent ; accuracy db \6 ; pp - assert \6 <= 40, "PP must be 40 or less" + ASSERT \6 <= 40, "PP must be 40 or less" ENDM Moves: diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 4e68b5c5..f304af10 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -5157,7 +5157,7 @@ MetronomePickMove: and a jr z, .pickMoveLoop cp STRUGGLE - assert NUM_ATTACKS == STRUGGLE ; random numbers greater than STRUGGLE are not moves + ASSERT NUM_ATTACKS == STRUGGLE ; random numbers greater than STRUGGLE are not moves jr nc, .pickMoveLoop cp METRONOME jr z, .pickMoveLoop @@ -6755,7 +6755,7 @@ HandleExplodingAnimation: ret nz ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT ld [wAnimationType], a - assert ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH + ASSERT ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH ; ld a, MEGA_PUNCH ; fallthrough PlayMoveAnimation: diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index 47b13311..439e41e2 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -216,8 +216,8 @@ FreezeBurnParalyzeEffect: jr c, .regular_effectiveness ; extra effectiveness ld b, 30 percent + 1 - assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 - assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1 + ASSERT PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 + ASSERT PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1 sub PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 ; treat extra effective as regular from now on .regular_effectiveness push af diff --git a/engine/events/poison.asm b/engine/events/poison.asm index c0b4a18f..beb1a312 100644 --- a/engine/events/poison.asm +++ b/engine/events/poison.asm @@ -1,6 +1,6 @@ ApplyOutOfBattlePoisonDamage: ld a, [wStatusFlags5] - assert BIT_SCRIPTED_MOVEMENT_STATE == 7 + ASSERT BIT_SCRIPTED_MOVEMENT_STATE == 7 add a ; overflows scripted movement state bit into carry flag jp c, .noBlackOut ; no black out if joypad states are being simulated ld a, [wPartyCount] diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 6c87bde0..162e79a7 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -2512,7 +2512,7 @@ GetMaxPP: and %11000000 ; get PP Up count pop bc or b ; place normal max PP in 6 lower bits of a - assert wMoveData + MOVE_PP + 1 == wPPUpCountAndMaxPP + ASSERT wMoveData + MOVE_PP + 1 == wPPUpCountAndMaxPP ld h, d ld l, e inc hl ; hl = wPPUpCountAndMaxPP diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index cac6f2dd..18903294 100644 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -212,7 +212,7 @@ LoadTownMap_Fly:: ld [wDestinationMap], a ld hl, wStatusFlags6 set BIT_FLY_WARP, [hl] - assert wStatusFlags6 + 1 == wStatusFlags7 + ASSERT wStatusFlags6 + 1 == wStatusFlags7 inc hl set BIT_USED_FLY, [hl] .pressedB diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 60bcfcbd..4b430f6a 100644 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -155,21 +155,21 @@ LinkMenu: ld hl, wTopMenuItemY ld a, 7 ld [hli], a - assert wTopMenuItemY + 1 == wTopMenuItemX + ASSERT wTopMenuItemY + 1 == wTopMenuItemX ld a, 6 ld [hli], a - assert wTopMenuItemX + 1 == wCurrentMenuItem + ASSERT wTopMenuItemX + 1 == wCurrentMenuItem xor a ld [hli], a inc hl - assert wCurrentMenuItem + 2 == wMaxMenuItem + ASSERT wCurrentMenuItem + 2 == wMaxMenuItem ld a, 2 ld [hli], a - assert wMaxMenuItem + 1 == wMenuWatchedKeys - assert 2 + 1 == A_BUTTON | B_BUTTON + ASSERT wMaxMenuItem + 1 == wMenuWatchedKeys + ASSERT 2 + 1 == A_BUTTON | B_BUTTON inc a ld [hli], a - assert wMenuWatchedKeys + 1 == wLastMenuItem + ASSERT wMenuWatchedKeys + 1 == wLastMenuItem xor a ld [hl], a .waitForInputLoop @@ -468,7 +468,7 @@ DisplayOptionMenu: xor a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - assert BIT_FAST_TEXT_DELAY == 0 + ASSERT BIT_FAST_TEXT_DELAY == 0 inc a ; 1 << BIT_FAST_TEXT_DELAY ld [wLetterPrintingDelayFlags], a ld [wOptionsCancelCursorX], a diff --git a/engine/movie/oak_speech/init_player_data.asm b/engine/movie/oak_speech/init_player_data.asm index 6b0a1a11..843eb96e 100644 --- a/engine/movie/oak_speech/init_player_data.asm +++ b/engine/movie/oak_speech/init_player_data.asm @@ -34,7 +34,7 @@ DEF START_MONEY EQU $3000 ld hl, wObtainedBadges ld [hli], a - assert wObtainedBadges + 1 == wUnusedObtainedBadges + ASSERT wObtainedBadges + 1 == wUnusedObtainedBadges ld [hl], a ld hl, wPlayerCoins diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 77e4ac38..bad1df92 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -17,9 +17,9 @@ PrepareTitleScreen:: ld [wLetterPrintingDelayFlags], a ld hl, wStatusFlags6 ld [hli], a - assert wStatusFlags6 + 1 == wStatusFlags7 + ASSERT wStatusFlags6 + 1 == wStatusFlags7 ld [hli], a - assert wStatusFlags7 + 1 == wElite4Flags + ASSERT wStatusFlags7 + 1 == wElite4Flags ld [hl], a ld a, BANK(Music_TitleScreen) ld [wAudioROMBank], a diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm index 4da437da..a5d3ee3e 100644 --- a/engine/overworld/player_state.asm +++ b/engine/overworld/player_state.asm @@ -403,7 +403,7 @@ CheckForBoulderCollisionWithSprites: ld a, [hli] ld b, a ldh a, [hPlayerFacing] - assert BIT_FACING_DOWN == 0 + ASSERT BIT_FACING_DOWN == 0 rrca jr c, .pushingDown ; pushing up diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index be23f508..afae4396 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -262,7 +262,7 @@ Evolution_PartyMonLoop: ; loop over party mons RenameEvolvedMon: ; Renames the mon to its new, evolved form's standard name unless it had a ; nickname, in which case the nickname is kept. - assert wCurSpecies == wNameListIndex ; save+restore wCurSpecies while using wNameListIndex + ASSERT wCurSpecies == wNameListIndex ; save+restore wCurSpecies while using wNameListIndex ld a, [wCurSpecies] push af ld a, [wMonHIndex] diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index ec72b79a..48cf27de 100644 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -1,7 +1,7 @@ PromptUserToPlaySlots: call SaveScreenTilesToBuffer2 ld a, BANK(DisplayTextIDInit) - assert BANK(DisplayTextIDInit) == 1 << BIT_NO_AUTO_TEXT_BOX + ASSERT BANK(DisplayTextIDInit) == 1 << BIT_NO_AUTO_TEXT_BOX ld [wAutoTextBoxDrawingControl], a ; 1 << BIT_NO_AUTO_TEXT_BOX ld b, a ; BANK(DisplayTextIDInit) ld hl, DisplayTextIDInit diff --git a/home/list_menu.asm b/home/list_menu.asm index f04684a3..646e7b7f 100644 --- a/home/list_menu.asm +++ b/home/list_menu.asm @@ -129,7 +129,7 @@ DisplayListMenuIDLoop:: and a ; PCPOKEMONLISTMENU? jr z, .pokemonList ; if it's an item menu - assert wCurListMenuItem == wCurItem + ASSERT wCurListMenuItem == wCurItem push hl call GetItemPrice pop hl @@ -147,7 +147,7 @@ DisplayListMenuIDLoop:: call GetName jr .storeChosenEntry .pokemonList - assert wCurListMenuItem == wCurPartySpecies + ASSERT wCurListMenuItem == wCurPartySpecies ld hl, wPartyCount ld a, [wListPointer] cp l ; is it a list of party pokemon or box pokemon? diff --git a/home/text_script.asm b/home/text_script.asm index c1606371..f3015b66 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -1,7 +1,7 @@ ; this function is used to display sign messages, sprite dialog, etc. ; INPUT: [hSpriteIndex] = sprite ID or [hTextID] = text ID DisplayTextID:: - assert hSpriteIndex == hTextID ; these are at the same memory location + ASSERT hSpriteIndex == hTextID ; these are at the same memory location ldh a, [hLoadedROMBank] push af farcall DisplayTextIDInit ; initialization diff --git a/scripts/HallOfFame.asm b/scripts/HallOfFame.asm index 91be3996..c6ecf4ec 100644 --- a/scripts/HallOfFame.asm +++ b/scripts/HallOfFame.asm @@ -31,7 +31,7 @@ HallOfFameResetEventsAndSaveScript: ld [wLetterPrintingDelayFlags], a ld hl, wStatusFlags7 res BIT_NO_MAP_MUSIC, [hl] - assert wStatusFlags7 + 1 == wElite4Flags + ASSERT wStatusFlags7 + 1 == wElite4Flags inc hl set BIT_UNUSED_BEAT_ELITE_4, [hl] ; unused xor a ; SCRIPT_*_DEFAULT From 79518a602e6241ff6bd6e905fabaf644680f7469 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Thu, 30 Jan 2025 22:13:40 +0000 Subject: [PATCH 09/10] Consistently refer to CGB, not GBC (#491) --- constants/hardware_constants.asm | 6 ++++-- engine/gfx/palettes.asm | 16 ++++++++-------- home/start.asm | 8 ++++---- ram/wram.asm | 3 ++- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/constants/hardware_constants.asm b/constants/hardware_constants.asm index 005a6934..6c5d43c1 100644 --- a/constants/hardware_constants.asm +++ b/constants/hardware_constants.asm @@ -1,6 +1,8 @@ -; From http://nocash.emubase.de/pandocs.htm. +; Reference documents: +; https://gbdev.io/pandocs/ +; https://github.com/gbdev/hardware.inc -DEF GBC EQU $11 +DEF CGB EQU $11 ; MBC1 DEF MBC1SRamEnable EQU $0000 diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm index 05202079..f69eeba9 100644 --- a/engine/gfx/palettes.asm +++ b/engine/gfx/palettes.asm @@ -396,11 +396,11 @@ LoadSGB: ret nc ld a, 1 ld [wOnSGB], a - ld a, [wGBC] + ld a, [wOnCGB] and a - jr z, .notGBC + jr z, .notCGB ret -.notGBC +.notCGB di call PrepareSuperNintendoVRAMTransfer ei @@ -563,21 +563,21 @@ Wait7000: ret SendSGBPackets: - ld a, [wGBC] + ld a, [wOnCGB] and a - jr z, .notGBC + jr z, .notCGB push de - call InitGBCPalettes + call InitCGBPalettes pop hl call EmptyFunc3 ret -.notGBC +.notCGB push de call SendSGBPacket pop hl jp SendSGBPacket -InitGBCPalettes: +InitCGBPalettes: ld a, $80 ; index 0 with auto-increment ldh [rBGPI], a inc hl diff --git a/home/start.asm b/home/start.asm index 764f9468..5e301da2 100644 --- a/home/start.asm +++ b/home/start.asm @@ -1,10 +1,10 @@ _Start:: - cp GBC - jr z, .gbc + cp CGB + jr z, .cgb xor a jr .ok -.gbc +.cgb ld a, FALSE .ok - ld [wGBC], a + ld [wOnCGB], a jp Init diff --git a/ram/wram.asm b/ram/wram.asm index aa36c188..e7d35f96 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -1029,7 +1029,8 @@ wScriptedNPCWalkCounter:: db ds 1 -wGBC:: db +; always 0 since full CGB support was not implemented +wOnCGB:: db ; if running on SGB, it's 1, else it's 0 wOnSGB:: db From 43f21cc4948682b51b4c72bcef38631f95b47bfe Mon Sep 17 00:00:00 2001 From: Narishma-gb <194818981+Narishma-gb@users.noreply.github.com> Date: Thu, 30 Jan 2025 23:26:55 +0100 Subject: [PATCH 10/10] Fix some label typos, and add some constants instead of raw numbers (#492) --- data/maps/objects/Route3.asm | 2 +- data/maps/objects/TradeCenter.asm | 2 +- engine/battle/animations.asm | 8 ++--- engine/overworld/trainer_sight.asm | 10 +++---- macros/scripts/maps.asm | 4 +-- scripts/ChampionsRoom.asm | 2 +- scripts/PokemonTower6F.asm | 2 +- scripts/RocketHideoutB2F.asm | 14 ++++----- scripts/RocketHideoutB4F.asm | 48 +++++++++++++++--------------- scripts/RocketHideoutElevator.asm | 4 +-- scripts/Route8.asm | 6 ++-- scripts/SilphCo6F.asm | 10 +++---- scripts/SilphCo7F.asm | 2 +- text/RocketHideoutB2F.asm | 6 ++-- text/RocketHideoutB4F.asm | 18 +++++------ text/Route8.asm | 2 +- text/SilphCo6F.asm | 4 +-- 17 files changed, 72 insertions(+), 72 deletions(-) diff --git a/data/maps/objects/Route3.asm b/data/maps/objects/Route3.asm index ce7224b5..6f491468 100644 --- a/data/maps/objects/Route3.asm +++ b/data/maps/objects/Route3.asm @@ -15,7 +15,7 @@ Route3_Object: def_warp_events def_bg_events - bg_event 59, 9, 10 ; Route3SignText + bg_event 59, 9, TEXT_ROUTE3_SIGN def_object_events object_event 57, 11, SPRITE_SUPER_NERD, STAY, NONE, TEXT_ROUTE3_SUPER_NERD diff --git a/data/maps/objects/TradeCenter.asm b/data/maps/objects/TradeCenter.asm index 74613f9a..cfa1fe0b 100644 --- a/data/maps/objects/TradeCenter.asm +++ b/data/maps/objects/TradeCenter.asm @@ -9,6 +9,6 @@ TradeCenter_Object: def_bg_events def_object_events - object_event 2, 2, SPRITE_RED, STAY, 0, TEXT_TRADECENTER_OPPONENT + object_event 2, 2, SPRITE_RED, STAY, ANY_DIR, TEXT_TRADECENTER_OPPONENT def_warps_to TRADE_CENTER diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index a6d12012..ce6c6d5d 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -1935,7 +1935,7 @@ AnimationSubstitute: ; Changes the pokemon's sprite to the mini sprite ld hl, wTempPic xor a - ld bc, $310 + ld bc, 7 * 7 tiles call FillMemory ldh a, [hWhoseTurn] and a @@ -2120,7 +2120,7 @@ GetMonSpriteTileMapPointerFromRowCount: ldh a, [hWhoseTurn] and a jr nz, .enemyTurn - ld a, 20 * 5 + 1 + ld a, 5 * SCREEN_WIDTH + 1 jr .next .enemyTurn ld a, 12 @@ -2133,7 +2133,7 @@ GetMonSpriteTileMapPointerFromRowCount: sub b and a jr z, .done - ld de, 20 + ld de, SCREEN_WIDTH .loop add hl, de dec a @@ -2294,7 +2294,7 @@ CopyTileIDs: dec c jr nz, .columnLoop pop hl - ld bc, 20 + ld bc, SCREEN_WIDTH add hl, bc pop bc dec b diff --git a/engine/overworld/trainer_sight.asm b/engine/overworld/trainer_sight.asm index f32b558a..da845fda 100644 --- a/engine/overworld/trainer_sight.asm +++ b/engine/overworld/trainer_sight.asm @@ -97,8 +97,8 @@ TrainerWalkUpToPlayer:: swap a dec a ld c, a ; bc = steps yet to go to reach player - xor a - ld b, a ; a = direction to go to + xor a ; NPC_MOVEMENT_DOWN + ld b, a jr .writeWalkScript .facingUp ld a, [wTrainerScreenY] @@ -111,7 +111,7 @@ TrainerWalkUpToPlayer:: dec a ld c, a ; bc = steps yet to go to reach player ld b, $0 - ld a, $40 ; a = direction to go to + ld a, NPC_MOVEMENT_UP jr .writeWalkScript .facingRight ld a, [wTrainerScreenX] @@ -124,7 +124,7 @@ TrainerWalkUpToPlayer:: dec a ld c, a ; bc = steps yet to go to reach player ld b, $0 - ld a, $c0 ; a = direction to go to + ld a, NPC_MOVEMENT_RIGHT jr .writeWalkScript .facingLeft ld a, [wTrainerScreenX] @@ -137,7 +137,7 @@ TrainerWalkUpToPlayer:: dec a ld c, a ; bc = steps yet to go to reach player ld b, $0 - ld a, $80 ; a = direction to go to + ld a, NPC_MOVEMENT_LEFT .writeWalkScript ld hl, wNPCMovementDirections2 ld de, wNPCMovementDirections2 diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm index c5f0d1d0..b5799e64 100644 --- a/macros/scripts/maps.asm +++ b/macros/scripts/maps.asm @@ -106,8 +106,8 @@ ENDM ;\1 event flag ;\2 view range ;\3 TextBeforeBattle -;\4 TextAfterBattle -;\5 TextEndBattle +;\4 TextEndBattle +;\5 TextAfterBattle MACRO trainer DEF _ev_bit = \1 % 8 DEF _cur_bit = CURRENT_TRAINER_BIT % 8 diff --git a/scripts/ChampionsRoom.asm b/scripts/ChampionsRoom.asm index 46814138..4d8a218b 100644 --- a/scripts/ChampionsRoom.asm +++ b/scripts/ChampionsRoom.asm @@ -5,7 +5,7 @@ ChampionsRoom_Script: jp CallFunctionInTable ResetRivalScript: - xor a ; SCENE_CHAMPIONSROOM_DEFAULT + xor a ; SCRIPT_CHAMPIONSROOM_DEFAULT ld [wJoyIgnore], a ld [wChampionsRoomCurScript], a ret diff --git a/scripts/PokemonTower6F.asm b/scripts/PokemonTower6F.asm index cf246c56..251b3759 100644 --- a/scripts/PokemonTower6F.asm +++ b/scripts/PokemonTower6F.asm @@ -74,7 +74,7 @@ PokemonTower6FMarowakBattleScript: .did_not_defeat ld a, $1 ld [wSimulatedJoypadStatesIndex], a - ld a, $10 + ld a, D_RIGHT ld [wSimulatedJoypadStatesEnd], a xor a ld [wSpritePlayerStateData2MovementByte1], a diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 7a5c2e4a..0df2f06a 100644 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -281,7 +281,7 @@ RocketHideoutB2F_TextPointers: RocketHideout2TrainerHeaders: def_trainers RocketHideout2TrainerHeader0: - trainer EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0, 4, RocketHideoutB1FRocketBattleText, RocketHideoutB1FRocketEndBattleText, RocketHideoutB1FRocketAfterBattleText + trainer EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0, 4, RocketHideoutB2FRocketBattleText, RocketHideoutB2FRocketEndBattleText, RocketHideoutB2FRocketAfterBattleText db -1 ; end RocketHideoutB2FRocketText: @@ -290,14 +290,14 @@ RocketHideoutB2FRocketText: call TalkToTrainer jp TextScriptEnd -RocketHideoutB1FRocketBattleText: - text_far _RocketHideoutB1FRocketBattleText +RocketHideoutB2FRocketBattleText: + text_far _RocketHideoutB2FRocketBattleText text_end -RocketHideoutB1FRocketEndBattleText: - text_far _RocketHideoutB1FRocketEndBattleText +RocketHideoutB2FRocketEndBattleText: + text_far _RocketHideoutB2FRocketEndBattleText text_end -RocketHideoutB1FRocketAfterBattleText: - text_far _RocketHideoutB1FRocketAfterBattleText +RocketHideoutB2FRocketAfterBattleText: + text_far _RocketHideoutB2FRocketAfterBattleText text_end diff --git a/scripts/RocketHideoutB4F.asm b/scripts/RocketHideoutB4F.asm index 2c630067..a8445db3 100644 --- a/scripts/RocketHideoutB4F.asm +++ b/scripts/RocketHideoutB4F.asm @@ -89,11 +89,11 @@ RocketHideoutB4F_TextPointers: RocketHideout4TrainerHeaders: def_trainers 2 RocketHideout4TrainerHeader0: - trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0, 0, RocketHideoutB4FGiovanniBattleText, RocketHideoutB4FGiovanniEndBattleText, RocketHideoutB4FGiovanniAfterBattleText + trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0, 0, RocketHideoutB4FRocket1BattleText, RocketHideoutB4FRocket1EndBattleText, RocketHideoutB4FRocket1AfterBattleText RocketHideout4TrainerHeader1: - trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1, 0, RocketHideoutB4FRocket1BattleText, RocketHideoutB4FRocket1EndBattleText, RocketHideoutB4FRocket1AfterBattleText + trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1, 0, RocketHideoutB4FRocket2BattleText, RocketHideoutB4FRocket2EndBattleText, RocketHideoutB4FRocket2AfterBattleText RocketHideout4TrainerHeader2: - trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2, 1, RocketHideoutB4FRocket2BattleText, RocketHideoutB4FRocket2EndBattleText, RocketHideoutB4FRocket2AfterBattleText + trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2, 1, RocketHideoutB4FRocket3BattleText, RocketHideoutB4FRocket3EndBattleText, RocketHideoutB4FRocket3AfterBattleText db -1 ; end RocketHideoutB4FGiovanniText: @@ -142,24 +142,6 @@ RocketHideoutB4FRocket1Text: call TalkToTrainer jp TextScriptEnd -RocketHideoutB4FGiovanniBattleText: - text_far _RocketHideoutB4FGiovanniBattleText - text_end - -RocketHideoutB4FGiovanniEndBattleText: - text_far _RocketHideoutB4FGiovanniEndBattleText - text_end - -RocketHideoutB4FGiovanniAfterBattleText: - text_far _RocketHideoutB4FGiovanniAfterBattleText - text_end - -RocketHideoutB4FRocket2Text: - text_asm - ld hl, RocketHideout4TrainerHeader1 - call TalkToTrainer - jp TextScriptEnd - RocketHideoutB4FRocket1BattleText: text_far _RocketHideoutB4FRocket1BattleText text_end @@ -172,9 +154,9 @@ RocketHideoutB4FRocket1AfterBattleText: text_far _RocketHideoutB4FRocket1AfterBattleText text_end -RocketHideoutB4FRocket3Text: +RocketHideoutB4FRocket2Text: text_asm - ld hl, RocketHideout4TrainerHeader2 + ld hl, RocketHideout4TrainerHeader1 call TalkToTrainer jp TextScriptEnd @@ -187,6 +169,24 @@ RocketHideoutB4FRocket2EndBattleText: text_end RocketHideoutB4FRocket2AfterBattleText: + text_far _RocketHideoutB4FRocket2AfterBattleText + text_end + +RocketHideoutB4FRocket3Text: + text_asm + ld hl, RocketHideout4TrainerHeader2 + call TalkToTrainer + jp TextScriptEnd + +RocketHideoutB4FRocket3BattleText: + text_far _RocketHideoutB4FRocket3BattleText + text_end + +RocketHideoutB4FRocket3EndBattleText: + text_far _RocketHideoutB4FRocket3EndBattleText + text_end + +RocketHideoutB4FRocket3AfterBattleText: text_asm ld hl, .Text call PrintText @@ -199,5 +199,5 @@ RocketHideoutB4FRocket2AfterBattleText: jp TextScriptEnd .Text: - text_far _RocketHideoutB4FRocket2AfterBattleText + text_far _RocketHideoutB4FRocket3AfterBattleText text_end diff --git a/scripts/RocketHideoutElevator.asm b/scripts/RocketHideoutElevator.asm index bd6fb498..d1be4cfb 100644 --- a/scripts/RocketHideoutElevator.asm +++ b/scripts/RocketHideoutElevator.asm @@ -32,7 +32,7 @@ RocketHideoutElevatorStoreWarpEntriesScript: ret RocketHideoutElevatorScript: - ld hl, RocketHideoutElavatorFloors + ld hl, RocketHideoutElevatorFloors call LoadItemList ld hl, RocketHideoutElevatorWarpMaps ld de, wElevatorWarpMaps @@ -40,7 +40,7 @@ RocketHideoutElevatorScript: call CopyData ret -RocketHideoutElavatorFloors: +RocketHideoutElevatorFloors: db 3 ; # db FLOOR_B1F db FLOOR_B2F diff --git a/scripts/Route8.asm b/scripts/Route8.asm index 657d5c83..7b5476c9 100644 --- a/scripts/Route8.asm +++ b/scripts/Route8.asm @@ -35,7 +35,7 @@ Route8TrainerHeader1: Route8TrainerHeader2: trainer EVENT_BEAT_ROUTE_8_TRAINER_2, 4, Route8SuperNerd2BattleText, Route8SuperNerd2EndBattleText, Route8SuperNerd2AfterBattleText Route8TrainerHeader3: - trainer EVENT_BEAT_ROUTE_8_TRAINER_3, 2, Route8CooltrainerF1BattleText, Route8CooltrainerF21EndBattleText, Route8CooltrainerF1AfterBattleText + trainer EVENT_BEAT_ROUTE_8_TRAINER_3, 2, Route8CooltrainerF1BattleText, Route8CooltrainerF1EndBattleText, Route8CooltrainerF1AfterBattleText Route8TrainerHeader4: trainer EVENT_BEAT_ROUTE_8_TRAINER_4, 3, Route8SuperNerd3BattleText, Route8SuperNerd3EndBattleText, Route8SuperNerd3AfterBattleText Route8TrainerHeader5: @@ -112,8 +112,8 @@ Route8CooltrainerF1BattleText: text_far _Route8CooltrainerF1BattleText text_end -Route8CooltrainerF21EndBattleText: - text_far _Route8CooltrainerF21EndBattleText +Route8CooltrainerF1EndBattleText: + text_far _Route8CooltrainerF1EndBattleText text_end Route8CooltrainerF1AfterBattleText: diff --git a/scripts/SilphCo6F.asm b/scripts/SilphCo6F.asm index ad8e83f4..0352f5b4 100644 --- a/scripts/SilphCo6F.asm +++ b/scripts/SilphCo6F.asm @@ -56,7 +56,7 @@ SilphCo6F_TextPointers: SilphCo6TrainerHeaders: def_trainers 6 SilphCo6TrainerHeader0: - trainer EVENT_BEAT_SILPH_CO_6F_TRAINER_0, 2, SilphCo6FRocket1BattleText, SilphCo6Rocket1EndBattleText, SilphCo6Rocket1AfterBattleText + trainer EVENT_BEAT_SILPH_CO_6F_TRAINER_0, 2, SilphCo6FRocket1BattleText, SilphCo6FRocket1EndBattleText, SilphCo6FRocket1AfterBattleText SilphCo6TrainerHeader1: trainer EVENT_BEAT_SILPH_CO_6F_TRAINER_1, 3, SilphCo6FScientistBattleText, SilphCo6FScientistEndBattleText, SilphCo6FScientistAfterBattleText SilphCo6TrainerHeader2: @@ -158,12 +158,12 @@ SilphCo6FRocket1BattleText: text_far _SilphCo6FRocket1BattleText text_end -SilphCo6Rocket1EndBattleText: - text_far _SilphCo6Rocket1EndBattleText +SilphCo6FRocket1EndBattleText: + text_far _SilphCo6FRocket1EndBattleText text_end -SilphCo6Rocket1AfterBattleText: - text_far _SilphCo6Rocket1AfterBattleText +SilphCo6FRocket1AfterBattleText: + text_far _SilphCo6FRocket1AfterBattleText text_end SilphCo6FScientistText: diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm index bf517d29..358be537 100644 --- a/scripts/SilphCo7F.asm +++ b/scripts/SilphCo7F.asm @@ -310,7 +310,7 @@ SilphCo7FSilphWorkerM1Text: lb bc, LAPRAS, 15 call GivePokemon jr nc, .done - ld a, [wSimulatedJoypadStatesEnd] + ld a, [wAddedToParty] and a call z, WaitForTextScrollButtonPress call EnableAutoTextBoxDrawing diff --git a/text/RocketHideoutB2F.asm b/text/RocketHideoutB2F.asm index 4dffbc3b..5e25c935 100644 --- a/text/RocketHideoutB2F.asm +++ b/text/RocketHideoutB2F.asm @@ -1,15 +1,15 @@ -_RocketHideoutB1FRocketBattleText:: +_RocketHideoutB2FRocketBattleText:: text "BOSS said you can" line "see GHOSTs with" cont "the SILPH SCOPE!" done -_RocketHideoutB1FRocketEndBattleText:: +_RocketHideoutB2FRocketEndBattleText:: text "I" line "surrender!" prompt -_RocketHideoutB1FRocketAfterBattleText:: +_RocketHideoutB2FRocketAfterBattleText:: text "The TEAM ROCKET" line "HQ has 4 basement" cont "floors. Can you" diff --git a/text/RocketHideoutB4F.asm b/text/RocketHideoutB4F.asm index b105b32a..ae16eed7 100644 --- a/text/RocketHideoutB4F.asm +++ b/text/RocketHideoutB4F.asm @@ -26,49 +26,49 @@ _RocketHideoutB4FGiovanniHopeWeMeetAgainText:: line "again..." done -_RocketHideoutB4FGiovanniBattleText:: +_RocketHideoutB4FRocket1BattleText:: text "I know you! You" line "ruined our plans" cont "at MT.MOON!" done -_RocketHideoutB4FGiovanniEndBattleText:: +_RocketHideoutB4FRocket1EndBattleText:: text "Burned" line "again!" prompt -_RocketHideoutB4FGiovanniAfterBattleText:: +_RocketHideoutB4FRocket1AfterBattleText:: text "Do you have" line "something against" cont "TEAM ROCKET?" done -_RocketHideoutB4FRocket1BattleText:: +_RocketHideoutB4FRocket2BattleText:: text "How can you not" line "see the beauty of" cont "our evil?" done -_RocketHideoutB4FRocket1EndBattleText:: +_RocketHideoutB4FRocket2EndBattleText:: text "Ayaya!" prompt -_RocketHideoutB4FRocket1AfterBattleText:: +_RocketHideoutB4FRocket2AfterBattleText:: text "BOSS! I'm sorry I" line "failed you!" done -_RocketHideoutB4FRocket2BattleText:: +_RocketHideoutB4FRocket3BattleText:: text "The elevator" line "doesn't work? Who" cont "has the LIFT KEY?" done -_RocketHideoutB4FRocket2EndBattleText:: +_RocketHideoutB4FRocket3EndBattleText:: text "No!" prompt -_RocketHideoutB4FRocket2AfterBattleText:: +_RocketHideoutB4FRocket3AfterBattleText:: text "Oh no! I dropped" line "the LIFT KEY!" done diff --git a/text/Route8.asm b/text/Route8.asm index 818a81d6..c66f18ea 100644 --- a/text/Route8.asm +++ b/text/Route8.asm @@ -50,7 +50,7 @@ _Route8CooltrainerF1BattleText:: line "I collect them!" done -_Route8CooltrainerF21EndBattleText:: +_Route8CooltrainerF1EndBattleText:: text "Why? Why??" prompt diff --git a/text/SilphCo6F.asm b/text/SilphCo6F.asm index 86581c24..83408a50 100644 --- a/text/SilphCo6F.asm +++ b/text/SilphCo6F.asm @@ -60,12 +60,12 @@ _SilphCo6FRocket1BattleText:: line "ROCKET BROTHERS!" done -_SilphCo6Rocket1EndBattleText:: +_SilphCo6FRocket1EndBattleText:: text "Flame" line "out!" prompt -_SilphCo6Rocket1AfterBattleText:: +_SilphCo6FRocket1AfterBattleText:: text "No matter!" line "My brothers will" cont "avenge me!"