pokered/engine/HoF_room_pc.asm

271 lines
4.4 KiB
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
HallOfFamePC:
2014-05-22 22:13:20 +00:00
callba AnimateHallOfFame
call ClearScreen
ld c, 100
2014-05-22 22:13:20 +00:00
call DelayFrames
call DisableLCD
2014-05-29 08:31:46 +00:00
ld hl, vFont
ld bc, $800 / 2
2015-07-15 02:46:52 +00:00
call ZeroMemory
2014-05-29 08:31:46 +00:00
ld hl, vChars2 + $600
ld bc, $200 / 2
2015-07-15 02:46:52 +00:00
call ZeroMemory
2014-05-29 08:31:46 +00:00
ld hl, vChars2 + $7e0
2014-05-22 22:13:20 +00:00
ld bc, $10
ld a, $ff
call FillMemory
2015-07-18 20:52:03 +00:00
coord hl, 0, 0
call FillFourRowsWithBlack
2015-07-18 20:52:03 +00:00
coord hl, 0, 14
call FillFourRowsWithBlack
2014-05-22 22:13:20 +00:00
ld a, $c0
ld [rBGP], a
2014-05-22 22:13:20 +00:00
call EnableLCD
ld a, $ff
call PlaySoundWaitForCurrent
ld c, BANK(Music_Credits)
ld a, MUSIC_CREDITS
call PlayMusic
ld c, 128
2014-05-22 22:13:20 +00:00
call DelayFrames
xor a
2015-07-19 21:01:08 +00:00
ld [wUnusedCD3D], a ; not read
2015-07-15 02:46:52 +00:00
ld [wNumCreditsMonsDisplayed], a
2014-05-22 22:13:20 +00:00
jp Credits
2016-06-12 00:24:04 +00:00
FadeInCreditsText:
ld hl, HoFGBPalettes
2015-07-15 02:46:52 +00:00
ld b, 4
2014-05-22 22:13:20 +00:00
.asm_740bf
ld a, [hli]
ld [rBGP], a
ld c, 5
2014-05-22 22:13:20 +00:00
call DelayFrames
dec b
jr nz, .asm_740bf
ret
2016-06-12 00:24:04 +00:00
DisplayCreditsMon:
2014-05-22 22:13:20 +00:00
xor a
ld [H_AUTOBGTRANSFERENABLED],a
call SaveScreenTilesToBuffer1
call FillMiddleOfScreenWithWhite
; display the next monster from CreditsMons
2015-07-15 02:46:52 +00:00
ld hl,wNumCreditsMonsDisplayed
2014-05-22 22:13:20 +00:00
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
2015-07-18 20:52:03 +00:00
coord hl, 8, 6
2014-05-22 22:13:20 +00:00
call GetMonHeader
call LoadFrontSpriteByMonIndex
2014-05-29 08:31:46 +00:00
ld hl,vBGMap0 + $c
2015-07-24 21:39:45 +00:00
call CreditsCopyTileMapToVRAM
2014-05-22 22:13:20 +00:00
xor a
ld [H_AUTOBGTRANSFERENABLED],a
call LoadScreenTilesFromBuffer1
2014-05-29 08:31:46 +00:00
ld hl,vBGMap0
2015-07-24 21:39:45 +00:00
call CreditsCopyTileMapToVRAM
2014-05-22 22:13:20 +00:00
ld a,$A7
2015-07-15 02:46:52 +00:00
ld [rWX],a
2014-05-29 08:31:46 +00:00
ld hl,vBGMap1
2015-07-24 21:39:45 +00:00
call CreditsCopyTileMapToVRAM
2014-05-22 22:13:20 +00:00
call FillMiddleOfScreenWithWhite
2015-07-22 01:58:19 +00:00
ld a,%11111100 ; make the mon a black silhouette
2015-07-13 20:35:35 +00:00
ld [rBGP],a
2015-07-15 02:46:52 +00:00
; scroll the mon left by one tile 7 times
2014-05-22 22:13:20 +00:00
ld bc,7
2015-07-15 02:46:52 +00:00
.scrollLoop1
call ScrollCreditsMonLeft
2014-05-22 22:13:20 +00:00
dec c
2015-07-15 02:46:52 +00:00
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
2015-07-22 01:58:19 +00:00
; is wrapping around to the right side of the screen.
2015-07-15 02:46:52 +00:00
ld c,20
.scrollLoop2
call ScrollCreditsMonLeft
ld a,[rWX]
2014-05-22 22:13:20 +00:00
sub 8
2015-07-15 02:46:52 +00:00
ld [rWX],a
2014-05-22 22:13:20 +00:00
dec c
2015-07-15 02:46:52 +00:00
jr nz,.scrollLoop2
2014-05-22 22:13:20 +00:00
xor a
2014-09-23 22:02:03 +00:00
ld [hWY],a
2015-07-15 02:46:52 +00:00
ld a,%11000000
2015-07-13 20:35:35 +00:00
ld [rBGP],a
2014-05-22 22:13:20 +00:00
ret
INCLUDE "data/credit_mons.asm"
2016-06-12 00:24:04 +00:00
ScrollCreditsMonLeft:
2014-05-22 22:13:20 +00:00
ld h, b
ld l, $20
2015-07-15 02:46:52 +00:00
call ScrollCreditsMonLeft_SetSCX
2014-05-22 22:13:20 +00:00
ld h, $0
ld l, $70
2015-07-15 02:46:52 +00:00
call ScrollCreditsMonLeft_SetSCX
2014-05-22 22:13:20 +00:00
ld a, b
add $8
ld b, a
ret
2016-06-12 00:24:04 +00:00
ScrollCreditsMonLeft_SetSCX:
2015-07-15 02:46:52 +00:00
ld a, [rLY]
2014-05-22 22:13:20 +00:00
cp l
2015-07-15 02:46:52 +00:00
jr nz, ScrollCreditsMonLeft_SetSCX
2014-05-22 22:13:20 +00:00
ld a, h
ld [rSCX], a
2015-07-15 02:46:52 +00:00
.loop
ld a, [rLY]
2014-05-22 22:13:20 +00:00
cp h
2015-07-15 02:46:52 +00:00
jr z, .loop
2014-05-22 22:13:20 +00:00
ret
2016-06-12 00:24:04 +00:00
HoFGBPalettes:
db %11000000
db %11010000
db %11100000
db %11110000
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
CreditsCopyTileMapToVRAM:
2014-05-22 22:13:20 +00:00
ld a, l
ld [H_AUTOBGTRANSFERDEST], a
2014-05-22 22:13:20 +00:00
ld a, h
ld [H_AUTOBGTRANSFERDEST + 1], a
2015-07-24 21:39:45 +00:00
ld a, 1
ld [H_AUTOBGTRANSFERENABLED], a
2014-05-22 22:13:20 +00:00
jp Delay3
2016-06-12 00:24:04 +00:00
ZeroMemory:
2015-07-15 02:46:52 +00:00
; zero bc bytes at hl
ld [hl], 0
2014-05-22 22:13:20 +00:00
inc hl
inc hl
dec bc
ld a, b
or c
2015-07-15 02:46:52 +00:00
jr nz, ZeroMemory
2014-05-22 22:13:20 +00:00
ret
2016-06-12 00:24:04 +00:00
FillFourRowsWithBlack:
ld bc, SCREEN_WIDTH * 4
2014-05-22 22:13:20 +00:00
ld a, $7e
jp FillMemory
2016-06-12 00:24:04 +00:00
FillMiddleOfScreenWithWhite:
2015-07-18 20:52:03 +00:00
coord hl, 0, 4
ld bc, SCREEN_WIDTH * 10
2015-08-05 21:20:29 +00:00
ld a, " "
2014-05-22 22:13:20 +00:00
jp FillMemory
2016-06-12 00:24:04 +00:00
Credits:
ld de, CreditsOrder
2014-05-22 22:13:20 +00:00
push de
2015-07-15 02:46:52 +00:00
.nextCreditsScreen
2014-05-22 22:13:20 +00:00
pop de
2015-07-18 20:52:03 +00:00
coord hl, 9, 6
2014-05-22 22:13:20 +00:00
push hl
call FillMiddleOfScreenWithWhite
pop hl
2015-07-15 02:46:52 +00:00
.nextCreditsCommand
2014-05-22 22:13:20 +00:00
ld a, [de]
inc de
push de
cp $ff
2015-07-15 02:46:52 +00:00
jr z, .fadeInTextAndShowMon
2014-05-22 22:13:20 +00:00
cp $fe
2015-07-15 02:46:52 +00:00
jr z, .showTextAndShowMon
2014-05-22 22:13:20 +00:00
cp $fd
2015-07-15 02:46:52 +00:00
jr z, .fadeInText
2014-05-22 22:13:20 +00:00
cp $fc
2015-07-15 02:46:52 +00:00
jr z, .showText
2014-05-22 22:13:20 +00:00
cp $fb
2015-07-15 02:46:52 +00:00
jr z, .showCopyrightText
2014-05-22 22:13:20 +00:00
cp $fa
jr z, .showTheEnd
push hl
push hl
ld hl, CreditsTextPointers
2014-05-22 22:13:20 +00:00
add a
ld c, a
2015-07-15 02:46:52 +00:00
ld b, 0
2014-05-22 22:13:20 +00:00
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
2015-07-14 07:16:19 +00:00
ld bc, SCREEN_WIDTH * 2
2014-05-22 22:13:20 +00:00
add hl, bc
pop de
2015-07-15 02:46:52 +00:00
jr .nextCreditsCommand
.fadeInTextAndShowMon
call FadeInCreditsText
ld c, 90
2015-07-15 02:46:52 +00:00
jr .next1
.showTextAndShowMon
ld c, 110
2015-07-15 02:46:52 +00:00
.next1
2014-05-22 22:13:20 +00:00
call DelayFrames
call DisplayCreditsMon
2015-07-15 02:46:52 +00:00
jr .nextCreditsScreen
.fadeInText
call FadeInCreditsText
ld c, 120
2015-07-15 02:46:52 +00:00
jr .next2
.showText
ld c, 140
2015-07-15 02:46:52 +00:00
.next2
2014-05-22 22:13:20 +00:00
call DelayFrames
2015-07-15 02:46:52 +00:00
jr .nextCreditsScreen
.showCopyrightText
2014-05-22 22:13:20 +00:00
push de
callba LoadCopyrightTiles
pop de
pop de
2015-07-15 02:46:52 +00:00
jr .nextCreditsCommand
2014-05-22 22:13:20 +00:00
.showTheEnd
ld c, 16
2014-05-22 22:13:20 +00:00
call DelayFrames
call FillMiddleOfScreenWithWhite
pop de
ld de, TheEndGfx
2014-05-29 08:31:46 +00:00
ld hl, vChars2 + $600
2015-08-10 04:56:20 +00:00
lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10
2014-05-22 22:13:20 +00:00
call CopyVideoData
2015-07-18 20:52:03 +00:00
coord hl, 4, 8
ld de, TheEndTextString
2014-05-22 22:13:20 +00:00
call PlaceString
2015-07-18 20:52:03 +00:00
coord hl, 4, 9
2014-05-22 22:13:20 +00:00
inc de
call PlaceString
2015-07-15 02:46:52 +00:00
jp FadeInCreditsText
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
TheEndTextString:
; "T H E E N D"
2014-05-22 22:13:20 +00:00
db $60," ",$62," ",$64," ",$64," ",$66," ",$68,"@"
db $61," ",$63," ",$65," ",$65," ",$67," ",$69,"@"
INCLUDE "data/credits_order.asm"
INCLUDE "text/credits_text.asm"
TheEndGfx: ; 7473e (1d:473e) (7473f on blue)
INCBIN "gfx/theend.interleave.2bpp"
2015-08-10 04:56:20 +00:00
TheEndGfxEnd: