Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/events/diploma.asm
1271 views
1
DEF CIRCLE_TILE_ID EQU $70
2
3
DisplayDiploma::
4
call SaveScreenTilesToBuffer2
5
call GBPalWhiteOutWithDelay3
6
call ClearScreen
7
xor a
8
ld [wUpdateSpritesEnabled], a
9
ld hl, wStatusFlags5
10
set BIT_NO_TEXT_DELAY, [hl]
11
call DisableLCD
12
ld hl, CircleTile
13
ld de, vChars2 tile CIRCLE_TILE_ID
14
ld bc, $10
15
ld a, BANK(CircleTile)
16
call FarCopyData2
17
hlcoord 0, 0
18
lb bc, 16, 18
19
predef Diploma_TextBoxBorder
20
21
ld hl, DiplomaTextPointersAndCoords
22
ld c, $5
23
.placeTextLoop
24
push bc
25
ld a, [hli]
26
ld e, a
27
ld a, [hli]
28
ld d, a
29
ld a, [hli]
30
push hl
31
ld h, [hl]
32
ld l, a
33
call PlaceString
34
pop hl
35
inc hl
36
pop bc
37
dec c
38
jr nz, .placeTextLoop
39
hlcoord 10, 4
40
ld de, wPlayerName
41
call PlaceString
42
farcall DrawPlayerCharacter
43
44
; Move the player 33 pixels right and set the priority bit so he appears
45
; behind the background layer.
46
ld hl, wShadowOAMSprite00XCoord
47
lb bc, $80, $28
48
.adjustPlayerGfxLoop
49
ld a, [hl] ; X
50
add 33
51
ld [hli], a
52
inc hl
53
ld a, b
54
ld [hli], a ; attributes
55
inc hl
56
dec c
57
jr nz, .adjustPlayerGfxLoop
58
59
call EnableLCD
60
farcall LoadTrainerInfoTextBoxTiles
61
ld b, SET_PAL_GENERIC
62
call RunPaletteCommand
63
call Delay3
64
call GBPalNormal
65
ld a, $90
66
ldh [rOBP0], a
67
call WaitForTextScrollButtonPress
68
ld hl, wStatusFlags5
69
res BIT_NO_TEXT_DELAY, [hl]
70
call GBPalWhiteOutWithDelay3
71
call RestoreScreenTilesAndReloadTilePatterns
72
call Delay3
73
jp GBPalNormal
74
75
UnusedPlayerNameLengthFunc:
76
; Unused function that does a calculation involving the length of the player's
77
; name.
78
ld hl, wPlayerName
79
lb bc, $ff, $00
80
.loop
81
ld a, [hli]
82
cp "@"
83
ret z
84
dec c
85
jr .loop
86
87
MACRO diploma_text
88
dw \3
89
dwcoord \1, \2
90
ENDM
91
92
DiplomaTextPointersAndCoords:
93
; x, y, text
94
diploma_text 5, 2, DiplomaText
95
diploma_text 3, 4, DiplomaPlayer
96
diploma_text 15, 4, DiplomaEmptyText
97
diploma_text 2, 6, DiplomaCongrats
98
diploma_text 9, 16, DiplomaGameFreak
99
100
DiplomaText:
101
db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@"
102
103
DiplomaPlayer:
104
db "Player@"
105
106
DiplomaEmptyText:
107
db "@"
108
109
DiplomaCongrats:
110
db "Congrats! This"
111
next "diploma certifies"
112
next "that you have"
113
next "completed your"
114
next "#DEX.@"
115
116
DiplomaGameFreak:
117
db "GAME FREAK@"
118
119