mirror of
https://github.com/a2-4am/4cade.git
synced 2024-12-24 22:31:40 +00:00
move DrawPage to ui.font with other drawing routines
This commit is contained in:
parent
7ab4dd136e
commit
d233ad6074
@ -18,70 +18,14 @@ Credits
|
||||
lda OffscreenPage
|
||||
ror ; draw on offscreen page
|
||||
+LDADDR $8000
|
||||
jsr .DrawPage
|
||||
jsr ShowOtherPage
|
||||
jsr WaitForKeyFor30Seconds
|
||||
jsr ShowOtherPage
|
||||
bit CLEARKBD
|
||||
clc
|
||||
jsr DrawPage ; draw credits
|
||||
jsr ShowOtherPage ; show credits
|
||||
jsr WaitForKeyFor30Seconds; wait
|
||||
bit CLEARKBD ; don't care about key
|
||||
jsr ShowOtherPage ; back to previous page
|
||||
clc ; if called from search mode, tell caller not to refresh
|
||||
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
|
||||
|
||||
}
|
||||
|
@ -4,11 +4,67 @@
|
||||
; hi-res font drawing routines
|
||||
;
|
||||
; Public functions
|
||||
; - DrawPage
|
||||
; - Draw40Chars
|
||||
; - DrawString
|
||||
; - DrawBuffer
|
||||
;
|
||||
|
||||
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
|
||||
|
||||
Draw40Chars
|
||||
; A/Y contains address of character buffer
|
||||
; carry bit clear -> draw on page 1
|
||||
|
Loading…
Reference in New Issue
Block a user