mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-03 22:30:09 +00:00
Reverted JGH's VDU driver PR for now. Breaks too much!
This commit is contained in:
parent
29507b1471
commit
aa639c8922
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
@ -7,7 +7,6 @@
|
||||
* Assembled with the Merlin 8 v2.58 assembler on Apple II.
|
||||
|
||||
XC ; 65c02
|
||||
XC ; 65816
|
||||
ORG $4000 ; Load addr of loader in main memory
|
||||
; Clear of first HGR frame buffer
|
||||
|
||||
|
@ -9,6 +9,8 @@
|
||||
* 09-Sep-2021 Moved keyboard and VDU OSBYTEs to Keyboard and VDU.
|
||||
|
||||
|
||||
XC ; 65c02
|
||||
|
||||
*************************
|
||||
* OSBYTE DISPATCH TABLE *
|
||||
*************************
|
||||
|
468
auxmem.vdu.s
468
auxmem.vdu.s
@ -13,9 +13,6 @@
|
||||
* 09-Sep-2021 New dispatch routine.
|
||||
* 22-Sep-2021 More VDU workspace, started MODE definitions.
|
||||
* 23-Sep-2021 More or less sorted VDU workspace.
|
||||
* 24-Sep-2021 Characters always stored in text buffer even with graphics screen.
|
||||
* 24-Sep-2021 AppleGS text written/read via 65816 screen banks.
|
||||
* 25-Sep-2021 VDU 22 sets up MODE definitions.
|
||||
|
||||
|
||||
**********************************
|
||||
@ -36,15 +33,10 @@ VDUSTATUS EQU $D0 ; $D0 # VDU status
|
||||
* bit 1 = Don't scroll (COPY cursor or VDU 5 mode)
|
||||
* bit 0 = VDU 2 printer echo active
|
||||
*
|
||||
VDUCHAR EQU VDUSTATUS+1 ; $D1 current control character
|
||||
VDUTEMP EQU VDUCHAR ; &D1
|
||||
VDUADDR EQU VDUSTATUS+2 ; $D2 address of current char cell
|
||||
VDUBANK EQU VDUADDR+2 ; $D4 screen bank
|
||||
VDUADDR2 EQU VDUADDR+3 ; $D5 address being scrolled
|
||||
VDUBANK2 EQU VDUBANK+3 ; $D7 screen bank being scrolled
|
||||
*
|
||||
OLDCHAR EQU OSKBD1 ; &EC character under cursor
|
||||
COPYCHAR EQU OSKBD2 ; &ED character under copy cursor
|
||||
VDUCHAR EQU VDUSTATUS+1 ; $D1
|
||||
VDUADDR EQU VDUSTATUS+4 ; $D4 address of current char cell
|
||||
OLDCHAR EQU OSKBD1 ; *TEMP* character under cursor
|
||||
COPYCHAR EQU OSKBD2 ; *TEMP* character under copy cursor
|
||||
|
||||
* VDU DRIVER MAIN WORKSPACE
|
||||
***************************
|
||||
@ -74,57 +66,50 @@ VDUCOPYX EQU VDUVARS+$1A ; absolute COPY text X posn
|
||||
VDUCOPYY EQU VDUVARS+$1B ; absolute COPY text Y posn
|
||||
*
|
||||
PIXELPLOTX EQU VDUVARS+$1C ; PLOT graphics X in pixels
|
||||
PIXELPLOTY EQU VDUVARS+$1E ; PLOT graphics Y in pixels
|
||||
PIXELPOSNX EQU VDUVARS+$20 ; current graphics X in pixels
|
||||
PIXELPOSNY EQU VDUVARS+$22 ; current graphics Y in pixels
|
||||
PIXELLASTX EQU VDUVARS+$24 ; last graphics X in pixels
|
||||
PIXELLASTY EQU VDUVARS+$26 ; last graphics Y in pixels
|
||||
VDURESETEND EQU VDUVARS+$27 ; end of section reset by VDU 26
|
||||
PIXELPLOTY EQU VDUVARS+$1E ; PLOT graphics Y in pixels
|
||||
PIXELPOSNX EQU VDUVARS+$20 ; current graphics X in pixels
|
||||
PIXELPOSNY EQU VDUVARS+$22 ; current graphics Y in pixels
|
||||
PIXELLASTX EQU VDUVARS+$24 ; last graphics X in pixels
|
||||
PIXELLASTY EQU VDUVARS+$26 ; last graphics Y in pixels
|
||||
*
|
||||
CURSOR EQU VDUVARS+$28 ; character used for cursor
|
||||
CURSORCP EQU VDUVARS+$29 ; character used for copy cursor
|
||||
CURSORED EQU VDUVARS+$2A ; character used for edit cursor
|
||||
CURSOR EQU VDUVARS+$28 ; character used for cursor
|
||||
CURSORED EQU VDUVARS+$29 ; character used for edit cursor
|
||||
CURSORCP EQU VDUVARS+$2A ; character used for copy cursor
|
||||
*
|
||||
VDUQ EQU VDUVARS+$2B ; $2B..$33
|
||||
VDUQLAST EQU VDUQ+1 ; Neatly becomes VDUVARS+$2C
|
||||
VDUQPLOT EQU VDUQ+5 ; Neatly becomes VDUVARS+$30
|
||||
VDUQ EQU VDUVARS+$2B ; $2B..$33
|
||||
VDUQLAST EQU VDUQ+1 ; Neatly becomes VDUVARS+$2C
|
||||
VDUQPLOT EQU VDUQ+5 ; Neatly becomes VDUVARS+$30
|
||||
*
|
||||
VDUBORDER EQU VDUVARS+$34 ; border colour
|
||||
VDUMODE EQU VDUVARS+$35 ; # current MODE
|
||||
VDUSCREEN EQU VDUVARS+$36 ; # MODE type
|
||||
TXTFGD EQU VDUVARS+$37 ; # text foreground
|
||||
TXTBGD EQU VDUVARS+$38 ; # text background
|
||||
GFXFGD EQU VDUVARS+$39 ; # graphics foreground
|
||||
GFXBGD EQU VDUVARS+$3A ; # graphics background
|
||||
GFXPLOTFGD EQU VDUVARS+$3B ; # foreground GCOL action
|
||||
GFXPLOTBGD EQU VDUVARS+$3C ; # background GCOL action
|
||||
VDUBORDER EQU VDUVARS+$34 ; Border colour
|
||||
VDUMODE EQU VDUVARS+$35 ; # current MODE
|
||||
VDUSCREEN EQU VDUVARS+$36 ; # MODE type
|
||||
TXTFGD EQU VDUVARS+$37 ; # Text foreground
|
||||
TXTBGD EQU VDUVARS+$38 ; # Text background
|
||||
GFXFGD EQU VDUVARS+$39 ; # Graphics foreground
|
||||
GFXBGD EQU VDUVARS+$3A ; # Graphics background
|
||||
GFXPLOTFGD EQU VDUVARS+$3B ; # Foreground GCOL action
|
||||
GFXPLOTBGD EQU VDUVARS+$3C ; # Background GCOL action
|
||||
VDUVAR3D EQU VDUVARS+$3D
|
||||
VDUVAR3E EQU VDUVARS+$3E
|
||||
VDUBYTES EQU VDUVARS+$3F ; # bytes per char, 1=text only
|
||||
VDUCOLOURS EQU VDUVARS+$40 ; # colours-1
|
||||
VDUPIXELS EQU VDUVARS+$41 ; # pixels per byte
|
||||
VDUWORKSP EQU VDUVARS+$42 ; 28 bytes of general workspace
|
||||
VDUBYTES EQU VDUVARS+$3F ; # bytes per char, 1=text only
|
||||
VDUCOLOURS EQU VDUVARS+$40 ; # colours-1
|
||||
VDUPIXELS EQU VDUVARS+$41 ; # pixels per byte
|
||||
VDUWORKSP EQU VDUVARS+$42 ; 28 bytes of general workspace
|
||||
VDUWORKSZ EQU VDUVAREND-VDUWORKSP+1
|
||||
*
|
||||
|
||||
* Screen definitions
|
||||
* 3 6 7
|
||||
SCNTXTMAXX DB 79,39,19,79,39,19,39,39 ; Max text column
|
||||
SCNTXTMAXY DB 23,23,23,23,23,23,23,23 ; Max text row
|
||||
*SCNBYTES DB 1, 1, 1, 1, 1, 1, 1, 1 ; Bytes per character
|
||||
SCNBYTES DB 1, 1, 8, 1, 1, 1, 1, 1 ; Bytes per character
|
||||
SCNCOLOURS DB 15,15,15,15,15,15,15,15 ; Colours-1
|
||||
SCNPIXELS DB 0, 0, 7, 0, 0, 0, 0, 0 ; Pixels per byte
|
||||
SCNTYPE DB 1, 0,128,1, 0, 0, 0,64 ; Screen type
|
||||
* 0 1 2 3 4 5 6 7
|
||||
SCNTXTMAXX DB 79,39,19,79,39,19,39,39 ; Max text column
|
||||
SCNTXTMAXY DB 23,23,23,23,23,23,23,23 ; Max text row
|
||||
SCNBYTES DB 1,1,8,1,1,1,1,1
|
||||
SCNCOLOURS DB 1,1,8,1,1,1,1,1
|
||||
SCNTYPE DB 1,0,128,1,0,0,0,0
|
||||
* b7=FastDraw
|
||||
* b6=Teletext
|
||||
* b0=40COL/80COL
|
||||
* =
|
||||
|
||||
* Colour table
|
||||
CLRTRANS DB 00,01,04,09,02,03,07,10
|
||||
DB 05,08,12,13,06,14,11,15
|
||||
|
||||
********************************************************************
|
||||
* Note that we use PAGE2 80 column mode ($800-$BFF in main and aux)
|
||||
* and PAGE1 HGR mode ($2000-$23ff in main only)
|
||||
@ -335,49 +320,33 @@ PRCHRC PHA ; Save character
|
||||
:RESUME PLA
|
||||
|
||||
* Put character to screen
|
||||
* Puts character to text screen buffer, then in graphics mode,
|
||||
* writes bitmap to graphics screen
|
||||
PUTCHRC PHA
|
||||
EOR #$80 ; Convert character
|
||||
TAX
|
||||
PUTCHRC EOR #$80 ; Convert character
|
||||
TAY
|
||||
AND #$A0
|
||||
BNE PRCHR4
|
||||
CPX #$20
|
||||
BCS PRCHR3 ; Not $80-$9F
|
||||
CPY #$20
|
||||
BCS PRCHR3 ; Not $80-$9F
|
||||
BIT VDUSCREEN
|
||||
BVC PRCHR3 ; Not teletext
|
||||
LDX #$E0 ; Convert $80-$9F to space
|
||||
PRCHR3 TXA
|
||||
BVC PRCHR3 ; Not teletext
|
||||
LDY #$E0 ; Convert $80-$9F to space
|
||||
PRCHR3 TYA
|
||||
EOR #$40
|
||||
TAX
|
||||
PRCHR4 JSR CHARADDR ; Find character address
|
||||
TXA ; Get buffer code
|
||||
BIT VDUBANK
|
||||
BPL PRCHR5 ; Not AppleGS, use short write
|
||||
>>> WRTMAIN ; Need this or long write fails!!
|
||||
CLC ; Enter 65816 native mode
|
||||
XCE
|
||||
SEP #$30 ; 8-bit M and X
|
||||
MX %11 ; Tell Merlin about it
|
||||
STA [VDUADDR],Y
|
||||
SEC ; Return to emulation mode
|
||||
XCE
|
||||
>>> WRTAUX ; As we were
|
||||
BRA PRCHR8
|
||||
PRCHR5 PHP ; Disable IRQs while
|
||||
SEI ; toggling memory
|
||||
BCC PRCHR6 ; Aux memory
|
||||
STA $C004 ; Switch to main memory
|
||||
PRCHR6 STA (VDUADDR),Y ; Store it
|
||||
PRCHR7 STA $C005 ; Back to aux memory
|
||||
PLP ; Restore IRQs
|
||||
PRCHR8 BIT VDUSCREEN
|
||||
BMI PRCHRSOFT ; Write character to graphics
|
||||
PLA
|
||||
RTS
|
||||
|
||||
* Write character to HGR screen
|
||||
PRCHRSOFT JSR HCHARADDR ; Addr in VDUADDR
|
||||
TAY
|
||||
PRCHR4 PHY
|
||||
JSR CHARADDR ; Find character address
|
||||
PLA ; Get character back
|
||||
PHA ; Stash it again
|
||||
PHP ; Disable IRQs while
|
||||
SEI ; toggling memory
|
||||
BCC PRCHR6 ; Aux memory
|
||||
STA $C004 ; Switch to main memory
|
||||
PRCHR6 STA (VDUADDR),Y ; Store it
|
||||
STA $C005 ; Back to aux memory
|
||||
PLP ; Restore IRQs
|
||||
LDY VDUBYTES
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BEQ :DONE
|
||||
JSR HCHARADDR ; Addr in VDUADDR
|
||||
PHP ; Disable IRQs while
|
||||
SEI ; toggling memory
|
||||
STA $C004 ; Write to main
|
||||
@ -389,76 +358,58 @@ PRCHRSOFT JSR HCHARADDR ; Addr in VDUADDR
|
||||
PLP ; Restore IRQs
|
||||
PLA ; Recover character
|
||||
>>> XF2MAIN,DRAWCHAR ; Plot char on HGR screen
|
||||
:DONE PLA ; Discard character
|
||||
RTS
|
||||
|
||||
PUTCHRET >>> ENTAUX
|
||||
RTS
|
||||
|
||||
* OSBYTE &87 - Read character at cursor
|
||||
***************************************
|
||||
* Fetch character from screen at (TEXTX,TEXTY) and return MODE in Y
|
||||
* Reads from text screen buffer regardless of screen type
|
||||
* Always uses text screen (which we maintain even in graphics mode)
|
||||
BYTE87
|
||||
GETCHRC JSR CHARADDR ; Find character address
|
||||
BIT VDUBANK
|
||||
BPL GETCHR5 ; Not AppleGS, use short read
|
||||
CLC ; Enter 65816 native mode
|
||||
XCE
|
||||
SEP #$30 ; 8-bit M and X
|
||||
MX %11 ; Tell Merlin about it
|
||||
LDA [VDUADDR],Y
|
||||
SEC ; Enter emulation mode
|
||||
XCE
|
||||
BRA GETCHR7
|
||||
GETCHR5 PHP ; Disable IRQs while
|
||||
SEI ; toggling memory
|
||||
BCC GETCHR6 ; Aux memory
|
||||
STA $C002 ; Switch to main memory
|
||||
GETCHR6 LDA (VDUADDR),Y ; Get character
|
||||
STA $C003 ; Back to aux memory
|
||||
PLP ; Restore IRQs
|
||||
GETCHR7 TAY ; Convert character
|
||||
GETCHRC JSR CHARADDR ; Find character address
|
||||
PHP ; Disable IRQs while
|
||||
SEI ; toggling memory
|
||||
BCC GETCHR6 ; Aux memory
|
||||
STA $C002 ; Switch to main memory
|
||||
GETCHR6 LDA (VDUADDR),Y ; Get character
|
||||
STA $C003 ; Back to aux memory
|
||||
PLP ; Restore IRQs
|
||||
TAY ; Convert character
|
||||
AND #$A0
|
||||
BNE GETCHR8
|
||||
BNE GETCHR7
|
||||
TYA
|
||||
EOR #$40
|
||||
TAY
|
||||
GETCHR8 TYA
|
||||
GETCHR7 TYA
|
||||
EOR #$80
|
||||
LDY VDUMODE ; Y=MODE
|
||||
TAX ; X=char, flag=NE
|
||||
LDY VDUMODE ; Y=MODE
|
||||
TAX ; X=char
|
||||
GETCHROK RTS
|
||||
|
||||
|
||||
* OSBYTE &86 - Get text cursor position
|
||||
***************************************
|
||||
* Get text cursor position
|
||||
BYTE86 LDY VDUTEXTY ; ROW ; $86 = read cursor pos
|
||||
LDX VDUTEXTX ; COL
|
||||
RTS
|
||||
|
||||
* Calculate character address
|
||||
* NB: VDUBANK (VDUADDR+2) is set by VDU22
|
||||
CHARADDR LDA VDUTEXTY
|
||||
CHARADDRY ASL
|
||||
TAY
|
||||
LDA SCNTAB+0,Y ; LSB of row address
|
||||
ASL
|
||||
TAX
|
||||
LDA SCNTAB+0,X ; LSB of row address
|
||||
STA VDUADDR+0
|
||||
LDA SCNTAB+1,Y ; MSB of row address
|
||||
LDA SCNTAB+1,X ; MSB of row address
|
||||
STA VDUADDR+1
|
||||
LDA VDUTEXTX
|
||||
BIT $C01F
|
||||
SEC
|
||||
BPL CHARADDR40 ; 40-col
|
||||
BPL CHARADDR40 ; 40-col
|
||||
LSR A
|
||||
CHARADDR40 TAY ; Y=offset into this row
|
||||
LDA VDUBANK
|
||||
AND #$FE
|
||||
BCS CHARADDROK
|
||||
ORA #$01
|
||||
CHARADDROK STA VDUBANK
|
||||
CHARADDR40 TAY ; Y=offset into this row
|
||||
RTS
|
||||
* (VDUADDR),Y=>character address
|
||||
* VDUBANK = AppleGS screen bank
|
||||
* CC=auxmem, CS=mainmem, X=preserved
|
||||
* CC=auxmem
|
||||
* CS=mainmem
|
||||
|
||||
* Calculate character address in HGR mode
|
||||
* This is the address of the first pixel row of the char
|
||||
@ -553,46 +504,20 @@ VDU31 LDY VDUQ+8
|
||||
|
||||
|
||||
* VDU 26 - Reset to default windows
|
||||
VDU26 LDA #$F7
|
||||
JSR CLRSTATUS ; Clear 'soft window'
|
||||
VDU26A LDX #VDURESETEND-VDUVARS
|
||||
LDA #$00
|
||||
VDU26LP STA VDUVARS,X ; Clear all windows
|
||||
DEX ; and all coords
|
||||
BPL VDU26LP ; and origin, etc.
|
||||
LDY VDUMODE
|
||||
LDA SCNTXTMAXY,Y
|
||||
STA TXTWINBOT ; Text window height
|
||||
STA GFXWINTOP ; Graphics height
|
||||
LDX #GFXWINTOP-VDUVARS
|
||||
LDA SCNTXTMAXX,Y
|
||||
STA TXTWINRGT ; Text window width
|
||||
STA GFXWINRGT ; Graphics width
|
||||
LDX #GFXWINRGT-VDUVARS
|
||||
* TO DO *
|
||||
VDU26 LDX VDUMODE
|
||||
VDU26A LDA SCNTXTMAXX,X
|
||||
STA TXTWINRGT
|
||||
LDA SCNTXTMAXY,X
|
||||
STA TXTWINBOT
|
||||
RTS
|
||||
|
||||
|
||||
|
||||
* VDU 24,left;bottom;right;top; - define graphics window
|
||||
VDU24 RTS
|
||||
|
||||
* VDU 28,left,bottom,right,top - define text window
|
||||
VDU28 RTS
|
||||
|
||||
* VDU 29,x;y; - define graphics origin
|
||||
VDU29 RTS
|
||||
|
||||
|
||||
|
||||
|
||||
* Initialise VDU driver
|
||||
***********************
|
||||
* On entry, A=MODE to start in
|
||||
* Assumes kernel has cleared workspace
|
||||
*
|
||||
VDUINIT STA VDUQ+8
|
||||
* JSR FONTIMPLODE ; Reset VDU 23 font
|
||||
|
||||
* VDU 22 - MODE n
|
||||
*****************
|
||||
@ -604,46 +529,59 @@ VDUINIT STA VDUQ+8
|
||||
* MODE 0 defaults to MODE 3
|
||||
* All others default to MODE 6
|
||||
*
|
||||
* Wait for VSync?
|
||||
VDU22 LDA VDUQ+8
|
||||
AND #$07
|
||||
TAX ; Set up MODE
|
||||
STX VDUMODE ; Screen MODE
|
||||
LDA SCNCOLOURS,X
|
||||
STA VDUCOLOURS ; Colours-1
|
||||
LDA SCNBYTES,X
|
||||
STA VDUBYTES ; Bytes per char
|
||||
LDA SCNPIXELS,X
|
||||
STA VDUPIXELS ; Pixels per byte
|
||||
LDA SCNTYPE,X
|
||||
STA VDUSCREEN ; Screen type
|
||||
JSR NEGCALL ; Find machine type
|
||||
AND #$0F
|
||||
BEQ :MODEGS ; MCHID=$x0 -> Not AppleGS, bank=0
|
||||
LDA #$E0 ; Not $x0 -> AppleGS, point to screen bank
|
||||
LDA #$00 ;;; DISABLE GS STUFF FOR NOW
|
||||
:MODEGS STA VDUBANK
|
||||
LDA #$01
|
||||
JSR CLRSTATUS ; Clear everything except PrinterEcho
|
||||
LDA #'_' ; Set up default cursors
|
||||
STA CURSOR ; Normal cursor
|
||||
STA CURSORCP ; Copy cursor when editing
|
||||
STA VDUMODE
|
||||
TAX ; Set up MODE
|
||||
LDA #'_' ; Set up default cursors
|
||||
STA CURSOR ; Normal cursor
|
||||
STA CURSORCP ; Copy cursor when editing
|
||||
LDA #$A0
|
||||
STA CURSORED ; Edit cursor when editing
|
||||
JSR VDU20 ; Default colours
|
||||
JSR VDU26 ; Default windows
|
||||
STA $C052 ; Clear MIXED
|
||||
LDA VDUSCREEN
|
||||
BMI VDU22G ; b7=1, graphics mode
|
||||
AND #$01 ; 40col/80col bit
|
||||
STA CURSORED ; Edit cursor when editing
|
||||
LDA #$01
|
||||
JSR CLRSTATUS ; Clear everything except PrinterEcho
|
||||
JSR VDU26A
|
||||
*
|
||||
LDA SCNBYTES,X
|
||||
STA VDUBYTES
|
||||
LDA SCNCOLOURS,X
|
||||
STA VDUCOLOURS
|
||||
LDA SCNTYPE,X
|
||||
STA VDUSCREEN
|
||||
BMI VDU22G ; b7=1, graphics mode
|
||||
* TEMP
|
||||
CPX #2
|
||||
BEQ VDU22G ; Jump out for MODE 1
|
||||
* TEMP
|
||||
*
|
||||
AND #$01 ; 40col/80col bit
|
||||
TAX
|
||||
STA $C00C,X ; Select 40col/80col
|
||||
STA $C051 ; Enable Text
|
||||
STA $C055 ; PAGE2
|
||||
STA $C00F ; Enable alt charset
|
||||
* Fall through into CLS
|
||||
STA $C00C,X ; Select 40col/80col
|
||||
STA $C051 ; Enable Text
|
||||
STA $C055 ; PAGE2
|
||||
STA $C052 ; Clear MIXED
|
||||
STA $C00F ; Enable alt charset
|
||||
BRA VDU22CLR
|
||||
|
||||
VDU12 STZ FXLINES
|
||||
|
||||
VDU22G STA $C050 ; Enable Graphics
|
||||
STA $C057 ; Hi-Res
|
||||
STA $C054 ; PAGE1
|
||||
STA $C052 ; Clear MIXED
|
||||
STA $C00C ; Select 40col text
|
||||
JMP VDU16 ; Clear HGR screen
|
||||
|
||||
VDU22CLR
|
||||
* JSR VDU15 ; Turn off paged scrolling
|
||||
* JSR VDU20 ; Reset colours
|
||||
* JSR VDU26 ; Reset windows
|
||||
* ; Drop through into VDU12, clear screen
|
||||
|
||||
|
||||
VDU12 LDY VDUBYTES
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BNE VDU12SOFT ; Graphics mode
|
||||
JMP CLEAR
|
||||
|
||||
* Clear the screen
|
||||
CLEAR STZ VDUTEXTY ; ROW
|
||||
@ -656,16 +594,9 @@ CLEAR STZ VDUTEXTY ; ROW
|
||||
BRA :L1
|
||||
:S3 STZ VDUTEXTY ; ROW
|
||||
STZ VDUTEXTX ; COL
|
||||
BIT VDUSCREEN
|
||||
BMI VDU12SOFT ; Graphics mode
|
||||
RTS
|
||||
VDU12SOFT JMP VDU16 ; *TEMP*
|
||||
|
||||
VDU22G STA $C050 ; Enable Graphics
|
||||
STA $C057 ; Hi-Res
|
||||
STA $C054 ; PAGE1
|
||||
STA $C00C ; Select 40col text
|
||||
JMP CLEAR ; Clear HGR & text screen
|
||||
|
||||
* Clear screen line
|
||||
CLRLINE LDA VDUTEXTY ; ROW
|
||||
@ -714,76 +645,59 @@ CLRLNRET >>> ENTAUX
|
||||
* Scroll whole screen one line
|
||||
SCROLLER LDA #$00
|
||||
:L1 PHA
|
||||
JSR SCR1LINE
|
||||
JSR SCR1LINE ; Scroll text screen 1 line
|
||||
PLA
|
||||
INC
|
||||
LDY VDUBYTES
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BEQ :TEXTONLY ; Text mode, skip HGR scroll
|
||||
PHA
|
||||
JSR HSCR1LINE ; Scroll HGR screen 1 text line
|
||||
PLA
|
||||
:TEXTONLY INC
|
||||
CMP #23
|
||||
BNE :L1
|
||||
BIT VDUSTATUS
|
||||
BVC :L2 ; Copy cursor not active
|
||||
BVC :L2 ; Copy cursor not active
|
||||
JSR COPYSWAP1
|
||||
LDA #11
|
||||
JSR OUTCHARGO
|
||||
JSR COPYSWAP1
|
||||
:L2 RTS
|
||||
|
||||
* Copy line A+1 to line A
|
||||
SCR1LINE ASL ; Dest addr->ZP1
|
||||
TAX
|
||||
LDA SCNTAB,X
|
||||
STA ZP1
|
||||
LDA SCNTAB+1,X
|
||||
STA ZP1+1
|
||||
INX ; Source addr->ZP2
|
||||
INX
|
||||
LDA SCNTAB,X
|
||||
STA ZP2
|
||||
LDA SCNTAB+1,X
|
||||
STA ZP2+1
|
||||
LDY #$00
|
||||
:L1 LDA (ZP2),Y
|
||||
STA (ZP1),Y
|
||||
STA $C002 ; Read main mem
|
||||
>>> WRTMAIN
|
||||
LDA (ZP2),Y
|
||||
STA (ZP1),Y
|
||||
STA $C003 ; Read aux mem
|
||||
>>> WRTAUX
|
||||
INY
|
||||
CPY #40
|
||||
BNE :L1
|
||||
RTS
|
||||
|
||||
* Copy text line A+1 to line A for HGR bitmap gfx mode
|
||||
SCR1SOFT
|
||||
HSCR1LINE >>> XF2MAIN,HGRSCR1L
|
||||
HSCR1RET >>> ENTAUX
|
||||
RTS
|
||||
|
||||
* Copy line A+1 to line A
|
||||
SCR1LINE PHA
|
||||
BIT VDUSCREEN
|
||||
BPL :NOSOFT
|
||||
JSR SCR1SOFT
|
||||
:NOSOFT JSR CHARADDRY ; VDUADDR=>line A
|
||||
LDX #2
|
||||
:L1 LDA VDUADDR,X ; Copy to VDUADDR2
|
||||
STA VDUADDR2,X
|
||||
DEX
|
||||
BPL :L1
|
||||
PLA
|
||||
INC A
|
||||
JSR CHARADDRY ; VDUADDR=>line A+1
|
||||
BIT VDUBANK
|
||||
BMI SCROLLGS
|
||||
LDY #39
|
||||
:L2 LDA (VDUADDR),Y
|
||||
STA (VDUADDR2),Y
|
||||
PHP
|
||||
SEI
|
||||
STA $C002 ; Read main mem
|
||||
STA $C004 ; Write main mem
|
||||
LDA (VDUADDR),Y
|
||||
STA (VDUADDR2),Y
|
||||
STA $C003 ; Read aux mem
|
||||
STA $C005 ; Write aux mem
|
||||
PLP
|
||||
DEY
|
||||
BPL :L2
|
||||
RTS
|
||||
SCROLLGS LDX #1
|
||||
:L4 LDY #39
|
||||
:L5 CLC ; Enter 65816 native mode
|
||||
XCE
|
||||
SEP #$30 ; 8-bit M and X
|
||||
MX %11 ; Tell Merlin about it
|
||||
LDA [VDUADDR],Y
|
||||
STA [VDUADDR2],Y
|
||||
SEC ; Enter emulation mode
|
||||
XCE
|
||||
DEY
|
||||
BPL :L5
|
||||
LDA VDUBANK
|
||||
EOR #$01
|
||||
STA VDUBANK
|
||||
STA VDUBANK2
|
||||
DEX
|
||||
BPL :L4
|
||||
RTS
|
||||
|
||||
* VDU 1 - Send one character to printer
|
||||
VDU01 RTS
|
||||
|
||||
* VDU 16 - CLG, clear graphics window
|
||||
VDU16 >>> XF2MAIN,CLRHGR
|
||||
@ -795,22 +709,7 @@ VDU16RET >>> ENTAUX
|
||||
RTS
|
||||
|
||||
* VDU 17 - COLOUR n - select text or border colour
|
||||
VDU17 LDA VDUQ+8 ; *TEMP*
|
||||
AND #15
|
||||
TAY
|
||||
LDX CLRTRANS,Y
|
||||
BIT VDUQ+8
|
||||
BPL VDU17FGD
|
||||
BVC VDU17BGD
|
||||
STX $C034
|
||||
RTS
|
||||
VDU17BGD LDA $C022
|
||||
AND #$F0
|
||||
STA $C022
|
||||
TXA
|
||||
ORA $C022
|
||||
STA $C022
|
||||
VDU17FGD RTS
|
||||
VDU17 RTS
|
||||
|
||||
* VDU 18 - GCOL k,a - select graphics colour and plot action
|
||||
VDU18 LDA VDUQ+7 ; Argument 'k'
|
||||
@ -839,15 +738,14 @@ VDU18RET1 >>> ENTAUX
|
||||
VDU19 RTS
|
||||
|
||||
* VDU 20 - Reset to default colours
|
||||
VDU20 LDA #$00 ; *TEMP*
|
||||
STA $C034
|
||||
LDA #$F0
|
||||
STA $C022
|
||||
RTS
|
||||
VDU20 RTS
|
||||
|
||||
* VDU 23 - Program video system and define characters
|
||||
VDU23 RTS
|
||||
|
||||
* VDU 24,left;bottom;right;top; - define graphics window
|
||||
VDU24 RTS
|
||||
|
||||
* VDU 25,k,x;y; - PLOT k,x;y; - PLOT point, line, etc.
|
||||
* x is in VDUQ+7,VDUQ+8
|
||||
* y is in VDUQ+5,VDUQ+6
|
||||
@ -907,6 +805,12 @@ HGRPOS LDA VDUQ+5
|
||||
XPIXEL DW $0000 ; Previous plot x-coord
|
||||
YPIXEL DB $00 ; Previous plot y-coord
|
||||
|
||||
* VDU 28,left,bottom,right,top - define text window
|
||||
VDU28 RTS
|
||||
|
||||
* VDU 29,x;y; - define graphics origin
|
||||
VDU29 RTS
|
||||
|
||||
|
||||
|
||||
|
||||
@ -923,10 +827,6 @@ BYTEA02 LDY VDUVARS+1,X
|
||||
RTS
|
||||
|
||||
|
||||
* PRINTER DRIVER
|
||||
****************
|
||||
* VDU 1 - Send one character to printer
|
||||
VDU01 RTS
|
||||
|
||||
|
||||
|
||||
|
@ -85,8 +85,8 @@ RESET TSX
|
||||
LDA $C05A ; AN1 off
|
||||
LDA $C05D ; AN2 on
|
||||
LDA $C05F ; AN3 on
|
||||
** LDA #$20 ; PAGE2 shadow on ROM3 GS
|
||||
** TRB $C035
|
||||
LDA #$20 ; PAGE2 shadow on ROM3 GS
|
||||
TRB $C035
|
||||
>>> XF2AUX,AUXMOS
|
||||
RTS
|
||||
|
||||
|
@ -12,8 +12,8 @@ START JSR CROUT
|
||||
JSR SETPRFX
|
||||
JSR DISCONN
|
||||
|
||||
** LDA #$20 ; PAGE2 shadow on ROM3 GS
|
||||
** TRB $C035
|
||||
LDA #$20 ; PAGE2 shadow on ROM3 GS
|
||||
TRB $C035
|
||||
|
||||
JSR ROMMENU
|
||||
LDA #>AUXADDR ; Address in aux
|
||||
|
Loading…
Reference in New Issue
Block a user