Miscellaneous labels

This commit is contained in:
PikalaxALT 2015-12-13 20:33:56 -05:00
parent 259c155187
commit 8a439dbd05
14 changed files with 236 additions and 232 deletions

View File

@ -205,7 +205,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0)
ld [CurPartyMon], a ld [CurPartyMon], a
xor a xor a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callba Functione039 callba RemoveMonFromPartyOrBox
call Functione3180 call Functione3180
ld a, $0 ld a, $0
ld [wJumptableIndex], a ld [wJumptableIndex], a
@ -468,7 +468,7 @@ endr
ld [CurPartyMon], a ld [CurPartyMon], a
ld a, PC_DEPOSIT ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callba Functione039 callba RemoveMonFromPartyOrBox
call Functione3180 call Functione3180
ld a, $0 ld a, $0
ld [wJumptableIndex], a ld [wJumptableIndex], a
@ -1880,7 +1880,7 @@ Functione307c: ; e307c (38:707c)
jr c, .asm_boxisfull jr c, .asm_boxisfull
xor a xor a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callba Functione039 callba RemoveMonFromPartyOrBox
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
call PlayCry call PlayCry
hlcoord 0, 0 hlcoord 0, 0
@ -1935,7 +1935,7 @@ TryWithdrawPokemon: ; e30fa (38:70fa)
jr c, .PartyFull jr c, .PartyFull
ld a, PC_DEPOSIT ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callba Functione039 callba RemoveMonFromPartyOrBox
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
call PlayCry call PlayCry
hlcoord 0, 0 hlcoord 0, 0
@ -2173,7 +2173,7 @@ Functione32b0: ; e32b0
callba Function5088b callba Function5088b
ld a, PC_DEPOSIT ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callba Functione039 callba RemoveMonFromPartyOrBox
ret ret
; e32fa ; e32fa
@ -2206,7 +2206,7 @@ Functione3316: ; e3316
call CopyMonToTemp call CopyMonToTemp
xor a xor a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callba Functione039 callba RemoveMonFromPartyOrBox
ret ret
; e3346 ; e3346

View File

@ -114,7 +114,7 @@ BuySellToss_InterpretJoypad: ; 2500e
.right .right
ld a, [wItemQuantityChangeBuffer] ld a, [wItemQuantityChangeBuffer]
add $a add 10
ld b, a ld b, a
ld a, [wItemQuantityBuffer] ld a, [wItemQuantityBuffer]
cp b cp b

View File

@ -1886,7 +1886,7 @@ Function28b87: ; 28b87
ld [wd002], a ld [wd002], a
xor a xor a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callab Functione039 callab RemoveMonFromPartyOrBox
ld a, [PartyCount] ld a, [PartyCount]
dec a dec a
ld [CurPartyMon], a ld [CurPartyMon], a

View File

@ -177,7 +177,7 @@ CheckPokeItem:: ; 44654
jr c, .close_sram_return jr c, .close_sram_return
xor a xor a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callba Functione039 callba RemoveMonFromPartyOrBox
ld a, $1 ld a, $1
.close_sram_return .close_sram_return

View File

@ -40,7 +40,7 @@ NPCTrade:: ; fcba8
; Select givemon from party ; Select givemon from party
ld b, 6 ld b, 6
callba Function5001d callba SelectTradeOrDaycareMon
ld a, TRADE_CANCEL ld a, TRADE_CANCEL
jr c, .done jr c, .done
@ -100,23 +100,23 @@ CheckTradeGender: ; fcc23
call GetTradeAttribute call GetTradeAttribute
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_fcc46 jr z, .matching
cp 1 cp 1
jr z, .asm_fcc3e jr z, .check_male
callba GetGender callba GetGender
jr nz, .asm_fcc48 jr nz, .not_matching
jr .asm_fcc46 jr .matching
.asm_fcc3e .check_male
callba GetGender callba GetGender
jr z, .asm_fcc48 jr z, .not_matching
.asm_fcc46 .matching
and a and a
ret ret
.asm_fcc48 .not_matching
scf scf
ret ret
; fcc4a ; fcc4a
@ -211,7 +211,7 @@ DoNPCTrade: ; fcc63
xor a xor a
ld [MonType], a ld [MonType], a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callab Functione039 callab RemoveMonFromPartyOrBox
predef TryAddMonToParty predef TryAddMonToParty
ld e, TRADE_DIALOG ld e, TRADE_DIALOG
@ -219,9 +219,9 @@ DoNPCTrade: ; fcc63
ld a, [hl] ld a, [hl]
cp TRADE_COMPLETE cp TRADE_COMPLETE
ld b, RESET_FLAG ld b, RESET_FLAG
jr c, .asm_fcd1c jr c, .incomplete
ld b, SET_FLAG ld b, SET_FLAG
.asm_fcd1c .incomplete
callba SetGiftPartyMonCaughtData callba SetGiftPartyMonCaughtData
ld e, TRADE_NICK ld e, TRADE_NICK
@ -291,7 +291,7 @@ DoNPCTrade: ; fcc63
ld a, [PartyCount] ld a, [PartyCount]
dec a dec a
ld [CurPartyMon], a ld [CurPartyMon], a
callba Functione134 callba ComputeNPCTrademonStats
pop af pop af
ld [CurPartyMon], a ld [CurPartyMon], a
pop hl pop hl

