2015-12-06 19:36:09 -08:00
|
|
|
MobileCheckOwnMonAnywhere: ; 4a843
|
|
|
|
; Like CheckOwnMonAnywhere, but only check for species.
|
|
|
|
; OT/ID don't matter.
|
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
|
|
|
|
ld d, a
|
|
|
|
ld e, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1Species
|
|
|
|
ld bc, wPartyMonOT
|
2015-12-06 19:36:09 -08:00
|
|
|
.asm_4a851
|
|
|
|
call .CheckMatch
|
|
|
|
ret c
|
|
|
|
push bc
|
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
call .CopyName
|
|
|
|
dec d
|
|
|
|
jr nz, .asm_4a851
|
|
|
|
ld a, BANK(sBoxCount)
|
|
|
|
call GetSRAMBank
|
|
|
|
ld a, [sBoxCount]
|
|
|
|
and a
|
|
|
|
jr z, .asm_4a888
|
|
|
|
ld d, a
|
|
|
|
ld hl, sBoxMon1Species
|
|
|
|
ld bc, sBoxMonOT
|
|
|
|
.asm_4a873
|
|
|
|
call .CheckMatch
|
|
|
|
jr nc, .asm_4a87c
|
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4a87c
|
|
|
|
push bc
|
|
|
|
ld bc, BOXMON_STRUCT_LENGTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
call .CopyName
|
|
|
|
dec d
|
|
|
|
jr nz, .asm_4a873
|
|
|
|
|
|
|
|
.asm_4a888
|
|
|
|
call CloseSRAM
|
|
|
|
ld c, 0
|
|
|
|
.asm_4a88d
|
|
|
|
ld a, [wCurBox]
|
|
|
|
and $f
|
|
|
|
cp c
|
|
|
|
jr z, .asm_4a8d1
|
|
|
|
ld hl, .BoxAddrs
|
|
|
|
ld b, 0
|
|
|
|
add hl, bc
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, bc
|
|
|
|
add hl, bc
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, [hli]
|
|
|
|
call GetSRAMBank
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_4a8d1
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
ld de, sBoxMons - sBoxCount
|
|
|
|
add hl, de
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
pop hl
|
|
|
|
push de
|
|
|
|
ld de, sBoxMonOT - sBoxCount
|
|
|
|
add hl, de
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
|
|
|
pop hl
|
|
|
|
ld d, a
|
|
|
|
.asm_4a8ba
|
|
|
|
call .CheckMatch
|
|
|
|
jr nc, .asm_4a8c4
|
|
|
|
pop bc
|
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4a8c4
|
|
|
|
push bc
|
|
|
|
ld bc, BOXMON_STRUCT_LENGTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
call .CopyName
|
|
|
|
dec d
|
|
|
|
jr nz, .asm_4a8ba
|
|
|
|
pop bc
|
|
|
|
|
|
|
|
.asm_4a8d1
|
|
|
|
inc c
|
|
|
|
ld a, c
|
|
|
|
cp NUM_BOXES
|
|
|
|
jr c, .asm_4a88d
|
|
|
|
call CloseSRAM
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
; 4a8dc
|
|
|
|
|
|
|
|
.CheckMatch: ; 4a8dc
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
ld d, b
|
|
|
|
ld e, c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wScriptVar]
|
2015-12-06 19:36:09 -08:00
|
|
|
ld b, [hl]
|
|
|
|
cp b
|
|
|
|
jr nz, .no_match
|
|
|
|
jr .match
|
|
|
|
|
|
|
|
.no_match
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.match
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 4a8f4
|
|
|
|
|
|
|
|
.BoxAddrs: ; 4a8f4
|
|
|
|
dba sBox1
|
|
|
|
dba sBox2
|
|
|
|
dba sBox3
|
|
|
|
dba sBox4
|
|
|
|
dba sBox5
|
|
|
|
dba sBox6
|
|
|
|
dba sBox7
|
|
|
|
dba sBox8
|
|
|
|
dba sBox9
|
|
|
|
dba sBox10
|
|
|
|
dba sBox11
|
|
|
|
dba sBox12
|
|
|
|
dba sBox13
|
|
|
|
dba sBox14
|
|
|
|
; 4a91e
|
|
|
|
|
|
|
|
.CopyName: ; 4a91e
|
|
|
|
push hl
|
|
|
|
ld hl, NAME_LENGTH
|
|
|
|
add hl, bc
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 4a927
|
|
|
|
|
2018-01-24 08:20:41 -08:00
|
|
|
UnusedFindItemInPCOrBag: ; 4a927
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wScriptVar]
|
|
|
|
ld [wCurItem], a
|
|
|
|
ld hl, wPCItems
|
2015-12-06 19:36:09 -08:00
|
|
|
call CheckItem
|
|
|
|
jr c, .found
|
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wScriptVar]
|
|
|
|
ld [wCurItem], a
|
|
|
|
ld hl, wNumItems
|
2015-12-06 19:36:09 -08:00
|
|
|
call CheckItem
|
|
|
|
jr c, .found
|
|
|
|
|
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.found
|
|
|
|
ld a, 1
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ret
|
|
|
|
; 4a94e
|
|
|
|
|
|
|
|
Function4a94e: ; 4a94e
|
|
|
|
call FadeToMenu
|
|
|
|
ld a, -1
|
|
|
|
ld hl, wd002
|
|
|
|
ld bc, 3
|
|
|
|
call ByteFill
|
|
|
|
xor a
|
|
|
|
ld [wd018], a
|
|
|
|
ld [wd019], a
|
2015-12-22 15:03:00 -08:00
|
|
|
ld b, SCGB_PACKPALS
|
2015-12-06 19:36:09 -08:00
|
|
|
call GetSGBLayout
|
|
|
|
call SetPalettes
|
|
|
|
call Function4aa22
|
|
|
|
jr c, .asm_4a985
|
|
|
|
jr z, .asm_4a9a1
|
|
|
|
jr .asm_4a97b
|
|
|
|
|
|
|
|
.asm_4a974
|
|
|
|
call Function4aa25
|
|
|
|
jr c, .asm_4a985
|
|
|
|
jr z, .asm_4a9a1
|
|
|
|
|
|
|
|
.asm_4a97b
|
|
|
|
call Function4ac58
|
|
|
|
ld hl, wd019
|
|
|
|
res 1, [hl]
|
|
|
|
jr .asm_4a974
|
|
|
|
|
|
|
|
.asm_4a985
|
|
|
|
ld a, [wd018]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_4a990
|
|
|
|
call Function4aba8
|
|
|
|
jr c, .asm_4a974
|
|
|
|
|
|
|
|
.asm_4a990
|
|
|
|
call CloseSubmenu
|
|
|
|
ld hl, wd002
|
|
|
|
ld a, -1
|
|
|
|
ld bc, 3
|
|
|
|
call ByteFill
|
|
|
|
scf
|
|
|
|
jr .asm_4a9af
|
|
|
|
|
|
|
|
.asm_4a9a1
|
|
|
|
call Function4a9c3
|
|
|
|
jr c, .asm_4a9b0
|
|
|
|
call Function4a9d7
|
|
|
|
jr c, .asm_4a974
|
|
|
|
call CloseSubmenu
|
|
|
|
and a
|
|
|
|
|
|
|
|
.asm_4a9af
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4a9b0
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
call PlaySFX
|
|
|
|
ld hl, UnknownText_0x4a9be
|
|
|
|
call PrintText
|
|
|
|
jr .asm_4a974
|
|
|
|
; 4a9be
|
|
|
|
|
|
|
|
UnknownText_0x4a9be: ; 0x4a9be
|
|
|
|
; Pick three #MON for battle.
|
|
|
|
text_jump UnknownText_0x1c51d7
|
|
|
|
db "@"
|
|
|
|
; 0x4a9c3
|
|
|
|
|
|
|
|
Function4a9c3: ; 4a9c3
|
|
|
|
ld hl, wd002
|
|
|
|
ld a, $ff
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4a9d5
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4a9d5
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4a9d5
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4a9d5
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 4a9d7
|
|
|
|
|
|
|
|
Function4a9d7: ; 4a9d7
|
|
|
|
ld a, [wd002]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMonNicknames
|
2015-12-06 19:36:09 -08:00
|
|
|
call GetNick
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wEndFlypoint
|
2015-12-06 19:36:09 -08:00
|
|
|
ld bc, 6
|
|
|
|
call CopyBytes
|
|
|
|
ld a, [wd003]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMonNicknames
|
2015-12-06 19:36:09 -08:00
|
|
|
call GetNick
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
ld de, wd00c
|
|
|
|
ld bc, 6
|
|
|
|
call CopyBytes
|
|
|
|
ld a, [wd004]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMonNicknames
|
2015-12-06 19:36:09 -08:00
|
|
|
call GetNick
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
ld de, wd012
|
|
|
|
ld bc, 6
|
|
|
|
call CopyBytes
|
|
|
|
ld hl, UnknownText_0x4aa1d
|
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
|
|
|
ret
|
|
|
|
; 4aa1d
|
|
|
|
|
|
|
|
UnknownText_0x4aa1d: ; 0x4aa1d
|
|
|
|
; , @ and @ . Use these three?
|
|
|
|
text_jump UnknownText_0x1c51f4
|
|
|
|
db "@"
|
|
|
|
; 0x4aa22
|
|
|
|
|
|
|
|
Function4aa22: ; 4aa22
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
|
|
|
Function4aa25: ; 4aa25
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall LoadPartyMenuGFX
|
|
|
|
farcall InitPartyMenuWithCancel
|
2015-12-06 19:36:09 -08:00
|
|
|
call Function4aad3
|
|
|
|
|
|
|
|
Function4aa34: ; 4aa34
|
2017-11-30 11:27:25 -08:00
|
|
|
ld a, PARTYMENUACTION_MOBILE
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wPartyMenuActionText], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall WritePartyMenuTilemap
|
2015-12-06 19:36:09 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wPartyMenuActionText], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall PrintPartyMenuText
|
2015-12-06 19:36:09 -08:00
|
|
|
call Function4aab6
|
|
|
|
call WaitBGMap
|
|
|
|
call SetPalettes
|
|
|
|
call DelayFrame
|
|
|
|
call Function4ab1a
|
|
|
|
jr z, .asm_4aa66
|
|
|
|
push af
|
|
|
|
call Function4aafb
|
|
|
|
jr c, .asm_4aa67
|
|
|
|
call Function4ab06
|
|
|
|
jr c, .asm_4aa67
|
|
|
|
pop af
|
|
|
|
|
|
|
|
.asm_4aa66
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4aa67
|
|
|
|
ld hl, wd019
|
|
|
|
set 1, [hl]
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
; 4aa6e
|
|
|
|
|
|
|
|
Function4aa6e: ; 4aa6e
|
|
|
|
pop af
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
jr Function4aa34
|
|
|
|
; 4aa7a
|
|
|
|
|
|
|
|
Function4aa7a: ; 4aa7a
|
|
|
|
ld hl, wd002
|
|
|
|
ld d, $3
|
|
|
|
.loop
|
|
|
|
ld e, PARTY_LENGTH
|
|
|
|
ld a, [hli]
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
cp -1
|
|
|
|
jr z, .done
|
|
|
|
ld hl, wSpriteAnimationStructs
|
|
|
|
inc a
|
|
|
|
ld d, a
|
|
|
|
.inner_loop
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .next
|
|
|
|
cp d
|
|
|
|
jr z, .same_as_d
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
ld a, $3
|
|
|
|
jr .proceed
|
|
|
|
|
|
|
|
.same_as_d
|
|
|
|
ld a, $2
|
|
|
|
|
|
|
|
.proceed
|
|
|
|
push hl
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
ld hl, $2
|
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
|
|
|
|
.next
|
|
|
|
ld bc, $10
|
|
|
|
add hl, bc
|
|
|
|
dec e
|
|
|
|
jr nz, .inner_loop
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
dec d
|
|
|
|
jr nz, .loop
|
|
|
|
jr .finished
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
|
|
|
|
.finished
|
|
|
|
ret
|
|
|
|
; 4aab6
|
|
|
|
|
|
|
|
Function4aab6: ; 4aab6
|
|
|
|
ld hl, wd002
|
|
|
|
ld d, $3
|
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
|
|
|
cp -1
|
|
|
|
jr z, .done
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
hlcoord 0, 1
|
|
|
|
ld bc, $28
|
|
|
|
call AddNTimes
|
|
|
|
ld [hl], $ec
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
dec d
|
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
.done
|
|
|
|
ret
|
|
|
|
; 4aad3
|
|
|
|
|
|
|
|
Function4aad3: ; 4aad3
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyCount
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, [hli]
|
|
|
|
and a
|
|
|
|
ret z ; Nothing in your party
|
|
|
|
|
|
|
|
ld c, a
|
|
|
|
xor a
|
|
|
|
ld [hObjectStructIndexBuffer], a
|
|
|
|
.loop
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
ld e, 0
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall LoadMenuMonIcon
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, [hObjectStructIndexBuffer]
|
|
|
|
inc a
|
|
|
|
ld [hObjectStructIndexBuffer], a
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
dec c
|
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
call Function4aa7a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall PlaySpriteAnimations
|
2015-12-06 19:36:09 -08:00
|
|
|
ret
|
|
|
|
; 4aafb
|
|
|
|
|
|
|
|
Function4aafb: ; 4aafb
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-12-06 19:36:09 -08:00
|
|
|
cp EGG
|
|
|
|
jr z, .egg
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.egg
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 4ab06
|
|
|
|
|
|
|
|
Function4ab06: ; 4ab06
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-12-06 19:36:09 -08:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1HP
|
2015-12-06 19:36:09 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
ld a, [hl]
|
|
|
|
or b
|
|
|
|
jr nz, .NotFainted
|
|
|
|
scf
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.NotFainted:
|
2015-12-06 19:36:09 -08:00
|
|
|
ret
|
|
|
|
; 4ab1a
|
|
|
|
|
|
|
|
Function4ab1a: ; 4ab1a
|
|
|
|
.asm_4ab1a
|
|
|
|
ld a, $fb
|
2015-12-20 09:54:08 -08:00
|
|
|
ld [wMenuJoypadFilter], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, $26
|
2015-12-21 11:10:16 -08:00
|
|
|
ld [w2DMenuCursorOffsets], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, $2
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [w2DMenuNumCols], a
|
2015-12-06 19:36:09 -08:00
|
|
|
call Function4adf7
|
2015-12-15 15:59:49 -08:00
|
|
|
call StaticMenuJoypad
|
2015-12-06 19:36:09 -08:00
|
|
|
call Function4abc3
|
|
|
|
jr c, .asm_4ab1a
|
|
|
|
push af
|
|
|
|
call Function4ab99
|
2015-12-17 19:31:16 -08:00
|
|
|
call nc, PlaceHollowCursor
|
2015-12-06 19:36:09 -08:00
|
|
|
pop af
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_4ab6d
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
inc a
|
|
|
|
ld b, a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wPartyMenuCursor], a
|
2015-12-06 19:36:09 -08:00
|
|
|
cp b
|
|
|
|
jr z, .asm_4ab7e
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-06 19:36:09 -08:00
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartyMon], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld c, a
|
|
|
|
ld b, $0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartySpecies
|
2015-12-06 19:36:09 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
ld a, $1
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ab6d
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-23 11:00:29 -08:00
|
|
|
ld [wPartyMenuCursor], a
|
2015-12-06 19:36:09 -08:00
|
|
|
.asm_4ab73
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ab7e
|
|
|
|
ld a, $1
|
|
|
|
ld [wd018], a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorX]
|
2015-12-06 19:36:09 -08:00
|
|
|
cp $2
|
|
|
|
jr z, .asm_4ab73
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
xor a
|
|
|
|
ld [wd018], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
; 4ab99
|
|
|
|
|
|
|
|
Function4ab99: ; 4ab99
|
|
|
|
bit 1, a
|
|
|
|
jr z, .asm_4aba6
|
|
|
|
ld a, [wd002]
|
|
|
|
cp $ff
|
|
|
|
jr z, .asm_4aba6
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4aba6
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
; 4aba8
|
|
|
|
|
|
|
|
Function4aba8: ; 4aba8
|
|
|
|
ld hl, wd004
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .asm_4abbe
|
|
|
|
dec hl
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .asm_4abbe
|
|
|
|
dec hl
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .asm_4abbe
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4abbe
|
|
|
|
ld a, $ff
|
|
|
|
ld [hl], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 4abc3
|
|
|
|
|
|
|
|
Function4abc3: ; 4abc3
|
|
|
|
bit 3, a
|
|
|
|
jr z, .asm_4abd5
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
inc a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, $1
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorX], a
|
2015-12-06 19:36:09 -08:00
|
|
|
jr .asm_4ac29
|
|
|
|
|
|
|
|
.asm_4abd5
|
|
|
|
bit 6, a
|
|
|
|
jr z, .asm_4abeb
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
|
|
|
ld [wMenuCursorY], a
|
2015-12-06 19:36:09 -08:00
|
|
|
and a
|
|
|
|
jr nz, .asm_4ac29
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
inc a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-06 19:36:09 -08:00
|
|
|
jr .asm_4ac29
|
|
|
|
|
|
|
|
.asm_4abeb
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_4ac08
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
|
|
|
ld [wMenuCursorY], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
inc a
|
2016-05-04 08:46:23 -07:00
|
|
|
inc a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld b, a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-06 19:36:09 -08:00
|
|
|
cp b
|
|
|
|
jr nz, .asm_4ac29
|
|
|
|
ld a, $1
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-06 19:36:09 -08:00
|
|
|
jr .asm_4ac29
|
|
|
|
|
|
|
|
.asm_4ac08
|
|
|
|
bit 4, a
|
|
|
|
jr nz, .asm_4ac10
|
|
|
|
bit 5, a
|
|
|
|
jr z, .asm_4ac56
|
|
|
|
|
|
|
|
.asm_4ac10
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-06 19:36:09 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
inc a
|
|
|
|
cp b
|
|
|
|
jr nz, .asm_4ac29
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorX]
|
2015-12-06 19:36:09 -08:00
|
|
|
cp $1
|
|
|
|
jr z, .asm_4ac26
|
|
|
|
ld a, $1
|
|
|
|
jr .asm_4ac29
|
|
|
|
|
|
|
|
.asm_4ac26
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorX], a
|
2015-12-06 19:36:09 -08:00
|
|
|
|
|
|
|
.asm_4ac29
|
|
|
|
hlcoord 0, 1
|
|
|
|
lb bc, 13, 1
|
|
|
|
call ClearBox
|
|
|
|
call Function4aab6
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
hlcoord 6, 1
|
|
|
|
.asm_4ac3b
|
|
|
|
ld bc, $28
|
|
|
|
add hl, bc
|
|
|
|
dec a
|
|
|
|
jr nz, .asm_4ac3b
|
|
|
|
ld [hl], $7f
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-06 19:36:09 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
inc a
|
|
|
|
cp b
|
|
|
|
jr z, .asm_4ac54
|
|
|
|
ld a, $1
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorX], a
|
2015-12-06 19:36:09 -08:00
|
|
|
|
|
|
|
.asm_4ac54
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ac56
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
; 4ac58
|
|
|
|
|
|
|
|
Function4ac58: ; 4ac58
|
|
|
|
lb bc, 2, 18
|
|
|
|
hlcoord 1, 15
|
|
|
|
call ClearBox
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall FreezeMonIcons
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_0x4aca2
|
|
|
|
call LoadMenuHeader
|
2015-12-06 19:36:09 -08:00
|
|
|
ld hl, wd019
|
|
|
|
bit 1, [hl]
|
|
|
|
jr z, .asm_4ac89
|
|
|
|
hlcoord 11, 13
|
|
|
|
ld b, $3
|
|
|
|
ld c, $7
|
|
|
|
call TextBox
|
|
|
|
hlcoord 13, 14
|
|
|
|
ld de, String_4ada7
|
|
|
|
call PlaceString
|
|
|
|
jr .asm_4ac96
|
|
|
|
|
|
|
|
.asm_4ac89
|
|
|
|
hlcoord 11, 9
|
|
|
|
ld b, $7
|
|
|
|
ld c, $7
|
|
|
|
call TextBox
|
|
|
|
call Function4ad68
|
|
|
|
|
|
|
|
.asm_4ac96
|
|
|
|
ld a, $1
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
call Function4acaa
|
|
|
|
call ExitMenu
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
; 4aca2
|
|
|
|
|
2018-01-23 13:08:43 -08:00
|
|
|
MenuHeader_0x4aca2: ; 0x4aca2
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 11, 9, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
2015-12-06 19:36:09 -08:00
|
|
|
dw NULL
|
|
|
|
db 1 ; default option
|
|
|
|
; 0x4acaa
|
|
|
|
|
|
|
|
Function4acaa: ; 4acaa
|
|
|
|
.asm_4acaa
|
|
|
|
ld a, $a0
|
2018-01-23 13:08:43 -08:00
|
|
|
ld [wMenuDataFlags], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, [wd019]
|
|
|
|
bit 1, a
|
|
|
|
jr z, .asm_4acc2
|
|
|
|
ld a, $2
|
2018-01-23 13:08:43 -08:00
|
|
|
ld [wMenuDataItems], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, $c
|
|
|
|
ld [wMenuBorderTopCoord], a
|
|
|
|
jr .asm_4accc
|
|
|
|
|
|
|
|
.asm_4acc2
|
|
|
|
ld a, $4
|
2018-01-23 13:08:43 -08:00
|
|
|
ld [wMenuDataItems], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, $8
|
|
|
|
ld [wMenuBorderTopCoord], a
|
|
|
|
|
|
|
|
.asm_4accc
|
|
|
|
ld a, $b
|
|
|
|
ld [wMenuBorderLeftCoord], a
|
|
|
|
ld a, $1
|
|
|
|
ld [wMenuCursorBuffer], a
|
2015-12-15 15:59:49 -08:00
|
|
|
call InitVerticalMenuCursor
|
2015-12-19 11:48:30 -08:00
|
|
|
ld hl, w2DMenuFlags1
|
2015-12-06 19:36:09 -08:00
|
|
|
set 6, [hl]
|
2015-12-15 15:59:49 -08:00
|
|
|
call StaticMenuJoypad
|
2015-12-06 19:36:09 -08:00
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
ld a, [hJoyPressed]
|
|
|
|
bit 0, a
|
|
|
|
jr nz, .asm_4acf4
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_4acf3
|
|
|
|
jr .asm_4acaa
|
|
|
|
|
|
|
|
.asm_4acf3
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4acf4
|
|
|
|
ld a, [wd019]
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_4ad0e
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-06 19:36:09 -08:00
|
|
|
cp $1
|
|
|
|
jr z, Function4ad17
|
|
|
|
cp $2
|
|
|
|
jp z, Function4ad56
|
|
|
|
cp $3
|
|
|
|
jp z, Function4ad60
|
|
|
|
jr .asm_4acf3
|
|
|
|
|
|
|
|
.asm_4ad0e
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-06 19:36:09 -08:00
|
|
|
cp $1
|
|
|
|
jr z, Function4ad56
|
|
|
|
jr .asm_4acf3
|
|
|
|
|
|
|
|
Function4ad17: ; 4ad17
|
|
|
|
call Function4adb2
|
|
|
|
jr z, .asm_4ad4a
|
|
|
|
ld hl, wd002
|
|
|
|
ld a, $ff
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4ad39
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4ad39
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4ad39
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
call WaitPlaySFX
|
|
|
|
ld hl, UnknownText_0x4ad51
|
|
|
|
call PrintText
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ad39
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-12-06 19:36:09 -08:00
|
|
|
ld [hl], a
|
|
|
|
call Function4a9c3
|
|
|
|
ret c
|
|
|
|
ld a, [wd019]
|
|
|
|
set 0, a
|
|
|
|
ld [wd019], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ad4a
|
|
|
|
ld a, $ff
|
|
|
|
ld [hl], a
|
|
|
|
call Function4adc2
|
|
|
|
ret
|
|
|
|
|
|
|
|
UnknownText_0x4ad51: ; 0x4ad51
|
|
|
|
; Only three #MON may enter.
|
|
|
|
text_jump UnknownText_0x1c521c
|
|
|
|
db "@"
|
|
|
|
; 0x4ad56
|
|
|
|
|
|
|
|
Function4ad56: ; 4ad56
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall OpenPartyStats
|
2015-12-11 13:59:40 -08:00
|
|
|
call WaitBGMap2
|
2015-12-06 19:36:09 -08:00
|
|
|
ret
|
|
|
|
; 4ad60
|
|
|
|
|
|
|
|
Function4ad60: ; 4ad60
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ManagePokemonMoves
|
2015-12-06 19:36:09 -08:00
|
|
|
ret
|
|
|
|
; 4ad67
|
|
|
|
|
|
|
|
Function4ad67: ; 4ad67
|
|
|
|
ret
|
|
|
|
; 4ad68
|
|
|
|
|
|
|
|
Function4ad68: ; 4ad68
|
|
|
|
hlcoord 13, 12
|
|
|
|
ld de, String_4ad88
|
|
|
|
call PlaceString
|
|
|
|
call Function4adb2
|
|
|
|
jr c, .asm_4ad7e
|
|
|
|
hlcoord 13, 10
|
|
|
|
ld de, String_4ada0
|
|
|
|
jr .asm_4ad84
|
|
|
|
|
|
|
|
.asm_4ad7e
|
|
|
|
hlcoord 13, 10
|
|
|
|
ld de, String_4ad9a
|
|
|
|
|
|
|
|
.asm_4ad84
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
; 4ad88
|
|
|
|
|
|
|
|
String_4ad88: ; 4ad88
|
|
|
|
db "つよさをみる"
|
|
|
|
next "つかえるわざ"
|
|
|
|
next "もどる@"
|
|
|
|
; 4ad9a
|
|
|
|
|
|
|
|
String_4ad9a: ; 4ad9a
|
|
|
|
db "さんかする@"
|
|
|
|
; 4ada0
|
|
|
|
|
|
|
|
String_4ada0: ; 4ada0
|
|
|
|
db "さんかしない@"
|
|
|
|
; 4ada7
|
|
|
|
|
|
|
|
String_4ada7: ; 4ada7
|
|
|
|
db "つよさをみる"
|
|
|
|
next "もどる@" ; BACK
|
|
|
|
; 4adb2
|
|
|
|
|
|
|
|
Function4adb2: ; 4adb2
|
|
|
|
ld hl, wd002
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-12-06 19:36:09 -08:00
|
|
|
cp [hl]
|
|
|
|
ret z
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
ret z
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
ret z
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 4adc2
|
|
|
|
|
|
|
|
Function4adc2: ; 4adc2
|
|
|
|
ld a, [wd002]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .skip
|
|
|
|
ld a, [wd003]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .skip2
|
|
|
|
ld a, [wd004]
|
|
|
|
ld [wd002], a
|
|
|
|
ld a, $ff
|
|
|
|
ld [wd004], a
|
|
|
|
jr .skip
|
|
|
|
|
|
|
|
.skip2
|
|
|
|
ld [wd002], a
|
|
|
|
ld a, $ff
|
|
|
|
ld [wd003], a
|
|
|
|
|
|
|
|
.skip
|
|
|
|
ld a, [wd003]
|
|
|
|
cp $ff
|
|
|
|
ret nz
|
|
|
|
ld b, a
|
|
|
|
ld a, [wd004]
|
|
|
|
ld [wd003], a
|
|
|
|
ld a, b
|
|
|
|
ld [wd004], a
|
|
|
|
ret
|
|
|
|
; 4adf7
|
|
|
|
|
|
|
|
Function4adf7: ; 4adf7
|
|
|
|
ld a, [wd019]
|
|
|
|
bit 0, a
|
|
|
|
ret z
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-06 19:36:09 -08:00
|
|
|
inc a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, $1
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorX], a
|
2015-12-06 19:36:09 -08:00
|
|
|
ld a, [wd019]
|
|
|
|
res 0, a
|
|
|
|
ld [wd019], a
|
|
|
|
ret
|
|
|
|
; 4ae12
|