From 3d34f5a5a371ad2b9979ae36763cdfb52c581dab Mon Sep 17 00:00:00 2001 From: mid-kid Date: Thu, 22 Feb 2018 21:35:11 +0100 Subject: [PATCH] Label wPokemonWithdrawDepositParameter of RemoveMonFromPartyOrBox It takes a clearly different parameter, completely unrelated and different in function to PC_DEPOSIT and PC_WITHDRAW. --- constants/wram_constants.asm | 2 ++ engine/billspc.asm | 12 ++++++------ engine/events/special.asm | 2 +- engine/link.asm | 2 +- engine/mail.asm | 2 +- engine/move_mon.asm | 4 ++-- engine/npctrade.asm | 4 ++-- mobile/mobile_40.asm | 2 +- mobile/mobile_46.asm | 2 +- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm index 074f8a7de..631bf6482 100644 --- a/constants/wram_constants.asm +++ b/constants/wram_constants.asm @@ -128,6 +128,8 @@ SPAWN_RED EQU 2 ; wPokemonWithdrawDepositParameter PC_WITHDRAW EQU 0 PC_DEPOSIT EQU 1 +REMOVE_PARTY EQU 0 +REMOVE_BOX EQU 1 DAY_CARE_WITHDRAW EQU 2 DAY_CARE_DEPOSIT EQU 3 diff --git a/engine/billspc.asm b/engine/billspc.asm index 639db4205..42a761634 100755 --- a/engine/billspc.asm +++ b/engine/billspc.asm @@ -203,7 +203,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) ld hl, wBillsPC_ScrollPosition add [hl] ld [wCurPartyMon], a - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox call ReleasePKMN_ByePKMN @@ -463,7 +463,7 @@ BillsPC_Withdraw: ; e2675 (38:6675) ld hl, wBillsPC_ScrollPosition add [hl] ld [wCurPartyMon], a - ld a, PC_DEPOSIT + ld a, REMOVE_BOX ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox call ReleasePKMN_ByePKMN @@ -1821,7 +1821,7 @@ DepositPokemon: ; e307c (38:707c) ld [wPokemonWithdrawDepositParameter], a predef SendGetMonIntoFromBox jr c, .asm_boxisfull - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox ld a, [wCurPartySpecies] @@ -1876,7 +1876,7 @@ TryWithdrawPokemon: ; e30fa (38:70fa) ld [wPokemonWithdrawDepositParameter], a predef SendGetMonIntoFromBox jr c, .PartyFull - ld a, PC_DEPOSIT + ld a, REMOVE_BOX ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox ld a, [wCurPartySpecies] @@ -2113,7 +2113,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7 call CopyMonToTemp call CloseSRAM farcall CalcBufferMonStats - ld a, PC_DEPOSIT + ld a, REMOVE_BOX ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox ret @@ -2146,7 +2146,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7 ld hl, wPartyMon1Species ld bc, PARTYMON_STRUCT_LENGTH call CopyMonToTemp - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox ret diff --git a/engine/events/special.asm b/engine/events/special.asm index 081606512..e23aaae8c 100755 --- a/engine/events/special.asm +++ b/engine/events/special.asm @@ -118,7 +118,7 @@ Special_ReturnShuckle: ; 737e cp 150 ld a, SHUCKIE_HAPPY jr nc, .HappyToStayWithYou - xor a ; take from pc + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a callfar RemoveMonFromPartyOrBox ld a, SHUCKIE_RETURNED diff --git a/engine/link.asm b/engine/link.asm index 4c22e18ea..238ccb7f7 100755 --- a/engine/link.asm +++ b/engine/link.asm @@ -1863,7 +1863,7 @@ LinkTrade: ; 28b87 add hl, bc ld a, [hl] ld [wd002], a - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a callfar RemoveMonFromPartyOrBox ld a, [wPartyCount] diff --git a/engine/mail.asm b/engine/mail.asm index c1a2db5aa..a8e9bd2c5 100755 --- a/engine/mail.asm +++ b/engine/mail.asm @@ -175,7 +175,7 @@ CheckPokeItem:: ; 44654 farcall CheckCurPartyMonFainted ld a, POKEMAIL_LAST_MON jr c, .close_sram_return - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox ld a, POKEMAIL_CORRECT diff --git a/engine/move_mon.asm b/engine/move_mon.asm index a3600d2f0..0a4465f97 100755 --- a/engine/move_mon.asm +++ b/engine/move_mon.asm @@ -918,7 +918,7 @@ GetLastPartyMon: ; de1a DepositMonWithDayCareMan: ; de2a ld de, wBreedMon1Nick call DepositBreedmon - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a jp RemoveMonFromPartyOrBox ; de37 @@ -926,7 +926,7 @@ DepositMonWithDayCareMan: ; de2a DepositMonWithDayCareLady: ; de37 ld de, wBreedMon2Nick call DepositBreedmon - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a jp RemoveMonFromPartyOrBox ; de44 diff --git a/engine/npctrade.asm b/engine/npctrade.asm index 7082d5442..49f7123e1 100755 --- a/engine/npctrade.asm +++ b/engine/npctrade.asm @@ -185,8 +185,8 @@ DoNPCTrade: ; fcc63 ld a, [wOTTrademonSpecies] ld [wCurPartySpecies], a xor a - ld [wMonType], a - ld [wPokemonWithdrawDepositParameter], a + ld [wMonType], a ; PARTYMON + ld [wPokemonWithdrawDepositParameter], a ; REMOVE_PARTY callfar RemoveMonFromPartyOrBox predef TryAddMonToParty diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index b96e6c470..1c1ae16ee 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -5410,7 +5410,7 @@ Function1023c6: ; 1023c6 ld a, [wcd4c] dec a ld [wCurPartyMon], a - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox ld hl, wPartyCount diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm index 3d8a126f7..73d92b21f 100755 --- a/mobile/mobile_46.asm +++ b/mobile/mobile_46.asm @@ -7323,7 +7323,7 @@ Function11b5c0: ; 11b5c0 ld a, [wcd82] dec a ld [wCurPartyMon], a - xor a + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox farcall Function170807