Graphics refactoring in preparation for SHR gfx

This commit is contained in:
Bobbi Webber-Manners 2022-12-29 20:10:21 -05:00
parent 74b856e8f5
commit 53c351e353
5 changed files with 45 additions and 21 deletions

Binary file not shown.

View File

@ -157,24 +157,6 @@ VDU18RET1 >>> ENTAUX
>>> WRTAUX
RTS
* TEMP *
HGRPLOTTER LDX #3
HGRPLOTTER1 LDA VDUQ+5,X
PHA
DEX
BPL HGRPLOTTER1
JSR HGRPLOT
LDX #0
HGRPLOTTER2 LDA VDUQ+5,X
STA PIXELPLOTX,X
PLA
STA VDUQ+5,X
INX
CPX #4
BCC HGRPLOTTER2
RTS
* TEMP *
* Plot actions, PLOT k,x,y
* k is in VDUQ+4
* x is in VDUQ+5,VDUQ+6

View File

@ -301,8 +301,7 @@ SHRPRCH640 SEC
* Apply colour masks to 16 bit word of character data
* Called in 65816 native mode, 16 bit
MX %00 ; Tell Merlin 16 bit M & X
SHRCOLWORD
SHRCOLWORD MX %00 ; Tell Merlin 16 bit M & X
PHA ; Keep A
AND SHRCOLMASK ; Mask to set foreground colour
STA ZP1 ; Keep foreground

View File

@ -1152,13 +1152,36 @@ VDU25BACKUP2 LDA GFXPOSNX,X ; POSN becomes LAST
BPL VDU25BACKUP2
LDA VDUPIXELS
BEQ :S2
JSR HGRPLOTTER
JSR GFXPLOTTER
:S2 LDA KEYBOARD ; This and PRCHRC need to be
EOR #$80 ; made more generalised
BMI VDU25EXIT ; No key pressed
JSR KBDCHKESC ; Ask KBD to test if Escape
VDU25EXIT RTS
* Wrapper around call to HGR/SHR plotting routine
GFXPLOTTER LDX #3
:L1 LDA VDUQ+5,X
PHA
DEX
BPL :L1
BIT VDUSCREEN
BPL :S1
JSR HGRPLOT
BRA GFXPLOTTER2
:S1 BVC GFXPLOTTER2
>>> XF2MAIN,SHRPLOT
GFXPLOTRET >>> ENTAUX
GFXPLOTTER2 LDX #0
:L1 LDA VDUQ+5,X
STA PIXELPLOTX,X
PLA
STA VDUQ+5,X
INX
CPX #4
BCC :L1
RTS
* Adjust graphics origin
ADJORIG CLC
LDA GFXORIGX+0

View File

@ -202,6 +202,26 @@ SHRCHAR640 PHY ; Preserve Y
RTS
* Plot actions: PLOT k,x,y
* k is in SHRVDUQ+4
* x is in SHRVDUQ+5,SHRVDUQ+6
* y is in SHRVDUQ+7,SHRVDUQ+8
*
* Plot actions:
* $00+x - move/draw lines
* $40+x - plot point
* $50+x - fill triangle
* $60+x - fill rectangle
* $90+x - draw circle
* $98+x - fill circle
*
SHRPLOT >>> ENTMAIN
JSR SHRCOORD ; Convert coordinates
* ...
>>> XF2AUX,GFXPLOTRET
RTS
* Convert high-resolution screen coordinates
* from 1280x1024 to 620x200 or 320x200
* TODO: Totally untested ...