2018-06-24 07:09:41 -07:00
|
|
|
Function100000:
|
2015-12-07 08:28:58 -08:00
|
|
|
; d: 1 or 2
|
|
|
|
; e: bank
|
|
|
|
; bc: addr
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, 1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100022
|
|
|
|
call Function1000ba
|
|
|
|
call Function100675
|
|
|
|
call Function100057
|
|
|
|
call Function10016f
|
|
|
|
call Function100276
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
|
|
|
call Function100301
|
|
|
|
pop bc
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100022:
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
|
|
|
push bc
|
2016-05-05 12:07:37 -07:00
|
|
|
call SetRAMStateForMobile
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
ld a, d
|
|
|
|
ld [wcd21], a
|
|
|
|
ld a, e
|
2015-12-07 08:28:58 -08:00
|
|
|
ld [wcd22], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
ld [wcd23], a
|
|
|
|
ld a, b
|
|
|
|
ld [wcd24], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10127e
|
2018-01-02 11:00:14 -08:00
|
|
|
farcall Stubbed_Function106462
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function106464 ; load broken gfx
|
|
|
|
farcall Function11615a ; init RAM
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wVramState
|
2015-02-10 19:15:15 -08:00
|
|
|
set 1, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100057:
|
2016-05-05 12:07:37 -07:00
|
|
|
call DisableMobile
|
2015-11-11 20:38:57 -08:00
|
|
|
call ReturnToMapFromSubmenu
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wVramState
|
2015-02-10 19:15:15 -08:00
|
|
|
res 1, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
SetRAMStateForMobile:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wBGMapBuffer
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $65
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
|
|
|
xor a
|
2019-08-22 19:10:58 -07:00
|
|
|
ld hl, wMobileWRAM
|
|
|
|
ld bc, wMobileWRAMEnd - wMobileWRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rIE]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wBGMapBuffer], a
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMapAnims], a
|
|
|
|
ldh [hLCDCPointer], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
EnableMobile:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-03-19 08:36:14 -07:00
|
|
|
ld hl, wOverworldMapBlocks
|
|
|
|
ld bc, wOverworldMapBlocksEnd - wOverworldMapBlocks
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
2016-05-05 12:07:37 -07:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
di
|
|
|
|
call DoubleSpeed
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rIF], a
|
2019-05-05 09:14:46 -07:00
|
|
|
ld a, IE_DEFAULT
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rIE], a
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMapAnims], a
|
|
|
|
ldh [hLCDCPointer], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMobileReceive], a
|
|
|
|
ldh [hMobile], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ei
|
2016-05-05 12:07:37 -07:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
DisableMobile:
|
2015-02-10 19:15:15 -08:00
|
|
|
di
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMobileReceive], a
|
|
|
|
ldh [hMobile], a
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hVBlank], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call NormalSpeed
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rIF], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBGMapBuffer]
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rIE], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ei
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1000ba:
|
2015-12-07 08:28:58 -08:00
|
|
|
.loop
|
2016-05-05 12:07:37 -07:00
|
|
|
; call [wcd22]:([wcd23][wcd24] + [wMobileCommsJumptableIndex])
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd23
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld e, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld d, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, de
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, de
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, [wcd22]
|
2021-01-09 12:16:05 -08:00
|
|
|
call GetFarWord
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, [wcd22]
|
2015-02-10 19:15:15 -08:00
|
|
|
rst FarCall
|
2015-12-07 08:28:58 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1000e8
|
|
|
|
call Function1000fa
|
|
|
|
call Function100144
|
|
|
|
call Function100163
|
|
|
|
ld a, [wcd2b]
|
|
|
|
and a
|
2015-12-07 08:28:58 -08:00
|
|
|
jr z, .loop
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrame
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1000e8:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
bit 7, [hl]
|
|
|
|
ret z
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function115dd3
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1000fa:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wc30d]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
ld hl, wcd29
|
|
|
|
bit 4, [hl]
|
|
|
|
ret z
|
|
|
|
ld a, [wcd2b]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_100117
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function11619d
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100117
|
|
|
|
di
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rIF], a
|
|
|
|
ldh a, [rIE]
|
2019-05-05 09:14:46 -07:00
|
|
|
and $1f ^ (1 << SERIAL | 1 << TIMER)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rIE], a
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMobileReceive], a
|
|
|
|
ldh [hMobile], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ei
|
2015-11-23 13:04:53 -08:00
|
|
|
|
2015-10-19 07:23:58 -07:00
|
|
|
ld a, [wLinkMode]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
|
|
|
xor a
|
2015-10-19 07:23:58 -07:00
|
|
|
ld [wLinkMode], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $04
|
2015-11-11 11:12:46 -08:00
|
|
|
ld [wc314 + 5], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function11619d
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
pop af
|
2015-10-19 07:23:58 -07:00
|
|
|
ld [wLinkMode], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100144:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
bit 5, [hl]
|
|
|
|
jr z, .asm_100155
|
|
|
|
res 5, [hl]
|
|
|
|
res 2, [hl]
|
|
|
|
res 6, [hl]
|
|
|
|
call Function100320
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100155
|
|
|
|
bit 2, [hl]
|
|
|
|
ret z
|
|
|
|
res 2, [hl]
|
|
|
|
res 6, [hl]
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferTilemapToWRAMBank3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100163:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
bit 6, [hl]
|
|
|
|
ret z
|
|
|
|
res 6, [hl]
|
|
|
|
call DelayFrame
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10016f:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2b]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ret z
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ret z
|
|
|
|
cp $ff
|
|
|
|
jp z, .asm_1001f5
|
|
|
|
cp $fe
|
|
|
|
jr z, .asm_1001c4
|
|
|
|
cp $f5
|
|
|
|
jr z, .asm_1001e7
|
|
|
|
cp $f6
|
|
|
|
jr z, .asm_1001b6
|
|
|
|
cp $fa
|
|
|
|
jp z, .asm_1001bd
|
|
|
|
cp $f7
|
|
|
|
jp z, .asm_1001ee
|
|
|
|
cp $f4
|
|
|
|
jr z, .asm_1001d2
|
|
|
|
cp $f3
|
|
|
|
jr z, .asm_1001cb
|
|
|
|
cp $f1
|
|
|
|
jr z, .asm_1001c4
|
|
|
|
cp $f2
|
|
|
|
jr z, .asm_1001c4
|
|
|
|
cp $fc
|
|
|
|
jr z, .asm_1001e6
|
|
|
|
cp $fb
|
|
|
|
jr z, .asm_1001af
|
|
|
|
cp $f8
|
|
|
|
ret z
|
2015-11-07 18:04:54 -08:00
|
|
|
ret ; ????????????????????????????
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_1001af
|
|
|
|
ld a, $d7
|
2015-11-02 11:37:02 -08:00
|
|
|
ld de, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_1001d7
|
|
|
|
|
|
|
|
.asm_1001b6
|
|
|
|
ld a, $d5
|
2015-11-02 11:37:02 -08:00
|
|
|
ld de, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_1001d7
|
|
|
|
|
|
|
|
.asm_1001bd
|
|
|
|
ld a, $d6
|
2015-11-02 11:37:02 -08:00
|
|
|
ld de, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_1001d7
|
|
|
|
|
|
|
|
.asm_1001c4
|
|
|
|
ld a, $d2
|
2015-12-07 08:28:58 -08:00
|
|
|
ld de, 2
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_1001d7
|
|
|
|
|
|
|
|
.asm_1001cb
|
|
|
|
ld a, $d1
|
2015-12-07 08:28:58 -08:00
|
|
|
ld de, 1
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_1001d7
|
|
|
|
|
|
|
|
.asm_1001d2
|
|
|
|
ld a, $d0
|
2015-11-02 11:37:02 -08:00
|
|
|
ld de, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_1001d7
|
2019-08-22 05:41:17 -07:00
|
|
|
ld [wMobileErrorCodeBuffer], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, d
|
2019-08-22 05:41:17 -07:00
|
|
|
ld [wMobileErrorCodeBuffer + 2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, e
|
2019-08-22 05:41:17 -07:00
|
|
|
ld [wMobileErrorCodeBuffer + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10020b
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1001e6
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1001e7
|
|
|
|
ld de, String10025e
|
|
|
|
call Function100232
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1001ee
|
|
|
|
ld de, String10024d
|
|
|
|
call Function100232
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1001f5
|
|
|
|
ld a, [wcd2c]
|
2019-08-22 05:41:17 -07:00
|
|
|
ld [wMobileErrorCodeBuffer], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2d]
|
2019-08-22 05:41:17 -07:00
|
|
|
ld [wMobileErrorCodeBuffer + 2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2d]
|
2019-08-22 05:41:17 -07:00
|
|
|
ld [wMobileErrorCodeBuffer + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10020b
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10020b:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ld [wc303], a
|
2018-01-24 08:17:05 -08:00
|
|
|
farcall FadeOutPalettes
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function106464
|
2015-02-10 19:15:15 -08:00
|
|
|
call HideSprites
|
|
|
|
call DelayFrame
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall DisplayMobileError
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100232:
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function106464
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function3f20
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 1, 2
|
|
|
|
pop de
|
|
|
|
call PlaceString
|
|
|
|
call Function100320
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String10024d:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "つうしんを キャンセル しました@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String10025e:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "おともだちと えらんだ へやが"
|
2015-02-10 19:15:15 -08:00
|
|
|
next "ちがうようです@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100276:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2b]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10029f
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_100296
|
|
|
|
cp $f5
|
|
|
|
jr z, .asm_1002a5
|
|
|
|
cp $f6
|
|
|
|
jr z, .asm_1002a5
|
|
|
|
cp $f7
|
|
|
|
jr z, .asm_100293
|
|
|
|
cp $f8
|
|
|
|
jr z, .asm_1002b1
|
|
|
|
jr .asm_1002c0
|
|
|
|
|
|
|
|
.asm_100293
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100296
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Script_reloadmappart
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $04
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10029f
|
|
|
|
call Function1002dc
|
2015-12-07 08:28:58 -08:00
|
|
|
ld c, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1002a5
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Script_reloadmappart
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1002ed
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1002b1
|
|
|
|
call Function1002c9
|
|
|
|
call Function1002dc
|
|
|
|
ld de, String10024d
|
|
|
|
call Function100232
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1002c0
|
|
|
|
call Function1002c9
|
|
|
|
call Function1002dc
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1002c9:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
bit 0, [hl]
|
|
|
|
ret z
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CleanUpBattleRAM
|
|
|
|
farcall LoadPokemonData
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1002dc:
|
2015-11-11 20:38:57 -08:00
|
|
|
ld a, MAPSETUP_LINKRETURN
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMapEntryMethod], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall RunMapSetupScript
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMapEntryMethod], a
|
2015-11-04 13:14:27 -08:00
|
|
|
call LoadStandardFont
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1002ed:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall LoadOW_BGPal7
|
|
|
|
farcall ApplyPals
|
2020-08-03 14:41:01 -07:00
|
|
|
ld a, TRUE
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hCGBPalUpdate], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrame
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100301:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
bit 1, [hl]
|
|
|
|
ret z
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function106464
|
|
|
|
farcall Function10202c
|
|
|
|
farcall Function115dd3
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100320
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100320:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_ReloadMapPart
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
Function100327: ; unreferenced
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferTilemapToWRAMBank3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10032e:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10034d
|
|
|
|
ld e, a
|
|
|
|
ret nc
|
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100337:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10032e
|
|
|
|
ret c
|
|
|
|
ld a, [wc821]
|
|
|
|
bit 4, a
|
|
|
|
jr z, .asm_100345
|
|
|
|
ld a, e
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100345
|
|
|
|
ld a, $f9
|
|
|
|
ld e, a
|
|
|
|
ld [wcd2b], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10034d:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wc821]
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_10036a
|
|
|
|
bit 2, a
|
|
|
|
jr nz, .asm_10037e
|
|
|
|
bit 3, a
|
|
|
|
jr nz, .asm_100366
|
|
|
|
bit 0, a
|
|
|
|
jr nz, .asm_100364
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100364
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100366
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10036a
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_00
|
|
|
|
call MobileAPI
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2c], a
|
|
|
|
ld a, h
|
|
|
|
ld [wcd2d], a
|
|
|
|
ld a, l
|
|
|
|
ld [wcd2e], a
|
|
|
|
ld a, $ff
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10037e
|
|
|
|
ld a, $fe
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100382:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd27]
|
|
|
|
ld hl, Jumptable_10044e
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10038a:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wccb4
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_17
|
|
|
|
call MobileAPI
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100393:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcc60
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_1D
|
|
|
|
call MobileAPI
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10039c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcc60
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, w3_d000
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $54
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
Function1003ab: ; unreferenced
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w3_d000
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, wcc60
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $54
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1003ba:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wccb4
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, w3_d080
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $54
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1003c9:
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w3_d080
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, wccb4
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $54
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1003d8:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wccb4
|
|
|
|
ld a, [hli]
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
|
|
|
add hl, bc
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBGMapPalBuffer]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
inc bc
|
|
|
|
call Function10043a
|
|
|
|
add hl, bc
|
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
|
|
|
ld a, c
|
2016-01-12 09:46:18 -08:00
|
|
|
add $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wccb4], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1003f5:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcc60]
|
2016-01-12 09:46:18 -08:00
|
|
|
sub $03
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcc60], a
|
|
|
|
ld a, [wccb4]
|
2016-01-12 09:46:18 -08:00
|
|
|
sub $03
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wccb4], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100406:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcc60]
|
2016-01-12 09:46:18 -08:00
|
|
|
sub $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcc61
|
|
|
|
call Function10043a
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
cp e
|
|
|
|
jr nz, .asm_100426
|
|
|
|
ld a, [hld]
|
|
|
|
cp d
|
|
|
|
jr nz, .asm_100426
|
|
|
|
dec hl
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBGMapPalBuffer]
|
2015-02-10 19:15:15 -08:00
|
|
|
cp [hl]
|
|
|
|
jr nz, .asm_10042d
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100426
|
|
|
|
ld a, $f4
|
|
|
|
ld [wcd2b], a
|
|
|
|
jr .asm_100432
|
|
|
|
|
|
|
|
.asm_10042d
|
|
|
|
ld a, $f3
|
|
|
|
ld [wcd2b], a
|
|
|
|
|
|
|
|
.asm_100432
|
|
|
|
push hl
|
|
|
|
ld hl, wcd7c
|
|
|
|
inc [hl]
|
|
|
|
pop hl
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10043a:
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
|
|
|
push bc
|
2015-11-02 11:37:02 -08:00
|
|
|
ld de, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_10043f
|
|
|
|
ld a, [hli]
|
|
|
|
add e
|
|
|
|
ld e, a
|
|
|
|
ld a, d
|
2015-12-07 08:28:58 -08:00
|
|
|
adc 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, a
|
|
|
|
dec bc
|
|
|
|
ld a, b
|
|
|
|
or c
|
|
|
|
jr nz, .asm_10043f
|
|
|
|
pop bc
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_10044e:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function10046a
|
|
|
|
dw Function10047c
|
|
|
|
dw Function100493
|
|
|
|
dw Function1004ba
|
|
|
|
dw Function1004f4
|
|
|
|
dw Function1004ce
|
|
|
|
dw Function1004de
|
|
|
|
dw Function1004a4
|
|
|
|
dw Function100495
|
|
|
|
dw Function1004ce
|
|
|
|
dw Function1004de
|
|
|
|
dw Function1004e9
|
|
|
|
dw Function1004f4
|
|
|
|
dw Function1004a4
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10046a:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wBGMapPalBuffer
|
2015-02-10 19:15:15 -08:00
|
|
|
inc [hl]
|
|
|
|
call Function1003d8
|
|
|
|
call Function1003ba
|
|
|
|
ld a, [wcd27]
|
|
|
|
inc a
|
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10047c:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100337
|
|
|
|
ret c
|
|
|
|
ret z
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_100487
|
|
|
|
jr .asm_10048d
|
|
|
|
|
|
|
|
.asm_100487
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $08
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10048d
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100493:
|
2015-02-10 19:15:15 -08:00
|
|
|
jr asm_100497
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100495:
|
2015-02-10 19:15:15 -08:00
|
|
|
jr asm_100497
|
|
|
|
|
2018-10-24 12:33:18 -07:00
|
|
|
asm_100497:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100337
|
|
|
|
ret c
|
|
|
|
ret z
|
|
|
|
ld a, [wcd27]
|
|
|
|
inc a
|
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1004a4:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100406
|
|
|
|
jr c, .asm_1004b8
|
|
|
|
call Function1003c9
|
|
|
|
call Function1003f5
|
|
|
|
ld a, [wcd27]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1004b8
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1004ba:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10038a
|
|
|
|
and a
|
|
|
|
jr nz, .asm_1004c8
|
|
|
|
ld a, [wcd27]
|
|
|
|
inc a
|
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1004c8
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $08
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1004ce:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100337
|
|
|
|
ret c
|
|
|
|
ret z
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ret nz
|
|
|
|
ld a, [wcd27]
|
|
|
|
inc a
|
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1004de:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100393
|
|
|
|
ld a, [wcd27]
|
|
|
|
inc a
|
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1004e9:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10038a
|
|
|
|
ld a, [wcd27]
|
|
|
|
inc a
|
|
|
|
ld [wcd27], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1004f4:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100337
|
|
|
|
ret c
|
|
|
|
ret z
|
|
|
|
ld a, [wcd27]
|
|
|
|
inc a
|
|
|
|
ld [wcd27], a
|
|
|
|
call Function10039c
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100504:
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
|
|
|
call Function3f20
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2015-02-10 19:15:15 -08:00
|
|
|
pop de
|
|
|
|
hlcoord 4, 2
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100513:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function3f7c
|
2015-12-15 15:59:49 -08:00
|
|
|
call PlaceVerticalMenuItems
|
|
|
|
call InitVerticalMenuCursor
|
2015-12-19 11:48:30 -08:00
|
|
|
ld hl, w2DMenuFlags1
|
2015-02-10 19:15:15 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100522:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd28]
|
|
|
|
ld hl, Jumptable_10052a
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_10052a:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function100534
|
|
|
|
dw Function100545
|
|
|
|
dw Function100545
|
|
|
|
dw Function100545
|
|
|
|
dw Function10054d
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100534:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100513
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2015-11-25 07:16:29 -08:00
|
|
|
call ApplyTilemap
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd28]
|
|
|
|
inc a
|
|
|
|
ld [wcd28], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100545:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd28]
|
|
|
|
inc a
|
|
|
|
ld [wcd28], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10054d:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileMenuJoypad
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2015-12-20 09:54:08 -08:00
|
|
|
ld hl, wMenuJoypadFilter
|
2015-02-10 19:15:15 -08:00
|
|
|
and [hl]
|
|
|
|
ret z
|
2015-12-15 15:59:49 -08:00
|
|
|
call MenuClickSound
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 0, a
|
|
|
|
jr nz, .asm_100565
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_10056f
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100565
|
|
|
|
ld a, [wcd28]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd28], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10056f
|
|
|
|
ld a, [wcd28]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd28], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100579:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd26]
|
|
|
|
ld hl, Jumptable_100581
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_100581:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function100585
|
|
|
|
dw Function100597
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100585:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_1005b2
|
|
|
|
call LoadMenuHeader
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd28], a
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100597:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100522
|
|
|
|
ld a, [wcd28]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
jr nc, .asm_1005a6
|
|
|
|
xor a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_1005a6
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd26]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MenuHeader_1005b2:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2015-02-10 19:15:15 -08:00
|
|
|
db 6, 14
|
|
|
|
db 10, 19
|
2018-01-23 13:08:43 -08:00
|
|
|
dw MenuData_1005ba
|
2015-02-10 19:15:15 -08:00
|
|
|
db 1 ; default option
|
|
|
|
|
2018-01-23 13:08:43 -08:00
|
|
|
MenuData_1005ba:
|
2018-01-14 02:59:56 -08:00
|
|
|
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
|
2015-02-10 19:15:15 -08:00
|
|
|
db 2
|
|
|
|
db "はい@"
|
|
|
|
db "いいえ@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1005c3:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd26]
|
|
|
|
ld hl, Jumptable_1005cb
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_1005cb:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function1005cf
|
|
|
|
dw Function1005e1
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1005cf:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_1005fc
|
|
|
|
call LoadMenuHeader
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd28], a
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1005e1:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100522
|
|
|
|
ld a, [wcd28]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
jr nc, .asm_1005f0
|
|
|
|
xor a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_1005f0
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd26]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MenuHeader_1005fc:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2015-02-10 19:15:15 -08:00
|
|
|
db 6, 14
|
|
|
|
db 10, 19
|
2018-01-23 13:08:43 -08:00
|
|
|
dw MenuData_100604
|
2015-02-10 19:15:15 -08:00
|
|
|
db 1 ; default option
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MenuData_100604:
|
2018-01-14 02:59:56 -08:00
|
|
|
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
|
2015-02-10 19:15:15 -08:00
|
|
|
db 2
|
|
|
|
db "かける@"
|
|
|
|
db "まつ@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mobile_CommunicationStandby:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 3, 10
|
2016-05-05 12:07:37 -07:00
|
|
|
ld b, 1
|
|
|
|
ld c, 11
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function3eea
|
2016-05-05 12:07:37 -07:00
|
|
|
ld de, .String
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 4, 11
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.String:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "つうしんたいきちゅう!@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
AdvanceMobileInactivityTimerAndCheckExpired:
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
2016-05-08 11:11:24 -07:00
|
|
|
call IncrementMobileInactivityTimerByCFrames
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
2016-05-08 11:11:24 -07:00
|
|
|
ld a, [wMobileInactivityTimerMinutes]
|
2015-02-10 19:15:15 -08:00
|
|
|
cp b
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nc, .timed_out
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
.timed_out
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $fa
|
|
|
|
ld [wcd2b], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
StartMobileInactivityTimer:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2016-05-08 11:11:24 -07:00
|
|
|
ld [wMobileInactivityTimerMinutes], a
|
|
|
|
ld [wMobileInactivityTimerSeconds], a
|
|
|
|
ld [wMobileInactivityTimerFrames], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
IncrementMobileInactivityTimerBy1Frame:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, 1
|
2018-06-24 07:09:41 -07:00
|
|
|
IncrementMobileInactivityTimerByCFrames:
|
2016-05-08 11:11:24 -07:00
|
|
|
ld hl, wMobileInactivityTimerFrames ; timer?
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hl]
|
|
|
|
add c
|
2016-05-08 11:11:24 -07:00
|
|
|
cp 60
|
|
|
|
jr c, .seconds
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
.seconds
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hld], a
|
|
|
|
ret c
|
|
|
|
ld a, [hl]
|
|
|
|
inc a
|
2016-05-08 11:11:24 -07:00
|
|
|
cp 60
|
|
|
|
jr c, .minutes
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
.minutes
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hld], a
|
|
|
|
ret c
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100665:
|
2015-02-10 19:15:15 -08:00
|
|
|
call UpdateTime
|
|
|
|
ld hl, wcd36
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hHours]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hli], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hMinutes]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hli], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hSeconds]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100675:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
bit 2, [hl]
|
|
|
|
set 2, [hl]
|
|
|
|
ret nz
|
|
|
|
call Function1006d3
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100681:
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
|
|
|
ld hl, wcd2a
|
|
|
|
bit 2, [hl]
|
|
|
|
ld hl, wcd2a
|
|
|
|
set 2, [hl]
|
|
|
|
pop hl
|
|
|
|
jr nz, .asm_100694
|
|
|
|
push hl
|
|
|
|
call Function1006d3
|
|
|
|
pop hl
|
|
|
|
.asm_100694
|
|
|
|
ld de, wcd32
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100697:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [de]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_1006bb
|
|
|
|
inc de
|
|
|
|
push de
|
|
|
|
call .asm_1006b4
|
|
|
|
ld de, String1006c2
|
|
|
|
call PlaceString
|
|
|
|
ld h, b
|
|
|
|
ld l, c
|
|
|
|
pop de
|
|
|
|
inc de
|
|
|
|
call .asm_1006b4
|
|
|
|
ld de, String1006c6
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1006b4
|
2015-10-10 14:03:04 -07:00
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintNum
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1006bb
|
|
|
|
ld de, String1006ca
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String1006c2:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "ふん @"
|
2018-06-24 07:09:41 -07:00
|
|
|
String1006c6:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "びょう@"
|
2018-06-24 07:09:41 -07:00
|
|
|
String1006ca:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "1じかんいじょう@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1006d3:
|
2015-02-10 19:15:15 -08:00
|
|
|
call UpdateTime
|
|
|
|
ld de, wcd34
|
|
|
|
ld hl, wcd38
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1006dc:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hld]
|
|
|
|
ld c, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hSeconds]
|
2015-02-10 19:15:15 -08:00
|
|
|
sub c
|
|
|
|
jr nc, .asm_1006e5
|
|
|
|
add $3c
|
|
|
|
|
|
|
|
.asm_1006e5
|
|
|
|
ld [de], a
|
|
|
|
dec de
|
|
|
|
ld a, [hld]
|
|
|
|
ld c, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hMinutes]
|
2015-02-10 19:15:15 -08:00
|
|
|
sbc c
|
|
|
|
jr nc, .asm_1006f0
|
|
|
|
add $3c
|
|
|
|
|
|
|
|
.asm_1006f0
|
|
|
|
ld [de], a
|
|
|
|
dec de
|
|
|
|
ld a, [hl]
|
|
|
|
ld c, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hHours]
|
2015-02-10 19:15:15 -08:00
|
|
|
sbc c
|
|
|
|
jr nc, .asm_1006fb
|
2022-01-10 17:57:40 -08:00
|
|
|
add MAX_HOUR
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_1006fb
|
|
|
|
ld [de], a
|
|
|
|
ret
|
|
|
|
|
2019-11-17 10:47:42 -08:00
|
|
|
MobileBattleResetTimer:
|
|
|
|
ld a, BANK(sMobileBattleTimer)
|
|
|
|
ld hl, sMobileBattleTimer
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
2016-05-10 09:31:49 -07:00
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
MobileBattleFixTimer:
|
|
|
|
ld a, BANK(sMobileBattleTimer)
|
|
|
|
ld hl, sMobileBattleTimer
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2019-10-20 15:27:34 -07:00
|
|
|
xor a ; MOBILE_BATTLE_ALLOWED_SECONDS
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hli], a
|
2019-10-20 15:27:34 -07:00
|
|
|
ld a, MOBILE_BATTLE_ALLOWED_MINUTES
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hli], a
|
|
|
|
xor a
|
|
|
|
ld [hli], a
|
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100720:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ld [wcd6a], a
|
|
|
|
call UpdateTime
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hHours]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd72], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hMinutes]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd73], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hSeconds]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd74], a
|
2019-10-20 15:27:34 -07:00
|
|
|
ld a, BANK(sMobileBattleTimer)
|
|
|
|
ld hl, sMobileBattleTimer
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld [wcd6c], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wcd6d], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wcd6e], a
|
|
|
|
call CloseSRAM
|
|
|
|
ld a, [wcd6d]
|
|
|
|
ld [wcd6b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100754:
|
2015-02-10 19:15:15 -08:00
|
|
|
call UpdateTime
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hHours]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd72], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hMinutes]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd73], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hSeconds]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd74], a
|
|
|
|
ld a, [wcd6d]
|
|
|
|
ld [wcd6b], a
|
|
|
|
ld hl, wcd2a
|
|
|
|
res 6, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100772:
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
|
|
|
ld hl, wcd6c
|
|
|
|
ld a, [de]
|
|
|
|
cp [hl]
|
|
|
|
jr c, .asm_10079a
|
|
|
|
jr nz, .asm_10078c
|
|
|
|
inc hl
|
|
|
|
inc de
|
|
|
|
ld a, [de]
|
|
|
|
cp [hl]
|
|
|
|
jr c, .asm_10079a
|
|
|
|
jr nz, .asm_10078c
|
|
|
|
inc hl
|
|
|
|
inc de
|
|
|
|
ld a, [de]
|
|
|
|
cp [hl]
|
|
|
|
jr c, .asm_10079a
|
|
|
|
jr z, .asm_10079a
|
|
|
|
|
|
|
|
.asm_10078c
|
|
|
|
pop hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wcd6c], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wcd6d], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wcd6e], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10079a
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10079c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd21]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .dont_quit
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
bit 5, [hl]
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .dont_quit
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
bit 6, [hl]
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .dont_quit
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd6a]
|
|
|
|
add c
|
2016-05-08 11:11:24 -07:00
|
|
|
cp 60
|
|
|
|
jr nc, .overflow
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd6a], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
.overflow
|
|
|
|
sub 60
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd6a], a
|
|
|
|
ld d, b
|
|
|
|
push de
|
|
|
|
call Function1007f6
|
|
|
|
pop de
|
2016-05-08 11:11:24 -07:00
|
|
|
jr c, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
and a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, b
|
2016-05-08 11:11:24 -07:00
|
|
|
cp 10
|
|
|
|
jr nc, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, d
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
ld a, [wcd6b]
|
|
|
|
cp b
|
|
|
|
ret z
|
|
|
|
ld a, b
|
|
|
|
ld [wcd6b], a
|
|
|
|
call Function1008e0
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
.quit
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1008e0
|
|
|
|
ld hl, wcd2a
|
|
|
|
set 4, [hl]
|
|
|
|
ld a, $fc
|
|
|
|
ld [wcd2b], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
.dont_quit
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1007f6:
|
2015-02-10 19:15:15 -08:00
|
|
|
call UpdateTime
|
|
|
|
ld hl, wcd74
|
|
|
|
ld de, wcd71
|
|
|
|
call Function1006dc
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $04
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, $a802
|
|
|
|
call Function100826
|
|
|
|
call CloseSRAM
|
|
|
|
ld hl, wcd6e
|
|
|
|
call Function100826
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hHours]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd72], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hMinutes]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd73], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hSeconds]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd74], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100826:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd71]
|
|
|
|
add [hl]
|
|
|
|
sub $3c
|
|
|
|
jr nc, .asm_100830
|
|
|
|
add $3c
|
|
|
|
|
|
|
|
.asm_100830
|
|
|
|
ld [hld], a
|
|
|
|
ccf
|
2019-11-17 10:47:42 -08:00
|
|
|
ld a, [wcd70]
|
2015-02-10 19:15:15 -08:00
|
|
|
adc [hl]
|
|
|
|
sub $3c
|
|
|
|
jr nc, .asm_10083c
|
|
|
|
add $3c
|
|
|
|
|
|
|
|
.asm_10083c
|
|
|
|
ld [hld], a
|
|
|
|
ld b, a
|
|
|
|
ccf
|
|
|
|
ld a, [wcd6f]
|
|
|
|
adc [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ld c, a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100846:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
bit 5, [hl]
|
|
|
|
jr nz, .asm_10087c
|
|
|
|
ld a, [wcd6e]
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
sub c
|
|
|
|
jr nc, .asm_100858
|
|
|
|
add $3c
|
|
|
|
|
|
|
|
.asm_100858
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd6d]
|
|
|
|
ld c, a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0a
|
2015-02-10 19:15:15 -08:00
|
|
|
sbc c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, String_10088e
|
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 4, 16
|
|
|
|
call Function100697
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10087c
|
|
|
|
ld de, String_10088e
|
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ld h, b
|
|
|
|
ld l, c
|
|
|
|
ld de, String_10089f
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_10088e:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "モバイルたいせん できる"
|
2015-02-10 19:15:15 -08:00
|
|
|
next "じかん@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_10089f:
|
2018-01-19 18:49:16 -08:00
|
|
|
db " むせいげん@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
MobileBattleGetRemainingTime:
|
|
|
|
; Calculates the difference between 10 minutes and sMobileBattleTimer
|
|
|
|
; Returns minutes in c and seconds in b
|
|
|
|
ld a, BANK(sMobileBattleTimer)
|
|
|
|
ld hl, sMobileBattleTimer
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call CloseSRAM
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 2]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
2019-10-20 15:27:34 -07:00
|
|
|
ld a, MOBILE_BATTLE_ALLOWED_SECONDS
|
2015-02-10 19:15:15 -08:00
|
|
|
sub b
|
2019-10-20 15:27:34 -07:00
|
|
|
jr nc, .no_carry_seconds
|
|
|
|
add 60
|
|
|
|
.no_carry_seconds
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 1]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2019-10-20 15:27:34 -07:00
|
|
|
ld a, MOBILE_BATTLE_ALLOWED_MINUTES
|
2015-02-10 19:15:15 -08:00
|
|
|
sbc c
|
|
|
|
ld c, a
|
2019-10-20 15:27:34 -07:00
|
|
|
jr c, .fail
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2]
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
2019-10-20 15:27:34 -07:00
|
|
|
jr nz, .fail
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
.fail
|
|
|
|
call MobileBattleFixTimer
|
2015-12-07 08:28:58 -08:00
|
|
|
ld c, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1008e0:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hBGMapMode]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hVBlank]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
|
|
|
push bc
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hVBlank], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100970
|
|
|
|
call Function100902
|
|
|
|
call Function100989
|
|
|
|
call DelayFrame
|
|
|
|
pop bc
|
|
|
|
ld a, c
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hVBlank], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, b
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100902:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 3, 10
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, $01
|
|
|
|
ld c, $0b
|
2019-04-08 05:15:10 -07:00
|
|
|
call Textbox
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd6d]
|
|
|
|
ld c, a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0a
|
2015-02-10 19:15:15 -08:00
|
|
|
sub c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10093f
|
|
|
|
ld de, .string_100966
|
|
|
|
hlcoord 4, 11
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 8, 11
|
2015-10-10 14:03:04 -07:00
|
|
|
lb bc, 1, 2
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintNum
|
|
|
|
ld de, SFX_TWO_PC_BEEPS
|
|
|
|
call PlaySFX
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ReloadMapPart
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, $3c
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10093f
|
|
|
|
ld de, .string_10095a
|
|
|
|
hlcoord 4, 11
|
|
|
|
call PlaceString
|
|
|
|
ld de, SFX_4_NOTE_DITTY
|
|
|
|
call PlaySFX
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ReloadMapPart
|
2015-11-10 20:23:28 -08:00
|
|
|
ld c, 120
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrames
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.string_10095a
|
2018-01-19 18:49:16 -08:00
|
|
|
db "たいせん しゅうりょう@"
|
2018-06-24 07:09:41 -07:00
|
|
|
.string_100966
|
2018-01-19 18:49:16 -08:00
|
|
|
db "のこり ふん!@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100970:
|
2015-07-22 12:57:02 -07:00
|
|
|
hlcoord 0, 0
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, w3_dc00
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1009a5
|
2020-02-13 09:30:13 -08:00
|
|
|
hlcoord 0, 0, wAttrmap
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, w3_dd68
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1009a5
|
|
|
|
call Function1009d2
|
|
|
|
call Function1009ae
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100989:
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w3_dc00
|
2015-07-22 12:57:02 -07:00
|
|
|
decoord 0, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1009a5
|
|
|
|
call Function1009ae
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ReloadMapPart
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w3_dd68
|
2020-02-13 09:30:13 -08:00
|
|
|
decoord 0, 0, wAttrmap
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1009a5
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1009a5:
|
2015-07-22 12:57:02 -07:00
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1009ae:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-10 20:23:28 -08:00
|
|
|
|
|
|
|
ld hl, w3_d800
|
2020-02-13 09:30:13 -08:00
|
|
|
decoord 0, 0, wAttrmap
|
2015-11-10 20:23:28 -08:00
|
|
|
ld c, SCREEN_WIDTH
|
|
|
|
ld b, SCREEN_HEIGHT
|
|
|
|
.loop_row
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
2015-11-10 20:23:28 -08:00
|
|
|
.loop_col
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-11-10 20:23:28 -08:00
|
|
|
jr nz, .loop_col
|
2016-01-04 05:43:55 -08:00
|
|
|
ld bc, BG_MAP_WIDTH - SCREEN_WIDTH
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
2015-11-10 20:23:28 -08:00
|
|
|
jr nz, .loop_row
|
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1009d2:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rVBK]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rVBK], a
|
2015-11-10 20:23:28 -08:00
|
|
|
|
|
|
|
ld hl, w3_d800
|
2015-11-20 08:47:52 -08:00
|
|
|
debgcoord 0, 0
|
2016-01-12 09:46:18 -08:00
|
|
|
lb bc, $03, $24
|
2015-02-10 19:15:15 -08:00
|
|
|
call Get2bpp
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rVBK], a
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1009f3:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyDown]
|
2015-02-10 19:15:15 -08:00
|
|
|
and SELECT + A_BUTTON
|
|
|
|
cp SELECT + A_BUTTON
|
2016-01-04 05:43:55 -08:00
|
|
|
jr nz, .select_a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
set 4, [hl]
|
|
|
|
ld a, $f8
|
|
|
|
ld [wcd2b], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2016-01-04 05:43:55 -08:00
|
|
|
.select_a
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
_LinkBattleSendReceiveAction:
|
2015-11-23 13:04:53 -08:00
|
|
|
call .StageForSend
|
2020-05-25 18:19:52 -07:00
|
|
|
ld [wLinkBattleSentAction], a
|
2022-06-06 14:22:48 -07:00
|
|
|
vc_hook Wireless_start_exchange
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall PlaceWaitingText
|
2015-10-19 07:23:58 -07:00
|
|
|
ld a, [wLinkMode]
|
2015-11-10 20:23:28 -08:00
|
|
|
cp LINK_MOBILE
|
2015-11-23 13:04:53 -08:00
|
|
|
jr nz, .not_mobile
|
2015-09-09 16:27:07 -07:00
|
|
|
|
2016-01-04 05:43:55 -08:00
|
|
|
call .MobileBattle_SendReceiveAction
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100da5
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall FinishBattleAnim
|
2015-11-23 13:04:53 -08:00
|
|
|
jr .done
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.not_mobile
|
2016-01-04 05:43:55 -08:00
|
|
|
call .LinkBattle_SendReceiveAction
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.done
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.StageForSend:
|
2018-01-23 13:45:34 -08:00
|
|
|
ld a, [wBattlePlayerAction]
|
2018-07-28 16:27:34 -07:00
|
|
|
and a ; BATTLEPLAYERACTION_USEMOVE?
|
2015-11-23 13:04:53 -08:00
|
|
|
jr nz, .switch
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPlayerMove]
|
2018-10-20 21:52:10 -07:00
|
|
|
ld b, BATTLEACTION_STRUGGLE
|
2015-02-10 19:15:15 -08:00
|
|
|
cp STRUGGLE
|
2015-11-23 13:04:53 -08:00
|
|
|
jr z, .struggle
|
2018-10-20 21:52:10 -07:00
|
|
|
ld b, BATTLEACTION_SKIPTURN
|
2015-02-10 19:15:15 -08:00
|
|
|
cp $ff
|
2015-11-23 13:04:53 -08:00
|
|
|
jr z, .struggle
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurMoveNum]
|
2015-11-23 13:04:53 -08:00
|
|
|
jr .use_move
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.switch
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-11-23 13:04:53 -08:00
|
|
|
add BATTLEACTION_SWITCH1
|
|
|
|
jr .use_move
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.struggle
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, b
|
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.use_move
|
2016-01-12 09:46:18 -08:00
|
|
|
and $0f
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.LinkBattle_SendReceiveAction:
|
2020-05-25 18:19:52 -07:00
|
|
|
ld a, [wLinkBattleSentAction]
|
2015-11-23 13:04:53 -08:00
|
|
|
ld [wPlayerLinkAction], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $ff
|
2015-11-23 13:04:53 -08:00
|
|
|
ld [wOtherPlayerLinkAction], a
|
|
|
|
.waiting
|
2015-12-01 18:54:11 -08:00
|
|
|
call LinkTransfer
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrame
|
2015-11-23 13:04:53 -08:00
|
|
|
ld a, [wOtherPlayerLinkAction]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2015-11-23 13:04:53 -08:00
|
|
|
jr z, .waiting
|
|
|
|
|
2022-06-06 14:22:48 -07:00
|
|
|
vc_hook Wireless_end_exchange
|
|
|
|
vc_patch Wireless_net_delay_3
|
2022-03-12 15:34:04 -08:00
|
|
|
if DEF(_CRYSTAL11_VC)
|
|
|
|
ld b, 26
|
|
|
|
else
|
2015-11-23 13:04:53 -08:00
|
|
|
ld b, 10
|
2022-03-12 15:34:04 -08:00
|
|
|
endc
|
|
|
|
vc_patch_end
|
2015-11-23 13:04:53 -08:00
|
|
|
.receive
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrame
|
2015-12-01 18:54:11 -08:00
|
|
|
call LinkTransfer
|
2015-02-10 19:15:15 -08:00
|
|
|
dec b
|
2015-11-23 13:04:53 -08:00
|
|
|
jr nz, .receive
|
|
|
|
|
2022-06-06 14:22:48 -07:00
|
|
|
vc_hook Wireless_start_send_zero_bytes
|
|
|
|
vc_patch Wireless_net_delay_4
|
2022-03-12 15:34:04 -08:00
|
|
|
if DEF(_CRYSTAL11_VC)
|
|
|
|
ld b, 26
|
|
|
|
else
|
2015-11-23 13:04:53 -08:00
|
|
|
ld b, 10
|
2022-03-12 15:34:04 -08:00
|
|
|
endc
|
|
|
|
vc_patch_end
|
2015-11-23 13:04:53 -08:00
|
|
|
.acknowledge
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrame
|
2015-12-01 18:54:11 -08:00
|
|
|
call LinkDataReceived
|
2015-02-10 19:15:15 -08:00
|
|
|
dec b
|
2015-11-23 13:04:53 -08:00
|
|
|
jr nz, .acknowledge
|
|
|
|
|
2022-06-06 14:22:48 -07:00
|
|
|
vc_hook Wireless_end_send_zero_bytes
|
2015-11-23 13:04:53 -08:00
|
|
|
ld a, [wOtherPlayerLinkAction]
|
|
|
|
ld [wBattleAction], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.MobileBattle_SendReceiveAction:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100acf
|
2016-05-08 11:11:24 -07:00
|
|
|
call StartMobileInactivityTimer
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd27], a
|
|
|
|
.asm_100a92
|
|
|
|
call DelayFrame
|
|
|
|
call GetJoypad
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100382
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
|
|
|
ld b, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
2016-05-08 11:11:24 -07:00
|
|
|
call AdvanceMobileInactivityTimerAndCheckExpired
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
|
|
|
jr c, .asm_100ac7
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10079c
|
|
|
|
jr c, .asm_100ac7
|
|
|
|
call Function1009f3
|
|
|
|
jr c, .asm_100ac7
|
|
|
|
ld a, [wcd2b]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_100ac7
|
|
|
|
ld a, [wcd27]
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_100a92
|
|
|
|
call Function100ae7
|
|
|
|
jr .asm_100ace
|
|
|
|
|
|
|
|
.asm_100ac7
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0f
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wd430], a
|
|
|
|
jr .asm_100ace
|
|
|
|
|
|
|
|
.asm_100ace
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100acf:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, Unknown_100b0a
|
|
|
|
ld hl, wccb5
|
2020-05-25 18:19:52 -07:00
|
|
|
ld a, [wLinkBattleSentAction]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hli], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_100adb
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
inc c
|
|
|
|
and a
|
|
|
|
jr nz, .asm_100adb
|
|
|
|
ld a, c
|
|
|
|
ld [wccb4], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100ae7:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, Unknown_100b0a
|
|
|
|
ld hl, wcc62
|
|
|
|
.asm_100aed
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
and a
|
|
|
|
jr z, .asm_100af8
|
|
|
|
cp [hl]
|
|
|
|
jr nz, .asm_100aff
|
|
|
|
inc hl
|
|
|
|
jr .asm_100aed
|
|
|
|
|
|
|
|
.asm_100af8
|
|
|
|
ld a, [wcc61]
|
|
|
|
ld [wd430], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100aff
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0f
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wd430], a
|
|
|
|
ld a, $f1
|
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2019-11-18 15:48:39 -08:00
|
|
|
pushc
|
|
|
|
setcharmap ascii
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_100b0a:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "tetsuji", 0
|
|
|
|
|
2019-11-18 15:48:39 -08:00
|
|
|
popc
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2020-08-03 13:56:11 -07:00
|
|
|
Mobile_LoadBattleMenu:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100dd8
|
|
|
|
ret c
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, BattleMenuHeader
|
|
|
|
ld a, BANK(BattleMenuHeader)
|
|
|
|
ld de, LoadMenuHeader
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCall_de
|
2018-01-23 13:08:43 -08:00
|
|
|
ld a, BANK(BattleMenuHeader)
|
|
|
|
ld [wMenuData_2DMenuItemStringsBank], a
|
2020-12-23 13:29:30 -08:00
|
|
|
ld a, [wBattleMenuCursorPosition]
|
|
|
|
ld [wMenuCursorPosition], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100e72
|
|
|
|
call Function100b45
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall InitPartyMenuBGPal7
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100ed4
|
2020-12-23 13:29:30 -08:00
|
|
|
ld a, [wMenuCursorPosition]
|
|
|
|
ld [wBattleMenuCursorPosition], a
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100b45:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100b7a
|
2015-12-28 07:57:04 -08:00
|
|
|
.loop
|
|
|
|
call Mobile_SetOverworldDelay
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileMenuJoypad
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferTilemapToWRAMBank3
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100e2d
|
|
|
|
pop bc
|
|
|
|
jr c, .asm_100b6b
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, [wMenuJoypadFilter]
|
2015-02-10 19:15:15 -08:00
|
|
|
and c
|
2015-12-28 07:57:04 -08:00
|
|
|
jr z, .loop
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_GetMenuSelection
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100b6b
|
2015-12-19 11:48:30 -08:00
|
|
|
ld a, [w2DMenuNumCols]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld a, [w2DMenuNumRows]
|
2015-02-10 19:15:15 -08:00
|
|
|
call SimpleMultiply
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wMenuCursorPosition], a
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100b7a:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, CopyMenuData
|
|
|
|
ld a, [wMenuData_2DMenuItemStringsBank]
|
2015-02-10 19:15:15 -08:00
|
|
|
rst FarCall
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Draw2DMenu
|
|
|
|
farcall MobileTextBorder
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2015-11-25 07:16:29 -08:00
|
|
|
call ApplyTilemap
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Init2DMenuCursorPosition
|
2015-12-19 11:48:30 -08:00
|
|
|
ld hl, w2DMenuFlags1
|
2015-02-10 19:15:15 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2020-08-03 13:56:11 -07:00
|
|
|
Mobile_MoveSelectionScreen:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wSwappingMove], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CheckPlayerHasUsableMoves
|
2015-02-10 19:15:15 -08:00
|
|
|
ret z
|
|
|
|
call Function100dd8
|
2015-10-11 09:15:03 -07:00
|
|
|
jp c, xor_a_dec_a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100e72
|
2015-12-28 07:57:04 -08:00
|
|
|
call .GetMoveSelection
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall InitPartyMenuBGPal7
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100ed4
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetMoveSelection:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2020-06-20 08:56:18 -07:00
|
|
|
call .ListMoves
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100c98
|
2015-12-28 07:57:04 -08:00
|
|
|
.master_loop
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MoveInfoBox
|
2015-12-28 07:57:04 -08:00
|
|
|
.loop
|
|
|
|
call Mobile_SetOverworldDelay
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileMenuJoypad
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferTilemapToWRAMBank3
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100e2d
|
|
|
|
pop bc
|
2015-12-28 07:57:04 -08:00
|
|
|
jr c, .b_button
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, [wMenuJoypadFilter]
|
2015-02-10 19:15:15 -08:00
|
|
|
and c
|
2015-12-28 07:57:04 -08:00
|
|
|
bit D_UP_F, a
|
|
|
|
jp nz, .d_up
|
|
|
|
bit D_DOWN_F, a
|
|
|
|
jp nz, .d_down
|
|
|
|
bit A_BUTTON_F, a
|
|
|
|
jr nz, .a_button
|
|
|
|
bit B_BUTTON_F, a
|
|
|
|
jr nz, .b_button
|
|
|
|
jr .loop
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.d_up
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
2015-12-28 07:57:04 -08:00
|
|
|
jp nz, .master_loop
|
2015-12-04 05:46:11 -08:00
|
|
|
ld a, [wNumMoves]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-28 07:57:04 -08:00
|
|
|
jp .master_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.d_down
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
2015-12-04 05:46:11 -08:00
|
|
|
ld a, [wNumMoves]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2015-12-26 18:59:03 -08:00
|
|
|
inc a
|
2015-02-10 19:15:15 -08:00
|
|
|
cp b
|
2015-12-28 07:57:04 -08:00
|
|
|
jp nz, .master_loop
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-28 07:57:04 -08:00
|
|
|
jp .master_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.b_button
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurMoveNum], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.a_button
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurMoveNum], a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wBattleMonPP
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
and $3f
|
2015-12-28 07:57:04 -08:00
|
|
|
jr z, .no_pp_left
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPlayerDisableCount]
|
2015-02-10 19:15:15 -08:00
|
|
|
swap a
|
2016-01-12 09:46:18 -08:00
|
|
|
and $0f
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
|
|
|
cp c
|
2015-12-28 07:57:04 -08:00
|
|
|
jr z, .move_disabled
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wBattleMonMoves
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPlayerMove], a
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.move_disabled
|
2015-09-09 16:27:07 -07:00
|
|
|
ld hl, BattleText_TheMoveIsDisabled
|
2015-12-28 07:57:04 -08:00
|
|
|
jr .print_text
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.no_pp_left
|
2015-09-09 16:27:07 -07:00
|
|
|
ld hl, BattleText_TheresNoPPLeftForThisMove
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.print_text
|
2019-04-08 05:15:10 -07:00
|
|
|
call StdBattleTextbox
|
2020-02-13 09:30:13 -08:00
|
|
|
call SafeLoadTempTilemapToTilemap
|
2015-12-28 07:57:04 -08:00
|
|
|
jp .GetMoveSelection
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2020-06-20 08:56:18 -07:00
|
|
|
.ListMoves:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 0, 8
|
|
|
|
ld b, 8
|
|
|
|
ld c, 8
|
2019-04-08 05:15:10 -07:00
|
|
|
call Textbox
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wBattleMonMoves
|
2015-10-17 14:18:52 -07:00
|
|
|
ld de, wListMoves_MoveIndicesBuffer
|
2015-02-10 19:15:15 -08:00
|
|
|
ld bc, NUM_MOVES
|
|
|
|
call CopyBytes
|
|
|
|
ld a, SCREEN_WIDTH * 2
|
2020-11-03 19:52:50 -08:00
|
|
|
ld [wListMovesLineSpacing], a
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 2, 10
|
2018-01-16 11:30:10 -08:00
|
|
|
predef ListMoves
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100c98:
|
2020-06-20 08:56:18 -07:00
|
|
|
ld de, .data
|
|
|
|
call Load2DMenuData
|
2015-12-04 05:46:11 -08:00
|
|
|
ld a, [wNumMoves]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [w2DMenuNumRows], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurMoveNum]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-20 08:56:18 -07:00
|
|
|
.data:
|
|
|
|
db 10, 1 ; cursor start y, x
|
|
|
|
db -1, 1 ; rows, columns
|
|
|
|
db $a0, $00 ; flags
|
|
|
|
dn 2, 0 ; cursor offsets
|
|
|
|
db D_UP | D_DOWN | A_BUTTON | B_BUTTON ; accepted buttons
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mobile_PartyMenuSelect:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100dd8
|
|
|
|
ret c
|
2015-12-19 11:48:30 -08:00
|
|
|
ld hl, w2DMenuFlags1
|
2015-02-10 19:15:15 -08:00
|
|
|
set 7, [hl]
|
|
|
|
res 6, [hl]
|
2015-12-23 11:00:29 -08:00
|
|
|
.loop
|
2015-12-28 07:57:04 -08:00
|
|
|
call Mobile_SetOverworldDelay
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileMenuJoypad
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall PlaySpriteAnimations
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferTilemapToWRAMBank3
|
2016-05-08 11:11:24 -07:00
|
|
|
call MobileComms_CheckInactivityTimer
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
2015-12-23 11:00:29 -08:00
|
|
|
jr c, .done
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, [wMenuJoypadFilter]
|
2015-02-10 19:15:15 -08:00
|
|
|
and c
|
2015-12-23 11:00:29 -08:00
|
|
|
jr z, .loop
|
2015-12-17 19:31:16 -08:00
|
|
|
call PlaceHollowCursor
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
|
|
|
ld b, a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
cp b
|
2015-12-23 11:00:29 -08:00
|
|
|
jr z, .done
|
|
|
|
ld [wPartyMenuCursor], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
|
|
|
bit 1, b
|
2015-12-23 11:00:29 -08:00
|
|
|
jr nz, .done
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartyMon], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartySpecies
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-23 11:00:29 -08:00
|
|
|
.done
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MobileBattleMonMenu:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100dd8
|
|
|
|
ret c
|
|
|
|
call Function100d67
|
2015-12-19 11:48:30 -08:00
|
|
|
ld hl, w2DMenuFlags1
|
2015-02-10 19:15:15 -08:00
|
|
|
set 7, [hl]
|
|
|
|
res 6, [hl]
|
|
|
|
.asm_100d30
|
2015-12-28 07:57:04 -08:00
|
|
|
call Mobile_SetOverworldDelay
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileMenuJoypad
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall PlaySpriteAnimations
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferTilemapToWRAMBank3
|
2016-05-08 11:11:24 -07:00
|
|
|
call MobileComms_CheckInactivityTimer
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
|
|
|
jr c, .asm_100d54
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, [wMenuJoypadFilter]
|
2015-02-10 19:15:15 -08:00
|
|
|
and c
|
|
|
|
jr nz, .asm_100d56
|
|
|
|
jr .asm_100d30
|
|
|
|
|
|
|
|
.asm_100d54
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100d56
|
|
|
|
push af
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
pop af
|
|
|
|
bit 1, a
|
|
|
|
jr z, .asm_100d65
|
|
|
|
ret z
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100d65
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100d67:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, .MenuHeader
|
|
|
|
call CopyMenuHeader
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-11-04 11:02:11 -08:00
|
|
|
call MenuBox
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2015-12-15 15:59:49 -08:00
|
|
|
call PlaceVerticalMenuItems
|
2015-02-10 19:15:15 -08:00
|
|
|
call WaitBGMap
|
2018-01-23 13:08:43 -08:00
|
|
|
call CopyMenuData
|
2015-12-15 15:59:49 -08:00
|
|
|
call InitVerticalMenuCursor
|
2015-12-19 11:48:30 -08:00
|
|
|
ld hl, w2DMenuFlags1
|
2015-02-10 19:15:15 -08:00
|
|
|
set 6, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.MenuHeader:
|
2015-02-10 19:15:15 -08:00
|
|
|
db 0 ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 11, 11, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
2018-01-23 13:08:43 -08:00
|
|
|
dw .MenuData
|
2015-02-10 19:15:15 -08:00
|
|
|
db 1 ; default option
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.MenuData:
|
2018-01-14 02:59:56 -08:00
|
|
|
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
|
2015-02-10 19:15:15 -08:00
|
|
|
db 3
|
2016-01-04 05:43:55 -08:00
|
|
|
db "いれかえる@" ; TRADE
|
|
|
|
db "つよさをみる@" ; STATS
|
|
|
|
db "キャンセル@" ; CANCEL
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100da5:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
res 3, [hl]
|
|
|
|
ld hl, wcd29
|
|
|
|
res 0, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100db0:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
bit 3, [hl]
|
|
|
|
jr nz, .asm_100dbe
|
|
|
|
ld hl, wcd2a
|
|
|
|
set 3, [hl]
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100dbe
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100dc0:
|
2015-10-19 07:23:58 -07:00
|
|
|
ld a, [wLinkMode]
|
2015-11-23 13:04:53 -08:00
|
|
|
cp LINK_MOBILE
|
2015-12-26 15:11:55 -08:00
|
|
|
jr nz, .mobile
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
bit 3, [hl]
|
2015-12-26 15:11:55 -08:00
|
|
|
jr z, .mobile
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-12-26 15:11:55 -08:00
|
|
|
.mobile
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mobile_SetOverworldDelay:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, 30
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wOverworldDelay], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100dd8:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
|
|
|
ld b, $03
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall AdvanceMobileInactivityTimerAndCheckExpired
|
2015-02-10 19:15:15 -08:00
|
|
|
jr c, .asm_100dfb
|
|
|
|
ld c, $3c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10079c
|
|
|
|
jr c, .asm_100dfb
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10032e
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2b]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_100dfb
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100dfb
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MobileComms_CheckInactivityTimer:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOverworldDelay]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
|
|
|
ld a, 30
|
|
|
|
sub c
|
|
|
|
ld c, a
|
|
|
|
ld b, 3
|
|
|
|
push bc
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall AdvanceMobileInactivityTimerAndCheckExpired ; useless to farcall
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
2016-05-08 11:11:24 -07:00
|
|
|
jr c, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, 1
|
|
|
|
call Function10079c
|
2016-05-08 11:11:24 -07:00
|
|
|
jr c, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1009f3
|
2016-05-08 11:11:24 -07:00
|
|
|
jr c, .quit
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10032e ; useless to farcall
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2b]
|
|
|
|
and a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
.quit
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100e2d:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOverworldDelay]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
|
|
|
ld a, 30
|
|
|
|
sub c
|
|
|
|
ld c, a
|
|
|
|
ld b, 3
|
|
|
|
push bc
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall AdvanceMobileInactivityTimerAndCheckExpired
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
|
|
|
jr c, .asm_100e61
|
|
|
|
ld b, 1
|
|
|
|
call Function10079c
|
|
|
|
jr c, .asm_100e61
|
|
|
|
call Function1009f3
|
|
|
|
jr c, .asm_100e61
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10032e
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2b]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_100e61
|
|
|
|
call Function100e63
|
|
|
|
call Function100e84
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_100e61
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100e63:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, e
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ret nz
|
|
|
|
call Function100db0
|
|
|
|
ret nc
|
|
|
|
ld de, SFX_ELEVATOR_END
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100e72:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ld hl, wcd29
|
|
|
|
bit 0, [hl]
|
|
|
|
jr z, .asm_100e7c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_100e7c
|
|
|
|
ld [wcd67], a
|
|
|
|
xor a
|
|
|
|
ld [wcd68], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100e84:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd67]
|
|
|
|
ld hl, Jumptable_100e8c
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_100e8c:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function100ea2
|
|
|
|
dw Function100eae
|
|
|
|
dw Function100eb4
|
|
|
|
dw Function100eae
|
|
|
|
dw Function100eb4
|
|
|
|
dw Function100eae
|
|
|
|
dw Function100eb4
|
|
|
|
dw Function100eae
|
|
|
|
dw Function100eb4
|
|
|
|
dw Function100eae
|
|
|
|
dw Function100ec4
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100ea2:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100dc0
|
|
|
|
ret nc
|
|
|
|
ld hl, wcd29
|
|
|
|
set 0, [hl]
|
|
|
|
call Function100ec5
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100eae:
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
call Function100eca
|
|
|
|
jr asm_100eb8
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100eb4:
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
call Function100eca
|
|
|
|
|
2018-05-05 00:19:04 -07:00
|
|
|
asm_100eb8:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd68
|
|
|
|
inc [hl]
|
|
|
|
ld a, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
2015-12-07 08:28:58 -08:00
|
|
|
ld [hl], 0
|
2015-02-10 19:15:15 -08:00
|
|
|
jr Function100ec5
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100ec4:
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-05-05 00:19:04 -07:00
|
|
|
Function100ec5:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd67
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100eca:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_InitPartyMenuBGPal7
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function100ed4
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100ed4:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ApplyPals
|
2020-08-03 14:41:01 -07:00
|
|
|
ld a, TRUE
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hCGBPalUpdate], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100edf:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, Unknown_100fc0
|
|
|
|
ld c, 1
|
2020-10-26 12:45:57 -07:00
|
|
|
jr Function100f02
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100ee6:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, Unknown_100fc0
|
|
|
|
ld c, 2
|
2020-10-26 12:45:57 -07:00
|
|
|
jr Function100f02
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100eed:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, Unknown_100feb
|
|
|
|
ld c, 1
|
2020-10-26 12:45:57 -07:00
|
|
|
jr Function100f02
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100ef4:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, Unknown_100ff3
|
|
|
|
ld c, 1
|
2020-10-26 12:45:57 -07:00
|
|
|
jr Function100f02
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
Function100efb: ; unreferenced
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, Unknown_10102c
|
|
|
|
ld c, 1
|
2020-10-26 12:45:57 -07:00
|
|
|
jr Function100f02
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
Function100f02:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2], a
|
2015-11-09 20:01:45 -08:00
|
|
|
; someting that was previously stored in de gets backed up to here
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, d
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 2], a
|
2015-11-09 20:01:45 -08:00
|
|
|
; empty this
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 4], a
|
|
|
|
ld [wStringBuffer2 + 5], a
|
2015-11-09 20:01:45 -08:00
|
|
|
.loop
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
2015-11-09 20:01:45 -08:00
|
|
|
jr z, .done
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 3], a ; bank
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
|
|
|
inc hl
|
2015-11-09 20:01:45 -08:00
|
|
|
; addr 1
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld e, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld d, a
|
2015-11-09 20:01:45 -08:00
|
|
|
; size
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld c, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
2015-11-09 20:01:45 -08:00
|
|
|
; addr 2
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
call Function100f3d
|
2015-11-09 20:01:45 -08:00
|
|
|
; next line
|
2015-02-10 19:15:15 -08:00
|
|
|
pop hl
|
2015-12-07 08:28:58 -08:00
|
|
|
ld de, 7
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, de
|
2015-11-09 20:01:45 -08:00
|
|
|
jr .loop
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-11-09 20:01:45 -08:00
|
|
|
.done
|
|
|
|
; recover the values into bc
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 4]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 5]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100f3d:
|
2015-11-09 20:01:45 -08:00
|
|
|
; parameter
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-11-09 20:01:45 -08:00
|
|
|
jr z, .two
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-11-09 20:01:45 -08:00
|
|
|
jr z, .one
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $03
|
2015-11-09 20:01:45 -08:00
|
|
|
jr z, .three
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-09 20:01:45 -08:00
|
|
|
.three
|
|
|
|
; what was once in de gets copied to hl,
|
|
|
|
; modified by Function100f8d, and put back
|
|
|
|
; into this backup
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 1]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld l, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 2]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld h, a
|
|
|
|
call Function100f8d
|
|
|
|
ld a, l
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, h
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-09 20:01:45 -08:00
|
|
|
.two
|
|
|
|
; hl gets backed up to de, then
|
|
|
|
; do the same as in .three
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 1]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld l, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 2]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld h, a
|
|
|
|
call Function100f8d
|
|
|
|
ld a, l
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, h
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-09 20:01:45 -08:00
|
|
|
.one
|
|
|
|
; de gets copied to hl, then
|
|
|
|
; load the backup into de,
|
|
|
|
; finally run Function100f8d
|
|
|
|
; and store the de result
|
2015-02-10 19:15:15 -08:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 1]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld e, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 2]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, a
|
|
|
|
call Function100f8d
|
|
|
|
ld a, e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, d
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function100f8d:
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 4]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld l, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 5]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld h, a
|
|
|
|
add hl, bc
|
|
|
|
ld a, l
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 4], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, h
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 5], a
|
2015-02-10 19:15:15 -08:00
|
|
|
pop hl
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 3]
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 7, a
|
|
|
|
res 7, a
|
2015-11-09 20:01:45 -08:00
|
|
|
jr z, .sram
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
2016-01-12 09:46:18 -08:00
|
|
|
jr nz, .far_wram
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
.far_wram
|
2015-02-10 19:15:15 -08:00
|
|
|
and $7f
|
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2015-11-09 20:01:45 -08:00
|
|
|
.sram
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
2022-06-06 14:25:42 -07:00
|
|
|
MACRO macro_100fc0
|
2015-11-09 20:01:45 -08:00
|
|
|
; first byte:
|
|
|
|
; Bit 7 set: Not SRAM
|
2021-05-30 12:51:49 -07:00
|
|
|
; Lower 7 bits: Bank if SRAM
|
|
|
|
; address, size[, OT address]
|
|
|
|
db ($80 * (\1 >= SRAM_End)) | (BANK(\1) * (\1 < SRAM_End))
|
|
|
|
dw \1, \2
|
|
|
|
if _NARG == 3
|
|
|
|
dw \3
|
|
|
|
else
|
|
|
|
dw NULL
|
|
|
|
endc
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
Unknown_100fc0:
|
|
|
|
macro_100fc0 wPlayerName, NAME_LENGTH, wOTPlayerName
|
|
|
|
macro_100fc0 wPartyCount, 1 + PARTY_LENGTH + 1, wOTPartyCount
|
|
|
|
macro_100fc0 wPlayerID, 2, wOTPlayerID
|
|
|
|
macro_100fc0 wPartyMons, PARTYMON_STRUCT_LENGTH * PARTY_LENGTH, wOTPartyMons
|
|
|
|
macro_100fc0 wPartyMonOTs, NAME_LENGTH * PARTY_LENGTH, wOTPartyMonOTs
|
|
|
|
macro_100fc0 wPartyMonNicknames, MON_NAME_LENGTH * PARTY_LENGTH, wOTPartyMonNicknames
|
|
|
|
db -1 ; end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_100feb:
|
2021-05-30 12:51:49 -07:00
|
|
|
macro_100fc0 sPartyMail, MAIL_STRUCT_LENGTH * PARTY_LENGTH
|
|
|
|
db -1 ; end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_100ff3:
|
2021-05-30 12:51:49 -07:00
|
|
|
macro_100fc0 wdc41, 1
|
|
|
|
macro_100fc0 wPlayerName, NAME_LENGTH
|
|
|
|
macro_100fc0 wPlayerName, NAME_LENGTH
|
|
|
|
macro_100fc0 wPlayerID, 2
|
|
|
|
macro_100fc0 wSecretID, 2
|
|
|
|
macro_100fc0 wPlayerGender, 1
|
|
|
|
macro_100fc0 s4_a603, 8
|
|
|
|
macro_100fc0 s4_a007, PARTYMON_STRUCT_LENGTH
|
|
|
|
db -1 ; end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_10102c:
|
2021-05-30 12:51:49 -07:00
|
|
|
macro_100fc0 wOTPlayerName, NAME_LENGTH
|
|
|
|
macro_100fc0 wOTPlayerID, 2
|
|
|
|
macro_100fc0 wOTPartyMonNicknames, MON_NAME_LENGTH * PARTY_LENGTH
|
|
|
|
macro_100fc0 wOTPartyMonOTs, NAME_LENGTH * PARTY_LENGTH
|
|
|
|
macro_100fc0 wOTPartyMons, PARTYMON_STRUCT_LENGTH * PARTY_LENGTH
|
|
|
|
db -1 ; end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101050:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10107d
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOTPartyCount]
|
2015-12-04 05:46:11 -08:00
|
|
|
rept 2 ; ???
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2015-12-04 05:46:11 -08:00
|
|
|
ld bc, wc7bb - wc608
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1010de
|
|
|
|
ld hl, wc7bb
|
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
2022-09-14 17:49:58 -07:00
|
|
|
ld a, BANK(s7_a001)
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2022-09-14 17:49:58 -07:00
|
|
|
ld de, s7_a001
|
2015-12-04 05:46:11 -08:00
|
|
|
ld bc, wc7bd - wc608
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10107d:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2015-12-04 05:46:11 -08:00
|
|
|
ld bc, wc7bd - wc608
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPlayerName
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2015-12-04 05:46:11 -08:00
|
|
|
ld bc, NAME_LENGTH
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld hl, wd271
|
|
|
|
ld a, [hli]
|
2015-11-10 20:23:28 -08:00
|
|
|
ld [wc608 + 11], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hl]
|
2015-11-10 20:23:28 -08:00
|
|
|
ld [wc608 + 12], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyMonNicknames
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608 + 13
|
2015-12-04 05:46:11 -08:00
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call .CopyAllFromOT
|
2021-03-17 13:16:02 -07:00
|
|
|
ld hl, wOTPartyMonOTs
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTClassName + 1
|
2015-12-04 05:46:11 -08:00
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call .CopyAllFromOT
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyMon1Species
|
2022-09-14 17:49:58 -07:00
|
|
|
ld de, wc699
|
2015-12-04 05:46:11 -08:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
|
|
|
call .CopyAllFromOT
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $50
|
|
|
|
ld [wc7b9], a
|
|
|
|
ld a, $33
|
|
|
|
ld [wc7ba], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.CopyAllFromOT:
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
|
|
|
ld hl, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOTPartyCount]
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
|
|
|
pop hl
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1010de:
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
|
|
|
push bc
|
|
|
|
ld de, 0
|
2015-12-04 05:46:11 -08:00
|
|
|
.loop
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
add e
|
|
|
|
ld e, a
|
|
|
|
ld a, d
|
|
|
|
adc 0
|
|
|
|
ld d, a
|
|
|
|
dec bc
|
|
|
|
ld a, b
|
|
|
|
or c
|
2015-12-04 05:46:11 -08:00
|
|
|
jr nz, .loop
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
LoadSelectedPartiesForColosseum:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 9
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
2016-05-05 12:07:37 -07:00
|
|
|
ld hl, wPlayerMonSelection
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wPartyCount
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyThreeSpecies
|
|
|
|
ld hl, wPlayerMonSelection
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wPartyMon1Species
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyPartyStruct
|
|
|
|
ld hl, wPlayerMonSelection
|
2021-03-17 13:16:02 -07:00
|
|
|
ld de, wPartyMonOTs
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyName
|
|
|
|
ld hl, wPlayerMonSelection
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wPartyMonNicknames
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyName
|
|
|
|
ld hl, wOTMonSelection
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTPartyCount
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyThreeSpecies
|
|
|
|
ld hl, wOTMonSelection
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTPartyMon1Species
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyPartyStruct
|
|
|
|
ld hl, wOTMonSelection
|
2021-03-17 13:16:02 -07:00
|
|
|
ld de, wOTPartyMonOTs
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyName
|
|
|
|
ld hl, wOTMonSelection
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTPartyMonNicknames
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyName
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.CopyThreeSpecies:
|
2016-05-05 12:07:37 -07:00
|
|
|
; Load the 3 choices to the buffer
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
2018-01-23 14:39:09 -08:00
|
|
|
ld bc, wStringBuffer2 + NAME_LENGTH_JAPANESE
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2016-05-05 12:07:37 -07:00
|
|
|
.party_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2016-05-05 12:07:37 -07:00
|
|
|
call .GetNthSpecies
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [bc], a
|
|
|
|
inc bc
|
|
|
|
pop af
|
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
cp 3
|
|
|
|
jr nz, .party_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
pop de
|
2016-05-05 12:07:37 -07:00
|
|
|
; Copy the 3 choices to the party
|
|
|
|
ld a, 3
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [de], a
|
|
|
|
inc de
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer2 + NAME_LENGTH_JAPANESE
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 3
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld a, $ff
|
|
|
|
ld [de], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetNthSpecies:
|
2016-05-05 12:07:37 -07:00
|
|
|
; Preserves hl and de
|
|
|
|
; Get the index of the Nth selection
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
|
|
|
add l
|
|
|
|
ld l, a
|
|
|
|
ld a, h
|
2015-12-07 08:28:58 -08:00
|
|
|
adc 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld h, a
|
|
|
|
ld a, [hl]
|
|
|
|
pop hl
|
2016-05-05 12:07:37 -07:00
|
|
|
; Get the corresponding species
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
|
|
|
inc de
|
|
|
|
add e
|
|
|
|
ld e, a
|
|
|
|
ld a, d
|
2015-12-07 08:28:58 -08:00
|
|
|
adc 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, a
|
|
|
|
ld a, [de]
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.CopyPartyStruct:
|
2016-05-05 12:07:37 -07:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
|
|
|
jr .ContinueCopy
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.CopyName:
|
2016-05-05 12:07:37 -07:00
|
|
|
ld bc, NAME_LENGTH
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2016-05-05 12:07:37 -07:00
|
|
|
.ContinueCopy:
|
|
|
|
; Copy, via wc608...
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, LOW(wc608)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2], a
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, HIGH(wc608)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 1], a
|
2016-05-05 12:07:37 -07:00
|
|
|
; ... bc bytes...
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, b
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 3], a
|
2016-05-05 12:07:37 -07:00
|
|
|
; ... to de...
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 4], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, d
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 5], a
|
2016-05-05 12:07:37 -07:00
|
|
|
; ... 3 times.
|
|
|
|
ld a, 3
|
|
|
|
.big_copy_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
|
|
|
push af
|
2016-05-05 12:07:37 -07:00
|
|
|
call .GetDestinationAddress
|
|
|
|
call .GetCopySize
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
|
|
|
call AddNTimes
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld e, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 1]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, a
|
|
|
|
call CopyBytes
|
|
|
|
ld a, e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, d
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2 + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
pop hl
|
|
|
|
pop af
|
|
|
|
dec a
|
2016-05-05 12:07:37 -07:00
|
|
|
jr nz, .big_copy_loop
|
|
|
|
call .GetCopySize
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, 3
|
|
|
|
ld hl, 0
|
|
|
|
call AddNTimes
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
2016-05-05 12:07:37 -07:00
|
|
|
call .GetDestinationAddress
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetDestinationAddress:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 4]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld l, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 5]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld h, a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.GetCopySize:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 2]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wStringBuffer2 + 3]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1011f1:
|
2019-04-27 10:50:24 -07:00
|
|
|
ld a, BANK(s4_a60c)
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2019-04-27 10:50:24 -07:00
|
|
|
ld a, [s4_a60c]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wdc41], a
|
|
|
|
call CloseSRAM
|
|
|
|
ld hl, wdc41
|
|
|
|
res 4, [hl]
|
2020-10-28 10:35:39 -07:00
|
|
|
ld hl, wGameTimerPaused
|
|
|
|
bit GAME_TIMER_MOBILE_F, [hl]
|
2015-11-23 13:04:53 -08:00
|
|
|
jr z, .skip
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wdc41
|
|
|
|
set 4, [hl]
|
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.skip
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10209c
|
|
|
|
xor a
|
|
|
|
ld [wdc5f], a
|
|
|
|
ld [wdc60], a
|
2015-11-23 13:04:53 -08:00
|
|
|
ld a, LINK_MOBILE
|
2015-10-19 07:23:58 -07:00
|
|
|
ld [wLinkMode], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101220:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2015-10-19 07:23:58 -07:00
|
|
|
ld [wLinkMode], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101225:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, 1
|
|
|
|
ld e, BANK(Jumptable_101297)
|
|
|
|
ld bc, Jumptable_101297
|
|
|
|
call Function100000
|
|
|
|
jr Function10123d
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101231:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, 2
|
|
|
|
ld e, BANK(Jumptable_101297)
|
|
|
|
ld bc, Jumptable_101297
|
|
|
|
call Function100000
|
|
|
|
jr Function10123d
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10123d:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
ld hl, Jumptable_101247
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_101247:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function101251
|
|
|
|
dw Function10127d
|
|
|
|
dw Function10127c
|
|
|
|
dw Function10126c
|
|
|
|
dw Function101265
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101251:
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2015-12-24 19:58:42 -08:00
|
|
|
call RefreshScreen
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, ClosingLinkText
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1021e0
|
|
|
|
call Function1020ea
|
|
|
|
ret c
|
2018-01-24 08:17:05 -08:00
|
|
|
call Function102142
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101265:
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, LinkTerminatedText
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1021e0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10126c:
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Script_reloadmappart
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, ClosingLinkText
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1021e0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10127c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10127d:
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10127e:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wdc5f]
|
|
|
|
and a
|
2016-05-05 12:07:37 -07:00
|
|
|
jr z, .zero
|
|
|
|
cp 1
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, $27
|
2016-05-05 12:07:37 -07:00
|
|
|
jr z, .load
|
|
|
|
cp 2
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, $37
|
2016-05-05 12:07:37 -07:00
|
|
|
jr z, .load
|
|
|
|
.zero
|
2015-12-07 08:28:58 -08:00
|
|
|
ld c, 0
|
2016-05-05 12:07:37 -07:00
|
|
|
.load
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_101297:
|
2016-05-05 12:07:37 -07:00
|
|
|
dw Function101a97 ; 00
|
|
|
|
dw Function101ab4 ; 01
|
|
|
|
dw Function101475 ; 02
|
|
|
|
dw Function101b0f ; 03
|
|
|
|
dw Function101438 ; 04
|
|
|
|
dw Function101b2b ; 05
|
|
|
|
dw Function101b59 ; 06
|
|
|
|
dw Function101475 ; 07
|
|
|
|
dw Function101b70 ; 08
|
|
|
|
dw Function101438 ; 09
|
|
|
|
dw Function101b8f ; 0a
|
|
|
|
dw Function101d7b ; 0b
|
|
|
|
dw Function101d95 ; 0c
|
|
|
|
dw Function101475 ; 0d
|
|
|
|
dw Function101db2 ; 0e
|
|
|
|
dw Function101e4f ; 0f
|
|
|
|
dw Function101475 ; 10
|
|
|
|
dw Function101e64 ; 11
|
|
|
|
dw Function101e4f ; 12
|
|
|
|
dw Function101475 ; 13
|
|
|
|
dw Function101e64 ; 14
|
|
|
|
dw Function101d95 ; 15
|
|
|
|
dw Function101475 ; 16
|
|
|
|
dw Function101db2 ; 17
|
|
|
|
dw Function101dd0 ; 18
|
|
|
|
dw Function101de3 ; 19
|
|
|
|
dw Function101e39 ; 1a
|
|
|
|
dw Function101e09 ; 1b
|
|
|
|
dw Function101e4f ; 1c
|
|
|
|
dw Function101475 ; 1d
|
|
|
|
dw Function101e64 ; 1e
|
|
|
|
dw Function101d95 ; 1f
|
|
|
|
dw Function101475 ; 20
|
|
|
|
dw Function101db2 ; 21
|
|
|
|
dw Function101e09 ; 22
|
|
|
|
dw Function101e31 ; 23
|
|
|
|
dw Function101bc8 ; 24
|
|
|
|
dw Function101438 ; 25
|
|
|
|
dw Function101be5 ; 26
|
|
|
|
dw Function101ac6 ; 27
|
|
|
|
dw Function101ab4 ; 28
|
|
|
|
dw Function101475 ; 29
|
|
|
|
dw Function101c11 ; 2a
|
|
|
|
dw Function1014f4 ; 2b
|
|
|
|
dw Function101cc8 ; 2c
|
|
|
|
dw Function1014e2 ; 2d
|
|
|
|
dw Function1014e2 ; 2e
|
|
|
|
dw Function101d10 ; 2f
|
|
|
|
dw Function101d2a ; 30
|
|
|
|
dw Function101d2a ; 31
|
|
|
|
dw Function101507 ; 32
|
|
|
|
dw Function10156d ; 33
|
|
|
|
dw Function101557 ; 34
|
|
|
|
dw Function10158a ; 35
|
|
|
|
dw Function101c42 ; 36
|
|
|
|
dw Function101aed ; 37
|
|
|
|
dw Function101ab4 ; 38
|
|
|
|
dw Function101475 ; 39
|
|
|
|
dw Function101c2b ; 3a
|
|
|
|
dw Function1014f4 ; 3b
|
|
|
|
dw Function101cdf ; 3c
|
|
|
|
dw Function1014e2 ; 3d
|
|
|
|
dw Function1014e2 ; 3e
|
|
|
|
dw Function101d1e ; 3f
|
|
|
|
dw Function101d2a ; 40
|
|
|
|
dw Function101d2a ; 41
|
|
|
|
dw Function101507 ; 42
|
|
|
|
dw Function10156d ; 43
|
|
|
|
dw Function101544 ; 44
|
|
|
|
dw Function10158a ; 45
|
|
|
|
dw Function101c42 ; 46
|
|
|
|
dw Function101c50 ; 47
|
|
|
|
dw Function1014ce ; 48
|
|
|
|
dw Function101cf6 ; 49
|
|
|
|
dw Function101826 ; 4a
|
|
|
|
dw Function1017e4 ; 4b
|
|
|
|
dw Function1017f1 ; 4c
|
|
|
|
dw Function1018a8 ; 4d
|
|
|
|
dw Function1018d6 ; 4e
|
|
|
|
dw Function1017e4 ; 4f
|
|
|
|
dw Function1017f1 ; 50
|
|
|
|
dw Function1018e1 ; 51
|
|
|
|
dw Function1015df ; 52
|
|
|
|
dw Function10167d ; 53
|
|
|
|
dw Function10168a ; 54
|
|
|
|
dw Function10162a ; 55
|
|
|
|
dw Function1015be ; 56
|
|
|
|
dw Function10167d ; 57
|
|
|
|
dw Function10168a ; 58
|
|
|
|
dw Function10161f ; 59
|
|
|
|
dw Function10159d ; 5a
|
|
|
|
dw Function10167d ; 5b
|
|
|
|
dw Function10168a ; 5c
|
|
|
|
dw Function101600 ; 5d
|
|
|
|
dw Function101d03 ; 5e
|
|
|
|
dw Function101d6b ; 5f
|
|
|
|
dw Function10159d ; 60
|
|
|
|
dw Function1014ce ; 61
|
|
|
|
dw Function10168e ; 62
|
|
|
|
dw Function101600 ; 63
|
|
|
|
dw Function101913 ; 64
|
|
|
|
dw Function10194b ; 65
|
|
|
|
dw _SelectMonsForMobileBattle ; 66
|
|
|
|
dw Function1017e4 ; 67
|
|
|
|
dw Function1017f5 ; 68
|
|
|
|
dw _StartMobileBattle ; 69
|
|
|
|
dw Function101537 ; 6a
|
|
|
|
dw Function101571 ; 6b
|
|
|
|
dw Function101c92 ; 6c
|
|
|
|
dw Function10152a ; 6d
|
|
|
|
dw Function101571 ; 6e
|
|
|
|
dw Function101a4f ; 6f
|
|
|
|
dw Function101cbc ; 70
|
|
|
|
dw Function101c62 ; 71
|
|
|
|
dw Function101537 ; 72
|
|
|
|
dw Function101571 ; 73
|
|
|
|
dw Function101c92 ; 74
|
|
|
|
dw Function10152a ; 75
|
|
|
|
dw Function101571 ; 76
|
|
|
|
dw Function101ca0 ; 77
|
|
|
|
dw Function101475 ; 78
|
|
|
|
dw Function101cbc ; 79
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10138b:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function8adcc
|
2015-12-07 08:28:58 -08:00
|
|
|
ld c, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
jr c, .asm_101396
|
|
|
|
inc c
|
|
|
|
|
|
|
|
.asm_101396
|
|
|
|
sla c
|
|
|
|
ld a, [wcd2f]
|
|
|
|
and a
|
|
|
|
jr z, .asm_10139f
|
|
|
|
inc c
|
|
|
|
|
|
|
|
.asm_10139f
|
|
|
|
sla c
|
|
|
|
ld a, [wcd21]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_1013a9
|
|
|
|
inc c
|
|
|
|
|
|
|
|
.asm_1013a9
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1013aa:
|
2015-11-11 20:38:57 -08:00
|
|
|
call ClearBGPalettes
|
2015-09-09 16:27:07 -07:00
|
|
|
call Call_ExitMenu
|
2015-12-18 17:07:09 -08:00
|
|
|
call ReloadTilesetAndPalettes
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function106464
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2016-01-06 04:44:50 -08:00
|
|
|
call FinishExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1013c0:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall BlankScreen
|
2018-01-02 11:00:14 -08:00
|
|
|
farcall Stubbed_Function106462
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function106464
|
2016-01-06 04:44:50 -08:00
|
|
|
call FinishExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1013d6:
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferAttrmapAndTilemapToWRAMBank3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1013dd:
|
2017-12-24 15:11:17 -08:00
|
|
|
call CGBOnly_CopyTilemapAtOnce
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function1013e1: ; unreferenced
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
|
|
|
inc de
|
|
|
|
ld b, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld c, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_1013e6
|
|
|
|
inc c
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
and a
|
|
|
|
jr z, .asm_1013f1
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_1013e6
|
|
|
|
scf
|
|
|
|
|
|
|
|
.asm_1013f1
|
|
|
|
pop de
|
|
|
|
ld a, c
|
|
|
|
ld [de], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1013f5:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld c, a
|
|
|
|
.asm_1013f9
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_1013f9
|
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function101400: ; unreferenced
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
cp [hl]
|
|
|
|
jr nz, asm_101416
|
|
|
|
inc hl
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101406:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_101409
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
cp [hl]
|
|
|
|
jr nz, asm_101416
|
|
|
|
inc hl
|
|
|
|
dec bc
|
|
|
|
ld a, b
|
|
|
|
or c
|
|
|
|
jr nz, .asm_101409
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-10-24 12:33:18 -07:00
|
|
|
asm_101416:
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101418:
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetJoypad
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyDown]
|
2015-02-10 19:15:15 -08:00
|
|
|
and SELECT + A_BUTTON
|
|
|
|
cp SELECT + A_BUTTON
|
|
|
|
jr z, .asm_101425
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101425
|
|
|
|
ld a, $f7
|
|
|
|
ld [wcd2b], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10142c:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wc305], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function115e18
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101438:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
ld a, [wcd26]
|
|
|
|
ld hl, Jumptable_101457
|
|
|
|
rst JumpTable
|
|
|
|
ld a, [wcd26]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_101457:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function10145b
|
|
|
|
dw Function101467
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10145b:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $3c
|
|
|
|
ld [wcd42], a
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101467:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd42
|
|
|
|
dec [hl]
|
|
|
|
ret nz
|
|
|
|
ld a, [wcd26]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101475:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
ld a, [wcd26]
|
|
|
|
ld hl, Jumptable_101494
|
|
|
|
rst JumpTable
|
|
|
|
ld a, [wcd26]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_101494:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function10149a
|
|
|
|
dw Function1014a6
|
|
|
|
dw Function1014b7
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10149a:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $28
|
|
|
|
ld [wcd42], a
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1014a6:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd42
|
|
|
|
dec [hl]
|
|
|
|
ret nz
|
|
|
|
ld a, $50
|
|
|
|
ld [wcd42], a
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1014b7:
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetJoypad
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2022-09-14 17:49:58 -07:00
|
|
|
and A_BUTTON | B_BUTTON
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_1014c5
|
|
|
|
ld hl, wcd42
|
|
|
|
dec [hl]
|
|
|
|
ret nz
|
|
|
|
|
|
|
|
.asm_1014c5
|
|
|
|
ld a, [wcd26]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1014ce:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100720
|
|
|
|
farcall StartMobileInactivityTimer
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1014e2:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1014f4:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall EnableMobile
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101507:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, wcd30
|
2015-12-07 08:28:58 -08:00
|
|
|
ld hl, $40
|
|
|
|
ld bc, $40
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_01
|
|
|
|
call MobileAPI
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function10151d: ; unreferenced
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_1A
|
|
|
|
call MobileAPI
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10152a:
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_1B
|
|
|
|
call MobileAPI
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101537:
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_05
|
|
|
|
call MobileAPI
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101544:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall StartMobileInactivityTimer
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_09
|
|
|
|
call MobileAPI
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101557:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall StartMobileInactivityTimer
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd53
|
2022-01-16 14:50:50 -08:00
|
|
|
ld a, MOBILEAPI_04
|
|
|
|
call MobileAPI
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10156d:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101418
|
|
|
|
ret c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101571:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10032e
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
|
|
|
ret z
|
|
|
|
ld a, e
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_101582
|
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101582
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10158a:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall IncrementMobileInactivityTimerBy1Frame
|
2016-05-08 11:11:24 -07:00
|
|
|
ld a, [wMobileInactivityTimerMinutes]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $0a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr c, Function10156d
|
|
|
|
ld a, $fb
|
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10159d:
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100edf
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w5_d800
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10174c
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1015be:
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100eed
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w5_d800
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10174c
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1015df:
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100ef4
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w5_d800
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10174c
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101600:
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w5_d800
|
|
|
|
ld de, wc608
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $1e0
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100ee6
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10161f:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101649
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10162a:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101663
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
MobileCopyTransferData:
|
|
|
|
ld de, wMobileTransferData
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $1e0
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
MobileCopyTransferData2:
|
|
|
|
ld hl, wMobileTransferData
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $1e0
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101649:
|
2019-10-20 15:27:34 -07:00
|
|
|
ld a, BANK(w5_d800)
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w5_d800
|
2019-10-20 15:27:34 -07:00
|
|
|
call MobileCopyTransferData
|
|
|
|
ld a, BANK(w5_da00)
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, w5_da00
|
2019-10-20 15:27:34 -07:00
|
|
|
call MobileCopyTransferData2
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10165a:
|
2019-10-20 15:27:34 -07:00
|
|
|
ld a, BANK(w5_da00)
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w5_da00
|
2019-10-20 15:27:34 -07:00
|
|
|
call MobileCopyTransferData
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101663:
|
2019-10-20 15:27:34 -07:00
|
|
|
ld a, BANK(w5_dc00)
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w5_d800
|
2019-10-20 15:27:34 -07:00
|
|
|
call MobileCopyTransferData
|
|
|
|
ld a, BANK(w5_dc00)
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, w5_dc00
|
2019-10-20 15:27:34 -07:00
|
|
|
call MobileCopyTransferData2
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function101674: ; unreferenced
|
2019-10-20 15:27:34 -07:00
|
|
|
ld a, BANK(w5_dc00)
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, w5_dc00
|
2019-10-20 15:27:34 -07:00
|
|
|
call MobileCopyTransferData
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10167d:
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10168a:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101418
|
|
|
|
ret c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10168e:
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10079c
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
|
|
|
ld b, $03
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall AdvanceMobileInactivityTimerAndCheckExpired
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
|
|
|
ld a, [wcd26]
|
|
|
|
ld hl, Jumptable_1016c3
|
|
|
|
rst JumpTable
|
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
ld a, [wcd26]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_1016c3:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function1016cf
|
|
|
|
dw Function1016de
|
|
|
|
dw Function1016f8
|
|
|
|
dw Function101705
|
|
|
|
dw Function101719
|
|
|
|
dw Function101724
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1016cf:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd3a
|
|
|
|
inc [hl]
|
|
|
|
call Function10176f
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1016de:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10177b
|
|
|
|
jr nc, .asm_1016eb
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1016eb
|
|
|
|
ld a, $ff
|
|
|
|
ld [wcd39], a
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1016f8:
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd27], a
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101705:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100382
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd27]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101719:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1017c7
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101724:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd39]
|
|
|
|
cp $ff
|
|
|
|
jr z, .asm_101731
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101731
|
|
|
|
ld a, [wcd26]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
Unknown_10173a:
|
|
|
|
db $50
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10173b:
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
|
|
|
push af
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ld a, [Unknown_10173a]
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
|
|
|
call AddNTimes
|
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10174c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd3d], a
|
|
|
|
ld a, l
|
|
|
|
ld [wcd3e], a
|
|
|
|
ld a, h
|
|
|
|
ld [wcd3f], a
|
|
|
|
ld a, e
|
|
|
|
ld [wcd3b], a
|
|
|
|
ld a, d
|
2019-04-27 10:50:24 -07:00
|
|
|
ld [wBattleTowerRoomMenu2JumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
ld [wcd40], a
|
|
|
|
ld a, b
|
|
|
|
ld [wcd41], a
|
|
|
|
xor a
|
|
|
|
ld [wcd39], a
|
|
|
|
ld [wcd3a], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10176f:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wccb4
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $54
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $11
|
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10177b:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [Unknown_10173a]
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd3a]
|
2015-11-02 11:37:02 -08:00
|
|
|
ld hl, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
ld hl, wcd40
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ld a, l
|
|
|
|
sub e
|
|
|
|
ld l, a
|
|
|
|
ld a, h
|
|
|
|
sbc d
|
|
|
|
ld h, a
|
|
|
|
jr c, .asm_1017a0
|
|
|
|
add hl, bc
|
|
|
|
call Function1017b0
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1017a0
|
|
|
|
ld a, $ff
|
|
|
|
ld [wcd39], a
|
|
|
|
add hl, bc
|
|
|
|
ld a, h
|
|
|
|
or l
|
|
|
|
ret z
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
call Function1017b0
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1017b0:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
ld [wccb4], a
|
|
|
|
push bc
|
|
|
|
ld a, [wcd3a]
|
|
|
|
dec a
|
|
|
|
ld hl, wcd3b
|
|
|
|
call Function10173b
|
|
|
|
pop bc
|
|
|
|
ld de, wccb5
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1017c7:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcc60]
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd3a]
|
|
|
|
dec a
|
|
|
|
ld hl, wcd3e
|
|
|
|
call Function10173b
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
ld hl, wcc61
|
|
|
|
ld a, [wcd3d]
|
|
|
|
call FarCopyWRAM
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1017e4:
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd27], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1017f1:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101418
|
|
|
|
ret c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1017f5:
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10079c
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
|
|
|
ld b, $03
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall AdvanceMobileInactivityTimerAndCheckExpired
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100382
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd27]
|
|
|
|
bit 7, a
|
2016-05-05 12:07:37 -07:00
|
|
|
jr nz, .next
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
ret
|
|
|
|
|
2016-05-05 12:07:37 -07:00
|
|
|
.next
|
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101826:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd21]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_101833
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_101844
|
|
|
|
jr .asm_101869
|
|
|
|
|
|
|
|
.asm_101833
|
|
|
|
ld hl, Unknown_10186f
|
|
|
|
ld de, wccb4
|
|
|
|
call Function1013f5
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101844
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function103654
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
ld hl, Unknown_101882
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10185b
|
|
|
|
ld hl, Unknown_101895
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10185b
|
|
|
|
jr .asm_101869
|
|
|
|
|
|
|
|
.asm_10185b
|
|
|
|
ld de, wccb4
|
|
|
|
call Function1013f5
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101869
|
|
|
|
ld a, $fe
|
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2019-11-18 15:48:39 -08:00
|
|
|
pushc
|
|
|
|
setcharmap ascii
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
Unknown_10186f:
|
|
|
|
db .end - @
|
2016-01-12 09:46:18 -08:00
|
|
|
db $19, $73, $09, $13, "trade_crystal"
|
2022-08-06 21:38:08 -07:00
|
|
|
.end
|
|
|
|
db 0
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
Unknown_101882:
|
|
|
|
db .end - @
|
2016-01-12 09:46:18 -08:00
|
|
|
db $19, $67, $10, $01, "free__crystal"
|
2022-08-06 21:38:08 -07:00
|
|
|
.end
|
|
|
|
db 0
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
Unknown_101895:
|
|
|
|
db .end - @
|
2016-01-12 09:46:18 -08:00
|
|
|
db $19, $67, $10, $01, "limit_crystal"
|
2022-08-06 21:38:08 -07:00
|
|
|
.end
|
|
|
|
db 0
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2019-11-18 09:26:07 -08:00
|
|
|
popc
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1018a8:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wccb5
|
|
|
|
ld de, wcc61
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $04
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101406
|
|
|
|
jr c, .asm_1018d0
|
|
|
|
ld hl, wccb9
|
|
|
|
ld de, wcc65
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $06
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101406
|
|
|
|
jr c, .asm_1018ca
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1018ca
|
|
|
|
ld a, $f6
|
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1018d0
|
|
|
|
ld a, $f5
|
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1018d6:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1018ec
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1018e1:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1018fb
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1018ec:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wccb4
|
|
|
|
ld [hli], a
|
|
|
|
ld c, a
|
|
|
|
.asm_1018f3
|
|
|
|
call Random
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_1018f3
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1018fb:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2f]
|
|
|
|
and a
|
|
|
|
jr z, .asm_101906
|
|
|
|
ld hl, wcc61
|
|
|
|
jr .asm_101909
|
|
|
|
|
|
|
|
.asm_101906
|
|
|
|
ld hl, wccb5
|
|
|
|
|
|
|
|
.asm_101909
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wLinkBattleRNs
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 10
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101913:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
set 0, [hl]
|
|
|
|
xor a
|
|
|
|
ld [wc30d], a
|
|
|
|
ld hl, wcd29
|
|
|
|
res 4, [hl]
|
|
|
|
xor a
|
|
|
|
ld [wc305], a
|
|
|
|
ld hl, wcd29
|
|
|
|
res 7, [hl]
|
|
|
|
ld a, $90
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hWY], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd21]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10193f
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_101945
|
|
|
|
ld a, $71
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10193f
|
|
|
|
ld a, $66
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101945
|
|
|
|
ld a, $65
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10194b:
|
2015-10-24 07:34:19 -07:00
|
|
|
call DisableSpriteUpdates
|
2015-02-10 19:15:15 -08:00
|
|
|
call ClearSprites
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1021f9
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
bit 3, [hl]
|
|
|
|
jr nz, .asm_101967
|
|
|
|
call Function1013c0
|
|
|
|
ld a, $71
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101967
|
|
|
|
ld a, $60
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
_SelectMonsForMobileBattle:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall BlankScreen
|
|
|
|
farcall Mobile_CommunicationStandby
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
|
|
|
ld hl, wcd2a
|
|
|
|
set 6, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $06
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wccb4], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld hl, wPlayerMonSelection
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, wccb5
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 3
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld hl, wcd6c
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wccb8], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wccb9], a
|
|
|
|
ld a, [hl]
|
|
|
|
ld [wccba], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
_StartMobileBattle:
|
2016-05-05 12:07:37 -07:00
|
|
|
call CopyOtherPlayersBattleMonSelection
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100754
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ld [wdc5f], a
|
|
|
|
ld [wdc60], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall BlankScreen
|
2019-04-08 05:15:10 -07:00
|
|
|
call SpeechTextbox
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100846
|
2016-05-05 12:07:37 -07:00
|
|
|
ld c, 120
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrames
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall ClearTilemap
|
2016-05-05 12:07:37 -07:00
|
|
|
call .CopyOTDetails
|
|
|
|
call StartMobileBattle
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2b]
|
|
|
|
cp $fc
|
|
|
|
jr nz, .asm_1019e6
|
|
|
|
xor a
|
|
|
|
ld [wcd2b], a
|
|
|
|
.asm_1019e6
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.CopyOTDetails:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2022-09-14 17:49:58 -07:00
|
|
|
ld a, BANK(w5_dc0d)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-10 20:23:28 -08:00
|
|
|
|
|
|
|
ld bc, w5_dc0d
|
|
|
|
ld de, w5_dc11
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall GetMobileOTTrainerClass
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-10 20:23:28 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wOtherTrainerClass], a
|
|
|
|
ld hl, wOTPlayerName
|
|
|
|
ld de, wOTClassName
|
2015-11-10 20:23:28 -08:00
|
|
|
ld bc, NAME_LENGTH
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [wcd2f]
|
|
|
|
and a
|
2018-01-19 16:31:45 -08:00
|
|
|
ld a, USING_INTERNAL_CLOCK
|
2016-05-05 12:07:37 -07:00
|
|
|
jr z, .got_link_player_number
|
2018-01-19 16:31:45 -08:00
|
|
|
ld a, USING_EXTERNAL_CLOCK
|
2016-05-05 12:07:37 -07:00
|
|
|
.got_link_player_number
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hSerialConnectionStatus], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
StartMobileBattle:
|
2016-05-05 12:07:37 -07:00
|
|
|
; force stereo and fast text speed
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOptions
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
2016-05-05 12:07:37 -07:00
|
|
|
and (1 << STEREO)
|
|
|
|
or 1 ; 1 frame per character i.e. fast text
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hl], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, 1
|
|
|
|
ld [wDisableTextAcceleration], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall BattleIntro
|
|
|
|
farcall DoBattle
|
|
|
|
farcall ShowLinkBattleParticipantsAfterEnd
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wDisableTextAcceleration], a
|
2018-01-19 16:31:45 -08:00
|
|
|
ld a, CONNECTION_NOT_ESTABLISHED
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hSerialConnectionStatus], a
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wOptions], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101a4f:
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, 1
|
|
|
|
ld [wDisableTextAcceleration], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall DisplayLinkBattleResult
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wDisableTextAcceleration], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CleanUpBattleRAM
|
|
|
|
farcall LoadPokemonData
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1013c0
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
CopyOtherPlayersBattleMonSelection:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcc61
|
2016-05-05 12:07:37 -07:00
|
|
|
ld de, wOTMonSelection
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 3
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld de, wcc64
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100772
|
|
|
|
farcall Function101050
|
|
|
|
farcall LoadSelectedPartiesForColosseum
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101a97:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function115d99
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 7, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101ab4:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101ac6:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function115d99
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 7, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
xor a
|
|
|
|
ld [wcd2f], a
|
|
|
|
ld de, wdc42
|
|
|
|
call Function102068
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101aed:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function115d99
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 7, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2f], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101b0f:
|
2015-12-07 08:28:58 -08:00
|
|
|
ld c, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101b2b:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100579
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 2, [hl]
|
|
|
|
ld a, [wcd26]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
call Function1013dd
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_101b51
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101b51
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101b59:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101b70:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $04
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101b8f:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1005c3
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 2, [hl]
|
|
|
|
ld a, [wcd26]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
call Function1013dd
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_101bbc
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2f], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101bbc
|
|
|
|
xor a
|
|
|
|
ld [wcd2f], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101bc8:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $08
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
call Function102048
|
|
|
|
call Function1013dd
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101be5:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100579
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 2, [hl]
|
|
|
|
ld a, [wcd26]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
call Function1013dd
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_101c0b
|
|
|
|
ld a, $2a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101c0b
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101c11:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wdc5f], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $09
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
call Function102048
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101c2b:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wdc5f], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $07
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101c42:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd2a
|
|
|
|
set 1, [hl]
|
|
|
|
call Function100665
|
|
|
|
ld a, $47
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101c50:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $0a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 2, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101c62:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function115d99
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 7, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
|
|
|
xor a
|
|
|
|
ld [wc30d], a
|
|
|
|
ld hl, wcd29
|
|
|
|
res 4, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $0b
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101c92:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100675
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101ca0:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $0c
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101cbc:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function101cc2: ; unreferenced
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101cc8:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-11-11 11:12:46 -08:00
|
|
|
ld [wc314], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wc30d], a
|
|
|
|
ld hl, wcd29
|
|
|
|
set 4, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101cdf:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $06
|
2015-11-11 11:12:46 -08:00
|
|
|
ld [wc314], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wc30d], a
|
|
|
|
ld hl, wcd29
|
|
|
|
set 4, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101cf6:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0b
|
2015-11-11 11:12:46 -08:00
|
|
|
ld [wc314 + 1], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d03:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0e
|
2015-11-11 11:12:46 -08:00
|
|
|
ld [wc314 + 1], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d10:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr Function101d2a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d1e:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d2a:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101418
|
|
|
|
ret c
|
|
|
|
ld hl, wcd29
|
|
|
|
set 6, [hl]
|
|
|
|
ld a, [wcd26]
|
|
|
|
ld hl, Jumptable_101d4d
|
|
|
|
rst JumpTable
|
|
|
|
ld a, [wcd26]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_101d4d:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function101d51
|
|
|
|
dw Function101d5d
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d51:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $3c
|
|
|
|
ld [wcd42], a
|
|
|
|
ld a, [wcd26]
|
|
|
|
inc a
|
|
|
|
ld [wcd26], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d5d:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd42
|
|
|
|
dec [hl]
|
|
|
|
ret nz
|
|
|
|
ld a, [wcd26]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d6b:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wc30d]
|
|
|
|
and a
|
|
|
|
ret nz
|
|
|
|
ld hl, wcd29
|
|
|
|
res 4, [hl]
|
|
|
|
ld a, $64
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d7b:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10138b
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, 0
|
|
|
|
ld hl, Unknown_101d8d
|
|
|
|
add hl, bc
|
|
|
|
ld c, [hl]
|
|
|
|
ld a, c
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_101d8d:
|
2016-01-12 09:46:18 -08:00
|
|
|
db $15, $15, $1f, $1f, $0c, $12, $3a, $3a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101d95:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee2
|
2018-01-23 13:08:43 -08:00
|
|
|
call LoadStandardMenuHeader
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $0e
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101db2:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function103302
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
|
|
|
jr c, .asm_101dca
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101dca
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101dd0:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wdc41
|
|
|
|
bit 1, [hl]
|
|
|
|
jr nz, .asm_101ddd
|
|
|
|
ld a, $19
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101ddd
|
|
|
|
ld a, $1b
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101de3:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ecc
|
|
|
|
call Function101ead
|
|
|
|
jr c, .asm_101df3
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101df3
|
|
|
|
call Function101e98
|
|
|
|
jr c, .asm_101e00
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101e00
|
|
|
|
call Function101ed3
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101e09:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ead
|
|
|
|
jr c, .asm_101e16
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101e16
|
|
|
|
call Function101ecc
|
|
|
|
call Function101e98
|
|
|
|
push af
|
|
|
|
call Function101ed3
|
|
|
|
pop af
|
|
|
|
jr c, .asm_101e2b
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101e2b
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101e31:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $3a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
jp Function101c2b
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101e39:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1020bf
|
|
|
|
push af
|
|
|
|
call Function101ed3
|
|
|
|
pop af
|
|
|
|
jr c, .asm_101e49
|
|
|
|
ld a, $2a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101e49
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101e4f:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $06
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
call Function1013d6
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd26], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101e64:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ecc
|
|
|
|
call Function1020a8
|
|
|
|
push af
|
|
|
|
call Function101ed3
|
|
|
|
pop af
|
|
|
|
jr c, .asm_101e77
|
|
|
|
ld a, $24
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101e77
|
|
|
|
ld hl, wcd29
|
|
|
|
set 5, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function101e82: ; unreferenced
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ecc
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function101e8d: ; unreferenced
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ed3
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, [wMobileCommsJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld [wMobileCommsJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101e98:
|
2015-02-10 19:15:15 -08:00
|
|
|
call ClearSprites
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function8adb3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
2020-10-28 10:35:39 -07:00
|
|
|
ld hl, wGameTimerPaused
|
|
|
|
set GAME_TIMER_MOBILE_F, [hl]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wdc41
|
|
|
|
set 4, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101ead:
|
2020-10-28 10:35:39 -07:00
|
|
|
ld hl, wGameTimerPaused
|
|
|
|
bit GAME_TIMER_MOBILE_F, [hl]
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_101ec8
|
|
|
|
ld hl, wdc41
|
|
|
|
bit 2, [hl]
|
|
|
|
jr z, .asm_101eca
|
|
|
|
ld a, [wcd2f]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_101ec8
|
|
|
|
ld hl, wdc41
|
|
|
|
bit 1, [hl]
|
|
|
|
jr z, .asm_101eca
|
|
|
|
|
|
|
|
.asm_101ec8
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_101eca
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101ecc:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee2
|
|
|
|
call FadeToMenu
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101ed3:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1013aa
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function115d99
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101ee2:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld e, 0
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function101ee4:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, 0
|
|
|
|
ld hl, Unknown_101ef5
|
|
|
|
add hl, de
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, de
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld d, [hl]
|
|
|
|
ld e, a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100504
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_101ef5:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw String_101f13
|
|
|
|
dw String_101f14
|
|
|
|
dw String_101f32
|
|
|
|
dw String_101f4f
|
|
|
|
dw String_101f69
|
|
|
|
dw String_101f81
|
|
|
|
dw String_101f93
|
|
|
|
dw String_101faa
|
|
|
|
dw String_101fc5
|
|
|
|
dw String_101fd2
|
|
|
|
dw String_101fe1
|
|
|
|
dw String_101fef
|
|
|
|
dw String_102000
|
|
|
|
dw String_10200c
|
|
|
|
dw String_102014
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101f13:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101f14:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "モバイルアダプタを つかって"
|
|
|
|
next "おともだちと つうしんします@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101f32:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "でんわを かけるひとには"
|
|
|
|
next "つうわりょうきんが かかります@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101f4f:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "モバイルアダプタの じゅんびは"
|
|
|
|
next "できて いますか?@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101f69:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "あなたが おともだちに"
|
|
|
|
next "でんわを かけますか?@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101f81:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "めいしフォルダーを"
|
|
|
|
next "つかいますか?@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101f93:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "でんわばんごうを にゅうりょく"
|
2015-02-10 19:15:15 -08:00
|
|
|
next "してください@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101faa:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "それでは おともだちからの"
|
|
|
|
next "でんわを おまちします⋯@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101fc5:
|
2018-01-19 18:49:16 -08:00
|
|
|
next "に でんわを かけます@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101fd2:
|
2018-01-19 18:49:16 -08:00
|
|
|
next "に でんわを かけています@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101fe1:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "でんわが つながりました!@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_101fef:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "つうわを"
|
2018-01-19 18:49:16 -08:00
|
|
|
next "しゅうりょう します⋯@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_102000:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "つうしん しゅうりょう@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_10200c:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "つうわ じかん@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_102014:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "それでは つうしんの"
|
|
|
|
next "せっていを してください@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10202c:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function115d99
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd29
|
|
|
|
set 7, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10142c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld e, $0d
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function101ee4
|
|
|
|
hlcoord 4, 4
|
|
|
|
call Function100681
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102048:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10204c
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10204c:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 3, 2
|
|
|
|
ld c, $10
|
|
|
|
ld de, wcd53
|
|
|
|
.asm_102054
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
and a
|
|
|
|
jr z, .asm_102067
|
|
|
|
sub $30
|
|
|
|
jr c, .asm_102067
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $0a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nc, .asm_102067
|
|
|
|
add $f6
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_102054
|
|
|
|
|
|
|
|
.asm_102067
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102068:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd53
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $08
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_10206d
|
|
|
|
ld a, [de]
|
|
|
|
call Function102080
|
|
|
|
jr c, .asm_10207f
|
|
|
|
ld a, [de]
|
|
|
|
swap a
|
|
|
|
call Function102080
|
|
|
|
jr c, .asm_10207f
|
|
|
|
inc de
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_10206d
|
|
|
|
|
|
|
|
.asm_10207f
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102080:
|
2016-01-12 09:46:18 -08:00
|
|
|
and $0f
|
|
|
|
cp $0f
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10208a
|
|
|
|
add $30
|
|
|
|
ld [hli], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10208a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld [hl], 0
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10208e:
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
ld de, wdc42
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 8
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10209c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $ff
|
|
|
|
ld hl, wdc42
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 8
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1020a8:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10209c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, wdc42
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function17a68f
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
|
|
|
call Function10208e
|
|
|
|
call Function102068
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1020bf:
|
2015-02-10 19:15:15 -08:00
|
|
|
call ClearSprites
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function8aba9
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
jr z, .asm_1020e8
|
|
|
|
dec a
|
|
|
|
ld hl, $a04c
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $25
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $04
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10208e
|
|
|
|
call Function102068
|
|
|
|
call CloseSRAM
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1020e8
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1020ea:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wdc41
|
|
|
|
bit 4, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
jr z, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wdc41
|
|
|
|
bit 2, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
jr nz, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10218d
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 4, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
jr z, .quit
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 2, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
jr nz, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102112
|
2016-01-12 09:46:18 -08:00
|
|
|
jr z, .quit
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
.quit
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102112:
|
2022-09-14 17:49:58 -07:00
|
|
|
ld a, BANK(s4_a03b)
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2022-09-14 17:49:58 -07:00
|
|
|
ld hl, s4_a03b + 6
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, 40
|
|
|
|
.outer_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
push hl
|
2022-09-14 17:49:58 -07:00
|
|
|
ld de, wc60f
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, 31
|
|
|
|
.inner_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [de]
|
|
|
|
cp [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
jr nz, .not_matching
|
2015-02-10 19:15:15 -08:00
|
|
|
inc de
|
|
|
|
inc hl
|
|
|
|
dec b
|
2016-01-12 09:46:18 -08:00
|
|
|
jr nz, .inner_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
pop hl
|
|
|
|
xor a
|
2016-01-12 09:46:18 -08:00
|
|
|
jr .done
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
.not_matching
|
2015-02-10 19:15:15 -08:00
|
|
|
pop hl
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, 37
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, de
|
|
|
|
dec c
|
2016-01-12 09:46:18 -08:00
|
|
|
jr nz, .outer_loop
|
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
2016-01-12 09:46:18 -08:00
|
|
|
jr .done ; useless jr
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
.done
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
|
|
|
call CloseSRAM
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102142:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10218d
|
|
|
|
call Function102180
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, NewCardArrivedText
|
2019-04-08 05:15:10 -07:00
|
|
|
call MenuTextbox
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, SFX_LEVEL_UP
|
|
|
|
call PlaySFX
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10219f
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, PutCardInCardFolderText
|
2019-04-08 05:15:10 -07:00
|
|
|
call MenuTextbox
|
2015-02-10 19:15:15 -08:00
|
|
|
call YesNoBox
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
jr c, .asm_10217c
|
|
|
|
call Function1021b8
|
|
|
|
jr c, .asm_10217c
|
|
|
|
call Function10218d
|
|
|
|
call Function102180
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, CardWasListedText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
|
|
|
|
|
|
|
.asm_10217c
|
|
|
|
call Function1013d6
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102180:
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608 + 1
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer2
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 11
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10218d:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld hl, w5_dc00
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $26
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, wc608 + 1 ; useless
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10219f:
|
2015-02-10 19:15:15 -08:00
|
|
|
call FadeToMenu
|
|
|
|
call Function10218d
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608 + 1
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function8ac4e
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
call PlayClickSFX
|
|
|
|
call Function1013aa
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1021b8:
|
2015-02-10 19:15:15 -08:00
|
|
|
call FadeToMenu
|
|
|
|
call Function10218d
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, wPlayerMoveStruct
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function8ac70
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
|
|
|
call Function1013aa
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
NewCardArrivedText:
|
|
|
|
text_far _NewCardArrivedText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
PutCardInCardFolderText:
|
|
|
|
text_far _PutCardInCardFolderText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
CardWasListedText:
|
|
|
|
text_far _CardWasListedText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1021e0:
|
2019-04-08 05:15:10 -07:00
|
|
|
call MenuTextbox
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
StartingLinkText: ; unreferenced
|
|
|
|
text_far _StartingLinkText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
LinkTerminatedText:
|
|
|
|
text_far _LinkTerminatedText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
ClosingLinkText:
|
|
|
|
text_far _ClosingLinkText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1021f9:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102233
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $0 ; Function10234b
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ld hl, wcd29
|
|
|
|
bit 3, [hl]
|
|
|
|
res 3, [hl]
|
|
|
|
jr z, .asm_10220f
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $1 ; Function102361
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
|
|
|
|
.asm_10220f
|
|
|
|
call Function1022ca
|
|
|
|
ld a, [wcd49]
|
|
|
|
ld hl, Jumptable_1022f5
|
|
|
|
rst JumpTable
|
|
|
|
call Function102241
|
|
|
|
call Function1022d0
|
|
|
|
jr c, .asm_102231
|
|
|
|
ld a, [wcd49]
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_10220f
|
|
|
|
xor a
|
|
|
|
ld hl, wcd29
|
|
|
|
bit 3, [hl]
|
|
|
|
ret z
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102231
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102233:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd49
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 10
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
call Function10304f
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102241:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10226a
|
|
|
|
call Function102274
|
|
|
|
call Function10224b
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10224b:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
bit 1, [hl]
|
|
|
|
jr nz, .asm_10225e
|
|
|
|
bit 2, [hl]
|
|
|
|
jr nz, .asm_10225e
|
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10225e
|
|
|
|
res 1, [hl]
|
|
|
|
res 2, [hl]
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_ReloadMapPart
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10226a:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
bit 0, [hl]
|
|
|
|
ret z
|
|
|
|
call Function10305d
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102274:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
bit 3, [hl]
|
|
|
|
ret z
|
|
|
|
res 3, [hl]
|
2015-12-07 08:28:58 -08:00
|
|
|
ld de, 8
|
2015-02-10 19:15:15 -08:00
|
|
|
call PlaySFX
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102283:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2020-02-13 09:30:13 -08:00
|
|
|
ld [wAttrmapEnd], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 0, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10228e:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2020-02-13 09:30:13 -08:00
|
|
|
ld [wAttrmapEnd], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
res 0, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102298:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, e
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ret nz
|
|
|
|
ld hl, wcd4b
|
|
|
|
bit 6, [hl]
|
|
|
|
jr z, .asm_1022b6
|
|
|
|
ld hl, wcd4b
|
|
|
|
bit 7, [hl]
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 7, [hl]
|
|
|
|
ret nz
|
|
|
|
ld de, SFX_ELEVATOR_END
|
|
|
|
call PlaySFX
|
|
|
|
jr .asm_1022c1
|
|
|
|
|
|
|
|
.asm_1022b6
|
|
|
|
ld hl, wcd4b
|
|
|
|
bit 7, [hl]
|
|
|
|
ld hl, wcd4b
|
|
|
|
res 7, [hl]
|
|
|
|
ret z
|
|
|
|
|
|
|
|
.asm_1022c1
|
|
|
|
call Function10304f
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2020-02-13 09:30:13 -08:00
|
|
|
ld [wAttrmapEnd], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1022ca:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, 30
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wOverworldDelay], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1022d0:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10032e
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2b]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_1022f3
|
|
|
|
call Function102298
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOverworldDelay]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
|
|
|
ld a, 30
|
|
|
|
sub c
|
|
|
|
ld c, a
|
2020-11-09 12:17:03 -08:00
|
|
|
ld b, 03
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall AdvanceMobileInactivityTimerAndCheckExpired
|
2015-02-10 19:15:15 -08:00
|
|
|
jr c, .asm_1022f3
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1022f3
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_1022f5:
|
2015-12-28 07:57:04 -08:00
|
|
|
dw Function10234b ; 00
|
|
|
|
dw Function102361 ; 01
|
|
|
|
dw Function10236e ; 02
|
|
|
|
dw Function102387 ; 03
|
|
|
|
dw Function1023a1 ; 04
|
|
|
|
dw Function1025c7 ; 05
|
|
|
|
dw Function1025dc ; 06
|
|
|
|
dw Function1024f6 ; 07
|
|
|
|
dw Function10250c ; 08
|
|
|
|
dw Function1024a8 ; 09
|
|
|
|
dw Function102591 ; 0a
|
|
|
|
dw Function1024a8 ; 0b
|
|
|
|
dw Function1025b0 ; 0c
|
|
|
|
dw Function1025bd ; 0d
|
|
|
|
dw Function102814 ; 0e
|
|
|
|
dw Function10283c ; 0f
|
|
|
|
dw Function102862 ; 10
|
|
|
|
dw Function10286f ; 11
|
|
|
|
dw Function1024a8 ; 12
|
|
|
|
dw Function1028a5 ; 13
|
|
|
|
dw Function1028ab ; 14
|
|
|
|
dw Function1023b5 ; 15
|
|
|
|
dw Function1023c6 ; 16
|
|
|
|
dw Function1024af ; 17
|
|
|
|
dw Function102416 ; 18
|
|
|
|
dw Function102423 ; 19
|
|
|
|
dw Function10244b ; 1a
|
|
|
|
dw Function1024af ; 1b
|
|
|
|
dw Function10246a ; 1c
|
|
|
|
dw Function102652 ; 1d
|
|
|
|
dw Function10266b ; 1e
|
|
|
|
dw Function1025e9 ; 1f
|
|
|
|
dw Function1025ff ; 20
|
|
|
|
dw Function102738 ; 21
|
|
|
|
dw Function102754 ; 22
|
|
|
|
dw Function1026b7 ; 23
|
|
|
|
dw Function1026c8 ; 24
|
|
|
|
dw Function1028bf ; 25
|
|
|
|
dw Function1028c6 ; 26
|
|
|
|
dw Function1028d3 ; 27
|
|
|
|
dw Function1028da ; 28
|
|
|
|
dw Function1024a8 ; 29
|
|
|
|
dw Function10248d ; 2a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10234b:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102d9a
|
|
|
|
call Function102dd3
|
|
|
|
call Function102dec
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102361:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $cc
|
|
|
|
call Function1028e8
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10236e:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1028fc
|
|
|
|
ret nc
|
|
|
|
ld a, [wcd51]
|
|
|
|
cp $cc
|
|
|
|
jr z, .asm_10237f
|
|
|
|
ld a, $f2
|
|
|
|
ld [wcd2b], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10237f
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102387:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 6, [hl]
|
|
|
|
xor a
|
|
|
|
ld [wdc5f], a
|
|
|
|
ld de, MUSIC_ROUTE_30
|
|
|
|
call PlayMusic
|
|
|
|
call Function102d9a
|
|
|
|
call Function102dd3
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1023a1:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102283
|
|
|
|
call Function102db7
|
|
|
|
call Function102dec
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, $1d
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1023b5:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10228e
|
|
|
|
call Function102a3b
|
|
|
|
call Function102b12
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1023c6:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102c48
|
|
|
|
call Function102c87
|
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartyMon], a
|
2018-02-22 12:35:11 -08:00
|
|
|
xor a ; REMOVE_PARTY
|
2017-12-09 12:14:51 -08:00
|
|
|
ld [wPokemonWithdrawDepositParameter], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall RemoveMonFromPartyOrBox
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyCount
|
2015-02-10 19:15:15 -08:00
|
|
|
inc [hl]
|
|
|
|
ld a, [hli]
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $ff
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4c], a
|
|
|
|
call Function102c07
|
|
|
|
call Function102d48
|
|
|
|
call Function102b32
|
|
|
|
call Function102f50
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, $14
|
|
|
|
ld [wcd4e], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4f], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102416:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, $aa
|
|
|
|
call Function1028e8
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102423:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102921
|
|
|
|
ret nc
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall SaveAfterLinkTrade
|
2018-01-02 11:00:14 -08:00
|
|
|
farcall StubbedTrainerRankings_Trades
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall BackupMobileEventIndex
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10244b:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102f32
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, $19
|
|
|
|
ld [wcd4e], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4f], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10246a:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102d9a
|
|
|
|
ld hl, wcd29
|
|
|
|
set 3, [hl]
|
|
|
|
call Function102e07
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, $2a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
Function102480: ; unreferenced
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, $32
|
|
|
|
call DelayFrames
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10248d:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd49]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
Function102496: ; unreferenced
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4e
|
|
|
|
dec [hl]
|
|
|
|
ret nz
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1024a8:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1009f3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1024af:
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetJoypad
|
|
|
|
ld a, [wcd4a]
|
|
|
|
ld hl, Jumptable_1024ba
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_1024ba:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function1024c0
|
|
|
|
dw Function1024cb
|
|
|
|
dw Function1024de
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1024c0:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4e
|
|
|
|
inc [hl]
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1024cb:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4e
|
|
|
|
dec [hl]
|
|
|
|
ret nz
|
|
|
|
ld a, [wcd4f]
|
|
|
|
inc a
|
|
|
|
ld [wcd4e], a
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1024de:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4e
|
|
|
|
dec [hl]
|
|
|
|
jr z, .asm_1024e9
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-02-10 19:15:15 -08:00
|
|
|
and A_BUTTON | B_BUTTON
|
|
|
|
ret z
|
|
|
|
|
|
|
|
.asm_1024e9
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1024f6:
|
2015-12-17 19:31:16 -08:00
|
|
|
call PlaceHollowCursor
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, [wcd4c]
|
|
|
|
call Function1028e8
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10250c:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1028fc
|
|
|
|
ret nc
|
|
|
|
ld a, [wcd51]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $0f
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10254b
|
|
|
|
and a
|
|
|
|
jr z, .asm_102572
|
|
|
|
cp $aa
|
|
|
|
jr z, .asm_102572
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $07
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nc, .asm_102572
|
|
|
|
ld [wcd4d], a
|
|
|
|
dec a
|
|
|
|
ld [wd003], a
|
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2015-11-10 16:51:13 -08:00
|
|
|
ld [wd002], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102b9c
|
|
|
|
call Function102bdc
|
|
|
|
jr c, .asm_10256d
|
2020-10-04 16:43:28 -07:00
|
|
|
farcall CheckAnyOtherAliveMonsForTrade
|
2015-02-10 19:15:15 -08:00
|
|
|
jr c, .asm_102568
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0e
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10254b
|
|
|
|
call Function103021
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, $1e
|
|
|
|
ld [wcd4e], a
|
|
|
|
ld a, $1e
|
|
|
|
ld [wcd4f], a
|
|
|
|
ld a, $29
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102568
|
|
|
|
call Function102ff5
|
|
|
|
jr .asm_102577
|
|
|
|
|
|
|
|
.asm_10256d
|
|
|
|
call Function102f85
|
|
|
|
jr .asm_102577
|
|
|
|
|
|
|
|
.asm_102572
|
|
|
|
call Function102fce
|
|
|
|
jr .asm_102577
|
|
|
|
|
|
|
|
.asm_102577
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, $1e
|
|
|
|
ld [wcd4e], a
|
|
|
|
ld a, $3c
|
|
|
|
ld [wcd4f], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $09
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102591:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102ee7
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, $1e
|
|
|
|
ld [wcd4e], a
|
|
|
|
ld a, $3c
|
|
|
|
ld [wcd4f], a
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1025b0:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $09
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1028e8
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1025bd:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1028fc
|
|
|
|
ret nc
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $04
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1025c7:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102f6d
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0f
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1028e8
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1025dc:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1028fc
|
|
|
|
ret nc
|
|
|
|
ld a, [wcd49]
|
|
|
|
set 7, a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1025e9:
|
2015-02-10 19:15:15 -08:00
|
|
|
nop
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 6, [hl]
|
|
|
|
call Function102b4e
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1025ff:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 2, [hl]
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1009f3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileMenuJoypad
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, [wMenuJoypadFilter]
|
2015-02-10 19:15:15 -08:00
|
|
|
and c
|
|
|
|
ret z
|
2015-12-28 07:57:04 -08:00
|
|
|
bit A_BUTTON_F, c
|
|
|
|
jr nz, .a_button
|
|
|
|
bit D_UP_F, c
|
|
|
|
jr nz, .d_up
|
|
|
|
bit D_DOWN_F, c
|
|
|
|
jr nz, .d_down
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.a_button
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 3, [hl]
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $27 ; Function1028d3
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.d_up
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOTPartyCount]
|
2015-02-10 19:15:15 -08:00
|
|
|
cp b
|
|
|
|
ret nz
|
2015-12-17 19:31:16 -08:00
|
|
|
call HideCursor
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $1d ; Function102652
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.d_down
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ret nz
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $23 ; Function1026b7
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102652:
|
2015-02-10 19:15:15 -08:00
|
|
|
nop
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 6, [hl]
|
|
|
|
nop
|
|
|
|
call Function102b7b
|
|
|
|
nop
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
nop
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10266b:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 2, [hl]
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1009f3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileMenuJoypad
|
2015-12-20 09:54:08 -08:00
|
|
|
ld a, [wMenuJoypadFilter]
|
2015-02-10 19:15:15 -08:00
|
|
|
and c
|
|
|
|
ret z
|
2015-12-28 07:57:04 -08:00
|
|
|
bit A_BUTTON_F, c
|
|
|
|
jr nz, .a_button
|
|
|
|
bit D_DOWN_F, c
|
|
|
|
jr nz, .d_down
|
|
|
|
bit D_UP_F, c
|
|
|
|
jr nz, .d_up
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.a_button
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 3, [hl]
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $21 ; Function102738
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.d_down
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
|
|
|
ret nz
|
2015-12-17 19:31:16 -08:00
|
|
|
call HideCursor
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $1f ; Function1025e9
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2015-12-28 07:57:04 -08:00
|
|
|
.d_up
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-02-10 19:15:15 -08:00
|
|
|
cp b
|
|
|
|
ret nz
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $23 ; Function1026b7
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1026b7:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 6, [hl]
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1026c8:
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetJoypad
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1009f3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
|
|
|
ld a, [wcd4a]
|
|
|
|
ld hl, Jumptable_1026da
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_1026da:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function1026de
|
|
|
|
dw Function1026f3
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1026de:
|
2015-12-17 19:31:16 -08:00
|
|
|
call HideCursor
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 9, 17
|
|
|
|
ld [hl], $ed
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1026f3:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-12-28 07:57:04 -08:00
|
|
|
bit A_BUTTON_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_102723
|
2015-12-28 07:57:04 -08:00
|
|
|
bit D_UP_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_102712
|
2015-12-28 07:57:04 -08:00
|
|
|
bit D_DOWN_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_102702
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102702
|
|
|
|
hlcoord 9, 17
|
2015-12-28 07:57:04 -08:00
|
|
|
ld [hl], " "
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $1d ; Function102652
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102712
|
|
|
|
hlcoord 9, 17
|
2015-12-28 07:57:04 -08:00
|
|
|
ld [hl], " "
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOTPartyCount]
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $1f ; Function1025e9
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102723
|
|
|
|
hlcoord 9, 17
|
2015-12-28 07:57:04 -08:00
|
|
|
ld [hl], "▷"
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 3, [hl]
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 2, [hl]
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $5 ; Function1025c7
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102738:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 6, [hl]
|
2015-12-17 19:31:16 -08:00
|
|
|
call PlaceHollowCursor
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1027eb
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102754:
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetJoypad
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1009f3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
|
|
|
ld a, [wcd4a]
|
|
|
|
ld hl, Jumptable_102766
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_102766:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function102770
|
|
|
|
dw Function102775
|
|
|
|
dw Function10278c
|
|
|
|
dw Function1027a0
|
|
|
|
dw Function1027b7
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102770:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102775:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 1, 16
|
2015-12-28 07:57:04 -08:00
|
|
|
ld [hl], "▶"
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 11, 16
|
2015-12-28 07:57:04 -08:00
|
|
|
ld [hl], " "
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 2, [hl]
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10278c:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-12-28 07:57:04 -08:00
|
|
|
bit A_BUTTON_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, asm_1027c6
|
2015-12-28 07:57:04 -08:00
|
|
|
bit B_BUTTON_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, asm_1027e2
|
2015-12-28 07:57:04 -08:00
|
|
|
bit D_RIGHT_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_10279b
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10279b
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1027a0:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 1, 16
|
2015-12-28 07:57:04 -08:00
|
|
|
ld [hl], " "
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 11, 16
|
2015-12-28 07:57:04 -08:00
|
|
|
ld [hl], "▶"
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 2, [hl]
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1027b7:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-12-28 07:57:04 -08:00
|
|
|
bit A_BUTTON_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, asm_1027d1
|
2015-12-28 07:57:04 -08:00
|
|
|
bit B_BUTTON_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, asm_1027e2
|
2015-12-28 07:57:04 -08:00
|
|
|
bit D_LEFT_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, Function102770
|
|
|
|
ret
|
|
|
|
|
|
|
|
asm_1027c6:
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 3, [hl]
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $25 ; Function1028bf
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
asm_1027d1:
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 3, [hl]
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4c], a
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $7 ; Function1024f6
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
asm_1027e2:
|
|
|
|
call Function102db7
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $1d ; Function102652
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1027eb:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 0, 14
|
2015-12-28 07:57:04 -08:00
|
|
|
ld b, 2
|
|
|
|
ld c, 18
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall _LinkTextbox
|
2015-12-28 07:57:04 -08:00
|
|
|
ld de, .Stats_Trade
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 2, 16
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.Stats_Trade:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "STATS TRADE@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102814:
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd52], a
|
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2015-11-10 16:51:13 -08:00
|
|
|
ld [wd002], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
|
|
|
ld [wd003], a
|
|
|
|
call Function102ea8
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10283c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 2, [hl]
|
|
|
|
call Function1029c3
|
|
|
|
ret z
|
|
|
|
jr c, .asm_102852
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $10 ; Function102862
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102852
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $14 ; Function1028ab
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 3, [hl]
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102862:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $08
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1028e8
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10286f:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1028fc
|
|
|
|
ret nc
|
|
|
|
ld a, [wcd52]
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd51]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $08
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_102886
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $15 ; Function1023b5
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102886
|
|
|
|
call Function102ee7
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, $1e
|
|
|
|
ld [wcd4e], a
|
|
|
|
ld a, $3c
|
|
|
|
ld [wcd4f], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1028a5:
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $4 ; Function1023a1
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1028ab:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd52]
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102f15
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $c ; Function1025b0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1028bf:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1028c6:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wMonType], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102bac
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $1d ; Function102652
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1028d3:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd49]
|
|
|
|
inc a
|
|
|
|
ld [wcd49], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1028da:
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, OTPARTYMON
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wMonType], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102bac
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, $1f ; Function1025e9
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd49], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1028e8:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
res 6, [hl]
|
|
|
|
ld [wcd50], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall StartMobileInactivityTimer
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1028fc:
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetJoypad
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1009f3
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nc, .asm_102909
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102909
|
|
|
|
ld a, [wcd4a]
|
|
|
|
ld hl, Jumptable_102917
|
|
|
|
rst JumpTable
|
|
|
|
ret nc
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_102917:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function102933
|
|
|
|
dw Function10294f
|
|
|
|
dw Function10295d
|
|
|
|
dw Function10296e
|
|
|
|
dw Function102996
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102921:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4a]
|
|
|
|
ld hl, Jumptable_10292f
|
|
|
|
rst JumpTable
|
|
|
|
ret nc
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd4a], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_10292f:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function10295d
|
|
|
|
dw Function102984
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102933:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_1029bb
|
|
|
|
call LoadMenuHeader
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102e07
|
|
|
|
ld a, $32
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTextDelayFrames], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10294f:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTextDelayFrames]
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret nz
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10295d:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10299e
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcd27], a
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10296e:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100382
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ld a, [wcd27]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102984:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function100382
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ld a, [wcd27]
|
|
|
|
bit 7, a
|
|
|
|
ret z
|
|
|
|
call Function1029af
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102996:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1029af
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10299e:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wccb4], a
|
|
|
|
ld a, [wcd50]
|
|
|
|
ld [wccb5], a
|
|
|
|
ld a, $aa
|
|
|
|
ld [wcd51], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1029af:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
res 7, [hl]
|
|
|
|
ld a, [wcc61]
|
|
|
|
ld [wcd51], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MenuHeader_1029bb:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 3, 10, 15, 12
|
2015-02-10 19:15:15 -08:00
|
|
|
dw NULL
|
|
|
|
db 1 ; default option
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1029c3:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4a]
|
|
|
|
ld hl, Jumptable_1029cb
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Jumptable_1029cb:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Function1029cf
|
|
|
|
dw Function1029fe
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1029cf:
|
2018-01-23 13:08:43 -08:00
|
|
|
call LoadStandardMenuHeader
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 10, 7
|
2015-12-17 10:49:26 -08:00
|
|
|
ld b, 3
|
|
|
|
ld c, 8
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall _LinkTextbox
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, String_102a26
|
|
|
|
hlcoord 12, 8
|
|
|
|
call PlaceString
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld de, MenuData3_102a33
|
2020-06-20 08:56:18 -07:00
|
|
|
call Load2DMenuData
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4a]
|
|
|
|
inc a
|
|
|
|
ld [wcd4a], a
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1029fe:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function1009f3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret c
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileMenuJoypad
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2015-12-20 09:54:08 -08:00
|
|
|
ld hl, wMenuJoypadFilter
|
2015-02-10 19:15:15 -08:00
|
|
|
and [hl]
|
|
|
|
ret z
|
|
|
|
push af
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_102a21
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102a21
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_102a26:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "TRADE"
|
|
|
|
next "CANCEL"
|
|
|
|
db "@"
|
|
|
|
|
2015-12-17 10:49:26 -08:00
|
|
|
MenuData3_102a33:
|
2020-06-20 08:56:18 -07:00
|
|
|
db 8, 11 ; cursor start y, x
|
|
|
|
db 2, 1 ; rows, columns
|
|
|
|
db $80, $00 ; flags
|
|
|
|
dn 2, 0 ; cursor offset
|
|
|
|
db A_BUTTON ; accepted buttons
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102a3b:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd30]
|
|
|
|
ld [wc74e], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPlayerName
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, wPlayerTrademonSenderName
|
2015-12-17 10:49:26 -08:00
|
|
|
ld bc, NAME_LENGTH
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartySpecies
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPlayerTrademonSpecies], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2021-03-17 13:16:02 -07:00
|
|
|
ld hl, wPartyMonOTs
|
2015-02-10 19:15:15 -08:00
|
|
|
call SkipNames
|
2015-12-17 10:49:26 -08:00
|
|
|
ld de, wPlayerTrademonOTName
|
|
|
|
ld bc, NAME_LENGTH
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1ID
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
ld a, [hli]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPlayerTrademonID], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hl]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPlayerTrademonID + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1DVs
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
ld a, [hli]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPlayerTrademonDVs], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hl]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPlayerTrademonDVs + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1Species
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall GetCaughtGender
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wPlayerTrademonCaughtData], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPlayerName
|
2015-12-17 10:49:26 -08:00
|
|
|
ld de, wOTTrademonSenderName
|
|
|
|
ld bc, NAME_LENGTH
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
2015-12-17 10:49:26 -08:00
|
|
|
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartySpecies
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wOTTrademonSpecies], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
2021-03-17 13:16:02 -07:00
|
|
|
ld hl, wOTPartyMonOTs
|
2015-02-10 19:15:15 -08:00
|
|
|
call SkipNames
|
2015-12-17 10:49:26 -08:00
|
|
|
ld de, wOTTrademonOTName
|
|
|
|
ld bc, NAME_LENGTH
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyMon1ID
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
ld a, [hli]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wOTTrademonID], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hl]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wOTTrademonID + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyMon1DVs
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
ld a, [hli]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wOTTrademonDVs], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hl]
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wOTTrademonDVs + 1], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyMon1Species
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall GetCaughtGender
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2015-12-17 10:49:26 -08:00
|
|
|
ld [wOTTrademonCaughtData], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102b12:
|
2015-12-17 10:49:26 -08:00
|
|
|
ld c, 100
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrames
|
|
|
|
call Function102d9a
|
2015-10-21 07:43:42 -07:00
|
|
|
call LoadFontsBattleExtra
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd2f]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_102b2b
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function108026
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_102b31
|
|
|
|
|
|
|
|
.asm_102b2b
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10802a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_102b31
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102b32:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartyMon], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-11-28 12:13:40 -08:00
|
|
|
ld [wForceEvolution], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall EvolvePokemon
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102d9a
|
|
|
|
call Function102dd3
|
|
|
|
call Function102dec
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102b4e:
|
2015-12-28 07:57:04 -08:00
|
|
|
ld a, OTPARTYMON
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wMonType], a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2020-06-20 08:56:18 -07:00
|
|
|
ld de, MenuData_102b73
|
|
|
|
call Load2DMenuData
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOTPartyCount]
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [w2DMenuNumRows], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function102b68: ; unreferenced
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld hl, wWindowStackPointer
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $10
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2020-06-20 08:56:18 -07:00
|
|
|
MenuData_102b73:
|
|
|
|
db 9, 6 ; cursor start y, x
|
|
|
|
db -1, 1 ; rows, columns
|
|
|
|
db $a0, $00 ; flags
|
|
|
|
dn 1, 0 ; cursor offset
|
|
|
|
db D_UP | D_DOWN | A_BUTTON ; accepted buttons
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102b7b:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wMonType], a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
2020-06-20 08:56:18 -07:00
|
|
|
ld de, MenuData_102b94
|
|
|
|
call Load2DMenuData
|
2015-02-10 19:15:15 -08:00
|
|
|
pop af
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [w2DMenuNumRows], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-20 08:56:18 -07:00
|
|
|
MenuData_102b94:
|
|
|
|
db 1, 6 ; cursor start y, x
|
|
|
|
db 255, 1 ; rows, columns
|
|
|
|
db $a0, $00 ; flags
|
|
|
|
dn 1, 0 ; cursor offset
|
|
|
|
db D_UP | D_DOWN | A_BUTTON ; accepted buttons
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102b9c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
|
|
|
hlcoord 6, 9
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $14
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld [hl], $ec
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102bac:
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartyMon], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call LowVolume
|
|
|
|
call ClearSprites
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall _MobileStatsScreenInit
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-02-10 19:15:15 -08:00
|
|
|
inc a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102d9a
|
|
|
|
call ClearPalettes
|
|
|
|
call DelayFrame
|
|
|
|
call MaxVolume
|
|
|
|
call Function102dd3
|
|
|
|
call Function102dec
|
|
|
|
call Function102db7
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102bdc:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyMon1Species
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPartyLocation
|
|
|
|
push hl
|
|
|
|
ld a, [wcd4d]
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartyCount
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
pop hl
|
|
|
|
cp EGG
|
|
|
|
jr z, .asm_102bfa
|
|
|
|
cp [hl]
|
|
|
|
jr nz, .asm_102c05
|
|
|
|
|
|
|
|
.asm_102bfa
|
2015-11-04 08:19:58 -08:00
|
|
|
ld bc, MON_LEVEL
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp MAX_LEVEL + 1
|
|
|
|
jr nc, .asm_102c05
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_102c05
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102c07:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102c14
|
|
|
|
call Function102c3b
|
|
|
|
call Function102c21
|
|
|
|
call Function102c2e
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102c14:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartySpecies
|
|
|
|
ld de, wOTPartySpecies
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 1
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102c71
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102c21:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMonNicknames
|
|
|
|
ld de, wOTPartyMonNicknames
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 11
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102c71
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102c2e:
|
2021-03-17 13:16:02 -07:00
|
|
|
ld hl, wPartyMonOTs
|
|
|
|
ld de, wOTPartyMonOTs
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 11
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102c71
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102c3b:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1
|
|
|
|
ld de, wOTPartyMon1
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $30
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102c71
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102c48:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10165a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, $a600
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $2f
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102c71
|
|
|
|
call CloseSRAM
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, w5_da00
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $1e0
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102c71:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
|
|
|
call AddNTimes
|
|
|
|
push hl
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
|
|
|
call AddNTimes
|
|
|
|
pop de
|
|
|
|
call SwapBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102c87:
|
2015-10-24 16:49:19 -07:00
|
|
|
ld a, [wJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
|
|
|
ld a, [wcf64]
|
|
|
|
push af
|
|
|
|
ld a, [wcd4c]
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcf64], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, $a600
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $11a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102d3e
|
|
|
|
call Function102cee
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, $a600
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $11a
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102d3e
|
|
|
|
ld a, [wcd4d]
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOTPartyCount]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcf64], a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
|
|
|
ld hl, w5_da00
|
2015-11-10 20:23:28 -08:00
|
|
|
ld de, wc608
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $11a
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
call Function102cee
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, w5_da00
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $11a
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
|
|
|
pop af
|
|
|
|
ld [wcf64], a
|
|
|
|
pop af
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102cee:
|
2015-10-24 16:49:19 -07:00
|
|
|
ld a, [wJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
|
|
|
call Function102d34
|
2015-11-10 16:51:13 -08:00
|
|
|
ld de, wd002
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $2f
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
2015-10-24 16:49:19 -07:00
|
|
|
ld a, [wJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $06
|
2015-02-10 19:15:15 -08:00
|
|
|
sub c
|
|
|
|
ret z
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $2f
|
2015-11-02 11:37:02 -08:00
|
|
|
ld hl, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
|
|
|
push hl
|
2015-10-24 16:49:19 -07:00
|
|
|
ld a, [wJumptableIndex]
|
2015-02-10 19:15:15 -08:00
|
|
|
dec a
|
|
|
|
call Function102d34
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2015-12-07 08:28:58 -08:00
|
|
|
ld hl, $2f
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, de
|
|
|
|
pop bc
|
|
|
|
call CopyBytes
|
|
|
|
ld a, [wcf64]
|
|
|
|
dec a
|
|
|
|
call Function102d34
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2015-11-10 16:51:13 -08:00
|
|
|
ld hl, wd002
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $2f
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102d34:
|
2015-11-10 20:23:28 -08:00
|
|
|
ld hl, wc608
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, $2f
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102d3e:
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102d48:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcd4c]
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyCount
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
2018-07-28 16:27:34 -07:00
|
|
|
ld [wTempSpecies], a
|
2015-02-10 19:15:15 -08:00
|
|
|
cp EGG
|
|
|
|
jr z, .asm_102d6d
|
|
|
|
dec a
|
|
|
|
call SetSeenAndCaughtMon
|
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2015-11-04 08:19:58 -08:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1Happiness
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld [hl], BASE_HAPPINESS
|
|
|
|
|
|
|
|
.asm_102d6d
|
2018-07-28 16:27:34 -07:00
|
|
|
ld a, [wTempSpecies]
|
2015-02-10 19:15:15 -08:00
|
|
|
cp UNOWN
|
|
|
|
jr nz, .asm_102d98
|
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
2015-11-04 08:19:58 -08:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartyMon1DVs
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetUnownLetter
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall UpdateUnownDex
|
2015-11-29 18:34:59 -08:00
|
|
|
ld a, [wFirstUnownSeen]
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
jr nz, .asm_102d98
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wUnownLetter]
|
2015-11-29 18:34:59 -08:00
|
|
|
ld [wFirstUnownSeen], a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_102d98
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102d9a:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, " "
|
|
|
|
hlcoord 0, 0
|
2015-07-22 12:57:02 -07:00
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $07
|
2020-02-13 09:30:13 -08:00
|
|
|
hlcoord 0, 0, wAttrmap
|
2015-07-22 12:57:02 -07:00
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2015-02-10 19:15:15 -08:00
|
|
|
call ByteFill
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferAttrmapAndTilemapToWRAMBank3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102db7:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102e4f
|
|
|
|
call Function102e3e
|
|
|
|
ld hl, wcd4b
|
|
|
|
set 1, [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102dc3:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 0, 12
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, 4
|
|
|
|
ld c, 18
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall _LinkTextbox
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102dd3:
|
2015-02-10 19:15:15 -08:00
|
|
|
call DisableLCD
|
2020-02-27 11:33:30 -08:00
|
|
|
ld de, MobileTradeLightsGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles0
|
2020-02-27 11:33:30 -08:00
|
|
|
lb bc, BANK(MobileTradeLightsGFX), 4
|
2015-02-10 19:15:15 -08:00
|
|
|
call Get2bpp
|
2020-10-23 10:36:54 -07:00
|
|
|
farcall __LoadTradeScreenBorderGFX
|
2015-02-10 19:15:15 -08:00
|
|
|
call EnableLCD
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102dec:
|
2020-02-27 11:33:30 -08:00
|
|
|
ld hl, MobileTradeLightsPalettes
|
2018-01-01 06:08:21 -08:00
|
|
|
ld de, wOBPals1
|
2016-01-12 09:46:18 -08:00
|
|
|
ld bc, 4 palettes
|
|
|
|
ld a, $05
|
2015-02-10 19:15:15 -08:00
|
|
|
call FarCopyWRAM
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function49742
|
2015-09-09 16:27:07 -07:00
|
|
|
call SetPalettes
|
2015-02-10 19:15:15 -08:00
|
|
|
call DelayFrame
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102e07:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 3, 10
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, 1
|
|
|
|
ld c, 11
|
2015-10-19 07:23:58 -07:00
|
|
|
ld a, [wBattleMode]
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
2016-01-12 09:46:18 -08:00
|
|
|
jr z, .link_battle
|
2019-04-08 05:15:10 -07:00
|
|
|
call Textbox
|
2016-01-12 09:46:18 -08:00
|
|
|
jr .okay
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
.link_battle
|
2020-02-23 12:30:21 -08:00
|
|
|
; the next three operations are pointless
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 3, 10
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, 1
|
|
|
|
ld c, 11
|
2015-02-10 19:15:15 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall _LinkTextbox
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2016-01-12 09:46:18 -08:00
|
|
|
.okay
|
|
|
|
ld de, .waiting
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 4, 11
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.waiting
|
2015-02-10 19:15:15 -08:00
|
|
|
db "Waiting...!@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102e3e:
|
2020-05-29 04:16:49 -07:00
|
|
|
ld de, .CancelString
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 10, 17
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2020-05-29 04:16:49 -07:00
|
|
|
.CancelString:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "CANCEL@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102e4f:
|
2020-11-01 09:36:38 -08:00
|
|
|
farcall LoadMobileTradeBorderTilemap
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall _InitMG_Mobile_LinkTradePalMap
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wPlayerName
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 4, 0
|
|
|
|
call PlaceString
|
|
|
|
ld a, $14
|
|
|
|
ld [bc], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTPlayerName
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 4, 8
|
|
|
|
call PlaceString
|
|
|
|
ld a, $14
|
|
|
|
ld [bc], a
|
|
|
|
hlcoord 7, 1
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wPartySpecies
|
2016-01-12 09:46:18 -08:00
|
|
|
call .PlaceSpeciesNames
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 7, 9
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wOTPartySpecies
|
2016-01-12 09:46:18 -08:00
|
|
|
call .PlaceSpeciesNames
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.PlaceSpeciesNames:
|
2015-12-07 08:28:58 -08:00
|
|
|
ld c, 0
|
2016-01-12 09:46:18 -08:00
|
|
|
.count_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [de]
|
|
|
|
cp $ff
|
|
|
|
ret z
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wNamedObjectIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
ld a, c
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hDividend], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPokemonName
|
|
|
|
pop hl
|
|
|
|
call PlaceString
|
|
|
|
pop de
|
|
|
|
inc de
|
|
|
|
pop hl
|
2016-01-12 09:46:18 -08:00
|
|
|
ld bc, SCREEN_WIDTH
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
inc c
|
2016-01-12 09:46:18 -08:00
|
|
|
jr .count_loop
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102ea8:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
|
|
|
ld a, [wcd4c]
|
|
|
|
dec a
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPartySpecies
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wNamedObjectIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPokemonName
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer1
|
|
|
|
ld de, wStringBuffer2
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 11
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [wcd4d]
|
|
|
|
dec a
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartySpecies
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wNamedObjectIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPokemonName
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, TradingMonForOTMonText
|
2019-04-08 05:15:10 -07:00
|
|
|
call PrintTextboxText
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
TradingMonForOTMonText:
|
|
|
|
text_far _TradingMonForOTMonText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102ee7:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
|
|
|
ld de, String_102ef4
|
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_102ef4:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "Too bad! The trade"
|
|
|
|
next "was canceled!"
|
|
|
|
db "@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102f15:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, .TooBadTheTradeWasCanceled
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.TooBadTheTradeWasCanceled:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "こうかんを キャンセルしました@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102f32:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, .TradeCompleted
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.TradeCompleted:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "Trade completed!@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102f50:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, .PleaseWait
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.PleaseWait:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "しょうしょう おまち ください@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102f6d:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
2016-01-12 09:46:18 -08:00
|
|
|
ld de, .Finished
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.Finished:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "しゅうりょう します@"
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102f85:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wd003]
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wOTPartySpecies
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wNamedObjectIndex], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetPokemonName
|
|
|
|
call Function102dc3
|
|
|
|
ld de, String_102fb2
|
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer1
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 13, 14
|
|
|
|
call PlaceString
|
|
|
|
ld de, String_102fcc
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_102fb2:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "あいてがわ<PKMN>えらんだ "
|
|
|
|
next "いじょう<PKMN>あるようです!!"
|
2015-02-10 19:15:15 -08:00
|
|
|
db "@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_102fcc:
|
2015-02-10 19:15:15 -08:00
|
|
|
db "に@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102fce:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
|
|
|
ld de, String_102fdb
|
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_102fdb:
|
2018-01-18 19:30:30 -08:00
|
|
|
db "あいてがわ<NO>せんたくに"
|
2018-01-19 18:49:16 -08:00
|
|
|
next "いじょう<PKMN>あるようです!!"
|
2015-02-10 19:15:15 -08:00
|
|
|
done
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function102ff5:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
|
|
|
ld de, String_103002
|
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_103002:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "その#を こうかんすると"
|
|
|
|
next "せんとう できなく なっちゃうよ!"
|
2015-02-10 19:15:15 -08:00
|
|
|
db "@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103021:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function102dc3
|
|
|
|
ld de, String_10302e
|
|
|
|
hlcoord 1, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_10302e:
|
2018-01-19 18:49:16 -08:00
|
|
|
db "あいてが ちゅうしを えらんだので"
|
|
|
|
next "こうかんを ちゅうし します"
|
2015-02-10 19:15:15 -08:00
|
|
|
db "@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10304f:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2020-02-13 09:30:13 -08:00
|
|
|
ld [wAttrmapEnd], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wcf42], a
|
|
|
|
ld [wcf44], a
|
|
|
|
ld [wcf45], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10305d:
|
2015-02-10 19:15:15 -08:00
|
|
|
nop
|
2020-02-13 09:30:13 -08:00
|
|
|
ld a, [wAttrmapEnd]
|
2015-02-10 19:15:15 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
call Function10307f
|
|
|
|
ret c
|
|
|
|
call Function103094
|
|
|
|
call Function10306e
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10306e:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hOAMUpdate], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call ClearSprites
|
2022-07-09 14:18:22 -07:00
|
|
|
ld de, wShadowOAM
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1030cd
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hOAMUpdate], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10307f:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
bit 7, [hl]
|
|
|
|
jr z, .asm_10308a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_10308a
|
|
|
|
ld hl, wcf45
|
|
|
|
inc [hl]
|
|
|
|
ld a, [hl]
|
|
|
|
cp c
|
|
|
|
ret c
|
|
|
|
xor a
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103094:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wcd4b
|
|
|
|
bit 7, [hl]
|
|
|
|
jr nz, .asm_1030c0
|
|
|
|
ld a, [wcf42]
|
|
|
|
bit 7, a
|
|
|
|
jr nz, .asm_1030b2
|
|
|
|
ld a, [wcf44]
|
|
|
|
inc a
|
|
|
|
ld [wcf44], a
|
|
|
|
cp $2c
|
|
|
|
ret nz
|
|
|
|
ld hl, wcf42
|
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1030b2
|
|
|
|
ld a, [wcf44]
|
|
|
|
dec a
|
|
|
|
ld [wcf44], a
|
|
|
|
ret nz
|
|
|
|
ld hl, wcf42
|
|
|
|
res 7, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1030c0
|
|
|
|
ld hl, wcf44
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_1030ca
|
|
|
|
dec a
|
|
|
|
ld [hl], a
|
|
|
|
ret nz
|
|
|
|
|
|
|
|
.asm_1030ca
|
|
|
|
ld [hl], $2c
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1030cd:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wcf44]
|
|
|
|
ld l, a
|
|
|
|
ld h, 0
|
|
|
|
add hl, hl
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2015-02-10 19:15:15 -08:00
|
|
|
ld bc, Unknown_103112
|
|
|
|
add hl, bc
|
|
|
|
ld b, $30
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $08
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_1030de
|
|
|
|
push hl
|
|
|
|
ld hl, wcd4b
|
|
|
|
bit 7, [hl]
|
|
|
|
pop hl
|
2015-12-07 08:28:58 -08:00
|
|
|
ld a, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_1030eb
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $05
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_1030eb
|
|
|
|
|
|
|
|
add [hl]
|
|
|
|
inc hl
|
|
|
|
push hl
|
|
|
|
|
|
|
|
add a
|
2015-12-26 18:59:03 -08:00
|
|
|
add a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2017-12-25 10:40:10 -08:00
|
|
|
add LOW(Unknown_10327a)
|
2015-02-10 19:15:15 -08:00
|
|
|
ld l, a
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, HIGH(Unknown_10327a)
|
2015-02-10 19:15:15 -08:00
|
|
|
adc 0
|
|
|
|
ld h, a
|
|
|
|
|
|
|
|
ld a, b
|
|
|
|
add [hl]
|
|
|
|
inc hl
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $0a
|
2015-02-10 19:15:15 -08:00
|
|
|
add [hl]
|
|
|
|
inc hl
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
pop hl
|
|
|
|
ld a, b
|
2016-01-12 09:46:18 -08:00
|
|
|
add $08
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, a
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_1030de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_103112:
|
2016-01-12 09:46:18 -08:00
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $01, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $02, $01, $00, $00, $00, $00, $00, $00
|
|
|
|
db $03, $02, $01, $00, $00, $00, $00, $00
|
|
|
|
db $04, $03, $02, $01, $00, $00, $00, $00
|
|
|
|
db $04, $04, $03, $02, $01, $00, $00, $00
|
|
|
|
db $04, $04, $04, $03, $02, $01, $00, $00
|
|
|
|
db $04, $04, $04, $04, $03, $02, $01, $00
|
|
|
|
db $04, $04, $04, $04, $04, $03, $02, $01
|
|
|
|
db $04, $04, $04, $04, $04, $04, $03, $02
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $03
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $04, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $03, $04, $04, $04, $04, $04, $04, $04
|
|
|
|
db $02, $03, $04, $04, $04, $04, $04, $04
|
|
|
|
db $01, $02, $03, $04, $04, $04, $04, $04
|
|
|
|
db $00, $01, $02, $03, $04, $04, $04, $04
|
|
|
|
db $00, $00, $01, $02, $03, $04, $04, $04
|
|
|
|
db $00, $00, $00, $01, $02, $03, $04, $04
|
|
|
|
db $00, $00, $00, $00, $01, $02, $03, $04
|
|
|
|
db $00, $00, $00, $00, $00, $01, $02, $03
|
|
|
|
db $00, $00, $00, $00, $00, $00, $01, $02
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $01
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
db $00, $00, $00, $00, $00, $00, $00, $00
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_10327a:
|
2016-01-12 09:46:18 -08:00
|
|
|
db $00, $00, $00, $00
|
|
|
|
db $00, $00, $01, $00
|
|
|
|
db $00, $00, $02, $00
|
|
|
|
db $00, $00, $03, $00
|
|
|
|
db $00, $00, $01, $01
|
|
|
|
db $00, $00, $00, $00
|
|
|
|
db $00, $00, $01, $02
|
|
|
|
db $00, $00, $02, $02
|
|
|
|
db $00, $00, $03, $02
|
|
|
|
db $00, $00, $01, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2020-02-27 11:33:30 -08:00
|
|
|
MobileTradeLightsGFX:
|
|
|
|
INCBIN "gfx/mobile/mobile_trade_lights.2bpp"
|
|
|
|
|
|
|
|
MobileTradeLightsPalettes:
|
|
|
|
INCLUDE "gfx/mobile/mobile_trade_lights.pal"
|
2016-01-12 09:46:18 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103302:
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function103309
|
|
|
|
call Function103362
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103309:
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2020-11-03 20:25:22 -08:00
|
|
|
ld hl, wd1ea
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 10
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
2019-04-27 10:50:24 -07:00
|
|
|
ld a, BANK(s4_a60c)
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wdc41]
|
2019-04-27 10:50:24 -07:00
|
|
|
ld [s4_a60c], a
|
2020-11-03 20:25:22 -08:00
|
|
|
ld [wd1ea], a
|
2015-02-10 19:15:15 -08:00
|
|
|
call CloseSRAM
|
|
|
|
call Function1035c6
|
|
|
|
ld a, [hli]
|
|
|
|
ld e, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld d, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld c, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wd1ef], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wd1ec], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wd1ed], a
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
call Function3eea
|
|
|
|
ld hl, wd1ec
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ld a, [hl]
|
|
|
|
ld [wd1ee], a
|
|
|
|
call Function1034be
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferAttrmapAndTilemapToWRAMBank3
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wd1f0], a
|
|
|
|
call Function10339a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103362:
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_103362
|
|
|
|
ld a, [wd1f0]
|
|
|
|
ld [wd1f1], a
|
|
|
|
call Function1033af
|
|
|
|
call Function10339a
|
|
|
|
call Function10342c
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall HDMATransferTilemapToWRAMBank3
|
2020-11-03 20:25:22 -08:00
|
|
|
ld a, [wd1eb]
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_103362
|
2020-11-03 20:25:22 -08:00
|
|
|
ld hl, wd1eb
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 6, [hl]
|
|
|
|
jr z, .asm_103398
|
2019-04-27 10:50:24 -07:00
|
|
|
ld a, BANK(s4_a60c)
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2020-11-03 20:25:22 -08:00
|
|
|
ld a, [wd1ea]
|
2019-04-27 10:50:24 -07:00
|
|
|
ld [s4_a60c], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wdc41], a
|
|
|
|
call CloseSRAM
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_103398
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10339a:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wd1f0]
|
|
|
|
ld [wd1f2], a
|
|
|
|
ld c, a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld b, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
ld hl, wd1ec
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld [wd1f3], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1033af:
|
2015-02-10 19:15:15 -08:00
|
|
|
call GetJoypad
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2016-05-16 06:36:24 -07:00
|
|
|
bit D_LEFT_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .left
|
2016-05-16 06:36:24 -07:00
|
|
|
bit D_RIGHT_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .right
|
2016-05-16 06:36:24 -07:00
|
|
|
bit B_BUTTON_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .b
|
2016-05-16 06:36:24 -07:00
|
|
|
bit A_BUTTON_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .a
|
2016-05-16 06:36:24 -07:00
|
|
|
bit D_UP_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .up
|
2016-05-16 06:36:24 -07:00
|
|
|
bit D_DOWN_F, a
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .down
|
|
|
|
ret
|
|
|
|
|
|
|
|
.up
|
|
|
|
ld a, [wd1f0]
|
|
|
|
dec a
|
|
|
|
ld [wd1f0], a
|
2016-05-16 06:36:24 -07:00
|
|
|
cp 1
|
2015-02-10 19:15:15 -08:00
|
|
|
ret nc
|
|
|
|
ld a, [wd1ee]
|
|
|
|
ld [wd1f0], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.down
|
|
|
|
ld a, [wd1f0]
|
|
|
|
inc a
|
|
|
|
ld [wd1f0], a
|
|
|
|
ld c, a
|
|
|
|
ld a, [wd1ee]
|
|
|
|
cp c
|
|
|
|
ret nc
|
2016-05-16 06:36:24 -07:00
|
|
|
ld a, 1
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wd1f0], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.b
|
|
|
|
call PlayClickSFX
|
2020-11-03 20:25:22 -08:00
|
|
|
ld hl, wd1eb
|
2015-02-10 19:15:15 -08:00
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.a
|
|
|
|
ld a, [wd1f3]
|
2016-05-16 06:36:24 -07:00
|
|
|
cp 3
|
|
|
|
jr nz, .a_return
|
2015-02-10 19:15:15 -08:00
|
|
|
ld de, SFX_TRANSACTION
|
|
|
|
call PlaySFX
|
2020-11-03 20:25:22 -08:00
|
|
|
ld hl, wd1eb
|
2015-02-10 19:15:15 -08:00
|
|
|
set 7, [hl]
|
2020-11-03 20:25:22 -08:00
|
|
|
ld hl, wd1eb
|
2015-02-10 19:15:15 -08:00
|
|
|
set 6, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.left
|
|
|
|
.right
|
2016-05-16 06:36:24 -07:00
|
|
|
.a_return
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wd1f3]
|
2016-05-16 06:36:24 -07:00
|
|
|
cp 3
|
2015-02-10 19:15:15 -08:00
|
|
|
ret z
|
|
|
|
ld de, SFX_PUSH_BUTTON
|
|
|
|
call PlaySFX
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 8
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10350f
|
2020-11-03 20:25:22 -08:00
|
|
|
ld a, [wd1ea]
|
2015-02-10 19:15:15 -08:00
|
|
|
xor e
|
2020-11-03 20:25:22 -08:00
|
|
|
ld [wd1ea], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10342c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wd1f0]
|
|
|
|
ld [wd1f2], a
|
|
|
|
call Function103490
|
|
|
|
call Function10343c
|
|
|
|
call Function1034a7
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10343c:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wd1f3]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nz, .asm_103452
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 1
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1034f7
|
|
|
|
ld c, $12
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1034e0
|
|
|
|
jr .asm_10345f
|
|
|
|
|
|
|
|
.asm_103452
|
|
|
|
ld bc, $ffed
|
|
|
|
call Function1034f7
|
|
|
|
ld c, $12
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1034e0
|
|
|
|
|
|
|
|
.asm_10345f
|
2015-11-02 11:37:02 -08:00
|
|
|
ld bc, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10350f
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 1
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function103487
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 8
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10350f
|
2020-11-03 20:25:22 -08:00
|
|
|
ld a, [wd1ea]
|
2015-02-10 19:15:15 -08:00
|
|
|
and e
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 2
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10347d
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 4
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_10347d
|
|
|
|
call Function10350f
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 11
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function103487
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103487:
|
2015-02-10 19:15:15 -08:00
|
|
|
push de
|
|
|
|
call Function1034f7
|
|
|
|
pop de
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103490:
|
2015-02-10 19:15:15 -08:00
|
|
|
hlcoord 0, 15
|
|
|
|
ld c, $14
|
2016-01-12 09:46:18 -08:00
|
|
|
ld b, $03
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1034e0
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 6
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function10350f
|
|
|
|
hlcoord 1, 16
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1034a7:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wd1f1]
|
|
|
|
ld [wd1f2], a
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 10
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1034f7
|
|
|
|
ld [hl], $7f
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 10
|
2015-02-10 19:15:15 -08:00
|
|
|
call Function1034f1
|
|
|
|
ld [hl], $ed
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1034be:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wd1f2], a
|
|
|
|
ld hl, wd1ec
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ld a, [hli]
|
|
|
|
.asm_1034ca
|
|
|
|
push af
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
|
|
|
ld [wd1f3], a
|
|
|
|
call Function10343c
|
|
|
|
ld hl, wd1f2
|
|
|
|
inc [hl]
|
|
|
|
pop hl
|
|
|
|
pop af
|
|
|
|
dec a
|
|
|
|
jr nz, .asm_1034ca
|
|
|
|
call Function103490
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1034e0:
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
call ClearBox
|
|
|
|
pop hl
|
2020-02-13 09:30:13 -08:00
|
|
|
ld bc, wAttrmap - wTilemap
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $06
|
2015-10-13 09:46:40 -07:00
|
|
|
call FillBoxWithByte
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1034f1:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wd1f0]
|
|
|
|
ld [wd1f2], a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1034f7:
|
2015-07-22 12:57:02 -07:00
|
|
|
hlcoord 0, 0
|
2015-02-10 19:15:15 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [wd1ef]
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
call AddNTimes
|
|
|
|
ld a, [wd1f2]
|
|
|
|
dec a
|
|
|
|
ld bc, 40
|
|
|
|
call AddNTimes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10350f:
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wd1f3]
|
|
|
|
push bc
|
|
|
|
ld hl, Unknown_103522
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 9
|
2015-02-10 19:15:15 -08:00
|
|
|
call AddNTimes
|
|
|
|
pop bc
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld d, [hl]
|
|
|
|
ld e, a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_103522:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw String_103546
|
|
|
|
dw String_103598
|
|
|
|
dw String_1035a0
|
|
|
|
dw String_10355f
|
2016-01-12 09:46:18 -08:00
|
|
|
db $01
|
2015-02-10 19:15:15 -08:00
|
|
|
dw String_10354f
|
|
|
|
dw String_1035a8
|
|
|
|
dw String_1035b1
|
|
|
|
dw String_103571
|
2016-01-12 09:46:18 -08:00
|
|
|
db $02
|
2015-02-10 19:15:15 -08:00
|
|
|
dw String_103557
|
|
|
|
dw String_1035ba
|
|
|
|
dw String_1035bd
|
|
|
|
dw String_103585
|
2016-01-12 09:46:18 -08:00
|
|
|
db $04
|
2015-02-10 19:15:15 -08:00
|
|
|
dw String_103545
|
|
|
|
dw String_1035c1
|
|
|
|
dw String_1035c1
|
|
|
|
dw String_103545
|
|
|
|
|
|
|
|
String_103545: db "@"
|
2018-01-19 18:49:16 -08:00
|
|
|
String_103546: db "せんとう アニメ@"
|
2015-02-10 19:15:15 -08:00
|
|
|
String_10354f: db "でんわばんごう@"
|
|
|
|
String_103557: db "めいしこうかん@"
|
2018-01-19 18:49:16 -08:00
|
|
|
String_10355f: db "でんわを かけるひとが きめられる@"
|
|
|
|
String_103571: db "でんわばんごうの にゅうりょくのしかた@"
|
|
|
|
String_103585: db "あたらしいめいしが あれば こうかん@"
|
|
|
|
String_103598: db "とばして みる@"
|
|
|
|
String_1035a0: db "じっくり みる@"
|
2015-02-10 19:15:15 -08:00
|
|
|
String_1035a8: db "めいしからえらぶ@"
|
2018-01-19 18:49:16 -08:00
|
|
|
String_1035b1: db "すうじで いれる@"
|
2015-02-10 19:15:15 -08:00
|
|
|
String_1035ba: db "する@"
|
|
|
|
String_1035bd: db "しない@"
|
|
|
|
String_1035c1: db "けってい@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1035c6:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function10138b
|
2015-02-10 19:15:15 -08:00
|
|
|
ld b, 0
|
|
|
|
ld hl, Unknown_1035d7
|
|
|
|
add hl, bc
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, bc
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_1035d7:
|
2015-02-10 19:15:15 -08:00
|
|
|
dw Unknown_1035e7
|
|
|
|
dw Unknown_1035f3
|
|
|
|
dw Unknown_103608
|
|
|
|
dw Unknown_103608
|
|
|
|
dw Unknown_1035fe
|
2018-01-24 08:17:05 -08:00
|
|
|
dw AskMobileOrCable
|
|
|
|
dw AskMobileOrCable
|
|
|
|
dw AskMobileOrCable
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_1035e7:
|
2015-02-10 19:15:15 -08:00
|
|
|
dwcoord 0, 6
|
2016-01-12 09:46:18 -08:00
|
|
|
db $12, $07, $07
|
2015-02-10 19:15:15 -08:00
|
|
|
dw .this
|
|
|
|
.this
|
|
|
|
db 4, 2, 1, 0, 3
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_1035f3:
|
2015-02-10 19:15:15 -08:00
|
|
|
dwcoord 0, 7
|
2016-01-12 09:46:18 -08:00
|
|
|
db $12, $06, $09
|
2015-02-10 19:15:15 -08:00
|
|
|
dw .this
|
|
|
|
.this
|
|
|
|
db 3, 2, 1, 3
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_1035fe:
|
2015-02-10 19:15:15 -08:00
|
|
|
dwcoord 0, 9
|
2016-01-12 09:46:18 -08:00
|
|
|
db $12, $04, $0b
|
2015-02-10 19:15:15 -08:00
|
|
|
dw .this
|
|
|
|
.this
|
|
|
|
db 2, 0, 3
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Unknown_103608:
|
2015-02-10 19:15:15 -08:00
|
|
|
dwcoord 0, 9
|
2016-01-12 09:46:18 -08:00
|
|
|
db $12, $04, $0b
|
2015-02-10 19:15:15 -08:00
|
|
|
dw .this
|
|
|
|
.this
|
|
|
|
db 2, 2, 3
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
AskMobileOrCable:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_103640
|
|
|
|
call LoadMenuHeader
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, [wMobileOrCable_LastSelection]
|
|
|
|
and $0f
|
2015-11-16 13:01:45 -08:00
|
|
|
jr z, .skip_load
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wMenuCursorPosition], a
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-11-16 13:01:45 -08:00
|
|
|
.skip_load
|
2015-12-15 15:59:49 -08:00
|
|
|
call VerticalMenu
|
2015-12-24 19:58:42 -08:00
|
|
|
call CloseWindow
|
2015-11-16 13:01:45 -08:00
|
|
|
jr c, .pressed_b
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld c, a
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, [wMobileOrCable_LastSelection]
|
2015-02-10 19:15:15 -08:00
|
|
|
and $f0
|
|
|
|
or c
|
2016-01-12 09:46:18 -08:00
|
|
|
ld [wMobileOrCable_LastSelection], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-16 13:01:45 -08:00
|
|
|
.pressed_b
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MenuHeader_103640:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 13, 6, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
|
2018-01-23 13:08:43 -08:00
|
|
|
dw MenuData_103648
|
2015-02-10 19:15:15 -08:00
|
|
|
db 1 ; default option
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MenuData_103648:
|
2018-01-14 02:59:56 -08:00
|
|
|
db STATICMENU_CURSOR ; flags
|
2015-02-10 19:15:15 -08:00
|
|
|
db 2
|
|
|
|
db "モバイル@"
|
|
|
|
db "ケーブル@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103654:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_AlwaysReturnNotCarry
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 7, c
|
|
|
|
jr nz, .asm_103666
|
|
|
|
ld hl, wcd2a
|
|
|
|
res 5, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $02
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_103666
|
|
|
|
ld hl, wcd2a
|
|
|
|
set 5, [hl]
|
2016-01-12 09:46:18 -08:00
|
|
|
ld c, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mobile_SelectThreeMons:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_AlwaysReturnNotCarry
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 7, c
|
|
|
|
jr z, .asm_10369b
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, MobileBattleMustPickThreeMonText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
|
|
|
jr c, .asm_103696
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CheckForMobileBattleRules
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nc, .asm_103690
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_103696
|
|
|
|
|
|
|
|
.asm_103690
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_103696
|
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_10369b
|
2016-01-12 09:46:18 -08:00
|
|
|
ld hl, wMobileOrCable_LastSelection
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 7, [hl]
|
|
|
|
set 7, [hl]
|
|
|
|
jr nz, .asm_1036b5
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, MobileBattleMoreInfoText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
|
|
|
jr c, .asm_1036b5
|
|
|
|
call Function1036f9
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
|
|
|
|
.asm_1036b5
|
|
|
|
call Function103700
|
|
|
|
jr c, .asm_1036f4
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_103747
|
|
|
|
call LoadMenuHeader
|
2015-12-15 15:59:49 -08:00
|
|
|
call VerticalMenu
|
2015-07-20 00:51:52 -07:00
|
|
|
call ExitMenu
|
2015-02-10 19:15:15 -08:00
|
|
|
jr c, .asm_1036f4
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $01
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_1036d9
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $02
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_1036f4
|
2016-01-12 09:46:18 -08:00
|
|
|
cp $03
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_1036ec
|
|
|
|
jr .asm_1036b5
|
|
|
|
|
|
|
|
.asm_1036d9
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CheckForMobileBattleRules
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nc, .asm_1036e6
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_1036f4
|
|
|
|
|
|
|
|
.asm_1036e6
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_1036ec
|
|
|
|
call Function1036f9
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
jr .asm_1036b5
|
|
|
|
|
|
|
|
.asm_1036f4
|
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1036f9:
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, MobileBattleRulesText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103700:
|
2021-02-05 09:44:21 -08:00
|
|
|
ld c, 10
|
2017-12-28 04:15:46 -08:00
|
|
|
ld hl, wSwarmFlags
|
2018-01-22 12:40:43 -08:00
|
|
|
bit SWARMFLAGS_MOBILE_4_F, [hl]
|
2015-02-10 19:15:15 -08:00
|
|
|
jr z, .asm_10370f
|
2019-10-20 15:27:34 -07:00
|
|
|
farcall MobileBattleGetRemainingTime
|
2015-02-10 19:15:15 -08:00
|
|
|
.asm_10370f
|
|
|
|
ld a, c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2], a
|
|
|
|
ld a, [wStringBuffer2]
|
2021-02-05 09:44:21 -08:00
|
|
|
cp 5
|
|
|
|
jr nc, .five_or_more_mins
|
|
|
|
cp 2
|
|
|
|
jr nc, .two_to_five_mins
|
|
|
|
cp 1
|
|
|
|
jr nc, .one_min
|
|
|
|
jr .times_up
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
.five_or_more_mins
|
|
|
|
ld hl, WouldYouLikeToMobileBattleText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
.two_to_five_mins
|
|
|
|
ld hl, WantAQuickMobileBattleText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
.one_min
|
|
|
|
ld hl, WantToRushThroughAMobileBattleText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
.times_up
|
|
|
|
ld hl, PleaseTryAgainTomorrowText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MenuHeader_103747:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 13, 5, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
|
2018-01-23 13:08:43 -08:00
|
|
|
dw MenuData_10374f
|
2015-02-10 19:15:15 -08:00
|
|
|
db 1 ; default option
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MenuData_10374f:
|
2018-01-14 02:59:56 -08:00
|
|
|
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
|
2015-02-10 19:15:15 -08:00
|
|
|
db 3
|
|
|
|
db "はい@"
|
|
|
|
db "やめる@"
|
|
|
|
db "せつめい@"
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
MobileBattleMustPickThreeMonText:
|
|
|
|
text_far _MobileBattleMustPickThreeMonText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
MobileBattleMoreInfoText:
|
|
|
|
text_far _MobileBattleMoreInfoText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
MobileBattleRulesText:
|
|
|
|
text_far _MobileBattleRulesText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
WouldYouLikeToMobileBattleText:
|
|
|
|
text_far _WouldYouLikeToMobileBattleText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
WantAQuickMobileBattleText:
|
|
|
|
text_far _WantAQuickMobileBattleText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
WantToRushThroughAMobileBattleText:
|
|
|
|
text_far _WantToRushThroughAMobileBattleText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
PleaseTryAgainTomorrowText:
|
|
|
|
text_far _PleaseTryAgainTomorrowText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function103780:
|
2018-07-28 16:27:34 -07:00
|
|
|
ld a, [wChosenCableClubRoom]
|
2015-02-10 19:15:15 -08:00
|
|
|
push af
|
|
|
|
call Function10378c
|
|
|
|
pop af
|
2018-07-28 16:27:34 -07:00
|
|
|
ld [wChosenCableClubRoom], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10378c:
|
2015-12-07 08:28:58 -08:00
|
|
|
ld c, 0
|
2017-12-28 04:15:46 -08:00
|
|
|
ld hl, wSwarmFlags
|
2018-01-22 12:40:43 -08:00
|
|
|
bit SWARMFLAGS_MOBILE_4_F, [hl]
|
2015-11-23 13:04:53 -08:00
|
|
|
jr nz, .already_set
|
2018-01-22 12:40:43 -08:00
|
|
|
ld c, 1
|
2017-12-28 04:15:46 -08:00
|
|
|
ld hl, wSwarmFlags
|
2018-01-22 12:40:43 -08:00
|
|
|
set SWARMFLAGS_MOBILE_4_F, [hl]
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.already_set
|
2015-02-10 19:15:15 -08:00
|
|
|
push bc
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Link_SaveGame
|
2015-02-10 19:15:15 -08:00
|
|
|
pop bc
|
2015-11-23 13:04:53 -08:00
|
|
|
jr c, .failed_to_save
|
2018-01-22 12:40:43 -08:00
|
|
|
ld a, 1
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
ret z
|
2019-11-17 10:47:42 -08:00
|
|
|
farcall MobileBattleResetTimer
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.failed_to_save
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
ret z
|
2017-12-28 04:15:46 -08:00
|
|
|
ld hl, wSwarmFlags
|
2018-01-22 12:40:43 -08:00
|
|
|
res SWARMFLAGS_MOBILE_4_F, [hl]
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1037c2:
|
2019-10-20 15:27:34 -07:00
|
|
|
call MobileCheckRemainingBattleTime
|
2015-11-23 13:04:53 -08:00
|
|
|
jr c, .nope
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, [wdc5f]
|
|
|
|
and a
|
2015-11-23 13:04:53 -08:00
|
|
|
jr z, .nope
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, TryAgainUsingSameSettingsText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
2015-11-23 13:04:53 -08:00
|
|
|
jr c, .nope
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2015-11-23 13:04:53 -08:00
|
|
|
.nope
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ld [wdc5f], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
TryAgainUsingSameSettingsText:
|
|
|
|
text_far _TryAgainUsingSameSettingsText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function1037eb:
|
2019-10-20 15:27:34 -07:00
|
|
|
call MobileCheckRemainingBattleTime
|
2015-02-10 19:15:15 -08:00
|
|
|
jr nc, .asm_103807
|
2019-10-20 15:27:34 -07:00
|
|
|
ld hl, MobileBattleLessThanOneMinuteLeftText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2019-10-20 15:27:34 -07:00
|
|
|
ld hl, MobileBattleNoTimeLeftForLinkingText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_103807
|
|
|
|
ld a, [wdc60]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_103813
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_103813
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $02
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
MobileBattleLessThanOneMinuteLeftText:
|
|
|
|
text_far _MobileBattleLessThanOneMinuteLeftText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
MobileBattleNoTimeLeftForLinkingText:
|
|
|
|
text_far _MobileBattleNoTimeLeftForLinkingText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
MobileCheckRemainingBattleTime:
|
|
|
|
; Returns carry if less than one minute remains
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_AlwaysReturnNotCarry
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 7, c
|
2019-10-20 15:27:34 -07:00
|
|
|
jr nz, .ok
|
|
|
|
farcall MobileBattleGetRemainingTime
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2019-10-20 15:27:34 -07:00
|
|
|
cp 1
|
|
|
|
jr c, .fail
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
.ok
|
2015-02-10 19:15:15 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2019-10-20 15:27:34 -07:00
|
|
|
.fail
|
2015-02-10 19:15:15 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10383c:
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [wdc60], a
|
|
|
|
xor a
|
2016-05-05 12:07:37 -07:00
|
|
|
ld hl, wPlayerMonSelection
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hli], a
|
2015-12-26 18:59:03 -08:00
|
|
|
ld [hli], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ld [hl], a
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, PickThreeMonForMobileBattleText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Script_reloadmappart
|
|
|
|
farcall Function4a94e
|
2015-02-10 19:15:15 -08:00
|
|
|
jr c, .asm_103870
|
2015-11-10 16:51:13 -08:00
|
|
|
ld hl, wd002
|
2016-05-05 12:07:37 -07:00
|
|
|
ld de, wPlayerMonSelection
|
2015-12-07 08:28:58 -08:00
|
|
|
ld bc, 3
|
2015-02-10 19:15:15 -08:00
|
|
|
call CopyBytes
|
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_103870
|
2016-01-12 09:46:18 -08:00
|
|
|
ld a, $01
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wScriptVar], a
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
PickThreeMonForMobileBattleText:
|
|
|
|
text_far _PickThreeMonForMobileBattleText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-02-10 19:15:15 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function10387b:
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_AlwaysReturnNotCarry
|
2015-02-10 19:15:15 -08:00
|
|
|
bit 7, c
|
|
|
|
ret nz
|
2019-10-20 15:27:34 -07:00
|
|
|
farcall MobileBattleGetRemainingTime
|
2015-02-10 19:15:15 -08:00
|
|
|
ld a, c
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wStringBuffer2], a
|
2021-02-05 09:44:21 -08:00
|
|
|
ld hl, MobileBattleRemainingTimeText
|
2015-02-10 19:15:15 -08:00
|
|
|
call PrintText
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-02-10 19:15:15 -08:00
|
|
|
ret
|
|
|
|
|
2021-02-05 09:44:21 -08:00
|
|
|
MobileBattleRemainingTimeText:
|
|
|
|
text_far _MobileBattleRemainingTimeText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|