pokecrystal-board/mobile/mobile_22.asm

4254 lines
58 KiB
NASM
Raw Normal View History

String_89116:
db "-----@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
String_8911c:
db "でんわばんごうが ただしく" ; Phone number is not
next "はいって いません!@" ; entered correctly!
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
String_89135:
db "データが かわって いますが" ; The data has changed.
next "かきかえないで やめますか?@" ; Quit anyway?
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
String_89153:
db "メッセージは ありません@" ; No message
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
OpenSRAMBank4:
2015-10-16 10:35:43 -07:00
push af
ld a, $4
call GetSRAMBank
pop af
ret
2018-06-24 07:09:41 -07:00
Function89168:
ld hl, wGameTimerPause
2018-01-23 09:40:29 -08:00
set GAMETIMERPAUSE_MOBILE_7_F, [hl]
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function8916e:
ld hl, wGameTimerPause
2018-01-23 09:40:29 -08:00
res GAMETIMERPAUSE_MOBILE_7_F, [hl]
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function89174:
ld hl, wGameTimerPause
2018-01-23 09:40:29 -08:00
bit GAMETIMERPAUSE_MOBILE_7_F, [hl]
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function8917a:
2015-11-10 16:51:13 -08:00
ld hl, wd002
2015-10-16 10:35:43 -07:00
ld bc, $32
xor a
call ByteFill
ret
2018-06-24 07:09:41 -07:00
Function89185:
; strcmp(hl, de, c)
; Compares c bytes starting at de and hl and incrementing together until a mismatch is found.
; Preserves hl and de.
2015-10-16 10:35:43 -07:00
push de
push hl
.loop
ld a, [de]
inc de
cp [hl]
jr nz, .done
inc hl
dec c
jr nz, .loop
.done
pop hl
pop de
ret
2018-06-24 07:09:41 -07:00
Function89193:
; copy(hl, de, 4)
2015-10-16 10:35:43 -07:00
; Copies c bytes from hl to de.
; Preserves hl and de.
2015-10-16 10:35:43 -07:00
push de
push hl
.loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .loop
pop hl
pop de
ret
2018-06-24 07:09:41 -07:00
Function8919e:
2015-10-16 10:35:43 -07:00
; Searches for the c'th string starting at de. Returns the pointer in de.
ld a, c
and a
ret z
.loop
ld a, [de]
inc de
cp "@"
jr nz, .loop
dec c
jr nz, .loop
ret
2018-06-24 07:09:41 -07:00
Function891ab:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode1
2017-12-24 09:47:30 -08:00
farcall ReloadMapPart
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function891b8:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
hlcoord 0, 0
ld a, " "
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
call DelayFrame
ret
2018-06-24 07:09:41 -07:00
Function891ca:
2015-10-16 10:35:43 -07:00
push bc
call Function891b8
call WaitBGMap
pop bc
ret
2018-06-24 07:09:41 -07:00
Function891d3:
2015-10-16 10:35:43 -07:00
push bc
call Function891ca
ld c, $10
call DelayFrames
pop bc
ret
2018-06-24 07:09:41 -07:00
Function891de:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
call ClearPalettes
2018-01-23 14:39:09 -08:00
hlcoord 0, 0, wAttrMap
2015-10-16 10:35:43 -07:00
ld a, $7
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
hlcoord 0, 0
ld a, " "
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
call Function891ab
ret
2018-06-24 07:09:41 -07:00
Function891fe:
2015-10-16 10:35:43 -07:00
push bc
call Function891de
ld c, $10
call DelayFrames
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89209:
2015-10-16 10:35:43 -07:00
ld a, 1
2015-11-25 07:16:29 -08:00
ld [wSpriteUpdatesEnabled], a
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function8920f:
2015-10-16 10:35:43 -07:00
ld a, 0
2015-11-25 07:16:29 -08:00
ld [wSpriteUpdatesEnabled], a
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function89215:
2015-10-16 10:35:43 -07:00
push hl
push bc
2018-01-23 14:39:09 -08:00
ld bc, wAttrMap - wTileMap
2015-10-16 10:35:43 -07:00
add hl, bc
ld [hl], a
pop bc
pop hl
ret
2018-06-24 07:09:41 -07:00
Function8921f:
2015-10-16 10:35:43 -07:00
push de
ld de, SCREEN_WIDTH
add hl, de
inc hl
ld a, $7f
.loop
push bc
push hl
.asm_89229
ld [hli], a
dec c
jr nz, .asm_89229
pop hl
add hl, de
pop bc
dec b
jr nz, .loop
pop de
ret
2018-06-24 07:09:41 -07:00
Mobile22_ButtonSound:
call JoyWaitAorB
2015-10-16 10:35:43 -07:00
call PlayClickSFX
ret
2018-06-24 07:09:41 -07:00
Mobile22_SetBGMapMode0:
2015-10-16 10:35:43 -07:00
xor a
ld [hBGMapMode], a
ret
2018-06-24 07:09:41 -07:00
Mobile22_SetBGMapMode1:
2015-10-16 10:35:43 -07:00
ld a, $1
ld [hBGMapMode], a
ret
2018-06-24 07:09:41 -07:00
Function89245:
2017-12-24 09:47:30 -08:00
farcall TryLoadSaveFile
2015-10-16 10:35:43 -07:00
ret c
2017-12-24 09:47:30 -08:00
farcall _LoadData
2015-10-16 10:35:43 -07:00
and a
ret
2018-06-24 07:09:41 -07:00
Function89254:
2015-10-16 10:35:43 -07:00
ld bc, $d07
jr Function89261
2018-06-24 07:09:41 -07:00
Function89259:
2015-10-16 10:35:43 -07:00
ld bc, $0e07
jr Function89261
2018-06-24 07:09:41 -07:00
Function8925e:
2015-10-16 10:35:43 -07:00
ld bc, $0e0c
2018-06-24 07:09:41 -07:00
Function89261:
2015-10-16 10:35:43 -07:00
push af
push bc
ld hl, MenuHeader_0x892a3
call CopyMenuHeader
2015-10-16 10:35:43 -07:00
pop bc
2015-10-24 07:34:19 -07:00
ld hl, wMenuBorderTopCoord
2015-10-16 10:35:43 -07:00
ld a, c
ld [hli], a
ld a, b
ld [hli], a
ld a, c
add $4
ld [hli], a
ld a, b
add $5
ld [hl], a
pop af
2015-11-01 09:44:30 -08:00
ld [wMenuCursorBuffer], a
2015-12-22 19:19:33 -08:00
call PushWindow
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
call Function89209
2015-12-15 15:59:49 -08:00
call VerticalMenu
2015-10-16 10:35:43 -07:00
push af
ld c, $a
call DelayFrames
call CloseWindow
2015-10-16 10:35:43 -07:00
call Function8920f
pop af
jr c, .done
2015-12-15 15:59:49 -08:00
ld a, [wMenuCursorY]
2015-10-16 10:35:43 -07:00
cp $2
jr z, .done
and a
ret
.done
scf
ret
MenuHeader_0x892a3:
db MENU_BACKUP_TILES ; flags
menu_coords 10, 5, 15, 9
dw MenuData_0x892ab
2015-10-16 10:35:43 -07:00
db 1 ; default option
MenuData_0x892ab:
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags
2015-10-16 10:35:43 -07:00
db 2 ; items
db "はい@"
db "いいえ@"
2018-06-24 07:09:41 -07:00
Function892b4:
2015-10-16 10:35:43 -07:00
call Function8931b
2018-06-24 07:09:41 -07:00
Function892b7:
2015-10-16 10:35:43 -07:00
ld d, b
ld e, c
ld hl, 0
add hl, bc
ld a, "@"
ld bc, 6
call ByteFill
ld b, d
ld c, e
ld hl, 6
add hl, bc
ld a, "@"
ld bc, 6
call ByteFill
ld b, d
ld c, e
ld hl, 12
add hl, bc
xor a
ld [hli], a
ld [hl], a
ld hl, 14
add hl, bc
ld [hli], a
ld [hl], a
ld hl, 16
add hl, bc
ld [hl], a
ld hl, 17
add hl, bc
ld a, -1
ld bc, 8
call ByteFill
ld b, d
ld c, e
ld e, 6
ld hl, 25
add hl, bc
.loop
ld a, -1
ld [hli], a
ld a, -1
ld [hli], a
dec e
jr nz, .loop
ret
2018-06-24 07:09:41 -07:00
Function89305:
2015-10-16 10:35:43 -07:00
xor a
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
ld c, 40
.loop
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
inc a
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
push bc
call Function892b4
pop bc
dec c
jr nz, .loop
ret
2018-06-24 07:09:41 -07:00
Function8931b:
2015-10-16 10:35:43 -07:00
push hl
ld hl, $a03b ; 4:a03b
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
dec a
ld bc, 37
2015-10-16 10:35:43 -07:00
call AddNTimes
ld b, h
ld c, l
pop hl
ret
2018-06-24 07:09:41 -07:00
Function8932d:
2015-10-16 10:35:43 -07:00
ld hl, 0
add hl, bc
2018-06-24 07:09:41 -07:00
Function89331:
; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator.
; Sets carry if it does not find a nonspace character.
; Returns the location of the following character in hl.
2015-10-16 10:35:43 -07:00
push bc
2017-12-21 08:56:33 -08:00
ld c, NAME_LENGTH_JAPANESE - 1
2015-10-16 10:35:43 -07:00
.loop
ld a, [hli]
cp "@"
jr z, .terminator
cp " "
jr nz, .nonspace
dec c
jr nz, .loop
.terminator
scf
jr .done
.nonspace
and a
.done
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89346:
2015-10-16 10:35:43 -07:00
ld h, b
ld l, c
jr _incave
2018-06-24 07:09:41 -07:00
Function8934a:
2017-12-21 08:56:33 -08:00
ld hl, NAME_LENGTH_JAPANESE
2015-10-16 10:35:43 -07:00
add hl, bc
_incave:
; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator. Sets carry if it does not find a nonspace character. Returns the location of the following character in hl.
push bc
2017-12-21 08:56:33 -08:00
ld c, NAME_LENGTH_JAPANESE - 1
2015-10-16 10:35:43 -07:00
.loop
ld a, [hli]
cp "@"
jr z, .terminator
cp " "
jr nz, .nonspace
dec c
jr nz, .loop
.terminator
scf
jr .done
.nonspace
and a
.done
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89363:
2015-10-16 10:35:43 -07:00
; Scans six byte pairs starting at bc to find $ff. Sets carry if it does not find a $ff. Returns the location of the byte after the first $ff found in hl.
ld h, b
ld l, c
jr ._incave
ld hl, 25
add hl, bc
._incave
push de
2017-12-21 08:56:33 -08:00
ld e, NAME_LENGTH_JAPANESE
2015-10-16 10:35:43 -07:00
.loop
ld a, [hli]
cp -1
jr nz, .ok
ld a, [hli]
cp -1
jr nz, .ok
dec e
jr nz, .loop
scf
jr .done
.ok
and a
.done
pop de
ret
2018-06-24 07:09:41 -07:00
Function89381:
2015-10-16 10:35:43 -07:00
push bc
push de
call Function89b45
jr c, .ok
push hl
ld a, -1
ld bc, 8
call ByteFill
pop hl
.ok
pop de
ld c, 8
call Function89193
pop bc
ret
2018-06-24 07:09:41 -07:00
Function8939a:
2015-10-16 10:35:43 -07:00
push bc
ld hl, 0
add hl, bc
2015-11-10 16:51:13 -08:00
ld de, wd002
2015-10-16 10:35:43 -07:00
ld c, 6
call Function89193
pop bc
ld hl, 17
add hl, bc
ld de, wd008
call Function89381
ret
2018-06-24 07:09:41 -07:00
Function893b3:
2015-10-16 10:35:43 -07:00
call DisableLCD
call ClearSprites
2015-11-04 13:14:27 -08:00
call LoadStandardFont
call LoadFontsExtra
2015-10-16 10:35:43 -07:00
call Function893ef
call Function8942b
call Function89455
call EnableLCD
ret
2018-06-24 07:09:41 -07:00
Function893cc:
2015-10-16 10:35:43 -07:00
call DisableLCD
call ClearSprites
2015-11-04 13:14:27 -08:00
call LoadStandardFont
call LoadFontsExtra
2015-10-16 10:35:43 -07:00
call Function893ef
call Function89464
call EnableLCD
ret
2018-06-24 07:09:41 -07:00
Function893e2:
2015-10-16 10:35:43 -07:00
call Function89b1e
call Function893b3
call Function8a5b6
call Function8949c
ret
2018-06-24 07:09:41 -07:00
Function893ef:
2017-12-28 04:32:33 -08:00
ld de, vTiles0
2015-10-16 10:35:43 -07:00
ld hl, GFX_8940b
ld bc, $20
ld a, BANK(GFX_8940b)
call FarCopyBytes
ret
2018-06-24 07:09:41 -07:00
Function893fe:
2015-10-16 10:35:43 -07:00
call DisableLCD
call Function893ef
call EnableLCD
call DelayFrame
ret
2018-06-24 07:09:41 -07:00
GFX_8940b:
2015-10-16 10:35:43 -07:00
INCBIN "gfx/unknown/08940b.2bpp"
2018-06-24 07:09:41 -07:00
Function8942b:
2017-12-28 04:32:33 -08:00
ld de, vTiles0 tile $02
2018-01-19 17:48:33 -08:00
ld hl, MobileAdapterGFX + $7d tiles
ld bc, 8 tiles
2015-10-16 10:35:43 -07:00
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
2017-12-28 04:32:33 -08:00
ld de, vTiles0 tile $0a
2018-01-19 17:48:33 -08:00
ld hl, MobileAdapterGFX + $c6 tiles
ld bc, 4 tiles
2015-10-16 10:35:43 -07:00
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
ret
2018-06-24 07:09:41 -07:00
Function89448:
; Clears the sprite array
2015-10-16 10:35:43 -07:00
push af
ld hl, wVirtualOAM
2018-01-10 10:47:57 -08:00
ld d, 24 * SPRITEOAMSTRUCT_LENGTH
2015-10-16 10:35:43 -07:00
xor a
.loop
ld [hli], a
dec d
jr nz, .loop
pop af
ret
2018-06-24 07:09:41 -07:00
Function89455:
2018-01-19 17:48:33 -08:00
ld hl, MobileAdapterGFX + $7d tiles
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $0c
2018-01-19 17:48:33 -08:00
ld bc, $49 tiles
2015-10-16 10:35:43 -07:00
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
ret
2018-06-24 07:09:41 -07:00
Function89464:
2015-10-16 10:35:43 -07:00
ld hl, MobileAdapterGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2
2018-01-19 17:48:33 -08:00
ld bc, $20 tiles
2015-10-16 10:35:43 -07:00
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
2018-01-19 17:48:33 -08:00
ld hl, MobileAdapterGFX + $66 tiles
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $20
2018-01-19 17:48:33 -08:00
ld bc, $17 tiles
2015-10-16 10:35:43 -07:00
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
ret
2018-06-24 07:09:41 -07:00
Function89481:
2015-10-16 10:35:43 -07:00
ld d, 2
call Function8934a
ret c
ld d, 0
ld hl, 16
add hl, bc
bit 0, [hl]
ret z
inc d
ret
2018-06-24 07:09:41 -07:00
Function89492:
2015-10-16 10:35:43 -07:00
ld d, 0
ld a, [wPlayerGender]
2018-01-22 11:34:55 -08:00
bit PLAYERGENDER_FEMALE_F, a
2015-10-16 10:35:43 -07:00
ret z
inc d
ret
2018-06-24 07:09:41 -07:00
Function8949c:
2015-10-16 10:35:43 -07:00
ld a, [rSVBK]
push af
ld a, 5
ld [rSVBK], a
ld hl, Palette_894b3
2018-01-01 06:08:21 -08:00
ld de, wBGPals1 palette 7
2017-12-26 17:33:41 -08:00
ld bc, 1 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
pop af
ld [rSVBK], a
ret
2018-06-24 07:09:41 -07:00
Palette_894b3:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
Function894bb:
2015-10-16 10:35:43 -07:00
call Function894dc
push bc
call Function8956f
call Function8949c
call Function8a60d
pop bc
ret
2018-06-24 07:09:41 -07:00
Function894ca:
2015-10-16 10:35:43 -07:00
push bc
call Function894dc
call Function895c7
call Function8949c
call Function8a60d
2015-10-25 19:26:53 -07:00
call SetPalettes
2015-10-16 10:35:43 -07:00
pop bc
ret
2018-06-24 07:09:41 -07:00
Function894dc:
2015-10-16 10:35:43 -07:00
push bc
ld a, [rSVBK]
push af
ld a, 5
ld [rSVBK], a
2015-11-19 20:38:16 -08:00
2015-10-16 10:35:43 -07:00
ld c, d
ld b, 0
2015-11-19 20:38:16 -08:00
ld hl, .PalettePointers
2015-10-16 10:35:43 -07:00
add hl, bc
add hl, bc
2015-10-16 10:35:43 -07:00
ld a, [hli]
ld h, [hl]
ld l, a
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2015-11-19 20:38:16 -08:00
ld bc, 3 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
2015-11-19 20:38:16 -08:00
ld hl, .Pals345
2018-01-01 06:08:21 -08:00
ld de, wBGPals1 + 3 palettes
2015-11-19 20:38:16 -08:00
ld bc, 3 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
2015-11-19 20:38:16 -08:00
2015-10-16 10:35:43 -07:00
pop af
ld [rSVBK], a
pop bc
ret
2018-06-24 07:09:41 -07:00
.PalettePointers:
2015-11-19 20:38:16 -08:00
dw .Pals012a
dw .Pals012b
dw .Pals012c
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
.Pals012a:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 10, 17, 13
RGB 10, 08, 22
RGB 00, 00, 00
RGB 31, 31, 31
RGB 16, 20, 31
RGB 10, 08, 22
RGB 00, 00, 00
RGB 31, 31, 31
RGB 16, 20, 31
RGB 10, 17, 13
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
.Pals012b:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 30, 22, 11
RGB 31, 08, 15
RGB 00, 00, 00
RGB 31, 31, 31
RGB 16, 20, 31
RGB 31, 08, 15
RGB 00, 00, 00
RGB 31, 31, 31
RGB 16, 20, 31
RGB 30, 22, 11
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
.Pals012c:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 15, 20, 26
RGB 25, 07, 20
RGB 00, 00, 00
RGB 31, 31, 31
RGB 16, 20, 31
RGB 25, 07, 20
RGB 00, 00, 00
RGB 31, 31, 31
RGB 16, 20, 31
RGB 15, 20, 26
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
.Pals345:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 13, 00
RGB 14, 08, 00
RGB 31, 31, 31
RGB 16, 16, 31
RGB 00, 00, 31
RGB 00, 00, 00
RGB 19, 31, 11
RGB 00, 00, 00
RGB 00, 00, 00
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
Function8956f:
2015-10-16 10:35:43 -07:00
push bc
ld hl, 16
add hl, bc
ld d, h
ld e, l
ld hl, $000c
add hl, bc
ld b, h
ld c, l
2017-12-24 09:47:30 -08:00
farcall GetMobileOTTrainerClass
2015-10-16 10:35:43 -07:00
ld a, c
2018-01-23 14:39:09 -08:00
ld [wTrainerClass], a
2015-10-16 10:35:43 -07:00
ld a, [rSVBK]
push af
ld a, 5
ld [rSVBK], a
ld hl, wd030
ld a, -1
ld [hli], a
ld a, " "
ld [hl], a
pop af
ld [rSVBK], a
2018-01-23 14:39:09 -08:00
ld a, [wTrainerClass]
2015-10-16 10:35:43 -07:00
ld h, 0
ld l, a
add hl, hl
add hl, hl
2015-10-16 10:35:43 -07:00
ld de, TrainerPalettes
add hl, de
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld de, wd032
ld c, 4
.loop
ld a, BANK(TrainerPalettes)
call GetFarByte
ld [de], a
inc de
inc hl
dec c
jr nz, .loop
ld hl, wd036
xor a
ld [hli], a
ld [hl], a
pop af
ld [rSVBK], a
pop bc
ret
2018-06-24 07:09:41 -07:00
Function895c7:
ld a, [rSVBK]
2015-10-16 10:35:43 -07:00
push af
ld a, 5
ld [rSVBK], a
2015-10-16 10:35:43 -07:00
ld hl, Palette_895de
ld de, wd030
ld bc, 8
call CopyBytes
pop af
ld [rSVBK], a
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Palette_895de:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 07, 07, 06
RGB 07, 07, 06
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
Function895e6:
2015-10-16 10:35:43 -07:00
ld a, 7
2018-01-23 14:39:09 -08:00
hlcoord 0, 0, wAttrMap
2015-10-16 10:35:43 -07:00
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
ret
2018-06-24 07:09:41 -07:00
Function895f2:
2015-10-16 10:35:43 -07:00
push bc
xor a
2018-01-23 14:39:09 -08:00
hlcoord 0, 0, wAttrMap
2015-10-16 10:35:43 -07:00
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
call Function89605
call Function89655
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89605:
2018-01-23 14:39:09 -08:00
hlcoord 19, 2, wAttrMap
2015-10-16 10:35:43 -07:00
ld a, 1
ld de, SCREEN_WIDTH
ld c, 14
.loop
ld [hl], a
dec c
jr z, .done
add hl, de
inc a
ld [hl], a
dec a
add hl, de
dec c
jr nz, .loop
.done
2018-01-23 14:39:09 -08:00
hlcoord 0, 16, wAttrMap
2015-10-16 10:35:43 -07:00
ld c, 10
ld a, 2
.loop2
ld [hli], a
dec a
ld [hli], a
inc a
dec c
jr nz, .loop2
2018-01-23 14:39:09 -08:00
hlcoord 1, 11, wAttrMap
2015-10-16 10:35:43 -07:00
ld a, 4
ld bc, 4
call ByteFill
ld a, 5
ld bc, 14
call ByteFill
ret
2018-06-24 07:09:41 -07:00
Function8963d:
2018-01-23 14:39:09 -08:00
hlcoord 12, 3, wAttrMap
2015-10-16 10:35:43 -07:00
ld a, 6
ld de, SCREEN_WIDTH
lb bc, 7, 7
.loop
push hl
ld c, 7
.next
ld [hli], a
dec c
jr nz, .next
pop hl
add hl, de
dec b
jr nz, .loop
ret
2018-06-24 07:09:41 -07:00
Function89655:
2018-01-23 14:39:09 -08:00
hlcoord 1, 12, wAttrMap
2015-10-16 10:35:43 -07:00
ld de, SCREEN_WIDTH
ld a, 5
ld b, 4
.loop
ld c, 18
push hl
.next
ld [hli], a
dec c
jr nz, .next
pop hl
add hl, de
dec b
jr nz, .loop
ret
2018-06-24 07:09:41 -07:00
Function8966c:
2015-10-16 10:35:43 -07:00
push bc
call Function89688
hlcoord 4, 0
ld c, 8
call Function896f5
pop bc
ret
2018-06-24 07:09:41 -07:00
Function8967a:
2015-10-16 10:35:43 -07:00
push bc
call Function89688
hlcoord 2, 0
ld c, 12
call Function896f5
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89688:
2015-10-16 10:35:43 -07:00
hlcoord 0, 0
ld a, 1
ld e, SCREEN_WIDTH
call Function896e1
ld a, 2
ld e, SCREEN_WIDTH
call Function896eb
ld a, 3
ld [hli], a
ld a, 4
ld e, SCREEN_HEIGHT
call Function896e1
ld a, 6
ld [hli], a
push bc
ld c, 13
.loop
call Function896cb
dec c
jr z, .done
call Function896d6
dec c
jr nz, .loop
.done
pop bc
ld a, 25
ld [hli], a
ld a, 26
ld e, SCREEN_HEIGHT
call Function896e1
ld a, 28
ld [hli], a
ld a, 2
ld e, SCREEN_WIDTH
call Function896eb
ret
2018-06-24 07:09:41 -07:00
Function896cb:
2015-10-16 10:35:43 -07:00
ld de, SCREEN_WIDTH - 1
ld a, 7
ld [hl], a
add hl, de
ld a, 9
ld [hli], a
ret
2018-06-24 07:09:41 -07:00
Function896d6:
2015-10-16 10:35:43 -07:00
ld de, SCREEN_WIDTH - 1
ld a, 10
ld [hl], a
add hl, de
ld a, 11
ld [hli], a
ret
2018-06-24 07:09:41 -07:00
Function896e1:
2015-10-16 10:35:43 -07:00
.loop
ld [hli], a
inc a
dec e
ret z
ld [hli], a
dec a
dec e
jr nz, .loop
ret
2018-06-24 07:09:41 -07:00
Function896eb:
2015-10-16 10:35:43 -07:00
.loop
ld [hli], a
dec a
dec e
ret z
ld [hli], a
inc a
dec e
jr nz, .loop
ret
2018-06-24 07:09:41 -07:00
Function896f5:
2015-10-16 10:35:43 -07:00
call Function8971f
call Function89736
inc hl
inc hl
2015-10-16 10:35:43 -07:00
ld b, 2
ClearScreenArea:
2015-10-16 10:35:43 -07:00
; clears an area of the screen
; INPUT:
; hl = address of upper left corner of the area
; b = height
; c = width
ld a, " " ; blank tile
ld de, 20 ; screen width
.loop
push bc
push hl
.innerLoop
ld [hli], a
dec c
jr nz, .innerLoop
pop hl
pop bc
add hl, de
dec b
jr nz, .loop
dec hl
inc c
inc c
2015-10-16 10:35:43 -07:00
.asm_89713
ld a, $36
ld [hli], a
dec c
ret z
ld a, $18
ld [hli], a
dec c
2018-06-24 18:39:23 -07:00
jr nz, .asm_89713
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function8971f:
2015-10-16 10:35:43 -07:00
ld a, $2c
ld [hli], a
ld a, $2d
ld [hld], a
push hl
ld de, SCREEN_WIDTH
add hl, de
ld a, $31
ld [hli], a
ld a, $32
ld [hld], a
add hl, de
ld a, $35
ld [hl], a
pop hl
ret
2018-06-24 07:09:41 -07:00
Function89736:
2015-10-16 10:35:43 -07:00
push hl
inc hl
inc hl
2015-10-16 10:35:43 -07:00
ld e, c
ld d, $0
add hl, de
ld a, $2f
ld [hli], a
ld a, $30
ld [hld], a
ld de, SCREEN_WIDTH
add hl, de
ld a, $33
ld [hli], a
ld a, $34
ld [hl], a
add hl, de
ld a, $1f
ld [hl], a
pop hl
ret
2018-06-24 07:09:41 -07:00
Function89753:
2015-10-16 10:35:43 -07:00
ld a, $c
ld [hl], a
xor a
call Function89215
ret
2018-06-24 07:09:41 -07:00
Function8975b:
2015-10-16 10:35:43 -07:00
ld a, $1d
ld [hli], a
inc a
ld [hli], a
ld a, $d
ld [hl], a
dec hl
dec hl
2015-10-16 10:35:43 -07:00
ld a, $4
ld e, $3
.asm_89769
call Function89215
inc hl
dec e
jr nz, .asm_89769
ret
2018-06-24 07:09:41 -07:00
Function89771:
2015-10-16 10:35:43 -07:00
ld a, $12
ld [hl], a
ld a, $3
call Function89215
ret
2018-06-24 07:09:41 -07:00
Function8977a:
2015-10-16 10:35:43 -07:00
ld e, $4
ld d, $13
.asm_8977e
ld a, d
ld [hl], a
ld a, $4
call Function89215
inc hl
inc d
dec e
jr nz, .asm_8977e
ld e, $e
.asm_8978c
ld a, d
ld [hl], a
xor a
call Function89215
inc hl
dec e
jr nz, .asm_8978c
ret
2018-06-24 07:09:41 -07:00
Function89797:
2015-10-16 10:35:43 -07:00
push bc
ld a, $e
ld [hl], a
ld bc, SCREEN_WIDTH
add hl, bc
ld a, $11
ld [hli], a
ld a, $10
ld c, $8
.asm_897a6
ld [hli], a
dec c
jr nz, .asm_897a6
ld a, $f
ld [hl], a
pop bc
ret
2018-06-24 07:09:41 -07:00
Function897af:
2015-10-16 10:35:43 -07:00
push bc
ld hl, $0010
add hl, bc
ld d, h
ld e, l
ld hl, $000c
add hl, bc
ld b, h
ld c, l
2017-12-24 09:47:30 -08:00
farcall GetMobileOTTrainerClass
2015-10-16 10:35:43 -07:00
ld a, c
2018-01-23 14:39:09 -08:00
ld [wTrainerClass], a
2015-10-16 10:35:43 -07:00
xor a
2018-01-23 14:39:09 -08:00
ld [wCurPartySpecies], a
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $37
farcall GetTrainerPic
2015-10-16 10:35:43 -07:00
pop bc
ret
2018-06-24 07:09:41 -07:00
Function897d5:
2015-10-16 10:35:43 -07:00
push bc
call Function8934a
jr nc, .asm_897f3
2018-01-23 14:39:09 -08:00
hlcoord 12, 3, wAttrMap
2015-10-16 10:35:43 -07:00
xor a
ld de, SCREEN_WIDTH
lb bc, 7, 7
.asm_897e5
push hl
ld c, $7
.asm_897e8
ld [hli], a
dec c
jr nz, .asm_897e8
pop hl
add hl, de
dec b
jr nz, .asm_897e5
pop bc
ret
.asm_897f3
ld a, $37
2016-01-12 09:46:18 -08:00
ld [hGraphicStartTile], a
2015-10-16 10:35:43 -07:00
hlcoord 12, 3
lb bc, 7, 7
predef PlaceGraphic
2015-10-16 10:35:43 -07:00
call Function8963d
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89807:
2018-01-19 17:48:33 -08:00
ld hl, MobileAdapterGFX + $20 tiles
ld a, [wPlayerGender]
2018-01-22 11:34:55 -08:00
bit PLAYERGENDER_FEMALE_F, a
2015-10-16 10:35:43 -07:00
jr z, .asm_89814
2018-01-19 17:48:33 -08:00
ld hl, MobileAdapterGFX + $43 tiles
2015-10-16 10:35:43 -07:00
.asm_89814
call DisableLCD
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $37
2018-01-19 17:48:33 -08:00
ld bc, $23 tiles
2015-10-16 10:35:43 -07:00
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
call EnableLCD
call DelayFrame
ret
2018-06-24 07:09:41 -07:00
Function89829:
2015-10-16 10:35:43 -07:00
push bc
ld bc, $705
ld de, $14
ld a, $37
.asm_89832
push bc
push hl
.asm_89834
ld [hli], a
inc a
dec c
jr nz, .asm_89834
pop hl
add hl, de
pop bc
dec b
jr nz, .asm_89832
call Function8963d
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89844:
2015-10-16 10:35:43 -07:00
call Function89481
call Function894bb
call Function897af
push bc
2015-12-11 13:59:40 -08:00
call WaitBGMap2
2015-10-25 19:26:53 -07:00
call SetPalettes
2015-10-16 10:35:43 -07:00
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89856:
2015-10-16 10:35:43 -07:00
push bc
call Function891b8
pop bc
call Function895f2
call Function8966c
call Function899d3
call Function898aa
call Function898be
call Function898dc
call Function898f3
push bc
ld bc, wd008
hlcoord 2, 10
call Function89975
pop bc
call Function897d5
ret
2018-06-24 07:09:41 -07:00
Function8987f:
2015-10-16 10:35:43 -07:00
call Function891b8
call Function895f2
call Function8967a
call Function899d3
hlcoord 5, 1
call Function8999c
hlcoord 13, 3
call Function89829
call Function899b2
hlcoord 5, 5
call Function899c9
ld bc, wd008
hlcoord 2, 10
call Function89975
ret
2018-06-24 07:09:41 -07:00
Function898aa:
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
and a
ret z
push bc
hlcoord 6, 1
2018-01-23 14:39:09 -08:00
ld de, wMenuSelection
2015-10-16 10:35:43 -07:00
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
pop bc
ret
2018-06-24 07:09:41 -07:00
Function898be:
2015-10-16 10:35:43 -07:00
push bc
2015-11-10 16:51:13 -08:00
ld de, wd002
ld hl, wd002
2015-10-16 10:35:43 -07:00
call Function89331
jr nc, .asm_898cd
ld de, String_89116
.asm_898cd
hlcoord 9, 1
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
and a
jr nz, .asm_898d7
dec hl
.asm_898d7
call PlaceString
pop bc
ret
2018-06-24 07:09:41 -07:00
Function898dc:
2015-10-16 10:35:43 -07:00
ld hl, $0006
add hl, bc
push bc
ld d, h
ld e, l
call Function8934a
jr nc, .asm_898eb
ld de, String_89116
.asm_898eb
hlcoord 6, 4
call PlaceString
pop bc
ret
2018-06-24 07:09:41 -07:00
Function898f3:
2015-10-16 10:35:43 -07:00
push bc
ld hl, $000c
add hl, bc
ld d, h
ld e, l
call Function8934a
jr c, .asm_8990a
hlcoord 5, 5
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
jr .asm_89913
.asm_8990a
hlcoord 5, 5
ld de, String_89116
call PlaceString
.asm_89913
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89915:
2015-10-16 10:35:43 -07:00
push bc
push hl
ld de, Unknown_89942
ld c, $8
.asm_8991c
ld a, [de]
ld [hl], a
ld a, $4
call Function89215
inc hl
inc de
dec c
jr nz, .asm_8991c
pop hl
ld b, $4
ld c, $2b
ld a, $8
ld de, Unknown_8994a
.asm_89932
push af
ld a, [de]
cp [hl]
jr nz, .asm_8993b
call Function8994e
inc de
.asm_8993b
inc hl
pop af
dec a
jr nz, .asm_89932
pop bc
ret
2018-06-24 07:09:41 -07:00
Unknown_89942:
2015-10-16 10:35:43 -07:00
db $24, $25, $26, " ", $27, $28, $29, $2a
2018-06-24 07:09:41 -07:00
Unknown_8994a:
2015-10-16 10:35:43 -07:00
db $24, $27, $29, $ff
2018-06-24 07:09:41 -07:00
Function8994e:
2015-10-16 10:35:43 -07:00
push hl
push de
ld de, SCREEN_WIDTH
ld a, l
sub e
ld l, a
ld a, h
sbc d
ld h, a
ld a, c
ld [hl], a
ld a, b
call Function89215
pop de
pop hl
ret
2018-06-24 07:09:41 -07:00
Function89962:
2015-10-16 10:35:43 -07:00
push bc
ld c, $4
ld b, $20
.asm_89967
ld a, b
ld [hl], a
ld a, $4
call Function89215
inc hl
inc b
dec c
jr nz, .asm_89967
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89975:
2015-10-16 10:35:43 -07:00
push bc
ld e, $8
.asm_89978
ld a, [bc]
ld d, a
call Function8998b
swap d
inc hl
ld a, d
call Function8998b
inc bc
inc hl
dec e
jr nz, .asm_89978
pop bc
ret
2018-06-24 07:09:41 -07:00
Function8998b:
2015-10-16 10:35:43 -07:00
push bc
and $f
cp $a
jr nc, .asm_89997
ld c, $f6
add c
jr .asm_89999
.asm_89997
ld a, $7f
.asm_89999
ld [hl], a
pop bc
ret
2018-06-24 07:09:41 -07:00
Function8999c:
2018-01-23 14:39:09 -08:00
ld de, wPlayerName
2015-10-16 10:35:43 -07:00
call PlaceString
inc bc
ld h, b
ld l, c
ld de, String_899ac
call PlaceString
ret
2018-06-24 07:09:41 -07:00
String_899ac:
db "の めいし@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function899b2:
2018-01-23 14:39:09 -08:00
ld bc, wPlayerName
2015-10-16 10:35:43 -07:00
call Function89346
jr c, .asm_899bf
2018-01-23 14:39:09 -08:00
ld de, wPlayerName
2015-10-16 10:35:43 -07:00
jr .asm_899c2
.asm_899bf
ld de, String_89116
.asm_899c2
hlcoord 6, 4
call PlaceString
ret
2018-06-24 07:09:41 -07:00
Function899c9:
2018-01-23 14:39:09 -08:00
ld de, wPlayerID
2015-10-16 10:35:43 -07:00
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ret
2018-06-24 07:09:41 -07:00
Function899d3:
2015-10-16 10:35:43 -07:00
hlcoord 1, 4
call Function89753
hlcoord 2, 5
call Function8975b
hlcoord 1, 9
call Function89771
hlcoord 1, 11
call Function8977a
hlcoord 1, 5
call Function89797
hlcoord 2, 4
call Function89962
hlcoord 2, 9
call Function89915
ret
2018-06-24 07:09:41 -07:00
Function899fe:
2015-10-16 10:35:43 -07:00
push bc
push hl
ld hl, $0019
add hl, bc
ld b, h
ld c, l
pop hl
call Function89a0c
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89a0c:
2015-10-16 10:35:43 -07:00
push hl
call Function89363
pop hl
jr c, .asm_89a1c
ld d, h
ld e, l
2017-12-24 09:47:30 -08:00
farcall Function11c08f
2015-10-16 10:35:43 -07:00
ret
.asm_89a1c
ld de, String_89153
call PlaceString
ret
2018-06-24 07:09:41 -07:00
Function89a23:
2015-10-16 10:35:43 -07:00
hlcoord 0, 11
ld b, $4
ld c, $12
call Function8921f
ret
2018-06-24 07:09:41 -07:00
Function89a2e:
2015-10-16 10:35:43 -07:00
hlcoord 11, 12
ld b, $2
ld c, $6
call TextBox
hlcoord 13, 13
ld de, String_89a4e
call PlaceString
hlcoord 13, 14
ld de, String_89a53
call PlaceString
call Function89655
ret
2018-06-24 07:09:41 -07:00
String_89a4e:
2015-10-16 10:35:43 -07:00
db "けってい@"
2018-06-24 07:09:41 -07:00
String_89a53:
2015-10-16 10:35:43 -07:00
db "やめる@"
2018-06-24 07:09:41 -07:00
Function89a57:
call JoyTextDelay_ForcehJoyDown ; joypad
bit D_UP_F, c
jr nz, .d_up
bit D_DOWN_F, c
jr nz, .d_down
bit A_BUTTON_F, c
jr nz, .a_b_button
bit B_BUTTON_F, c
jr nz, .a_b_button
bit START_F, c
jr nz, .start_button
2015-10-16 10:35:43 -07:00
scf
ret
.a_b_button
2015-10-16 10:35:43 -07:00
ld a, $1
and a
ret
.start_button
2015-10-16 10:35:43 -07:00
ld a, $2
and a
ret
.d_up
call .MoveCursorUp
call nc, .PlayPocketSwitchSFX
2015-10-16 10:35:43 -07:00
ld a, $0
ret
.d_down
call .MoveCursorDown
call nc, .PlayPocketSwitchSFX
2015-10-16 10:35:43 -07:00
ld a, $0
ret
2018-06-24 07:09:41 -07:00
.PlayPocketSwitchSFX:
2015-10-16 10:35:43 -07:00
push af
2015-12-13 11:15:16 -08:00
ld de, SFX_SWITCH_POCKETS
2015-10-16 10:35:43 -07:00
call PlaySFX
pop af
ret
2018-06-24 07:09:41 -07:00
.MoveCursorDown:
ld d, 40
ld e, 1
call .ApplyCursorMovement
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
.MoveCursorUp:
ld d, 1
ld e, -1
call .ApplyCursorMovement
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
.ApplyCursorMovement:
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
ld c, a
push bc
.loop
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
cp d
jr z, .equal_to_d
2015-10-16 10:35:43 -07:00
add e
jr nz, .not_zero
2015-10-16 10:35:43 -07:00
inc a
.not_zero
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
call .Function89ac7 ; BCD conversion of data in SRAM?
jr nc, .loop
2018-01-23 14:39:09 -08:00
call .Function89ae6 ; split [wMenuSelection] into [wd030] + [wd031] where [wd030] <= 5
2015-10-16 10:35:43 -07:00
pop bc
and a
ret
.equal_to_d
2015-10-16 10:35:43 -07:00
pop bc
ld a, c
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
scf
ret
2018-06-24 07:09:41 -07:00
.Function89ac7:
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
call Function8931b
call .Function89ad4
2015-10-16 10:35:43 -07:00
call CloseSRAM
ret
2018-06-24 07:09:41 -07:00
.Function89ad4:
2015-10-16 10:35:43 -07:00
push de
call Function8932d ; find a non-space character within 5 bytes of bc
jr c, .no_nonspace_character
ld hl, 17
2015-10-16 10:35:43 -07:00
add hl, bc
call Function89b45
jr c, .finish_decode
2015-10-16 10:35:43 -07:00
.no_nonspace_character
2015-10-16 10:35:43 -07:00
and a
.finish_decode
2015-10-16 10:35:43 -07:00
pop de
ret
2018-06-24 07:09:41 -07:00
.Function89ae6:
2015-10-16 10:35:43 -07:00
ld hl, wd031
xor a
ld [hl], a
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
.loop2
cp 6
jr c, .load_and_ret
sub 5
2015-10-16 10:35:43 -07:00
ld c, a
ld a, [hl]
add 5
2015-10-16 10:35:43 -07:00
ld [hl], a
ld a, c
jr .loop2
2015-10-16 10:35:43 -07:00
.load_and_ret
2015-10-16 10:35:43 -07:00
ld [wd030], a
ret
2018-06-24 07:09:41 -07:00
Function89b00:
2017-12-24 09:47:30 -08:00
farcall MG_Mobile_Layout_LoadPals
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function89b07:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
call DelayFrame
2017-12-24 09:47:30 -08:00
farcall Function4a3a7
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function89b14:
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function89b07
call Function89b00
ret
2018-06-24 07:09:41 -07:00
Function89b1e:
2017-12-24 09:47:30 -08:00
farcall Function4a485
2015-10-16 10:35:43 -07:00
call Function89b00
ret
2018-06-24 07:09:41 -07:00
Function89b28:
2015-10-16 10:35:43 -07:00
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893e2
2015-10-25 19:26:53 -07:00
call Call_ExitMenu
2015-10-16 10:35:43 -07:00
call Function891ab
2015-10-25 19:26:53 -07:00
call SetPalettes
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function89b3b:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2017-12-24 09:47:30 -08:00
farcall Function48cda
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function89b45:
; some sort of decoder?
; BCD?
2015-10-16 10:35:43 -07:00
push hl
push bc
ld c, $10
ld e, $0
.loop
2015-10-16 10:35:43 -07:00
ld a, [hli]
ld b, a
and $f
cp 10
jr c, .low_nybble_less_than_10
2015-10-16 10:35:43 -07:00
ld a, c
cp $b
jr nc, .clear_carry
jr .set_carry
2015-10-16 10:35:43 -07:00
.low_nybble_less_than_10
2015-10-16 10:35:43 -07:00
dec c
swap b
inc e
ld a, b
and $f
cp 10
jr c, .high_nybble_less_than_10
2015-10-16 10:35:43 -07:00
ld a, c
cp $b
jr nc, .clear_carry
jr .set_carry
2015-10-16 10:35:43 -07:00
.high_nybble_less_than_10
2015-10-16 10:35:43 -07:00
inc e
dec c
jr nz, .loop
2015-10-16 10:35:43 -07:00
dec e
.set_carry
2015-10-16 10:35:43 -07:00
scf
jr .finish
2015-10-16 10:35:43 -07:00
.clear_carry
2015-10-16 10:35:43 -07:00
and a
.finish
2015-10-16 10:35:43 -07:00
pop bc
pop hl
ret
2018-06-24 07:09:41 -07:00
Function89b78:
2015-10-16 10:35:43 -07:00
push bc
ld a, [wd010]
cp $10
jr c, .asm_89b8c
ld a, e
and a
jr z, .asm_89b89
ld c, e
.asm_89b85
inc hl
dec c
jr nz, .asm_89b85
.asm_89b89
ld a, $7f
ld [hl], a
.asm_89b8c
ld a, [wd010]
inc a
and $1f
ld [wd010], a
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89b97:
2015-10-16 10:35:43 -07:00
call Function89c34
jr c, .asm_89ba0
call Function89448
ret
.asm_89ba0
ld a, [wd011]
ld hl, Unknown_89bd8
and a
jr z, .asm_89bae
.asm_89ba9
inc hl
inc hl
2015-10-16 10:35:43 -07:00
dec a
jr nz, .asm_89ba9
.asm_89bae
ld a, [hli]
ld h, [hl]
ld l, a
2018-01-30 11:52:46 -08:00
ld de, wVirtualOAMSprite00
2015-10-16 10:35:43 -07:00
.asm_89bb4
ld a, [hli]
cp $ff
ret z
ld c, a
ld b, $0
.asm_89bbb
push hl
ld a, [hli]
2018-01-10 10:47:57 -08:00
ld [de], a ; y
2015-10-16 10:35:43 -07:00
inc de
ld a, [hli]
add b
2018-01-10 10:47:57 -08:00
ld [de], a ; x
2015-10-16 10:35:43 -07:00
inc de
2018-01-10 10:47:57 -08:00
ld a, $08
2015-10-16 10:35:43 -07:00
add b
ld b, a
2018-01-10 10:47:57 -08:00
ld a, [hli] ; tile id
2015-10-16 10:35:43 -07:00
ld [de], a
inc de
2018-01-10 10:47:57 -08:00
ld a, [hli] ; attributes
2015-10-16 10:35:43 -07:00
ld [de], a
inc de
pop hl
dec c
jr nz, .asm_89bbb
ld b, $0
ld c, $4
add hl, bc
jr .asm_89bb4
2018-06-24 07:09:41 -07:00
Unknown_89bd8:
2015-10-16 10:35:43 -07:00
dw Unknown_89be0
dw Unknown_89bf5
dw Unknown_89c0a
dw Unknown_89c1f
2018-06-24 07:09:41 -07:00
Unknown_89be0:
2018-01-10 19:53:42 -08:00
db $01, $12, $4e, $01, 0
db $01, $19, $4e, $01, 0 | Y_FLIP
db $01, $12, $72, $01, 0 | X_FLIP
db $01, $19, $72, $01, 0 | X_FLIP | Y_FLIP
db -1 ; end
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Unknown_89bf5:
2018-01-10 19:53:42 -08:00
db $01, $60, $16, $01, 0
db $01, $62, $16, $01, 0 | Y_FLIP
db $01, $60, $92, $01, 0 | X_FLIP
db $01, $62, $92, $01, 0 | X_FLIP | Y_FLIP
db -1 ; end
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Unknown_89c0a:
2018-01-10 19:53:42 -08:00
db $01, $78, $66, $01, 0
db $01, $78, $66, $01, 0 | Y_FLIP
db $01, $78, $92, $01, 0 | X_FLIP
db $01, $78, $92, $01, 0 | X_FLIP | Y_FLIP
db -1 ; end
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Unknown_89c1f:
2018-01-10 19:53:42 -08:00
db $01, $80, $66, $01, 0
db $01, $80, $66, $01, 0 | Y_FLIP
db $01, $80, $92, $01, 0 | X_FLIP
db $01, $80, $92, $01, 0 | X_FLIP | Y_FLIP
db -1 ; end
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function89c34:
2015-10-16 10:35:43 -07:00
push bc
ld a, [wd012]
ld c, a
inc a
and $f
ld [wd012], a
ld a, c
cp $8
pop bc
ret
2018-06-24 07:09:41 -07:00
Function89c44:
2015-10-16 10:35:43 -07:00
call Function89c34
jr c, .asm_89c4f
push de
call Function89448
pop de
ret
.asm_89c4f
2018-01-30 11:52:46 -08:00
ld hl, wVirtualOAMSprite00
2015-10-16 10:35:43 -07:00
push de
ld a, b
2018-01-10 10:47:57 -08:00
ld [hli], a ; y
2015-10-16 10:35:43 -07:00
ld d, $8
ld a, e
and a
ld a, c
jr z, .asm_89c60
.asm_89c5c
add d
dec e
jr nz, .asm_89c5c
.asm_89c60
pop de
2018-01-10 10:47:57 -08:00
ld [hli], a ; x
2015-10-16 10:35:43 -07:00
ld a, d
2018-01-10 10:47:57 -08:00
ld [hli], a ; tile id
2015-10-16 10:35:43 -07:00
xor a
2018-01-10 10:47:57 -08:00
ld [hli], a ; attributes
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function89c67:
; menu scrolling?
call JoyTextDelay_ForcehJoyDown ; joypad
2015-10-16 10:35:43 -07:00
ld b, $0
bit A_BUTTON_F, c
jr z, .not_a_button
2015-10-16 10:35:43 -07:00
ld b, $1
and a
ret
.not_a_button
bit B_BUTTON_F, c
jr z, .not_b_button
2015-10-16 10:35:43 -07:00
scf
ret
.not_b_button
2015-10-16 10:35:43 -07:00
xor a
bit D_UP_F, c
jr z, .not_d_up
2015-10-16 10:35:43 -07:00
ld a, $1
.not_d_up
bit D_DOWN_F, c
jr z, .not_d_down
2015-10-16 10:35:43 -07:00
ld a, $2
.not_d_down
bit D_LEFT_F, c
jr z, .not_d_left
2015-10-16 10:35:43 -07:00
ld a, $3
.not_d_left
bit D_RIGHT_F, c
jr z, .not_d_right
2015-10-16 10:35:43 -07:00
ld a, $4
.not_d_right
2015-10-16 10:35:43 -07:00
and a
ret z ; no dpad pressed
2015-10-16 10:35:43 -07:00
dec a
ld c, a
ld d, $0
ld hl, .ScrollData0
2015-10-16 10:35:43 -07:00
ld a, [wd02f]
and a
jr z, .got_data
ld hl, .ScrollData1
.got_data
2015-10-16 10:35:43 -07:00
ld a, [wd011]
and a
jr z, .got_row
2015-10-16 10:35:43 -07:00
ld e, $4
.add_n_times
2015-10-16 10:35:43 -07:00
add hl, de
dec a
jr nz, .add_n_times
.got_row
2015-10-16 10:35:43 -07:00
ld e, c
add hl, de
ld a, [hl]
and a
ret z
dec a
ld [wd011], a
xor a
ld [wd012], a
ret
2018-06-24 07:09:41 -07:00
.ScrollData0:
2015-10-16 10:35:43 -07:00
db 0, 2, 0, 0
db 1, 3, 0, 0
db 2, 4, 0, 0
db 3, 0, 0, 0
2018-06-24 07:09:41 -07:00
.ScrollData1:
2015-10-16 10:35:43 -07:00
db 0, 0, 0, 0
db 0, 3, 0, 0
db 2, 4, 0, 0
db 3, 0, 0, 0
2018-06-24 07:09:41 -07:00
Function89cdf:
2015-10-16 10:35:43 -07:00
ld a, $10
add b
ld b, a
ld a, $8
add c
ld c, a
ld e, $2
ld a, $2
2018-01-30 11:52:46 -08:00
ld hl, wVirtualOAMSprite00
2015-10-16 10:35:43 -07:00
.asm_89cee
push af
push bc
ld d, $4
.asm_89cf2
ld a, b
2018-01-10 10:47:57 -08:00
ld [hli], a ; y
2015-10-16 10:35:43 -07:00
ld a, c
2018-01-10 10:47:57 -08:00
ld [hli], a ; x
2015-10-16 10:35:43 -07:00
ld a, e
2018-01-10 10:47:57 -08:00
ld [hli], a ; tile id
2015-10-16 10:35:43 -07:00
ld a, $1
2018-01-10 10:47:57 -08:00
ld [hli], a ; attributes
2015-10-16 10:35:43 -07:00
ld a, $8
add c
ld c, a
inc e
dec d
jr nz, .asm_89cf2
pop bc
ld a, $8
add b
ld b, a
pop af
dec a
jr nz, .asm_89cee
ret
2018-06-24 07:09:41 -07:00
Function89d0d:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
ld a, [rSVBK]
2015-10-16 10:35:43 -07:00
push af
ld a, $5
ld [rSVBK], a
2016-05-11 14:16:03 -07:00
ld c, 8
2018-01-01 06:08:21 -08:00
ld de, wBGPals1
2016-05-11 14:16:03 -07:00
.loop
2015-10-16 10:35:43 -07:00
push bc
2016-05-11 14:16:03 -07:00
ld hl, .Palette1
ld bc, 1 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
pop bc
dec c
2016-05-11 14:16:03 -07:00
jr nz, .loop
ld hl, .Palette2
2018-01-01 06:08:21 -08:00
ld de, wBGPals1 + 2 palettes
2016-05-11 14:16:03 -07:00
ld bc, 1 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
2016-05-11 14:16:03 -07:00
2015-10-16 10:35:43 -07:00
pop af
ld [rSVBK], a
2016-05-11 14:16:03 -07:00
2015-10-25 19:26:53 -07:00
call SetPalettes
2017-12-24 09:47:30 -08:00
farcall PrintMail_
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode1
ld c, 24
2015-10-16 10:35:43 -07:00
call DelayFrames
call RestartMapMusic
ret
2018-06-24 07:09:41 -07:00
.Palette1:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 19, 19, 19
RGB 15, 15, 15
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
.Palette2:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 19, 19, 19
RGB 19, 19, 19
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
Function89d5e:
2015-10-16 10:35:43 -07:00
push af
call CopyMenuHeader
2015-10-16 10:35:43 -07:00
pop af
2015-11-01 09:44:30 -08:00
ld [wMenuCursorBuffer], a
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-12-15 15:59:49 -08:00
call PlaceVerticalMenuItems
call InitVerticalMenuCursor
ld hl, w2DMenuFlags1
2015-10-16 10:35:43 -07:00
set 7, [hl]
ret
2018-06-24 07:09:41 -07:00
Function89d75:
2015-10-16 10:35:43 -07:00
push hl
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
call _hl_
2017-12-24 09:47:30 -08:00
farcall Mobile_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
2015-10-16 10:35:43 -07:00
pop hl
jr asm_89d90
2018-06-24 07:09:41 -07:00
Function89d85:
2015-10-16 10:35:43 -07:00
push hl
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
call _hl_
call CGBOnly_CopyTilemapAtOnce
2015-10-16 10:35:43 -07:00
pop hl
2018-06-24 07:09:41 -07:00
asm_89d90:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
push hl
call _hl_
call Function89dab
2015-12-15 15:59:49 -08:00
ld a, [wMenuCursorY]
2015-10-16 10:35:43 -07:00
push af
call Function891ab
pop af
pop hl
jr c, .asm_89da9
jr z, asm_89d90
scf
ret
.asm_89da9
and a
ret
2018-06-24 07:09:41 -07:00
Function89dab:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2017-12-24 09:47:30 -08:00
farcall MobileMenuJoypad
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
ld a, c
ld hl, wMenuJoypadFilter
2015-10-16 10:35:43 -07:00
and [hl]
ret z
bit 0, a
jr nz, .asm_89dc7
bit 1, a
jr nz, .asm_89dd9
xor a
ret
.asm_89dc7
call PlayClickSFX
ld a, [w2DMenuNumRows]
2015-10-16 10:35:43 -07:00
ld c, a
2015-12-15 15:59:49 -08:00
ld a, [wMenuCursorY]
2015-10-16 10:35:43 -07:00
cp c
jr z, .asm_89dd9
2015-12-17 19:31:16 -08:00
call PlaceHollowCursor
2015-10-16 10:35:43 -07:00
scf
ret
.asm_89dd9
call PlayClickSFX
ld a, $1
and a
ret
2018-06-24 07:09:41 -07:00
Function89de0:
2015-10-16 10:35:43 -07:00
call ClearSprites
call Function89e0a
jr c, .asm_89e00
ld c, $1
.asm_89dea
call Function8a31c
jr z, .asm_89dfd
2015-12-15 15:59:49 -08:00
ld a, [wMenuCursorY]
2015-10-16 10:35:43 -07:00
ld c, a
push bc
ld hl, Jumptable_89e04
ld a, e
dec a
rst JumpTable
pop bc
jr .asm_89dea
.asm_89dfd
call Function891fe
.asm_89e00
call Function8917a
ret
2018-06-24 07:09:41 -07:00
Jumptable_89e04:
2015-10-16 10:35:43 -07:00
dw Function8a62c
dw Function8a999
dw Function8ab93
2018-06-24 07:09:41 -07:00
Function89e0a:
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
call Function8b3b0
call CloseSRAM
ld hl, Jumptable_89e18
rst JumpTable
ret
2018-06-24 07:09:41 -07:00
Jumptable_89e18:
2015-10-16 10:35:43 -07:00
dw Function89e1e
dw Function8a116
dw Function8a2aa
2018-06-24 07:09:41 -07:00
Function89e1e:
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
2018-06-24 07:09:41 -07:00
ld bc, $a037
2015-10-16 10:35:43 -07:00
call Function8b36c
call CloseSRAM
xor a
ld [wd02d], a
2018-06-24 07:09:41 -07:00
asm_89e2e:
2015-10-16 10:35:43 -07:00
ld a, [wd02d]
ld hl, Jumptable_89e3c
rst JumpTable
ret
2018-06-24 07:09:41 -07:00
Function89e36:
2015-10-16 10:35:43 -07:00
ld hl, wd02d
inc [hl]
jr asm_89e2e
2018-06-24 07:09:41 -07:00
Jumptable_89e3c:
2015-10-16 10:35:43 -07:00
dw Function89e6f
dw Function89fed
dw Function89ff6
dw Function8a03d
dw Function89eb9
dw Function89efd
dw Function89fce
dw Function8a04c
dw Function8a055
dw Function8a0e6
dw Function8a0ec
dw Function8a0f5
dw Function89e58
dw Function89e68
2018-06-24 07:09:41 -07:00
Function89e58:
2015-10-16 10:35:43 -07:00
ld a, $1
call Function8a2fe
call Function891fe
call Function893e2
call Function89168
and a
ret
2018-06-24 07:09:41 -07:00
Function89e68:
2015-10-16 10:35:43 -07:00
call Function891fe
ld a, $1
scf
ret
2018-06-24 07:09:41 -07:00
Function89e6f:
2015-10-16 10:35:43 -07:00
call Function891de
call Function89245
call Function89ee1
call Function89e9a
hlcoord 7, 4
call Function8a58d
ld a, $5
2018-01-23 14:39:09 -08:00
hlcoord 7, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
ld a, $6
2018-01-23 14:39:09 -08:00
hlcoord 10, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
call Function891ab
2015-10-25 19:26:53 -07:00
call SetPalettes
2015-10-16 10:35:43 -07:00
jp Function89e36
2018-06-24 07:09:41 -07:00
Function89e9a:
ld a, [rSVBK]
2015-10-16 10:35:43 -07:00
push af
ld a, $5
ld [rSVBK], a
2015-10-16 10:35:43 -07:00
ld hl, Palette_89eb1
2018-01-01 06:08:21 -08:00
ld de, wBGPals1 palette 5
ld bc, 1 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
pop af
ld [rSVBK], a
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Palette_89eb1:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 31, 31, 31
RGB 27, 19, 00
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
Function89eb9:
2015-10-16 10:35:43 -07:00
call Function891fe
call Function89ee1
call Function89e9a
hlcoord 7, 4
call Function8a58d
ld a, $5
2018-01-23 14:39:09 -08:00
hlcoord 7, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
ld a, $6
2018-01-23 14:39:09 -08:00
hlcoord 10, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
call Function891ab
2015-10-25 19:26:53 -07:00
call SetPalettes
2015-10-16 10:35:43 -07:00
jp Function89e36
2018-06-24 07:09:41 -07:00
Function89ee1:
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893e2
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2017-12-24 09:47:30 -08:00
farcall Function4a3a7
farcall MG_Mobile_Layout_CreatePalBoxes
2015-10-16 10:35:43 -07:00
hlcoord 1, 0
call Function8a53d
ret
2018-06-24 07:09:41 -07:00
Function89efd:
2015-10-16 10:35:43 -07:00
ld hl, wd012
ld a, $ff
ld [hli], a
xor a
rept 4
ld [hli], a
endr
ld [hl], a
.asm_89f09
ld hl, wd012
inc [hl]
ld a, [hli]
and $3
jr nz, .asm_89f2e
ld a, [hl]
cp $4
jr nc, .asm_89f2e
ld b, $32
inc [hl]
ld a, [hl]
dec a
jr z, .asm_89f26
ld c, a
.asm_89f1f
ld a, $b
add b
ld b, a
dec c
jr nz, .asm_89f1f
.asm_89f26
ld c, $e8
ld a, [wd013]
call Function89fa5
.asm_89f2e
ld a, [wd013]
and a
jr z, .asm_89f58
.asm_89f34
call Function89f6a
ld e, a
ld a, c
cp $a8
jr nc, .asm_89f4d
cp $46
jr c, .asm_89f4d
ld d, $0
dec e
ld hl, wd014
add hl, de
set 0, [hl]
inc e
jr .asm_89f51
.asm_89f4d
ld a, $2
add c
ld c, a
.asm_89f51
ld a, e
call Function89f77
dec a
jr nz, .asm_89f34
.asm_89f58
call DelayFrame
ld hl, wd014
ld c, $4
.asm_89f60
ld a, [hli]
and a
jr z, .asm_89f09
dec c
jr nz, .asm_89f60
jp Function89e36
2018-06-24 07:09:41 -07:00
Function89f6a:
2015-10-16 10:35:43 -07:00
push af
ld de, $10
call Function89f9a
ld a, [hli]
ld b, a
ld a, [hl]
ld c, a
pop af
ret
2018-06-24 07:09:41 -07:00
Function89f77:
2015-10-16 10:35:43 -07:00
push af
ld de, $10
call Function89f9a
ld d, $2
.asm_89f80
push bc
ld e, $2
.asm_89f83
ld a, b
ld [hli], a
ld a, c
ld [hli], a
inc hl
inc hl
2015-10-16 10:35:43 -07:00
ld a, $8
add c
ld c, a
dec e
jr nz, .asm_89f83
pop bc
ld a, $8
add b
ld b, a
dec d
jr nz, .asm_89f80
pop af
ret
2018-06-24 07:09:41 -07:00
Function89f9a:
2015-10-16 10:35:43 -07:00
dec a
ld hl, wVirtualOAM
2015-10-16 10:35:43 -07:00
and a
ret z
.asm_89fa0
add hl, de
dec a
jr nz, .asm_89fa0
ret
2018-06-24 07:09:41 -07:00
Function89fa5:
2015-10-16 10:35:43 -07:00
ld de, $10
call Function89f9a
ld e, $2
ld d, $a
.asm_89faf
push bc
ld a, $2
.asm_89fb2
push af
ld a, b
ld [hli], a
ld a, c
ld [hli], a
ld a, d
inc d
ld [hli], a
ld a, $1
ld [hli], a
ld a, $8
add c
ld c, a
pop af
dec a
jr nz, .asm_89fb2
pop bc
ld a, $8
add b
ld b, a
dec e
jr nz, .asm_89faf
ret
2018-06-24 07:09:41 -07:00
Function89fce:
2015-10-16 10:35:43 -07:00
call Function8a5b6
ld a, $5
2018-01-23 14:39:09 -08:00
hlcoord 7, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
ld a, $6
2018-01-23 14:39:09 -08:00
hlcoord 10, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
call Function89448
2015-10-25 19:26:53 -07:00
call SetPalettes
2015-10-16 10:35:43 -07:00
call Function891ab
jp Function89e36
2018-06-24 07:09:41 -07:00
Function89fed:
2015-10-16 10:35:43 -07:00
ld hl, UnknownText_0x8a102
call PrintText
jp Function89e36
2018-06-24 07:09:41 -07:00
Function89ff6:
2015-10-16 10:35:43 -07:00
call Function891fe
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call Function89807
call Function89492
call Function894ca
call OpenSRAMBank4
ld hl, $a603
ld a, -1
ld bc, 8
call ByteFill
ld hl, $a603
ld de, wd008
call Function89381
call CloseSRAM
call Function8987f
call OpenSRAMBank4
hlcoord 1, 13
ld bc, $a007
call Function89a0c
call CloseSRAM
call Function891ab
2016-05-11 14:16:03 -07:00
call Mobile22_ButtonSound
2015-10-16 10:35:43 -07:00
jp Function89e36
2018-06-24 07:09:41 -07:00
Function8a03d:
2015-10-16 10:35:43 -07:00
ld hl, UnknownText_0x8a107
call Function89209
call PrintText
call Function8920f
jp Function89e36
2018-06-24 07:09:41 -07:00
Function8a04c:
2015-10-16 10:35:43 -07:00
ld hl, UnknownText_0x8a10c
call PrintText
jp Function89e36
2018-06-24 07:09:41 -07:00
Function8a055:
2015-10-16 10:35:43 -07:00
ld c, $7
ld b, $4
.asm_8a059
call Function8a0a1
inc c
call Function8a0c9
push bc
call Function8a58d
pop bc
call Function8a0de
push bc
push hl
ld a, $5
call Function8a5a3
pop hl
inc hl
inc hl
inc hl
2015-10-16 10:35:43 -07:00
ld a, $6
call Function8a5a3
call CGBOnly_CopyTilemapAtOnce
2015-10-16 10:35:43 -07:00
pop bc
ld a, c
cp $b
jr nz, .asm_8a059
call Function8a0a1
hlcoord 12, 4
call Function8a58d
ld a, $5
2018-01-23 14:39:09 -08:00
hlcoord 12, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
pop hl
ld a, $6
2018-01-23 14:39:09 -08:00
hlcoord 15, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
call CGBOnly_CopyTilemapAtOnce
2015-10-16 10:35:43 -07:00
jp Function89e36
2018-06-24 07:09:41 -07:00
Function8a0a1:
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
push bc
call Function8a0c9
ld e, $6
.asm_8a0aa
push hl
ld bc, $6
add hl, bc
ld d, [hl]
call Function8a0c1
pop hl
ld [hl], d
call Function89215
ld bc, $14
add hl, bc
dec e
jr nz, .asm_8a0aa
pop bc
ret
2018-06-24 07:09:41 -07:00
Function8a0c1:
2015-10-16 10:35:43 -07:00
push hl
2018-01-23 14:39:09 -08:00
ld bc, wAttrMap - wTileMap
2015-10-16 10:35:43 -07:00
add hl, bc
ld a, [hl]
pop hl
ret
2018-06-24 07:09:41 -07:00
Function8a0c9:
2015-10-16 10:35:43 -07:00
push bc
hlcoord 0, 0
ld de, $14
ld a, b
and a
jr z, .asm_8a0d8
.asm_8a0d4
add hl, de
dec b
jr nz, .asm_8a0d4
.asm_8a0d8
ld d, $0
ld e, c
add hl, de
pop bc
ret
2018-06-24 07:09:41 -07:00
Function8a0de:
2015-10-16 10:35:43 -07:00
call Function8a0c9
2018-01-23 14:39:09 -08:00
ld de, wAttrMap - wTileMap
2015-10-16 10:35:43 -07:00
add hl, de
ret
2018-06-24 07:09:41 -07:00
Function8a0e6:
2015-10-16 10:35:43 -07:00
call Function8b539
jp Function89e36
2018-06-24 07:09:41 -07:00
Function8a0ec:
2015-10-16 10:35:43 -07:00
ld hl, UnknownText_0x8a111
call PrintText
jp Function89e36
2018-06-24 07:09:41 -07:00
Function8a0f5:
2015-10-16 10:35:43 -07:00
call Function8b555
jp nc, Function8a0ff
ld hl, wd02d
inc [hl]
2018-06-24 07:09:41 -07:00
Function8a0ff:
2015-10-16 10:35:43 -07:00
jp Function89e36
UnknownText_0x8a102:
2015-10-16 10:35:43 -07:00
; The CARD FOLDER stores your and your friends' CARDS. A CARD contains information like the person's name, phone number and profile.
text_jump UnknownText_0x1c5238
db "@"
UnknownText_0x8a107:
2015-10-16 10:35:43 -07:00
; This is your CARD. Once you've entered your phone number, you can trade CARDS with your friends.
text_jump UnknownText_0x1c52bc
db "@"
UnknownText_0x8a10c:
2015-10-16 10:35:43 -07:00
; If you have your friend's CARD, you can use it to make a call from a mobile phone on the 2nd floor of a #MON CENTER.
text_jump UnknownText_0x1c531e
db "@"
UnknownText_0x8a111:
2015-10-16 10:35:43 -07:00
; To safely store your collection of CARDS, you must set a PASSCODE for your CARD FOLDER.
text_jump UnknownText_0x1c5394
db "@"
2018-06-24 07:09:41 -07:00
Function8a116:
2015-10-16 10:35:43 -07:00
ld a, $1
ld [wd030], a
ld hl, MenuHeader_0x8a176
call LoadMenuHeader
2015-10-16 10:35:43 -07:00
.asm_8a121
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
call Function8a17b
jr c, .asm_8a16b
2015-12-15 15:59:49 -08:00
ld a, [wMenuCursorY]
2015-10-16 10:35:43 -07:00
ld [wd030], a
dec d
jr z, .asm_8a140
call Function8a20d
jr c, .asm_8a121
xor a
call Function8a2fe
call Function8916e
jr .asm_8a16b
.asm_8a140
call Function89174
jr nz, .asm_8a14c
call Function8a241
jr c, .asm_8a121
jr .asm_8a15a
.asm_8a14c
call WaitSFX
ld de, SFX_TWINKLE
call PlaySFX
ld c, $10
call DelayFrames
.asm_8a15a
call ExitMenu
call Function891de
call Function893e2
call Function89245
call Function89168
and a
ret
.asm_8a16b
call Function89209
call CloseWindow
2015-10-16 10:35:43 -07:00
call Function8920f
scf
ret
MenuHeader_0x8a176:
db MENU_BACKUP_TILES ; flags
menu_coords 14, 0, SCREEN_WIDTH - 1, 6
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function8a17b:
2015-10-16 10:35:43 -07:00
decoord 14, 0
ld b, $5
ld c, $4
call Function89b3b
ld hl, MenuHeader_0x8a19a
2015-10-16 10:35:43 -07:00
ld a, [wd030]
call Function89d5e
ld hl, Function8a1b0
call Function89d75
jr nc, .asm_8a198
ld a, $0
.asm_8a198
ld d, a
ret
MenuHeader_0x8a19a:
db MENU_BACKUP_TILES ; flags
menu_coords 14, 0, SCREEN_WIDTH - 1, 6
dw MenuData_0x8a1a2
2015-10-16 10:35:43 -07:00
db 1 ; default option
MenuData_0x8a1a2:
db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING | STATICMENU_WRAP ; flags
2015-10-16 10:35:43 -07:00
db 3 ; items
db "ひらく@"
db "すてる@"
db "もどる@"
2018-06-24 07:09:41 -07:00
Function8a1b0:
2015-10-16 10:35:43 -07:00
hlcoord 0, 12
ld b, $4
ld c, $12
call TextBox
hlcoord 1, 14
2015-12-15 15:59:49 -08:00
ld a, [wMenuCursorY]
2015-10-16 10:35:43 -07:00
ld de, Strings_8a1cc
dec a
ld c, a
call Function8919e
call PlaceString
ret
2018-06-24 07:09:41 -07:00
Strings_8a1cc:
db "めいし<NO>せいりと へんしゅうを"
2015-10-16 10:35:43 -07:00
next "おこないます"
db "@"
db "めいしフォルダー<NO>めいしと"
next "あんしょうばんごう<WO>けします"
2015-10-16 10:35:43 -07:00
db "@"
db "まえ<NO>がめん<NI>もどります"
2015-10-16 10:35:43 -07:00
db "@"
2018-06-24 07:09:41 -07:00
Function8a20d:
2015-10-16 10:35:43 -07:00
ld hl, UnknownText_0x8a232
call PrintText
ld a, $2
call Function89259
ret c
ld hl, UnknownText_0x8a237
call PrintText
ld a, $2
call Function89259
ret c
xor a
call Function8a2fe
ld hl, UnknownText_0x8a23c
call PrintText
xor a
and a
ret
UnknownText_0x8a232:
2015-10-16 10:35:43 -07:00
; If the CARD FOLDER is deleted, all its CARDS and the PASSCODE will also be deleted. Beware--a deleted CARD FOLDER can't be restored. Want to delete your CARD FOLDER?
text_jump UnknownText_0x1c53ee
db "@"
UnknownText_0x8a237:
2015-10-16 10:35:43 -07:00
; Are you sure you want to delete it?
text_jump UnknownText_0x1c5494
db "@"
UnknownText_0x8a23c:
2015-10-16 10:35:43 -07:00
; The CARD FOLDER has been deleted.
text_jump UnknownText_0x1c54b9
db "@"
2018-06-24 07:09:41 -07:00
Function8a241:
call LoadStandardMenuHeader
2015-10-16 10:35:43 -07:00
call Function891fe
call Function8a262
jr nc, .asm_8a254
call Function891fe
call Function89b28
scf
ret
.asm_8a254
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-25 19:26:53 -07:00
call Call_ExitMenu
2015-10-16 10:35:43 -07:00
call Function891de
and a
ret
2018-06-24 07:09:41 -07:00
Function8a262:
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893e2
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2017-12-24 09:47:30 -08:00
farcall Function4a3a7
farcall MG_Mobile_Layout_CreatePalBoxes
2015-10-16 10:35:43 -07:00
hlcoord 1, 0
call Function8a53d
hlcoord 12, 4
call Function8a58d
ld a, $5
2018-01-23 14:39:09 -08:00
hlcoord 12, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
ld a, $6
2018-01-23 14:39:09 -08:00
hlcoord 15, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
xor a
ld [wd02e], a
ld bc, wd013
call Function8b36c
call Function8b493
call Function891ab
2015-10-25 19:26:53 -07:00
call SetPalettes
2015-10-16 10:35:43 -07:00
call Function8b5e7
ret
2018-06-24 07:09:41 -07:00
Function8a2aa:
ld hl, MenuHeader_0x8a2ef
call LoadMenuHeader
2015-10-16 10:35:43 -07:00
ld hl, UnknownText_0x8a2f4
call PrintText
ld a, $1
call Function89259
jr nc, .asm_8a2cf
ld hl, UnknownText_0x8a2f9
call PrintText
ld a, $2
call Function89259
jr c, .asm_8a2ea
call Function8a20d
jr .asm_8a2ea
.asm_8a2cf
call ExitMenu
call Function8a241
jr c, .asm_8a2ed
ld a, $1
call Function8a313
call CloseSRAM
call Function891de
call Function89245
call Function89168
and a
ret
.asm_8a2ea
call CloseWindow
2015-10-16 10:35:43 -07:00
.asm_8a2ed
scf
ret
MenuHeader_0x8a2ef:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
2015-10-16 10:35:43 -07:00
UnknownText_0x8a2f4:
2015-10-16 10:35:43 -07:00
; There is an older CARD FOLDER from a previous journey. Do you want to open it?
text_jump UnknownText_0x1c54dd
db "@"
UnknownText_0x8a2f9:
2015-10-16 10:35:43 -07:00
; Delete the old CARD FOLDER?
text_jump UnknownText_0x1c552d
db "@"
2018-06-24 07:09:41 -07:00
Function8a2fe:
2015-10-16 10:35:43 -07:00
call Function8a313
call Function89305
ld hl, $a603
ld bc, $8
ld a, -1
call ByteFill
call CloseSRAM
ret
2018-06-24 07:09:41 -07:00
Function8a313:
2015-10-16 10:35:43 -07:00
ld c, a
call OpenSRAMBank4
ld a, c
ld [$a60b], a
ret
2018-06-24 07:09:41 -07:00
Function8a31c:
2015-10-16 10:35:43 -07:00
push bc
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2017-12-24 09:47:30 -08:00
farcall Function4a3a7
farcall MG_Mobile_Layout_CreatePalBoxes
2015-10-16 10:35:43 -07:00
hlcoord 1, 0
call Function8a53d
hlcoord 12, 4
call Function8a58d
call Function8a3b2
pop bc
ld a, c
2015-11-01 09:44:30 -08:00
ld [wMenuCursorBuffer], a
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-12-15 15:59:49 -08:00
call PlaceVerticalMenuItems
call InitVerticalMenuCursor
ld hl, w2DMenuFlags1
2015-10-16 10:35:43 -07:00
set 7, [hl]
.asm_8a34e
call Function8a3a2
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
call Function8a453
call Function8a4d3
call Function8a4fc
call Function891ab
2015-10-25 19:26:53 -07:00
call SetPalettes
2015-10-16 10:35:43 -07:00
call Function8a383
jr c, .asm_8a370
jr z, .asm_8a34e
.asm_8a36a
call Function89448
xor a
ld e, a
ret
.asm_8a370
call Function89448
2015-12-17 19:31:16 -08:00
call PlaceHollowCursor
2015-10-16 10:35:43 -07:00
call Function8a3a2
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
cp $ff
jr z, .asm_8a36a
ld e, a
and a
ret
2018-06-24 07:09:41 -07:00
Function8a383:
2017-12-24 09:47:30 -08:00
farcall MobileMenuJoypad
2015-10-16 10:35:43 -07:00
ld a, c
ld hl, wMenuJoypadFilter
2015-10-16 10:35:43 -07:00
and [hl]
ret z
bit 0, a
jr nz, .asm_8a399
bit 1, a
jr nz, .asm_8a39e
xor a
ret
.asm_8a399
call PlayClickSFX
scf
ret
.asm_8a39e
call PlayClickSFX
ret
2018-06-24 07:09:41 -07:00
Function8a3a2:
2015-12-15 15:59:49 -08:00
ld a, [wMenuCursorY]
2015-10-16 10:35:43 -07:00
dec a
2015-11-10 16:51:13 -08:00
ld hl, wd002
2015-10-16 10:35:43 -07:00
ld e, a
ld d, $0
add hl, de
ld a, [hl]
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function8a3b2:
2015-10-16 10:35:43 -07:00
ld a, $1
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
call Function8a4fc
call Function8a3df
jr nc, .asm_8a3ce
decoord 0, 2
ld b, $6
ld c, $9
call Function89b3b
ld hl, MenuHeader_0x8a435
2015-10-16 10:35:43 -07:00
jr .asm_8a3db
.asm_8a3ce
decoord 0, 2
ld b, $8
ld c, $9
call Function89b3b
ld hl, MenuHeader_0x8a40f
2015-10-16 10:35:43 -07:00
.asm_8a3db
call CopyMenuHeader
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function8a3df:
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
ld hl, $a603
call Function89b45
call CloseSRAM
2015-11-10 16:51:13 -08:00
ld hl, wd002
2015-10-16 10:35:43 -07:00
jr c, .asm_8a3f8
ld de, Unknown_8a408
call Function8a400
scf
ret
.asm_8a3f8
ld de, Unknown_8a40b
call Function8a400
and a
ret
2018-06-24 07:09:41 -07:00
Function8a400:
2015-10-16 10:35:43 -07:00
ld a, [de]
inc de
ld [hli], a
cp $ff
jr nz, Function8a400
ret
Unknown_8a408: db 1, 2, -1
Unknown_8a40b: db 1, 2, 3, -1
MenuHeader_0x8a40f:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 2, 10, TEXTBOX_Y - 1
dw MenuData_0x8a417
2015-10-16 10:35:43 -07:00
db 1 ; default option
MenuData_0x8a417:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
2015-10-16 10:35:43 -07:00
db 4 ; items
db "めいしりスト@"
db "じぶんの めいし@"
2015-10-16 10:35:43 -07:00
db "めいしこうかん@"
db "やめる@"
MenuHeader_0x8a435:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 2, 10, 9
dw MenuData_0x8a43d
2015-10-16 10:35:43 -07:00
db 1 ; default option
MenuData_0x8a43d:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
2015-10-16 10:35:43 -07:00
db 3 ; items
db "めいしりスト@"
db "じぶんの めいし@"
2015-10-16 10:35:43 -07:00
db "やめる@"
2018-06-24 07:09:41 -07:00
Function8a453:
2015-10-16 10:35:43 -07:00
hlcoord 0, 12
ld b, $4
ld c, $12
call TextBox
hlcoord 1, 14
ld de, String_8a476
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
cp $ff
jr z, .asm_8a472
ld de, Strings_8a483
dec a
ld c, a
call Function8919e
.asm_8a472
call PlaceString
ret
2018-06-24 07:09:41 -07:00
String_8a476:
db "まえ<NO>がめん<NI>もどります@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Strings_8a483:
db "おともだち<NO>めいしは"
next "ここ<NI>いれておきます@"
2015-10-16 10:35:43 -07:00
db "でんわばんごう<WO>いれると"
next "めいしこうかん<GA>できます@"
2015-10-16 10:35:43 -07:00
db "ともだちと じぶん<NO>めいしを"
next "せきがいせんで こうかん します@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function8a4d3:
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
cp $1
jr nz, .asm_8a4eb
ld a, $5
2018-01-23 14:39:09 -08:00
hlcoord 12, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
ld a, $7
2018-01-23 14:39:09 -08:00
hlcoord 15, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
ret
.asm_8a4eb
ld a, $7
2018-01-23 14:39:09 -08:00
hlcoord 12, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
ld a, $6
2018-01-23 14:39:09 -08:00
hlcoord 15, 4, wAttrMap
2015-10-16 10:35:43 -07:00
call Function8a5a3
ret
2018-06-24 07:09:41 -07:00
Function8a4fc:
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
cp $3
jr nz, asm_8a529
ld hl, wd012
ld a, [hli]
ld b, a
ld a, [hld]
add b
ld [hl], a
ld b, a
ld c, $80
call Function89cdf
call Function8a515
ret
2018-06-24 07:09:41 -07:00
Function8a515:
2015-10-16 10:35:43 -07:00
ld hl, wd012
ld a, [hl]
cp $38
jr c, .asm_8a520
cp $3c
ret c
.asm_8a520
ld a, [wd013]
cpl
inc a
ld [wd013], a
ret
2018-06-24 07:09:41 -07:00
asm_8a529:
2015-10-16 10:35:43 -07:00
ld hl, wd012
ld a, $3c
ld [hli], a
ld a, $ff
ld [hli], a
ld hl, wVirtualOAM
2015-10-16 10:35:43 -07:00
xor a
2018-01-10 10:47:57 -08:00
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
2015-10-16 10:35:43 -07:00
call ByteFill
ret
2018-06-24 07:09:41 -07:00
Function8a53d:
2015-10-16 10:35:43 -07:00
push hl
ld a, $15
ld c, $8
ld de, $14
call Function8a573
ld a, $1d
ld c, $9
call Function8a57c
inc a
ld [hl], a
call Function8a584
pop hl
add hl, de
ld a, $1f
ld c, $8
call Function8a573
dec hl
ld a, $51
ld [hli], a
ld a, $26
ld c, $1
call Function8a57c
ld a, $52
ld c, $3
call Function8a573
ld a, $27
ld c, $6
2018-06-24 07:09:41 -07:00
Function8a573:
2015-10-16 10:35:43 -07:00
ld [hl], a
call Function8a584
inc a
dec c
jr nz, Function8a573
ret
2018-06-24 07:09:41 -07:00
Function8a57c:
2015-10-16 10:35:43 -07:00
ld [hl], a
call Function8a584
dec c
jr nz, Function8a57c
ret
2018-06-24 07:09:41 -07:00
Function8a584:
2015-10-16 10:35:43 -07:00
push af
ld a, $4
call Function89215
inc hl
pop af
ret
2018-06-24 07:09:41 -07:00
Function8a58d:
2015-10-16 10:35:43 -07:00
ld a, $2d
ld bc, $606
ld de, $14
.asm_8a595
push bc
push hl
.asm_8a597
ld [hli], a
inc a
dec c
jr nz, .asm_8a597
pop hl
add hl, de
pop bc
dec b
jr nz, .asm_8a595
ret
2018-06-24 07:09:41 -07:00
Function8a5a3:
2015-10-16 10:35:43 -07:00
ld bc, $603
ld de, $14
.asm_8a5a9
push bc
push hl
.asm_8a5ab
ld [hli], a
dec c
jr nz, .asm_8a5ab
pop hl
add hl, de
pop bc
dec b
jr nz, .asm_8a5a9
ret
2018-06-24 07:09:41 -07:00
Function8a5b6:
ld a, [rSVBK]
2015-10-16 10:35:43 -07:00
push af
ld a, $5
ld [rSVBK], a
2015-10-16 10:35:43 -07:00
ld hl, Palette_8a5e5
2018-01-01 06:08:21 -08:00
ld de, wBGPals1 + 4 palettes
2015-12-18 17:07:09 -08:00
ld bc, 3 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
ld hl, Palette_8a5fd
2018-01-01 06:08:21 -08:00
ld de, wOBPals1
2015-12-18 17:07:09 -08:00
ld bc, 1 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
ld hl, Palette_8a605
2018-01-01 06:08:21 -08:00
ld de, wOBPals1 + 1 palettes
2015-12-18 17:07:09 -08:00
ld bc, 1 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
pop af
ld [rSVBK], a
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Palette_8a5e5:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 27, 19, 00
RGB 07, 11, 22
RGB 00, 00, 00
2015-12-18 17:07:09 -08:00
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 16, 16, 31
RGB 27, 19, 00
RGB 00, 00, 00
2015-12-18 17:07:09 -08:00
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 31, 00, 00
RGB 27, 19, 00
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
Palette_8a5fd:
2015-10-16 10:35:43 -07:00
RGB 00, 00, 00
RGB 00, 00, 00
RGB 00, 00, 00
RGB 31, 31, 31
2018-06-24 07:09:41 -07:00
Palette_8a605:
2015-10-16 10:35:43 -07:00
RGB 00, 00, 00
RGB 14, 18, 31
RGB 16, 16, 31
RGB 31, 31, 31
2018-06-24 07:09:41 -07:00
Function8a60d:
2015-10-16 10:35:43 -07:00
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, Palette_8a624
2018-01-01 06:08:21 -08:00
ld de, wOBPals1
2015-12-18 17:07:09 -08:00
ld bc, 1 palettes
2015-10-16 10:35:43 -07:00
call CopyBytes
pop af
ld [rSVBK], a
ret
2018-06-24 07:09:41 -07:00
Palette_8a624:
2015-10-16 10:35:43 -07:00
RGB 31, 31, 31
RGB 31, 31, 31
RGB 31, 31, 31
RGB 00, 00, 00
2018-06-24 07:09:41 -07:00
Function8a62c:
call LoadStandardMenuHeader
2015-10-16 10:35:43 -07:00
call Function891fe
xor a
call Function8b94a
call Function8b677
.asm_8a639
xor a
ld [wd033], a
ld [wd032], a
ld [wd0e3], a
call Function8b7bd
ld a, c
and a
jr z, .asm_8a66a
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
ld b, a
2015-12-17 14:51:32 -08:00
ld a, [wScrollingMenuCursorPosition]
2015-10-16 10:35:43 -07:00
inc a
ld [wd034], a
push bc
call Function8b960
ld a, c
pop bc
jr z, .asm_8a639
ld c, a
ld hl, Jumptable_8a671
ld a, b
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
ld a, c
dec a
rst JumpTable
jr .asm_8a639
.asm_8a66a
call Function891fe
call Function89b28
ret
2018-06-24 07:09:41 -07:00
Jumptable_8a671:
2015-10-16 10:35:43 -07:00
dw Function8a679
dw Function8a6cd
dw Function8a8c3
dw Function8a930
2018-06-24 07:09:41 -07:00
Function8a679:
2015-10-16 10:35:43 -07:00
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call OpenSRAMBank4
call Function8931b
call Function89844
call CloseSRAM
call OpenSRAMBank4
call Function8939a
call Function89856
hlcoord 1, 13
call Function899fe
call Function891ab
call CloseSRAM
.asm_8a6a3
call Function89a57
jr c, .asm_8a6a3
and a
jr z, Function8a679
ld hl, Jumptable_8a6bc
dec a
rst JumpTable
jr c, Function8a679
call Function891fe
call Function8b677
call Function89448
ret
2018-06-24 07:09:41 -07:00
Jumptable_8a6bc:
2015-10-16 10:35:43 -07:00
dw Function8a6c0
dw Function8a6c5
2018-06-24 07:09:41 -07:00
Function8a6c0:
2015-10-16 10:35:43 -07:00
call PlayClickSFX
and a
ret
2018-06-24 07:09:41 -07:00
Function8a6c5:
2015-10-16 10:35:43 -07:00
call PlayClickSFX
call Function89d0d
scf
ret
2018-06-24 07:09:41 -07:00
Function8a6cd:
2015-10-16 10:35:43 -07:00
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call OpenSRAMBank4
call Function8931b
call Function89844
call Function8a757
call CloseSRAM
.asm_8a6e5
call OpenSRAMBank4
call Function8931b
call Function89856
call Function89a2e
call Function891ab
xor a
ld [wd02f], a
call CloseSRAM
.asm_8a6fb
call Function89b97
call Function89c67
jr c, .asm_8a718
ld a, b
and a
jr z, .asm_8a6fb
call PlayClickSFX
call Function89448
ld a, [wd011]
ld hl, Jumptable_8a74f
rst JumpTable
jr nc, .asm_8a6e5
jr .asm_8a742
.asm_8a718
call OpenSRAMBank4
call Function8a765
call CloseSRAM
jr nc, .asm_8a73f
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
call Function89448
call Function89a23
hlcoord 1, 13
ld de, String_89135
call PlaceString
call WaitBGMap
ld a, $2
call Function89254
jr c, .asm_8a6e5
.asm_8a73f
call CloseSRAM
.asm_8a742
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function89448
call Function891d3
call Function8b677
ret
2018-06-24 07:09:41 -07:00
Jumptable_8a74f:
2015-10-16 10:35:43 -07:00
dw Function8a78c
dw Function8a7cb
dw Function8a818
dw Function8a8a1
2018-06-24 07:09:41 -07:00
Function8a757:
2015-10-16 10:35:43 -07:00
call Function8939a
xor a
ld [wd010], a
ld [wd011], a
ld [wd012], a
ret
2018-06-24 07:09:41 -07:00
Function8a765:
2015-10-16 10:35:43 -07:00
call Function8931b
push bc
ld hl, $0
add hl, bc
2015-11-10 16:51:13 -08:00
ld de, wd002
2015-10-16 10:35:43 -07:00
ld c, $6
call Function89185
pop bc
jr nz, .asm_8a78a
push bc
ld hl, $11
add hl, bc
ld de, wd008
ld c, $8
call Function89185
pop bc
jr nz, .asm_8a78a
and a
ret
.asm_8a78a
scf
ret
2018-06-24 07:09:41 -07:00
Function8a78c:
2015-10-16 10:35:43 -07:00
call Function891fe
2015-11-10 16:51:13 -08:00
ld de, wd002
2015-10-16 10:35:43 -07:00
ld b, $5
2017-12-24 09:47:30 -08:00
farcall NamingScreen
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
call Function8931b
push bc
ld hl, $0
add hl, bc
ld d, h
ld e, l
2015-11-10 16:51:13 -08:00
ld hl, wd002
2015-10-16 10:35:43 -07:00
call InitName
call CloseSRAM
call DelayFrame
call JoyTextDelay
2015-10-16 10:35:43 -07:00
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call OpenSRAMBank4
pop bc
call Function89844
call CloseSRAM
and a
ret
2018-06-24 07:09:41 -07:00
Function8a7cb:
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
push af
call Function891de
ld de, wd008
ld c, $0
2017-12-24 09:47:30 -08:00
farcall Function17a68f
2015-10-16 10:35:43 -07:00
jr c, .asm_8a7f4
ld hl, wd008
ld a, $ff
ld bc, $8
call ByteFill
ld h, d
ld l, e
ld de, wd008
ld c, $8
call Function89193
.asm_8a7f4
pop af
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call OpenSRAMBank4
call Function8931b
call Function89844
call Function89856
call Function89a2e
call Function891ab
call CloseSRAM
and a
ret
2018-06-24 07:09:41 -07:00
Function8a818:
2015-10-16 10:35:43 -07:00
call Function89a23
2015-11-10 16:51:13 -08:00
ld hl, wd002
2015-10-16 10:35:43 -07:00
call Function89331
jr c, .asm_8a875
ld hl, wd008
call Function89b45
jr nc, .asm_8a87a
call OpenSRAMBank4
call Function8a765
jr nc, .asm_8a863
call Function8931b
push bc
ld hl, $0
add hl, bc
ld d, h
ld e, l
2015-11-10 16:51:13 -08:00
ld hl, wd002
2015-10-16 10:35:43 -07:00
ld c, $6
call Function89193
pop bc
ld hl, $11
add hl, bc
ld d, h
ld e, l
ld hl, wd008
ld c, $8
call Function89193
hlcoord 1, 13
ld de, .string_8a868
call PlaceString
call WaitBGMap
call JoyWaitAorB
2015-10-16 10:35:43 -07:00
.asm_8a863
call CloseSRAM
scf
ret
.string_8a868
db "めいし<WO>かきかえ まし<TA!>@"
2015-10-16 10:35:43 -07:00
.asm_8a875
ld de, String_8a88b
jr .asm_8a87d
.asm_8a87a
ld de, String_8911c
.asm_8a87d
hlcoord 1, 13
call PlaceString
call WaitBGMap
call JoyWaitAorB
2015-10-16 10:35:43 -07:00
and a
ret
2018-06-24 07:09:41 -07:00
String_8a88b:
db "おともだち<NO>なまえが"
next "かかれて いません!@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function8a8a1:
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
call Function8a765
call CloseSRAM
jr nc, .asm_8a8bf
call Function89a23
hlcoord 1, 13
ld de, String_89135
call PlaceString
ld a, $2
call Function89254
jr c, .asm_8a8c1
.asm_8a8bf
scf
ret
.asm_8a8c1
and a
ret
2018-06-24 07:09:41 -07:00
Function8a8c3:
2015-10-16 10:35:43 -07:00
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call OpenSRAMBank4
call Function8931b
call Function89844
call Function8939a
call Function89856
call CloseSRAM
call Function891ab
hlcoord 1, 13
ld de, String_8a919
call PlaceString
ld a, $2
call Function89254
jr c, .asm_8a90f
call OpenSRAMBank4
call Function892b4
call CloseSRAM
call Function89a23
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
hlcoord 1, 13
ld de, String_8a926
call PlaceString
call WaitBGMap
call JoyWaitAorB
2015-10-16 10:35:43 -07:00
.asm_8a90f
call Function89448
call Function891fe
call Function8b677
ret
2018-06-24 07:09:41 -07:00
String_8a919:
db "このデータ<WO>けしますか?@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
String_8a926:
db "データ<WO>けしまし<TA!>@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function8a930:
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
push af
xor a
ld [wd032], a
ld a, $1
ld [wd033], a
ld a, [wd034]
ld [wd0e3], a
.asm_8a943
call Function8b7bd
2015-12-15 15:59:49 -08:00
ld a, [wMenuJoypad]
2015-10-16 10:35:43 -07:00
and $1
jr nz, .asm_8a953
ld a, c
and a
jr nz, .asm_8a943
pop af
ret
.asm_8a953
call OpenSRAMBank4
pop af
cp c
jr z, .asm_8a995
push bc
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
call Function8931b
push bc
ld h, b
ld l, c
2015-11-10 16:51:13 -08:00
ld de, wd002
2015-10-16 10:35:43 -07:00
ld bc, $25
call CopyBytes
pop de
pop bc
ld a, c
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
call Function8931b
push bc
ld h, b
ld l, c
ld bc, $25
call CopyBytes
pop de
2015-11-10 16:51:13 -08:00
ld hl, wd002
2015-10-16 10:35:43 -07:00
ld bc, $25
call CopyBytes
ld de, SFX_SWITCH_POKEMON
call WaitPlaySFX
ld de, SFX_SWITCH_POKEMON
call WaitPlaySFX
.asm_8a995
call CloseSRAM
ret
2018-06-24 07:09:41 -07:00
Function8a999:
ld hl, MenuHeader_0x8a9c9
call LoadMenuHeader
2015-10-16 10:35:43 -07:00
ld c, $1
.asm_8a9a1
call Function8a9ce
jr c, .asm_8a9bb
push bc
push de
call LoadStandardMenuHeader
2015-10-16 10:35:43 -07:00
pop de
dec e
ld a, e
ld hl, Jumptable_8a9c5
rst JumpTable
call Function891fe
call Function89b28
pop bc
jr .asm_8a9a1
.asm_8a9bb
call Function89209
call CloseWindow
2015-10-16 10:35:43 -07:00
call Function8920f
ret
2018-06-24 07:09:41 -07:00
Jumptable_8a9c5:
2015-10-16 10:35:43 -07:00
dw Function8aa0a
dw Function8ab3b
MenuHeader_0x8a9c9:
db MENU_BACKUP_TILES ; flags
menu_coords 11, 4, 18, TEXTBOX_Y - 1
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function8a9ce:
2015-10-16 10:35:43 -07:00
push bc
decoord 11, 4
ld b, $6
ld c, $6
call Function89b3b
pop bc
ld a, c
ld hl, MenuHeader_0x8a9f2
2015-10-16 10:35:43 -07:00
call Function89d5e
ld hl, Function8aa09
call Function89d85
jr c, .asm_8a9ed
ld c, a
ld e, a
and a
ret
.asm_8a9ed
ld c, a
ld e, $0
scf
ret
MenuHeader_0x8a9f2:
db MENU_BACKUP_TILES ; flags
menu_coords 11, 4, 18, TEXTBOX_Y - 1
dw MenuData_0x8a9fa
2015-10-16 10:35:43 -07:00
db 1 ; default option
MenuData_0x8a9fa:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
2015-10-16 10:35:43 -07:00
db 3 ; items
db "へんしゅう@"
db "みる@"
db "やめる@"
2018-06-24 07:09:41 -07:00
Function8aa09:
2015-10-16 10:35:43 -07:00
ret
2018-06-24 07:09:41 -07:00
Function8aa0a:
2015-10-16 10:35:43 -07:00
ld a, $1
ld [wd02f], a
ld [wd011], a
xor a
ld [wd010], a
ld [wd012], a
call OpenSRAMBank4
ld hl, $a603
ld de, wd008
call Function89381
call CloseSRAM
call Function891fe
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call Function89807
call Function89492
call Function894ca
.asm_8aa3a
call Function8987f
call Function89a2e
call Function891ab
.asm_8aa43
call Function89b97
call Function89c67
jr c, .asm_8aa61
ld a, b
and a
jr z, .asm_8aa43
call PlayClickSFX
call Function89448
ld a, [wd011]
dec a
ld hl, Jumptable_8aa6d
rst JumpTable
jr nc, .asm_8aa3a
jr .asm_8aa69
.asm_8aa61
call Function89448
call Function8ab11
jr nc, .asm_8aa3a
.asm_8aa69
call Function89448
ret
2018-06-24 07:09:41 -07:00
Jumptable_8aa6d:
2015-10-16 10:35:43 -07:00
dw Function8aa73
dw Function8aab6
dw Function8ab11
2018-06-24 07:09:41 -07:00
Function8aa73:
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
ld e, a
push de
call Function891de
ld de, wd008
ld c, $0
2017-12-24 09:47:30 -08:00
farcall Function17a68f
2015-10-16 10:35:43 -07:00
jr c, .asm_8aa9d
ld hl, wd008
ld a, $ff
ld bc, $8
call ByteFill
ld h, d
ld l, e
ld de, wd008
ld c, $8
call Function89193
.asm_8aa9d
call Function891fe
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call Function89807
call Function89492
call Function894ca
pop de
ld a, e
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
and a
ret
2018-06-24 07:09:41 -07:00
Function8aab6:
2015-10-16 10:35:43 -07:00
call Function89a23
ld hl, wd008
call Function89b45
jr nc, Function8ab00
call OpenSRAMBank4
ld de, wd008
ld hl, $a603
ld c, $8
call Function89185
jr z, .asm_8aaeb
ld hl, wd008
ld de, $a603
ld c, $8
call Function89193
hlcoord 1, 13
ld de, String_8aaf0
call PlaceString
call WaitBGMap
call JoyWaitAorB
2015-10-16 10:35:43 -07:00
.asm_8aaeb
call CloseSRAM
scf
ret
2018-06-24 07:09:41 -07:00
String_8aaf0:
db "あたらしい めいし<PKMN>できまし<LNBRK>@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function8ab00:
2015-10-16 10:35:43 -07:00
ld de, String_8911c
hlcoord 1, 13
call PlaceString
call WaitBGMap
2016-05-11 14:16:03 -07:00
call Mobile22_ButtonSound
2015-10-16 10:35:43 -07:00
and a
ret
2018-06-24 07:09:41 -07:00
Function8ab11:
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
ld hl, $a603
ld de, wd008
ld c, $8
call Function89185
call CloseSRAM
jr z, .asm_8ab37
call Function89a23
hlcoord 1, 13
ld de, String_89135
call PlaceString
ld a, $2
call Function89254
jr c, .asm_8ab39
.asm_8ab37
scf
ret
.asm_8ab39
and a
ret
2018-06-24 07:09:41 -07:00
Function8ab3b:
.pressed_start
2015-10-16 10:35:43 -07:00
call Function891fe
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call Function89807
call Function89492
call Function894ca
call OpenSRAMBank4
ld hl, $a603
ld de, wd008
call Function89381
call CloseSRAM
call Function8987f
call OpenSRAMBank4
hlcoord 1, 13
ld bc, $a007
call Function89a0c
call CloseSRAM
call Function891ab
call .JoypadLoop
jr c, .pressed_start
ret
2018-06-24 07:09:41 -07:00
.JoypadLoop:
call JoyTextDelay_ForcehJoyDown
bit A_BUTTON_F, c
jr nz, .a_b_button
bit B_BUTTON_F, c
jr nz, .a_b_button
bit START_F, c
jr z, .JoypadLoop
2015-10-16 10:35:43 -07:00
call PlayClickSFX
call Function89d0d
scf
ret
.a_b_button
2015-10-16 10:35:43 -07:00
call PlayClickSFX
and a
ret
2018-06-24 07:09:41 -07:00
Function8ab93:
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
call LoadStandardMenuHeader
2017-12-24 09:47:30 -08:00
farcall Function105688
2015-10-16 10:35:43 -07:00
call ClearSprites
call Function891fe
call Function89b28
ret
2018-06-24 07:09:41 -07:00
Function8aba9:
2015-10-16 10:35:43 -07:00
ld a, $2
call Function8b94a
ld a, $1
ld [wd032], a
.asm_8abb3
call Function891fe
call Function8b677
.asm_8abb9
call Function8b7bd
jr z, .asm_8abdf
ld a, c
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
call Function8931b
ld hl, $0011
add hl, bc
call Function89b45
call CloseSRAM
jr c, .asm_8abe2
ld de, SFX_WRONG
call WaitPlaySFX
call CloseSRAM
jr .asm_8abb9
.asm_8abdf
xor a
ld c, a
ret
.asm_8abe2
call PlayClickSFX
.asm_8abe5
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call OpenSRAMBank4
call Function8931b
call Function89844
call CloseSRAM
call OpenSRAMBank4
call Function8939a
call Function89856
hlcoord 1, 13
call Function899fe
call CloseSRAM
call Function891ab
.asm_8ac0f
call Function89a57
jr c, .asm_8ac0f
and a
jr z, .asm_8abe5
cp $2
jr z, .asm_8ac0f
hlcoord 0, 12
ld b, $4
ld c, $12
call TextBox
hlcoord 1, 14
ld de, String_8ac3b
call PlaceString
ld a, $1
call Function8925e
jp c, .asm_8abb3
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
ld c, a
ret
2018-06-24 07:09:41 -07:00
String_8ac3b:
db "こ<NO>ともだち<NI>でんわを"
next "かけますか?@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function8ac4e:
2015-10-16 10:35:43 -07:00
xor a
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
push de
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
pop bc
call Function89844
call Function8939a
call Function89856
hlcoord 1, 13
call Function899fe
call Function891ab
ret
2018-06-24 07:09:41 -07:00
Function8ac70:
2015-10-16 10:35:43 -07:00
push de
ld a, $3
call Function8b94a
2018-06-24 07:09:41 -07:00
Function8ac76:
2015-10-16 10:35:43 -07:00
call Function891fe
call Function8b677
2018-06-24 07:09:41 -07:00
Function8ac7c:
2015-10-16 10:35:43 -07:00
call Function8b7bd
jr z, .asm_8acf0
ld a, c
ld [wd02f], a
2018-01-23 14:39:09 -08:00
ld [wMenuSelection], a
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
call Function8931b
call Function8932d
call CloseSRAM
jr nc, .asm_8acb0
call OpenSRAMBank4
ld hl, $0011
add hl, bc
call Function89b45
call CloseSRAM
jr nc, .asm_8accc
call OpenSRAMBank4
call Function892b7
call CloseSRAM
jr .asm_8accc
.asm_8acb0
call Function8ad0b
jr c, Function8ac76
and a
jr nz, .asm_8accc
call OpenSRAMBank4
ld h, b
ld l, c
ld d, $0
ld e, $6
add hl, de
ld d, h
ld e, l
pop hl
ld c, $1f
call Function89193
jr .asm_8ace4
.asm_8accc
pop hl
call OpenSRAMBank4
ld d, b
ld e, c
ld c, $6
call Function89193
ld a, $6
add e
ld e, a
ld a, $0
adc d
ld d, a
ld c, $1f
call Function89193
.asm_8ace4
call CloseSRAM
2015-11-04 13:14:27 -08:00
call LoadStandardFont
2015-10-16 10:35:43 -07:00
ld a, [wd02f]
ld c, a
and a
ret
.asm_8acf0
ld hl, UnknownText_0x8ad06
call PrintText
ld a, $2
call Function89259
jp c, Function8ac7c
2015-11-04 13:14:27 -08:00
call LoadStandardFont
2015-10-16 10:35:43 -07:00
pop de
ld c, $0
scf
ret
UnknownText_0x8ad06:
2015-10-16 10:35:43 -07:00
; Finish registering CARDS?
text_jump UnknownText_0x1c554a
db "@"
2018-06-24 07:09:41 -07:00
Function8ad0b:
2015-10-16 10:35:43 -07:00
.asm_8ad0b
2018-01-23 14:39:09 -08:00
ld a, [wMenuSelection]
2015-10-16 10:35:43 -07:00
ld [wd02f], a
call Function891de
2015-11-11 20:38:57 -08:00
call ClearBGPalettes
2015-10-16 10:35:43 -07:00
call Function893cc
call OpenSRAMBank4
call Function8931b
push bc
call Function89844
call Function8939a
call Function89856
hlcoord 1, 13
call Function899fe
call CloseSRAM
call Function891ab
pop bc
.asm_8ad37
push bc
call Function89a57
pop bc
jr c, .asm_8ad37
and a
jr z, .asm_8ad0b
cp $2
jr z, .asm_8ad37
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
push bc
hlcoord 0, 12
ld b, $4
ld c, $12
call TextBox
ld de, String_8ad89
hlcoord 1, 14
call PlaceString
ld a, $2
call Function8925e
jr c, .asm_8ad87
2016-05-11 14:16:03 -07:00
call Mobile22_SetBGMapMode0
2015-10-16 10:35:43 -07:00
hlcoord 0, 12
ld b, $4
ld c, $12
call TextBox
ld de, String_8ad9c
hlcoord 1, 14
call PlaceString
ld a, $1
call Function8925e
jr c, .asm_8ad84
ld a, $0
jr .asm_8ad86
.asm_8ad84
ld a, $1
.asm_8ad86
and a
.asm_8ad87
pop bc
ret
2018-06-24 07:09:41 -07:00
String_8ad89:
db "こ<NO>めいし<WO>けして"
next "いれかえますか?@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
String_8ad9c:
db "おともだち<NO>なまえを"
next "のこして おきますか?@"
2015-10-16 10:35:43 -07:00
2018-06-24 07:09:41 -07:00
Function8adb3:
2015-10-16 10:35:43 -07:00
call Function891de
call Function8a262
push af
call Function891de
pop af
ret
2018-06-24 07:09:41 -07:00
Function8adbf:
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
ld hl, $a603
call Function89b45
call CloseSRAM
ret
2018-06-24 07:09:41 -07:00
Function8adcc:
2015-10-16 10:35:43 -07:00
call OpenSRAMBank4
call Function8b3b0
call CloseSRAM
ret nc
cp $2
ret z
scf
ret