From eb39f6a3396b21047a11dd871263c6dbc5f2c65f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 7 Nov 2015 13:05:58 -0500 Subject: [PATCH] Move MON_* parentheses to the EQUS declaration --- battle/core.asm | 18 ++++---- constants/pokemon_constants.asm | 64 ++++++++++++++-------------- event/dratini.asm | 2 +- items/item_effects.asm | 16 +++---- main.asm | 74 ++++++++++++++++----------------- sram.asm | 8 ++-- 6 files changed, 91 insertions(+), 91 deletions(-) diff --git a/battle/core.asm b/battle/core.asm index 45c5e8bd0..51da5bd26 100644 --- a/battle/core.asm +++ b/battle/core.asm @@ -4068,16 +4068,16 @@ InitBattleMon: ; 3da0d ld de, BattleMonSpecies ld bc, MON_ID call CopyBytes - ld bc, (MON_DVS) - (MON_ID) + ld bc, MON_DVS - MON_ID add hl, bc ld de, BattleMonDVs - ld bc, (MON_PKRUS) - (MON_DVS) + ld bc, MON_PKRUS - MON_DVS call CopyBytes rept 3 inc hl endr ld de, BattleMonLevel - ld bc, (PARTYMON_STRUCT_LENGTH) - (MON_LEVEL) + ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL call CopyBytes ld a, [BattleMonSpecies] ld [TempBattleMonSpecies], a @@ -4096,7 +4096,7 @@ endr call CopyBytes ld hl, BattleMonAttack ld de, PlayerStats - ld bc, (PARTYMON_STRUCT_LENGTH) - (MON_ATK) + ld bc, PARTYMON_STRUCT_LENGTH - MON_ATK call CopyBytes call Function3ec2c call BadgeStatBoosts @@ -4160,16 +4160,16 @@ Function3dabd: ; 3dabd ld de, EnemyMonSpecies ld bc, MON_ID call CopyBytes - ld bc, (MON_DVS) - (MON_ID) + ld bc, MON_DVS - MON_ID add hl, bc ld de, EnemyMonDVs - ld bc, (MON_PKRUS) - (MON_DVS) + ld bc, MON_PKRUS - MON_DVS call CopyBytes rept 3 inc hl endr ld de, EnemyMonLevel - ld bc, (PARTYMON_STRUCT_LENGTH) - (MON_LEVEL) + ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL call CopyBytes ld a, [EnemyMonSpecies] ld [CurSpecies], a @@ -4182,7 +4182,7 @@ endr call CopyBytes ld hl, EnemyMonAttack ld de, EnemyStats - ld bc, (PARTYMON_STRUCT_LENGTH) - (MON_ATK) + ld bc, PARTYMON_STRUCT_LENGTH - MON_ATK call CopyBytes call Function3ec30 ld hl, BaseType1 @@ -5868,7 +5868,7 @@ endr push hl call .asm_3e6a5 pop hl - ld bc, (MON_PP) - (MON_MOVES) + ld bc, MON_PP - MON_MOVES add hl, bc call .asm_3e6a5 diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm index 4fe16d09c..3407281c4 100644 --- a/constants/pokemon_constants.asm +++ b/constants/pokemon_constants.asm @@ -260,38 +260,38 @@ NUM_POKEMON EQU const_value EGG EQU 253 ; pokemon structure in RAM -MON_SPECIES EQUS "PartyMon1Species - PartyMon1" -MON_ITEM EQUS "PartyMon1Item - PartyMon1" -MON_MOVES EQUS "PartyMon1Moves - PartyMon1" -MON_ID EQUS "PartyMon1ID - PartyMon1" -MON_EXP EQUS "PartyMon1Exp - PartyMon1" -MON_STAT_EXP EQUS "PartyMon1StatExp - PartyMon1" -MON_HP_EXP EQUS "PartyMon1HPExp - PartyMon1" -MON_ATK_EXP EQUS "PartyMon1AtkExp - PartyMon1" -MON_DEF_EXP EQUS "PartyMon1DefExp - PartyMon1" -MON_SPD_EXP EQUS "PartyMon1SpdExp - PartyMon1" -MON_SPC_EXP EQUS "PartyMon1SpcExp - PartyMon1" -MON_DVS EQUS "PartyMon1DVs - PartyMon1" -MON_PP EQUS "PartyMon1PP - PartyMon1" -MON_HAPPINESS EQUS "PartyMon1Happiness - PartyMon1" -MON_PKRUS EQUS "PartyMon1PokerusStatus - PartyMon1" -MON_CAUGHTDATA EQUS "PartyMon1CaughtData - PartyMon1" -MON_CAUGHTLEVEL EQUS "PartyMon1CaughtLevel - PartyMon1" -MON_CAUGHTTIME EQUS "PartyMon1CaughtTime - PartyMon1" -MON_CAUGHTGENDER EQUS "PartyMon1CaughtGender - PartyMon1" -MON_CAUGHTLOCATION EQUS "PartyMon1CaughtLocation - PartyMon1" -MON_LEVEL EQUS "PartyMon1Level - PartyMon1" -MON_STATUS EQUS "PartyMon1Status - PartyMon1" -MON_HP EQUS "PartyMon1HP - PartyMon1" -MON_MAXHP EQUS "PartyMon1MaxHP - PartyMon1" -MON_ATK EQUS "PartyMon1Attack - PartyMon1" -MON_DEF EQUS "PartyMon1Defense - PartyMon1" -MON_SPD EQUS "PartyMon1Speed - PartyMon1" -MON_SAT EQUS "PartyMon1SpclAtk - PartyMon1" -MON_SDF EQUS "PartyMon1SpclDef - PartyMon1" -BOXMON_STRUCT_LENGTH EQUS "PartyMon1End - PartyMon1" -PARTYMON_STRUCT_LENGTH EQUS "PartyMon1StatsEnd - PartyMon1" -SCRATCHMON_STRUCT_LENGTH EQUS "PartyMon1StatsEnd - PartyMon1Item" +MON_SPECIES EQUS "(PartyMon1Species - PartyMon1)" +MON_ITEM EQUS "(PartyMon1Item - PartyMon1)" +MON_MOVES EQUS "(PartyMon1Moves - PartyMon1)" +MON_ID EQUS "(PartyMon1ID - PartyMon1)" +MON_EXP EQUS "(PartyMon1Exp - PartyMon1)" +MON_STAT_EXP EQUS "(PartyMon1StatExp - PartyMon1)" +MON_HP_EXP EQUS "(PartyMon1HPExp - PartyMon1)" +MON_ATK_EXP EQUS "(PartyMon1AtkExp - PartyMon1)" +MON_DEF_EXP EQUS "(PartyMon1DefExp - PartyMon1)" +MON_SPD_EXP EQUS "(PartyMon1SpdExp - PartyMon1)" +MON_SPC_EXP EQUS "(PartyMon1SpcExp - PartyMon1)" +MON_DVS EQUS "(PartyMon1DVs - PartyMon1)" +MON_PP EQUS "(PartyMon1PP - PartyMon1)" +MON_HAPPINESS EQUS "(PartyMon1Happiness - PartyMon1)" +MON_PKRUS EQUS "(PartyMon1PokerusStatus - PartyMon1)" +MON_CAUGHTDATA EQUS "(PartyMon1CaughtData - PartyMon1)" +MON_CAUGHTLEVEL EQUS "(PartyMon1CaughtLevel - PartyMon1)" +MON_CAUGHTTIME EQUS "(PartyMon1CaughtTime - PartyMon1)" +MON_CAUGHTGENDER EQUS "(PartyMon1CaughtGender - PartyMon1)" +MON_CAUGHTLOCATION EQUS "(PartyMon1CaughtLocation - PartyMon1)" +MON_LEVEL EQUS "(PartyMon1Level - PartyMon1)" +MON_STATUS EQUS "(PartyMon1Status - PartyMon1)" +MON_HP EQUS "(PartyMon1HP - PartyMon1)" +MON_MAXHP EQUS "(PartyMon1MaxHP - PartyMon1)" +MON_ATK EQUS "(PartyMon1Attack - PartyMon1)" +MON_DEF EQUS "(PartyMon1Defense - PartyMon1)" +MON_SPD EQUS "(PartyMon1Speed - PartyMon1)" +MON_SAT EQUS "(PartyMon1SpclAtk - PartyMon1)" +MON_SDF EQUS "(PartyMon1SpclDef - PartyMon1)" +BOXMON_STRUCT_LENGTH EQUS "(PartyMon1End - PartyMon1)" +PARTYMON_STRUCT_LENGTH EQUS "(PartyMon1StatsEnd - PartyMon1)" +SCRATCHMON_STRUCT_LENGTH EQUS "(PartyMon1StatsEnd - PartyMon1Item)" const_value SET 1 const MONMENU_CUT ; 1 diff --git a/event/dratini.asm b/event/dratini.asm index aa1d7a0f4..24876f9f4 100644 --- a/event/dratini.asm +++ b/event/dratini.asm @@ -59,7 +59,7 @@ endr call GetFarByte ; get the address of the move's PP and update the PP - ld hl, (MON_PP) - (MON_MOVES) + ld hl, MON_PP - MON_MOVES add hl, de ld [hl], a diff --git a/items/item_effects.asm b/items/item_effects.asm index 0b67efce5..a8551d30c 100644 --- a/items/item_effects.asm +++ b/items/item_effects.asm @@ -1338,11 +1338,11 @@ Functioneed9: ; eed9 ; eeeb Table_eeeb: ; eeeb - db HP_UP, (MON_HP_EXP) - (MON_STAT_EXP) - db PROTEIN, (MON_ATK_EXP) - (MON_STAT_EXP) - db IRON, (MON_DEF_EXP) - (MON_STAT_EXP) - db CARBOS, (MON_SPD_EXP) - (MON_STAT_EXP) - db CALCIUM, (MON_SPC_EXP) - (MON_STAT_EXP) + db HP_UP, MON_HP_EXP - MON_STAT_EXP + db PROTEIN, MON_ATK_EXP - MON_STAT_EXP + db IRON, MON_DEF_EXP - MON_STAT_EXP + db CARBOS, MON_SPD_EXP - MON_STAT_EXP + db CALCIUM, MON_SPC_EXP - MON_STAT_EXP ; eef5 @@ -2641,7 +2641,7 @@ Functionf652: ; f652 rept NUM_MOVES + 2 ; BattleMonPP - BattleMonMoves inc de endr - ld bc, (MON_PP) - (MON_MOVES) + ld bc, MON_PP - MON_MOVES add hl, bc ld a, [hl] ld [de], a @@ -3111,7 +3111,7 @@ Functionf84c: ; f84c ld de, Buffer1 predef FillPP pop hl - ld bc, (MON_PP) - (MON_MOVES) + ld bc, MON_PP - MON_MOVES add hl, bc ld de, Buffer1 ld b, 0 @@ -3279,7 +3279,7 @@ Functionf8ec: ; f8ec pop hl push bc - ld bc, (MON_PP) - (MON_MOVES) + ld bc, MON_PP - MON_MOVES ld a, [MonType] cp WILDMON jr nz, .notwild diff --git a/main.asm b/main.asm index d272e5c7a..e14f964d0 100644 --- a/main.asm +++ b/main.asm @@ -1642,7 +1642,7 @@ LearnMove: ; 6508 .learn ld a, [wd262] ld [hl], a - ld bc, (MON_PP) - (MON_MOVES) + ld bc, MON_PP - MON_MOVES add hl, bc push hl @@ -9232,7 +9232,7 @@ Functione039: ; e039 cp [hl] jr z, .asm_e131 ld hl, sPartyScratch1 - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes push hl add hl, bc @@ -9242,11 +9242,11 @@ Functione039: ; e039 .asm_e11a push bc push hl - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call CopyBytes pop hl push hl - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH add hl, bc pop de pop bc @@ -9357,7 +9357,7 @@ endr srl c pop hl push bc - ld bc, (MON_DVS) - (MON_HP_EXP) + 1 + ld bc, MON_DVS - MON_HP_EXP + 1 add hl, bc pop bc ld a, c @@ -13536,12 +13536,12 @@ Function12cfe: ; 12cfe (4:6cfe) ld [de], a ld a, [CurPartyMon] ld hl, sPartyScratch1 - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes ld d, h ld e, l ld hl, DefaultFlypoint - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH ld a, BANK(sPartyScratch1) call GetSRAMBank call CopyBytes @@ -26053,7 +26053,7 @@ Function28595: ; 28595 .next pop de - ld hl, (SCRATCHMON_STRUCT_LENGTH) + ld hl, SCRATCHMON_STRUCT_LENGTH add hl, de ld d, h ld e, l @@ -26916,13 +26916,13 @@ Function28b87: ; 28b87 .asm_28c7b ld hl, sPartyScratch1 ld a, [DefaultFlypoint] - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes ld a, BANK(sPartyScratch1) call GetSRAMBank ld d, h ld e, l - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH add hl, bc ld a, [DefaultFlypoint] ld c, a @@ -26932,7 +26932,7 @@ Function28b87: ; 28b87 cp $6 jr z, .asm_28ca6 push bc - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call CopyBytes pop bc jr .asm_28c96 @@ -26941,15 +26941,15 @@ Function28b87: ; 28b87 ld hl, sPartyScratch1 ld a, [PartyCount] dec a - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes push hl ld hl, wc9f4 ld a, [wd003] - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes pop de - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call CopyBytes call CloseSRAM ld hl, PlayerName @@ -32105,7 +32105,7 @@ FindFirstAliveMon: ; 2ee2f jr nz, .loop .okay - ld de, (MON_LEVEL) - (MON_HP) + ld de, MON_LEVEL - MON_HP add hl, de ld a, [hl] ld [BattleMonLevel], a @@ -33505,7 +33505,7 @@ FillMoves: ; 424e1 jr z, .NextMove push hl ld a, [hl] - ld hl, (MON_PP) - (MON_MOVES) + ld hl, MON_PP - MON_MOVES add hl, de push hl dec a @@ -34126,23 +34126,23 @@ Function4456e: ; 4456e call Function44648 cp $a jr nc, .asm_445be - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH ld hl, s0_a835 call AddNTimes ld d, h ld e, l ld a, [CurPartyMon] - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH ld hl, sPartyScratch1 call AddNTimes push hl ld a, BANK(s0_a834) call GetSRAMBank - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call CopyBytes pop hl xor a - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call ByteFill ld a, MON_ITEM call GetPartyParamLocation @@ -34164,7 +34164,7 @@ Function445c0: ; 445c0 (11:45c0) ld a, b push bc ld hl, s0_a835 - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes push hl add hl, bc @@ -34175,7 +34175,7 @@ Function445c0: ; 445c0 (11:45c0) cp $9 jr z, .done push bc - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call CopyBytes pop bc inc b @@ -34184,7 +34184,7 @@ Function445c0: ; 445c0 (11:45c0) ld h, d ld l, e xor a - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call ByteFill ld hl, s0_a834 dec [hl] @@ -34194,7 +34194,7 @@ Function445c0: ; 445c0 (11:45c0) ReadMailMessage: ; 445f4 ld a, b ld hl, s0_a835 - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes ld d, h ld e, l @@ -34206,22 +34206,22 @@ Function44607: ; 44607 call GetSRAMBank push bc ld a, b - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH ld hl, s0_a835 call AddNTimes push hl ld a, [CurPartyMon] - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH ld hl, sPartyScratch1 call AddNTimes ld d, h ld e, l pop hl push hl - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call CopyBytes pop hl - ld de, (PARTYMON_STRUCT_LENGTH) - (MON_MOVES) + ld de, PARTYMON_STRUCT_LENGTH - MON_MOVES add hl, de ld d, [hl] ld a, [CurPartyMon] @@ -34260,7 +34260,7 @@ Function44654:: ; 44654 call GetSRAMBank ld a, [CurPartyMon] ld hl, sPartyScratch1 - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes ld d, h ld e, l @@ -34363,11 +34363,11 @@ BackupScratchmons: ; 44725 call GetSRAMBank ld hl, sPartyScratch1 ld de, sPartyScratch2 - ld bc, 6 * (SCRATCHMON_STRUCT_LENGTH) + ld bc, 6 * SCRATCHMON_STRUCT_LENGTH call CopyBytes ld hl, s0_a834 ld de, s0_aa0b - ld bc, 1 + 10 * (SCRATCHMON_STRUCT_LENGTH) + ld bc, 1 + 10 * SCRATCHMON_STRUCT_LENGTH call CopyBytes jp CloseSRAM ; 44745 @@ -34377,11 +34377,11 @@ RestoreScratchmons: ; 44745 (11:4745) call GetSRAMBank ld hl, sPartyScratch2 ld de, sPartyScratch1 - ld bc, 6 * (SCRATCHMON_STRUCT_LENGTH) + ld bc, 6 * SCRATCHMON_STRUCT_LENGTH call CopyBytes ld hl, s0_aa0b ld de, s0_a834 - ld bc, 1 + 10 * (SCRATCHMON_STRUCT_LENGTH) + ld bc, 1 + 10 * SCRATCHMON_STRUCT_LENGTH call CopyBytes jp CloseSRAM @@ -34390,11 +34390,11 @@ DeleteScratchmons: ; 44765 (11:4765) call GetSRAMBank xor a ld hl, sPartyScratch1 - ld bc, 6 * (SCRATCHMON_STRUCT_LENGTH) + ld bc, 6 * SCRATCHMON_STRUCT_LENGTH call ByteFill xor a ld hl, s0_a834 - ld bc, 1 + 10 * (SCRATCHMON_STRUCT_LENGTH) + ld bc, 1 + 10 * SCRATCHMON_STRUCT_LENGTH call ByteFill jp CloseSRAM ; 44781 (11:4781) @@ -34471,7 +34471,7 @@ InitMail: ; 0x447b9 Function447da: ; 0x447da dec a - ld hl, s0_a835 + (MON_HP) - 1 + ld hl, s0_a835 + MON_HP - 1 ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes ld a, BANK(s0_a834) @@ -63031,7 +63031,7 @@ INCLUDE "engine/radio.asm" ReadPartyMonMail: ; b9229 ld a, [CurPartyMon] ld hl, sPartyScratch1 - ld bc, (SCRATCHMON_STRUCT_LENGTH) + ld bc, SCRATCHMON_STRUCT_LENGTH call AddNTimes ld d, h ld e, l diff --git a/sram.asm b/sram.asm index 9656636af..67a4b73e9 100644 --- a/sram.asm +++ b/sram.asm @@ -9,12 +9,12 @@ sScratch:: SECTION "SRAM Bank 0", SRAM [$a600], BANK [0] -sPartyScratch1:: ds 6 * (SCRATCHMON_STRUCT_LENGTH) -sPartyScratch2:: ds 6 * (SCRATCHMON_STRUCT_LENGTH) +sPartyScratch1:: ds 6 * SCRATCHMON_STRUCT_LENGTH +sPartyScratch2:: ds 6 * SCRATCHMON_STRUCT_LENGTH s0_a834:: ds 1 -s0_a835:: ds 10 * (SCRATCHMON_STRUCT_LENGTH) +s0_a835:: ds 10 * SCRATCHMON_STRUCT_LENGTH s0_aa0b:: ds 1 -s0_aa0c:: ds 10 * (SCRATCHMON_STRUCT_LENGTH) +s0_aa0c:: ds 10 * SCRATCHMON_STRUCT_LENGTH sMysteryGiftItem:: ds 1 s0_abe3:: ds 1