pokered/engine/events/diploma.asm

117 lines
2 KiB
NASM
Raw Normal View History

CIRCLE_TILE_ID EQU $70
DisplayDiploma::
2014-05-22 22:13:20 +00:00
call SaveScreenTilesToBuffer2
call GBPalWhiteOutWithDelay3
call ClearScreen
xor a
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a
ld hl, wd730
2014-05-22 22:13:20 +00:00
set 6, [hl]
call DisableLCD
ld hl, CircleTile
2020-07-07 19:09:54 +00:00
ld de, vChars2 tile CIRCLE_TILE_ID
ld bc, $10
2014-05-22 22:13:20 +00:00
ld a, BANK(CircleTile)
call FarCopyData2
hlcoord 0, 0
2015-08-05 21:20:29 +00:00
lb bc, 16, 18
2015-02-07 10:43:08 +00:00
predef Diploma_TextBoxBorder
ld hl, DiplomaTextPointersAndCoords
2014-05-22 22:13:20 +00:00
ld c, $5
.asm_56715
push bc
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
ld a, [hli]
push hl
ld h, [hl]
ld l, a
call PlaceString
pop hl
inc hl
pop bc
dec c
jr nz, .asm_56715
hlcoord 10, 4
ld de, wPlayerName
2014-05-22 22:13:20 +00:00
call PlaceString
farcall DrawPlayerCharacter
2015-07-17 07:16:27 +00:00
; Move the player 33 pixels right and set the priority bit so he appears
; behind the background layer.
ld hl, wOAMBuffer + $01
2015-08-05 21:20:29 +00:00
lb bc, $80, $28
2015-07-17 07:16:27 +00:00
.adjustPlayerGfxLoop
ld a, [hl] ; X
add 33
2014-05-22 22:13:20 +00:00
ld [hli], a
inc hl
ld a, b
2015-07-17 07:16:27 +00:00
ld [hli], a ; attributes
2014-05-22 22:13:20 +00:00
inc hl
dec c
2015-07-17 07:16:27 +00:00
jr nz, .adjustPlayerGfxLoop
2014-05-22 22:13:20 +00:00
call EnableLCD
farcall LoadTrainerInfoTextBoxTiles
2015-08-12 09:16:56 +00:00
ld b, SET_PAL_GENERIC
call RunPaletteCommand
2014-05-22 22:13:20 +00:00
call Delay3
call GBPalNormal
ld a, $90
ldh [rOBP0], a
2014-05-22 22:13:20 +00:00
call WaitForTextScrollButtonPress
ld hl, wd730
2014-05-22 22:13:20 +00:00
res 6, [hl]
call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns
2014-05-22 22:13:20 +00:00
call Delay3
jp GBPalNormal
2016-06-12 00:24:04 +00:00
UnusedPlayerNameLengthFunc:
2015-07-17 07:16:27 +00:00
; Unused function that does a calculation involving the length of the player's
; name.
ld hl, wPlayerName
lb bc, $ff, $00
2015-07-17 07:16:27 +00:00
.loop
2014-05-22 22:13:20 +00:00
ld a, [hli]
2015-07-17 07:16:27 +00:00
cp "@"
2014-05-22 22:13:20 +00:00
ret z
dec c
2015-07-17 07:16:27 +00:00
jr .loop
2014-05-22 22:13:20 +00:00
diploma_text: MACRO
dw \3
dwcoord \1, \2
ENDM
2016-06-12 00:24:04 +00:00
DiplomaTextPointersAndCoords:
; x, y, text
diploma_text 5, 2, DiplomaText
diploma_text 3, 4, DiplomaPlayer
diploma_text 15, 4, DiplomaEmptyText
diploma_text 2, 6, DiplomaCongrats
diploma_text 9, 16, DiplomaGameFreak
2014-05-22 22:13:20 +00:00
DiplomaText:
db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@"
2014-05-22 22:13:20 +00:00
DiplomaPlayer:
db "Player@"
DiplomaEmptyText:
db "@"
DiplomaCongrats:
db "Congrats! This"
next "diploma certifies"
next "that you have"
next "completed your"
next "#DEX.@"
DiplomaGameFreak:
db "GAME FREAK@"