View File

@ -13,7 +13,7 @@ SelectMonFromParty: ; 50000
; 5001d ; 5001d
Function5001d: ; 5001d SelectTradeOrDaycareMon: ; 5001d
ld a, b ld a, b
ld [PartyMenuActionText], a ld [PartyMenuActionText], a
call DisableSpriteUpdates call DisableSpriteUpdates

View File

@ -62,9 +62,9 @@ EnterWestConnection: ; 1045ed
.skip_to_load .skip_to_load
ld a, l ld a, l
ld [wd194], a ld [wOverworldMapAnchor], a
ld a, h ld a, h
ld [wd194 + 1], a ld [wOverworldMapAnchor + 1], a
jp EnteredConnection jp EnteredConnection
; 104629 ; 104629
@ -99,9 +99,9 @@ EnterEastConnection: ; 104629
.skip_to_load .skip_to_load
ld a, l ld a, l
ld [wd194], a ld [wOverworldMapAnchor], a
ld a, h ld a, h
ld [wd194 + 1], a ld [wOverworldMapAnchor + 1], a
jp EnteredConnection jp EnteredConnection
; 104665 ; 104665
@ -126,9 +126,9 @@ EnterNorthConnection: ; 104665
srl c srl c
add hl, bc add hl, bc
ld a, l ld a, l
ld [wd194], a ld [wOverworldMapAnchor], a
ld a, h ld a, h
ld [wd194 + 1], a ld [wOverworldMapAnchor + 1], a
jp EnteredConnection jp EnteredConnection
; 104696 ; 104696
@ -153,9 +153,9 @@ EnterSouthConnection: ; 104696
srl c srl c
add hl, bc add hl, bc
ld a, l ld a, l
ld [wd194], a ld [wOverworldMapAnchor], a
ld a, h ld a, h
ld [wd194 + 1], a ld [wOverworldMapAnchor + 1], a
; fallthrough ; fallthrough
; 1046c4 ; 1046c4
@ -427,14 +427,14 @@ GetCoordOfUpperLeftCorner:: ; 10486d
.resume2 .resume2
call AddNTimes call AddNTimes
ld a, l ld a, l
ld [wd194], a ld [wOverworldMapAnchor], a
ld a, h ld a, h
ld [wd194 + 1], a ld [wOverworldMapAnchor + 1], a
ld a, [YCoord] ld a, [YCoord]
and $1 and $1
ld [wd196], a ld [wMetatileStandingY], a
ld a, [XCoord] ld a, [XCoord]
and $1 and $1
ld [wd197], a ld [wMetatileStandingX], a
ret ret
; 1048ba ; 1048ba

View File

@ -103,7 +103,7 @@ Function16798: ; 16798
ld a, 4 ld a, 4
call Function1689b call Function1689b
ld b, 6 ld b, 6
callba Function5001d callba SelectTradeOrDaycareMon
jr c, .asm_167dd jr c, .asm_167dd
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
cp EGG cp EGG

View File

@ -322,7 +322,7 @@ Function8ce14: ; 8ce14
Function8ce19: ; 8ce19 Function8ce19: ; 8ce19
ld d, $55 ld d, $55
ld a, [wd194 + 1] ld a, [wOverworldMapAnchor + 1]
ld e, a ld e, a
ld b, SPRITE_ANIM_INDEX_15 ld b, SPRITE_ANIM_INDEX_15
ld a, [rSVBK] ld a, [rSVBK]
@ -386,7 +386,7 @@ Function8ce6d: ; 8ce6d
; 8ce7a ; 8ce7a
Function8ce7a: ; 8ce7a Function8ce7a: ; 8ce7a
ld hl, wd194 ld hl, wOverworldMapAnchor
ld a, [wcf65] ld a, [wcf65]
cp [hl] cp [hl]
jr z, .asm_8ce9e jr z, .asm_8ce9e

View File

