aboutsummaryrefslogtreecommitdiffstats
path: root/engine/events/diploma2.asm
blob: 0653526dedb6be8f98d04cca497100ce3543759f (plain) (blame)
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
DEF CIRCLE_TILE_ID EQU $10

DisplayDiplomaTop:
	call GBPalWhiteOutWithDelay3
	call ClearScreen
	ld de, DiplomaGraphics
	ld hl, vChars2
	lb bc, BANK(DiplomaGraphics), (DiplomaGraphicsEnd - DiplomaGraphics) / $10
	call CopyVideoData

	hlcoord 0, 0
	call DiplomaDrawHorizontalBorder
	hlcoord 0, 0
	call DiplomaDrawVerticalBorder
	hlcoord 19, 0
	call DiplomaDrawVerticalBorder
	ld a, $00
	hlcoord 0, 0
	ld [hl], a
	hlcoord 19, 0
	ld [hl], a

	ld de, DiplomaText
	hlcoord 5, 2
	call PlaceString

	ld de, DiplomaPlayer
	hlcoord 3, 4
	call PlaceString

	ld de, wPlayerName
	hlcoord 10, 4
	call PlaceString

	ld de, DiplomaCongrats
	hlcoord 2, 6
	call PlaceString

	ld de, DiplomaGameFreak
	hlcoord 9, 16
	call PlaceString

	ld b, SET_PAL_GENERIC
	call RunPaletteCommand
	ld a, $01
	ldh [hAutoBGTransferEnabled], a
	call Delay3
	call GBPalNormal
	ret

DiplomaText:
	db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@"

DiplomaPlayer:
	db "Player@"

DiplomaCongrats:
	db   "Congrats! This"
	next "diploma certifies"
	next "that you have"
	next "completed your"
	next "#DEX.@"

DiplomaGameFreak:
	db "GAME FREAK@"

DisplayDiplomaBottom:
	call ClearScreen
	hlcoord 0, 17
	call DiplomaDrawHorizontalBorder
	hlcoord 0, 0
	call DiplomaDrawVerticalBorder
	hlcoord 19, 0
	call DiplomaDrawVerticalBorder
	ld a, $00
	hlcoord 0, 17
	ld [hl], a
	hlcoord 19, 17
	ld [hl], a

	ld de, DiplomaPikachuTiles
	hlcoord 6, 2
	lb bc, 10, 12
	call Diploma_Surfing_CopyBox

	ld de, CongratulationsTiles
	hlcoord 5, 13
	lb bc, 1, 11
	call Diploma_Surfing_CopyBox

	ld de, DiplomaPlayTime
	hlcoord 2, 15
	call PlaceString
	hlcoord 12, 15
	ld de, wPlayTimeHours
	lb bc, LEFT_ALIGN | 1, 3
	call PrintNumber
	ld [hl], $16 ; colon
	inc hl
	ld de, wPlayTimeMinutes
	lb bc, LEADING_ZEROES | 1, 2
	call PrintNumber

	ld a, [wNumSetBits]
	cp NUM_POKEMON
	ret nz
	ld de, DiplomaMewTiles
	hlcoord 2, 0
	lb bc, 4, 5
	call Diploma_Surfing_CopyBox
	ret

DiplomaPikachuTiles:
INCBIN "gfx/diploma/diploma_pikachu.tilemap"

CongratulationsTiles:
	db $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; CONGRATULATIONS!

DiplomaMewTiles:
INCBIN "gfx/diploma/diploma_mew.tilemap"

DiplomaPlayTime:
	db "PLAY TIME@"

DiplomaDrawHorizontalBorder:
	ld c, SCREEN_WIDTH / 2
.loop
	ld [hl], $02
	inc hl
	ld [hl], $01
	inc hl
	dec c
	jr nz, .loop
	ret

DiplomaDrawVerticalBorder:
	ld c, SCREEN_HEIGHT / 2
	ld de, SCREEN_WIDTH
.loop
	ld [hl], $04
	add hl, de
	ld [hl], $03
	add hl, de
	dec c
	jr nz, .loop
	ret

DiplomaGraphics: INCBIN "gfx/diploma/diploma.2bpp"
DiplomaGraphicsEnd: