2020-06-21 20:27:43 +00:00
|
|
|
Function16c000: ; unreferenced
|
2016-05-05 19:07:37 +00:00
|
|
|
; Only for CGB
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hCGB]
|
2015-11-04 12:35:41 +00:00
|
|
|
and a
|
|
|
|
ret z
|
2016-05-05 19:07:37 +00:00
|
|
|
; Only do this once per boot cycle
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSystemBooted]
|
2015-11-04 12:35:41 +00:00
|
|
|
and a
|
|
|
|
ret z
|
2020-10-28 17:35:39 +00:00
|
|
|
; Disable the joypad during mobile setup
|
|
|
|
ld a, [wJoypadDisable]
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
2020-10-28 17:35:39 +00:00
|
|
|
set JOYPAD_DISABLE_SGB_TRANSFER_F, a
|
|
|
|
ld [wJoypadDisable], a
|
2016-05-05 19:07:37 +00:00
|
|
|
; Do stuff
|
|
|
|
call MobileSystemSplashScreen_InitGFX ; Load GFX
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall SetRAMStateForMobile
|
|
|
|
farcall EnableMobile
|
2016-05-05 19:07:37 +00:00
|
|
|
call .RunJumptable
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall DisableMobile
|
2016-05-05 19:07:37 +00:00
|
|
|
; Prevent this routine from running again
|
2018-01-19 19:49:43 +00:00
|
|
|
; until the next time the system is turned on
|
2015-11-04 12:35:41 +00:00
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSystemBooted], a
|
2016-05-05 19:07:37 +00:00
|
|
|
; Restore the flag state
|
2015-11-04 12:35:41 +00:00
|
|
|
pop af
|
2020-10-28 17:35:39 +00:00
|
|
|
ld [wJoypadDisable], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.RunJumptable:
|
2015-11-04 12:35:41 +00:00
|
|
|
xor a
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ld [wcf64], a
|
2015-11-11 00:51:13 +00:00
|
|
|
ld [wd002], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld [wd003], a
|
2016-05-05 19:07:37 +00:00
|
|
|
.loop
|
2015-11-04 12:35:41 +00:00
|
|
|
call DelayFrame
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall Function10635c
|
2015-11-11 00:51:13 +00:00
|
|
|
ld a, [wd002]
|
2016-05-05 19:07:37 +00:00
|
|
|
ld hl, .Jumptable
|
2015-11-04 12:35:41 +00:00
|
|
|
rst JumpTable
|
|
|
|
call Function16cb2e
|
|
|
|
call Function16cbae
|
2015-11-11 00:51:13 +00:00
|
|
|
ld a, [wd002]
|
2015-11-04 12:35:41 +00:00
|
|
|
cp $ff
|
2016-05-05 19:07:37 +00:00
|
|
|
jr nz, .loop
|
2015-11-04 12:35:41 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.Jumptable:
|
2016-05-05 19:07:37 +00:00
|
|
|
dw .init
|
2015-11-04 12:35:41 +00:00
|
|
|
dw Function16c0ba
|
|
|
|
dw Function16c089
|
|
|
|
dw Function16c09e
|
|
|
|
dw Function16c0a8
|
|
|
|
dw Function16c0dc
|
|
|
|
dw Function16c0ec
|
|
|
|
dw Function16c0ba
|
|
|
|
dw Function16c0ca
|
|
|
|
dw Function16c0dc
|
|
|
|
dw Function16c0ec
|
2016-05-05 19:07:37 +00:00
|
|
|
dw .quit
|
2015-11-04 12:35:41 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.init
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wcf64]
|
|
|
|
and a
|
|
|
|
ret z
|
2015-11-11 00:51:13 +00:00
|
|
|
ld [wd002], a
|
2015-11-04 12:35:41 +00:00
|
|
|
xor a
|
|
|
|
ld [wd003], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.quit
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
|
|
|
ld a, $ff
|
2015-11-11 00:51:13 +00:00
|
|
|
ld [wd002], a
|
2015-11-04 12:35:41 +00:00
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c089:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, $1
|
2020-11-04 04:25:22 +00:00
|
|
|
ld [wd1eb], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld [wd1f1], a
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16c0fa
|
2015-11-11 00:51:13 +00:00
|
|
|
ld a, [wd002]
|
2015-11-04 12:35:41 +00:00
|
|
|
ld [wcf64], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c09e:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wcf64]
|
|
|
|
cp $4
|
|
|
|
ret nz
|
|
|
|
call Function16c0fa
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c0a8:
|
2015-11-04 12:35:41 +00:00
|
|
|
xor a
|
2020-11-04 04:25:22 +00:00
|
|
|
ld [wd1eb], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld [wd1f1], a
|
|
|
|
call ClearSprites
|
|
|
|
ld a, $90
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16c0fa
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c0ba:
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16c943
|
|
|
|
push af
|
|
|
|
ld a, [wd003]
|
|
|
|
inc a
|
|
|
|
ld [wd003], a
|
|
|
|
pop af
|
|
|
|
call c, Function16c0fa
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c0ca:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wd003]
|
|
|
|
cp $28
|
|
|
|
push af
|
|
|
|
ld a, [wd003]
|
|
|
|
inc a
|
|
|
|
ld [wd003], a
|
|
|
|
pop af
|
|
|
|
call z, Function16c0fa
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c0dc:
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16ca11
|
|
|
|
push af
|
|
|
|
ld a, [wd003]
|
|
|
|
inc a
|
|
|
|
ld [wd003], a
|
|
|
|
pop af
|
|
|
|
call c, Function16c0fa
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c0ec:
|
2015-11-12 04:38:57 +00:00
|
|
|
call ClearBGPalettes
|
2015-11-04 12:35:41 +00:00
|
|
|
call ClearScreen
|
|
|
|
push af
|
|
|
|
ld a, $ff
|
2015-11-11 00:51:13 +00:00
|
|
|
ld [wd002], a
|
2015-11-04 12:35:41 +00:00
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c0fa:
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
2015-11-11 00:51:13 +00:00
|
|
|
ld a, [wd002]
|
2015-11-04 12:35:41 +00:00
|
|
|
inc a
|
2015-11-11 00:51:13 +00:00
|
|
|
ld [wd002], a
|
2015-11-04 12:35:41 +00:00
|
|
|
xor a
|
|
|
|
ld [wd003], a
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
MobileSystemSplashScreen_InitGFX:
|
2015-11-04 12:35:41 +00:00
|
|
|
call DisableLCD
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles2
|
2016-05-05 19:07:37 +00:00
|
|
|
ld de, .Tiles
|
2018-01-15 00:43:35 +00:00
|
|
|
lb bc, BANK(.Tiles), 104
|
2015-11-04 12:35:41 +00:00
|
|
|
call Get2bpp
|
2016-05-05 19:07:37 +00:00
|
|
|
call .LoadPals
|
2020-02-13 17:30:13 +00:00
|
|
|
call .LoadTilemap
|
|
|
|
call .LoadAttrmap
|
2015-11-20 16:47:52 +00:00
|
|
|
hlbgcoord 0, 0
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cc73
|
|
|
|
call Function16cc02
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapMode], a
|
2015-11-04 12:35:41 +00:00
|
|
|
call EnableLCD
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.LoadPals:
|
2018-01-01 14:08:21 +00:00
|
|
|
ld de, wBGPals1
|
2020-02-27 19:33:30 +00:00
|
|
|
ld hl, MobileSplashScreenPalettes
|
2015-11-04 12:35:41 +00:00
|
|
|
ld bc, 8
|
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ApplyPals
|
2015-11-04 12:35:41 +00:00
|
|
|
ret
|
|
|
|
|
2020-02-13 17:30:13 +00:00
|
|
|
.LoadTilemap:
|
2015-11-04 12:35:41 +00:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, 20
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
2020-02-13 17:30:13 +00:00
|
|
|
ld hl, .Tilemap
|
2015-11-04 12:35:41 +00:00
|
|
|
decoord 0, 1
|
|
|
|
ld bc, $0154
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2020-02-13 17:30:13 +00:00
|
|
|
.LoadAttrmap:
|
|
|
|
hlcoord 0, 0, wAttrmap
|
2015-11-04 12:35:41 +00:00
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
2020-02-13 17:30:13 +00:00
|
|
|
ld hl, .Attrmap
|
|
|
|
decoord 0, 1, wAttrmap
|
2015-11-04 12:35:41 +00:00
|
|
|
ld bc, 17 * SCREEN_WIDTH
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2016-05-05 19:07:37 +00:00
|
|
|
.Tiles:
|
2017-12-15 22:50:45 +00:00
|
|
|
INCBIN "gfx/mobile/mobile_splash.2bpp"
|
2015-11-04 12:35:41 +00:00
|
|
|
|
2020-02-13 17:30:13 +00:00
|
|
|
.Tilemap:
|
2017-12-15 22:50:45 +00:00
|
|
|
INCBIN "gfx/mobile/mobile_splash.tilemap"
|
2015-11-04 12:35:41 +00:00
|
|
|
|
2020-02-13 17:30:13 +00:00
|
|
|
.Attrmap:
|
2017-12-15 22:50:45 +00:00
|
|
|
INCBIN "gfx/mobile/mobile_splash.attrmap"
|
2015-11-04 12:35:41 +00:00
|
|
|
|
2020-02-27 19:33:30 +00:00
|
|
|
MobileSplashScreenPalettes:
|
|
|
|
INCLUDE "gfx/mobile/mobile_splash.pal"
|
2015-11-04 12:35:41 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16c943:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wd003]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_16c95e
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [rSVBK]
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
|
|
|
ld a, $5
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, $ff
|
2018-01-01 13:47:16 +00:00
|
|
|
ld bc, 1 palettes
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call ByteFill
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
|
|
|
|
.asm_16c95e
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [rSVBK]
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
|
|
|
ld a, $5
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld e, $0
|
|
|
|
ld a, $0
|
|
|
|
.asm_16c969
|
2020-02-27 19:33:30 +00:00
|
|
|
ld hl, MobileSplashScreenPalettes
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cabb
|
|
|
|
ld d, a
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cabb
|
|
|
|
cp d
|
|
|
|
jr z, .asm_16c991
|
|
|
|
ld b, $1
|
|
|
|
.asm_16c981
|
|
|
|
dec a
|
|
|
|
cp d
|
|
|
|
jr z, .asm_16c988
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_16c981
|
|
|
|
|
|
|
|
.asm_16c988
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cadc
|
|
|
|
|
|
|
|
.asm_16c991
|
2020-02-27 19:33:30 +00:00
|
|
|
ld hl, MobileSplashScreenPalettes
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cad8
|
|
|
|
ld d, a
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cad8
|
|
|
|
cp d
|
|
|
|
jr z, .asm_16c9b9
|
|
|
|
ld b, $1
|
|
|
|
.asm_16c9a9
|
|
|
|
dec a
|
|
|
|
cp d
|
|
|
|
jr z, .asm_16c9b0
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_16c9a9
|
|
|
|
|
|
|
|
.asm_16c9b0
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cb08
|
|
|
|
|
|
|
|
.asm_16c9b9
|
2020-02-27 19:33:30 +00:00
|
|
|
ld hl, MobileSplashScreenPalettes
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cac4
|
|
|
|
ld d, a
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cac4
|
|
|
|
cp d
|
|
|
|
jr z, .asm_16c9e1
|
|
|
|
ld b, $1
|
|
|
|
.asm_16c9d1
|
|
|
|
dec a
|
|
|
|
cp d
|
|
|
|
jr z, .asm_16c9d8
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_16c9d1
|
|
|
|
|
|
|
|
.asm_16c9d8
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cae8
|
|
|
|
|
|
|
|
.asm_16c9e1
|
|
|
|
inc e
|
2016-05-04 15:46:23 +00:00
|
|
|
inc e
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, e
|
|
|
|
cp $8
|
|
|
|
jr nz, .asm_16c969
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ApplyPals
|
2015-11-04 12:35:41 +00:00
|
|
|
call SetPalettes
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [rSVBK]
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wd003]
|
|
|
|
cp $1f
|
|
|
|
jr z, .asm_16ca09
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld e, $0
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_16ca09
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16ca11:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wd003]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_16ca1d
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ApplyPals
|
2015-11-04 12:35:41 +00:00
|
|
|
|
|
|
|
.asm_16ca1d
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [rSVBK]
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
|
|
|
ld a, $5
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld e, $0
|
|
|
|
ld a, $0
|
|
|
|
.asm_16ca28
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cabb
|
|
|
|
cp $1f
|
|
|
|
jr z, .asm_16ca48
|
|
|
|
ld b, $1
|
|
|
|
.asm_16ca37
|
|
|
|
inc a
|
|
|
|
cp $1f
|
|
|
|
jr z, .asm_16ca3f
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_16ca37
|
|
|
|
|
|
|
|
.asm_16ca3f
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cadc
|
|
|
|
|
|
|
|
.asm_16ca48
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cad8
|
|
|
|
cp $1f
|
|
|
|
jr z, .asm_16ca68
|
|
|
|
ld b, $1
|
|
|
|
.asm_16ca57
|
|
|
|
inc a
|
|
|
|
cp $1f
|
|
|
|
jr z, .asm_16ca5f
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_16ca57
|
|
|
|
|
|
|
|
.asm_16ca5f
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cb08
|
|
|
|
|
|
|
|
.asm_16ca68
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cac4
|
|
|
|
cp $1f
|
|
|
|
jr z, .asm_16ca88
|
|
|
|
ld b, $1
|
|
|
|
.asm_16ca77
|
|
|
|
inc a
|
|
|
|
cp $1f
|
|
|
|
jr z, .asm_16ca7f
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_16ca77
|
|
|
|
|
|
|
|
.asm_16ca7f
|
2018-01-01 14:08:21 +00:00
|
|
|
ld hl, wBGPals1
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cab6
|
|
|
|
call Function16cae8
|
|
|
|
|
|
|
|
.asm_16ca88
|
|
|
|
inc e
|
2016-05-04 15:46:23 +00:00
|
|
|
inc e
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, e
|
|
|
|
cp $8
|
|
|
|
jr nz, .asm_16ca28
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ApplyPals
|
2015-11-04 12:35:41 +00:00
|
|
|
call SetPalettes
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [rSVBK]
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wd003]
|
|
|
|
cp $1f
|
|
|
|
jr z, .asm_16caae
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_16caae
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rSVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cab6:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld b, $0
|
|
|
|
ld c, e
|
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cabb:
|
2015-11-04 12:35:41 +00:00
|
|
|
inc hl
|
|
|
|
ld a, [hl]
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
and $1f
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cac4:
|
2015-11-04 12:35:41 +00:00
|
|
|
inc hl
|
|
|
|
ld a, [hld]
|
|
|
|
and $3
|
|
|
|
ld b, a
|
|
|
|
ld a, [hl]
|
|
|
|
sla a
|
|
|
|
rl b
|
|
|
|
sla a
|
|
|
|
rl b
|
|
|
|
sla a
|
|
|
|
rl b
|
|
|
|
ld a, b
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cad8:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and $1f
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cadc:
|
2015-11-04 12:35:41 +00:00
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
ld b, a
|
|
|
|
inc hl
|
|
|
|
ld a, [hl]
|
|
|
|
and $83
|
|
|
|
or b
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cae8:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld c, a
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
srl a
|
|
|
|
ld b, a
|
|
|
|
inc hl
|
|
|
|
ld a, [hl]
|
|
|
|
and $fc
|
|
|
|
or b
|
|
|
|
ld [hld], a
|
|
|
|
ld a, c
|
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
ld b, a
|
|
|
|
ld a, [hl]
|
|
|
|
and $1f
|
|
|
|
or b
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cb08:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld b, a
|
|
|
|
ld a, [hl]
|
|
|
|
and $e0
|
|
|
|
or b
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cb0f:
|
2015-11-04 12:35:41 +00:00
|
|
|
xor a
|
2020-11-04 04:25:22 +00:00
|
|
|
ld [wd1ea], a
|
|
|
|
ld [wd1eb], a
|
2015-11-04 12:35:41 +00:00
|
|
|
xor a
|
|
|
|
ld [wd1ec], a
|
|
|
|
ld a, $70
|
|
|
|
ld [wd1ee], a
|
|
|
|
ld a, $4
|
|
|
|
ld [wd1ed], a
|
|
|
|
ld a, $a0
|
|
|
|
ld [wd1ef], a
|
|
|
|
xor a
|
|
|
|
ld [wd1f0], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cb2e:
|
2020-11-04 04:25:22 +00:00
|
|
|
ld a, [wd1eb]
|
2015-11-04 12:35:41 +00:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
call Function16cb40
|
|
|
|
ld hl, Unknown_16cb86
|
2018-01-23 21:45:34 +00:00
|
|
|
ld de, wVirtualOAM
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cb5d
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cb40:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld hl, wd1ec
|
|
|
|
inc [hl]
|
|
|
|
ld a, [hl]
|
|
|
|
cp $18
|
|
|
|
ret c
|
|
|
|
xor a
|
|
|
|
ld [hl], a
|
|
|
|
ld a, [wd1ef]
|
|
|
|
cp $a0
|
|
|
|
jr nz, .asm_16cb57
|
|
|
|
ld a, $a7
|
|
|
|
ld [wd1ef], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_16cb57
|
|
|
|
ld a, $a0
|
|
|
|
ld [wd1ef], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cb5d:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [hli]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
.asm_16cb60
|
|
|
|
push af
|
|
|
|
ld a, [wd1ee]
|
|
|
|
add [hl]
|
|
|
|
add $10
|
|
|
|
ld [de], a
|
|
|
|
inc hl
|
|
|
|
inc de
|
|
|
|
ld a, [wd1ed]
|
|
|
|
add [hl]
|
|
|
|
add $8
|
|
|
|
ld [de], a
|
|
|
|
inc hl
|
|
|
|
inc de
|
|
|
|
ld a, [wd1ef]
|
|
|
|
add [hl]
|
|
|
|
ld [de], a
|
|
|
|
inc hl
|
|
|
|
inc de
|
|
|
|
ld a, [wd1f0]
|
|
|
|
or [hl]
|
|
|
|
ld [de], a
|
|
|
|
inc hl
|
|
|
|
inc de
|
|
|
|
pop af
|
|
|
|
dec a
|
|
|
|
jr nz, .asm_16cb60
|
|
|
|
ret
|
|
|
|
|
|
|
|
Unknown_16cb86:
|
|
|
|
db 7
|
|
|
|
db 0, 0, 0, 1
|
|
|
|
db 8, 0, 1, 1
|
|
|
|
db 8, 8, 2, 0
|
|
|
|
db 8, 16, 3, 0
|
|
|
|
db 16, 0, 4, 1
|
|
|
|
db 16, 8, 5, 0
|
|
|
|
db 16, 16, 6, 0
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cba3:
|
2015-11-04 12:35:41 +00:00
|
|
|
xor a
|
|
|
|
ld [wd1f1], a
|
|
|
|
ld [wd1f2], a
|
|
|
|
ld [wd1f3], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cbae:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wd1f1]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
call Function16cbba
|
|
|
|
call Function16cbd1
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cbba:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld hl, wd1f2
|
|
|
|
inc [hl]
|
|
|
|
ld a, [hl]
|
|
|
|
cp $c
|
|
|
|
ret c
|
|
|
|
xor a
|
|
|
|
ld [hl], a
|
|
|
|
ld a, [wd1f3]
|
|
|
|
inc a
|
|
|
|
cp $4
|
|
|
|
jr c, .asm_16cbcd
|
|
|
|
xor a
|
|
|
|
|
|
|
|
.asm_16cbcd
|
|
|
|
ld [wd1f3], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cbd1:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, [wd1f3]
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
ld hl, Unknown_16cbfb
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-12-19 01:07:09 +00:00
|
|
|
ld bc, 2
|
2015-11-04 12:35:41 +00:00
|
|
|
ld hl, Unknown_16cfa3
|
|
|
|
call AddNTimes
|
2018-01-23 00:40:17 +00:00
|
|
|
ld de, wBGPals1 palette 1 color 2
|
|
|
|
ld bc, PAL_COLOR_SIZE
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ApplyPals
|
2020-08-03 21:41:01 +00:00
|
|
|
ld a, TRUE
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hCGBPalUpdate], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Unknown_16cbfb:
|
|
|
|
db 0, 1, 2, 1, 0, 1, 2
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cc02:
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cc18
|
|
|
|
call Function16cc49
|
|
|
|
call Function16cc62
|
|
|
|
call Function16cc25
|
|
|
|
call Function16cc6e
|
|
|
|
call Function16cb0f
|
|
|
|
call Function16cba3
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cc18:
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles1
|
2020-02-27 19:33:30 +00:00
|
|
|
ld de, MobileAdapterCheckGFX
|
|
|
|
lb bc, BANK(MobileAdapterCheckGFX), 46
|
2015-11-04 12:35:41 +00:00
|
|
|
call Get2bpp
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cc25:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld hl, Unknown_16cfa9
|
2018-01-01 14:08:21 +00:00
|
|
|
ld de, wBGPals1 + 1 palettes
|
2015-12-19 01:07:09 +00:00
|
|
|
call .CopyPal
|
2015-11-04 12:35:41 +00:00
|
|
|
ld hl, Unknown_16cfb1
|
2018-01-01 14:08:21 +00:00
|
|
|
ld de, wOBPals1
|
2015-12-19 01:07:09 +00:00
|
|
|
call .CopyPal
|
2015-11-04 12:35:41 +00:00
|
|
|
ld hl, Unknown_16cfb9
|
2018-01-01 14:08:21 +00:00
|
|
|
ld de, wOBPals1 + 1 palettes
|
2015-12-19 01:07:09 +00:00
|
|
|
call .CopyPal
|
2015-11-04 12:35:41 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.CopyPal:
|
2015-12-19 01:07:09 +00:00
|
|
|
ld bc, 1 palettes
|
2015-11-04 12:35:41 +00:00
|
|
|
ld a, $5
|
|
|
|
jp FarCopyWRAM
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cc49:
|
2015-11-04 12:35:41 +00:00
|
|
|
hlcoord 4, 15
|
|
|
|
ld a, $80
|
|
|
|
call Function16cc5a
|
|
|
|
hlcoord 4, 16
|
|
|
|
ld a, $90
|
|
|
|
call Function16cc5a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cc5a:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld c, $10
|
|
|
|
.asm_16cc5c
|
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_16cc5c
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cc62:
|
2020-02-13 17:30:13 +00:00
|
|
|
hlcoord 0, 15, wAttrmap
|
2015-11-04 12:35:41 +00:00
|
|
|
ld bc, $0028
|
|
|
|
ld a, $1
|
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cc6e:
|
2017-12-28 12:32:33 +00:00
|
|
|
hlbgcoord 0, 0, vBGMap1
|
2015-11-04 12:35:41 +00:00
|
|
|
jr Function16cc73
|
|
|
|
|
|
|
|
Function16cc73:
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [rVBK]
|
2015-11-04 12:35:41 +00:00
|
|
|
push af
|
|
|
|
ld a, $0
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
push hl
|
|
|
|
decoord 0, 0
|
|
|
|
call Function16cc90
|
|
|
|
pop hl
|
|
|
|
ld a, $1
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rVBK], a
|
2020-02-13 17:30:13 +00:00
|
|
|
decoord 0, 0, wAttrmap
|
2015-11-04 12:35:41 +00:00
|
|
|
call Function16cc90
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rVBK], a
|
2015-11-04 12:35:41 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function16cc90:
|
2015-11-04 12:35:41 +00:00
|
|
|
ld bc, $1214
|
|
|
|
.asm_16cc93
|
|
|
|
push bc
|
|
|
|
.asm_16cc94
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_16cc94
|
|
|
|
ld bc, $000c
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_16cc93
|
|
|
|
ret
|
|
|
|
|
2020-02-27 19:33:30 +00:00
|
|
|
MobileAdapterCheckGFX:
|
|
|
|
INCBIN "gfx/mobile/mobile_splash_check.2bpp"
|
2015-11-04 12:35:41 +00:00
|
|
|
|
|
|
|
Unknown_16cfa3:
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 25, 27, 29
|
|
|
|
RGB 16, 19, 25
|
|
|
|
|
|
|
|
Unknown_16cfa9:
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 25, 27, 29
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
Unknown_16cfb1:
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 13, 09, 18
|
|
|
|
RGB 26, 21, 16
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
Unknown_16cfb9:
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 18, 05, 02
|
|
|
|
RGB 27, 11, 12
|
|
|
|
RGB 07, 07, 07
|