-
Notifications
You must be signed in to change notification settings - Fork 998
/
diploma.asm
117 lines (105 loc) · 2.08 KB
/
diploma.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
DEF CIRCLE_TILE_ID EQU $70
DisplayDiploma::
call SaveScreenTilesToBuffer2
call GBPalWhiteOutWithDelay3
call ClearScreen
xor a
ld [wUpdateSpritesEnabled], a
ld hl, wStatusFlags5
set BIT_NO_TEXT_DELAY, [hl]
call DisableLCD
ld hl, CircleTile
ld de, vChars2 tile CIRCLE_TILE_ID
ld bc, $10
ld a, BANK(CircleTile)
call FarCopyData2
hlcoord 0, 0
lb bc, 16, 18
predef Diploma_TextBoxBorder
ld hl, DiplomaTextPointersAndCoords
ld c, $5
.placeTextLoop
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, .placeTextLoop
hlcoord 10, 4
ld de, wPlayerName
call PlaceString
farcall DrawPlayerCharacter
; Move the player 33 pixels right and set the priority bit so he appears
; behind the background layer.
ld hl, wShadowOAMSprite00XCoord
lb bc, $80, $28
.adjustPlayerGfxLoop
ld a, [hl] ; X
add 33
ld [hli], a
inc hl
ld a, b
ld [hli], a ; attributes
inc hl
dec c
jr nz, .adjustPlayerGfxLoop
call EnableLCD
farcall LoadTrainerInfoTextBoxTiles
ld b, SET_PAL_GENERIC
call RunPaletteCommand
call Delay3
call GBPalNormal
ld a, $90
ldh [rOBP0], a
call WaitForTextScrollButtonPress
ld hl, wStatusFlags5
res BIT_NO_TEXT_DELAY, [hl]
call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns
call Delay3
jp GBPalNormal
UnusedPlayerNameLengthFunc:
; Unused function that does a calculation involving the length of the player's
; name.
ld hl, wPlayerName
lb bc, $ff, $00
.loop
ld a, [hli]
cp "@"
ret z
dec c
jr .loop
MACRO diploma_text
dw \3
dwcoord \1, \2
ENDM
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
DiplomaText:
db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@"
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@"