2018-06-24 07:09:41 -07:00
|
|
|
InitMobileProfile:
|
2015-11-16 19:29:54 -08:00
|
|
|
xor a
|
|
|
|
set 6, a
|
|
|
|
ld [wd002], a
|
|
|
|
ld hl, wd003
|
|
|
|
set 0, [hl]
|
|
|
|
ld a, c
|
|
|
|
and a
|
2015-12-14 17:06:41 -08:00
|
|
|
call z, InitCrystalData
|
2015-11-16 19:29:54 -08:00
|
|
|
call ClearBGPalettes
|
|
|
|
call Function48d3d
|
|
|
|
ld a, [wd479]
|
|
|
|
bit 1, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .not_yet_initialized
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd003]
|
|
|
|
set 0, a
|
|
|
|
set 1, a
|
|
|
|
set 2, a
|
|
|
|
set 3, a
|
|
|
|
ld [wd003], a
|
2016-05-08 11:11:24 -07:00
|
|
|
.not_yet_initialized
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function486bf
|
|
|
|
call LoadFontsExtra
|
2017-12-15 14:50:45 -08:00
|
|
|
ld de, MobileUpArrowGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles2 tile $10
|
2017-12-15 14:50:45 -08:00
|
|
|
lb bc, BANK(MobileUpArrowGFX), 1
|
2015-11-16 19:29:54 -08:00
|
|
|
call Request1bpp
|
2017-12-15 14:50:45 -08:00
|
|
|
ld de, MobileDownArrowGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles2 tile $11
|
2017-12-15 14:50:45 -08:00
|
|
|
lb bc, BANK(MobileDownArrowGFX), 1
|
2015-11-16 19:29:54 -08:00
|
|
|
call Request1bpp
|
|
|
|
call Function4a3a7
|
|
|
|
call ClearBGPalettes
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
|
|
|
jr z, .asm_4808a
|
|
|
|
call Function48689
|
|
|
|
jr .asm_480d7
|
|
|
|
.asm_4808a
|
|
|
|
ld a, $5
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wMusicFade], a
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, LOW(MUSIC_MOBILE_ADAPTER_MENU)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wMusicFadeID], a
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, HIGH(MUSIC_MOBILE_ADAPTER_MENU)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wMusicFadeID + 1], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld c, 20
|
|
|
|
call DelayFrames
|
2020-10-30 07:45:31 -07:00
|
|
|
ld b, CRYSTAL_CGB_MOBILE_1
|
|
|
|
call GetCrystalCGBLayout
|
2015-11-16 19:29:54 -08:00
|
|
|
call ClearBGPalettes
|
|
|
|
hlcoord 0, 0
|
2015-12-26 15:11:55 -08:00
|
|
|
ld b, 2
|
|
|
|
ld c, 20
|
2015-11-16 19:29:54 -08:00
|
|
|
call ClearBox
|
|
|
|
hlcoord 0, 1
|
|
|
|
ld a, $c
|
|
|
|
ld [hl], a
|
|
|
|
ld bc, $13
|
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ld de, MobileProfileString
|
|
|
|
hlcoord 1, 1
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 0, 2
|
|
|
|
ld b, $a
|
|
|
|
ld c, $12
|
|
|
|
call Function48cdc
|
|
|
|
hlcoord 2, 4
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_Gender
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
.asm_480d7
|
|
|
|
hlcoord 2, 6
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_Age
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
hlcoord 2, 8
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_Address
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
hlcoord 2, 10
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_ZipCode
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
hlcoord 2, 12
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_OK
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
|
|
|
jr nz, .asm_48113
|
2017-12-28 04:15:46 -08:00
|
|
|
ld a, [wPlayerGender]
|
2015-11-16 19:29:54 -08:00
|
|
|
ld hl, Strings_484fb
|
|
|
|
call GetNthString
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
hlcoord 11, 4
|
|
|
|
call PlaceString
|
|
|
|
.asm_48113
|
|
|
|
hlcoord 11, 6
|
|
|
|
call Function487ec
|
|
|
|
ld a, [wd474]
|
|
|
|
dec a
|
|
|
|
ld hl, Prefectures
|
|
|
|
call GetNthString
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
hlcoord 11, 8
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 11, 10
|
|
|
|
call Function489ea
|
|
|
|
hlcoord 0, 14
|
|
|
|
ld b, $2
|
|
|
|
ld c, $12
|
2019-04-08 05:15:10 -07:00
|
|
|
call Textbox
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 1, 16
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_PersonalInfo
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
call Function48187
|
2015-12-11 13:59:40 -08:00
|
|
|
call WaitBGMap2
|
2015-11-16 19:29:54 -08:00
|
|
|
call SetPalettes
|
2015-12-15 15:59:49 -08:00
|
|
|
call StaticMenuJoypad
|
|
|
|
ld hl, wMenuCursorY
|
2015-11-16 19:29:54 -08:00
|
|
|
ld b, [hl]
|
|
|
|
push bc
|
|
|
|
jr asm_4815f
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48157:
|
2015-12-15 15:59:49 -08:00
|
|
|
call ScrollingMenuJoypad
|
|
|
|
ld hl, wMenuCursorY
|
2015-11-16 19:29:54 -08:00
|
|
|
ld b, [hl]
|
|
|
|
push bc
|
2018-06-24 07:09:41 -07:00
|
|
|
asm_4815f:
|
2016-05-08 11:11:24 -07:00
|
|
|
bit A_BUTTON_F, a
|
2015-11-16 19:29:54 -08:00
|
|
|
jp nz, Function4820d
|
|
|
|
ld b, a
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .dont_check_b_button
|
2015-11-16 19:29:54 -08:00
|
|
|
ld hl, wd479
|
|
|
|
bit 1, [hl]
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .dont_check_b_button
|
|
|
|
bit B_BUTTON_F, b
|
|
|
|
jr nz, .b_button
|
|
|
|
.dont_check_b_button
|
2015-11-16 19:29:54 -08:00
|
|
|
jp Function48272
|
2016-05-08 11:11:24 -07:00
|
|
|
|
|
|
|
.b_button
|
2015-11-16 19:29:54 -08:00
|
|
|
call ClearBGPalettes
|
|
|
|
call Function48d30
|
|
|
|
pop bc
|
2020-02-13 09:30:13 -08:00
|
|
|
call ClearTilemap
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, $ff
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48187:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd479]
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_481f1
|
|
|
|
ld a, [wd003]
|
|
|
|
ld d, a
|
|
|
|
call Function48725
|
|
|
|
jr c, .asm_481a2
|
|
|
|
lb bc, 1, 4
|
|
|
|
hlcoord 2, 12
|
|
|
|
call ClearBox
|
|
|
|
jr .asm_481ad
|
|
|
|
.asm_481a2
|
|
|
|
push de
|
|
|
|
hlcoord 2, 12
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_OK
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
pop de
|
|
|
|
.asm_481ad
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
|
|
|
jr nz, .asm_481c1
|
|
|
|
bit 0, d
|
|
|
|
jr nz, .asm_481c1
|
|
|
|
lb bc, 1, 8
|
|
|
|
hlcoord 11, 4
|
|
|
|
call ClearBox
|
|
|
|
.asm_481c1
|
|
|
|
bit 1, d
|
|
|
|
jr nz, .asm_481ce
|
|
|
|
lb bc, 1, 8
|
|
|
|
hlcoord 11, 6
|
|
|
|
call ClearBox
|
|
|
|
.asm_481ce
|
|
|
|
bit 2, d
|
|
|
|
jr nz, .asm_481db
|
|
|
|
lb bc, 2, 8
|
|
|
|
hlcoord 11, 7
|
|
|
|
call ClearBox
|
|
|
|
.asm_481db
|
|
|
|
bit 3, d
|
|
|
|
jr nz, .asm_481f1
|
|
|
|
ld a, [wd479]
|
|
|
|
bit 0, a
|
|
|
|
jr nz, .asm_481f8
|
|
|
|
lb bc, 1, 8
|
|
|
|
hlcoord 11, 10
|
|
|
|
call ClearBox
|
|
|
|
jr .asm_48201
|
|
|
|
.asm_481f1
|
|
|
|
ld a, [wd479]
|
|
|
|
bit 0, a
|
|
|
|
jr nz, .asm_48201
|
|
|
|
.asm_481f8
|
|
|
|
hlcoord 11, 10
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, .String_TellLater
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
.asm_48201
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.String_TellLater:
|
2015-11-16 19:29:54 -08:00
|
|
|
db "Tell Later@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function4820d:
|
2015-12-17 19:31:16 -08:00
|
|
|
call PlaceHollowCursor
|
2015-12-15 15:59:49 -08:00
|
|
|
ld hl, wMenuCursorY
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
|
|
|
jr z, .asm_4821f
|
|
|
|
pop af
|
|
|
|
inc a
|
|
|
|
push af
|
|
|
|
.asm_4821f
|
|
|
|
pop af
|
|
|
|
cp $1
|
|
|
|
jr z, asm_4828d
|
|
|
|
cp $2
|
|
|
|
jp z, Function4876f
|
|
|
|
cp $3
|
|
|
|
jp z, Function48304
|
|
|
|
cp $4
|
|
|
|
jp z, Function488d3
|
|
|
|
ld a, $2
|
2015-12-15 15:59:49 -08:00
|
|
|
call MenuClickSound
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
|
|
|
jr z, .asm_4825c
|
|
|
|
jr .asm_4825c
|
|
|
|
|
|
|
|
hlcoord 1, 15
|
|
|
|
ld b, $2
|
|
|
|
ld c, $12
|
|
|
|
call ClearBox
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_ProfileChanged
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 1, 16
|
|
|
|
call PlaceString
|
|
|
|
call WaitBGMap
|
|
|
|
ld c, 48
|
|
|
|
call DelayFrames
|
|
|
|
|
|
|
|
.asm_4825c
|
|
|
|
call ClearBGPalettes
|
|
|
|
call Function48d30
|
|
|
|
pop bc
|
2020-02-13 09:30:13 -08:00
|
|
|
call ClearTilemap
|
2016-06-06 15:23:00 -07:00
|
|
|
ld b, SCGB_DIPLOMA
|
2015-11-16 19:29:54 -08:00
|
|
|
call GetSGBLayout
|
|
|
|
ld hl, wd479
|
|
|
|
set 1, [hl]
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48272:
|
2015-11-16 19:29:54 -08:00
|
|
|
jp Function4840c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MobileString_PersonalInfo:
|
2015-11-16 19:29:54 -08:00
|
|
|
db "Personal Info@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48283:
|
2015-11-16 19:29:54 -08:00
|
|
|
lb bc, 2, 18
|
|
|
|
hlcoord 1, 15
|
|
|
|
call ClearBox
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
asm_4828d:
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function48283
|
|
|
|
hlcoord 1, 16
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileDesc_Gender
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_0x484f1
|
|
|
|
call LoadMenuHeader
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function4873c
|
|
|
|
hlcoord 11, 2
|
|
|
|
ld b, $4
|
|
|
|
ld c, $7
|
|
|
|
call Function48cdc
|
|
|
|
hlcoord 13, 4
|
|
|
|
ld de, String_484fb
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 13, 6
|
|
|
|
ld de, String_484ff
|
|
|
|
call PlaceString
|
|
|
|
call WaitBGMap
|
2017-12-28 04:15:46 -08:00
|
|
|
ld a, [wPlayerGender]
|
2015-11-16 19:29:54 -08:00
|
|
|
inc a
|
|
|
|
ld [wMenuCursorBuffer], a
|
2015-12-15 15:59:49 -08:00
|
|
|
call StaticMenuJoypad
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlayClickSFX
|
|
|
|
call ExitMenu
|
|
|
|
bit 0, a
|
|
|
|
jp z, Function4840c
|
2015-12-15 15:59:49 -08:00
|
|
|
ld hl, wMenuCursorY
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [hl]
|
|
|
|
ld hl, Strings_484fb
|
|
|
|
cp $1
|
|
|
|
jr z, .asm_482ed
|
|
|
|
.asm_482e1
|
|
|
|
ld a, [hli]
|
|
|
|
cp $50
|
|
|
|
jr nz, .asm_482e1
|
2018-01-22 11:34:55 -08:00
|
|
|
ld a, 1 << PLAYERGENDER_FEMALE_F
|
2017-12-28 04:15:46 -08:00
|
|
|
ld [wPlayerGender], a
|
2015-11-16 19:29:54 -08:00
|
|
|
jr .asm_482f1
|
|
|
|
.asm_482ed
|
|
|
|
xor a
|
2017-12-28 04:15:46 -08:00
|
|
|
ld [wPlayerGender], a
|
2015-11-16 19:29:54 -08:00
|
|
|
.asm_482f1
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
hlcoord 11, 4
|
|
|
|
call PlaceString
|
|
|
|
ld a, [wd003]
|
|
|
|
set 0, a
|
|
|
|
ld [wd003], a
|
|
|
|
jp Function4840c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48304:
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function48283
|
|
|
|
hlcoord 1, 16
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileDesc_Address
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_0x48504
|
|
|
|
call LoadMenuHeader
|
|
|
|
ld hl, MenuHeader_0x48513
|
|
|
|
call LoadMenuHeader
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 10, 0
|
|
|
|
ld b, $c
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
ld a, [wMenuCursorBuffer]
|
|
|
|
ld b, a
|
2015-11-23 13:04:53 -08:00
|
|
|
ld a, [wMenuScrollPosition]
|
2015-11-16 19:29:54 -08:00
|
|
|
ld c, a
|
|
|
|
push bc
|
|
|
|
ld a, [wd474]
|
|
|
|
dec a
|
|
|
|
cp $29
|
|
|
|
jr c, .asm_4833f
|
|
|
|
sub $29
|
|
|
|
inc a
|
|
|
|
ld [wMenuCursorBuffer], a
|
|
|
|
ld a, $29
|
|
|
|
.asm_4833f
|
2015-11-23 13:04:53 -08:00
|
|
|
ld [wMenuScrollPosition], a
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall Mobile_OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
|
2015-11-16 19:29:54 -08:00
|
|
|
.asm_48348
|
2015-12-17 19:31:16 -08:00
|
|
|
call ScrollingMenu
|
2015-11-16 19:29:54 -08:00
|
|
|
ld de, $629
|
|
|
|
call Function48383
|
|
|
|
jr c, .asm_48348
|
|
|
|
ld d, a
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
|
|
|
ld [wMenuCursorBuffer], a
|
|
|
|
ld a, c
|
2015-11-23 13:04:53 -08:00
|
|
|
ld [wMenuScrollPosition], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, d
|
|
|
|
push af
|
|
|
|
call ExitMenu
|
|
|
|
call ExitMenu
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-11-16 19:29:54 -08:00
|
|
|
bit 0, a
|
|
|
|
jr z, .asm_48377
|
|
|
|
call Function483bb
|
|
|
|
ld a, [wd003]
|
|
|
|
set 2, a
|
|
|
|
ld [wd003], a
|
|
|
|
.asm_48377
|
|
|
|
call Function48187
|
2020-02-13 09:30:13 -08:00
|
|
|
farcall Mobile_OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
|
2015-11-16 19:29:54 -08:00
|
|
|
jp Function4840c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48383:
|
2015-11-16 19:29:54 -08:00
|
|
|
push bc
|
|
|
|
push af
|
|
|
|
bit 5, a
|
|
|
|
jr nz, .asm_48390
|
|
|
|
bit 4, a
|
|
|
|
jr nz, .asm_4839f
|
|
|
|
and a
|
|
|
|
jr .asm_483b7
|
|
|
|
.asm_48390
|
2015-11-23 13:04:53 -08:00
|
|
|
ld a, [wMenuScrollPosition]
|
2015-11-16 19:29:54 -08:00
|
|
|
sub d
|
2015-11-23 13:04:53 -08:00
|
|
|
ld [wMenuScrollPosition], a
|
2015-11-16 19:29:54 -08:00
|
|
|
jr nc, .asm_483af
|
|
|
|
xor a
|
2015-11-23 13:04:53 -08:00
|
|
|
ld [wMenuScrollPosition], a
|
2015-11-16 19:29:54 -08:00
|
|
|
jr .asm_483af
|
|
|
|
.asm_4839f
|
2015-11-23 13:04:53 -08:00
|
|
|
ld a, [wMenuScrollPosition]
|
2015-11-16 19:29:54 -08:00
|
|
|
add d
|
2015-11-23 13:04:53 -08:00
|
|
|
ld [wMenuScrollPosition], a
|
2015-11-16 19:29:54 -08:00
|
|
|
cp e
|
|
|
|
jr c, .asm_483af
|
|
|
|
ld a, e
|
2015-11-23 13:04:53 -08:00
|
|
|
ld [wMenuScrollPosition], a
|
2015-11-16 19:29:54 -08:00
|
|
|
jr .asm_483af
|
|
|
|
.asm_483af
|
2015-12-15 15:59:49 -08:00
|
|
|
ld hl, wMenuCursorY
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [hl]
|
|
|
|
ld [wMenuCursorBuffer], a
|
|
|
|
scf
|
|
|
|
.asm_483b7
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function483bb:
|
2015-12-17 14:51:32 -08:00
|
|
|
ld hl, wScrollingMenuCursorPosition
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [hl]
|
|
|
|
inc a
|
|
|
|
ld [wd474], a
|
|
|
|
dec a
|
|
|
|
ld b, a
|
|
|
|
ld hl, Prefectures
|
|
|
|
.asm_483c8
|
|
|
|
and a
|
|
|
|
jr z, .asm_483d5
|
|
|
|
.asm_483cb
|
|
|
|
ld a, [hli]
|
|
|
|
cp "@"
|
|
|
|
jr nz, .asm_483cb
|
|
|
|
ld a, b
|
|
|
|
dec a
|
|
|
|
ld b, a
|
|
|
|
jr .asm_483c8
|
|
|
|
.asm_483d5
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
ld b, $2
|
|
|
|
ld c, $8
|
|
|
|
hlcoord 11, 7
|
|
|
|
call ClearBox
|
|
|
|
hlcoord 11, 8
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function483e8:
|
2015-11-16 19:29:54 -08:00
|
|
|
push de
|
|
|
|
ld hl, Prefectures
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMenuSelection]
|
2015-11-16 19:29:54 -08:00
|
|
|
cp $ff
|
|
|
|
jr nz, .asm_483f8
|
|
|
|
ld hl, Wakayama ; last string
|
|
|
|
jr .asm_48405
|
|
|
|
|
|
|
|
.asm_483f8
|
|
|
|
ld d, a
|
|
|
|
and a
|
|
|
|
jr z, .asm_48405
|
|
|
|
.asm_483fc
|
|
|
|
ld a, [hli]
|
|
|
|
cp "@"
|
|
|
|
jr nz, .asm_483fc
|
|
|
|
ld a, d
|
|
|
|
dec a
|
|
|
|
jr .asm_483f8
|
|
|
|
|
|
|
|
.asm_48405
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
pop hl
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function4840c:
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function48187
|
|
|
|
call Function48283
|
|
|
|
hlcoord 1, 16
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileString_PersonalInfo
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
call Function486bf
|
|
|
|
pop bc
|
2015-12-15 15:59:49 -08:00
|
|
|
ld hl, wMenuCursorY
|
2015-11-16 19:29:54 -08:00
|
|
|
ld [hl], b
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .narrower_box
|
2015-12-26 08:31:56 -08:00
|
|
|
ld b, 9
|
|
|
|
ld c, 1
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 1, 4
|
|
|
|
call ClearBox
|
|
|
|
jp Function48157
|
2016-05-08 11:11:24 -07:00
|
|
|
|
|
|
|
.narrower_box
|
2015-12-26 08:31:56 -08:00
|
|
|
ld b, 7
|
|
|
|
ld c, 1
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 1, 6
|
|
|
|
call ClearBox
|
|
|
|
jp Function48157
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Mobile12_Bin2Dec:
|
2015-11-16 19:29:54 -08:00
|
|
|
push bc
|
|
|
|
push af
|
|
|
|
push de
|
|
|
|
push hl
|
2015-12-26 08:31:56 -08:00
|
|
|
ld hl, .DigitStrings
|
|
|
|
.loop
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
2015-12-26 08:31:56 -08:00
|
|
|
jr z, .got_string
|
2015-11-16 19:29:54 -08:00
|
|
|
inc hl
|
2015-12-26 18:59:03 -08:00
|
|
|
inc hl
|
2015-11-16 19:29:54 -08:00
|
|
|
dec a
|
2015-12-26 08:31:56 -08:00
|
|
|
jr .loop
|
|
|
|
.got_string
|
2015-11-16 19:29:54 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
pop hl
|
|
|
|
call PlaceString
|
|
|
|
pop de
|
|
|
|
pop af
|
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.DigitStrings:
|
2015-11-16 19:29:54 -08:00
|
|
|
db "0@"
|
|
|
|
db "1@"
|
|
|
|
db "2@"
|
|
|
|
db "3@"
|
|
|
|
db "4@"
|
|
|
|
db "5@"
|
|
|
|
db "6@"
|
|
|
|
db "7@"
|
|
|
|
db "8@"
|
|
|
|
db "9@"
|
|
|
|
|
2015-12-26 08:31:56 -08:00
|
|
|
MobileProfileString: db " Mobile Profile@"
|
|
|
|
MobileString_Gender: db "Gender@"
|
|
|
|
MobileString_Age: db "Age@"
|
|
|
|
MobileString_Address: db "Address@"
|
|
|
|
MobileString_ZipCode: db "Zip Code@"
|
|
|
|
MobileString_OK: db "OK@"
|
|
|
|
MobileString_ProfileChanged: db "Profile Changed@"
|
|
|
|
MobileDesc_Gender: db "Boy or girl?@"
|
|
|
|
MobileDesc_Age: db "How old are you?@"
|
|
|
|
MobileDesc_Address: db "Where do you live?@"
|
|
|
|
MobileDesc_ZipCode: db "Your zip code?@"
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
MenuHeader_0x484f1:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 11, 2, SCREEN_WIDTH - 1, 7
|
2018-01-23 13:08:43 -08:00
|
|
|
dw MenuData_0x484f9
|
2015-11-16 19:29:54 -08:00
|
|
|
db 1 ; default option
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
MenuData_0x484f9:
|
2018-01-14 02:59:56 -08:00
|
|
|
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
|
2015-11-16 19:29:54 -08:00
|
|
|
db 2 ; items
|
|
|
|
Strings_484fb:
|
|
|
|
String_484fb: db "Boy@"
|
|
|
|
String_484ff: db "Girl@"
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
MenuHeader_0x48504:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 10, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
MenuHeader_0x48509:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 10, 5, SCREEN_WIDTH - 1, 7
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
MenuHeader_0x4850e:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 10, 9, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
MenuHeader_0x48513:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 11, 1, 18, 12
|
2018-01-23 13:08:43 -08:00
|
|
|
dw MenuData_0x4851b
|
2015-11-16 19:29:54 -08:00
|
|
|
db 1 ; default option
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
MenuData_0x4851b:
|
2018-01-14 02:59:56 -08:00
|
|
|
db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_RIGHT | SCROLLINGMENU_ENABLE_LEFT | SCROLLINGMENU_CALL_FUNCTION1_CANCEL ; flags
|
2019-06-08 15:24:40 -07:00
|
|
|
db 6, 0 ; rows, columns
|
2019-06-08 17:31:24 -07:00
|
|
|
db SCROLLINGMENU_ITEMS_NORMAL ; item format
|
2019-06-08 15:24:40 -07:00
|
|
|
dba .Items
|
|
|
|
dba Function483e8
|
|
|
|
dba NULL
|
|
|
|
dba NULL
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2019-06-08 15:24:40 -07:00
|
|
|
.Items:
|
|
|
|
db 46
|
|
|
|
x = 0
|
|
|
|
rept 46
|
|
|
|
db x
|
|
|
|
x = x + 1
|
|
|
|
endr
|
|
|
|
db -1
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
Prefectures:
|
|
|
|
Aichi: db "あいちけん@" ; Aichi
|
|
|
|
Aomori: db "あおもりけん@" ; Aomori
|
|
|
|
Akita: db "あきたけん@" ; Akita
|
|
|
|
Ishikawa: db "いしかわけん@" ; Ishikawa
|
|
|
|
Ibaraki: db "いばらきけん@" ; Ibaraki
|
|
|
|
Iwate: db "いわてけん@" ; Iwate
|
|
|
|
Ehime: db "えひめけん@" ; Ehime
|
|
|
|
Oita: db "おおいたけん@" ; Oita
|
|
|
|
Osakafu: db "おおさかふ@" ; Osakafu
|
|
|
|
Okayama: db "おかやまけん@" ; Okayama
|
|
|
|
Okinawa: db "おきなわけん@" ; Okinawa
|
|
|
|
Kagawa: db "かがわけん@" ; Kagawa
|
|
|
|
Kagoshima: db "かごしまけん@" ; Kagoshima
|
|
|
|
Kanagawa: db "かながわけん@" ; Kanagawa
|
|
|
|
Gifu: db "ぎふけん@" ; Gifu
|
|
|
|
Kyotofu: db "きょうとふ@" ; Kyotofu
|
|
|
|
Kumamoto: db "くまもとけん@" ; Kumamoto
|
|
|
|
Gunma: db "ぐんまけん@" ; Gunma
|
|
|
|
Kochi: db "こうちけん@" ; Kochi
|
|
|
|
Saitama: db "さいたまけん@" ; Saitama
|
|
|
|
Saga: db "さがけん@" ; Saga
|
|
|
|
Shiga: db "しがけん@" ; Shiga
|
|
|
|
Shizuoka: db "しずおかけん@" ; Shizuoka
|
|
|
|
Shimane: db "しまねけん@" ; Shimane
|
|
|
|
Chiba: db "ちばけん@" ; Chiba
|
|
|
|
Tokyo: db "とうきょうと@" ; Tokyo
|
|
|
|
Tokushima: db "とくしまけん@" ; Tokushima
|
|
|
|
Tochigi: db "とちぎけん@" ; Tochigi
|
|
|
|
Tottori: db "とっとりけん@" ; Tottori
|
|
|
|
Toyama: db "とやまけん@" ; Toyama
|
|
|
|
Nagasaki: db "ながさきけん@" ; Nagasaki
|
|
|
|
Nagano: db "ながのけん@" ; Nagano
|
|
|
|
Naraken: db "ならけん@" ; Naraken
|
|
|
|
Niigata: db "にいがたけん@" ; Niigata
|
|
|
|
Hyogo: db "ひょうごけん@" ; Hyogo
|
|
|
|
Hiroshima: db "ひろしまけん@" ; Hiroshima
|
|
|
|
Fukui: db "ふくいけん@" ; Fukui
|
|
|
|
Fukuoka: db "ふくおかけん@" ; Fukuoka
|
|
|
|
Fukushima: db "ふくしまけん@" ; Fukushima
|
|
|
|
Hokkaido: db "ほっかいどう@" ; Hokkaido
|
|
|
|
Mie: db "みえけん@" ; Mie
|
|
|
|
Miyagi: db "みやぎけん@" ; Miyagi
|
|
|
|
Miyazaki: db "みやざきけん@" ; Miyazaki
|
|
|
|
Yamagata: db "やまがたけん@" ; Yamagata
|
|
|
|
Yamaguchi: db "やまぐちけん@" ; Yamaguchi
|
|
|
|
Yamanashi: db "やまなしけん@" ; Yamanashi
|
|
|
|
Wakayama: db "わかやまけん@" ; Wakayama
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48689:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld c, 7
|
|
|
|
call DelayFrames
|
2020-10-30 07:45:31 -07:00
|
|
|
ld b, CRYSTAL_CGB_MOBILE_1
|
|
|
|
call GetCrystalCGBLayout
|
2015-11-16 19:29:54 -08:00
|
|
|
call ClearBGPalettes
|
|
|
|
hlcoord 0, 0
|
2016-05-08 11:11:24 -07:00
|
|
|
ld b, 4
|
|
|
|
ld c, SCREEN_WIDTH
|
2015-11-16 19:29:54 -08:00
|
|
|
call ClearBox
|
|
|
|
hlcoord 0, 2
|
|
|
|
ld a, $c
|
|
|
|
ld [hl], a
|
2016-05-08 11:11:24 -07:00
|
|
|
ld bc, SCREEN_WIDTH - 1
|
2015-11-16 19:29:54 -08:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
ld de, MobileProfileString
|
|
|
|
hlcoord 1, 2
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 0, 4
|
|
|
|
ld b, $8
|
|
|
|
ld c, $12
|
|
|
|
call Function48cdc
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function486bf:
|
2015-12-19 11:48:30 -08:00
|
|
|
ld hl, w2DMenuCursorInitY
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .start_at_6
|
|
|
|
ld a, 4
|
2015-11-16 19:29:54 -08:00
|
|
|
ld [hli], a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr .got_init_y
|
|
|
|
|
|
|
|
.start_at_6
|
|
|
|
ld a, 6
|
2015-11-16 19:29:54 -08:00
|
|
|
ld [hli], a
|
2016-05-08 11:11:24 -07:00
|
|
|
.got_init_y
|
|
|
|
ld a, 1
|
|
|
|
ld [hli], a ; init x
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .check_wd479
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function48725
|
2016-05-08 11:11:24 -07:00
|
|
|
ld a, 4
|
|
|
|
jr nc, .got_num_rows_1
|
|
|
|
ld a, 5
|
|
|
|
.got_num_rows_1
|
2015-11-16 19:29:54 -08:00
|
|
|
ld [hli], a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr .got_num_rows_2
|
|
|
|
|
|
|
|
.check_wd479
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd479]
|
|
|
|
bit 1, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr nz, .four_rows
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function48725
|
2016-05-08 11:11:24 -07:00
|
|
|
jr c, .four_rows
|
|
|
|
ld a, 3
|
2015-11-16 19:29:54 -08:00
|
|
|
ld [hli], a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr .got_num_rows_2
|
|
|
|
|
|
|
|
.four_rows
|
|
|
|
ld a, 4
|
2015-11-16 19:29:54 -08:00
|
|
|
ld [hli], a
|
2016-05-08 11:11:24 -07:00
|
|
|
.got_num_rows_2
|
|
|
|
ld a, 1
|
|
|
|
ld [hli], a ; num cols
|
2018-01-14 20:43:51 -08:00
|
|
|
ld [hl], 0 ; flags 1
|
2015-11-16 19:29:54 -08:00
|
|
|
set 5, [hl]
|
|
|
|
inc hl
|
|
|
|
xor a
|
2016-05-08 11:11:24 -07:00
|
|
|
ld [hli], a ; flags 2
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, $20
|
2016-05-08 11:11:24 -07:00
|
|
|
ld [hli], a ; cursor offsets
|
|
|
|
ld a, A_BUTTON
|
|
|
|
add D_UP
|
|
|
|
add D_DOWN
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 6, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .got_joypad_mask
|
2015-11-16 19:29:54 -08:00
|
|
|
pop af
|
2016-05-08 11:11:24 -07:00
|
|
|
add B_BUTTON
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
2016-05-08 11:11:24 -07:00
|
|
|
.got_joypad_mask
|
2015-11-16 19:29:54 -08:00
|
|
|
pop af
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $1
|
2016-05-08 11:11:24 -07:00
|
|
|
ld [hli], a ; cursor y
|
|
|
|
ld [hli], a ; cursor x
|
2015-11-16 19:29:54 -08:00
|
|
|
xor a
|
2016-05-08 11:11:24 -07:00
|
|
|
ld [hli], a ; off char
|
|
|
|
ld [hli], a ; cursor tile
|
|
|
|
ld [hli], a ; cursor tile + 1
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48725:
|
2016-05-08 11:11:24 -07:00
|
|
|
; ld a, [wd003]
|
|
|
|
; and $f
|
|
|
|
; cp $f
|
|
|
|
; jr nz, .clear_carry
|
|
|
|
; scf
|
|
|
|
; ret
|
|
|
|
; .clear_carry
|
|
|
|
; and a
|
|
|
|
; ret
|
|
|
|
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd003]
|
|
|
|
bit 0, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .clear_carry
|
2015-11-16 19:29:54 -08:00
|
|
|
bit 1, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .clear_carry
|
2015-11-16 19:29:54 -08:00
|
|
|
bit 2, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .clear_carry
|
2015-11-16 19:29:54 -08:00
|
|
|
bit 3, a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .clear_carry
|
2015-11-16 19:29:54 -08:00
|
|
|
scf
|
|
|
|
ret
|
2016-05-08 11:11:24 -07:00
|
|
|
|
|
|
|
.clear_carry
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function4873c:
|
2015-12-19 11:48:30 -08:00
|
|
|
ld hl, w2DMenuCursorInitY
|
2016-05-08 11:11:24 -07:00
|
|
|
ld a, 4
|
2015-11-16 19:29:54 -08:00
|
|
|
ld [hli], a
|
2016-05-08 11:11:24 -07:00
|
|
|
ld a, 12
|
|
|
|
ld [hli], a ; init x
|
|
|
|
ld a, 2
|
|
|
|
ld [hli], a ; num rows
|
|
|
|
ld a, 1
|
|
|
|
ld [hli], a ; num cols
|
2018-01-14 20:43:51 -08:00
|
|
|
ld [hl], 0 ; flags 1
|
2015-11-16 19:29:54 -08:00
|
|
|
set 5, [hl]
|
|
|
|
inc hl
|
|
|
|
xor a
|
2016-05-08 11:11:24 -07:00
|
|
|
ld [hli], a ; flags 2
|
|
|
|
ln a, 2, 0
|
|
|
|
ld [hli], a ; cursor offsets
|
|
|
|
ld a, A_BUTTON
|
|
|
|
add B_BUTTON
|
|
|
|
ld [hli], a ; joypad filter
|
2017-12-28 04:15:46 -08:00
|
|
|
; ld a, [wPlayerGender]
|
2018-01-22 11:34:55 -08:00
|
|
|
; xor 1 << PLAYERGENDER_FEMALE_F
|
2016-05-08 11:11:24 -07:00
|
|
|
; inc a
|
2017-12-28 04:15:46 -08:00
|
|
|
ld a, [wPlayerGender]
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .male
|
|
|
|
ld a, 2
|
|
|
|
jr .okay_gender
|
|
|
|
|
|
|
|
.male
|
|
|
|
ld a, 1
|
|
|
|
.okay_gender
|
|
|
|
ld [hli], a ; cursor y
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, $1
|
2016-05-08 11:11:24 -07:00
|
|
|
ld [hli], a ; cursor x
|
2015-11-16 19:29:54 -08:00
|
|
|
xor a
|
2016-05-08 11:11:24 -07:00
|
|
|
ld [hli], a ; off char
|
|
|
|
ld [hli], a ; cursor tile
|
|
|
|
ld [hli], a ; cursor tile + 1
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function4876f:
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function48283
|
|
|
|
hlcoord 1, 16
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileDesc_Age
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_0x48509
|
|
|
|
call LoadMenuHeader
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hInMenu]
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 10, 5
|
|
|
|
ld b, $1
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
call WaitBGMap
|
|
|
|
ld a, [wd473]
|
|
|
|
and a
|
|
|
|
jr z, .asm_487ab
|
|
|
|
cp $64
|
|
|
|
jr z, .asm_487b2
|
|
|
|
hlcoord 12, 5
|
|
|
|
ld [hl], $10
|
|
|
|
hlcoord 12, 7
|
|
|
|
ld [hl], $11
|
|
|
|
jr .asm_487b7
|
|
|
|
.asm_487ab
|
|
|
|
hlcoord 12, 5
|
|
|
|
ld [hl], $10
|
|
|
|
jr .asm_487b7
|
|
|
|
.asm_487b2
|
|
|
|
hlcoord 12, 7
|
|
|
|
ld [hl], $11
|
|
|
|
.asm_487b7
|
|
|
|
hlcoord 11, 6
|
|
|
|
call Function487ec
|
|
|
|
ld c, 10
|
|
|
|
call DelayFrames
|
|
|
|
ld a, [wd473]
|
|
|
|
push af
|
|
|
|
.asm_487c6
|
|
|
|
call JoyTextDelay
|
|
|
|
call Function4880e
|
|
|
|
jr nc, .asm_487c6
|
|
|
|
ld a, $1
|
2015-12-15 15:59:49 -08:00
|
|
|
call MenuClickSound
|
2015-11-16 19:29:54 -08:00
|
|
|
pop bc
|
|
|
|
jr nz, .asm_487da
|
|
|
|
ld a, b
|
|
|
|
ld [wd473], a
|
|
|
|
.asm_487da
|
|
|
|
ld a, [wd473]
|
|
|
|
call ExitMenu
|
|
|
|
hlcoord 11, 6
|
|
|
|
call Function487ec
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2015-11-16 19:29:54 -08:00
|
|
|
jp Function4840c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function487ec:
|
2015-11-16 19:29:54 -08:00
|
|
|
push hl
|
|
|
|
ld de, wd473
|
|
|
|
call Function487ff
|
|
|
|
pop hl
|
|
|
|
rept 4
|
|
|
|
inc hl
|
|
|
|
endr
|
|
|
|
ld de, String_4880d
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function487ff:
|
2015-11-16 19:29:54 -08:00
|
|
|
push hl
|
|
|
|
ld a, " "
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
ld b, PRINTNUM_LEADINGZEROS | 1
|
|
|
|
ld c, 3
|
|
|
|
call PrintNum
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_4880d:
|
2015-11-16 19:29:54 -08:00
|
|
|
db "@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function4880e:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-11-16 19:29:54 -08:00
|
|
|
and A_BUTTON
|
|
|
|
jp nz, Function488b9
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-11-16 19:29:54 -08:00
|
|
|
and B_BUTTON
|
|
|
|
jp nz, Function488b4
|
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
|
|
|
jr nz, .asm_48843
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
|
|
|
jr nz, .asm_48838
|
|
|
|
ld a, [hl]
|
|
|
|
and D_LEFT
|
|
|
|
jr nz, .asm_4884f
|
|
|
|
ld a, [hl]
|
|
|
|
and D_RIGHT
|
|
|
|
jr nz, .asm_4885f
|
|
|
|
call DelayFrame
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
.asm_48838
|
|
|
|
ld hl, wd473
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_48840
|
|
|
|
dec a
|
|
|
|
.asm_48840
|
|
|
|
ld [hl], a
|
|
|
|
jr .asm_4886f
|
|
|
|
.asm_48843
|
|
|
|
ld hl, wd473
|
|
|
|
ld a, [hl]
|
|
|
|
cp $64
|
|
|
|
jr nc, .asm_4884c
|
|
|
|
inc a
|
|
|
|
.asm_4884c
|
|
|
|
ld [hl], a
|
|
|
|
jr .asm_4886f
|
|
|
|
.asm_4884f
|
|
|
|
ld a, [wd473]
|
|
|
|
cp $5b
|
|
|
|
jr c, .asm_48858
|
|
|
|
ld a, $5a
|
|
|
|
.asm_48858
|
|
|
|
add $a
|
|
|
|
ld [wd473], a
|
|
|
|
jr .asm_4886f
|
|
|
|
.asm_4885f
|
|
|
|
ld a, [wd473]
|
|
|
|
cp $a
|
|
|
|
jr nc, .asm_48868
|
|
|
|
ld a, $a
|
|
|
|
.asm_48868
|
|
|
|
sub $a
|
|
|
|
ld [wd473], a
|
|
|
|
jr .asm_4886f
|
|
|
|
.asm_4886f
|
|
|
|
ld a, [wd473]
|
|
|
|
and a
|
|
|
|
jr z, .asm_48887
|
|
|
|
cp $64
|
|
|
|
jr z, .asm_48898
|
|
|
|
jr z, .asm_488a7
|
|
|
|
hlcoord 12, 5
|
|
|
|
ld [hl], $10
|
|
|
|
hlcoord 12, 7
|
|
|
|
ld [hl], $11
|
|
|
|
jr .asm_488a7
|
|
|
|
.asm_48887
|
|
|
|
hlcoord 10, 5
|
|
|
|
ld b, $1
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
hlcoord 12, 5
|
|
|
|
ld [hl], $10
|
|
|
|
jr .asm_488a7
|
|
|
|
.asm_48898
|
|
|
|
hlcoord 10, 5
|
|
|
|
ld b, $1
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
hlcoord 12, 7
|
|
|
|
ld [hl], $11
|
|
|
|
.asm_488a7
|
|
|
|
hlcoord 11, 6
|
|
|
|
call Function487ec
|
|
|
|
call WaitBGMap
|
|
|
|
ld a, $1
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function488b4:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, $0
|
|
|
|
and a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function488b9:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd003]
|
|
|
|
set 1, a
|
|
|
|
ld [wd003], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MobileUpArrowGFX:
|
2020-02-27 11:33:30 -08:00
|
|
|
INCBIN "gfx/mobile/up_arrow.1bpp"
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MobileDownArrowGFX:
|
2020-02-27 11:33:30 -08:00
|
|
|
INCBIN "gfx/mobile/down_arrow.1bpp"
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function488d3:
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function48283
|
|
|
|
hlcoord 1, 16
|
2015-12-26 08:31:56 -08:00
|
|
|
ld de, MobileDesc_ZipCode
|
2015-11-16 19:29:54 -08:00
|
|
|
call PlaceString
|
|
|
|
call Function48a3a
|
|
|
|
jp c, Function4840c
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_0x4850e
|
|
|
|
call LoadMenuHeader
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hInMenu]
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 10, 9
|
|
|
|
ld b, $1
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
ld a, [wd475]
|
|
|
|
and $f
|
|
|
|
ld d, $0
|
|
|
|
hlcoord 11, 10
|
|
|
|
call Function489ea
|
|
|
|
call WaitBGMap
|
|
|
|
ld a, [wd475]
|
|
|
|
ld b, a
|
|
|
|
ld a, [wd476]
|
|
|
|
ld c, a
|
|
|
|
ld a, [wd477]
|
|
|
|
ld d, a
|
|
|
|
ld a, [wd478]
|
|
|
|
ld e, a
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
ld d, $0
|
|
|
|
ld b, $0
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
asm_48922:
|
2015-11-16 19:29:54 -08:00
|
|
|
push bc
|
|
|
|
call JoyTextDelay
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyDown]
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
|
|
|
jp z, Function4896e
|
|
|
|
bit 0, a
|
|
|
|
jp nz, Function4896e
|
|
|
|
bit 1, a
|
|
|
|
jp nz, Function4896e
|
|
|
|
ld a, [wd002]
|
|
|
|
and %11001111
|
|
|
|
res 7, a
|
|
|
|
ld [wd002], a
|
|
|
|
pop bc
|
|
|
|
inc b
|
|
|
|
ld a, b
|
|
|
|
cp $5
|
|
|
|
push bc
|
|
|
|
jr c, .asm_4894c
|
|
|
|
pop bc
|
|
|
|
ld b, $4
|
|
|
|
push bc
|
|
|
|
.asm_4894c
|
|
|
|
pop bc
|
|
|
|
push bc
|
|
|
|
ld a, b
|
|
|
|
cp $4
|
|
|
|
jr nz, asm_48972
|
|
|
|
ld c, 10
|
|
|
|
call DelayFrames
|
|
|
|
jr asm_48972
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
Function4895a: ; unreferenced
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
|
|
|
jr z, .asm_48965
|
|
|
|
pop bc
|
|
|
|
ld b, $1
|
|
|
|
push bc
|
|
|
|
jr asm_48972
|
|
|
|
|
|
|
|
.asm_48965
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
|
|
|
jr z, asm_48972
|
|
|
|
|
|
|
|
pop bc
|
|
|
|
ld b, $1
|
|
|
|
push bc
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function4896e:
|
2015-11-16 19:29:54 -08:00
|
|
|
pop bc
|
|
|
|
ld b, $0
|
|
|
|
push bc
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
asm_48972:
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function48ab5
|
|
|
|
push af
|
|
|
|
cp $f0
|
|
|
|
jr z, .asm_48994
|
|
|
|
cp $f
|
|
|
|
jr nz, .asm_48988
|
|
|
|
ld a, [wd002]
|
|
|
|
set 7, a
|
|
|
|
and $cf
|
|
|
|
ld [wd002], a
|
|
|
|
.asm_48988
|
|
|
|
hlcoord 11, 10
|
|
|
|
ld b, $0
|
|
|
|
ld c, d
|
|
|
|
add hl, bc
|
|
|
|
ld b, $3
|
|
|
|
call Function48c11
|
|
|
|
.asm_48994
|
|
|
|
call WaitBGMap
|
|
|
|
pop af
|
|
|
|
pop bc
|
|
|
|
jr nc, asm_48922
|
|
|
|
jr nz, .asm_489b1
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
|
|
|
ld [wd475], a
|
|
|
|
ld a, c
|
|
|
|
ld [wd476], a
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
|
|
|
ld [wd477], a
|
|
|
|
ld a, c
|
|
|
|
ld [wd478], a
|
|
|
|
jr .asm_489c5
|
|
|
|
.asm_489b1
|
|
|
|
push af
|
|
|
|
ld a, [wd479]
|
|
|
|
set 0, a
|
|
|
|
ld [wd479], a
|
|
|
|
ld a, [wd003]
|
|
|
|
set 3, a
|
|
|
|
ld [wd003], a
|
|
|
|
pop af
|
|
|
|
pop bc
|
|
|
|
pop bc
|
|
|
|
.asm_489c5
|
|
|
|
push af
|
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
ld a, $1
|
2015-12-15 15:59:49 -08:00
|
|
|
call MenuClickSound
|
2015-11-16 19:29:54 -08:00
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
pop bc
|
|
|
|
pop af
|
|
|
|
call ExitMenu
|
|
|
|
hlcoord 11, 10
|
|
|
|
call Function489ea
|
|
|
|
hlcoord 11, 9
|
|
|
|
lb bc, 1, 8
|
|
|
|
call ClearBox
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2015-11-16 19:29:54 -08:00
|
|
|
jp Function4840c
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function489ea:
|
2015-11-16 19:29:54 -08:00
|
|
|
push de
|
|
|
|
ld a, [wd475]
|
|
|
|
and $f
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd476]
|
|
|
|
and $f0
|
|
|
|
swap a
|
|
|
|
inc hl
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd476]
|
|
|
|
and $f
|
|
|
|
inc hl
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
inc hl
|
|
|
|
ld de, String_48a38
|
|
|
|
call PlaceString
|
|
|
|
ld a, [wd477]
|
|
|
|
and $f0
|
|
|
|
swap a
|
|
|
|
inc hl
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd477]
|
|
|
|
and $f
|
|
|
|
inc hl
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd478]
|
|
|
|
and $f0
|
|
|
|
swap a
|
|
|
|
inc hl
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd478]
|
|
|
|
and $f
|
|
|
|
inc hl
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_48a38:
|
2015-11-16 19:29:54 -08:00
|
|
|
db "-@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48a3a:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, MenuHeader_0x48a9c
|
|
|
|
call LoadMenuHeader
|
2015-11-16 19:29:54 -08:00
|
|
|
call Function4873c
|
|
|
|
ld a, $a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [w2DMenuCursorInitY], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, $b
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [w2DMenuCursorInitX], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, $1
|
2015-12-15 15:59:49 -08:00
|
|
|
ld [wMenuCursorY], a
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 10, 8
|
|
|
|
ld b, $4
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
hlcoord 12, 10
|
|
|
|
ld de, String_48aa1
|
|
|
|
call PlaceString
|
2015-12-15 15:59:49 -08:00
|
|
|
call StaticMenuJoypad
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
call PlayClickSFX
|
|
|
|
call ExitMenu
|
|
|
|
pop af
|
|
|
|
bit 1, a
|
|
|
|
jp nz, Function48a9a
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuCursorY]
|
2015-11-16 19:29:54 -08:00
|
|
|
cp $1
|
|
|
|
jr z, .asm_48a98
|
|
|
|
ld a, [wd003]
|
|
|
|
set 3, a
|
|
|
|
ld [wd003], a
|
|
|
|
ld a, [wd479]
|
|
|
|
res 0, a
|
|
|
|
ld [wd479], a
|
|
|
|
xor a
|
|
|
|
ld bc, $4
|
|
|
|
ld hl, wd475
|
|
|
|
call ByteFill
|
|
|
|
jr Function48a9a
|
|
|
|
.asm_48a98
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48a9a:
|
2015-11-16 19:29:54 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
MenuHeader_0x48a9c:
|
2018-01-14 02:59:56 -08:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
menu_coords 10, 8, SCREEN_WIDTH - 1, 13
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
String_48aa1:
|
2015-11-16 19:29:54 -08:00
|
|
|
db "Tell Now"
|
|
|
|
next "Tell Later@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48ab5:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-11-16 19:29:54 -08:00
|
|
|
and A_BUTTON
|
|
|
|
jp nz, Function48c0f
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-11-16 19:29:54 -08:00
|
|
|
and B_BUTTON
|
|
|
|
jp nz, Function48c0d
|
|
|
|
ld a, d
|
|
|
|
and a
|
|
|
|
jr z, .asm_48adf
|
|
|
|
cp $1
|
|
|
|
jr z, .asm_48ae7
|
|
|
|
cp $2
|
|
|
|
jr z, .asm_48af1
|
|
|
|
cp $3
|
|
|
|
jr z, .asm_48af9
|
|
|
|
cp $4
|
|
|
|
jr z, .asm_48b03
|
|
|
|
cp $5
|
|
|
|
jr z, .asm_48b0b
|
|
|
|
cp $6
|
|
|
|
jr .asm_48b15
|
|
|
|
.asm_48adf
|
|
|
|
ld hl, wd475
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr .asm_48b1d
|
|
|
|
.asm_48ae7
|
|
|
|
ld hl, wd476
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or $f0
|
|
|
|
jr .asm_48b1d
|
|
|
|
.asm_48af1
|
|
|
|
ld hl, wd476
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr .asm_48b1d
|
|
|
|
.asm_48af9
|
|
|
|
ld hl, wd477
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or $f0
|
|
|
|
jr .asm_48b1d
|
|
|
|
.asm_48b03
|
|
|
|
ld hl, wd477
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr .asm_48b1d
|
|
|
|
.asm_48b0b
|
|
|
|
ld hl, wd478
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
or $f0
|
|
|
|
jr .asm_48b1d
|
|
|
|
.asm_48b15
|
|
|
|
ld hl, wd478
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr .asm_48b1d
|
|
|
|
.asm_48b1d
|
|
|
|
push hl
|
|
|
|
push af
|
|
|
|
ld e, $0
|
|
|
|
hlcoord 11, 10
|
|
|
|
ld a, d
|
|
|
|
.asm_48b25
|
|
|
|
and a
|
|
|
|
jr z, .asm_48b2c
|
|
|
|
inc e
|
|
|
|
dec a
|
|
|
|
jr .asm_48b25
|
|
|
|
.asm_48b2c
|
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
|
|
|
jr nz, .asm_48b8d
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
|
|
|
jr nz, .asm_48b55
|
|
|
|
ld a, [hl]
|
|
|
|
and D_LEFT
|
|
|
|
jp nz, Function48bd7
|
|
|
|
ld a, [hl]
|
|
|
|
and D_RIGHT
|
|
|
|
jr nz, .asm_48b9d
|
|
|
|
hlcoord 11, 10
|
|
|
|
call Function489ea
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 7, a
|
|
|
|
jr nz, .asm_48b51
|
|
|
|
.asm_48b51
|
|
|
|
pop bc
|
|
|
|
pop bc
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
.asm_48b55
|
|
|
|
pop af
|
|
|
|
ld b, a
|
|
|
|
and $f
|
|
|
|
and a
|
|
|
|
ld a, b
|
|
|
|
jr nz, .asm_48b61
|
|
|
|
and $f0
|
|
|
|
add $a
|
|
|
|
.asm_48b61
|
|
|
|
dec a
|
|
|
|
.asm_48b62
|
|
|
|
push de
|
|
|
|
push af
|
|
|
|
hlcoord 10, 9
|
|
|
|
ld b, $1
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
pop af
|
|
|
|
pop de
|
|
|
|
hlcoord 11, 10
|
|
|
|
ld b, a
|
|
|
|
ld a, d
|
|
|
|
cp $3
|
|
|
|
jr c, .asm_48b7a
|
|
|
|
inc hl
|
|
|
|
.asm_48b7a
|
|
|
|
ld a, b
|
|
|
|
pop hl
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_48b85
|
|
|
|
call Function48c4d
|
|
|
|
jr .asm_48b88
|
|
|
|
.asm_48b85
|
|
|
|
call Function48c5a
|
|
|
|
.asm_48b88
|
|
|
|
ld a, $f0
|
|
|
|
jp Function48c00
|
|
|
|
.asm_48b8d
|
|
|
|
pop af
|
|
|
|
ld b, a
|
|
|
|
and $f
|
|
|
|
cp $9
|
|
|
|
ld a, b
|
|
|
|
jr c, .asm_48b9a
|
|
|
|
and $f0
|
|
|
|
add $ff
|
|
|
|
.asm_48b9a
|
|
|
|
inc a
|
|
|
|
jr .asm_48b62
|
|
|
|
.asm_48b9d
|
|
|
|
push de
|
|
|
|
hlcoord 10, 9
|
|
|
|
ld b, $1
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
pop de
|
|
|
|
ld a, d
|
|
|
|
cp $6
|
|
|
|
jr nc, .asm_48baf
|
|
|
|
inc d
|
|
|
|
.asm_48baf
|
|
|
|
pop af
|
|
|
|
pop hl
|
|
|
|
ld b, a
|
|
|
|
ld a, d
|
|
|
|
cp $6
|
|
|
|
ld a, b
|
|
|
|
jr z, .asm_48bc4
|
|
|
|
bit 7, a
|
|
|
|
jr nz, .asm_48bc4
|
|
|
|
inc hl
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
and $f
|
|
|
|
jr asm_48bc7
|
|
|
|
.asm_48bc4
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
asm_48bc7:
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 11, 10
|
|
|
|
push af
|
|
|
|
ld a, d
|
|
|
|
cp $3
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
|
|
|
jr c, .asm_48bd3
|
|
|
|
inc hl
|
|
|
|
.asm_48bd3
|
|
|
|
ld a, $f
|
|
|
|
jr Function48c00
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48bd7:
|
2015-11-16 19:29:54 -08:00
|
|
|
push de
|
|
|
|
hlcoord 10, 9
|
|
|
|
ld b, $1
|
|
|
|
ld c, $8
|
|
|
|
call Function48cdc
|
|
|
|
pop de
|
|
|
|
ld a, d
|
|
|
|
and a
|
|
|
|
pop af
|
|
|
|
pop hl
|
|
|
|
ld b, a
|
|
|
|
ld a, d
|
|
|
|
and a
|
|
|
|
ld a, b
|
|
|
|
jr z, .asm_48bf3
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_48bf8
|
|
|
|
dec d
|
|
|
|
dec hl
|
|
|
|
.asm_48bf3
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
jr asm_48bc7
|
|
|
|
.asm_48bf8
|
|
|
|
dec d
|
|
|
|
ld a, [hl]
|
|
|
|
swap a
|
|
|
|
and $f
|
|
|
|
jr asm_48bc7
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48c00:
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
hlcoord 11, 10
|
|
|
|
call Function489ea
|
|
|
|
ld a, $1
|
|
|
|
and a
|
|
|
|
pop bc
|
|
|
|
ld a, b
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48c0d:
|
2015-11-16 19:29:54 -08:00
|
|
|
xor a
|
|
|
|
and a
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48c0f:
|
2015-11-16 19:29:54 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48c11:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wd002]
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_48c20
|
|
|
|
ld a, d
|
|
|
|
cp $3
|
|
|
|
jr c, .asm_48c1e
|
|
|
|
inc hl
|
|
|
|
.asm_48c1e
|
|
|
|
ld [hl], $7f
|
|
|
|
.asm_48c20
|
|
|
|
ld a, [wd002]
|
|
|
|
swap a
|
|
|
|
and $3
|
|
|
|
inc a
|
|
|
|
cp b
|
|
|
|
jr nz, .asm_48c40
|
|
|
|
ld a, [wd002]
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_48c3a
|
|
|
|
res 7, a
|
|
|
|
ld [wd002], a
|
|
|
|
xor a
|
|
|
|
jr .asm_48c40
|
|
|
|
.asm_48c3a
|
|
|
|
set 7, a
|
|
|
|
ld [wd002], a
|
|
|
|
xor a
|
|
|
|
.asm_48c40
|
|
|
|
swap a
|
|
|
|
ld b, a
|
|
|
|
ld a, [wd002]
|
|
|
|
and $cf
|
|
|
|
or b
|
|
|
|
ld [wd002], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48c4d:
|
2015-11-16 19:29:54 -08:00
|
|
|
swap a
|
|
|
|
and $f0
|
|
|
|
push af
|
|
|
|
ld a, [hl]
|
|
|
|
and $f
|
|
|
|
ld [hl], a
|
|
|
|
pop af
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48c5a:
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
ld a, [hl]
|
|
|
|
and $f0
|
|
|
|
ld [hl], a
|
|
|
|
pop af
|
|
|
|
or [hl]
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48c63:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, "@"
|
|
|
|
ld [de], a
|
|
|
|
ld a, c
|
|
|
|
cp $30
|
|
|
|
jr nc, .asm_48c8c
|
|
|
|
and a
|
|
|
|
jr z, .asm_48c8c
|
|
|
|
dec c
|
|
|
|
push de
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
ld a, "@"
|
|
|
|
ld b, 7
|
|
|
|
.asm_48c76
|
|
|
|
ld [hli], a
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_48c76
|
|
|
|
ld hl, Prefectures
|
|
|
|
ld a, c
|
|
|
|
call GetNthString
|
|
|
|
.asm_48c81
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld a, [hl]
|
|
|
|
cp "@"
|
|
|
|
jr nz, .asm_48c81
|
|
|
|
and a
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_48c8c
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2020-06-21 13:27:43 -07:00
|
|
|
Function48c8e: ; unreferenced
|
2018-01-02 07:04:21 -08:00
|
|
|
ld hl, wd019 + $11
|
2015-11-16 19:29:54 -08:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Function48c63
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 10, 7
|
|
|
|
call PlaceString
|
|
|
|
call WaitBGMap
|
|
|
|
ret
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
Function48ca3: ; unreferenced
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
ld b, 0
|
|
|
|
ld c, 0
|
|
|
|
ld d, 0
|
|
|
|
.asm_48cad
|
|
|
|
cp 100
|
|
|
|
jr c, .asm_48cb6
|
|
|
|
sub 100
|
|
|
|
inc b
|
|
|
|
jr .asm_48cad
|
|
|
|
|
|
|
|
.asm_48cb6
|
|
|
|
cp 10
|
|
|
|
jr c, .asm_48cbf
|
|
|
|
sub 10
|
|
|
|
inc c
|
|
|
|
jr .asm_48cb6
|
|
|
|
|
|
|
|
.asm_48cbf
|
|
|
|
cp 1
|
|
|
|
jr c, .asm_48cc7
|
|
|
|
dec a
|
|
|
|
inc d
|
|
|
|
jr .asm_48cbf
|
|
|
|
|
|
|
|
.asm_48cc7
|
|
|
|
ld a, b
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
inc hl
|
|
|
|
ld a, c
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
inc hl
|
|
|
|
ld a, d
|
2015-12-26 08:31:56 -08:00
|
|
|
call Mobile12_Bin2Dec
|
2015-11-16 19:29:54 -08:00
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
pop bc
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48cda:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48cdc:
|
2015-11-16 19:29:54 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
call Function48cfd
|
|
|
|
pop hl
|
|
|
|
pop bc
|
2020-02-13 09:30:13 -08:00
|
|
|
ld de, wAttrmap - wTilemap
|
2015-11-16 19:29:54 -08:00
|
|
|
add hl, de
|
|
|
|
inc b
|
2015-12-26 18:59:03 -08:00
|
|
|
inc b
|
|
|
|
inc c
|
2015-11-16 19:29:54 -08:00
|
|
|
inc c
|
|
|
|
ld a, $0
|
|
|
|
.asm_48ced
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
.asm_48cef
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_48cef
|
|
|
|
pop hl
|
|
|
|
ld de, $14
|
|
|
|
add hl, de
|
|
|
|
pop bc
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_48ced
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48cfd:
|
2015-11-16 19:29:54 -08:00
|
|
|
push hl
|
|
|
|
ld a, $4
|
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
call Function48d2a
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
ld de, $14
|
|
|
|
add hl, de
|
|
|
|
.asm_48d0c
|
|
|
|
push hl
|
|
|
|
ld a, $7
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $7f
|
|
|
|
call Function48d2a
|
|
|
|
ld [hl], $8
|
|
|
|
pop hl
|
|
|
|
ld de, $14
|
|
|
|
add hl, de
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_48d0c
|
|
|
|
ld a, $9
|
|
|
|
ld [hli], a
|
|
|
|
ld a, $a
|
|
|
|
call Function48d2a
|
|
|
|
ld [hl], $b
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48d2a:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld d, c
|
|
|
|
.asm_48d2b
|
|
|
|
ld [hli], a
|
|
|
|
dec d
|
|
|
|
jr nz, .asm_48d2b
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48d30:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld hl, wd475
|
|
|
|
call Function48d4a
|
|
|
|
ld hl, wd477
|
|
|
|
call Function48d4a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48d3d:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld hl, wd475
|
|
|
|
call Function48d94
|
|
|
|
ld hl, wd477
|
|
|
|
call Function48d94
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48d4a:
|
2015-11-16 19:29:54 -08:00
|
|
|
inc hl
|
|
|
|
ld a, [hl]
|
|
|
|
ld b, a
|
|
|
|
and $f
|
|
|
|
ld c, a
|
|
|
|
srl b
|
|
|
|
srl b
|
|
|
|
srl b
|
|
|
|
srl b
|
|
|
|
push bc
|
|
|
|
ld c, 10
|
|
|
|
ld a, b
|
|
|
|
call SimpleMultiply
|
|
|
|
pop bc
|
|
|
|
add c
|
|
|
|
ld [hld], a
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMultiplicand + 0], a
|
|
|
|
ldh [hMultiplicand + 1], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [hl]
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
ld c, 10
|
|
|
|
call SimpleMultiply
|
|
|
|
ld b, a
|
|
|
|
ld a, [hli]
|
|
|
|
and $f
|
|
|
|
add b
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMultiplicand + 2], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, 100
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMultiplier], a
|
2015-11-16 19:29:54 -08:00
|
|
|
call Multiply
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hProduct + 2]
|
2015-11-16 19:29:54 -08:00
|
|
|
ld b, a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hProduct + 3]
|
2015-11-16 19:29:54 -08:00
|
|
|
ld c, a
|
|
|
|
ld e, [hl]
|
|
|
|
add e
|
|
|
|
ld c, a
|
|
|
|
ld a, b
|
2018-02-04 10:16:40 -08:00
|
|
|
adc 0
|
2015-11-16 19:29:54 -08:00
|
|
|
ld b, a
|
|
|
|
ld a, c
|
|
|
|
ld [hld], a
|
|
|
|
ld [hl], b
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Function48d94:
|
2015-11-16 19:29:54 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hDividend + 0], a
|
|
|
|
ldh [hDividend + 1], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [hli]
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hDividend + 0], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [hl]
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hDividend + 1], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, 100
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hDivisor], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld b, 2
|
|
|
|
call Divide
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hRemainder]
|
2016-02-15 15:57:49 -08:00
|
|
|
ld c, 10
|
2015-11-16 19:29:54 -08:00
|
|
|
call SimpleDivide
|
|
|
|
sla b
|
|
|
|
sla b
|
|
|
|
sla b
|
|
|
|
sla b
|
|
|
|
or b
|
|
|
|
ld [hld], a
|
2018-08-26 10:49:38 -07:00
|
|
|
ldh a, [hQuotient + 3]
|
2015-11-16 19:29:54 -08:00
|
|
|
ld c, 10
|
|
|
|
call SimpleDivide
|
|
|
|
sla b
|
|
|
|
sla b
|
|
|
|
sla b
|
|
|
|
sla b
|
|
|
|
or b
|
|
|
|
ld [hl], a
|
|
|
|
ret
|