From 8acb45bb058ed37ed36b5d7c27c4e93cee2bb809 Mon Sep 17 00:00:00 2001 From: Sylvie <35663410+Rangi42@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:13:11 -0500 Subject: [PATCH 1/9] Assert the relations between some move effect constants (#478) --- constants/move_effect_constants.asm | 4 ++-- data/moves/effects_pointers.asm | 4 ++-- data/moves/moves.asm | 6 +++--- engine/battle/effects.asm | 8 +++++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/constants/move_effect_constants.asm b/constants/move_effect_constants.asm index 8f33ece32..6914fafdf 100644 --- a/constants/move_effect_constants.asm +++ b/constants/move_effect_constants.asm @@ -9,7 +9,7 @@ const POISON_SIDE_EFFECT1 ; $02 const DRAIN_HP_EFFECT ; $03 const BURN_SIDE_EFFECT1 ; $04 - const FREEZE_SIDE_EFFECT ; $05 + const FREEZE_SIDE_EFFECT1 ; $05 const PARALYZE_SIDE_EFFECT1 ; $06 const EXPLODE_EFFECT ; $07 Explosion, Self Destruct const DREAM_EATER_EFFECT ; $08 @@ -39,7 +39,7 @@ const SLEEP_EFFECT ; $20 const POISON_SIDE_EFFECT2 ; $21 const BURN_SIDE_EFFECT2 ; $22 - const_skip ; $23 + const FREEZE_SIDE_EFFECT2 ; $23 unused (Blizzard in JP Red/Green) const PARALYZE_SIDE_EFFECT2 ; $24 const FLINCH_SIDE_EFFECT2 ; $25 const OHKO_EFFECT ; $26 moves like Horn Drill diff --git a/data/moves/effects_pointers.asm b/data/moves/effects_pointers.asm index c33a5fd66..63350efc8 100644 --- a/data/moves/effects_pointers.asm +++ b/data/moves/effects_pointers.asm @@ -5,7 +5,7 @@ MoveEffectPointerTable: dw PoisonEffect ; POISON_SIDE_EFFECT1 dw DrainHPEffect ; DRAIN_HP_EFFECT dw FreezeBurnParalyzeEffect ; BURN_SIDE_EFFECT1 - dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT + dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT1 dw FreezeBurnParalyzeEffect ; PARALYZE_SIDE_EFFECT1 dw ExplodeEffect ; EXPLODE_EFFECT dw DrainHPEffect ; DREAM_EATER_EFFECT @@ -35,7 +35,7 @@ MoveEffectPointerTable: dw SleepEffect ; SLEEP_EFFECT dw PoisonEffect ; POISON_SIDE_EFFECT2 dw FreezeBurnParalyzeEffect ; BURN_SIDE_EFFECT2 - dw FreezeBurnParalyzeEffect ; unused effect + dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT2 dw FreezeBurnParalyzeEffect ; PARALYZE_SIDE_EFFECT2 dw FlinchSideEffect ; FLINCH_SIDE_EFFECT2 dw OneHitKOEffect ; OHKO_EFFECT diff --git a/data/moves/moves.asm b/data/moves/moves.asm index c32a89cb9..e59ed0070 100644 --- a/data/moves/moves.asm +++ b/data/moves/moves.asm @@ -18,7 +18,7 @@ Moves: move MEGA_PUNCH, NO_ADDITIONAL_EFFECT, 80, NORMAL, 85, 20 move PAY_DAY, PAY_DAY_EFFECT, 40, NORMAL, 100, 20 move FIRE_PUNCH, BURN_SIDE_EFFECT1, 75, FIRE, 100, 15 - move ICE_PUNCH, FREEZE_SIDE_EFFECT, 75, ICE, 100, 15 + move ICE_PUNCH, FREEZE_SIDE_EFFECT1, 75, ICE, 100, 15 move THUNDERPUNCH, PARALYZE_SIDE_EFFECT1, 75, ELECTRIC, 100, 15 move SCRATCH, NO_ADDITIONAL_EFFECT, 40, NORMAL, 100, 35 move VICEGRIP, NO_ADDITIONAL_EFFECT, 55, NORMAL, 100, 30 @@ -68,8 +68,8 @@ Moves: move WATER_GUN, NO_ADDITIONAL_EFFECT, 40, WATER, 100, 25 move HYDRO_PUMP, NO_ADDITIONAL_EFFECT, 120, WATER, 80, 5 move SURF, NO_ADDITIONAL_EFFECT, 95, WATER, 100, 15 - move ICE_BEAM, FREEZE_SIDE_EFFECT, 95, ICE, 100, 10 - move BLIZZARD, FREEZE_SIDE_EFFECT, 120, ICE, 90, 5 + move ICE_BEAM, FREEZE_SIDE_EFFECT1, 95, ICE, 100, 10 + move BLIZZARD, FREEZE_SIDE_EFFECT1, 120, ICE, 90, 5 move PSYBEAM, CONFUSION_SIDE_EFFECT, 65, PSYCHIC_TYPE, 100, 20 move BUBBLEBEAM, SPEED_DOWN_SIDE_EFFECT, 65, WATER, 100, 20 move AURORA_BEAM, ATTACK_DOWN_SIDE_EFFECT, 65, ICE, 100, 20 diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index 95c8706f1..47b133110 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -216,7 +216,9 @@ FreezeBurnParalyzeEffect: jr c, .regular_effectiveness ; extra effectiveness ld b, 30 percent + 1 - sub BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 ; treat extra effective as regular from now on + 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 call BattleRandom ; get random 8bit value for probability test @@ -226,7 +228,7 @@ FreezeBurnParalyzeEffect: ld a, b ; what type of effect is this? cp BURN_SIDE_EFFECT1 jr z, .burn1 - cp FREEZE_SIDE_EFFECT + cp FREEZE_SIDE_EFFECT1 jr z, .freeze1 ; .paralyze1 ld a, 1 << PAR @@ -279,7 +281,7 @@ FreezeBurnParalyzeEffect: ld a, b cp BURN_SIDE_EFFECT1 jr z, .burn2 - cp FREEZE_SIDE_EFFECT + cp FREEZE_SIDE_EFFECT1 jr z, .freeze2 ; .paralyze2 ld a, 1 << PAR From 73ddc94f39668773c9c40ed3d527be58433a10dd Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 16 Dec 2024 10:29:59 -0500 Subject: [PATCH 2/9] Use "gray", not "grey" This matches the in-game text, e.g. Pewter is "A Stone Gray City" --- constants/palette_constants.asm | 2 +- data/pokemon/palettes.asm | 48 ++++++++++++++-------------- data/sgb/sgb_palettes.asm | 2 +- engine/battle/ghost_marowak_anim.asm | 2 +- engine/events/poison.asm | 2 +- engine/gfx/palettes.asm | 4 +-- macros/data.asm | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm index 78d39c95f..6d2d49dec 100644 --- a/constants/palette_constants.asm +++ b/constants/palette_constants.asm @@ -58,7 +58,7 @@ DEF SET_PAL_DEFAULT EQU $ff const PAL_GREENMON ; $16 const PAL_PINKMON ; $17 const PAL_YELLOWMON ; $18 - const PAL_GREYMON ; $19 + const PAL_GRAYMON ; $19 const PAL_SLOTS1 ; $1A const PAL_SLOTS2 ; $1B const PAL_SLOTS3 ; $1C diff --git a/data/pokemon/palettes.asm b/data/pokemon/palettes.asm index 2ce500aa6..4aec84eaa 100644 --- a/data/pokemon/palettes.asm +++ b/data/pokemon/palettes.asm @@ -19,8 +19,8 @@ MonsterPalettes: db PAL_BROWNMON ; PIDGEY db PAL_BROWNMON ; PIDGEOTTO db PAL_BROWNMON ; PIDGEOT - db PAL_GREYMON ; RATTATA - db PAL_GREYMON ; RATICATE + db PAL_GRAYMON ; RATTATA + db PAL_GRAYMON ; RATICATE db PAL_BROWNMON ; SPEAROW db PAL_BROWNMON ; FEAROW db PAL_PURPLEMON ; EKANS @@ -66,23 +66,23 @@ MonsterPalettes: db PAL_YELLOWMON ; ABRA db PAL_YELLOWMON ; KADABRA db PAL_YELLOWMON ; ALAKAZAM - db PAL_GREYMON ; MACHOP - db PAL_GREYMON ; MACHOKE - db PAL_GREYMON ; MACHAMP + db PAL_GRAYMON ; MACHOP + db PAL_GRAYMON ; MACHOKE + db PAL_GRAYMON ; MACHAMP db PAL_GREENMON ; BELLSPROUT db PAL_GREENMON ; WEEPINBELL db PAL_GREENMON ; VICTREEBEL db PAL_CYANMON ; TENTACOOL db PAL_CYANMON ; TENTACRUEL - db PAL_GREYMON ; GEODUDE - db PAL_GREYMON ; GRAVELER - db PAL_GREYMON ; GOLEM + db PAL_GRAYMON ; GEODUDE + db PAL_GRAYMON ; GRAVELER + db PAL_GRAYMON ; GOLEM db PAL_REDMON ; PONYTA db PAL_REDMON ; RAPIDASH db PAL_PINKMON ; SLOWPOKE db PAL_PINKMON ; SLOWBRO - db PAL_GREYMON ; MAGNEMITE - db PAL_GREYMON ; MAGNETON + db PAL_GRAYMON ; MAGNEMITE + db PAL_GRAYMON ; MAGNETON db PAL_BROWNMON ; FARFETCHD db PAL_BROWNMON ; DODUO db PAL_BROWNMON ; DODRIO @@ -90,12 +90,12 @@ MonsterPalettes: db PAL_BLUEMON ; DEWGONG db PAL_PURPLEMON ; GRIMER db PAL_PURPLEMON ; MUK - db PAL_GREYMON ; SHELLDER - db PAL_GREYMON ; CLOYSTER + db PAL_GRAYMON ; SHELLDER + db PAL_GRAYMON ; CLOYSTER db PAL_PURPLEMON ; GASTLY db PAL_PURPLEMON ; HAUNTER db PAL_PURPLEMON ; GENGAR - db PAL_GREYMON ; ONIX + db PAL_GRAYMON ; ONIX db PAL_YELLOWMON ; DROWZEE db PAL_YELLOWMON ; HYPNO db PAL_REDMON ; KRABBY @@ -104,15 +104,15 @@ MonsterPalettes: db PAL_YELLOWMON ; ELECTRODE db PAL_PINKMON ; EXEGGCUTE db PAL_GREENMON ; EXEGGUTOR - db PAL_GREYMON ; CUBONE - db PAL_GREYMON ; MAROWAK + db PAL_GRAYMON ; CUBONE + db PAL_GRAYMON ; MAROWAK db PAL_BROWNMON ; HITMONLEE db PAL_BROWNMON ; HITMONCHAN db PAL_PINKMON ; LICKITUNG db PAL_PURPLEMON ; KOFFING db PAL_PURPLEMON ; WEEZING - db PAL_GREYMON ; RHYHORN - db PAL_GREYMON ; RHYDON + db PAL_GRAYMON ; RHYHORN + db PAL_GRAYMON ; RHYDON db PAL_PINKMON ; CHANSEY db PAL_BLUEMON ; TANGELA db PAL_BROWNMON ; KANGASKHAN @@ -121,33 +121,33 @@ MonsterPalettes: db PAL_REDMON ; GOLDEEN db PAL_REDMON ; SEAKING db PAL_REDMON ; STARYU - db PAL_GREYMON ; STARMIE + db PAL_GRAYMON ; STARMIE db PAL_PINKMON ; MR_MIME db PAL_GREENMON ; SCYTHER db PAL_MEWMON ; JYNX db PAL_YELLOWMON ; ELECTABUZZ db PAL_REDMON ; MAGMAR db PAL_BROWNMON ; PINSIR - db PAL_GREYMON ; TAUROS + db PAL_GRAYMON ; TAUROS db PAL_REDMON ; MAGIKARP db PAL_BLUEMON ; GYARADOS db PAL_CYANMON ; LAPRAS - db PAL_GREYMON ; DITTO - db PAL_GREYMON ; EEVEE + db PAL_GRAYMON ; DITTO + db PAL_GRAYMON ; EEVEE db PAL_CYANMON ; VAPOREON db PAL_YELLOWMON ; JOLTEON db PAL_REDMON ; FLAREON - db PAL_GREYMON ; PORYGON + db PAL_GRAYMON ; PORYGON db PAL_BLUEMON ; OMANYTE db PAL_BLUEMON ; OMASTAR db PAL_BROWNMON ; KABUTO db PAL_BROWNMON ; KABUTOPS - db PAL_GREYMON ; AERODACTYL + db PAL_GRAYMON ; AERODACTYL db PAL_PINKMON ; SNORLAX db PAL_BLUEMON ; ARTICUNO db PAL_YELLOWMON ; ZAPDOS db PAL_REDMON ; MOLTRES - db PAL_GREYMON ; DRATINI + db PAL_GRAYMON ; DRATINI db PAL_BLUEMON ; DRAGONAIR db PAL_BROWNMON ; DRAGONITE db PAL_MEWMON ; MEWTWO diff --git a/data/sgb/sgb_palettes.asm b/data/sgb/sgb_palettes.asm index 58aba757d..eb6bc584d 100644 --- a/data/sgb/sgb_palettes.asm +++ b/data/sgb/sgb_palettes.asm @@ -31,7 +31,7 @@ ENDC RGB 31,29,31, 20,26,16, 09,20,11, 03,02,02 ; PAL_GREENMON RGB 31,29,31, 30,22,24, 28,15,21, 03,02,02 ; PAL_PINKMON RGB 31,29,31, 31,28,14, 26,20,00, 03,02,02 ; PAL_YELLOWMON - RGB 31,29,31, 26,21,22, 15,15,18, 03,02,02 ; PAL_GREYMON + RGB 31,29,31, 26,21,22, 15,15,18, 03,02,02 ; PAL_GRAYMON RGB 31,29,31, 26,21,22, 27,20,06, 03,02,02 ; PAL_SLOTS1 IF DEF(_RED) RGB 31,29,31, 31,31,17, 25,17,21, 03,02,02 ; PAL_SLOTS2 diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index a7f4d025b..b6275e52f 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -16,7 +16,7 @@ MarowakAnim: ld a, $1 ldh [hWhoseTurn], a callfar ChangeMonPic - ; alternate between black and light grey 8 times. + ; alternate between black and light gray 8 times. ; this makes the ghost's body appear to flash ld d, $80 call FlashSprite8Times diff --git a/engine/events/poison.asm b/engine/events/poison.asm index 5a7bed7c4..bd79ad16c 100644 --- a/engine/events/poison.asm +++ b/engine/events/poison.asm @@ -90,7 +90,7 @@ ApplyOutOfBattlePoisonDamage: and a ; are any party members poisoned? jr z, .skipPoisonEffectAndSound ld b, $2 - predef ChangeBGPalColor0_4Frames ; change BG white to dark grey for 4 frames + predef ChangeBGPalColor0_4Frames ; change BG white to dark gray for 4 frames ld a, SFX_POISONED call PlaySound .skipPoisonEffectAndSound diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm index 892a5698a..b48da9b89 100644 --- a/engine/gfx/palettes.asm +++ b/engine/gfx/palettes.asm @@ -170,7 +170,7 @@ SetPal_Overworld: ld [wDefaultPaletteCommand], a ret .PokemonTowerOrAgatha - ld a, PAL_GREYMON - 1 + ld a, PAL_GRAYMON - 1 jr .town .caveOrBruno ld a, PAL_CAVE - 1 @@ -271,7 +271,7 @@ BadgeBlkDataLengths: DeterminePaletteID: bit TRANSFORMED, a ; a is battle status 3 - ld a, PAL_GREYMON ; if the mon has used Transform, use Ditto's palette + ld a, PAL_GRAYMON ; if the mon has used Transform, use Ditto's palette ret nz ld a, [hl] DeterminePaletteIDOutOfBattle: diff --git a/macros/data.asm b/macros/data.asm index 2e4a7ce2a..c3c9cb8d7 100644 --- a/macros/data.asm +++ b/macros/data.asm @@ -15,7 +15,7 @@ ENDM ; used in data/pokemon/base_stats/*.asm MACRO tmhm -; initialize bytes to 0 + ; initialize bytes to 0 FOR n, (NUM_TM_HM + 7) / 8 DEF _tm{d:n} = 0 ENDR From 4742345f5832be63e9ed4806d6c1a98a38561f6c Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 16 Dec 2024 10:35:55 -0500 Subject: [PATCH 3/9] Remove redundant parentheses --- engine/battle/animations.asm | 2 +- engine/events/poison.asm | 4 ++-- engine/items/town_map.asm | 2 +- engine/link/cable_club.asm | 2 +- engine/menus/main_menu.asm | 4 ++-- home/serial.asm | 6 +++--- home/vcopy.asm | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 25867c9e2..fca797755 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -2402,7 +2402,7 @@ FallingObjects_UpdateOAMEntry: sub b ld [hli], a ; X inc hl - ld a, (1 << OAM_X_FLIP) + ld a, 1 << OAM_X_FLIP .next2 ld [hl], a ; attribute ret diff --git a/engine/events/poison.asm b/engine/events/poison.asm index bd79ad16c..c0b4a18f4 100644 --- a/engine/events/poison.asm +++ b/engine/events/poison.asm @@ -15,7 +15,7 @@ ApplyOutOfBattlePoisonDamage: ld de, wPartySpecies .applyDamageLoop ld a, [hl] - and (1 << PSN) + and 1 << PSN jr z, .nextMon2 ; not poisoned dec hl dec hl @@ -79,7 +79,7 @@ ApplyOutOfBattlePoisonDamage: ld e, 0 .countPoisonedLoop ld a, [hl] - and (1 << PSN) + and 1 << PSN or e ld e, a ld bc, wPartyMon2 - wPartyMon1 diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index e98a819c1..b53b6f2dd 100644 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -510,7 +510,7 @@ WriteSymmetricMonPartySpriteOAM: ld [hli], a ; tile ld a, [wSymmetricSpriteOAMAttributes] ld [hli], a ; attributes - xor (1 << OAM_X_FLIP) + xor 1 << OAM_X_FLIP ld [wSymmetricSpriteOAMAttributes], a inc d ld a, 8 diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index b8fe569b7..abc193fae 100644 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -119,7 +119,7 @@ CableClub_DoBattleOrTradeAgain: ldh [rSC], a .skipSendingTwoZeroBytes call Delay3 - ld a, (1 << SERIAL) + ld a, 1 << SERIAL ldh [rIE], a ld hl, wSerialRandomNumberListBlock ld de, wSerialOtherGameboyRandomNumberListBlock diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index f5f926ede..7f68ca6e6 100644 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -231,7 +231,7 @@ LinkMenu: ld c, " " ld d, "▷" ld a, [wLinkMenuSelectionSendBuffer] - and (B_BUTTON << 2) ; was B button pressed? + and B_BUTTON << 2 ; was B button pressed? jr nz, .updateCursorPosition ; A button was pressed ld a, [wCurrentMenuItem] @@ -254,7 +254,7 @@ LinkMenu: call DelayFrames call LoadScreenTilesFromBuffer1 ld a, [wLinkMenuSelectionSendBuffer] - and (B_BUTTON << 2) ; was B button pressed? + and B_BUTTON << 2 ; was B button pressed? jr nz, .choseCancel ; cancel if B pressed ld a, [wCurrentMenuItem] cp $2 diff --git a/home/serial.asm b/home/serial.asm index 58111de6f..bfec707b7 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -118,7 +118,7 @@ Serial_ExchangeByte:: .doNotIncrementUnknownCounter ldh a, [rIE] and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) - cp (1 << SERIAL) + cp 1 << SERIAL jr nz, .loop ld a, [wUnknownSerialCounter2] dec a @@ -140,7 +140,7 @@ Serial_ExchangeByte:: ldh [hSerialReceivedNewData], a ldh a, [rIE] and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) - sub (1 << SERIAL) + sub 1 << SERIAL jr nz, .skipReloadingUnknownCounter2 ld [wUnknownSerialCounter2], a ld a, $50 @@ -166,7 +166,7 @@ Serial_ExchangeByte:: .done ldh a, [rIE] and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) - cp (1 << SERIAL) + cp 1 << SERIAL ld a, SERIAL_NO_DATA_BYTE ret z ld a, [hl] diff --git a/home/vcopy.asm b/home/vcopy.asm index 93c035ebd..1b7428175 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -140,7 +140,7 @@ AutoBgMapTransfer:: ld h, a ldh a, [hAutoBGTransferDest] ld l, a - ld de, (12 * 32) + ld de, 12 * 32 add hl, de xor a ; TRANSFERTOP jr .doTransfer @@ -160,7 +160,7 @@ AutoBgMapTransfer:: ld h, a ldh a, [hAutoBGTransferDest] ld l, a - ld de, (6 * 32) + ld de, 6 * 32 add hl, de ld a, TRANSFERBOTTOM .doTransfer From b42548b593b8d1b2127310d98973935eff298310 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 16 Dec 2024 10:44:44 -0500 Subject: [PATCH 4/9] Let CheckEitherEventSet reuse A like CheckBothEventsSet --- macros/scripts/events.asm | 6 +++++- scripts/MtMoonB2F.asm | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index fdbedb6f0..b07a38f3a 100644 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -411,9 +411,13 @@ ENDM ; returns the complement of whether either event is set in Z flag ;\1 = event index 1 ;\2 = event index 2 +;\3 = try to reuse a (optional) MACRO CheckEitherEventSet IF ((\1) / 8) == ((\2) / 8) - ld a, [wEventFlags + ((\1) / 8)] + IF (_NARG < 3) || (((\1) / 8) != event_byte) + DEF event_byte = ((\1) / 8) + ld a, [wEventFlags + ((\1) / 8)] + ENDC and (1 << ((\1) % 8)) | (1 << ((\2) % 8)) ELSE ; This case doesn't happen in the original ROM. diff --git a/scripts/MtMoonB2F.asm b/scripts/MtMoonB2F.asm index d17d13fee..d7d4a35b6 100644 --- a/scripts/MtMoonB2F.asm +++ b/scripts/MtMoonB2F.asm @@ -184,8 +184,7 @@ MtMoonB2FSuperNerdText: text_asm CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD jr z, .beat_super_nerd - ; CheckEitherEventSetReuseA EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL - and (1 << (EVENT_GOT_DOME_FOSSIL % 8)) | (1 << (EVENT_GOT_HELIX_FOSSIL % 8)) + CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL, 1 jr nz, .got_a_fossil ld hl, MtMoonB2fSuperNerdEachTakeOneText call PrintText From 8ebda7ffb2958ff7805bae1d4a9d45054f4618c7 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Sat, 21 Dec 2024 21:04:32 -0500 Subject: [PATCH 5/9] Use `SERIAL_RNS_LENGTH` in `BattleRandom` --- engine/battle/core.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 8eb34c5f9..28b0a2753 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6682,7 +6682,7 @@ BattleRandom: add hl, bc inc a ld [wLinkBattleRandomNumberListIndex], a - cp 9 + cp SERIAL_RNS_LENGTH - 1 ld a, [hl] pop bc pop hl @@ -6705,7 +6705,7 @@ ENDC ld [wLinkBattleRandomNumberListIndex], a ld hl, wLinkBattleRandomNumberList - ld b, 9 + ld b, SERIAL_RNS_LENGTH - 1 .loop ld a, [hl] ld c, a From 9e97dbcc4dec588023d837c23ed411d48f99ed31 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 6/9] 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 a5142216e..55ec218da 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 101ea8e2c..372337d08 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 6551d8cae..f3a96f82b 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 0x1B -r 03 -t "POKEMON RED" -pokeblue_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x1B -r 03 -t "POKEMON BLUE" -pokeblue_debug_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x1B -r 03 -t "POKEMON BLUE" -pokered_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x1B -r 03 -t "POKEMON RED" -pokeblue_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x1B -r 03 -t "POKEMON BLUE" +pokered_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC5+RAM+BATTERY -r 03 -t "POKEMON RED" +pokeblue_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC5+RAM+BATTERY -r 03 -t "POKEMON BLUE" +pokeblue_debug_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC5+RAM+BATTERY -r 03 -t "POKEMON BLUE" +pokered_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC5+RAM+BATTERY -r 03 -t "POKEMON RED" +pokeblue_vc_opt = -jsv -n 0 -k 01 -l 0x33 -m MBC5+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 fca797755..1ce37e338 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -1736,8 +1736,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 55fea288c..7cc7b0d08 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 5e30a32e6238a0a60c2a4fb8e0e98c677a5340d2 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 7/9] 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 7129e1e68..6199d2c69 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 "FOR" li "DEF" li "VIT" diff --git a/data/battle/stat_names.asm b/data/battle/stat_names.asm index f4024e2ab..71cc8b4e8 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 "VIE" li "FOR" li "DEF" diff --git a/data/battle_anims/base_coords.asm b/data/battle_anims/base_coords.asm index 109a06e81..72efb04ac 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 549c1c3cc..0e0de32f9 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 74097e226..33a4a2f2c 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 29475a570..2fa1976d6 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 1fa5af23e..b3244da20 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 04f0c2f46..3f45a1edb 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 fdce020a4..b2967804b 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 aaba27a8d..a4f7b5d11 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 8530426be..fa7958eb7 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 "HYPER BALL" li "SUPER BALL" diff --git a/data/items/prices.asm b/data/items/prices.asm index d01c0b7e3..aefd10785 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 e3ece9425..08d215117 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 87ec01cfc..de7ae84b0 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 44457ce6b..8d9eba2e6 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 111b87b83..bb62b5524 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 0bf49db6a..7b2a4e879 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 78b7ff62d..c93ba57be 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 e9fdc34ce..bd362c530 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 63350efc8..fc7c08c5c 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 e59ed0070..f435ab6b9 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 89f4238c6..d9350ebd6 100644 --- a/data/moves/names.asm +++ b/data/moves/names.asm @@ -1,5 +1,5 @@ MoveNames:: - list_start MoveNames + list_start li "ECRAS'FACE" li "POING-KARATE" li "TORGNOLES" diff --git a/data/moves/sfx.asm b/data/moves/sfx.asm index c3f01f4e5..f1466ac11 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 6b279f5ad..ee9b37f85 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 691e75b0d..76f7a0bdb 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 290f5625f..eab1818ed 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 7d6bf910d..0731efa96 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 32e7a79bb..7c47ddcc5 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 d900dde69..6a6704f98 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 f0df29e04..640f699d1 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 "RHINOFEROS" db "KANGOUREX@" db "NIDORAN♂@@" diff --git a/data/pokemon/palettes.asm b/data/pokemon/palettes.asm index 4aec84eaa..f0485e165 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 eb6bc584d..d8016d64b 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 612ce10c1..3c923e2d0 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 3e1033beb..ba67fae01 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 a8500ef22..30db7b95e 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 823b4b36e..3a4cdbd7d 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 a2c6975ba..eaab9a7ab 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 3741f06b9..1624b326e 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 f27e411d5..a1ad0fc29 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 1527dbe40..9b14f7483 100644 --- a/data/trainers/names.asm +++ b/data/trainers/names.asm @@ -1,5 +1,5 @@ TrainerNames:: - list_start TrainerNames + list_start li "GAMIN" li "SCOUT" li "FILLETTE" diff --git a/data/trainers/parties.asm b/data/trainers/parties.asm index b2ad5e080..cf5eb1519 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 4515d8806..f300fb29c 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 d969b1c5f..295a10a0a 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 a09fdce62..f15bed503 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 a936b1ae3..a5d058a10 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 85d2177ee..fe731c5dc 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 bc5b25820..7fb7f96b7 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 541865236..1c7e02003 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 24b0e48541b27074a8e8b32efc192cb2d33277a3 Mon Sep 17 00:00:00 2001 From: vulcandth Date: Fri, 27 Dec 2024 12:10:13 -0600 Subject: [PATCH 8/9] Use exported constants for VC patch (#483) --- Makefile | 6 +-- includes.asm | 7 +++ tools/make_patch.c | 22 +++++----- vc/pokeblue.constants.asm | 81 +++++++++++++++++------------------ vc/pokeblue.patch.template | 42 +++++++++--------- vc/pokered.constants.asm | 87 ++++++++++++++++++-------------------- vc/pokered.patch.template | 44 +++++++++---------- 7 files changed, 141 insertions(+), 148 deletions(-) diff --git a/Makefile b/Makefile index f3a96f82b..6523d82ab 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 8808e1d0b..f83b76e4d 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 77a306830..d96bf2162 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 edc3d6133..62151b80c 100644 --- a/vc/pokeblue.constants.asm +++ b/vc/pokeblue.constants.asm @@ -1,76 +1,71 @@ ; 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 "V" - vc_const REFLECT +EXPORT DEF R_CHAR EQU "R" +EXPORT DEF V_CHAR EQU "V" +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 ; [FPA 40 Begin] - vc_const HAZE +EXPORT HAZE ; "" is necessary since spaces separate template command arguments charmap "", " " - vc_const "" +EXPORT DEF SPACE_CHAR EQU "" diff --git a/vc/pokeblue.patch.template b/vc/pokeblue.patch.template index fea88653a..b0f40524a 100644 --- a/vc/pokeblue.patch.template +++ b/vc/pokeblue.patch.template @@ -174,7 +174,7 @@ MotionBlur0 = 27 ConditionType = 11 ConditionValueA = {dws_ 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} {dws/ wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == == || == == == == } {dws/ == == } -ConditionValueC = {dws_ "U" "L" "T" "I" "M" MEGA_PUNCH 00 "D" "E" "S" "T" "R" MEGA_PUNCH 00 "E" "X" "P" "L" } {dws/ "O" MEGA_PUNCH } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR I_CHAR M_CHAR MEGA_PUNCH 00 D_CHAR E_CHAR S_CHAR T_CHAR R_CHAR MEGA_PUNCH 00 E_CHAR X_CHAR P_CHAR L_CHAR } {dws/ O_CHAR MEGA_PUNCH } [FPA 001 End@Stop_reducing_move_anim_flashing_Mega_Punch] Mode = 3 @@ -183,7 +183,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "U" "L" "T" "I" "M" MEGA_PUNCH } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR I_CHAR M_CHAR MEGA_PUNCH } ;no117 guillotine [FPA 002 Begin@Reduce_move_anim_flashing_Guillotine] @@ -197,7 +197,7 @@ MotionBlur1 = 7 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "G" "U" "I" "L" "L" GUILLOTINE } +ConditionValueC = {dws_ G_CHAR U_CHAR I_CHAR L_CHAR L_CHAR GUILLOTINE } [FPA 002 End@Stop_reducing_move_anim_flashing_Guillotine] Mode = 3 @@ -206,7 +206,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "G" "U" "I" "L" "L" GUILLOTINE } +ConditionValueC = {dws_ G_CHAR U_CHAR I_CHAR L_CHAR L_CHAR GUILLOTINE } ;no150 mega kick [FPA 003 Begin@Reduce_move_anim_flashing_Mega_Kick] @@ -218,7 +218,7 @@ MotionBlur0 = 23 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "U" "L" "T" "I" "M" MEGA_KICK } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR I_CHAR M_CHAR MEGA_KICK } ;no123 bubble beam @@ -231,7 +231,7 @@ MotionBlur0 = 30 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "B" "U" "L" "L" "E" BUBBLEBEAM } +ConditionValueC = {dws_ B_CHAR U_CHAR L_CHAR L_CHAR E_CHAR BUBBLEBEAM } [FPA 004 End@Stop_reducing_move_anim_flashing_Bubblebeam_Mega_Kick] Mode = 3 @@ -240,7 +240,7 @@ Address = {hex @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == == } -ConditionValueC = {dws_ "B" "U" "L" "L" "E" BUBBLEBEAM 00 "U" "L" "T" "I" "M" MEGA_KICK } +ConditionValueC = {dws_ B_CHAR U_CHAR L_CHAR L_CHAR E_CHAR BUBBLEBEAM 00 U_CHAR L_CHAR T_CHAR I_CHAR M_CHAR MEGA_KICK } ;no116 hyper beam @@ -255,7 +255,7 @@ MotionBlur1 = 5 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "U" "L" "T" "R" "A" HYPER_BEAM } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR R_CHAR A_CHAR HYPER_BEAM } [FPA 005 End@Stop_reducing_move_anim_flashing_Hyper_Beam] Mode = 3 @@ -264,7 +264,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "U" "L" "T" "R" "A" HYPER_BEAM } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR R_CHAR A_CHAR HYPER_BEAM } ;no57 thunderbolt [FPA 006 Begin@Reduce_move_anim_flashing_Thunderbolt] @@ -276,7 +276,7 @@ MotionBlur0 = 30 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "T" "O" "N" "N" "E" THUNDERBOLT } +ConditionValueC = {dws_ T_CHAR O_CHAR N_CHAR N_CHAR E_CHAR THUNDERBOLT } [FPA 006 End@Stop_reducing_move_anim_flashing_Thunderbolt] @@ -286,7 +286,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "T" "O" "N" "N" "E" THUNDERBOLT } +ConditionValueC = {dws_ T_CHAR O_CHAR N_CHAR N_CHAR E_CHAR THUNDERBOLT } ;no159 reflect @@ -301,7 +301,7 @@ MotionBlur1 = 5 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "P" "R" "O" "T" "E" REFLECT } +ConditionValueC = {dws_ P_CHAR R_CHAR O_CHAR T_CHAR E_CHAR REFLECT } [FPA 007 End@Stop_reducing_move_anim_flashing_Reflect] Mode = 3 @@ -310,7 +310,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "P" "R" "O" "T" "E" REFLECT } +ConditionValueC = {dws_ P_CHAR R_CHAR O_CHAR T_CHAR E_CHAR REFLECT } ;no156 dream eater [FPA 008 Begin@Reduce_move_anim_flashing_Dream_Eater] @@ -324,7 +324,7 @@ MotionBlur1 = 7 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "D" "E" "V" "O" "R" DREAM_EATER } +ConditionValueC = {dws_ D_CHAR E_CHAR V_CHAR O_CHAR R_CHAR DREAM_EATER } [FPA 008 End@Stop_reducing_move_anim_flashing_Dream_Eater] Mode = 3 @@ -348,7 +348,7 @@ MotionBlur1 = 8 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "S" "P" "O" "R" "E" SPORE } +ConditionValueC = {dws_ S_CHAR P_CHAR O_CHAR R_CHAR E_CHAR SPORE } @@ -362,7 +362,7 @@ MotionBlur0 = 27 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "E" "B" "O" "U" "L" ROCK_SLIDE } +ConditionValueC = {dws_ E_CHAR B_CHAR O_CHAR U_CHAR L_CHAR ROCK_SLIDE } [FPA 010 End@Stop_reducing_move_anim_flashing] Mode = 3 @@ -371,7 +371,7 @@ Address = {HEX @} ConditionType = 11 ConditionValueA = {dws_ 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+4 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+4 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3} {dws/ wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == == || == == == == == == || == == == == == == || == == == == == == || == == == == == == || == == == == } {dws/ == == } -ConditionValueC = {dws_ "D" "E" "V" "O" "R" DREAM_EATER 00 "E" "B" "O" "U" "L" ROCK_SLIDE 00 "D" "E" "S" "T" "R" MEGA_PUNCH 00 "P" "I" "L" "Z" "S" "T" 00 "B" "U" "E" "E" "" HAZE 00 "D" "E" "S" "T" "R" SELFDESTRUCT 00 "E" "X" "P" "L" } {dws/ "O" EXPLOSION } +ConditionValueC = {dws_ D_CHAR E_CHAR V_CHAR O_CHAR R_CHAR DREAM_EATER 00 E_CHAR B_CHAR O_CHAR U_CHAR L_CHAR ROCK_SLIDE 00 D_CHAR E_CHAR S_CHAR T_CHAR R_CHAR MEGA_PUNCH 00 P_CHAR I_CHAR L_CHAR Z_CHAR S_CHAR T_CHAR 00 B_CHAR U_CHAR E_CHAR E_CHAR SPACE_CHAR HAZE 00 D_CHAR E_CHAR S_CHAR T_CHAR R_CHAR SELFDESTRUCT 00 E_CHAR X_CHAR P_CHAR L_CHAR } {dws/ O_CHAR EXPLOSION } ;No76 explosion @@ -384,7 +384,7 @@ MotionBlur0 = 28 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "E" "X" "P" "L" "O" EXPLOSION } +ConditionValueC = {dws_ E_CHAR X_CHAR P_CHAR L_CHAR O_CHAR EXPLOSION } ;No131 blizzard @@ -397,7 +397,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 } ;No56 self-destruct @@ -410,7 +410,7 @@ MotionBlur0 = 26 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "D" "E" "S" "T" "R" SELFDESTRUCT} +ConditionValueC = {dws_ D_CHAR E_CHAR S_CHAR T_CHAR R_CHAR SELFDESTRUCT} ;no40 haze @@ -423,4 +423,4 @@ MotionBlur0 = 26 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "B" "U" "E" "E" "" HAZE } +ConditionValueC = {dws_ B_CHAR U_CHAR E_CHAR E_CHAR SPACE_CHAR HAZE } diff --git a/vc/pokered.constants.asm b/vc/pokered.constants.asm index 6842c8ffd..6a001969c 100644 --- a/vc/pokered.constants.asm +++ b/vc/pokered.constants.asm @@ -1,77 +1,72 @@ ; 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 DEF F_CHAR EQU "F" +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 "V" +EXPORT DEF C_CHAR EQU "C" +EXPORT DEF V_CHAR EQU "V" ; "" is necessary since spaces separate template command arguments charmap "", " " - vc_const "" - vc_const ROCK_SLIDE - vc_const HAZE +EXPORT DEF SPACE_CHAR EQU "" +EXPORT ROCK_SLIDE +EXPORT HAZE ; [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 fdd95cf38..10a7d2ac1 100644 --- a/vc/pokered.patch.template +++ b/vc/pokered.patch.template @@ -192,7 +192,7 @@ MotionBlur0 = 21 ConditionType = 11 ConditionValueA = {dws_ 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} {dws/ wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == == || == == == == } {dws/ == == } -ConditionValueC = {dws_ "U" "L" "T" "I" "M" MEGA_PUNCH 00 "D" "E" "S" "T" "R" MEGA_PUNCH 00 "E" "X" "P" "L" } {dws/ "O" MEGA_PUNCH } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR I_CHAR M_CHAR MEGA_PUNCH 00 D_CHAR E_CHAR S_CHAR T_CHAR R_CHAR MEGA_PUNCH 00 E_CHAR X_CHAR P_CHAR L_CHAR } {dws/ O_CHAR MEGA_PUNCH } [FPA 001 End@Stop_reducing_move_anim_flashing_Mega_Punch] Mode = 3 @@ -201,7 +201,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "U" "L" "T" "I" "M" MEGA_PUNCH } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR I_CHAR M_CHAR MEGA_PUNCH } ;no117 guillotine [FPA 002 Begin@Reduce_move_anim_flashing_Guillotine] @@ -215,7 +215,7 @@ MotionBlur1 = 7 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "G" "U" "I" "L" "L" GUILLOTINE } +ConditionValueC = {dws_ G_CHAR U_CHAR I_CHAR L_CHAR L_CHAR GUILLOTINE } [FPA 002 End@Stop_reducing_move_anim_flashing_Guillotine] Mode = 3 @@ -224,7 +224,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "G" "U" "I" "L" "L" GUILLOTINE } +ConditionValueC = {dws_ G_CHAR U_CHAR I_CHAR L_CHAR L_CHAR GUILLOTINE } ;no150 mega kick [FPA 003 Begin@Reduce_move_anim_flashing_Mega_Kick] @@ -236,7 +236,7 @@ MotionBlur0 = 25 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "U" "L" "T" "I" "M" MEGA_KICK } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR I_CHAR M_CHAR MEGA_KICK } ;no123 bubble beam @@ -249,7 +249,7 @@ MotionBlur0 = 30 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "B" "U" "L" "L" "E" BUBBLEBEAM } +ConditionValueC = {dws_ B_CHAR U_CHAR L_CHAR L_CHAR E_CHAR BUBBLEBEAM } [FPA 004 End@Stop_reducing_move_anim_flashing_Bubblebeam_Mega_Kick] Mode = 3 @@ -258,7 +258,7 @@ Address = {hex @} ConditionType = 11 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == == } -ConditionValueC = {dws_ "B" "U" "L" "L" "E" BUBBLEBEAM 00 "U" "L" "T" "I" "M" MEGA_KICK } +ConditionValueC = {dws_ B_CHAR U_CHAR L_CHAR L_CHAR E_CHAR BUBBLEBEAM 00 U_CHAR L_CHAR T_CHAR I_CHAR M_CHAR MEGA_KICK } ;no116 hyper beam @@ -273,7 +273,7 @@ MotionBlur1 = 5 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "U" "L" "T" "R" "A" HYPER_BEAM } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR R_CHAR A_CHAR HYPER_BEAM } [FPA 005 End@Stop_reducing_move_anim_flashing_Hyper_Beam] Mode = 3 @@ -282,7 +282,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "U" "L" "T" "R" "A" HYPER_BEAM } +ConditionValueC = {dws_ U_CHAR L_CHAR T_CHAR R_CHAR A_CHAR HYPER_BEAM } ;no57 thunderbolt [FPA 006 Begin@Reduce_move_anim_flashing_Thunderbolt] @@ -294,7 +294,7 @@ MotionBlur0 = 30 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "T" "O" "N" "N" "E" THUNDERBOLT } +ConditionValueC = {dws_ T_CHAR O_CHAR N_CHAR N_CHAR E_CHAR THUNDERBOLT } [FPA 006 End@Stop_reducing_move_anim_flashing_Thunderbolt] @@ -304,7 +304,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "T" "O" "N" "N" "E" THUNDERBOLT } +ConditionValueC = {dws_ T_CHAR O_CHAR N_CHAR N_CHAR E_CHAR THUNDERBOLT } ;no159 reflect @@ -319,7 +319,7 @@ MotionBlur1 = 5 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "P" "R" "O" "T" "E" REFLECT } +ConditionValueC = {dws_ P_CHAR R_CHAR O_CHAR T_CHAR E_CHAR REFLECT } [FPA 007 End@Stop_reducing_move_anim_flashing_Reflect] Mode = 3 @@ -328,7 +328,7 @@ Address = {HEX @} ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "P" "R" "O" "T" "E" REFLECT } +ConditionValueC = {dws_ P_CHAR R_CHAR O_CHAR T_CHAR E_CHAR REFLECT } ;no156 dream eater [FPA 008 Begin@Reduce_move_anim_flashing_Dream_Eater] @@ -342,7 +342,7 @@ MotionBlur1 = 7 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "D" "E" "V" "O" "R" DREAM_EATER } +ConditionValueC = {dws_ D_CHAR E_CHAR V_CHAR O_CHAR R_CHAR DREAM_EATER } [FPA 008 End@Stop_reducing_move_anim_flashing_Blizzard] Mode = 3 @@ -351,7 +351,7 @@ Address = {HEX @} ConditionType = 11 ConditionValueA = {dws_ 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+4 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == == || == == == == == == } -ConditionValueC = {dws_ "B" "L" "I" "Z" "Z" BLIZZARD 00 "E" "X" "P" "L" "O" MEGA_PUNCH 00 "S" "P" "O" "R" "E" SPORE } +ConditionValueC = {dws_ B_CHAR L_CHAR I_CHAR Z_CHAR Z_CHAR BLIZZARD 00 E_CHAR X_CHAR P_CHAR L_CHAR O_CHAR MEGA_PUNCH 00 S_CHAR P_CHAR O_CHAR R_CHAR E_CHAR SPORE } ;rsm174650 ;no36 spore @@ -366,7 +366,7 @@ MotionBlur1 = 8 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "S" "P" "O" "R" "E" SPORE } +ConditionValueC = {dws_ S_CHAR P_CHAR O_CHAR R_CHAR E_CHAR SPORE } @@ -380,7 +380,7 @@ MotionBlur0 = 27 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "E" "B" "O" "U" "L" ROCK_SLIDE } +ConditionValueC = {dws_ E_CHAR B_CHAR O_CHAR U_CHAR L_CHAR ROCK_SLIDE } [FPA 010 End@Stop_reducing_move_anim_flashing] Mode = 3 @@ -389,7 +389,7 @@ Address = {HEX @} ConditionType = 11 ConditionValueA = {dws_ 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+4 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+4 wAnimationID 00 wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3} {dws/ wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == || == == == == == == || == == == == == == || == == == == == == || == == == == == == || == == == == == == || == == == == } {dws/ == == } -ConditionValueC = {dws_ "D" "E" "V" "O" "R" DREAM_EATER 00 "E" "B" "O" "U" "L" ROCK_SLIDE 00 "D" "E" "S" "T" "R" MEGA_PUNCH 00 "P" "I" "L" "Z" "S" "T" 00 "B" "U" "E" "E" "" HAZE 00 "D" "E" "S" "T" "R" SELFDESTRUCT 00 "E" "X" "P" "L" } {dws/ "O" EXPLOSION } +ConditionValueC = {dws_ D_CHAR E_CHAR V_CHAR O_CHAR R_CHAR DREAM_EATER 00 E_CHAR B_CHAR O_CHAR U_CHAR L_CHAR ROCK_SLIDE 00 D_CHAR E_CHAR S_CHAR T_CHAR R_CHAR MEGA_PUNCH 00 P_CHAR I_CHAR L_CHAR Z_CHAR S_CHAR T_CHAR 00 B_CHAR U_CHAR E_CHAR E_CHAR SPACE_CHAR HAZE 00 D_CHAR E_CHAR S_CHAR T_CHAR R_CHAR SELFDESTRUCT 00 E_CHAR X_CHAR P_CHAR L_CHAR } {dws/ O_CHAR EXPLOSION } ;No76 explosion @@ -402,7 +402,7 @@ MotionBlur0 = 28 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "E" "X" "P" "L" "O" EXPLOSION } +ConditionValueC = {dws_ E_CHAR X_CHAR P_CHAR L_CHAR O_CHAR EXPLOSION } ;No131 blizzard @@ -415,7 +415,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 } ;No56 self-destruct @@ -428,7 +428,7 @@ MotionBlur0 = 26 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "D" "E" "S" "T" "R" SELFDESTRUCT} +ConditionValueC = {dws_ D_CHAR E_CHAR S_CHAR T_CHAR R_CHAR SELFDESTRUCT} ;no40 haze @@ -441,4 +441,4 @@ MotionBlur0 = 26 ConditionType = 0 ConditionValueA = {dws_ wStringBuffer wStringBuffer+1 wStringBuffer+2 wStringBuffer+3 wStringBuffer+4 wAnimationID} ConditionValueB = {dws_ == == == == == == } -ConditionValueC = {dws_ "B" "U" "E" "E" "" HAZE } \ No newline at end of file +ConditionValueC = {dws_ B_CHAR U_CHAR E_CHAR E_CHAR SPACE_CHAR HAZE } \ No newline at end of file From 4a8aea7743d7f836da0a55070a230e6b2b5d0705 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Fri, 27 Dec 2024 20:27:34 -0500 Subject: [PATCH 9/9] 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 28b0a2753..656df0171 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -4448,7 +4448,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.