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

37
views.s
View File

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

Binary file not shown.