@ -124,10 +124,10 @@ LoadMapPart:: ; 217a
; 2198 ; 2198
LoadMetatiles:: ; 2198 LoadMetatiles:: ; 2198
; de <- wd194 ; de <- wOverworldMapAnchor
ld a, [wd194] ld a, [wOverworldMapAnchor]
ld e, a ld e, a
ld a, [wd194 + 1] ld a, [wOverworldMapAnchor + 1]
ld d, a ld d, a
ld hl, wMisc ld hl, wMisc
ld b, 5 ; SCREEN_WIDTH / 4 ld b, 5 ; SCREEN_WIDTH / 4
@ -1272,7 +1272,7 @@ ScrollMapUp:: ; 2748
ret ret
; 2771 ; 2771
ScrollMapLeft:: ; 2771 ScrollMapRight:: ; 2771
hlcoord 0, 0 hlcoord 0, 0
ld de, BGMapBuffer ld de, BGMapBuffer
call BackupBGMapColumn call BackupBGMapColumn
@ -1288,7 +1288,7 @@ ScrollMapLeft:: ; 2771
ret ret
; 278f ; 278f
ScrollMapRight:: ; 278f ScrollMapLeft:: ; 278f
hlcoord SCREEN_WIDTH - 2, 0 hlcoord SCREEN_WIDTH - 2, 0
ld de, BGMapBuffer ld de, BGMapBuffer
call BackupBGMapColumn call BackupBGMapColumn
@ -1468,7 +1468,7 @@ LoadTileset:: ; 2821
; 2879 ; 2879
BufferScreen:: ; 2879 BufferScreen:: ; 2879
ld hl, wd194 ld hl, wOverworldMapAnchor
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
@ -1497,7 +1497,7 @@ BufferScreen:: ; 2879
; 289d ; 289d
SaveScreen:: ; 289d SaveScreen:: ; 289d
ld hl, wd194 ld hl, wOverworldMapAnchor
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
@ -1547,7 +1547,7 @@ SaveScreen:: ; 289d
LoadNeighboringBlockData:: ; 28e3 LoadNeighboringBlockData:: ; 28e3
ld hl, wd194 ld hl, wOverworldMapAnchor
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a

364
main.asm
View File

