Add halloffame.asm and credits.asm

This commit is contained in:
libjet
2020-05-28 19:47:18 +01:00
parent 2e0371d637
commit 0cf765a4f5
20 changed files with 1562 additions and 13 deletions

View File

@@ -76,3 +76,13 @@
const US_COORDINATION
const TEXT_TRANSLATION
const PAAD_TESTING
; CreditsScript indexes (see data/credits_script.asm)
const_def -7
const CREDITS_THEEND
const CREDITS_WAIT2
const CREDITS_MUSIC
const CREDITS_CLEAR
const CREDITS_SCENE
const CREDITS_WAIT
const CREDITS_END

257
data/credits_script.asm Executable file
View File

@@ -0,0 +1,257 @@
CreditsScript:
; Clear the banner.
db CREDITS_CLEAR
; Pokemon Gold/Silver Version Staff
db STAFF, 0
db CREDITS_WAIT, 8
; Play the credits music.
db CREDITS_MUSIC
db CREDITS_WAIT2, 10
db CREDITS_WAIT, 1
; Update the banner.
db CREDITS_SCENE, 0 ; Bellossom
db DIRECTOR, 1
db SATOSHI_TAJIRI, 2
db CREDITS_WAIT, 12
db SUBDIRECTOR, 1
db JUNICHI_MASUDA, 2
db CREDITS_WAIT, 12
db PROGRAMMERS, 0
db TETSUYA_WATANABE, 1
db SHIGEKI_MORIMOTO, 2
db CREDITS_WAIT, 12
db PROGRAMMERS, 0
db SOUSUKE_TAMADA, 1
db TAKENORI_OOTA, 2
db CREDITS_WAIT, 12
db GRAPHICS_DIRECTOR, 1
db KEN_SUGIMORI, 2
db CREDITS_WAIT, 12
db MONSTER_DESIGN, 0
db KEN_SUGIMORI, 1
db MOTOFUMI_FUJIWARA, 2
db CREDITS_WAIT, 12
db MONSTER_DESIGN, 0
db SHIGEKI_MORIMOTO, 1
db ATSUKO_NISHIDA, 2
db CREDITS_WAIT, 12
db MONSTER_DESIGN, 0
db HIRONOBU_YOSHIDA, 1
db MUNEO_SAITO, 2
db CREDITS_WAIT, 12
db CREDITS_WAIT, 0
; Clear the banner.
db CREDITS_CLEAR
db CREDITS_WAIT, 1
; Update the banner.
db CREDITS_SCENE, 1 ; Togepi
db MONSTER_DESIGN, 0
db SATOSHI_OOTA, 1
db RENA_YOSHIKAWA, 2
db CREDITS_WAIT, 12
db GRAPHICS_DESIGN, 0
db JUN_OKUTANI, 1
db ASUKA_IWASHITA, 2
db TETSUYA_WATANABE, 3
db CREDITS_WAIT, 12
db CREDIT_MUSIC, 0
db JUNICHI_MASUDA, 1
db GO_ICHINOSE, 2
db CREDITS_WAIT, 12
db CREDIT_SOUND_EFFECTS, 0
db MORIKAZU_AOKI, 1
db JUNICHI_MASUDA, 2
db TETSUYA_WATANABE, 3
db CREDITS_WAIT, 12
db GAME_DESIGN, 0
db SATOSHI_TAJIRI, 1
db KOHJI_NISHINO, 2
db SHIGEKI_MORIMOTO, 3
db CREDITS_WAIT, 12
db GAME_DESIGN, 0
db JUNICHI_MASUDA, 1
db KENJI_MATSUSHIMA, 2
db CREDITS_WAIT, 12
db GAME_SCENARIO, 0
db TOSHINOBU_MATSUMIYA, 1
db KENJI_MATSUSHIMA, 2
db CREDITS_WAIT, 12
db TOOL_PROGRAMMING, 1
db TAKENORI_OOTA, 2
db CREDITS_WAIT, 12
db CREDITS_WAIT, 0
; Clear the banner.
db CREDITS_CLEAR
db CREDITS_WAIT, 1
; Update the banner.
db CREDITS_SCENE, 2 ; Elekid
db PARAMETRIC_DESIGN, 1
db KOHJI_NISHINO, 2
db CREDITS_WAIT, 12
db SCRIPT_DESIGN, 1
db NOBUHIRO_SEYA, 2
db CREDITS_WAIT, 12
db MAP_DATA_DESIGN, 1
db KAZUHITO_SEKINE, 2
db CREDITS_WAIT, 12
db MAP_DESIGN, 0
db TETSUJI_OOTA, 1
db KOHJI_NISHINO, 2
db NOBUHIRO_SEYA, 3
db CREDITS_WAIT, 12
db PRODUCERS, 1
db TAKEHIRO_IZUSHI, 2
db CREDITS_WAIT, 12
db PRODUCERS, 1
db TAKASHI_KAWAGUCHI, 2
db CREDITS_WAIT, 12
db PRODUCERS, 1
db TSUNEKAZU_ISHIHARA, 2
db CREDITS_WAIT, 12
db CREDITS_WAIT, 0
; Clear the banner.
db CREDITS_CLEAR
db CREDITS_WAIT, 1
; Update the banner.
db CREDITS_SCENE, 3 ; Sentret
db US_VERSION_STAFF, 1
db CREDITS_WAIT, 12
db US_COORDINATION, 0
db GAIL_TILDEN, 1
db HIRO_NAKAMURA, 2
db CREDITS_WAIT, 12
db US_COORDINATION, 0
db JUNICHI_MASUDA, 1
db NAOKO_KAWAKAMI, 2
db CREDITS_WAIT, 12
db US_COORDINATION, 0
db JEFF_KALLES, 1
db WILLIAM_GIESE, 2
db CREDITS_WAIT, 12
db TEXT_TRANSLATION, 1
db NOB_OGASAWARA, 2
db CREDITS_WAIT, 12
db PROGRAMMERS, 0
db TERUKI_MURAKAWA, 1
db KAZUYOSHI_OSAWA, 2
db CREDITS_WAIT, 12
db PAAD_TESTING, 0
db RANDY_SHOEMAKE, 1
db KATHY_HUGUENARD, 2
db JOEL_SIMON, 3
db CREDITS_WAIT, 12
db PRODUCT_TESTING, 0
db NCL_SUPER_MARIO_CLUB, 1
db KENJI_SAIKI, 2
db ATSUSHI_TADA, 3
db CREDITS_WAIT, 12
db SPECIAL_THANKS, 0
db AKITO_MORI, 1
db TAKAHIRO_HARADA, 2
db SATORU_IWATA, 3
db CREDITS_WAIT, 12
db SPECIAL_THANKS, 0
db HIROYUKI_ZINNAI, 1
db KUNIMI_KAWAMURA, 2
db KIMIKO_NAKAMICHI, 3
db CREDITS_WAIT, 12
db EXECUTIVE_PRODUCER, 1
db HIROSHI_YAMAUCHI, 2
db CREDITS_WAIT, 12
db COPYRIGHT, 0
db CREDITS_WAIT, 20
db CREDITS_WAIT, 19
; Display "The End" graphic.
db CREDITS_THEEND
db CREDITS_WAIT, 20
db CREDITS_END

607
engine/events/halloffame.asm Executable file
View File

@@ -0,0 +1,607 @@
HALLOFFAME_COLON EQU $63
HallOfFame::
call HallOfFame_FadeOutMusic
ld a, [wStatusFlags]
push af
ld a, 1
ld [wGameLogicPaused], a
call DisableSpriteUpdates
ld a, SPAWN_LANCE
ld [wSpawnAfterChampion], a
; Enable the Pokégear map to cycle through all of Kanto
ld hl, wStatusFlags
set STATUSFLAGS_HALL_OF_FAME_F, [hl]
ld hl, wHallOfFameCount
ld a, [hl]
cp HOF_MASTER_COUNT
jr nc, .ok
inc [hl]
.ok
farcall SaveGameData
call GetHallOfFameParty
farcall AddHallOfFameEntry
xor a
ld [wGameLogicPaused], a
call AnimateHallOfFame
pop af
jp Credits
RedCredits::
ld a, LOW(MUSIC_NONE)
ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
ld [wMusicFadeID + 1], a
ld a, 10
ld [wMusicFade], a
farcall FadeOutPalettes
xor a
ld [wVramState], a
ldh [hMapAnims], a
farcall InitDisplayForRedCredits
ld c, 8
call DelayFrames
call DisableSpriteUpdates
ld a, SPAWN_RED
ld [wSpawnAfterChampion], a
ld a, [wStatusFlags]
jp Credits
HallOfFame_FadeOutMusic:
ld a, LOW(MUSIC_NONE)
ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
ld [wMusicFadeID + 1], a
ld a, 10
ld [wMusicFade], a
farcall FadeOutPalettes
xor a
ld [wVramState], a
ldh [hMapAnims], a
farcall InitDisplayForHallOfFame
ld c, 100
jp DelayFrames
HallOfFame_PlayMusicDE:
push de
ld de, MUSIC_NONE
call PlayMusic
call DelayFrame
pop de
call PlayMusic
ret
AnimateHallOfFame:
xor a
ld [wJumptableIndex], a
call LoadHOFTeam
jr c, .done
ld de, MUSIC_HALL_OF_FAME
call HallOfFame_PlayMusicDE
xor a
ld [wHallOfFameMonCounter], a
.loop
ld a, [wHallOfFameMonCounter]
cp PARTY_LENGTH
jr nc, .done
ld hl, wHallOfFameTempMon1
ld bc, wHallOfFameTempMon1End - wHallOfFameTempMon1
call AddNTimes
ld a, [hl]
cp -1
jr z, .done
push hl
call AnimateHOFMonEntrance
pop hl
call .DisplayNewHallOfFamer
jr c, .done
ld hl, wHallOfFameMonCounter
inc [hl]
jr .loop
.done
call HOF_AnimatePlayerPic
ld a, 4
ld [wMusicFade], a
call RotateThreePalettesRight
ld c, 8
call DelayFrames
ret
.DisplayNewHallOfFamer:
call DisplayHOFMon
ld de, .String_NewHallOfFamer
hlcoord 1, 2
call PlaceString
call WaitBGMap
ld a, [wCurPartySpecies]
call PlayMonCry
ld c, 180
call DelayFrames
and a
ret
.String_NewHallOfFamer:
db "New Hall of Famer!@"
GetHallOfFameParty:
ld hl, wHallOfFamePokemonList
ld bc, wHallOfFamePokemonListEnd - wHallOfFamePokemonList + 1
xor a
call ByteFill
ld a, [wHallOfFameCount]
ld de, wHallOfFamePokemonList
ld [de], a
inc de
ld hl, wPartySpecies
ld c, 0
.next
ld a, [hli]
cp -1
jr z, .done
cp EGG
jr nz, .mon
inc c
jr .next
.mon
push hl
push de
push bc
ld a, c
ld hl, wPartyMons
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld c, l
ld b, h
ld hl, MON_SPECIES
add hl, bc
ld a, [hl]
ld [de], a
inc de
ld hl, MON_ID
add hl, bc
ld a, [hli]
ld [de], a
inc de
ld a, [hl]
ld [de], a
inc de
ld hl, MON_DVS
add hl, bc
ld a, [hli]
ld [de], a
inc de
ld a, [hl]
ld [de], a
inc de
ld hl, MON_LEVEL
add hl, bc
ld a, [hl]
ld [de], a
inc de
pop bc
push bc
ld a, c
ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
call AddNTimes
ld bc, MON_NAME_LENGTH - 1
call CopyBytes
pop bc
inc c
pop de
ld hl, wHallOfFamePokemonListMon1End - wHallOfFamePokemonListMon1
add hl, de
ld e, l
ld d, h
pop hl
jr .next
.done
ld a, -1
ld [de], a
ret
AnimateHOFMonEntrance:
push hl
call ClearBGPalettes
pop hl
ld a, [hli]
ld [wTempMonSpecies], a
ld [wCurPartySpecies], a
inc hl
inc hl
ld a, [hli]
ld [wTempMonDVs], a
ld a, [hli]
ld [wTempMonDVs + 1], a
ld hl, wTempMonDVs
predef GetUnownLetter
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
ld de, vTiles2 tile $31
predef GetMonBackpic
ld a, $31
ldh [hGraphicStartTile], a
hlcoord 6, 6
lb bc, 6, 6
predef PlaceGraphic
ld a, $d0
ldh [hSCY], a
ld a, $90
ldh [hSCX], a
call WaitBGMap
xor a
ldh [hBGMapMode], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
call HOF_SlideBackpic
xor a
ld [wBoxAlignment], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
hlcoord 6, 5
call _PrepMonFrontpic
call WaitBGMap
xor a
ldh [hBGMapMode], a
ldh [hSCY], a
call HOF_SlideFrontpic
ret
HOF_SlideBackpic:
.backpicloop
ldh a, [hSCX]
cp $70
ret z
add 4
ldh [hSCX], a
call DelayFrame
jr .backpicloop
HOF_SlideFrontpic:
.frontpicloop
ldh a, [hSCX]
and a
ret z
dec a
dec a
ldh [hSCX], a
call DelayFrame
jr .frontpicloop
_HallOfFamePC:
call LoadFontsBattleExtra
xor a
ld [wJumptableIndex], a
.MasterLoop:
call LoadHOFTeam
ret c
call .DisplayTeam
ret c
ld hl, wJumptableIndex
inc [hl]
jr .MasterLoop
.DisplayTeam:
xor a
ld [wHallOfFameMonCounter], a
.next
call .DisplayMonAndStrings
jr c, .start_button
.loop
call JoyTextDelay
ld hl, hJoyLast
ld a, [hl]
and B_BUTTON
jr nz, .b_button
ld a, [hl]
and A_BUTTON
jr nz, .a_button
ld a, [hl]
and START
jr nz, .start_button
call DelayFrame
jr .loop
.a_button
ld hl, wHallOfFameMonCounter
inc [hl]
jr .next
.b_button
scf
ret
.start_button
and a
ret
.DisplayMonAndStrings:
; Print the number of times the player has entered the Hall of Fame.
; If that number is at least HOF_MASTER_COUNT, print "HOF Master!" instead.
ld a, [wHallOfFameMonCounter]
cp PARTY_LENGTH
jr nc, .fail
ld hl, wHallOfFameTempMon1
ld bc, wHallOfFameTempMon1End - wHallOfFameTempMon1
call AddNTimes
ld a, [hl]
cp -1
jr nz, .okay
.fail
scf
ret
.okay
push hl
call ClearBGPalettes
pop hl
call DisplayHOFMon
ld a, [wHallOfFameTempWinCount]
cp HOF_MASTER_COUNT + 1 ; should be HOF_MASTER_COUNT
jr c, .print_num_hof
ld de, .HOFMaster
hlcoord 1, 2
call PlaceString
hlcoord 13, 2
jr .finish
.print_num_hof
ld de, .TimeFamer
hlcoord 1, 2
call PlaceString
hlcoord 2, 2
ld de, wHallOfFameTempWinCount
lb bc, 1, 3
call PrintNum
hlcoord 11, 2
.finish
ld de, .EmptyString1
call PlaceString
call WaitBGMap
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
ld a, [wCurPartySpecies]
call PlayMonCry
and a
ret
.EmptyString1:
db "@"
.EmptyString2:
db "@"
.HOFMaster:
db " HOF Master!@"
.TimeFamer:
db " -Time Famer@"
LoadHOFTeam:
ld a, [wJumptableIndex]
cp NUM_HOF_TEAMS
jr nc, .invalid
ld hl, sHallOfFame
ld bc, wHallOfFameTempEnd - wHallOfFameTemp + 1
call AddNTimes
ld a, BANK(sHallOfFame)
call OpenSRAM
ld a, [hl]
and a
jr z, .absent
ld de, wHallOfFameTemp
ld bc, wHallOfFameTempEnd - wHallOfFameTemp + 1
call CopyBytes
call CloseSRAM
and a
ret
.absent
call CloseSRAM
.invalid
scf
ret
DisplayHOFMon:
xor a
ldh [hBGMapMode], a
ld a, [hli]
ld [wTempMonSpecies], a
ld a, [hli]
ld [wTempMonID], a
ld a, [hli]
ld [wTempMonID + 1], a
ld a, [hli]
ld [wTempMonDVs], a
ld a, [hli]
ld [wTempMonDVs + 1], a
ld a, [hli]
ld [wTempMonLevel], a
ld de, wStringBuffer2
ld bc, MON_NAME_LENGTH - 1
call CopyBytes
ld a, "@"
ld [wStringBuffer2 + MON_NAME_LENGTH - 1], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
hlcoord 0, 0
lb bc, 3, SCREEN_WIDTH - 2
call Textbox
hlcoord 0, 12
lb bc, 4, SCREEN_WIDTH - 2
call Textbox
ld a, [wTempMonSpecies]
ld [wCurPartySpecies], a
ld [wDeciramBuffer], a
ld hl, wTempMonDVs
predef GetUnownLetter
xor a
ld [wBoxAlignment], a
hlcoord 6, 5
call _PrepMonFrontpic
ld a, [wCurPartySpecies]
cp EGG
jr z, .print_id_no
hlcoord 1, 13
ld a, "№"
ld [hli], a
ld [hl], "."
hlcoord 3, 13
ld de, wDeciramBuffer
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
call PrintNum
call GetBasePokemonName
hlcoord 7, 13
call PlaceString
ld a, TEMPMON
ld [wMonType], a
farcall GetGender
ld a, " "
jr c, .got_gender
ld a, "♂"
jr nz, .got_gender
ld a, "♀"
.got_gender
hlcoord 18, 13
ld [hli], a
hlcoord 8, 14
ld a, "/"
ld [hli], a
ld de, wStringBuffer2
call PlaceString
hlcoord 1, 16
call PrintLevel
.print_id_no
hlcoord 7, 16
ld a, "<ID>"
ld [hli], a
ld a, "№"
ld [hli], a
ld [hl], "/"
hlcoord 10, 16
ld de, wTempMonID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ret
HOF_AnimatePlayerPic:
call ClearBGPalettes
ld hl, vTiles2 tile HALLOFFAME_COLON
ld de, FontExtra + 13 tiles ; "<COLON>"
lb bc, BANK(FontExtra), 1
call Request2bpp
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
ld hl, ChrisBackpic
ld de, vTiles2 tile $31
ld b, BANK(ChrisBackpic)
ld c, 7 * 7
predef DecompressGet2bpp
ld a, $31
ldh [hGraphicStartTile], a
hlcoord 6, 6
lb bc, 6, 6
predef PlaceGraphic
ld a, $d0
ldh [hSCY], a
ld a, $90
ldh [hSCX], a
call WaitBGMap
xor a
ldh [hBGMapMode], a
ld [wCurPartySpecies], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
call HOF_SlideBackpic
xor a
ld [wBoxAlignment], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
ld a, $0c
ld [wTrainerClass], a
ld de, vTiles2
farcall GetTrainerPic
xor a
ldh [hGraphicStartTile], a
hlcoord 12, 5
lb bc, 7, 7
predef PlaceGraphic
ld a, $c0
ldh [hSCX], a
call WaitBGMap
xor a
ldh [hBGMapMode], a
ldh [hSCY], a
call HOF_SlideFrontpic
xor a
ldh [hBGMapMode], a
hlcoord 0, 2
lb bc, 8, 9
call Textbox
hlcoord 0, 12
lb bc, 4, 18
call Textbox
hlcoord 2, 4
ld de, wPlayerName
call PlaceString
hlcoord 1, 6
ld a, "<ID>"
ld [hli], a
ld a, "№"
ld [hli], a
ld [hl], "/"
hlcoord 4, 6
ld de, wPlayerID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
hlcoord 1, 8
ld de, .PlayTime
call PlaceString
hlcoord 3, 9
ld de, wGameTimeHours
lb bc, 2, 3
call PrintNum
ld [hl], HALLOFFAME_COLON
inc hl
ld de, wGameTimeMinutes
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
call WaitBGMap
farcall ProfOaksPCRating
ret
.PlayTime:
db "PLAY TIME@"

