mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-23 16:31:50 +00:00
SHR: inline coord conversion using macro
This commit is contained in:
parent
e18df1d337
commit
f6f6c20c37
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
@ -24,13 +24,15 @@ SHRGFXFGMSK2 DB $00 ; Copy of foreground colour mask
|
|||||||
SHRGFXBGMASK DB $00 ; Background colour mask
|
SHRGFXBGMASK DB $00 ; Background colour mask
|
||||||
SHRGFXACTION DB $00 ; GCOL action for point plotting
|
SHRGFXACTION DB $00 ; GCOL action for point plotting
|
||||||
|
|
||||||
* These are all persistent locals
|
* These are all persistent locals (14 bytes of ZP)
|
||||||
SHRXPIXEL EQU SHRZP+0 ; Prev point in screen coords (word)
|
SHRXPIXEL EQU SHRZP+0 ; Prev point in screen coords (word)
|
||||||
SHRYPIXEL EQU SHRZP+2 ; Prev point in screen coords (word)
|
SHRYPIXEL EQU SHRZP+2 ; Prev point in screen coords (word)
|
||||||
SHRWINLFT EQU SHRZP+4 ; Gfx window - left (0-639) (word)
|
SHRWINLFT EQU SHRZP+4 ; Gfx win - left (0-639) (word)
|
||||||
SHRWINRGT EQU SHRZP+6 ; Gfx window - right (0-639) (word)
|
SHRWINRGT EQU SHRZP+6 ; Gfx win - right (0-639) (word)
|
||||||
SHRWINTOP EQU SHRZP+8 ; Gfx window - top (0-199) (word)
|
SHRWINTOP EQU SHRZP+8 ; Gfx win - top (0-199) (word)
|
||||||
SHRWINBTM EQU SHRZP+10 ; Gfx window - bottom (0-199) (word)
|
SHRWINBTM EQU SHRZP+10 ; Gfx win - bottom (0-199) (word)
|
||||||
|
SHRCURROUT EQU SHRZP+12 ; Curr pt in/out gfx win (byte)
|
||||||
|
SHRPREVOUT EQU SHRZP+13 ; Prev pt in/out gfx win (byte)
|
||||||
|
|
||||||
|
|
||||||
* Explode font to generate SHRFONTXPLD table
|
* Explode font to generate SHRFONTXPLD table
|
||||||
@ -231,7 +233,7 @@ SHRCHAR640 PHY ; Preserve Y
|
|||||||
* Note: abs/rel handled in auxmem.vdu.s
|
* Note: abs/rel handled in auxmem.vdu.s
|
||||||
* TODO: No triangle filling or other fancy ops yet
|
* TODO: No triangle filling or other fancy ops yet
|
||||||
SHRPLOT >>> ENTMAIN
|
SHRPLOT >>> ENTMAIN
|
||||||
JSR SHRCOORD ; Convert coordinates
|
>>> SHRCOORD ; Convert coordinates
|
||||||
LDA A1L ; Preserve converted x
|
LDA A1L ; Preserve converted x
|
||||||
PHA
|
PHA
|
||||||
LDA A1H
|
LDA A1H
|
||||||
@ -676,10 +678,11 @@ SHRLINEHI MX %00 ; Tell Merlin 16 bit M & X
|
|||||||
:LIM EQU TMPZP+10 ; x1 gets stashed here
|
:LIM EQU TMPZP+10 ; x1 gets stashed here
|
||||||
|
|
||||||
|
|
||||||
* Convert high-resolution screen coordinates
|
* Macro to convert high-resolution screen coordinates
|
||||||
* from 1280x1024 to 640x200 or 320x200
|
* from 1280x1024 to 640x200 or 320x200
|
||||||
* On return: X-coordinate in A1L/H, Y-coordinate in A2L (A2H=0)
|
* On return: X-coordinate in A1L/H, Y-coordinate in A2L (A2H=0)
|
||||||
SHRCOORD PHP ; Disable interrupts
|
SHRCOORD MAC
|
||||||
|
PHP ; Disable interrupts
|
||||||
SEI
|
SEI
|
||||||
CLC ; 65816 native mode
|
CLC ; 65816 native mode
|
||||||
XCE
|
XCE
|
||||||
@ -695,7 +698,7 @@ SHRCOORD PHP ; Disable interrupts
|
|||||||
|
|
||||||
* Y-coordinate in SHRVDUQ+7,+8 1024*25/128=200
|
* Y-coordinate in SHRVDUQ+7,+8 1024*25/128=200
|
||||||
LDA SHRVDUQ+7
|
LDA SHRVDUQ+7
|
||||||
BMI :MINUS
|
BMI SHRCOORDNEG
|
||||||
ASL ; *2
|
ASL ; *2
|
||||||
ADC SHRVDUQ+7 ; *3
|
ADC SHRVDUQ+7 ; *3
|
||||||
ASL ; *6
|
ASL ; *6
|
||||||
@ -721,9 +724,9 @@ SHRCOORD PHP ; Disable interrupts
|
|||||||
XCE
|
XCE
|
||||||
MX %11 ; Tell Merlin
|
MX %11 ; Tell Merlin
|
||||||
PLP ; Normal service resumed
|
PLP ; Normal service resumed
|
||||||
RTS
|
BRA SHRCOORDEND
|
||||||
|
|
||||||
:MINUS MX %00 ; Tell Merlin we are 16 bit
|
SHRCOORDNEG MX %00 ; Tell Merlin we are 16 bit
|
||||||
EOR #$FFFF ; Negate
|
EOR #$FFFF ; Negate
|
||||||
INC A
|
INC A
|
||||||
ASL ; *2
|
ASL ; *2
|
||||||
@ -753,7 +756,7 @@ SHRCOORD PHP ; Disable interrupts
|
|||||||
XCE
|
XCE
|
||||||
MX %11 ; Tell Merlin
|
MX %11 ; Tell Merlin
|
||||||
PLP ; Normal service resumed
|
PLP ; Normal service resumed
|
||||||
RTS
|
SHRCOORDEND EOM
|
||||||
|
|
||||||
|
|
||||||
* Another coordinate transform, used by VDU25
|
* Another coordinate transform, used by VDU25
|
||||||
@ -772,7 +775,6 @@ SHRCOORD2 MX $00 ; Tell Merlin it's 16 bit
|
|||||||
|
|
||||||
* Y-coordinate in SHRVDUQ+7,+8 1024*25/128=200
|
* Y-coordinate in SHRVDUQ+7,+8 1024*25/128=200
|
||||||
LDA SHRVDUQ+2,X
|
LDA SHRVDUQ+2,X
|
||||||
BMI :MINUS
|
|
||||||
ASL ; *2
|
ASL ; *2
|
||||||
ADC SHRVDUQ+2,X ; *3
|
ADC SHRVDUQ+2,X ; *3
|
||||||
ASL ; *6
|
ASL ; *6
|
||||||
|
Loading…
x
Reference in New Issue
Block a user