summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorpikalaxalt <PikalaxALT@gmail.com>2016-05-27 15:55:56 -0400
committerpikalaxalt <PikalaxALT@gmail.com>2016-05-27 15:55:56 -0400
commit1524d902bf223115fac0f9f528826049817d28c7 (patch)
treec5ed2baf4f9984c5abd74fb4563338d4c2b0bd63 /engine
parentf508b9263752d7c5a53999811f51d1cc0b2b1ed4 (diff)
Credits. Can I add my own name? Kappa
Diffstat (limited to 'engine')
-rwxr-xr-xengine/HoF_room_pc.asm333
-rw-r--r--engine/bank3c.asm3
2 files changed, 195 insertions, 141 deletions
diff --git a/engine/HoF_room_pc.asm b/engine/HoF_room_pc.asm
index e00fc57d..51575a9d 100755
--- a/engine/HoF_room_pc.asm
+++ b/engine/HoF_room_pc.asm
@@ -1,173 +1,214 @@
-HallOfFamePC: ; 7405c (1d:405c)
- callba AnimateHallOfFame
+HallOfFamePC:
+ callab FallingStarEnd
call ClearScreen
ld c, 100
call DelayFrames
+
call DisableLCD
- ld hl, vFont
- ld bc, $800 / 2
- call ZeroMemory
- ld hl, vChars2 + $600
- ld bc, $200 / 2
- call ZeroMemory
- ld hl, vChars2 + $7e0
- ld bc, $10
- ld a, $ff
- call FillMemory
+ ld a, $a7
+ ld [rWX], a
+ xor a
+ ld [rSCX], a
+ ld [rSCY], a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld [hWY], a
+ ld [rWY], a
+ call CreditsLoadFont
coord hl, 0, 0
call FillFourRowsWithBlack
coord hl, 0, 14
call FillFourRowsWithBlack
- ld a, $c0
+ ld a, %11000000
ld [rBGP], a
+ call UpdateGBCPal_BGP
call EnableLCD
- ld a, $ff
- call PlaySoundWaitForCurrent
+ call StopAllMusic
+ ld hl, vBGMap1
+ call CreditsCopyTileMapToVRAM
+ ld hl, vBGMap0
+ call CreditsCopyTileMapToVRAM
ld c, BANK(Music_Credits)
ld a, MUSIC_CREDITS
call PlayMusic
ld c, 128
call DelayFrames
xor a
- ld [wUnusedCD3D], a ; not read
+ ld [wHoFMonSpecies], a
ld [wNumCreditsMonsDisplayed], a
jp Credits
-FadeInCreditsText: ; 740ba (1d:40ba)
+FadeInCreditsText:
+ ld a, $1
+ ld [H_AUTOBGTRANSFERENABLED], a
ld hl, HoFGBPalettes
ld b, 4
-.asm_740bf
+.asm_f0f91
ld a, [hli]
ld [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 5
call DelayFrames
dec b
- jr nz, .asm_740bf
+ jr nz, .asm_f0f91
ret
-DisplayCreditsMon: ; 740cb (1d:40cb)
- xor a
- ld [H_AUTOBGTRANSFERENABLED],a
- call SaveScreenTilesToBuffer1
- call FillMiddleOfScreenWithWhite
+HoFGBPalettes:
+ db %11000000
+ db %11010000
+ db %11100000
+ db %11110000
- ; display the next monster from CreditsMons
- ld hl,wNumCreditsMonsDisplayed
- ld c,[hl] ; how many monsters have we displayed so far?
- inc [hl]
- ld b,0
- ld hl,CreditsMons
- add hl,bc ; go that far in the list of monsters and get the next one
- ld a,[hl]
- ld [wcf91],a
- ld [wd0b5],a
- coord hl, 8, 6
- call GetMonHeader
- call LoadFrontSpriteByMonIndex
- ld hl,vBGMap0 + $c
+DisplayCreditsMon:
+ ld hl, vBGMap1
call CreditsCopyTileMapToVRAM
xor a
- ld [H_AUTOBGTRANSFERENABLED],a
- call LoadScreenTilesFromBuffer1
- ld hl,vBGMap0
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld hl, rLCDC
+ set 3, [hl]
+ call SaveScreenTilesToBuffer2
+ call FillMiddleOfScreenWithWhite
+ call GetNextCreditsMon
+ ld hl, vBGMap0 + 12
call CreditsCopyTileMapToVRAM
- ld a,$A7
- ld [rWX],a
- ld hl,vBGMap1
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ call LoadScreenTilesFromBuffer2DisableBGTransfer
+ ld hl, vBGMap0
call CreditsCopyTileMapToVRAM
- call FillMiddleOfScreenWithWhite
- ld a,%11111100 ; make the mon a black silhouette
- ld [rBGP],a
-
-; scroll the mon left by one tile 7 times
- ld bc,7
-.scrollLoop1
+ ld a, %11111100
+ ld [rBGP], a
+ call UpdateGBCPal_BGP
+ ld hl, rLCDC
+ res 3, [hl]
+ ld a, 1
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld b, 0
+ ld c, 10
call ScrollCreditsMonLeft
- dec c
- jr nz,.scrollLoop1
-
-; scroll the mon left by one tile 20 times
-; This time, we have to move the window left too in order to hide the text that
-; is wrapping around to the right side of the screen.
- ld c,20
-.scrollLoop2
+ call FillLeftHalfOfScreenWithWhite
+ ld c, 10
call ScrollCreditsMonLeft
- ld a,[rWX]
- sub 8
- ld [rWX],a
- dec c
- jr nz,.scrollLoop2
-
+ call FillRightHalfOfScreenWithWhite
+ ld c, 8
+ call ScrollCreditsMonLeft
+ ld a, %11000000
+ ld [rBGP], a
+ call UpdateGBCPal_BGP
xor a
- ld [hWY],a
- ld a,%11000000
- ld [rBGP],a
+ ld [hSCX], a
ret
-INCLUDE "data/credit_mons.asm"
-
-ScrollCreditsMonLeft: ; 74140 (1d:4140)
- ld h, b
- ld l, $20
- call ScrollCreditsMonLeft_SetSCX
- ld h, $0
- ld l, $70
- call ScrollCreditsMonLeft_SetSCX
+ScrollCreditsMonLeft:
+.asm_f0fff
ld a, b
- add $8
+ ld [hSCX], a
+ add 8
ld b, a
+ call DelayFrame
+ dec c
+ jr nz, .asm_f0fff
ret
-ScrollCreditsMonLeft_SetSCX: ; 74152 (1d:4152)
- ld a, [rLY]
- cp l
- jr nz, ScrollCreditsMonLeft_SetSCX
- ld a, h
- ld [rSCX], a
-.loop
- ld a, [rLY]
- cp h
- jr z, .loop
+GetNextCreditsMon:
+ ld hl, wNumCreditsMonsDisplayed
+ ld c, [hl]
+ inc [hl]
+ ld b, 0
+ ld hl, CreditsMons
+ add hl, bc
+ ld a, [hl]
+ ld [wcf91], a
+ ld [wd0b5], a
+ coord hl, 8, 6
+ call GetMonHeader
+ call LoadFrontSpriteByMonIndex
ret
-HoFGBPalettes: ; 74160 (1d:4160)
- db %11000000
- db %11010000
- db %11100000
- db %11110000
+INCLUDE "data/credit_mons.asm"
-CreditsCopyTileMapToVRAM: ; 74164 (1d:4164)
+CreditsCopyTileMapToVRAM:
ld a, l
- ld [H_AUTOBGTRANSFERDEST], a
+ ld [$ffbc], a
ld a, h
- ld [H_AUTOBGTRANSFERDEST + 1], a
- ld a, 1
+ ld [$ffbd], a
+ ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a
jp Delay3
-ZeroMemory: ; 74171 (1d:4171)
-; zero bc bytes at hl
+CreditsLoadFont:
+ call LoadFontTilePatterns
+ ld hl, vChars1
+ ld bc, $40 * $10
+ call ZeroMemory
+
+ call LoadTextBoxTilePatterns
+ ld hl, vChars2 + $60 * $10
+ ld bc, $10 * $10
+ call ZeroMemory
+
+ ld hl, vChars2 + $7e * $10
+ ld bc, $1 * $10
+ ld a, $ff
+ call FillMemory
+ ret
+
+ZeroMemory:
+.asm_f1071
ld [hl], 0
inc hl
inc hl
dec bc
ld a, b
or c
- jr nz, ZeroMemory
+ jr nz, .asm_f1071
ret
-FillFourRowsWithBlack: ; 7417b (1d:417b)
- ld bc, SCREEN_WIDTH * 4
+FillFourRowsWithBlack:
+ ld bc, 4 * SCREEN_WIDTH
ld a, $7e
jp FillMemory
-FillMiddleOfScreenWithWhite: ; 74183 (1d:4183)
+FillMiddleOfScreenWithWhite:
coord hl, 0, 4
- ld bc, SCREEN_WIDTH * 10
+ ld bc, 10 * SCREEN_WIDTH
ld a, " "
jp FillMemory
-Credits: ; 7418e (1d:418e)
+FillLeftHalfOfScreenWithWhite:
+ coord hl, 0, 4
+ push bc
+ call FillHalfOfScreenWithWhite
+ pop bc
+ ret
+
+FillRightHalfOfScreenWithWhite:
+ coord hl, 10, 4
+ push bc
+ call FillHalfOfScreenWithWhite
+ pop bc
+ ret
+
+FillHalfOfScreenWithWhite:
+ ld b, 10
+ ld c, 10
+ ld a, " "
+.asm_f10a6
+ push bc
+ push hl
+.asm_f10a8
+ ld [hli], a
+ dec c
+ jr nz, .asm_f10a8
+ pop hl
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .asm_f10a6
+ ret
+
+Credits: ; Roll credits
ld de, CreditsOrder
push de
.nextCreditsScreen
@@ -192,58 +233,48 @@ Credits: ; 7418e (1d:418e)
jr z, .showCopyrightText
cp $fa
jr z, .showTheEnd
- push hl
- push hl
- ld hl, CreditsTextPointers
- add a
- ld c, a
- ld b, 0
- add hl, bc
- ld e, [hl]
- inc hl
- ld d, [hl]
- ld a, [de]
- inc de
- ld c, a
- ld b, $ff
- pop hl
- add hl, bc
- call PlaceString
- pop hl
- ld bc, SCREEN_WIDTH * 2
- add hl, bc
+ call PlaceCreditsText
pop de
jr .nextCreditsCommand
+
+.showCopyrightText
+ callba LoadCopyrightTiles
+ pop de
+ jr .nextCreditsCommand
+
+
.fadeInTextAndShowMon
call FadeInCreditsText
- ld c, 90
+ ld c, 102
jr .next1
+
.showTextAndShowMon
- ld c, 110
+ ld c, 122
.next1
call DelayFrames
call DisplayCreditsMon
jr .nextCreditsScreen
+
.fadeInText
call FadeInCreditsText
- ld c, 120
+ ld c, 132
jr .next2
+
.showText
- ld c, 140
+ ld c, 152
.next2
call DelayFrames
jr .nextCreditsScreen
-.showCopyrightText
- push de
- callba LoadCopyrightTiles
- pop de
- pop de
- jr .nextCreditsCommand
+
.showTheEnd
- ld c, 16
+ call ShowTheEndGFX
+ pop de
+ ret
+
+ShowTheEndGFX:
+ ld c, 24
call DelayFrames
call FillMiddleOfScreenWithWhite
- pop de
ld de, TheEndGfx
ld hl, vChars2 + $600
lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10
@@ -258,8 +289,31 @@ Credits: ; 7418e (1d:418e)
TheEndTextString: ; 74229 (1d:4229)
; "T H E E N D"
- db $60," ",$62," ",$64," ",$64," ",$66," ",$68,"@"
- db $61," ",$63," ",$65," ",$65," ",$67," ",$69,"@"
+ db $60, " ", $62, " ", $64, " ", $64, " ", $66, " ", $68, "@"
+ db $61, " ", $63, " ", $65, " ", $65, " ", $67, " ", $69, "@"
+
+PlaceCreditsText:
+ push hl
+ push hl
+ ld hl, CreditsTextPointers
+ ld c, a
+ ld b, 0
+ add hl, bc
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ pop hl
+ ld a, [de]
+ inc de
+ ld c, a
+ ld b, $ff
+ add hl, bc
+ call PlaceString
+ pop hl
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ ret
INCLUDE "data/credits_order.asm"
@@ -268,3 +322,4 @@ INCLUDE "text/credits_text.asm"
TheEndGfx: ; 7473e (1d:473e) (7473f on blue)
INCBIN "gfx/theend.interleave.2bpp"
TheEndGfxEnd:
+
diff --git a/engine/bank3c.asm b/engine/bank3c.asm
index 61096d27..6174dc0b 100644
--- a/engine/bank3c.asm
+++ b/engine/bank3c.asm
@@ -342,8 +342,7 @@ NurseChanseyText:
TX_FAR _NurseChanseyText
db "@"
- dr $f0f26, $f18bb
-
+INCLUDE "engine/HoF_room_pc.asm"
INCLUDE "scripts/viridiancity2.asm"
INCLUDE "scripts/vermilioncity2.asm"
INCLUDE "scripts/celadoncity2.asm"