Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Bank $06
- *=$9900
- RollEndCredits:
- JSR ResetScroll
- JSR ClearScreen_B6
- LDA $00
- CLC
- ADC #$40
- _WaitFrame:
- CMP $00
- BNE _WaitFrame
- LDA #$1B ; Credits text pointer, low byte
- STA $75
- LDA #$9A ; Credits text pointer, high byte
- STA $76
- LDA #$00
- STA $A6
- ; Clears the top screen row and starts reading a new line
- ; of text that will be rendered at the bottom
- _StartCreditsLine:
- LDY #$00
- _ClrLineLoop:
- LDA #$00
- STA $0580,Y
- INY
- CPY #$1F
- BNE _ClrLineLoop
- LDA #$FF
- STA $0580,Y
- LDA #$01 ; Number of lines: 1
- STA $2D
- LDA #$20 ; Number of bytes/characters: 32 (fill row)
- STA $2E
- LDA #$01 ; Y: second row
- STA $29
- LDA #$00 ; X: first column
- STA $2A
- LDA #$FF ; Mode: uncompressed text in $580, write on all rows
- STA $30
- JSR DrawText
- LDA $75
- STA $29
- LDA $76
- STA $2A
- LDY #$00
- LDA ($29),Y
- TAX ; The first byte of each line is the X position where to start rendering text
- INY
- _WriteCreditsLine:
- LDA ($29),Y
- CMP #$FD ; This special character ends the credits and locks the game in an endless loop
- BEQ _EndlessLoop
- STA $0580,X
- INY
- INX
- CMP #$FF
- BEQ _EndOfLine
- JMP _WriteCreditsLine
- _EndOfLine:
- LDA #$01
- STA $2D
- LDA #$20
- STA $2E
- TYA
- CLC
- ADC $75 ; Advance pointer to beginning of next line of text
- STA $75
- LDA #$00
- ADC $76
- STA $76
- LDA #$1D ; Y: bottom row
- STA $29
- LDA #$00 ; X: first column
- STA $2A
- LDA #$FF
- STA $30
- JSR DrawText
- LDA #$04
- STA $0B
- _WaitScroll:
- LDA $0B
- BNE _WaitScroll
- JMP _StartCreditsLine
- _EndlessLoop:
- JMP _EndlessLoop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement