Add post credits tracker

This commit is contained in:
Kevin Cathcart
2018-09-09 17:43:40 -04:00
parent 889908368a
commit d8e196bf7a
4 changed files with 184 additions and 17 deletions

View File

@@ -565,8 +565,8 @@ CreditsLineTable:
dw CreditsLine171, CreditsLine152, CreditsLine171, CreditsLine171, CreditsLine153, CreditsLine154, CreditsLine171, CreditsLine155
dw CreditsLine156, CreditsLine171, CreditsLine157, CreditsLine158, CreditsLine171, CreditsLine159, CreditsLine160, CreditsLine171
dw CreditsLine161, CreditsLine162, CreditsLine171, CreditsLine163, CreditsLine164, CreditsLine171, CreditsLine165, CreditsLine166
dw CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001
dw CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine167, CreditsLine168, CreditsLine171, CreditsLine169, CreditsLine170
dw CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine167, CreditsLine168, CreditsLine171
dw CreditsLine169, CreditsLine170, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001
!FIRST_SWORD_X = 19
!FIRST_SWORD_Y = 319
@@ -601,6 +601,6 @@ CreditsLineTable:
!TOTAL_LAG_TIME_X = 19
!TOTAL_LAG_TIME_Y = 374
!COLLECTION_RATE_X = 22
!COLLECTION_RATE_Y = 387
!COLLECTION_RATE_Y = 381
!TOTAL_TIME_X = 19
!TOTAL_TIME_Y = 390
!TOTAL_TIME_Y = 384

View File

@@ -555,6 +555,42 @@ LoadModifiedFont:
DEX : BPL .nextWord
SEP #$30
JSL LoadFullItemTilesCredits
RTL
LoadFullItemTilesCredits:
; Based on CopyFontToVram(Bank00)
; copies font graphics to VRAM (for BG3)
; increment on writes to $2119
LDA.b #$80 : STA $2115
; set bank of the source address (see below)
LDA.b #FileSelectNewGraphics>>16 : STA $02
REP #$30
; vram target address is $8000 (word) (Wraps to start of VRAM on normal SNES, but using the correct address so it works on extended VRAM machines)
LDA.w #$8000 : STA $2116
; $00[3] = $0E8000 (offset for the font data)
LDA.w #FileSelectNewGraphics : STA $00
; going to write 0x1000 bytes (0x800 words)
LDX.w #$800-1
.nextWord
; read a word from the font data
LDA [$00] : STA $2118
; increment source address by 2
INC $00 : INC $00
DEX : BPL .nextWord
SEP #$30
RTL
@@ -566,14 +602,44 @@ CheckFontTable:
LDA.w FontTable,Y
PLB
RTL
NearEnding:
STZ.w $012A ; disable triforce helper thread
JSL LoadPaletteCredits
REP #$10
JSL AltBufferTable_credits
JSR DrawEndingItems
JML.l $00ec03 ; PaletteFilter_InitTheEndSprite
EndingItems:
; This function is not strictly needed, simply updating the tracker
; every frame, but it is useful for debuging, so should be left in.
REP #$10
JSR DrawEndingItems
REP #$20
LDX.b #$0e
RTL
DrawEndingItems:
JSL DrawPlayerFile_credits
JSL SetItemLayoutPriority
SEP #$30
LDA.b #$01 : STA $14
RTS
FontTable:
incbin stats/fonttable.bin
CreditsStats:
incsrc stats/statConfig.asm
dw $FFFF
org $0eedd9
JSL EndingItems
org $0eedaf
JSL NearEnding
org $0EE651
JSL LoadModifiedFont
@@ -596,4 +662,4 @@ org $0ee86d
JMP.w AfterDeathCounterOutput
org $0ee8fd
AfterDeathCounterOutput:
AfterDeathCounterOutput: