Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/menus/league_pc.asm
1271 views
1
PKMNLeaguePC:
2
ld hl, AccessedHoFPCText
3
call PrintText
4
ld hl, wStatusFlags5
5
set BIT_NO_TEXT_DELAY, [hl]
6
push hl
7
ld a, [wUpdateSpritesEnabled]
8
push af
9
ldh a, [hTileAnimations]
10
push af
11
xor a
12
ldh [hTileAnimations], a
13
ld [wSpriteFlipped], a
14
ld [wUpdateSpritesEnabled], a
15
ld [wHoFTeamIndex2], a
16
ld [wHoFTeamNo], a
17
ld a, [wNumHoFTeams]
18
ld b, a
19
cp HOF_TEAM_CAPACITY + 1
20
jr c, .loop
21
; If the total number of hall of fame teams is greater than the storage
22
; capacity, then calculate the number of the first team that is still recorded.
23
ld b, HOF_TEAM_CAPACITY
24
sub b
25
ld [wHoFTeamNo], a
26
.loop
27
ld hl, wHoFTeamNo
28
inc [hl]
29
push bc
30
ld a, [wHoFTeamIndex2]
31
ld [wHoFTeamIndex], a
32
farcall LoadHallOfFameTeams
33
call LeaguePCShowTeam
34
pop bc
35
jr c, .doneShowingTeams
36
ld hl, wHoFTeamIndex2
37
inc [hl]
38
ld a, [hl]
39
cp b
40
jr nz, .loop
41
.doneShowingTeams
42
pop af
43
ldh [hTileAnimations], a
44
pop af
45
ld [wUpdateSpritesEnabled], a
46
pop hl
47
res BIT_NO_TEXT_DELAY, [hl]
48
call GBPalWhiteOutWithDelay3
49
call ClearScreen
50
call RunDefaultPaletteCommand
51
jp GBPalNormal
52
53
LeaguePCShowTeam:
54
ld c, PARTY_LENGTH
55
.loop
56
push bc
57
call LeaguePCShowMon
58
call WaitForTextScrollButtonPress
59
ldh a, [hJoyHeld]
60
bit B_PAD_B, a
61
jr nz, .exit
62
ld hl, wHallOfFame + HOF_MON
63
ld de, wHallOfFame
64
ld bc, HOF_TEAM - HOF_MON
65
call CopyData
66
pop bc
67
ld a, [wHallOfFame + 0]
68
cp $ff
69
jr z, .done
70
dec c
71
jr nz, .loop
72
.done
73
and a
74
ret
75
.exit
76
pop bc
77
scf
78
ret
79
80
LeaguePCShowMon:
81
call GBPalWhiteOutWithDelay3
82
call ClearScreen
83
ld hl, wHallOfFame
84
ld a, [hli]
85
ld [wHoFMonSpecies], a
86
ld [wCurPartySpecies], a
87
ld [wCurSpecies], a
88
ld [wBattleMonSpecies2], a
89
ld [wWholeScreenPaletteMonSpecies], a
90
ld a, [hli]
91
ld [wHoFMonLevel], a
92
ld de, wNameBuffer
93
ld bc, NAME_LENGTH
94
call CopyData
95
ld b, SET_PAL_POKEMON_WHOLE_SCREEN
96
ld c, 0
97
call RunPaletteCommand
98
hlcoord 12, 5
99
call GetMonHeader
100
call LoadFrontSpriteByMonIndex
101
call GBPalNormal
102
hlcoord 0, 13
103
ld b, 2
104
ld c, $12
105
call TextBoxBorder
106
hlcoord 1, 15
107
ld de, HallOfFameNoText
108
call PlaceString
109
hlcoord 16, 15
110
ld de, wHoFTeamNo
111
lb bc, 1, 3
112
call PrintNumber
113
farjp HoFDisplayMonInfo
114
115
HallOfFameNoText:
116
db "HALL OF FAME No @"
117
118
AccessedHoFPCText:
119
text_far _AccessedHoFPCText
120
text_end
121
122