mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-02-06 02:30:15 +00:00
Clip out-of-range gfx coordinates.
This commit is contained in:
parent
c8e4940913
commit
bf1229bfaa
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
25
auxmem.gfx.s
25
auxmem.gfx.s
@ -7,8 +7,10 @@
|
|||||||
* from 1280x1024 to 280x192
|
* from 1280x1024 to 280x192
|
||||||
CVTCOORD
|
CVTCOORD
|
||||||
* X-coordinate in VDUQ+5,+6 1280*7/32=280
|
* X-coordinate in VDUQ+5,+6 1280*7/32=280
|
||||||
LDA VDUQ+6 ; X-coord -> ZP1 and ZP2
|
LDA VDUQ+6 ; MSB of X-coord
|
||||||
STA ZP1+1
|
CMP #$05 ; $500 is 1280
|
||||||
|
BCS :BIGX ; Value >=1280
|
||||||
|
STA ZP1+1 ; X-coord -> ZP1 and ZP2
|
||||||
STA ZP2+1
|
STA ZP2+1
|
||||||
LDA VDUQ+5
|
LDA VDUQ+5
|
||||||
STA ZP1+0
|
STA ZP1+0
|
||||||
@ -35,17 +37,20 @@ CVTCOORD
|
|||||||
ROR ZP2+0
|
ROR ZP2+0
|
||||||
STA VDUQ+6 ; ZP2 -> X-coord
|
STA VDUQ+6 ; ZP2 -> X-coord
|
||||||
LDA ZP2+0
|
LDA ZP2+0
|
||||||
STA VDUQ+5
|
STA VDUQ+5
|
||||||
|
|
||||||
* Y-coordinate in VDUQ+7,+8 1024*3/16=192
|
* Y-coordinate in VDUQ+7,+8 1024*3/16=192
|
||||||
LDA VDUQ+8 ; Y-coord -> ZP1
|
:YCOORD LDA VDUQ+8 ; MSB of Y-coord
|
||||||
|
AND #$FC
|
||||||
|
BNE :BIGY ; Y>1023
|
||||||
|
LDA VDUQ+8 ; Y-coord -> ZP1
|
||||||
STA ZP1+1
|
STA ZP1+1
|
||||||
STA ZP2+1
|
STA ZP2+1
|
||||||
LDA VDUQ+7
|
LDA VDUQ+7
|
||||||
STA ZP1+0
|
STA ZP1+0
|
||||||
ASL A ; ZP2 *= 2
|
ASL A ; ZP2 *= 2
|
||||||
ROL ZP2+1
|
ROL ZP2+1
|
||||||
CLC ; ZP2+ZP1->ZP2
|
CLC ; ZP2+ZP1->ZP2
|
||||||
ADC ZP1+0
|
ADC ZP1+0
|
||||||
STA ZP2+0
|
STA ZP2+0
|
||||||
LDA ZP2+1
|
LDA ZP2+1
|
||||||
@ -64,6 +69,14 @@ CVTCOORD
|
|||||||
SBC ZP2+0
|
SBC ZP2+0
|
||||||
STA VDUQ+7
|
STA VDUQ+7
|
||||||
RTS
|
RTS
|
||||||
|
:BIGY STZ VDUQ+7 ; Y too large, row zero
|
||||||
|
STZ VDUQ+8
|
||||||
|
RTS
|
||||||
|
:BIGX LDA #$17 ; X too large, use 279
|
||||||
|
STA VDUQ+5
|
||||||
|
LDA #$01
|
||||||
|
STA VDUQ+6
|
||||||
|
BRA :YCOORD
|
||||||
|
|
||||||
* Add coordinates to XPIXEL, YPIXEL
|
* Add coordinates to XPIXEL, YPIXEL
|
||||||
RELCOORD CLC
|
RELCOORD CLC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user