2014-02-05 16:07:24 -08:00
|
|
|
INCLUDE "includes.asm"
|
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
|
2017-12-15 14:22:52 -08:00
|
|
|
SECTION "Credits", ROMX
|
2013-02-25 21:51:05 -08:00
|
|
|
|
2015-11-26 18:05:32 -08:00
|
|
|
Credits:: ; 109847
|
2015-12-14 17:06:41 -08:00
|
|
|
bit 6, b ; Hall Of Fame
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, $0
|
2015-12-14 17:06:41 -08:00
|
|
|
jr z, .okay
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, $40
|
2015-12-14 17:06:41 -08:00
|
|
|
.okay
|
2015-10-24 16:49:19 -07:00
|
|
|
ld [wJumptableIndex], a
|
2013-11-24 01:26:10 -08:00
|
|
|
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
|
|
|
|
2015-11-11 20:38:57 -08:00
|
|
|
call ClearBGPalettes
|
2013-11-24 01:26:10 -08:00
|
|
|
call ClearTileMap
|
|
|
|
call ClearSprites
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
ld hl, wCreditsFaux2bpp
|
2013-11-24 01:26:10 -08:00
|
|
|
ld c, $80
|
|
|
|
ld de, $ff00
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
.load_loop
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, e
|
|
|
|
ld [hli], a
|
|
|
|
ld a, d
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-12-14 17:06:41 -08:00
|
|
|
jr nz, .load_loop
|
2013-11-24 01:26:10 -08:00
|
|
|
|
|
|
|
ld de, CreditsBorderGFX
|
2015-10-14 06:29:15 -07:00
|
|
|
ld hl, VTiles2 tile $20
|
2013-11-24 01:26:10 -08:00
|
|
|
lb bc, BANK(CreditsBorderGFX), $09
|
|
|
|
call Request2bpp
|
|
|
|
|
|
|
|
ld de, CopyrightGFX
|
2015-10-14 06:29:15 -07:00
|
|
|
ld hl, VTiles2 tile $60
|
2013-11-24 01:26:10 -08:00
|
|
|
lb bc, BANK(CopyrightGFX), $1d
|
|
|
|
call Request2bpp
|
|
|
|
|
|
|
|
ld de, TheEndGFX
|
2015-10-14 06:29:15 -07:00
|
|
|
ld hl, VTiles2 tile $40
|
2013-11-24 01:26:10 -08:00
|
|
|
lb bc, BANK(TheEndGFX), $10
|
|
|
|
call Request2bpp
|
|
|
|
|
|
|
|
ld a, $ff
|
2015-12-14 17:06:41 -08:00
|
|
|
ld [wCreditsBorderFrame], a
|
2013-11-24 01:26:10 -08:00
|
|
|
xor a
|
2015-12-14 17:06:41 -08:00
|
|
|
ld [wCreditsBorderMon], a
|
2013-11-24 01:26:10 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
call Credits_LoadBorderGFX
|
2013-11-24 01:26:10 -08:00
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
ld hl, VTiles2
|
2015-12-14 17:06:41 -08:00
|
|
|
lb bc, BANK(CreditsMonsGFX), 16
|
2013-11-24 01:26:10 -08:00
|
|
|
call Request2bpp
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
call ConstructCreditsTilemap
|
2013-11-24 01:26:10 -08:00
|
|
|
xor a
|
2015-12-14 17:06:41 -08:00
|
|
|
ld [wCreditsLYOverride], a
|
2013-11-24 01:26:10 -08:00
|
|
|
|
|
|
|
ld hl, LYOverrides
|
|
|
|
ld bc, $100
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
|
2014-12-29 08:47:47 -08:00
|
|
|
ld a, rSCX - $ff00
|
2016-06-13 19:53:33 -07:00
|
|
|
ld [hLCDCPointer], a
|
2013-11-24 01:26:10 -08:00
|
|
|
|
|
|
|
call GetCreditsPalette
|
2015-09-09 16:27:07 -07:00
|
|
|
call SetPalettes
|
2015-01-19 21:31:29 -08:00
|
|
|
ld a, [hVBlank]
|
2013-11-24 01:26:10 -08:00
|
|
|
push af
|
|
|
|
ld a, $5
|
2015-01-19 21:31:29 -08:00
|
|
|
ld [hVBlank], a
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, $1
|
2015-10-16 10:35:43 -07:00
|
|
|
ld [hInMenu], a
|
2013-11-24 01:26:10 -08:00
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
ld [CreditsPos], a
|
2017-12-09 16:41:03 -08:00
|
|
|
ld [CreditsUnusedCD21], a
|
2013-11-24 01:26:10 -08:00
|
|
|
ld [CreditsTimer], a
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
.execution_loop
|
|
|
|
call Credits_HandleBButton
|
|
|
|
call Credits_HandleAButton
|
|
|
|
jr nz, .exit_credits
|
2013-11-24 01:26:10 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
call Credits_Jumptable
|
2013-11-24 01:26:10 -08:00
|
|
|
call DelayFrame
|
2015-12-14 17:06:41 -08:00
|
|
|
jr .execution_loop
|
2013-11-24 01:26:10 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
.exit_credits
|
2015-11-11 20:38:57 -08:00
|
|
|
call ClearBGPalettes
|
2013-11-24 01:26:10 -08:00
|
|
|
xor a
|
2016-06-13 19:53:33 -07:00
|
|
|
ld [hLCDCPointer], a
|
2013-11-24 01:26:10 -08:00
|
|
|
ld [hBGMapAddress], a
|
|
|
|
pop af
|
2015-01-19 21:31:29 -08:00
|
|
|
ld [hVBlank], a
|
2013-11-24 01:26:10 -08:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
; 1098fd
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_HandleAButton: ; 1098fd
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, [hJoypadDown]
|
2015-12-14 17:06:41 -08:00
|
|
|
and A_BUTTON
|
2013-11-24 01:26:10 -08:00
|
|
|
ret z
|
2015-10-24 16:49:19 -07:00
|
|
|
ld a, [wJumptableIndex]
|
2013-11-24 01:26:10 -08:00
|
|
|
bit 7, a
|
|
|
|
ret
|
|
|
|
; 109908
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_HandleBButton: ; 109908
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, [hJoypadDown]
|
2015-12-14 17:06:41 -08:00
|
|
|
and B_BUTTON
|
2013-11-24 01:26:10 -08:00
|
|
|
ret z
|
2015-10-24 16:49:19 -07:00
|
|
|
ld a, [wJumptableIndex]
|
2013-11-24 01:26:10 -08:00
|
|
|
bit 6, a
|
|
|
|
ret z
|
|
|
|
ld hl, CreditsPos
|
|
|
|
ld a, [hli]
|
|
|
|
cp $d
|
2015-12-14 17:06:41 -08:00
|
|
|
jr nc, .okay
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, [hli]
|
|
|
|
and a
|
|
|
|
ret z
|
2015-12-14 17:06:41 -08:00
|
|
|
.okay
|
2013-11-24 01:26:10 -08:00
|
|
|
ld hl, CreditsTimer
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
; 109926
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_Jumptable: ; 109926
|
2015-10-24 16:49:19 -07:00
|
|
|
ld a, [wJumptableIndex]
|
2013-11-24 01:26:10 -08:00
|
|
|
and $f
|
|
|
|
ld e, a
|
2015-01-01 20:59:08 -08:00
|
|
|
ld d, 0
|
2015-12-14 17:06:41 -08:00
|
|
|
ld hl, .Jumptable
|
2013-11-24 01:26:10 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-17 16:14:55 -07:00
|
|
|
jp hl
|
2013-11-24 01:26:10 -08:00
|
|
|
; 109937
|
|
|
|
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
.Jumptable: ; 109937 (42:5937)
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2015-12-26 18:59:03 -08:00
|
|
|
dw ParseCredits
|
|
|
|
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_UpdateGFXRequestPath
|
|
|
|
dw Credits_RequestGFX
|
|
|
|
dw Credits_LoopBack
|
2015-12-14 17:06:41 -08:00
|
|
|
|
|
|
|
|
|
|
|
Credits_Next: ; 109951 (42:5951)
|
2015-10-24 16:49:19 -07:00
|
|
|
ld hl, wJumptableIndex
|
2013-11-24 01:26:10 -08:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_LoopBack: ; 109956 (42:5956)
|
2015-10-24 16:49:19 -07:00
|
|
|
ld hl, wJumptableIndex
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and $f0
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_PrepBGMapUpdate: ; 10995e (42:595e)
|
2013-11-24 01:26:10 -08:00
|
|
|
xor a
|
2015-11-10 13:53:37 -08:00
|
|
|
ld [hBGMapMode], a
|
2015-12-14 17:06:41 -08:00
|
|
|
jp Credits_Next
|
2013-11-24 01:26:10 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_UpdateGFXRequestPath: ; 109964 (42:5964)
|
|
|
|
call Credits_LoadBorderGFX
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, l
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [Requested2bppSource], a
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, h
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [Requested2bppSource + 1], a
|
2015-12-14 17:06:41 -08:00
|
|
|
ld a, VTiles2 % $100
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [Requested2bppDest], a
|
2015-12-14 17:06:41 -08:00
|
|
|
ld a, VTiles2 / $100
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [Requested2bppDest + 1], a
|
2015-12-14 17:06:41 -08:00
|
|
|
jr Credits_RequestGFX
|
2013-11-24 01:26:10 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_RequestGFX: ; 10997b (42:597b)
|
2013-11-24 01:26:10 -08:00
|
|
|
xor a
|
2015-11-10 13:53:37 -08:00
|
|
|
ld [hBGMapMode], a
|
2013-11-24 01:26:10 -08:00
|
|
|
ld a, $8
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [Requested2bpp], a
|
2015-12-14 17:06:41 -08:00
|
|
|
jp Credits_Next
|
2013-11-24 01:26:10 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_LYOverride: ; 109986 (42:5986)
|
2015-11-10 13:53:37 -08:00
|
|
|
ld a, [rLY]
|
2013-11-24 01:26:10 -08:00
|
|
|
cp $30
|
2015-12-14 17:06:41 -08:00
|
|
|
jr c, Credits_LYOverride
|
|
|
|
ld a, [wCreditsLYOverride]
|
2013-11-24 01:26:10 -08:00
|
|
|
dec a
|
2016-05-04 08:46:23 -07:00
|
|
|
dec a
|
2015-12-14 17:06:41 -08:00
|
|
|
ld [wCreditsLYOverride], a
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, LYOverrides + $1f
|
2015-12-14 17:06:41 -08:00
|
|
|
call .Fill
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, LYOverrides + $87
|
2015-12-14 17:06:41 -08:00
|
|
|
call .Fill
|
|
|
|
jp Credits_Next
|
2013-11-24 01:26:10 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
.Fill: ; 1099a3 (42:59a3)
|
2013-11-24 01:26:10 -08:00
|
|
|
ld c, $8
|
2015-12-14 17:06:41 -08:00
|
|
|
.loop
|
2013-11-24 01:26:10 -08:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-12-14 17:06:41 -08:00
|
|
|
jr nz, .loop
|
2013-11-24 01:26:10 -08:00
|
|
|
ret
|
|
|
|
; 1099aa
|
|
|
|
|
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
ParseCredits: ; 1099aa
|
2015-10-24 16:49:19 -07:00
|
|
|
ld hl, wJumptableIndex
|
2013-02-25 21:51:05 -08:00
|
|
|
bit 7, [hl]
|
|
|
|
jp nz, .done
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
; Wait until the timer has run out to parse the next command.
|
|
|
|
ld hl, CreditsTimer
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .parse
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
; One tick has passed.
|
|
|
|
dec [hl]
|
|
|
|
jp .done
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.parse
|
|
|
|
; First, let's clear the current text display,
|
|
|
|
; starting from line 5.
|
|
|
|
xor a
|
2015-11-09 13:41:09 -08:00
|
|
|
ld [hBGMapMode], a
|
2013-02-25 21:51:05 -08:00
|
|
|
hlcoord 0, 5
|
|
|
|
ld bc, 20 * 12
|
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
; Then read the script.
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.loop
|
|
|
|
call .get
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
; Commands:
|
2013-11-27 21:55:32 -08:00
|
|
|
cp CREDITS_END
|
2013-02-25 21:51:05 -08:00
|
|
|
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
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
; If it's not a command, it's a string identifier.
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
push af
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
ld hl, CreditsStrings
|
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2013-02-25 21:51:05 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld d, [hl]
|
|
|
|
ld e, a
|
|
|
|
pop af
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
; Strings spanning multiple lines have special cases.
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
cp COPYRIGHT
|
|
|
|
jr z, .copyright
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
cp STAFF
|
|
|
|
jr c, .staff
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
; The rest start from line 6.
|
|
|
|
|
|
|
|
hlcoord 0, 6
|
|
|
|
jr .print
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.copyright
|
|
|
|
hlcoord 2, 6
|
|
|
|
jr .print
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.staff
|
|
|
|
hlcoord 0, 6
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.print
|
|
|
|
; Print strings spaced every two lines.
|
|
|
|
call .get
|
|
|
|
ld bc, 20 * 2
|
|
|
|
call AddNTimes
|
|
|
|
call PlaceString
|
|
|
|
jr .loop
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.theend
|
|
|
|
; Display "The End" graphic.
|
2015-12-14 17:06:41 -08:00
|
|
|
call Credits_TheEnd
|
2013-02-25 21:51:05 -08:00
|
|
|
jr .loop
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.scene
|
|
|
|
; Update the scene number and corresponding palette.
|
|
|
|
call .get
|
2015-12-14 17:06:41 -08:00
|
|
|
ld [wCreditsBorderMon], a ; scene
|
2013-02-25 21:51:05 -08:00
|
|
|
xor a
|
2015-12-14 17:06:41 -08:00
|
|
|
ld [wCreditsBorderFrame], a ; frame
|
2013-02-25 21:51:05 -08:00
|
|
|
call GetCreditsPalette
|
2015-09-09 16:27:07 -07:00
|
|
|
call SetPalettes ; update hw pal registers
|
2013-02-25 21:51:05 -08:00
|
|
|
jr .loop
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.clear
|
|
|
|
; Clear the banner.
|
|
|
|
ld a, $ff
|
2015-12-14 17:06:41 -08:00
|
|
|
ld [wCreditsBorderFrame], a ; frame
|
2013-02-25 21:51:05 -08:00
|
|
|
jr .loop
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.music
|
|
|
|
; Play the credits music.
|
|
|
|
ld de, MUSIC_CREDITS
|
|
|
|
push de
|
|
|
|
ld de, MUSIC_NONE
|
2013-10-08 10:21:15 -07:00
|
|
|
call PlayMusic
|
2013-02-25 21:51:05 -08:00
|
|
|
call DelayFrame
|
|
|
|
pop de
|
2013-10-08 10:21:15 -07:00
|
|
|
call PlayMusic
|
2013-02-25 21:51:05 -08:00
|
|
|
jp .loop
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.wait2
|
|
|
|
; Wait for some amount of ticks.
|
|
|
|
call .get
|
|
|
|
ld [CreditsTimer], a
|
|
|
|
jr .done
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.wait
|
|
|
|
; Wait for some amount of ticks, and do something else.
|
|
|
|
call .get
|
|
|
|
ld [CreditsTimer], a
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
xor a
|
2015-11-09 13:41:09 -08:00
|
|
|
ld [hBGMapThird], a
|
2013-02-25 21:51:05 -08:00
|
|
|
ld a, 1
|
2015-11-09 13:41:09 -08:00
|
|
|
ld [hBGMapMode], a
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.done
|
2015-12-14 17:06:41 -08:00
|
|
|
jp Credits_Next
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
.end
|
|
|
|
; Stop execution.
|
2015-10-24 16:49:19 -07:00
|
|
|
ld hl, wJumptableIndex
|
2013-02-25 21:51:05 -08:00
|
|
|
set 7, [hl]
|
2015-12-14 17:06:41 -08:00
|
|
|
ld a, 32
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [MusicFade], a
|
|
|
|
ld a, MUSIC_POST_CREDITS % $100
|
|
|
|
ld [MusicFadeID], a
|
|
|
|
ld a, MUSIC_POST_CREDITS / $100
|
2017-12-09 10:52:14 -08:00
|
|
|
ld [MusicFadeID + 1], a
|
2013-02-25 21:51:05 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.get
|
|
|
|
; Get byte CreditsPos from CreditsScript
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
ld a, [CreditsPos]
|
|
|
|
ld e, a
|
|
|
|
ld a, [CreditsPos+1]
|
|
|
|
ld d, a
|
|
|
|
ld hl, CreditsScript
|
|
|
|
add hl, de
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
inc de
|
|
|
|
ld a, e
|
|
|
|
ld [CreditsPos], a
|
|
|
|
ld a, d
|
|
|
|
ld [CreditsPos+1], a
|
|
|
|
ld a, [hl]
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 109a95
|
|
|
|
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
ConstructCreditsTilemap: ; 109a95 (42:5a95)
|
2013-10-01 21:53:35 -07:00
|
|
|
xor a
|
2015-11-10 13:53:37 -08:00
|
|
|
ld [hBGMapMode], a
|
2013-10-01 21:53:35 -07:00
|
|
|
ld a, $c
|
2015-11-10 13:53:37 -08:00
|
|
|
ld [hBGMapAddress], a
|
2015-12-14 17:06:41 -08:00
|
|
|
|
2013-10-01 21:53:35 -07:00
|
|
|
ld a, $28
|
2015-07-22 12:57:02 -07:00
|
|
|
hlcoord 0, 0
|
2015-12-14 17:06:41 -08:00
|
|
|
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
|
2013-10-01 21:53:35 -07:00
|
|
|
call ByteFill
|
2015-12-14 17:06:41 -08:00
|
|
|
|
2013-10-01 21:53:35 -07:00
|
|
|
ld a, $7f
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 0, 4
|
2015-12-14 17:06:41 -08:00
|
|
|
ld bc, (SCREEN_HEIGHT - 4) * SCREEN_WIDTH
|
2013-10-01 21:53:35 -07:00
|
|
|
call ByteFill
|
2015-12-14 17:06:41 -08:00
|
|
|
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 0, 4
|
2013-10-01 21:53:35 -07:00
|
|
|
ld a, $24
|
2015-12-14 17:06:41 -08:00
|
|
|
call DrawCreditsBorder
|
|
|
|
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 0, 17
|
2013-10-01 21:53:35 -07:00
|
|
|
ld a, $20
|
2015-12-14 17:06:41 -08:00
|
|
|
call DrawCreditsBorder
|
|
|
|
|
2015-07-22 12:57:02 -07:00
|
|
|
hlcoord 0, 0, AttrMap
|
2015-12-14 17:06:41 -08:00
|
|
|
ld bc, 4 * SCREEN_WIDTH
|
2013-10-01 21:53:35 -07:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
2015-12-14 17:06:41 -08:00
|
|
|
|
2015-02-10 14:16:31 -08:00
|
|
|
hlcoord 0, 4, AttrMap
|
2015-12-14 17:06:41 -08:00
|
|
|
ld bc, SCREEN_WIDTH
|
2013-10-01 21:53:35 -07:00
|
|
|
ld a, $1
|
|
|
|
call ByteFill
|
2015-12-14 17:06:41 -08:00
|
|
|
|
2015-02-10 14:16:31 -08:00
|
|
|
hlcoord 0, 5, AttrMap
|
2015-12-14 17:06:41 -08:00
|
|
|
ld bc, 12 * SCREEN_WIDTH
|
2013-10-01 21:53:35 -07:00
|
|
|
ld a, $2
|
|
|
|
call ByteFill
|
2015-12-14 17:06:41 -08:00
|
|
|
|
2015-02-10 14:16:31 -08:00
|
|
|
hlcoord 0, 17, AttrMap
|
2015-12-14 17:06:41 -08:00
|
|
|
ld bc, SCREEN_WIDTH
|
2013-10-01 21:53:35 -07:00
|
|
|
ld a, $1
|
|
|
|
call ByteFill
|
2015-12-14 17:06:41 -08:00
|
|
|
|
2015-12-11 13:59:40 -08:00
|
|
|
call WaitBGMap2
|
2013-10-01 21:53:35 -07:00
|
|
|
xor a
|
2015-11-10 13:53:37 -08:00
|
|
|
ld [hBGMapMode], a
|
|
|
|
ld [hBGMapAddress], a
|
2015-07-22 12:57:02 -07:00
|
|
|
hlcoord 0, 0
|
2015-12-14 17:06:41 -08:00
|
|
|
call .InitTopPortion
|
2015-12-11 13:59:40 -08:00
|
|
|
call WaitBGMap2
|
2013-10-01 21:53:35 -07:00
|
|
|
ret
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
.InitTopPortion: ; 109aff (42:5aff)
|
|
|
|
ld b, 5
|
|
|
|
.outer_loop
|
2013-10-01 21:53:35 -07:00
|
|
|
push hl
|
2015-12-14 17:06:41 -08:00
|
|
|
ld de, SCREEN_WIDTH - 3
|
|
|
|
ld c, 4
|
2013-10-01 21:53:35 -07:00
|
|
|
xor a
|
2015-12-14 17:06:41 -08:00
|
|
|
.inner_loop
|
|
|
|
rept 3
|
2013-10-01 21:53:35 -07:00
|
|
|
ld [hli], a
|
|
|
|
inc a
|
2015-12-14 17:06:41 -08:00
|
|
|
endr
|
2013-10-01 21:53:35 -07:00
|
|
|
ld [hl], a
|
|
|
|
inc a
|
|
|
|
add hl, de
|
|
|
|
dec c
|
2015-12-14 17:06:41 -08:00
|
|
|
jr nz, .inner_loop
|
2013-10-01 21:53:35 -07:00
|
|
|
pop hl
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 4
|
2013-10-01 21:53:35 -07:00
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2013-10-01 21:53:35 -07:00
|
|
|
dec b
|
2015-12-14 17:06:41 -08:00
|
|
|
jr nz, .outer_loop
|
2013-10-01 21:53:35 -07:00
|
|
|
ret
|
2013-02-25 21:51:05 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
DrawCreditsBorder: ; 109b1d (42:5b1d)
|
|
|
|
ld c, SCREEN_WIDTH / 4
|
|
|
|
.loop
|
2013-10-01 21:53:35 -07:00
|
|
|
push af
|
2015-12-14 17:06:41 -08:00
|
|
|
rept 3
|
2013-10-01 21:53:35 -07:00
|
|
|
ld [hli], a
|
|
|
|
inc a
|
2015-12-14 17:06:41 -08:00
|
|
|
endr
|
2013-10-01 21:53:35 -07:00
|
|
|
ld [hli], a
|
|
|
|
pop af
|
|
|
|
dec c
|
2015-12-14 17:06:41 -08:00
|
|
|
jr nz, .loop
|
2013-10-01 21:53:35 -07:00
|
|
|
ret
|
2013-02-25 21:51:05 -08:00
|
|
|
|
|
|
|
GetCreditsPalette: ; 109b2c
|
|
|
|
call .GetPalAddress
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
push hl
|
|
|
|
ld a, 0
|
|
|
|
call .UpdatePals
|
|
|
|
pop hl
|
|
|
|
ret
|
2016-04-10 11:42:14 -07:00
|
|
|
|
|
|
|
.GetPalAddress:
|
2013-02-25 21:51:05 -08:00
|
|
|
; Each set of palette data is 24 bytes long.
|
2015-12-14 17:06:41 -08:00
|
|
|
ld a, [wCreditsBorderMon] ; scene
|
2013-02-25 21:51:05 -08:00
|
|
|
and 3
|
|
|
|
add a
|
|
|
|
add a ; * 8
|
|
|
|
add a
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2013-11-24 01:09:17 -08:00
|
|
|
ld hl, CreditsPalettes
|
2013-02-25 21:51:05 -08:00
|
|
|
add hl, de
|
|
|
|
add hl, de ; * 3
|
|
|
|
add hl, de
|
|
|
|
ret
|
2016-04-10 11:42:14 -07:00
|
|
|
|
|
|
|
.UpdatePals:
|
2013-02-25 21:51:05 -08:00
|
|
|
; Update the first three colors in both palette buffers.
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
push af
|
|
|
|
push hl
|
2015-11-20 12:15:32 -08:00
|
|
|
add UnknBGPals % $100
|
2013-02-25 21:51:05 -08:00
|
|
|
ld e, a
|
|
|
|
ld a, 0
|
2015-11-20 12:15:32 -08:00
|
|
|
adc UnknBGPals / $100
|
2013-02-25 21:51:05 -08:00
|
|
|
ld d, a
|
|
|
|
ld bc, 24
|
|
|
|
call CopyBytes
|
2016-04-10 11:42:14 -07:00
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
pop hl
|
|
|
|
pop af
|
2015-02-10 14:16:31 -08:00
|
|
|
add BGPals % $100
|
2013-02-25 21:51:05 -08:00
|
|
|
ld e, a
|
|
|
|
ld a, 0
|
2015-02-10 14:16:31 -08:00
|
|
|
adc BGPals / $100
|
2013-02-25 21:51:05 -08:00
|
|
|
ld d, a
|
|
|
|
ld bc, 24
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2013-11-24 01:09:17 -08:00
|
|
|
CreditsPalettes:
|
2013-11-27 21:55:32 -08:00
|
|
|
|
|
|
|
; Pichu
|
|
|
|
RGB 31, 00, 31
|
|
|
|
RGB 31, 25, 00
|
|
|
|
RGB 11, 14, 31
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 31, 05, 05
|
|
|
|
RGB 11, 14, 31
|
|
|
|
RGB 11, 14, 31
|
|
|
|
RGB 31, 31, 31
|
|
|
|
|
|
|
|
RGB 31, 05, 05
|
|
|
|
RGB 00, 00, 00
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 31
|
|
|
|
|
|
|
|
; Smoochum
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 27, 00
|
|
|
|
RGB 26, 06, 31
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 03, 13, 31
|
|
|
|
RGB 20, 00, 24
|
|
|
|
RGB 26, 06, 31
|
|
|
|
RGB 31, 31, 31
|
|
|
|
|
|
|
|
RGB 03, 13, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 31
|
|
|
|
|
|
|
|
; Ditto
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 23, 12, 28
|
|
|
|
RGB 31, 22, 00
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 03, 20, 00
|
|
|
|
RGB 31, 22, 00
|
|
|
|
RGB 31, 22, 00
|
|
|
|
RGB 31, 31, 31
|
|
|
|
|
|
|
|
RGB 03, 20, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 31
|
|
|
|
|
|
|
|
; Igglybuff
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 10, 31
|
|
|
|
RGB 31, 00, 09
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 31, 14, 00
|
|
|
|
RGB 31, 00, 09
|
|
|
|
RGB 31, 00, 09
|
|
|
|
RGB 31, 31, 31
|
|
|
|
|
|
|
|
RGB 31, 14, 00
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 31
|
2013-02-25 21:51:05 -08:00
|
|
|
; 109bca
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_LoadBorderGFX: ; 109bca (42:5bca)
|
|
|
|
ld hl, wCreditsBorderFrame
|
2013-10-01 14:23:21 -07:00
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
2015-12-14 17:06:41 -08:00
|
|
|
jr z, .init
|
2013-11-24 01:09:17 -08:00
|
|
|
|
|
|
|
and 3
|
2013-10-01 14:23:21 -07:00
|
|
|
ld e, a
|
|
|
|
inc a
|
2013-11-24 01:09:17 -08:00
|
|
|
and 3
|
2013-10-01 14:23:21 -07:00
|
|
|
ld [hl], a
|
2015-12-14 17:06:41 -08:00
|
|
|
ld a, [wCreditsBorderMon]
|
2013-11-24 01:09:17 -08:00
|
|
|
and 3
|
2013-10-01 14:23:21 -07:00
|
|
|
add a
|
2016-05-04 08:46:23 -07:00
|
|
|
add a
|
2013-10-01 14:23:21 -07:00
|
|
|
add e
|
|
|
|
add a
|
|
|
|
ld e, a
|
2013-11-24 01:09:17 -08:00
|
|
|
ld d, 0
|
2015-12-14 17:06:41 -08:00
|
|
|
ld hl, .Frames
|
2013-10-01 14:23:21 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ret
|
2013-11-24 01:09:17 -08:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
.init
|
|
|
|
ld hl, wCreditsFaux2bpp
|
2013-10-01 14:23:21 -07:00
|
|
|
ret
|
|
|
|
; 109bf1 (42:5bf1)
|
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
.Frames: ; 109bf1
|
2013-11-24 01:09:17 -08:00
|
|
|
dw CreditsPichuGFX
|
2015-12-14 17:06:41 -08:00
|
|
|
dw CreditsPichuGFX + 16 tiles
|
|
|
|
dw CreditsPichuGFX + 32 tiles
|
|
|
|
dw CreditsPichuGFX + 48 tiles
|
2013-11-24 01:09:17 -08:00
|
|
|
dw CreditsSmoochumGFX
|
2015-12-14 17:06:41 -08:00
|
|
|
dw CreditsSmoochumGFX + 16 tiles
|
|
|
|
dw CreditsSmoochumGFX + 32 tiles
|
|
|
|
dw CreditsSmoochumGFX + 48 tiles
|
2013-11-24 01:09:17 -08:00
|
|
|
dw CreditsDittoGFX
|
2015-12-14 17:06:41 -08:00
|
|
|
dw CreditsDittoGFX + 16 tiles
|
|
|
|
dw CreditsDittoGFX + 32 tiles
|
|
|
|
dw CreditsDittoGFX + 48 tiles
|
2013-11-24 01:09:17 -08:00
|
|
|
dw CreditsIgglybuffGFX
|
2015-12-14 17:06:41 -08:00
|
|
|
dw CreditsIgglybuffGFX + 16 tiles
|
|
|
|
dw CreditsIgglybuffGFX + 32 tiles
|
|
|
|
dw CreditsIgglybuffGFX + 48 tiles
|
2013-11-24 01:09:17 -08:00
|
|
|
; 109c11
|
2013-10-01 14:23:21 -07:00
|
|
|
|
2015-12-14 17:06:41 -08:00
|
|
|
Credits_TheEnd: ; 109c11 (42:5c11)
|
2013-10-01 14:23:21 -07:00
|
|
|
ld a, $40
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 6, 9
|
2015-12-14 17:06:41 -08:00
|
|
|
call .Load
|
2014-06-04 01:10:56 -07:00
|
|
|
hlcoord 6, 10
|
2015-12-14 17:06:41 -08:00
|
|
|
.Load: ; 109c1c (42:5c1c)
|
|
|
|
ld c, 8
|
|
|
|
.loop
|
2013-10-01 14:23:21 -07:00
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
dec c
|
2015-12-14 17:06:41 -08:00
|
|
|
jr nz, .loop
|
2013-10-01 14:23:21 -07:00
|
|
|
ret
|
|
|
|
; 109c24 (42:5c24)
|
|
|
|
|
2013-02-25 21:51:05 -08:00
|
|
|
|
2017-12-15 14:22:52 -08:00
|
|
|
INCLUDE "gfx/credits.asm"
|
2013-11-27 21:55:32 -08:00
|
|
|
|
2017-12-15 14:22:52 -08:00
|
|
|
INCLUDE "data/credits_script.asm"
|
2013-02-25 21:51:05 -08:00
|
|
|
|
2017-12-15 14:22:52 -08:00
|
|
|
INCLUDE "data/credits_strings.asm"
|