;license:MIT ;(c) 2018-9 by 4am ; ; credits page ; ; Public functions ; - Credits !zone { Credits ; clobbers all +LDADDR .CreditsFile jsr SetPath jsr LoadFile ; loads at $8000 jsr ClearOffscreen lda OffscreenPage ror ; draw on offscreen page +LDADDR $8000 jsr .DrawPage jsr ShowOtherPage jsr WaitForKeyFor30Seconds jsr ShowOtherPage bit CLEARKBD clc rts .CreditsFile !byte 7 !text "CREDITS" .DrawPage ; A/Y contains address of character buffer ; carry bit clear -> draw on page 1 ; carry bit set -> draw on page 2 ; drawing starts at VTAB 0, HTAB 0 ; clobbers PTR ; clobbers A/X/Y ; preserves all flags, by a quirk of implementation php ldx #0 stx VTAB +STAY PTR @drawLine ldy #0 sty HTAB @parseLine lda (PTR),y cmp #$5B ; '[' at beginning on line bne + ; ends the parsing tya beq @donePage + cmp #$0D beq @doneParsingLine cmp #$2A bne + lda #$10 sta (PTR),y ; asterisk -> dot, small + cmp #$7E bne + lda #$11 sta (PTR),y ; tilde -> dot, medium + iny bne @parseLine @doneParsingLine sty SAVE cpy #0 beq @skip ldx SAVE +LDAY PTR plp php jsr DrawBuffer @skip inc SAVE ; skip carriage return lda SAVE ; advance PTR to start of next line clc adc PTR sta PTR bcc + inc PTR+1 + inc VTAB ; this will print 255 lines if you give it bne @drawLine ; 255 lines, so don't do that @donePage plp rts }