123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- HallOfFamePC:
- callba AnimateHallOfFame
- 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
- coord hl, 0, 0
- call FillFourRowsWithBlack
- coord hl, 0, 14
- call FillFourRowsWithBlack
- ld a, %11000000
- ld [rBGP], a
- call EnableLCD
- ld a, $ff
- call PlaySoundWaitForCurrent
- ld c, BANK(Music_Credits)
- ld a, MUSIC_CREDITS
- call PlayMusic
- ld c, 128
- call DelayFrames
- xor a
- ld [wUnusedCD3D], a ; not read
- ld [wNumCreditsMonsDisplayed], a
- jp Credits
- FadeInCreditsText:
- ld hl, HoFGBPalettes
- ld b, 4
- .loop
- ld a, [hli]
- ld [rBGP], a
- ld c, 5
- call DelayFrames
- dec b
- jr nz, .loop
- ret
- DisplayCreditsMon:
- xor a
- ld [H_AUTOBGTRANSFERENABLED], a
- call SaveScreenTilesToBuffer1
- call FillMiddleOfScreenWithWhite
- ; 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
- call CreditsCopyTileMapToVRAM
- xor a
- ld [H_AUTOBGTRANSFERENABLED], a
- call LoadScreenTilesFromBuffer1
- ld hl, vBGMap0
- call CreditsCopyTileMapToVRAM
- ld a, $A7
- ld [rWX], a
- ld hl, vBGMap1
- 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
- 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 ScrollCreditsMonLeft
- ld a, [rWX]
- sub 8
- ld [rWX], a
- dec c
- jr nz, .scrollLoop2
- xor a
- ld [hWY], a
- ld a, %11000000
- ld [rBGP], a
- ret
- INCLUDE "data/credit_mons.asm"
- ScrollCreditsMonLeft:
- ld h, b
- ld l, $20
- call ScrollCreditsMonLeft_SetSCX
- ld h, $0
- ld l, $70
- call ScrollCreditsMonLeft_SetSCX
- ld a, b
- add $8
- ld b, a
- ret
- ScrollCreditsMonLeft_SetSCX:
- ld a, [rLY]
- cp l
- jr nz, ScrollCreditsMonLeft_SetSCX
- ld a, h
- ld [rSCX], a
- .loop
- ld a, [rLY]
- cp h
- jr z, .loop
- ret
- HoFGBPalettes:
- db %11000000
- db %11010000
- db %11100000
- db %11110000
- CreditsCopyTileMapToVRAM:
- ld a, l
- ld [H_AUTOBGTRANSFERDEST], a
- ld a, h
- ld [H_AUTOBGTRANSFERDEST + 1], a
- ld a, 1
- ld [H_AUTOBGTRANSFERENABLED], a
- jp Delay3
- ZeroMemory:
- ; zero bc bytes at hl
- ld [hl], 0
- inc hl
- inc hl
- dec bc
- ld a, b
- or c
- jr nz, ZeroMemory
- ret
- FillFourRowsWithBlack:
- ld bc, SCREEN_WIDTH * 4
- ld a, $7e
- jp FillMemory
- FillMiddleOfScreenWithWhite:
- coord hl, 0, 4
- ld bc, SCREEN_WIDTH * 10
- ld a, " "
- jp FillMemory
- Credits:
- ld de, CreditsOrder
- push de
- .nextCreditsScreen
- pop de
- coord hl, 9, 6
- push hl
- call FillMiddleOfScreenWithWhite
- pop hl
- .nextCreditsCommand
- ld a, [de]
- inc de
- push de
- cp $ff
- jr z, .fadeInTextAndShowMon
- cp $fe
- jr z, .showTextAndShowMon
- cp $fd
- jr z, .fadeInText
- cp $fc
- jr z, .showText
- cp $fb
- 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
- pop de
- jr .nextCreditsCommand
- .fadeInTextAndShowMon
- call FadeInCreditsText
- ld c, 90
- jr .next1
- .showTextAndShowMon
- ld c, 110
- .next1
- call DelayFrames
- call DisplayCreditsMon
- jr .nextCreditsScreen
- .fadeInText
- call FadeInCreditsText
- ld c, 120
- jr .next2
- .showText
- ld c, 140
- .next2
- call DelayFrames
- jr .nextCreditsScreen
- .showCopyrightText
- push de
- callba LoadCopyrightTiles
- pop de
- pop de
- jr .nextCreditsCommand
- .showTheEnd
- ld c, 16
- call DelayFrames
- call FillMiddleOfScreenWithWhite
- pop de
- ld de, TheEndGfx
- ld hl, vChars2 + $600
- lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10
- call CopyVideoData
- coord hl, 4, 8
- ld de, TheEndTextString
- call PlaceString
- coord hl, 4, 9
- inc de
- call PlaceString
- jp FadeInCreditsText
- TheEndTextString:
- ; "T H E E N D"
- 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:
- INCBIN "gfx/theend.2bpp"
- TheEndGfxEnd:
|