2018-06-24 07:09:41 -07:00
|
|
|
MovePlayerPicRight:
|
2017-12-15 17:10:54 -08:00
|
|
|
hlcoord 6, 4
|
|
|
|
ld de, 1
|
|
|
|
jr MovePlayerPic
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MovePlayerPicLeft:
|
2017-12-15 17:10:54 -08:00
|
|
|
hlcoord 13, 4
|
|
|
|
ld de, -1
|
|
|
|
; fallthrough
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
MovePlayerPic:
|
2017-12-15 17:10:54 -08: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 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2017-12-15 17:10:54 -08:00
|
|
|
lb bc, 7, 7
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PlaceGraphic
|
2017-12-15 17:10:54 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapThird], a
|
2017-12-15 17:10:54 -08: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 07:09:41 -07:00
|
|
|
ShowPlayerNamingChoices:
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, ChrisNameMenuHeader
|
2024-03-09 07:40:21 -08:00
|
|
|
ld a, [wPlayerCharacter]
|
2018-01-22 11:34:55 -08:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2020-11-01 09:36:38 -08:00
|
|
|
jr z, .got_header
|
2018-01-23 13:08:43 -08:00
|
|
|
ld hl, KrisNameMenuHeader
|
2020-11-01 09:36:38 -08:00
|
|
|
.got_header
|
2018-01-23 13:08:43 -08:00
|
|
|
call LoadMenuHeader
|
2017-12-15 17:10:54 -08:00
|
|
|
call VerticalMenu
|
|
|
|
ld a, [wMenuCursorY]
|
|
|
|
dec a
|
|
|
|
call CopyNameFromMenu
|
|
|
|
call CloseWindow
|
|
|
|
ret
|
|
|
|
|
2024-03-08 09:56:26 -08:00
|
|
|
INCLUDE "data/players/names.asm"
|
2017-12-15 17:10:54 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetPlayerIcon:
|
2024-03-09 07:40:21 -08:00
|
|
|
ld a, [wPlayerCharacter]
|
|
|
|
ld e, PLAYERDATA_DEFAULT_SPRITE
|
|
|
|
call GetPlayerField
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2017-12-15 17:10:54 -08:00
|
|
|
ld b, BANK(ChrisSpriteGFX)
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetCardPic:
|
2017-12-15 17:10:54 -08:00
|
|
|
ld hl, ChrisCardPic
|
2024-03-09 07:40:21 -08:00
|
|
|
ld a, [wPlayerCharacter]
|
2018-01-22 11:34:55 -08:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2020-11-01 09:36:38 -08:00
|
|
|
jr z, .got_pic
|
2017-12-15 17:10:54 -08:00
|
|
|
ld hl, KrisCardPic
|
2020-11-01 09:36:38 -08:00
|
|
|
.got_pic
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2 tile $00
|
2017-12-15 17:10:54 -08:00
|
|
|
ld bc, $23 tiles
|
2019-01-12 12:17:20 -08:00
|
|
|
ld a, BANK(ChrisCardPic) ; aka BANK(KrisCardPic)
|
2017-12-15 17:10:54 -08:00
|
|
|
call FarCopyBytes
|
2020-10-26 12:45:57 -07:00
|
|
|
ld hl, TrainerCardGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2 tile $23
|
2017-12-15 17:10:54 -08:00
|
|
|
ld bc, 6 tiles
|
2020-10-26 12:45:57 -07:00
|
|
|
ld a, BANK(TrainerCardGFX)
|
2017-12-15 17:10:54 -08:00
|
|
|
call FarCopyBytes
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
ChrisCardPic:
|
2017-12-15 17:10:54 -08:00
|
|
|
INCBIN "gfx/trainer_card/chris_card.2bpp"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
KrisCardPic:
|
2017-12-15 17:10:54 -08:00
|
|
|
INCBIN "gfx/trainer_card/kris_card.2bpp"
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
TrainerCardGFX:
|
2017-12-15 17:10:54 -08:00
|
|
|
INCBIN "gfx/trainer_card/trainer_card.2bpp"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
GetPlayerBackpic:
|
2024-03-09 07:40:21 -08:00
|
|
|
ld a, [wPlayerCharacter]
|
2024-03-08 09:56:26 -08:00
|
|
|
ld e, PLAYERDATA_BACKPIC
|
|
|
|
call GetPlayerField
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2 tile $31
|
2017-12-15 17:10:54 -08:00
|
|
|
ld c, 7 * 7
|
2024-03-08 09:56:26 -08:00
|
|
|
ld b, BANK(ChrisBackpic)
|
2018-01-16 11:30:10 -08:00
|
|
|
predef DecompressGet2bpp
|
2017-12-15 17:10:54 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
HOF_LoadTrainerFrontpic:
|
2017-12-15 17:10:54 -08:00
|
|
|
call WaitBGMap
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2020-11-01 09:36:38 -08:00
|
|
|
|
|
|
|
; Get class
|
|
|
|
ld e, CHRIS
|
2024-03-09 07:40:21 -08:00
|
|
|
ld a, [wPlayerCharacter]
|
2018-01-22 11:34:55 -08:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2020-11-01 09:36:38 -08:00
|
|
|
jr z, .got_class
|
|
|
|
ld e, KRIS
|
|
|
|
.got_class
|
2017-12-15 17:10:54 -08:00
|
|
|
ld a, e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTrainerClass], a
|
2020-11-01 09:36:38 -08:00
|
|
|
|
|
|
|
; Load pic
|
2017-12-15 17:10:54 -08:00
|
|
|
ld de, ChrisPic
|
2024-03-09 07:40:21 -08:00
|
|
|
ld a, [wPlayerCharacter]
|
2018-01-22 11:34:55 -08:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2020-11-01 09:36:38 -08:00
|
|
|
jr z, .got_pic
|
2017-12-15 17:10:54 -08:00
|
|
|
ld de, KrisPic
|
2020-11-01 09:36:38 -08:00
|
|
|
.got_pic
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles2
|
2019-01-12 12:17:20 -08:00
|
|
|
ld b, BANK(ChrisPic) ; aka BANK(KrisPic)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld c, 7 * 7
|
|
|
|
call Get2bpp
|
2020-11-01 09:36:38 -08:00
|
|
|
|
2017-12-15 17:10:54 -08:00
|
|
|
call WaitBGMap
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2017-12-15 17:10:54 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
DrawIntroPlayerPic:
|
2017-12-15 17:10:54 -08:00
|
|
|
; Draw the player pic at (6,4).
|
|
|
|
|
|
|
|
; Get class
|
|
|
|
ld e, CHRIS
|
2024-03-09 07:40:21 -08:00
|
|
|
ld a, [wPlayerCharacter]
|
2018-01-22 11:34:55 -08:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2020-11-01 09:36:38 -08:00
|
|
|
jr z, .got_class
|
2017-12-15 17:10:54 -08:00
|
|
|
ld e, KRIS
|
2020-11-01 09:36:38 -08:00
|
|
|
.got_class
|
2017-12-15 17:10:54 -08:00
|
|
|
ld a, e
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTrainerClass], a
|
2017-12-15 17:10:54 -08:00
|
|
|
|
|
|
|
; Load pic
|
|
|
|
ld de, ChrisPic
|
2024-03-09 07:40:21 -08:00
|
|
|
ld a, [wPlayerCharacter]
|
2018-01-22 11:34:55 -08:00
|
|
|
bit PLAYERGENDER_FEMALE_F, a
|
2020-11-01 09:36:38 -08:00
|
|
|
jr z, .got_pic
|
2017-12-15 17:10:54 -08:00
|
|
|
ld de, KrisPic
|
2020-11-01 09:36:38 -08:00
|
|
|
.got_pic
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles2
|
2019-01-12 12:17:20 -08:00
|
|
|
ld b, BANK(ChrisPic) ; aka BANK(KrisPic)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld c, 7 * 7 ; dimensions
|
|
|
|
call Get2bpp
|
|
|
|
|
|
|
|
; Draw
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hGraphicStartTile], a
|
2017-12-15 17:10:54 -08:00
|
|
|
hlcoord 6, 4
|
|
|
|
lb bc, 7, 7
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PlaceGraphic
|
2017-12-15 17:10:54 -08:00
|
|
|
ret
|