Minor refactor of mainmem.gfx.s

This commit is contained in:
Bobbi Webber-Manners 2021-10-10 14:43:57 -04:00
parent 281360de93
commit c0d00c27e5
2 changed files with 20 additions and 19 deletions

Binary file not shown.

View File

@ -19,9 +19,8 @@ SETLINE >>> ENTMAIN
JSR FDRAWADDR+43 ; FDRAW: SetLineMode JSR FDRAWADDR+43 ; FDRAW: SetLineMode
>>> XF2AUX,VDU18RET1 >>> XF2AUX,VDU18RET1
* Call FDraw DrawLine routine * Helper function to set up colors
DRAWLINE >>> ENTMAIN SETCOLOR LDA PLOTMODE
LDA PLOTMODE
AND #$03 AND #$03
CMP #$01 ; Draw in foreground colour CMP #$01 ; Draw in foreground colour
BNE :S1 BNE :S1
@ -35,30 +34,32 @@ DRAWLINE >>> ENTMAIN
BRA :SETCOLOR BRA :SETCOLOR
:S2 LDA BGCOLOR ; Draw in background colour :S2 LDA BGCOLOR ; Draw in background colour
:SETCOLOR STA FDRAWADDR+5 :SETCOLOR STA FDRAWADDR+5
JSR FDRAWADDR+16 ; FDRAW: SetColor JMP FDRAWADDR+16 ; FDRAW: SetColor
* Call FDraw DrawLine routine
DRAWLINE >>> ENTMAIN
JSR SETCOLOR
JSR FDRAWADDR+28 ; FDRAW: DrawLine JSR FDRAWADDR+28 ; FDRAW: DrawLine
>>> XF2AUX,VDU25RET >>> XF2AUX,VDU25RET
* Call FDraw DrawPoint routine * Call FDraw DrawPoint routine
DRAWPNT >>> ENTMAIN DRAWPNT >>> ENTMAIN
LDA PLOTMODE JSR SETCOLOR
AND #$03
CMP #$01 ; Draw in foreground colour
BNE :S1
LDA FGCOLOR
BRA :SETCOLOR
:S1 CMP #$02 ; Draw in inverse colour
BNE :S2
SEC
LDA #$07
SBC FGCOLOR
BRA :SETCOLOR
:S2 LDA BGCOLOR ; Draw in background colour
:SETCOLOR STA FDRAWADDR+5
JSR FDRAWADDR+16 ; FDRAW: SetColor
JSR FDRAWADDR+25 ; FDRAW: DrawPoint JSR FDRAWADDR+25 ; FDRAW: DrawPoint
>>> XF2AUX,VDU25RET >>> XF2AUX,VDU25RET
* Call FDraw DrawCircle routine
DRAWCIRC >>> ENTMAIN
JSR SETCOLOR
JSR FDRAWADDR+37 ; FDRAW: DrawCircle
>>> XF2AUX,VDU25RET
* Call FDraw FillCircle routine
FILLCIRC >>> ENTMAIN
JSR SETCOLOR
JSR FDRAWADDR+40 ; FDRAW: FillCircle
>>> XF2AUX,VDU25RET
* Reset colours and linetype * Reset colours and linetype
GFXINIT JSR FDRAWADDR+0 ; Initialize FDRAW library GFXINIT JSR FDRAWADDR+0 ; Initialize FDRAW library
LDA #$20 LDA #$20