consolidate raw and non-raw paint loops

This commit is contained in:
4am 2018-03-03 10:45:03 -05:00
parent 2acc9e286f
commit 1b0521d265
2 changed files with 13 additions and 24 deletions

35
views.s
View File

@ -488,27 +488,22 @@ paintCheck_plot: ; Paint our state
sta PARAM1 sta PARAM1
lda WG_VIEWRECORDS+4,y ; Raw or Apple format title? lda WG_VIEWRECORDS+4,y ; Raw or Apple format title?
ldy #0
and #VIEW_STYLE_RAWTITLE and #VIEW_STYLE_RAWTITLE
bne paintCheck_titleRawLoop asl
eor #$80 ; becomes #$80 for Apple format, 0 for raw
sta paintCheck_mask+1
ldy #0
paintCheck_titleLoop: paintCheck_titleLoop:
lda (PARAM0),y lda (PARAM0),y
beq paintCheck_done beq paintCheck_done
ora #$80 paintCheck_mask:
ora #$FF ; Self-modifying code!
jsr WGPlot jsr WGPlot
inc WG_CURSORX inc WG_CURSORX
iny iny
bra paintCheck_titleLoop bra paintCheck_titleLoop
paintCheck_titleRawLoop:
lda (PARAM0),y
beq paintCheck_done
jsr WGPlot
inc WG_CURSORX
iny
bra paintCheck_titleRawLoop
paintCheck_done: paintCheck_done:
rts rts
@ -671,29 +666,23 @@ paintWindowTitle_compute:
dec dec
sta WG_CURSORY sta WG_CURSORY
ldy #0
lda WG_VIEWRECORDS+4,y ; Raw or Apple format title? lda WG_VIEWRECORDS+4,y ; Raw or Apple format title?
and #VIEW_STYLE_RAWTITLE and #VIEW_STYLE_RAWTITLE
bne paintWindowTitleRawLoop asl
eor #$80 ; becomes #$80 for Apple format, 0 for raw
sta paintWindowTitle_mask
ldy #0
paintWindowTitleLoop: paintWindowTitleLoop:
lda (PARAM0),y lda (PARAM0),y
beq paintWindowTitle_done beq paintWindowTitle_done
ora #$80 paintWindowTitle_mask:
ora #$FF ; Self-modifying code!
jsr WGPlot ; Draw the character jsr WGPlot ; Draw the character
iny iny
inc WG_CURSORX ; Advance cursors inc WG_CURSORX ; Advance cursors
bra paintWindowTitleLoop bra paintWindowTitleLoop
paintWindowTitleRawLoop:
lda (PARAM0),y
beq paintWindowTitle_done
jsr WGPlot ; Draw the character
iny
inc WG_CURSORX ; Advance cursors
bra paintWindowTitleRawLoop
paintWindowTitle_done: paintWindowTitle_done:
rts rts

Binary file not shown.