627
engine/movie/credits.asm Executable file
View File

@@ -0,0 +1,627 @@
Credits::
ld b, a
bit 6, b ; Hall Of Fame
ld a, $0
jr z, .okay
ld a, $40
.okay
ld [wJumptableIndex], a
call ClearBGPalettes
call ClearTilemap
call ClearSprites
ld hl, wCreditsBlankFrame2bpp
ld c, (wCreditsBlankFrame2bppEnd - wCreditsBlankFrame2bpp) / 2
ld de, `22222222 ; eight pixels, each color #2 (dark)
; Fill wCreditsBlankFrame2bpp with 4x4=16 tiles, all solid dark color
; (the same color used for the four border frame mons' backgrounds)
.load_loop
ld a, e
ld [hli], a
ld a, d
ld [hli], a
dec c
jr nz, .load_loop
ld de, CreditsBorderGFX
ld hl, vTiles2 tile $20
lb bc, BANK(CreditsBorderGFX), 9
call Request2bpp
ld de, CopyrightGFX
ld hl, vTiles2 tile $60
lb bc, BANK(CopyrightGFX), 30
call Request2bpp
ld de, TheEndGFX
ld hl, vTiles2 tile $40
lb bc, BANK(TheEndGFX), 16
call Request2bpp
ld a, $ff
ld [wCreditsBorderFrame], a
xor a
ld [wCreditsBorderMon], a
call Credits_LoadBorderGFX
ld e, l
ld d, h
ld hl, vTiles2
lb bc, BANK(CreditsMonsGFX), 16
call Request2bpp
call ConstructCreditsTilemap
xor a
ld [wCreditsLYOverride], a
ld hl, wLYOverrides
ld bc, $100
xor a
call ByteFill
ld a, LOW(rSCX)
ldh [hLCDCPointer], a
call GetCreditsPalette
call SetPalettes
ldh a, [hVBlank]
push af
ld a, 5
ldh [hVBlank], a
ld a, 1
ldh [hInMenu], a
xor a
ldh [hBGMapMode], a
ld [wCreditsPos], a
ld [wCreditsPos + 1], a
ld [wCreditsTimer], a
.execution_loop
call Credits_HandleBButton
call Credits_HandleAButton
jr nz, .exit_credits
call Credits_Jumptable
call DelayFrame
jr .execution_loop
.exit_credits
call ClearBGPalettes
xor a
ldh [hLCDCPointer], a
ldh [hBGMapAddress], a
pop af
ldh [hVBlank], a
ret
Credits_HandleAButton:
ldh a, [hJoypadDown]
and A_BUTTON
ret z
ld a, [wJumptableIndex]
bit 7, a
ret
Credits_HandleBButton:
ldh a, [hJoypadDown]
and B_BUTTON
ret z
ld a, [wJumptableIndex]
bit 6, a
ret z
ld hl, wCreditsPos
ld a, [hli]
cp $d
jr nc, .okay
ld a, [hli]
and a
ret z
.okay
ld hl, wCreditsTimer
ld a, [hl]
and a
ret z
dec [hl]
ret
Credits_Jumptable:
ld a, [wJumptableIndex]
and $f
ld e, a
ld d, 0
ld hl, .Jumptable
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
jp hl
.Jumptable:
dw ParseCredits
dw Credits_Next
dw Credits_Next
dw Credits_Next
dw Credits_PrepBGMapUpdate
dw Credits_UpdateGFXRequestPath
dw Credits_RequestGFX
dw Credits_LYOverride
dw Credits_Next
dw Credits_Next
dw Credits_Next
dw Credits_Next
dw Credits_LoopBack
Credits_Next:
ld hl, wJumptableIndex
inc [hl]
ret
Credits_LoopBack:
ld hl, wJumptableIndex
ld a, [hl]
and $f0
ld [hl], a
ret
Credits_PrepBGMapUpdate:
xor a
ldh [hBGMapMode], a
jp Credits_Next
Credits_UpdateGFXRequestPath:
call Credits_LoadBorderGFX
ld a, l
ld [wRequested2bppSource], a
ld a, h
ld [wRequested2bppSource + 1], a
ld a, LOW(vTiles2)
ld [wRequested2bppDest], a
ld a, HIGH(vTiles2)
ld [wRequested2bppDest + 1], a
jr Credits_RequestGFX
Credits_RequestGFX:
xor a
ldh [hBGMapMode], a
ld a, 8
ld [wRequested2bpp], a
jp Credits_Next
Credits_LYOverride:
ldh a, [rLY]
cp $30
jr c, Credits_LYOverride
ld a, [wCreditsLYOverride]
inc a
inc a
ld [wCreditsLYOverride], a
ld hl, wLYOverrides + $1f
call .Fill
ld hl, wLYOverrides + $67
call .Fill
jp Credits_Next
.Fill:
ld c, 8
.loop
ld [hli], a
dec c
jr nz, .loop
ret
ParseCredits:
ld hl, wJumptableIndex
bit 7, [hl]
jp nz, .done
; Wait until the timer has run out to parse the next command.
ld hl, wCreditsTimer
ld a, [hl]
and a
jr z, .parse
; One tick has passed.
dec [hl]
jp .done
.parse
; First, let's clear the current text display,
; starting from line 5.
xor a
ldh [hBGMapMode], a
hlcoord 0, 5
ld bc, SCREEN_WIDTH * 8
ld a, " "
call ByteFill
; Then read the script.
.loop
call .get
; Commands:
cp CREDITS_END
jp z, .end
cp CREDITS_WAIT
jr z, .wait
cp CREDITS_SCENE
jr z, .scene
cp CREDITS_CLEAR
jr z, .clear
cp CREDITS_MUSIC
jr z, .music
cp CREDITS_WAIT2
jr z, .wait2
cp CREDITS_THEEND
jr z, .theend
; If it's not a command, it's a string identifier.
push af
ld e, a
ld d, 0
ld hl, CreditsStringsPointers
add hl, de
add hl, de
ld a, [hli]
ld d, [hl]
ld e, a
pop af
; Strings spanning multiple lines have special cases.
cp COPYRIGHT
jr z, .copyright
cp STAFF
jr c, .staff
; The rest start from line 6.
hlcoord 0, 6
jr .print
.copyright
hlcoord 2, 6
jr .print
.staff
hlcoord 0, 6
.print
; Print strings spaced every two lines.
call .get
ld bc, SCREEN_WIDTH * 2
call AddNTimes
ld a, $70
call FarString
jr .loop
.theend
; Display "The End" graphic.
call Credits_TheEnd
jr .loop
.scene
; Update the scene number and corresponding palette.
call .get
ld [wCreditsBorderMon], a ; scene
xor a
ld [wCreditsBorderFrame], a ; frame
call GetCreditsPalette
call SetPalettes ; update hw pal registers
jr .loop
.clear
; Clear the banner.
ld a, $ff
ld [wCreditsBorderFrame], a ; frame
jr .loop
.music
; Play the credits music.
ld de, $24
call HallOfFame_PlayMusicDE
jr .loop
.wait2
; Wait for some amount of ticks.
call .get
ld [wCreditsTimer], a
jr .done
.wait
; Wait for some amount of ticks, and do something else.
call .get
ld [wCreditsTimer], a
xor a
ldh [hBGMapThird], a
ld a, 1
ldh [hBGMapMode], a
.done
jp Credits_Next
.end
; Stop execution.
ld hl, wJumptableIndex
set 7, [hl]
ld a, 32
ld [wMusicFade], a
ld a, LOW(MUSIC_POST_CREDITS)
ld [wMusicFadeID], a
ld a, HIGH(MUSIC_POST_CREDITS)
ld [wMusicFadeID + 1], a
ret
.get
; Get byte wCreditsPos from CreditsScript
push hl
push de
ld a, [wCreditsPos]
ld e, a
ld a, [wCreditsPos + 1]
ld d, a
ld hl, CreditsScript
add hl, de
inc de
ld a, e
ld [wCreditsPos], a
ld a, d
ld [wCreditsPos + 1], a
ld a, [hl]
pop de
pop hl
ret
ConstructCreditsTilemap:
xor a
ldh [hBGMapMode], a
ld a, $c
ldh [hBGMapAddress], a
ld a, $28
hlcoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
call ByteFill
ld a, $7f
hlcoord 0, 4
ld bc, 10 * SCREEN_WIDTH
call ByteFill
hlcoord 0, 4
ld a, $24
call DrawCreditsBorder
hlcoord 0, 13
ld a, $20
call DrawCreditsBorder
hlcoord 0, 0, wAttrmap
ld bc, 4 * SCREEN_WIDTH
xor a
call ByteFill
hlcoord 0, 4, wAttrmap
ld bc, 10 * SCREEN_WIDTH
ld a, $1
call ByteFill
hlcoord 0, 14, wAttrmap
ld bc, 4 * SCREEN_WIDTH
xor a
call ByteFill
call WaitBGMap2
xor a
ldh [hBGMapMode], a
ldh [hBGMapAddress], a
ld hl, wTilemap
call .InitTopPortion
hlcoord 0, 14
call .InitTopPortion
call WaitBGMap2
ret
.InitTopPortion:
ld b, 5
.outer_loop
push hl
ld de, SCREEN_WIDTH - 3
ld c, 4
xor a
.inner_loop
rept 3
ld [hli], a
inc a
endr
ld [hl], a
inc a
add hl, de
dec c
jr nz, .inner_loop
pop hl
rept 4
inc hl
endr
dec b
jr nz, .outer_loop
ret
DrawCreditsBorder:
ld c, SCREEN_WIDTH / 4
.loop
push af
rept 3
ld [hli], a
inc a
endr
ld [hli], a
pop af
dec c
jr nz, .loop
ret
GetCreditsPalette:
ldh a, [hCGB]
and a
jr nz, .asm_6bcf
ldh a, [hSGB]
and a
ret z
call .GetPalAddress
inc hl
inc hl
ld a, [hli]
ld c, a
ld a, [hli]
ld b, a
ld a, [hli]
ld e, a
ld d, [hl]
farcall Function908e
ret
.asm_6bcf
call .GetPalAddress
push hl
ld a, 0
call .UpdatePals
pop hl
ld a, 8
call .UpdatePals
ld hl, wBGPals1 + 14
xor a
ld [hli], a
ld [hl], a
ld hl, wBGPals1 + 142
xor a
ld [hli], a
ld [hl], a
ret
.GetPalAddress:
; Each set of palette data is 8 bytes long.
ld a, [wCreditsBorderMon] ; scene
and %11
add a
add a ; * 8
add a
ld e, a
ld d, 0
ld hl, CreditsPalettes
add hl, de
ret
.UpdatePals:
; Update the first three colors in both palette buffers.
push af
push hl
add LOW(wBGPals1)
ld e, a
ld a, 0
adc HIGH(wBGPals1)
ld d, a
ld bc, 8
call CopyBytes
pop hl
pop af
add LOW(wBGPals2)
ld e, a
ld a, 0
adc HIGH(wBGPals2)
ld d, a
ld bc, 8
call CopyBytes
ret
CreditsPalettes:
INCLUDE "gfx/credits/credits.pal"
Credits_LoadBorderGFX:
ld hl, wCreditsBorderFrame
ld a, [hl]
cp $ff
jr z, .init
and %11
ld e, a
inc a
and %11
ld [hl], a
ld a, [wCreditsBorderMon]
and %11
add a
add a
add e
add a
ld e, a
ld d, 0
ld hl, .Frames
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
ret
.init
ld hl, wCreditsBlankFrame2bpp
ret
.Frames:
dw CreditsBellossomGFX
dw CreditsBellossomGFX + 16 tiles
dw CreditsBellossomGFX
dw CreditsBellossomGFX + 32 tiles
dw CreditsTogepiGFX
dw CreditsTogepiGFX + 16 tiles
dw CreditsTogepiGFX
dw CreditsTogepiGFX + 32 tiles
dw CreditsElekidGFX
dw CreditsElekidGFX + 16 tiles
dw CreditsElekidGFX
dw CreditsElekidGFX + 32 tiles
dw CreditsSentretGFX
dw CreditsSentretGFX + 16 tiles
dw CreditsSentretGFX + 32 tiles
dw CreditsSentretGFX + 48 tiles
Credits_TheEnd:
ld a, $40
hlcoord 6, 8
call .Load
hlcoord 6, 9
.Load:
ld c, 8
.loop
ld [hli], a
inc a
dec c
jr nz, .loop
ret
CreditsBorderGFX: INCBIN "gfx/credits/border.2bpp"
CreditsMonsGFX: ; used only for BANK(CreditsMonsGFX)
CreditsBellossomGFX: INCBIN "gfx/credits/bellossom.2bpp"
CreditsTogepiGFX: INCBIN "gfx/credits/togepi.2bpp"
CreditsElekidGFX: INCBIN "gfx/credits/elekid.2bpp"
CreditsSentretGFX: INCBIN "gfx/credits/sentret.2bpp"
INCLUDE "data/credits_script.asm"
INCLUDE "data/credits_strings_pointers.asm"

BIN
gfx/credits/bellossom.2bpp Executable file

Binary file not shown.

BIN
gfx/credits/bellossom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

BIN
gfx/credits/border.2bpp Executable file

Binary file not shown.

BIN
gfx/credits/border.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

11
gfx/credits/credits.pal Executable file
View File

@@ -0,0 +1,11 @@
RGB 31,31,31, 29,08,27, 15,24,12
RGB 07,07,07, 31,31,31, 30,26,11
RGB 31,11,27, 07,07,07, 31,31,31
RGB 31,31,05, 17,23,31, 07,07,07
RGB 31,31,31, 22,15,10, 31,19,09
RGB 07,07,07, 21,25,31, 31,31,31
RGB 31,31,31, 19,00,00, 31,31,31
RGB 18,23,31, 15,20,31, 00,00,00

BIN
gfx/credits/elekid.2bpp Executable file

Binary file not shown.

BIN
gfx/credits/elekid.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

BIN
gfx/credits/sentret.2bpp Executable file

Binary file not shown.

BIN
gfx/credits/sentret.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

BIN
gfx/credits/theend.2bpp Executable file

Binary file not shown.

BIN
gfx/credits/theend.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

BIN
gfx/credits/togepi.2bpp Executable file

Binary file not shown.

BIN
gfx/credits/togepi.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

View File

@@ -228,14 +228,8 @@ INCLUDE "engine/printer/printer.asm"
AnimObj00GFX:
dr $84a2a, $8640a
HallOfFame::
dr $8640a, $86446
RedCredits::
dr $86446, $86632
_HallOfFamePC::
dr $86632, $87b65
INCLUDE "data/credits_strings_pointers.asm"
INCLUDE "engine/events/halloffame.asm"
INCLUDE "engine/movie/credits.asm"
SECTION "bank23", ROMX
@@ -313,7 +307,11 @@ FreezeMonIcons::
UnfreezeMonIcons::
dr $8e922, $8e93d
HoldSwitchmonIcon::
dr $8e93d, $8fe43
dr $8e93d, $8fdbe
InitDisplayForHallOfFame::
dr $8fdbe, $8fdff
InitDisplayForRedCredits::
dr $8fdff, $8fe43
ELIF DEF(_SILVER)
dr $8d332, $8e6e3
@@ -332,7 +330,11 @@ FreezeMonIcons::
UnfreezeMonIcons::
dr $8e908, $8e923
HoldSwitchmonIcon::
dr $8e923, $8fe29
dr $8e923, $8fda4
InitDisplayForHallOfFame::
dr $8fda4, $8fde5
InitDisplayForRedCredits::
dr $8fde5, $8fe43
ENDC
@@ -397,7 +399,9 @@ DummyPredef2F::
INCLUDE "data/moves/animations.asm"
LoadPoisonBGPals::
dr $cbc76, $cbdba
dr $cbc76, $cbcbd
TheEndGFX::
dr $cbcbd, $cbdba
SECTION "Move Animations", ROMX
@@ -512,7 +516,10 @@ LoadHPBar::
StatsScreen_LoadFont::
dr $f80a6, $f80d9
LoadStatsScreenPageTilesGFX::
dr $f80d9, $f8aa2
dr $f80d9, $f80f2
FontExtra:
dr $f80f2, $f8aa2
StatsScreenPageTilesGFX::
dr $f8aa2, $f8bb2
EnemyHPBarBorderGFX::
@@ -523,13 +530,14 @@ ExpBarGFX::
dr $f8c02, $f8c92
TownMapGFX::
dr $f8c92, $f930e
Footprints::
dr $f930e, $fb30e
UnownFont::
dr $fb30e, $fb4be
INCLUDE "data/collision_permissions.asm"
Shrink1Pic::
dr $fb5be, $fb64e
Shrink2Pic::

View File

@@ -106,6 +106,14 @@ def filepath_rules(filepath):
args['pic_dimensions'] = 6, 6
elif name == 'balls':
args['width'] = 32
elif 'gfx/credits' in filedir:
if name in ['bellossom', 'togepi', 'elekid', 'sentret']:
args['width'] = 32
elif name == 'theend':
args['width'] = 64
elif name == 'border':
args['width'] = 72
elif 'gfx/debug' in filedir:
if name == 'color_test':

View File

@@ -286,6 +286,10 @@ wInitMinuteBuffer:: db ; c526
ds 19
wTimeSetBufferEnd::
NEXTU ; c508
; hall of fame temp struct
wHallOfFameTemp:: hall_of_fame wHallOfFameTemp
NEXTU ; c508
; link engine data
wLink_c508:: ds 10
@@ -549,6 +553,11 @@ wLYOverridesBackup:: ds SCREEN_HEIGHT_PX
wLYOverridesBackupEnd:: ds 112
UNION ; c900
; blank credits tile buffer
wCreditsBlankFrame2bpp:: ds 4 * 4 tiles
wCreditsBlankFrame2bppEnd::
NEXTU ; c900
; mystery gift data
wc900:: db
wc901:: db
@@ -1014,6 +1023,12 @@ NEXTU ; ce65
wTitleScreenTimer:: dw
ENDU
NEXTU ; ce64
; credits data
wCreditsBorderFrame:: db
wCreditsBorderMon:: db
wCreditsLYOverride:: db
NEXTU ; ce64
; pokedex
wPrevDexEntryJumptableIndex:: db
@@ -1043,6 +1058,7 @@ NEXTU ; ce64
wFrameCounter::
wMomBankDigitCursorPosition::
wNamingScreenLetterCase::
wHallOfFameMonCounter::
wSlotsDelay::
db
wPrinterQueueLength:: db
@@ -1213,6 +1229,11 @@ UNION ; ceed
; mail temp storage
wTempMail:: mailmsg wTempMail
NEXTU ; ceed
; credits
wCreditsPos:: dw
wCreditsTimer:: db
NEXTU ; ceed
; mon buffer
wBufferMonNick:: ds MON_NAME_LENGTH ; ceed