From f801d67f8e9b1a7f690a0b6e1549c5811ac015cd 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: Assert the relations between some move effect constants (#478) --- engine/battle/effects.asm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engine') diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index 95c8706f..47b13311 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 -- cgit v1.3.1-sl0p From ff76bba5074abefce1d479cd422a71ad3c297536 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 16 Dec 2024 10:29:59 -0500 Subject: 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(-) (limited to 'engine') diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm index 78d39c95..6d2d49de 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 2ce500aa..4aec84ea 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 58aba757..eb6bc584 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 a7f4d025..b6275e52 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 5a7bed7c..bd79ad16 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 47af5c29..05202079 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 2e4a7ce2..c3c9cb8d 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 -- cgit v1.3.1-sl0p From 67084c9d261c5ab88c52b2dd99c8a767be831805 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 16 Dec 2024 10:35:55 -0500 Subject: Remove redundant parentheses --- engine/battle/animations.asm | 2 +- engine/events/poison.asm | 4 ++-- engine/events/prize_menu.asm | 6 +++--- 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 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) (limited to 'engine') diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 3ccbf7c4..c0835680 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -2409,7 +2409,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 bd79ad16..c0b4a18f 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/events/prize_menu.asm b/engine/events/prize_menu.asm index 816637bf..f2b24a3f 100644 --- a/engine/events/prize_menu.asm +++ b/engine/events/prize_menu.asm @@ -129,15 +129,15 @@ GetPrizeMenuId: ; reg. c: ; [low nybble] number of bytes ; [bits 765 = %100] space-padding (not zero-padding) - ld c, (1 << 7 | 2) + ld c, (1 << 7) | 2 call PrintBCDNumber ld de, wPrize2Price hlcoord 13, 7 - ld c, (1 << 7 | 2) + ld c, (1 << 7) | 2 call PrintBCDNumber ld de, wPrize3Price hlcoord 13, 9 - ld c, (1 << 7 | 2) + ld c, (1 << 7) | 2 jp PrintBCDNumber INCLUDE "data/events/prizes.asm" diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index 6f2c050c..9c8aea39 100644 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -511,7 +511,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 8ae192b8..92a1b596 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 8bd6f05e..60bcfcbd 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 58111de6..bfec707b 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 93c035eb..1b742817 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 -- cgit v1.3.1-sl0p From a59c2bbaf92d381acf45fd6313dc23329a8d08ce Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Sat, 21 Dec 2024 21:04:32 -0500 Subject: Use `SERIAL_RNS_LENGTH` in `BattleRandom` --- engine/battle/core.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/battle/core.asm b/engine/battle/core.asm index c0d73bac..51d0c1b8 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6681,7 +6681,7 @@ BattleRandom: add hl, bc inc a ld [wLinkBattleRandomNumberListIndex], a - cp 9 + cp SERIAL_RNS_LENGTH - 1 ld a, [hl] pop bc pop hl @@ -6704,7 +6704,7 @@ ENDC ld [wLinkBattleRandomNumberListIndex], a ld hl, wLinkBattleRandomNumberList - ld b, 9 + ld b, SERIAL_RNS_LENGTH - 1 .loop ld a, [hl] ld c, a -- cgit v1.3.1-sl0p