pokered/engine/movie/hall_of_fame.asm

289 lines
4.9 KiB
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
AnimateHallOfFame:
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
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
ldh [hTilesetType], a
2015-08-31 02:38:41 +00:00
ld [wSpriteFlipped], 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
ldh [hAutoBGTransferEnabled], 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
ldh [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
2016-06-12 17:11:31 +00:00
ld b, 3
ld c, 14
2014-05-22 22:13:20 +00:00
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
ldh [hWY], a
ld hl, rLCDC
2014-05-22 22:13:20 +00:00
res 3, [hl]
ret
2016-06-12 00:24:04 +00:00
HallOfFameText:
2014-05-22 22:13:20 +00:00
db "HALL OF FAME@"
2016-06-12 00:24:04 +00:00
HoFShowMonOrPlayer:
2014-05-22 22:13:20 +00:00
call ClearScreen
ld a, $d0
ldh [hSCY], a
2014-05-22 22:13:20 +00:00
ld a, $c0
ldh [hSCX], a
2015-07-15 02:46:52 +00:00
ld a, [wHoFMonSpecies]
ld [wcf91], a
ld [wd0b5], a
ld [wBattleMonSpecies2], a
2015-08-12 09:16:56 +00:00
ld [wWholeScreenPaletteMonSpecies], 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
2015-08-12 09:16:56 +00:00
ld b, SET_PAL_POKEMON_WHOLE_SCREEN
ld c, 0
call RunPaletteCommand
2015-07-15 02:46:52 +00:00
ld a, %11100100
ldh [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
ldh [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
ldh a, [hSCX]
2014-05-22 22:13:20 +00:00
add e
ldh [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
2016-06-12 00:24:04 +00:00
HoFDisplayAndRecordMonInfo:
2015-07-15 02:46:52 +00:00
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
2016-06-12 00:24:04 +00:00
HoFDisplayMonInfo:
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
2016-06-12 00:24:04 +00:00
HoFMonInfoText:
2014-05-22 22:13:20 +00:00
db "LEVEL/"
next "TYPE1/"
next "TYPE2/@"
2016-06-12 00:24:04 +00:00
HoFLoadPlayerPics:
ld de, RedPicFront
2014-05-22 22:13:20 +00:00
ld a, BANK(RedPicFront)
call UncompressSpriteFromDE
2015-08-31 03:15:32 +00:00
ld hl, sSpriteBuffer1
ld de, sSpriteBuffer0
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
2016-06-12 00:24:04 +00:00
HoFLoadMonPlayerPicTileIDs:
2015-07-15 02:46:52 +00:00
; 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
2016-06-12 00:24:04 +00:00
HoFDisplayPlayerStats:
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
2016-06-12 04:30:05 +00:00
ld b, 6
ld c, 10
2014-05-22 22:13:20 +00:00
call TextBoxBorder
2015-07-18 20:52:03 +00:00
coord hl, 5, 0
2016-06-12 04:30:05 +00:00
ld b, 2
ld c, 9
2014-05-22 22:13:20 +00:00
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
2016-01-03 19:17:10 +00:00
ld de, wPlayTimeHours
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
2016-01-03 19:17:10 +00:00
ld de, wPlayTimeMinutes
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
2015-08-13 05:14:31 +00:00
ld hl, wDexRatingText
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
HoFPrintTextAndDelay:
2014-05-22 22:13:20 +00:00
call PrintText
ld c, 120
2014-05-22 22:13:20 +00:00
jp DelayFrames
2016-06-12 00:24:04 +00:00
HoFPlayTimeText:
2014-05-22 22:13:20 +00:00
db "PLAY TIME@"
2016-06-12 00:24:04 +00:00
HoFMoneyText:
2014-05-22 22:13:20 +00:00
db "MONEY@"
2016-06-12 00:24:04 +00:00
DexSeenOwnedText:
text_far _DexSeenOwnedText
text_end
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
DexRatingText:
text_far _DexRatingText
text_end
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
HoFRecordMonInfo:
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
ld bc, NAME_LENGTH
2014-05-22 22:13:20 +00:00
jp CopyData
2016-06-12 00:24:04 +00:00
HoFFadeOutScreenAndMusic:
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