pokered/engine/hall_of_fame.asm

289 lines
5.1 KiB
NASM
Raw Normal View History

2014-05-22 22:13:20 +00:00
AnimateHallOfFame: ; 701a0 (1c:41a0)
2015-07-15 02:46:52 +00:00
call HoFFadeOutScreenAndMusic
2014-05-22 22:13:20 +00:00
call ClearScreen
ld c, 100
2014-05-22 22:13:20 +00:00
call DelayFrames
call LoadFontTilePatterns
call LoadTextBoxTilePatterns
call DisableLCD
2014-05-29 08:31:46 +00:00
ld hl,vBGMap0
2014-05-22 22:13:20 +00:00
ld bc, $800
2015-08-05 21:20:29 +00:00
ld a, " "
2014-05-22 22:13:20 +00:00
call FillMemory
call EnableLCD
ld hl, rLCDC
2014-05-22 22:13:20 +00:00
set 3, [hl]
xor a
ld hl, wHallOfFame
ld bc, HOF_TEAM
2014-05-22 22:13:20 +00:00
call FillMemory
xor a
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a
2014-09-14 18:29:18 +00:00
ld [hTilesetType], a
2014-05-22 22:13:20 +00:00
ld [W_SPRITEFLIPPED], a
2015-07-15 02:46:52 +00:00
ld [wLetterPrintingDelayFlags], a ; no delay
ld [wHoFMonOrPlayer], a ; mon
2014-05-22 22:13:20 +00:00
inc a
ld [H_AUTOBGTRANSFERENABLED], a
2015-07-15 02:46:52 +00:00
ld hl, wNumHoFTeams
2014-05-22 22:13:20 +00:00
ld a, [hl]
inc a
2015-07-15 02:46:52 +00:00
jr z, .skipInc ; don't wrap around to 0
2014-05-22 22:13:20 +00:00
inc [hl]
2015-07-15 02:46:52 +00:00
.skipInc
2014-05-22 22:13:20 +00:00
ld a, $90
2014-09-23 22:02:03 +00:00
ld [hWY], a
2014-05-22 22:13:20 +00:00
ld c, BANK(Music_HallOfFame)
ld a, MUSIC_HALL_OF_FAME
call PlayMusic
ld hl, wPartySpecies
2014-05-22 22:13:20 +00:00
ld c, $ff
2015-07-15 02:46:52 +00:00
.partyMonLoop
2014-05-22 22:13:20 +00:00
ld a, [hli]
cp $ff
2015-07-15 02:46:52 +00:00
jr z, .doneShowingParty
2014-05-22 22:13:20 +00:00
inc c
push hl
push bc
2015-07-15 02:46:52 +00:00
ld [wHoFMonSpecies], a
2014-05-22 22:13:20 +00:00
ld a, c
2015-07-15 02:46:52 +00:00
ld [wHoFPartyMonIndex], a
ld hl, wPartyMon1Level
ld bc, wPartyMon2 - wPartyMon1
2014-05-22 22:13:20 +00:00
call AddNTimes
ld a, [hl]
2015-07-15 02:46:52 +00:00
ld [wHoFMonLevel], a
call HoFShowMonOrPlayer
call HoFDisplayAndRecordMonInfo
ld c, 80
2014-05-22 22:13:20 +00:00
call DelayFrames
2015-07-18 20:52:03 +00:00
coord hl, 2, 13
2014-05-22 22:13:20 +00:00
ld b, $3
ld c, $e
call TextBoxBorder
2015-07-18 20:52:03 +00:00
coord hl, 4, 15
2014-05-22 22:13:20 +00:00
ld de, HallOfFameText
call PlaceString
ld c, 180
2014-05-22 22:13:20 +00:00
call DelayFrames
2014-09-13 07:50:56 +00:00
call GBFadeOutToWhite
2014-05-22 22:13:20 +00:00
pop bc
pop hl
2015-07-15 02:46:52 +00:00
jr .partyMonLoop
.doneShowingParty
2014-05-22 22:13:20 +00:00
ld a, c
inc a
ld hl, wHallOfFame
ld bc, HOF_MON
2014-05-22 22:13:20 +00:00
call AddNTimes
ld [hl], $ff
call SaveHallOfFameTeams
2014-05-22 22:13:20 +00:00
xor a
2015-07-15 02:46:52 +00:00
ld [wHoFMonSpecies], a
2014-05-22 22:13:20 +00:00
inc a
2015-07-15 02:46:52 +00:00
ld [wHoFMonOrPlayer], a ; player
call HoFShowMonOrPlayer
call HoFDisplayPlayerStats
2015-07-15 02:46:52 +00:00
call HoFFadeOutScreenAndMusic
2014-05-22 22:13:20 +00:00
xor a
2014-09-23 22:02:03 +00:00
ld [hWY], a
ld hl, rLCDC
2014-05-22 22:13:20 +00:00
res 3, [hl]
ret
HallOfFameText: ; 7026b (1c:426b)
db "HALL OF FAME@"
2015-07-15 02:46:52 +00:00
HoFShowMonOrPlayer: ; 70278 (1c:4278)
2014-05-22 22:13:20 +00:00
call ClearScreen
ld a, $d0
2015-02-07 10:43:08 +00:00
ld [hSCY], a
2014-05-22 22:13:20 +00:00
ld a, $c0
2015-02-07 10:43:08 +00:00
ld [hSCX], a
2015-07-15 02:46:52 +00:00
ld a, [wHoFMonSpecies]
ld [wcf91], a
ld [wd0b5], a
ld [wBattleMonSpecies2], a
ld [wcf1d], a
2015-07-15 02:46:52 +00:00
ld a, [wHoFMonOrPlayer]
2014-05-22 22:13:20 +00:00
and a
2015-07-15 02:46:52 +00:00
jr z, .showMon
; show player
call HoFLoadPlayerPics
2015-07-15 02:46:52 +00:00
jr .next1
.showMon
2015-07-18 20:52:03 +00:00
coord hl, 12, 5
2014-05-22 22:13:20 +00:00
call GetMonHeader
call LoadFrontSpriteByMonIndex
predef LoadMonBackPic
2015-07-15 02:46:52 +00:00
.next1
2014-05-22 22:13:20 +00:00
ld b, $b
ld c, $0
call GoPAL_SET
2015-07-15 02:46:52 +00:00
ld a, %11100100
ld [rBGP], a
2015-07-15 02:46:52 +00:00
ld c, $31 ; back pic
call HoFLoadMonPlayerPicTileIDs
2014-05-22 22:13:20 +00:00
ld d, $a0
2015-07-15 02:46:52 +00:00
ld e, 4
2014-09-13 07:50:56 +00:00
ld a, [wOnSGB]
2014-05-22 22:13:20 +00:00
and a
2015-07-15 02:46:52 +00:00
jr z, .next2
sla e ; scroll more slowly on SGB
.next2
call .ScrollPic ; scroll back pic left
2014-05-22 22:13:20 +00:00
xor a
2015-02-07 10:43:08 +00:00
ld [hSCY], a
2015-07-15 02:46:52 +00:00
ld c, a ; front pic
call HoFLoadMonPlayerPicTileIDs
ld d, 0
ld e, -4
; scroll front pic right
.ScrollPic
2014-05-22 22:13:20 +00:00
call DelayFrame
2015-02-07 10:43:08 +00:00
ld a, [hSCX]
2014-05-22 22:13:20 +00:00
add e
2015-02-07 10:43:08 +00:00
ld [hSCX], a
2014-05-22 22:13:20 +00:00
cp d
2015-07-15 02:46:52 +00:00
jr nz, .ScrollPic
2014-05-22 22:13:20 +00:00
ret
2015-07-15 02:46:52 +00:00
HoFDisplayAndRecordMonInfo: ; 702e1 (1c:42e1)
ld a, [wHoFPartyMonIndex]
ld hl, wPartyMonNicks
2014-05-22 22:13:20 +00:00
call GetPartyMonName
2015-07-15 02:46:52 +00:00
call HoFDisplayMonInfo
jp HoFRecordMonInfo
2014-05-22 22:13:20 +00:00
2015-07-15 02:46:52 +00:00
HoFDisplayMonInfo: ; 702f0 (1c:42f0)
2015-07-18 20:52:03 +00:00
coord hl, 0, 2
2015-07-15 02:46:52 +00:00
ld b, 9
ld c, 10
2014-05-22 22:13:20 +00:00
call TextBoxBorder
2015-07-18 20:52:03 +00:00
coord hl, 2, 6
2014-05-22 22:13:20 +00:00
ld de, HoFMonInfoText
call PlaceString
2015-07-18 20:52:03 +00:00
coord hl, 1, 4
ld de, wcd6d
2014-05-22 22:13:20 +00:00
call PlaceString
2015-07-15 02:46:52 +00:00
ld a, [wHoFMonLevel]
2015-07-18 20:52:03 +00:00
coord hl, 8, 7
2014-05-22 22:13:20 +00:00
call PrintLevelCommon
2015-07-15 02:46:52 +00:00
ld a, [wHoFMonSpecies]
ld [wd0b5], a
2015-07-18 20:52:03 +00:00
coord hl, 3, 9
2015-02-08 00:24:16 +00:00
predef PrintMonType
2015-07-15 02:46:52 +00:00
ld a, [wHoFMonSpecies]
2014-05-22 22:13:20 +00:00
jp PlayCry
HoFMonInfoText: ; 70329 (1c:4329)
db "LEVEL/"
next "TYPE1/"
next "TYPE2/@"
HoFLoadPlayerPics: ; 7033e (1c:433e)
ld de, RedPicFront
2014-05-22 22:13:20 +00:00
ld a, BANK(RedPicFront)
call UncompressSpriteFromDE
ld hl, S_SPRITEBUFFER1
2015-08-05 21:20:29 +00:00
ld de, S_SPRITEBUFFER0
2014-05-22 22:13:20 +00:00
ld bc, $310
call CopyData
2014-05-29 08:31:46 +00:00
ld de, vFrontPic
2014-05-22 22:13:20 +00:00
call InterlaceMergeSpriteBuffers
ld de, RedPicBack
2014-05-22 22:13:20 +00:00
ld a, BANK(RedPicBack)
call UncompressSpriteFromDE
predef ScaleSpriteByTwo
2014-05-29 08:31:46 +00:00
ld de, vBackPic
2014-05-22 22:13:20 +00:00
call InterlaceMergeSpriteBuffers
ld c, $1
2015-07-15 02:46:52 +00:00
HoFLoadMonPlayerPicTileIDs: ; 7036d (1c:436d)
; c = base tile ID
ld b, 0
2015-07-18 20:52:03 +00:00
coord hl, 12, 5
2015-02-07 10:43:08 +00:00
predef_jump CopyTileIDsFromList
2014-05-22 22:13:20 +00:00
HoFDisplayPlayerStats: ; 70377 (1c:4377)
2015-07-21 21:21:14 +00:00
SetEvent EVENT_HALL_OF_FAME_DEX_RATING
predef DisplayDexRating
2015-07-18 20:52:03 +00:00
coord hl, 0, 4
2014-05-22 22:13:20 +00:00
ld b, $6
ld c, $a
call TextBoxBorder
2015-07-18 20:52:03 +00:00
coord hl, 5, 0
2014-05-22 22:13:20 +00:00
ld b, $2
ld c, $9
call TextBoxBorder
2015-07-18 20:52:03 +00:00
coord hl, 7, 2
ld de, wPlayerName
2014-05-22 22:13:20 +00:00
call PlaceString
2015-07-18 20:52:03 +00:00
coord hl, 1, 6
2014-05-22 22:13:20 +00:00
ld de, HoFPlayTimeText
call PlaceString
2015-07-18 20:52:03 +00:00
coord hl, 5, 7
ld de, W_PLAYTIMEHOURS + 1
2015-07-28 01:48:44 +00:00
lb bc, 1, 3
2014-05-22 22:13:20 +00:00
call PrintNumber
ld [hl], $6d
inc hl
ld de, W_PLAYTIMEMINUTES + 1
2015-07-28 01:48:44 +00:00
lb bc, LEADING_ZEROES | 1, 2
2014-05-22 22:13:20 +00:00
call PrintNumber
2015-07-18 20:52:03 +00:00
coord hl, 1, 9
2014-05-22 22:13:20 +00:00
ld de, HoFMoneyText
call PlaceString
2015-07-18 20:52:03 +00:00
coord hl, 4, 10
ld de, wPlayerMoney
2014-05-22 22:13:20 +00:00
ld c, $a3
call PrintBCDNumber
ld hl, DexSeenOwnedText
call HoFPrintTextAndDelay
2014-05-22 22:13:20 +00:00
ld hl, DexRatingText
call HoFPrintTextAndDelay
ld hl, wcc5d
2014-05-22 22:13:20 +00:00
HoFPrintTextAndDelay: ; 703e2 (1c:43e2)
2014-05-22 22:13:20 +00:00
call PrintText
ld c, 120
2014-05-22 22:13:20 +00:00
jp DelayFrames
HoFPlayTimeText: ; 703ea (1c:43ea)
db "PLAY TIME@"
HoFMoneyText: ; 703f4 (1c:43f4)
db "MONEY@"
DexSeenOwnedText: ; 703fa (1c:43fa)
TX_FAR _DexSeenOwnedText
db "@"
DexRatingText: ; 703ff (1c:43ff)
TX_FAR _DexRatingText
db "@"
2015-07-15 02:46:52 +00:00
HoFRecordMonInfo: ; 70404 (1c:4404)
ld hl, wHallOfFame
ld bc, HOF_MON
2015-07-15 02:46:52 +00:00
ld a, [wHoFPartyMonIndex]
2014-05-22 22:13:20 +00:00
call AddNTimes
2015-07-15 02:46:52 +00:00
ld a, [wHoFMonSpecies]
2014-05-22 22:13:20 +00:00
ld [hli], a
2015-07-15 02:46:52 +00:00
ld a, [wHoFMonLevel]
2014-05-22 22:13:20 +00:00
ld [hli], a
ld e, l
ld d, h
ld hl, wcd6d
2014-05-22 22:13:20 +00:00
ld bc, $b
jp CopyData
2015-07-15 02:46:52 +00:00
HoFFadeOutScreenAndMusic: ; 70423 (1c:4423)
2015-08-09 05:32:44 +00:00
ld a, 10
ld [wAudioFadeOutCounterReloadValue], a
ld [wAudioFadeOutCounter], a
2014-05-22 22:13:20 +00:00
ld a, $ff
2015-08-09 05:32:44 +00:00
ld [wAudioFadeOutControl], a
2014-09-13 07:50:56 +00:00
jp GBFadeOutToWhite