shithub: pokecrystal

Download patch

ref: eb39f6a3396b21047a11dd871263c6dbc5f2c65f
parent: 2cbb1acc6e3bc5fe30d1be8f665d2252703518ac
author: PikalaxALT <[email protected]>
date: Sat Nov 7 08:05:58 EST 2015

Move MON_* parentheses to the EQUS declaration

--- a/battle/core.asm
+++ b/battle/core.asm
@@ -4068,16 +4068,16 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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
 
--- a/constants/pokemon_constants.asm
+++ b/constants/pokemon_constants.asm
@@ -260,38 +260,38 @@
 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
--- a/event/dratini.asm
+++ b/event/dratini.asm
@@ -59,7 +59,7 @@
 	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
 
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -1338,11 +1338,11 @@
 ; 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 @@
 	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 @@
 	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 @@
 	pop hl
 
 	push bc
-	ld bc, (MON_PP) - (MON_MOVES)
+	ld bc, MON_PP - MON_MOVES
 	ld a, [MonType]
 	cp WILDMON
 	jr nz, .notwild
--- a/main.asm
+++ b/main.asm
@@ -1642,7 +1642,7 @@
 .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 @@
 	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 @@
 .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 @@
 	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 @@
 	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 @@
 
 .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 @@
 .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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 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,12 +34206,12 @@
 	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
@@ -34218,10 +34218,10 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 
 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 @@
 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
--- a/sram.asm
+++ b/sram.asm
@@ -9,12 +9,12 @@
 
 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