pokecrystal-board/engine/gfx/player_gfx.asm

173 lines
2.7 KiB
NASM
Raw Normal View History

2018-06-24 07:09:41 -07:00
MovePlayerPicRight:
hlcoord 6, 4
ld de, 1
jr MovePlayerPic
2018-06-24 07:09:41 -07:00
MovePlayerPicLeft:
hlcoord 13, 4
ld de, -1
; fallthrough
2018-06-24 07:09:41 -07:00
MovePlayerPic:
; Move player pic at hl by de * 7 tiles.
ld c, $8
.loop
push bc
push hl
push de
xor a
ldh [hBGMapMode], a
lb bc, 7, 7
predef PlaceGraphic
xor a
ldh [hBGMapThird], a
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:
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
jr z, .got_header
ld hl, KrisNameMenuHeader
.got_header
call LoadMenuHeader
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"
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
ld b, BANK(ChrisSpriteGFX)
ret
2018-06-24 07:09:41 -07:00
GetCardPic:
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
jr z, .got_pic
ld hl, KrisCardPic
.got_pic
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $00
ld bc, $23 tiles
ld a, BANK(ChrisCardPic) ; aka BANK(KrisCardPic)
call FarCopyBytes
ld hl, TrainerCardGFX
2017-12-28 04:32:33 -08:00
ld de, vTiles2 tile $23
ld bc, 6 tiles
ld a, BANK(TrainerCardGFX)
call FarCopyBytes
ret
2018-06-24 07:09:41 -07:00
ChrisCardPic:
INCBIN "gfx/trainer_card/chris_card.2bpp"
2018-06-24 07:09:41 -07:00
KrisCardPic:
INCBIN "gfx/trainer_card/kris_card.2bpp"
TrainerCardGFX:
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
ld c, 7 * 7
2024-03-08 09:56:26 -08:00
ld b, BANK(ChrisBackpic)
predef DecompressGet2bpp
ret
2018-06-24 07:09:41 -07:00
HOF_LoadTrainerFrontpic:
call WaitBGMap
xor a
ldh [hBGMapMode], a
; 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
jr z, .got_class
ld e, KRIS
.got_class
ld a, e
2018-01-23 14:39:09 -08:00
ld [wTrainerClass], a
; 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
jr z, .got_pic
ld de, KrisPic
.got_pic
2017-12-28 04:32:33 -08:00
ld hl, vTiles2
ld b, BANK(ChrisPic) ; aka BANK(KrisPic)
ld c, 7 * 7
call Get2bpp
call WaitBGMap
ld a, $1
ldh [hBGMapMode], a
ret
2018-06-24 07:09:41 -07:00
DrawIntroPlayerPic:
; 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
jr z, .got_class
ld e, KRIS
.got_class
ld a, e
2018-01-23 14:39:09 -08:00
ld [wTrainerClass], a
; 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
jr z, .got_pic
ld de, KrisPic
.got_pic
2017-12-28 04:32:33 -08:00
ld hl, vTiles2
ld b, BANK(ChrisPic) ; aka BANK(KrisPic)
ld c, 7 * 7 ; dimensions
call Get2bpp
; Draw
xor a
ldh [hGraphicStartTile], a
hlcoord 6, 4
lb bc, 7, 7
predef PlaceGraphic
ret