@ -435,9 +435,9 @@ DaycareStep:: ; 7282
dec hl dec hl
inc [hl] inc [hl]
ld a, [hl] ld a, [hl]
cp $50 cp 5242880 / $10000
jr c, .daycare_lady jr c, .daycare_lady
ld a, $50 ld a, 5242880 / $10000
ld [hl], a ld [hl], a
.daycare_lady .daycare_lady
@ -620,9 +620,8 @@ SpecialReturnShuckle: ; 737e
jr nc, .HappyToStayWithYou jr nc, .HappyToStayWithYou
xor a ; take from pc xor a ; take from pc
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callab Functione039 callab RemoveMonFromPartyOrBox
ld a, $2 ld a, $2
.HappyToStayWithYou .HappyToStayWithYou
ld [ScriptVar], a ld [ScriptVar], a
ret ret
@ -4812,21 +4811,24 @@ Functiond497:: ; d497 (3:5497)
and a and a
ret z ret z
bit 7, a bit 7, a
jr nz, .asm_d4a9 jr nz, .update_overworld_map
bit 6, a bit 6, a
jr nz, .asm_d4b3 jr nz, .update_player_coords
bit 5, a bit 5, a
jr nz, .asm_d4b8 jr nz, .finish
ret ret
.asm_d4a9
.update_overworld_map
ld a, $4 ld a, $4
ld [wd13f], a ld [wd13f], a
call Functiond536 call UpdateOverworldMap
jr .asm_d4b8 jr .finish
.asm_d4b3
call Functiond511 .update_player_coords
jr .asm_d4b8 call UpdatePlayerCoords
.asm_d4b8 jr .finish
.finish
call Functiond4e5 call Functiond4e5
ld a, [wPlayerStepVectorX] ld a, [wPlayerStepVectorX]
ld d, a ld d, a
@ -4860,22 +4862,23 @@ Functiond4e5: ; d4e5 (3:54e5)
ret z ret z
dec [hl] dec [hl]
ld a, [hl] ld a, [hl]
ld hl, Jumptable_d4f2 ld hl, .Jumptable
rst JumpTable rst JumpTable
ret ret
Jumptable_d4f2: ; d4f2 (3:54f2) .Jumptable: ; d4f2 (3:54f2)
dw GetMovementPermissions jumptable_start
dw BufferScreen jumptable GetMovementPermissions
dw .mobile jumptable BufferScreen
dw .fail2 jumptable .mobile
dw .fail1 jumptable .fail2
dw .fail1 jumptable .fail1
dw .fail1 jumptable .fail1
dw .fail1 jumptable .fail1
dw .fail1 jumptable .fail1
dw .fail1 jumptable .fail1
dw .fail1 jumptable .fail1
jumptable .fail1
.fail1: ; d508 (3:5508) .fail1: ; d508 (3:5508)
ret ret
@ -4887,71 +4890,74 @@ Jumptable_d4f2: ; d4f2 (3:54f2)
.fail2: ; d510 (3:5510) .fail2: ; d510 (3:5510)
ret ret
Functiond511: ; d511 (3:5511) UpdatePlayerCoords: ; d511 (3:5511)
ld a, [wPlayerStepDirection] ld a, [wPlayerStepDirection]
and a and a
jr nz, .asm_d51c jr nz, .check_step_down
ld hl, YCoord ld hl, YCoord
inc [hl] inc [hl]
ret ret
.asm_d51c
cp $1 .check_step_down
jr nz, .asm_d525 cp UP
jr nz, .check_step_left
ld hl, YCoord ld hl, YCoord
dec [hl] dec [hl]
ret ret
.asm_d525
cp $2 .check_step_left
jr nz, .asm_d52e cp LEFT
jr nz, .check_step_right
ld hl, XCoord ld hl, XCoord
dec [hl] dec [hl]
ret ret
.asm_d52e
cp $3 .check_step_right
cp RIGHT
ret nz ret nz
ld hl, XCoord ld hl, XCoord
inc [hl] inc [hl]
ret ret
Functiond536: ; d536 (3:5536) UpdateOverworldMap: ; d536 (3:5536)
ld a, [wPlayerStepDirection] ld a, [wPlayerStepDirection]
and a and a
jr z, .asm_d549 jr z, .step_down
cp $1 cp UP
jr z, .asm_d553 jr z, .step_up
cp $2 cp LEFT
jr z, .asm_d55d jr z, .step_left
cp $3 cp RIGHT
jr z, .asm_d567 jr z, .step_right
ret ret
.asm_d549 .step_down
call Functiond571 call .ScrollOverworldMapDown
call LoadMapPart call LoadMapPart
call ScrollMapUp call ScrollMapUp
ret ret
.asm_d553 .step_up
call Functiond5a2 call .ScrollOverworldMapUp
call LoadMapPart call LoadMapPart
call ScrollMapDown call ScrollMapDown
ret ret
.asm_d55d .step_left
call Functiond5d5 call .ScrollOverworldMapLeft
call LoadMapPart
call ScrollMapLeft
ret
.asm_d567
call Functiond5fe
call LoadMapPart call LoadMapPart
call ScrollMapRight call ScrollMapRight
ret ret
Functiond571: ; d571 (3:5571) .step_right
call .ScrollOverworldMapRight
call LoadMapPart
call ScrollMapLeft
ret
.ScrollOverworldMapDown: ; d571 (3:5571)
ld a, [wBGMapAnchor] ld a, [wBGMapAnchor]
add $40 add 2 * BG_MAP_WIDTH
ld [wBGMapAnchor], a ld [wBGMapAnchor], a
jr nc, .not_overflowed jr nc, .not_overflowed
ld a, [wBGMapAnchor + 1] ld a, [wBGMapAnchor + 1]
@ -4960,29 +4966,29 @@ Functiond571: ; d571 (3:5571)
or VBGMap0 / $100 or VBGMap0 / $100
ld [wBGMapAnchor + 1], a ld [wBGMapAnchor + 1], a
.not_overflowed .not_overflowed
ld hl, wd196 ld hl, wMetatileStandingY
inc [hl] inc [hl]
ld a, [hl] ld a, [hl]
cp $2 ; was 1 cp 2 ; was 1
jr nz, .skip jr nz, .done_down
ld [hl], $0 ld [hl], 0
call Functiond595 call .Add6ToOverworldMapAnchor
.skip .done_down
ret ret
Functiond595: ; d595 (3:5595) .Add6ToOverworldMapAnchor: ; d595 (3:5595)
ld hl, wd194 ld hl, wOverworldMapAnchor
ld a, [MapWidth] ld a, [MapWidth]
add $6 add 6
add [hl] add [hl]
ld [hli], a ld [hli], a
ret nc ret nc
inc [hl] inc [hl]
ret ret
Functiond5a2: ; d5a2 (3:55a2) .ScrollOverworldMapUp: ; d5a2 (3:55a2)
ld a, [wBGMapAnchor] ld a, [wBGMapAnchor]
sub $40 sub 2 * BG_MAP_WIDTH
ld [wBGMapAnchor], a ld [wBGMapAnchor], a
jr nc, .not_underflowed jr nc, .not_underflowed
ld a, [wBGMapAnchor + 1] ld a, [wBGMapAnchor + 1]
@ -4991,20 +4997,20 @@ Functiond5a2: ; d5a2 (3:55a2)
or VBGMap0 / $100 or VBGMap0 / $100
ld [wBGMapAnchor + 1], a ld [wBGMapAnchor + 1], a
.not_underflowed .not_underflowed
ld hl, wd196 ld hl, wMetatileStandingY
dec [hl] dec [hl]
ld a, [hl] ld a, [hl]
cp $ff ; was 0 cp -1 ; was 0
jr nz, .skip jr nz, .done_up
ld [hl], $1 ld [hl], $1
call Functiond5c6 call .Sub6FromOverworldMapAnchor
.skip .done_up
ret ret
Functiond5c6: ; d5c6 (3:55c6) .Sub6FromOverworldMapAnchor: ; d5c6 (3:55c6)
ld hl, wd194 ld hl, wOverworldMapAnchor
ld a, [MapWidth] ld a, [MapWidth]
add $6 add 6
ld b, a ld b, a
ld a, [hl] ld a, [hl]
sub b sub b
@ -5013,7 +5019,7 @@ Functiond5c6: ; d5c6 (3:55c6)
dec [hl] dec [hl]
ret ret
Functiond5d5: ; d5d5 (3:55d5) .ScrollOverworldMapLeft: ; d5d5 (3:55d5)
ld a, [wBGMapAnchor] ld a, [wBGMapAnchor]
ld e, a ld e, a
and $e0 and $e0
@ -5023,26 +5029,26 @@ Functiond5d5: ; d5d5 (3:55d5)
and $1f and $1f
or d or d
ld [wBGMapAnchor], a ld [wBGMapAnchor], a
ld hl, wd197 ld hl, wMetatileStandingX
dec [hl] dec [hl]
ld a, [hl] ld a, [hl]
cp $ff cp -1
jr nz, .asm_d5f3 jr nz, .done_left
ld [hl], $1 ld [hl], 1
call Functiond5f4 call .DecrementwOverworldMapAnchor
.asm_d5f3 .done_left
ret ret
Functiond5f4: ; d5f4 (3:55f4) .DecrementwOverworldMapAnchor: ; d5f4 (3:55f4)
ld hl, wd194 ld hl, wOverworldMapAnchor
ld a, [hl] ld a, [hl]
sub $1 sub 1
ld [hli], a ld [hli], a
ret nc ret nc
dec [hl] dec [hl]
ret ret
Functiond5fe: ; d5fe (3:55fe) .ScrollOverworldMapRight: ; d5fe (3:55fe)
ld a, [wBGMapAnchor] ld a, [wBGMapAnchor]
ld e, a ld e, a
and $e0 and $e0
@ -5052,20 +5058,20 @@ Functiond5fe: ; d5fe (3:55fe)
and $1f and $1f
or d or d
ld [wBGMapAnchor], a ld [wBGMapAnchor], a
ld hl, wd197 ld hl, wMetatileStandingX
inc [hl] inc [hl]
ld a, [hl] ld a, [hl]
cp $2 cp 2
jr nz, .asm_d61c jr nz, .done_right
ld [hl], $0 ld [hl], 0
call .Incrementwd194 call .IncrementwOverworldMapAnchor
.asm_d61c .done_right
ret ret
.Incrementwd194: ; d61d (3:561d) .IncrementwOverworldMapAnchor: ; d61d (3:561d)
ld hl, wd194 ld hl, wOverworldMapAnchor
ld a, [hl] ld a, [hl]
add $1 add 1
ld [hli], a ld [hli], a
ret nc ret nc
inc [hl] inc [hl]
@ -5645,13 +5651,13 @@ endr
ld d, a ld d, a
callab CalcExpAtLevel callab CalcExpAtLevel
pop de pop de
ld a, [hMultiplicand] ld a, [hProduct + 1]
ld [de], a ld [de], a
inc de inc de
ld a, [$ffb5] ld a, [hProduct + 2]
ld [de], a ld [de], a
inc de inc de
ld a, [$ffb6] ld a, [hProduct + 3]
ld [de], a ld [de], a
inc de inc de
xor a xor a
@ -5733,10 +5739,10 @@ endr
ld c, a ld c, a
ld b, $0 ld b, $0
call CalcPkmnStatC call CalcPkmnStatC
ld a, [$ffb5] ld a, [hProduct + 2]
ld [de], a ld [de], a
inc de inc de
ld a, [$ffb6] ld a, [hProduct + 3]
ld [de], a ld [de], a
inc de inc de
jr .next2 jr .next2
@ -6165,7 +6171,6 @@ endr
dec a dec a
ld b, a ld b, a
call Functiondcb6 call Functiondcb6
.CloseSRAM_And_ClearCarryFlag .CloseSRAM_And_ClearCarryFlag
call CloseSRAM call CloseSRAM
and a and a
@ -6211,7 +6216,7 @@ Functiondcb6: ; dcb6
ld a, [hli] ld a, [hli]
and a and a
jr z, .asm_dd18 jr z, .asm_dd18
ld [TempMonMoves+0], a ld [TempMonMoves], a
ld a, BOXMON ld a, BOXMON
ld [MonType], a ld [MonType], a
ld a, b ld a, b
@ -6388,7 +6393,7 @@ Functionde2a: ; de2a
call Functionde44 call Functionde44
xor a xor a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
jp Functione039 jp RemoveMonFromPartyOrBox
; de37 ; de37
Functionde37: ; de37 Functionde37: ; de37
@ -6396,7 +6401,7 @@ Functionde37: ; de37
call Functionde44 call Functionde44
xor a xor a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
jp Functione039 jp RemoveMonFromPartyOrBox
; de44 ; de44
Functionde44: ; de44 Functionde44: ; de44
@ -6423,14 +6428,14 @@ SentPkmnIntoBox: ; de6e
ld de, sBoxCount ld de, sBoxCount
ld a, [de] ld a, [de]
cp MONS_PER_BOX cp MONS_PER_BOX
jp nc, Functiondf42 jp nc, .full
inc a inc a
ld [de], a ld [de], a
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
ld [CurSpecies], a ld [CurSpecies], a
ld c, a ld c, a
.asm_de85 .loop
inc de inc de
ld a, [de] ld a, [de]
ld b, a ld b, a
@ -6438,7 +6443,7 @@ SentPkmnIntoBox: ; de6e
ld c, b ld c, b
ld [de], a ld [de], a
inc a inc a
jr nz, .asm_de85 jr nz, .loop
call GetBaseData call GetBaseData
call ShiftBoxMon call ShiftBoxMon
@ -6474,33 +6479,33 @@ SentPkmnIntoBox: ; de6e
ld d, a ld d, a
callab CalcExpAtLevel callab CalcExpAtLevel
pop de pop de
ld a, [hMultiplicand] ld a, [hProduct + 1]
ld [de], a ld [de], a
inc de inc de
ld a, [$ffb5] ld a, [hProduct + 2]
ld [de], a ld [de], a
inc de inc de
ld a, [$ffb6] ld a, [hProduct + 3]
ld [de], a ld [de], a
inc de inc de
; Set all 5 Experience Values to 0 ; Set all 5 Experience Values to 0
xor a xor a
ld b, 2*5 ld b, 2 * 5
.asm_dee5 .loop2
ld [de], a ld [de], a
inc de inc de
dec b dec b
jr nz, .asm_dee5 jr nz, .loop2
ld hl, EnemyMonDVs ld hl, EnemyMonDVs
ld b, 2 + NUM_MOVES ; DVs and PP ; EnemyMonHappiness - EnemyMonDVs ld b, 2 + NUM_MOVES ; DVs and PP ; EnemyMonHappiness - EnemyMonDVs
.asm_deef .loop3
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
dec b dec b
jr nz, .asm_deef jr nz, .loop3
ld a, BASE_HAPPINESS ld a, BASE_HAPPINESS
ld [de], a ld [de], a
@ -6519,12 +6524,12 @@ SentPkmnIntoBox: ; de6e
call SetSeenAndCaughtMon call SetSeenAndCaughtMon
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
cp UNOWN cp UNOWN
jr nz, .asm_df20 jr nz, .not_unown
ld hl, sBoxMon1DVs ld hl, sBoxMon1DVs
predef GetUnownLetter predef GetUnownLetter
callab UpdateUnownDex callab UpdateUnownDex
.asm_df20 .not_unown
ld hl, sBoxMon1Moves ld hl, sBoxMon1Moves
ld de, TempMonMoves ld de, TempMonMoves
ld bc, NUM_MOVES ld bc, NUM_MOVES
@ -6543,7 +6548,7 @@ SentPkmnIntoBox: ; de6e
ret ret
; df42 ; df42
Functiondf42: ; df42 .full: ; df42
call CloseSRAM call CloseSRAM
and a and a
ret ret
@ -6552,16 +6557,16 @@ Functiondf42: ; df42
ShiftBoxMon: ; df47 ShiftBoxMon: ; df47
ld hl, sBoxMonOT ld hl, sBoxMonOT
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call .asm_df5f call .shift
ld hl, sBoxMonNicknames ld hl, sBoxMonNicknames
ld bc, PKMN_NAME_LENGTH ld bc, PKMN_NAME_LENGTH
call .asm_df5f call .shift
ld hl, sBoxMons ld hl, sBoxMons
ld bc, BOXMON_STRUCT_LENGTH ld bc, BOXMON_STRUCT_LENGTH
.asm_df5f .shift
ld a, [sBoxCount] ld a, [sBoxCount]
cp 2 cp 2
ret c ret c
@ -6678,11 +6683,11 @@ GiveEgg:: ; df8c
call AddNTimes call AddNTimes
ld a, [wc2cc] ld a, [wc2cc]
bit 1, a bit 1, a
ld a, $1 ld a, 1
jr nz, .asm_e022 jr nz, .got_init_happiness
ld a, [BaseEggSteps] ld a, [BaseEggSteps]
.asm_e022 .got_init_happiness
ld [hl], a ld [hl], a
ld a, [PartyCount] ld a, [PartyCount]
dec a dec a
@ -6700,7 +6705,7 @@ String_Egg: ; e035
db "EGG@" db "EGG@"
; e039 ; e039
Functione039: ; e039 RemoveMonFromPartyOrBox: ; e039
ld hl, PartyCount ld hl, PartyCount
ld a, [wPokemonWithdrawDepositParameter] ld a, [wPokemonWithdrawDepositParameter]
@ -6722,30 +6727,33 @@ Functione039: ; e039
ld e, l ld e, l
ld d, h ld d, h
inc de inc de
.asm_e057 .loop
ld a, [de] ld a, [de]
inc de inc de
ld [hli], a ld [hli], a
inc a inc a
jr nz, .asm_e057 jr nz, .loop
ld hl, PartyMonOT ld hl, PartyMonOT
ld d, PARTY_LENGTH - 1 ld d, PARTY_LENGTH - 1
ld a, [wPokemonWithdrawDepositParameter] ld a, [wPokemonWithdrawDepositParameter]
and a and a
jr z, .asm_e06d jr z, .party
ld hl, sBoxMonOT ld hl, sBoxMonOT
ld d, MONS_PER_BOX - 1 ld d, MONS_PER_BOX - 1
.asm_e06d .party
; If this is the last mon in our party (box),
; shift all the other mons up to close the gap.
ld a, [CurPartyMon] ld a, [CurPartyMon]
call SkipNames call SkipNames
ld a, [CurPartyMon] ld a, [CurPartyMon]
cp d cp d
jr nz, .asm_e07e jr nz, .delete_inside
ld [hl], $ff ld [hl], -1
jp .asm_60f0 jp .finish
.asm_e07e .delete_inside
; Shift the OT names
ld d, h ld d, h
ld e, l ld e, l
ld bc, PKMN_NAME_LENGTH ld bc, PKMN_NAME_LENGTH
@ -6753,46 +6761,44 @@ Functione039: ; e039
ld bc, PartyMonNicknames ld bc, PartyMonNicknames
ld a, [wPokemonWithdrawDepositParameter] ld a, [wPokemonWithdrawDepositParameter]
and a and a
jr z, .asm_e090 jr z, .party2
ld bc, sBoxMonNicknames ld bc, sBoxMonNicknames
.asm_e090 .party2
call CopyDataUntil call CopyDataUntil
; Shift the struct
ld hl, PartyMons ld hl, PartyMons
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
ld a, [wPokemonWithdrawDepositParameter] ld a, [wPokemonWithdrawDepositParameter]
and a and a
jr z, .asm_e0a5 jr z, .party4
ld hl, sBoxMons ld hl, sBoxMons
ld bc, BOXMON_STRUCT_LENGTH ld bc, BOXMON_STRUCT_LENGTH
.party4
.asm_e0a5
ld a, [CurPartyMon] ld a, [CurPartyMon]
call AddNTimes call AddNTimes
ld d, h ld d, h
ld e, l ld e, l
ld a, [wPokemonWithdrawDepositParameter] ld a, [wPokemonWithdrawDepositParameter]
and a and a
jr z, .asm_e0bc jr z, .party5
ld bc, BOXMON_STRUCT_LENGTH ld bc, BOXMON_STRUCT_LENGTH
add hl, bc add hl, bc
ld bc, sBoxMonOT ld bc, sBoxMonOT
jr .asm_e0c3 jr .copy
.asm_e0bc .party5
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
add hl, bc add hl, bc
ld bc, PartyMonOT ld bc, PartyMonOT
.copy
.asm_e0c3
call CopyDataUntil call CopyDataUntil
; Shift the nicknames
ld hl, PartyMonNicknames ld hl, PartyMonNicknames
ld a, [wPokemonWithdrawDepositParameter] ld a, [wPokemonWithdrawDepositParameter]
and a and a
jr z, .asm_e0d2 jr z, .party6
ld hl, sBoxMonNicknames ld hl, sBoxMonNicknames
.party6
.asm_e0d2
ld bc, PKMN_NAME_LENGTH ld bc, PKMN_NAME_LENGTH
ld a, [CurPartyMon] ld a, [CurPartyMon]
call AddNTimes call AddNTimes
@ -6803,25 +6809,27 @@ Functione039: ; e039
ld bc, PartyMonNicknamesEnd ld bc, PartyMonNicknamesEnd
ld a, [wPokemonWithdrawDepositParameter] ld a, [wPokemonWithdrawDepositParameter]
and a and a
jr z, .asm_e0ed jr z, .party7
ld bc, sBoxMonNicknamesEnd ld bc, sBoxMonNicknamesEnd
.party7
.asm_e0ed
call CopyDataUntil call CopyDataUntil
; Mail time!
.asm_60f0 .finish
ld a, [wPokemonWithdrawDepositParameter] ld a, [wPokemonWithdrawDepositParameter]
and a and a
jp nz, CloseSRAM jp nz, CloseSRAM
ld a, [wLinkMode] ld a, [wLinkMode]
and a and a
ret nz ret nz
; Shift mail
ld a, BANK(sPartyMail) ld a, BANK(sPartyMail)
call GetSRAMBank call GetSRAMBank
; If this is the last mon in our party, no need to shift mail.
ld hl, PartyCount ld hl, PartyCount
ld a, [CurPartyMon] ld a, [CurPartyMon]
cp [hl] cp [hl]
jr z, .asm_e131 jr z, .close_sram
; Shift our mail messages up.
ld hl, sPartyMail ld hl, sPartyMail
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
call AddNTimes call AddNTimes
@ -6830,7 +6838,7 @@ Functione039: ; e039
pop de pop de
ld a, [CurPartyMon] ld a, [CurPartyMon]
ld b, a ld b, a
.asm_e11a .loop2
push bc push bc
push hl push hl
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
@ -6844,13 +6852,12 @@ Functione039: ; e039
inc b inc b
ld a, [PartyCount] ld a, [PartyCount]
cp b cp b
jr nz, .asm_e11a jr nz, .loop2
.close_sram
.asm_e131
jp CloseSRAM jp CloseSRAM
; e134 ; e134
Functione134: ; e134 ComputeNPCTrademonStats: ; e134
ld a, MON_LEVEL ld a, MON_LEVEL
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hl] ld a, [hl]
@ -7116,7 +7123,7 @@ GivePoke:: ; e277
ld e, l ld e, l
pop bc pop bc
ld a, b ld a, b
ld b, $0 ld b, 0
push bc push bc
push de push de
push af push af
@ -7136,15 +7143,15 @@ GivePoke:: ; e277
ld [TempEnemyMonSpecies], a ld [TempEnemyMonSpecies], a
callab LoadEnemyMon callab LoadEnemyMon
call SentPkmnIntoBox call SentPkmnIntoBox
jp nc, Functione3d4 jp nc, .FailedToGiveMon
ld a, $2 ld a, BOXMON
ld [MonType], a ld [MonType], a
xor a xor a
ld [CurPartyMon], a ld [CurPartyMon], a
ld de, wd050 ld de, wd050_MonNick
pop bc pop bc
ld a, b ld a, b
ld b, $1 ld b, 1
push bc push bc
push de push de
push af push af
@ -7160,12 +7167,12 @@ GivePoke:: ; e277
ld [TempEnemyMonSpecies], a ld [TempEnemyMonSpecies], a
call GetPokemonName call GetPokemonName
ld hl, StringBuffer1 ld hl, StringBuffer1
ld de, wd050 ld de, wd050_MonNick
ld bc, PKMN_NAME_LENGTH ld bc, PKMN_NAME_LENGTH
call CopyBytes call CopyBytes
pop af pop af
and a and a
jp z, .asm_e390 jp z, .wildmon
pop de pop de
pop bc pop bc
pop hl pop hl
@ -7187,7 +7194,7 @@ endr
and a and a
push de push de
push bc push bc
jr nz, .asm_e35e jr nz, .send_to_box
push hl push hl
ld a, [CurPartyMon] ld a, [CurPartyMon]
@ -7219,7 +7226,7 @@ endr
callba SetGiftPartyMonCaughtData callba SetGiftPartyMonCaughtData
jr .skip_nickname jr .skip_nickname
.asm_e35e .send_to_box
ld a, BANK(sBoxMonOT) ld a, BANK(sBoxMonOT)
call GetSRAMBank call GetSRAMBank
ld de, sBoxMonOT ld de, sBoxMonOT
@ -7243,21 +7250,20 @@ endr
callba SetGiftBoxMonCaughtData callba SetGiftBoxMonCaughtData
jr .skip_nickname jr .skip_nickname
.asm_e390 .wildmon
pop de pop de
pop bc pop bc
push bc push bc
push de push de
ld a, b ld a, b
and a and a
jr z, .asm_e3a0 jr z, .party
callba SetBoxMonCaughtData callba SetBoxMonCaughtData
jr .asm_e3a6 jr .set_caught_data
.asm_e3a0 .party
callba SetCaughtData callba SetCaughtData
.set_caught_data
.asm_e3a6
callba GiveANickname_YesNo callba GiveANickname_YesNo
pop de pop de
jr c, .skip_nickname jr c, .skip_nickname
@ -7282,7 +7288,7 @@ endr
ret ret
; e3d4 ; e3d4
Functione3d4: ; e3d4 .FailedToGiveMon: ; e3d4
pop bc pop bc
pop de pop de
ld b, $2 ld b, $2
@ -12396,14 +12402,14 @@ INCLUDE "engine/map_triggers.asm"
Function4d15b:: ; 4d15b Function4d15b:: ; 4d15b
ld hl, wc608 ld hl, wc608
ld a, [wd196] ld a, [wMetatileStandingY]
and a and a
jr z, .skip jr z, .skip
ld bc, $30 ld bc, $30
add hl, bc add hl, bc
.skip .skip
ld a, [wd197] ld a, [wMetatileStandingX]
and a and a
jr z, .next_dw jr z, .next_dw
rept 2 rept 2

