pokered/engine/menus/league_pc.asm

121 lines
2.1 KiB
NASM
Raw Normal View History

PKMNLeaguePC:
2014-05-22 22:13:20 +00:00
ld hl, AccessedHoFPCText
call PrintText
ld hl, wStatusFlags5
set BIT_NO_TEXT_DELAY, [hl]
2014-05-22 22:13:20 +00:00
push hl
2014-09-13 07:50:56 +00:00
ld a, [wUpdateSpritesEnabled]
2014-05-22 22:13:20 +00:00
push af
ldh a, [hTileAnimations]
2014-05-22 22:13:20 +00:00
push af
xor a
ldh [hTileAnimations], a
2015-08-31 02:38:41 +00:00
ld [wSpriteFlipped], a
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a
2015-07-19 03:49:52 +00:00
ld [wHoFTeamIndex2], a
2015-07-15 02:46:52 +00:00
ld [wHoFTeamNo], a
ld a, [wNumHoFTeams]
2014-05-22 22:13:20 +00:00
ld b, a
2015-07-15 02:46:52 +00:00
cp HOF_TEAM_CAPACITY + 1
jr c, .loop
; If the total number of hall of fame teams is greater than the storage
; capacity, then calculate the number of the first team that is still recorded.
ld b, HOF_TEAM_CAPACITY
2014-05-22 22:13:20 +00:00
sub b
2015-07-15 02:46:52 +00:00
ld [wHoFTeamNo], a
.loop
ld hl, wHoFTeamNo
2014-05-22 22:13:20 +00:00
inc [hl]
push bc
2015-07-19 03:49:52 +00:00
ld a, [wHoFTeamIndex2]
ld [wHoFTeamIndex], a
farcall LoadHallOfFameTeams
2015-07-15 02:46:52 +00:00
call LeaguePCShowTeam
2014-05-22 22:13:20 +00:00
pop bc
2015-07-15 02:46:52 +00:00
jr c, .doneShowingTeams
2015-07-19 03:49:52 +00:00
ld hl, wHoFTeamIndex2
2014-05-22 22:13:20 +00:00
inc [hl]
ld a, [hl]
cp b
2015-07-15 02:46:52 +00:00
jr nz, .loop
.doneShowingTeams
2014-05-22 22:13:20 +00:00
pop af
ldh [hTileAnimations], a
2014-05-22 22:13:20 +00:00
pop af
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a
2014-05-22 22:13:20 +00:00
pop hl
res 6, [hl]
call GBPalWhiteOutWithDelay3
call ClearScreen
2015-08-12 09:16:56 +00:00
call RunDefaultPaletteCommand
2014-05-22 22:13:20 +00:00
jp GBPalNormal
2016-06-12 00:24:04 +00:00
LeaguePCShowTeam:
ld c, PARTY_LENGTH
.loop
2014-05-22 22:13:20 +00:00
push bc
2015-07-15 02:46:52 +00:00
call LeaguePCShowMon
2014-05-22 22:13:20 +00:00
call WaitForTextScrollButtonPress
ldh a, [hJoyHeld]
2014-05-22 22:13:20 +00:00
bit 1, a
jr nz, .exit
ld hl, wHallOfFame + HOF_MON
ld de, wHallOfFame
ld bc, HOF_TEAM - HOF_MON
2014-05-22 22:13:20 +00:00
call CopyData
pop bc
ld a, [wHallOfFame + 0]
cp $ff
jr z, .done
2014-05-22 22:13:20 +00:00
dec c
jr nz, .loop
.done
2014-05-22 22:13:20 +00:00
and a
ret
.exit
2014-05-22 22:13:20 +00:00
pop bc
scf
ret
2016-06-12 00:24:04 +00:00
LeaguePCShowMon:
2014-05-22 22:13:20 +00:00
call GBPalWhiteOutWithDelay3
call ClearScreen
ld hl, wHallOfFame
2014-05-22 22:13:20 +00:00
ld a, [hli]
2015-07-15 02:46:52 +00:00
ld [wHoFMonSpecies], a
ld [wCurPartySpecies], a
ld [wCurSpecies], a
ld [wBattleMonSpecies2], a
2015-08-12 09:16:56 +00:00
ld [wWholeScreenPaletteMonSpecies], a
2014-05-22 22:13:20 +00:00
ld a, [hli]
2015-07-15 02:46:52 +00:00
ld [wHoFMonLevel], a
ld de, wNameBuffer
ld bc, NAME_LENGTH
2014-05-22 22:13:20 +00:00
call CopyData
2015-08-12 09:16:56 +00:00
ld b, SET_PAL_POKEMON_WHOLE_SCREEN
2014-05-22 22:13:20 +00:00
ld c, 0
2015-08-12 09:16:56 +00:00
call RunPaletteCommand
hlcoord 12, 5
2014-05-22 22:13:20 +00:00
call GetMonHeader
call LoadFrontSpriteByMonIndex
call GBPalNormal
hlcoord 0, 13
2014-05-22 22:13:20 +00:00
ld b, 2
ld c, $12
call TextBoxBorder
hlcoord 1, 15
2014-05-22 22:13:20 +00:00
ld de, HallOfFameNoText
call PlaceString
hlcoord 16, 15
2015-07-15 02:46:52 +00:00
ld de, wHoFTeamNo
2015-07-28 01:48:44 +00:00
lb bc, 1, 3
2014-05-22 22:13:20 +00:00
call PrintNumber
farjp HoFDisplayMonInfo
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
HallOfFameNoText:
2014-05-22 22:13:20 +00:00
db "HALL OF FAME No @"
2016-06-12 00:24:04 +00:00
AccessedHoFPCText:
text_far _AccessedHoFPCText
text_end