2020-06-21 20:27:43 +00:00
|
|
|
Function88248: ; unreferenced
|
2017-12-16 01:10:54 +00:00
|
|
|
ld c, CAL
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .okay
|
|
|
|
ld c, KAREN
|
|
|
|
|
|
|
|
.okay
|
|
|
|
ld a, c
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wTrainerClass], a
|
2017-12-16 01:10:54 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
MovePlayerPicRight:
|
2017-12-16 01:10:54 +00:00
|
|
|
hlcoord 6, 4
|
|
|
|
ld de, 1
|
|
|
|
jr MovePlayerPic
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
MovePlayerPicLeft:
|
2017-12-16 01:10:54 +00:00
|
|
|
hlcoord 13, 4
|
|
|
|
ld de, -1
|
|
|
|
; fallthrough
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
MovePlayerPic:
|
2017-12-16 01:10:54 +00:00
|
|
|
; Move player pic at hl by de * 7 tiles.
|
|
|
|
ld c, $8
|
|
|
|
.loop
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapMode], a
|
2017-12-16 01:10:54 +00:00
|
|
|
lb bc, 7, 7
|
2018-01-16 19:30:10 +00:00
|
|
|
predef PlaceGraphic
|
2017-12-16 01:10:54 +00:00
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapThird], a
|
2017-12-16 01:10:54 +00:00
|
|
|
call WaitBGMap
|
|
|
|
call DelayFrame
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
add hl, de
|
|
|
|
pop bc
|
|
|
|
dec c
|
|
|
|
ret z
|
|
|
|
push hl
|
|
|
|
push bc
|
|
|
|
ld a, l
|
|
|
|
sub e
|
|
|
|
ld l, a
|
|
|
|
ld a, h
|
|
|
|
sbc d
|
|
|
|
ld h, a
|
|
|
|
lb bc, 7, 7
|
|
|
|
call ClearBox
|
|
|
|
pop bc
|
|
|
|
pop hl
|
|
|
|
jr .loop
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
ShowPlayerNamingChoices:
|
2018-01-23 21:08:43 +00:00
|
|
|
ld hl, ChrisNameMenuHeader
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .GotGender
|
2018-01-23 21:08:43 +00:00
|
|
|
ld hl, KrisNameMenuHeader
|
2017-12-16 01:10:54 +00:00
|
|
|
.GotGender:
|
2018-01-23 21:08:43 +00:00
|
|
|
call LoadMenuHeader
|
2017-12-16 01:10:54 +00:00
|
|
|
call VerticalMenu
|
|
|
|
ld a, [wMenuCursorY]
|
|
|
|
dec a
|
|
|
|
call CopyNameFromMenu
|
|
|
|
call CloseWindow
|
|
|
|
ret
|
|
|
|
|
2018-01-09 05:45:03 +00:00
|
|
|
INCLUDE "data/player_names.asm"
|
2017-12-16 01:10:54 +00:00
|
|
|
|
2020-06-21 20:27:43 +00:00
|
|
|
GetPlayerNameArray: ; unreferenced
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPlayerName
|
2017-12-16 01:10:54 +00:00
|
|
|
ld de, MalePlayerNameArray
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .done
|
|
|
|
ld de, FemalePlayerNameArray
|
|
|
|
|
|
|
|
.done
|
|
|
|
call InitName
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
GetPlayerIcon:
|
2017-12-16 01:10:54 +00:00
|
|
|
; Get the player icon corresponding to gender
|
|
|
|
|
|
|
|
; Male
|
|
|
|
ld de, ChrisSpriteGFX
|
|
|
|
ld b, BANK(ChrisSpriteGFX)
|
|
|
|
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .done
|
|
|
|
|
|
|
|
; Female
|
|
|
|
ld de, KrisSpriteGFX
|
|
|
|
ld b, BANK(KrisSpriteGFX)
|
|
|
|
|
|
|
|
.done
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
GetCardPic:
|
2017-12-16 01:10:54 +00:00
|
|
|
ld hl, ChrisCardPic
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .GotClass
|
|
|
|
ld hl, KrisCardPic
|
|
|
|
.GotClass:
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles2 tile $00
|
2017-12-16 01:10:54 +00:00
|
|
|
ld bc, $23 tiles
|
2019-01-12 20:17:20 +00:00
|
|
|
ld a, BANK(ChrisCardPic) ; aka BANK(KrisCardPic)
|
2017-12-16 01:10:54 +00:00
|
|
|
call FarCopyBytes
|
2020-10-26 19:45:57 +00:00
|
|
|
ld hl, TrainerCardGFX
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles2 tile $23
|
2017-12-16 01:10:54 +00:00
|
|
|
ld bc, 6 tiles
|
2020-10-26 19:45:57 +00:00
|
|
|
ld a, BANK(TrainerCardGFX)
|
2017-12-16 01:10:54 +00:00
|
|
|
call FarCopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
ChrisCardPic:
|
2017-12-16 01:10:54 +00:00
|
|
|
INCBIN "gfx/trainer_card/chris_card.2bpp"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
KrisCardPic:
|
2017-12-16 01:10:54 +00:00
|
|
|
INCBIN "gfx/trainer_card/kris_card.2bpp"
|
|
|
|
|
2020-10-26 19:45:57 +00:00
|
|
|
TrainerCardGFX:
|
2017-12-16 01:10:54 +00:00
|
|
|
INCBIN "gfx/trainer_card/trainer_card.2bpp"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
GetPlayerBackpic:
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, GetChrisBackpic
|
|
|
|
call GetKrisBackpic
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
GetChrisBackpic:
|
2017-12-16 01:10:54 +00:00
|
|
|
ld hl, ChrisBackpic
|
|
|
|
ld b, BANK(ChrisBackpic)
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles2 tile $31
|
2017-12-16 01:10:54 +00:00
|
|
|
ld c, 7 * 7
|
2018-01-16 19:30:10 +00:00
|
|
|
predef DecompressGet2bpp
|
2017-12-16 01:10:54 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
HOF_LoadTrainerFrontpic:
|
2017-12-16 01:10:54 +00:00
|
|
|
call WaitBGMap
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapMode], a
|
2017-12-16 01:10:54 +00:00
|
|
|
ld e, 0
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .GotClass
|
|
|
|
ld e, 1
|
|
|
|
|
|
|
|
.GotClass:
|
|
|
|
ld a, e
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wTrainerClass], a
|
2017-12-16 01:10:54 +00:00
|
|
|
ld de, ChrisPic
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .GotPic
|
|
|
|
ld de, KrisPic
|
|
|
|
|
|
|
|
.GotPic:
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles2
|
2019-01-12 20:17:20 +00:00
|
|
|
ld b, BANK(ChrisPic) ; aka BANK(KrisPic)
|
2017-12-16 01:10:54 +00:00
|
|
|
ld c, 7 * 7
|
|
|
|
call Get2bpp
|
|
|
|
call WaitBGMap
|
|
|
|
ld a, $1
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapMode], a
|
2017-12-16 01:10:54 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
DrawIntroPlayerPic:
|
2017-12-16 01:10:54 +00:00
|
|
|
; Draw the player pic at (6,4).
|
|
|
|
|
|
|
|
; Get class
|
|
|
|
ld e, CHRIS
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .GotClass
|
|
|
|
ld e, KRIS
|
|
|
|
.GotClass:
|
|
|
|
ld a, e
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wTrainerClass], a
|
2017-12-16 01:10:54 +00:00
|
|
|
|
|
|
|
; Load pic
|
|
|
|
ld de, ChrisPic
|
2017-12-28 12:15:46 +00:00
|
|
|
ld a, [wPlayerGender]
|
2018-01-22 19:34:55 +00:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2017-12-16 01:10:54 +00:00
|
|
|
jr z, .GotPic
|
|
|
|
ld de, KrisPic
|
|
|
|
.GotPic:
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles2
|
2019-01-12 20:17:20 +00:00
|
|
|
ld b, BANK(ChrisPic) ; aka BANK(KrisPic)
|
2017-12-16 01:10:54 +00:00
|
|
|
ld c, 7 * 7 ; dimensions
|
|
|
|
call Get2bpp
|
|
|
|
|
|
|
|
; Draw
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hGraphicStartTile], a
|
2017-12-16 01:10:54 +00:00
|
|
|
hlcoord 6, 4
|
|
|
|
lb bc, 7, 7
|
2018-01-16 19:30:10 +00:00
|
|
|
predef PlaceGraphic
|
2017-12-16 01:10:54 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
ChrisPic:
|
2017-12-16 01:10:54 +00:00
|
|
|
INCBIN "gfx/player/chris.2bpp"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
KrisPic:
|
2017-12-16 01:10:54 +00:00
|
|
|
INCBIN "gfx/player/kris.2bpp"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
GetKrisBackpic:
|
2017-12-16 01:10:54 +00:00
|
|
|
; Kris's backpic is uncompressed.
|
|
|
|
ld de, KrisBackpic
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles2 tile $31
|
2017-12-16 01:10:54 +00:00
|
|
|
lb bc, BANK(KrisBackpic), 7 * 7 ; dimensions
|
|
|
|
call Get2bpp
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
KrisBackpic:
|
2017-12-16 01:10:54 +00:00
|
|
|
INCBIN "gfx/player/kris_back.2bpp"
|