Use 1280x1024 coordinate system for HGR.

This commit is contained in:
Bobbi Webber-Manners 2021-09-19 14:34:14 -04:00
parent bd65b82b6e
commit ed157d5bc3
3 changed files with 94 additions and 1 deletions

Binary file not shown.

View File

@ -168,6 +168,98 @@ PRDECPAD STA OSPAD
DW 1000
DW 10000
* Convert high-resolution screen coordinates
* from 1280x1024 to 280x192
CVTCOORD
* X-coordinate in VDUQ+5,+6 1280/4*7/8=280
LDA VDUQ+5 ; X-coord -> ZP1 and ZP2
STA ZP1+0
STA ZP2+0
LDA VDUQ+6
STA ZP1+1
STA ZP2+1
CLC ; ZP1 divide by 2 (0-639 now)
ROR ZP1+1
ROR ZP1+0
CLC ; ZP1 divide by 2 (0-319 now)
ROR ZP1+1
ROR ZP1+0
CLC ; ZP1+ZP2->ZP2
LDA ZP1+0
ADC ZP2+0
STA ZP2+0
LDA ZP1+1
ADC ZP2+1
STA ZP2+1
CLC ; ZP1+ZP2->ZP2
LDA ZP1+0
ADC ZP2+0
STA ZP2+0
LDA ZP1+1
ADC ZP2+1
STA ZP2+1
CLC ; ZP1+ZP2->ZP2
LDA ZP1+0
ADC ZP2+0
STA ZP2+0
LDA ZP1+1
ADC ZP2+1
STA ZP2+1
CLC ; ZP2 divide by 2
ROR ZP2+1
ROR ZP2+0
CLC ; ZP2 divide by 2
ROR ZP2+1
ROR ZP2+0
CLC ; ZP2 divide by 2
ROR ZP2+1
ROR ZP2+0
LDA ZP2+0
STA VDUQ+5
LDA ZP2+1
STA VDUQ+6
* Y-coordinate in VDUQ+7,+8 1024/4*3/4=192
LDA VDUQ+7 ; Y-coord -> ZP1
STA ZP1+0
LDA VDUQ+8
STA ZP1+1
CLC ; ZP1 divide by 2 (0-512 now)
ROR ZP1+1
ROR ZP1+0
CLC ; ZP1 divide by 2 (0-256 now)
ROR ZP1+1
ROR ZP1+0
LDA ZP1+0 ; Copy ZP1->ZP2
STA ZP2+0
LDA ZP1+1
STA ZP2+1
CLC ; ZP1+ZP2->ZP2
LDA ZP1+0
ADC ZP2+0
STA ZP2+0
LDA ZP1+1
ADC ZP2+1
STA ZP2+1
CLC ; ZP1+ZP2->ZP2
LDA ZP1+0
ADC ZP2+0
STA ZP2+0
LDA ZP1+1
ADC ZP2+1
STA ZP2+1
CLC ; ZP2 divide by 2
ROR ZP2+1
ROR ZP2+0
CLC ; ZP2 divide by 2
ROR ZP2+1
ROR ZP2+0
LDA ZP2+0
STA VDUQ+7
LDA ZP2+1
STA VDUQ+8
RTS
* GSINIT - Initialise for GSTRANS string parsing
************************************************

View File

@ -619,7 +619,8 @@ VDU24 RTS
* x is in VDUQ+7,VDUQ+8
* y is in VDUQ+5,VDUQ+6
* k is in VDUQ+4
VDU25 LDA VDUQ+4
VDU25 JSR CVTCOORD ; Convert coordinate system
LDA VDUQ+4
AND #$07
CMP #$04 ; Move absolute
BEQ HGRPOS ; Just update pos