mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2024-09-28 22:56:03 +00:00
VDU24 (define gfx window) sorta working.
This commit is contained in:
parent
837e42e101
commit
62aa305c96
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
20
auxmem.vdu.s
20
auxmem.vdu.s
@ -1089,12 +1089,20 @@ VDU28C LDY #TXTWINLFT+3-VDUVARS ; Copy to txt window params
|
|||||||
VDU28D RTS
|
VDU28D RTS
|
||||||
|
|
||||||
* VDU 24,left;bottom;right;top; - define graphics window
|
* VDU 24,left;bottom;right;top; - define graphics window
|
||||||
VDU24 RTS
|
VDU24 BIT VDUBANK ; Check if this is a GS
|
||||||
* If right<left, exit
|
BMI :GS
|
||||||
* If right>width, exit
|
RTS ; If not, hasta la vista
|
||||||
* If top<bottom, exit
|
:GS LDX #$08
|
||||||
* If top>height, exit
|
>>> WRTMAIN
|
||||||
* scale parameters
|
:L1 LDA VDUQGFXWIND,X ; Copy to main mem for SHR
|
||||||
|
STA SHRVDUQ,X
|
||||||
|
DEX
|
||||||
|
BNE :L1
|
||||||
|
>>> WRTAUX
|
||||||
|
>>> XF2MAIN,SHRVDU24
|
||||||
|
VDU24RETBAD >>> ENTAUX
|
||||||
|
RTS ; Validation failure
|
||||||
|
VDU24RET >>> ENTAUX
|
||||||
LDY #GFXWINLFT+7-VDUVARS ; Copy to gfx window params
|
LDY #GFXWINLFT+7-VDUVARS ; Copy to gfx window params
|
||||||
LDA #$08
|
LDA #$08
|
||||||
BNE COPYVDUQ
|
BNE COPYVDUQ
|
||||||
|
@ -15,7 +15,7 @@ SHRFONTXPLD EQU $A000 ; Explode SHR font to $E1:A000
|
|||||||
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
|
||||||
* 25 bytes of persistent storage
|
* 33 bytes of persistent storage
|
||||||
* TODO: Move to SHRZP maybe
|
* TODO: Move to SHRZP maybe
|
||||||
SHRPIXELS DB $00 ; Main memory copy of VDUPIXELS
|
SHRPIXELS DB $00 ; Main memory copy of VDUPIXELS
|
||||||
SHRVDUQ DS 16 ; Main memory copy of VDUQ
|
SHRVDUQ DS 16 ; Main memory copy of VDUQ
|
||||||
@ -25,6 +25,10 @@ SHRGFXBGMASK DB $00 ; Background colour mask
|
|||||||
SHRGFXACTION DB $00 ; GCOL action for point plotting
|
SHRGFXACTION DB $00 ; GCOL action for point plotting
|
||||||
SHRXPIXEL DW $0000 ; Previous point in screen coords
|
SHRXPIXEL DW $0000 ; Previous point in screen coords
|
||||||
SHRYPIXEL DW $0000 ; Previous point in screen coords
|
SHRYPIXEL DW $0000 ; Previous point in screen coords
|
||||||
|
SHRWINLFT DW 0 ; Graphics window - left
|
||||||
|
SHRWINRGT DW 639 ; Graphics window - right
|
||||||
|
SHRWINTOP DW 0 ; Graphics window - top
|
||||||
|
SHRWINBTM DW 199 ; Graphics window - bottom
|
||||||
|
|
||||||
|
|
||||||
* Explode font to generate SHRFONTXPLD table
|
* Explode font to generate SHRFONTXPLD table
|
||||||
@ -302,15 +306,15 @@ SHRPLOTCOL LDA SHRGFXFGMASK ; Preserve FG colour
|
|||||||
* Called in 65816 native mode, 8 bit M & X
|
* Called in 65816 native mode, 8 bit M & X
|
||||||
SHRPOINT REP #$30 ; 16 bit M & X
|
SHRPOINT REP #$30 ; 16 bit M & X
|
||||||
MX %00 ; Tell Merlin
|
MX %00 ; Tell Merlin
|
||||||
LDA A2L
|
LDA A2L ; y coordinate
|
||||||
CMP #000 ; TODO: Top of window
|
CMP SHRWINTOP
|
||||||
BMI :OUT
|
BMI :OUT
|
||||||
CMP #200 ; TODO: Bottom of window
|
CMP SHRWINBTM
|
||||||
BPL :OUT
|
BPL :OUT
|
||||||
LDA A1L
|
LDA A1L ; x coordinate
|
||||||
CMP #000 ; TODO: Left of window
|
CMP SHRWINLFT
|
||||||
BMI :OUT
|
BMI :OUT
|
||||||
CMP #640 ; TODO: Right of window
|
CMP SHRWINRGT
|
||||||
BPL :OUT
|
BPL :OUT
|
||||||
SEP #$30 ; 8 bit M & X
|
SEP #$30 ; 8 bit M & X
|
||||||
MX %11 ; Tell Merlin
|
MX %11 ; Tell Merlin
|
||||||
@ -748,6 +752,84 @@ SHRCOORD PHP ; Disable interrupts
|
|||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
|
||||||
|
* Another coordinate transform, used by VDU25
|
||||||
|
* Same as SHRCOORD above, except it is entered in native, 16 bit M & X mode
|
||||||
|
* Assumes positive coordinates.
|
||||||
|
* On entry: X is offset into SHRVDUQ to find coordinate
|
||||||
|
* On return: Coverted coordinats in A1L/H, A2L/H
|
||||||
|
SHRCOORD2 MX $00 ; Tell Merlin it's 16 bit
|
||||||
|
|
||||||
|
* X-coordinate in SHRVDUQ+5,+6 1280/2=640
|
||||||
|
LDA SHRVDUQ,X
|
||||||
|
ASL ; Sign bit -> C
|
||||||
|
ROR SHRVDUQ,X ; Signed divide /2
|
||||||
|
LDA SHRVDUQ,X
|
||||||
|
STA A1L ; Result in A1L/H
|
||||||
|
|
||||||
|
* Y-coordinate in SHRVDUQ+7,+8 1024*25/128=200
|
||||||
|
LDA SHRVDUQ+2,X
|
||||||
|
BMI :MINUS
|
||||||
|
ASL ; *2
|
||||||
|
ADC SHRVDUQ+2,X ; *3
|
||||||
|
ASL ; *6
|
||||||
|
ASL ; *12
|
||||||
|
ASL ; *24
|
||||||
|
ADC SHRVDUQ+2,X ; *25
|
||||||
|
|
||||||
|
ASL ;
|
||||||
|
AND #$FF00 ; Mask bits
|
||||||
|
ADC #0 ; Add in carry (9th bit)
|
||||||
|
XBA ; Clever trick: fewer shifts
|
||||||
|
STA A2L ; Into A2L/H
|
||||||
|
RTS
|
||||||
|
|
||||||
|
|
||||||
|
MX %11 ; Following code is 8 bit again
|
||||||
|
|
||||||
|
|
||||||
|
* Validate graphics window parms & store if okay
|
||||||
|
* First 8 bytes of SHRVDUQ: left, bottom, right, top
|
||||||
|
SHRVDU24 >>> ENTMAIN
|
||||||
|
PHP ; Disable interrupts
|
||||||
|
SEI
|
||||||
|
CLC ; 65816 native mode
|
||||||
|
XCE
|
||||||
|
REP #$30 ; 16 bit M & X
|
||||||
|
MX %00 ; Tell Merlin
|
||||||
|
LDA SHRVDUQ+4 ; Right
|
||||||
|
CMP SHRVDUQ+0 ; Left
|
||||||
|
BCC :BAD ; right<left
|
||||||
|
CMP #1280 ; width
|
||||||
|
BCS :BAD ; right>=width
|
||||||
|
LDA SHRVDUQ+6 ; Top
|
||||||
|
CMP SHRVDUQ+2 ; Bottom
|
||||||
|
BCC :BAD ; top<bottom
|
||||||
|
CMP #1024 ; height
|
||||||
|
BCS :BAD ; top>=height
|
||||||
|
|
||||||
|
LDX #$00 ; Start of SHRVDUQ
|
||||||
|
JSR SHRCOORD2 ; Convert left, bottom
|
||||||
|
LDA A1L ; left converted
|
||||||
|
STA SHRWINLFT
|
||||||
|
LDA A2L ; bottom converted
|
||||||
|
STA SHRWINBTM
|
||||||
|
LDX #$04 ; 4 byte offset
|
||||||
|
JSR SHRCOORD2 ; Convert right, top
|
||||||
|
LDA A1L ; right converted
|
||||||
|
STA SHRWINRGT
|
||||||
|
LDA A2L ; top converted
|
||||||
|
STA SHRWINBTM
|
||||||
|
|
||||||
|
SEC ; 65816 emulation mode
|
||||||
|
XCE
|
||||||
|
PLP
|
||||||
|
>>> XF2AUX,VDU24RET
|
||||||
|
:BAD SEC ; 65816 emulation mode
|
||||||
|
XCE
|
||||||
|
PLP
|
||||||
|
>>> XF2AUX,VDU24RETBAD
|
||||||
|
|
||||||
|
|
||||||
* Table of addresses of SHR rows (in reverse order)
|
* Table of addresses of SHR rows (in reverse order)
|
||||||
SHRROWSL DB <$9c60
|
SHRROWSL DB <$9c60
|
||||||
DB <$9bc0
|
DB <$9bc0
|
||||||
|
Loading…
Reference in New Issue
Block a user