View File

@ -5406,7 +5406,7 @@ Function1023c6: ; 1023c6
ld [CurPartyMon], a ld [CurPartyMon], a
xor a xor a
ld [wd10b], a ld [wd10b], a
callba Functione039 callba RemoveMonFromPartyOrBox
ld hl, PartyCount ld hl, PartyCount
inc [hl] inc [hl]
ld a, [hli] ld a, [hli]

View File

@ -7459,7 +7459,7 @@ Function11b5c0: ; 11b5c0
ld [CurPartyMon], a ld [CurPartyMon], a
xor a xor a
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callba Functione039 callba RemoveMonFromPartyOrBox
callba Function170807 callba Function170807
callba Function14a58 callba Function14a58
jp Function11ad8a jp Function11ad8a

View File

@ -1984,11 +1984,9 @@ wd182:: ds 1
wd191:: ds 1 wd191:: ds 1
wd192:: ds 1 wd192:: ds 1
wd193:: ds 1 wd193:: ds 1
wd194:: dw wOverworldMapAnchor:: dw
wMetatileStandingY:: wMetatileStandingY:: ds 1
wd196:: ds 1 wMetatileStandingX:: ds 1
wMetatileStandingX::
wd197:: ds 1
wSecondMapHeaderBank:: ds 1 wSecondMapHeaderBank:: ds 1
wTileset:: ds 1 wTileset:: ds 1
wPermission:: ds 1 wPermission:: ds 1