pokered/engine/menu/league_pc.asm

121 lines
2.1 KiB
NASM
Raw Normal View History

2014-05-22 22:13:20 +00:00
PKMNLeaguePC: ; 0x7657e
ld hl, AccessedHoFPCText
call PrintText
ld hl, wd730
2014-05-22 22:13:20 +00:00
set 6, [hl]
push hl
2014-09-13 07:50:56 +00:00
ld a, [wUpdateSpritesEnabled]
2014-05-22 22:13:20 +00:00
push af
2014-09-14 18:29:18 +00:00
ld a, [hTilesetType]
2014-05-22 22:13:20 +00:00
push af
xor a
2014-09-14 18:29:18 +00:00
ld [hTilesetType], a
2014-05-22 22:13:20 +00:00
ld [W_SPRITEFLIPPED], 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
callba 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
2014-09-14 18:29:18 +00:00
ld [hTilesetType], 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
call GoPAL_SET_CF1C
jp GBPalNormal
2015-07-15 02:46:52 +00:00
LeaguePCShowTeam: ; 765e5 (1d:65e5)
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
2014-05-25 17:51:53 +00:00
ld 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
2015-07-15 02:46:52 +00:00
LeaguePCShowMon: ; 76610 (1d:6610)
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 [wcf91], a
ld [wd0b5], a
ld [wBattleMonSpecies2], a
ld [wcf1d], 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, wcd6d
2014-05-22 22:13:20 +00:00
ld bc, $000B
call CopyData
ld b, $0B
ld c, 0
call GoPAL_SET
2015-07-18 20:52:03 +00:00
coord hl, 12, 5
2014-05-22 22:13:20 +00:00
call GetMonHeader
call LoadFrontSpriteByMonIndex
call GBPalNormal
2015-07-18 20:52:03 +00:00
coord hl, 0, 13
2014-05-22 22:13:20 +00:00
ld b, 2
ld c, $12
call TextBoxBorder
2015-07-18 20:52:03 +00:00
coord hl, 1, 15
2014-05-22 22:13:20 +00:00
ld de, HallOfFameNoText
call PlaceString
2015-07-18 20:52:03 +00:00
coord hl, 16, 15
2015-07-15 02:46:52 +00:00
ld de, wHoFTeamNo
2014-05-22 22:13:20 +00:00
ld bc, $0103
call PrintNumber
2015-07-19 18:56:13 +00:00
jpba HoFDisplayMonInfo
2014-05-22 22:13:20 +00:00
HallOfFameNoText: ; 76670 (1d:6670)
db "HALL OF FAME No @"
AccessedHoFPCText: ; 76683 (1d:6683)
TX_FAR _AccessedHoFPCText
db "@"