mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-01 09:32:09 +00:00
Updated disk image. Builds on Merlin-16 again.
This commit is contained in:
parent
5eceff7e82
commit
fa879f7f52
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
@ -58,9 +58,6 @@ COPYBUF EQU $9200 ; File copy needs separate buffer
|
||||
* Location of FDraw library in main memory
|
||||
FDRAWADDR EQU $9400
|
||||
|
||||
* Location of bitmap font in main memory
|
||||
FONTADDR EQU $A900
|
||||
|
||||
* Address in aux memory where ROM will be loaded
|
||||
AUXADDR EQU $8000
|
||||
|
||||
|
478
auxmem.vdu.s
478
auxmem.vdu.s
@ -23,7 +23,7 @@
|
||||
* VDU DRIVER ZERO PAGE
|
||||
**********************
|
||||
* $00D0-$00DF VDU driver zero page workspace
|
||||
VDUSTATUS EQU $D0 ; $D0 # VDU status
|
||||
VDUSTATUS EQU $D0 ; $D0 # VDU status
|
||||
* bit 7 = VDU 21 VDU disabled
|
||||
* bit 6 = COPY cursor active
|
||||
* bit 5 = VDU 5 Text at graphics cursor
|
||||
@ -33,78 +33,78 @@ 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
|
||||
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
|
||||
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
|
||||
***************************
|
||||
FXLINES EQU BYTEVARBASE+217 ; Paged scrolling line counter
|
||||
FXVDUQLEN EQU BYTEVARBASE+218 ; Length of pending VDU queue
|
||||
FXLINES EQU BYTEVARBASE+217 ; Paged scrolling line counter
|
||||
FXVDUQLEN EQU BYTEVARBASE+218 ; Length of pending VDU queue
|
||||
VDUVARS EQU $290
|
||||
VDUVAREND EQU $2ED
|
||||
|
||||
GFXWINLFT EQU VDUVARS+$00 ; # graphics window left
|
||||
GFXWINBOT EQU VDUVARS+$02 ; # graphics window bottom \ window
|
||||
GFXWINRGT EQU VDUVARS+$04 ; # graphics window right / size
|
||||
GFXWINTOP EQU VDUVARS+$06 ; # graphics window top
|
||||
TXTWINLFT EQU VDUVARS+$08 ; # text window left
|
||||
TXTWINBOT EQU VDUVARS+$09 ; # text window bottom \ window
|
||||
TXTWINRGT EQU VDUVARS+$0A ; # text window right / size
|
||||
TXTWINTOP EQU VDUVARS+$0B ; # text window top
|
||||
GFXORIGX EQU VDUVARS+$0C ; graphics X origin
|
||||
GFXORIGY EQU VDUVARS+$0E ; graphics Y origin
|
||||
GFXWINLFT EQU VDUVARS+$00 ; # graphics window left
|
||||
GFXWINBOT EQU VDUVARS+$02 ; # graphics window bottom \ window
|
||||
GFXWINRGT EQU VDUVARS+$04 ; # graphics window right / size
|
||||
GFXWINTOP EQU VDUVARS+$06 ; # graphics window top
|
||||
TXTWINLFT EQU VDUVARS+$08 ; # text window left
|
||||
TXTWINBOT EQU VDUVARS+$09 ; # text window bottom \ window
|
||||
TXTWINRGT EQU VDUVARS+$0A ; # text window right / size
|
||||
TXTWINTOP EQU VDUVARS+$0B ; # text window top
|
||||
GFXORIGX EQU VDUVARS+$0C ; graphics X origin
|
||||
GFXORIGY EQU VDUVARS+$0E ; graphics Y origin
|
||||
*
|
||||
GFXPOSNX EQU VDUVARS+$10 ; current graphics X posn
|
||||
GFXPOSNY EQU VDUVARS+$12 ; current graphics Y posn
|
||||
GFXLASTX EQU VDUVARS+$14 ; last graphics X posn
|
||||
GFXLASTY EQU VDUVARS+$16 ; last graphics Y posn
|
||||
VDUTEXTX EQU VDUVARS+$18 ; # absolute text X posn = POS+WINLFT
|
||||
VDUTEXTY EQU VDUVARS+$19 ; # absolute text Y posn = VPOS+WINTOP
|
||||
VDUCOPYX EQU VDUVARS+$1A ; absolute COPY text X posn
|
||||
VDUCOPYY EQU VDUVARS+$1B ; absolute COPY text Y posn
|
||||
GFXPOSNX EQU VDUVARS+$10 ; current graphics X posn
|
||||
GFXPOSNY EQU VDUVARS+$12 ; current graphics Y posn
|
||||
GFXLASTX EQU VDUVARS+$14 ; last graphics X posn
|
||||
GFXLASTY EQU VDUVARS+$16 ; last graphics Y posn
|
||||
VDUTEXTX EQU VDUVARS+$18 ; # absolute text X posn = POS+WINLFT
|
||||
VDUTEXTY EQU VDUVARS+$19 ; # absolute text Y posn = VPOS+WINTOP
|
||||
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
|
||||
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
|
||||
*
|
||||
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
|
||||
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
|
||||
SCNCOLOURS DB 1, 1, 1, 1, 1, 1, 1, 1 ; Colours-1
|
||||
SCNTYPE DB 1, 0,128,1, 0, 0, 0,64 ; Screen type
|
||||
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
|
||||
SCNCOLOURS DB 1,1
|
||||
SCNTYPE DB 1,0,128,1
|
||||
* b7=FastDraw
|
||||
* b6=Teletext
|
||||
* b0=40COL/80COL
|
||||
@ -123,36 +123,36 @@ SCNTAB DW $800,$880,$900,$980,$A00,$A80,$B00,$B80
|
||||
* CS if printer echo enabled for this character
|
||||
*
|
||||
OUTCHAR LDX FXVDUQLEN
|
||||
BNE ADDTOQ ; Waiting for chars
|
||||
BNE ADDTOQ ; Waiting for chars
|
||||
CMP #$7F
|
||||
BEQ CTRLDEL ; =$7F - control char
|
||||
BEQ CTRLDEL ; =$7F - control char
|
||||
CMP #$20
|
||||
BCC CTRLCHAR ; <$20 - control char
|
||||
BCC CTRLCHAR ; <$20 - control char
|
||||
BIT VDUSTATUS
|
||||
BMI OUTCHEXIT ; VDU disabled
|
||||
OUTCHARCP JSR PRCHRC ; Store char, checking keypress
|
||||
JSR VDU09 ; Move cursor right
|
||||
BMI OUTCHEXIT ; VDU disabled
|
||||
OUTCHARCP JSR PRCHRC ; Store char, checking keypress
|
||||
JSR VDU09 ; Move cursor right
|
||||
|
||||
* OSBYTE &75 - Read VDUSTATUS
|
||||
*****************************
|
||||
BYTE75
|
||||
OUTCHEXIT LDA VDUSTATUS
|
||||
TAX
|
||||
LSR A ; Return Cy=Printer Echo Enabled
|
||||
LSR A ; Return Cy=Printer Echo Enabled
|
||||
RTS
|
||||
|
||||
CTRLDEL LDA #$20 ; $7F becomes $20
|
||||
CTRLDEL LDA #$20 ; $7F becomes $20
|
||||
CTRLCHAR CMP #$01
|
||||
BEQ ADDQ ; One param
|
||||
BEQ ADDQ ; One param
|
||||
CMP #$11
|
||||
BCC CTRLCHARGO ; Zero params
|
||||
ADDQ STA VDUCHAR ; Save initial character
|
||||
BCC CTRLCHARGO ; Zero params
|
||||
ADDQ STA VDUCHAR ; Save initial character
|
||||
AND #$0F
|
||||
TAX
|
||||
LDA QLEN,X
|
||||
STA FXVDUQLEN ; Number of params to queue
|
||||
BEQ CTRLCHARGO1 ; Zero, do it now
|
||||
QDONE CLC ; CLC=Don't echo VDU queue to printer
|
||||
STA FXVDUQLEN ; Number of params to queue
|
||||
BEQ CTRLCHARGO1 ; Zero, do it now
|
||||
QDONE CLC ; CLC=Don't echo VDU queue to printer
|
||||
RTS
|
||||
ADDTOQ STA VDUQ-256+9,X
|
||||
INC FXVDUQLEN
|
||||
@ -160,22 +160,22 @@ ADDTOQ STA VDUQ-256+9,X
|
||||
CTRLCHARGO1 LDA VDUCHAR
|
||||
CTRLCHARGO ASL A
|
||||
TAY
|
||||
CMP #$10 ; 8*2
|
||||
BCC CTRLCHARGO2 ; ctrl<$08, don't echo to printer
|
||||
EOR #$FF ; ctrl>$0D, don't echo to printer
|
||||
CMP #$E5 ; (13*2) EOR 255
|
||||
CTRLCHARGO2 PHP ; Save CS=(ctrl>=8 && ctrl<=13)
|
||||
JSR CTRLCHARJMP ; Call routine
|
||||
CMP #$10 ; 8*2
|
||||
BCC CTRLCHARGO2 ; ctrl<$08, don't echo to printer
|
||||
EOR #$FF ; ctrl>$0D, don't echo to printer
|
||||
CMP #$E5 ; (13*2) EOR 255
|
||||
CTRLCHARGO2 PHP ; Save CS=(ctrl>=8 && ctrl<=13)
|
||||
JSR CTRLCHARJMP ; Call routine
|
||||
PLP
|
||||
BCS OUTCHEXIT ; If echoable, test if printer enabled
|
||||
RTS ; Return, CC=Don't echo to printer
|
||||
BCS OUTCHEXIT ; If echoable, test if printer enabled
|
||||
RTS ; Return, CC=Don't echo to printer
|
||||
|
||||
OUTCHARGO ASL A ; Entry point to move COPY cursor
|
||||
TAY ; (TEMP and scroll screen)
|
||||
OUTCHARGO ASL A ; Entry point to move COPY cursor
|
||||
TAY ; (TEMP and scroll screen)
|
||||
CTRLCHARJMP CPY #6*2
|
||||
BEQ CTRLCHAR6 ; Always allow VDU 6 through
|
||||
BEQ CTRLCHAR6 ; Always allow VDU 6 through
|
||||
BIT VDUSTATUS
|
||||
BMI VDU00 ; VDU disabled
|
||||
BMI VDU00 ; VDU disabled
|
||||
CTRLCHAR6 LDA CTRLADDRS+1,Y
|
||||
PHA
|
||||
LDA CTRLADDRS+0,Y
|
||||
@ -202,46 +202,46 @@ CTRLADDRS DW VDU00-1,VDU01-1,VDU02-1,VDU03-1
|
||||
* VDU 2 - Start print job
|
||||
VDU02
|
||||
* JSR select printer
|
||||
LDA #$01 ; Set Printer Echo On
|
||||
LDA #$01 ; Set Printer Echo On
|
||||
BNE SETSTATUS
|
||||
|
||||
* VDU 5 - Text at graphics cursor
|
||||
VDU05 LDX VDUPIXELS
|
||||
BEQ SETEXIT ; 0 pixels per char, text only
|
||||
BEQ SETEXIT ; 0 pixels per char, text only
|
||||
* Turn cursor off and other stuff
|
||||
LDA #$20 ; Set VDU 5 mode
|
||||
LDA #$20 ; Set VDU 5 mode
|
||||
BNE SETSTATUS
|
||||
|
||||
* VDU 14 - Select paged scrolling
|
||||
VDU14 STZ FXLINES ; Reset line counter
|
||||
LDA #$04 ; Set Paged Mode
|
||||
VDU14 STZ FXLINES ; Reset line counter
|
||||
LDA #$04 ; Set Paged Mode
|
||||
BNE SETSTATUS
|
||||
|
||||
* VDU 21 - Disable VDU
|
||||
VDU21 LDA #$80 ; Set VDU disabled
|
||||
VDU21 LDA #$80 ; Set VDU disabled
|
||||
|
||||
SETSTATUS ORA VDUSTATUS ; Set bits in VDU STATUS
|
||||
SETSTATUS ORA VDUSTATUS ; Set bits in VDU STATUS
|
||||
STA VDUSTATUS
|
||||
SETEXIT RTS
|
||||
|
||||
* VDU 3 - End print job
|
||||
VDU03
|
||||
* JSR flush printer
|
||||
LDA #$FE ; Clear Printer Echo
|
||||
LDA #$FE ; Clear Printer Echo
|
||||
BNE CLRSTATUS
|
||||
|
||||
* VDU 4 - Text at text cursor
|
||||
VDU04
|
||||
* Turn cursor on and other stuff
|
||||
LDA #$DF ; Clear VDU 5 mode
|
||||
LDA #$DF ; Clear VDU 5 mode
|
||||
BNE CLRSTATUS
|
||||
|
||||
* VDU 15 - Disable paged scrolling
|
||||
VDU15 LDA #$FB ; Clear paged scrolling
|
||||
VDU15 LDA #$FB ; Clear paged scrolling
|
||||
BRA CLRSTATUS
|
||||
|
||||
* VDU 6 - Enable VDU
|
||||
VDU06 LDA #$7F ; Clear VDU disabled
|
||||
VDU06 LDA #$7F ; Clear VDU disabled
|
||||
|
||||
CLRSTATUS AND VDUSTATUS
|
||||
STA VDUSTATUS
|
||||
@ -252,30 +252,30 @@ CLRSTATUS AND VDUSTATUS
|
||||
* A=cursor key, CS from caller
|
||||
COPYMOVE PHA
|
||||
BIT VDUSTATUS
|
||||
BVS COPYMOVE2 ; Edit cursor already on
|
||||
BVS COPYMOVE2 ; Edit cursor already on
|
||||
JSR GETCHRC
|
||||
STA COPYCHAR
|
||||
LDA CURSORED
|
||||
JSR PUTCHRC ; Edit cursor
|
||||
JSR PUTCHRC ; Edit cursor
|
||||
SEC
|
||||
JSR COPYSWAP2 ; Initialise copy cursor
|
||||
JSR COPYSWAP2 ; Initialise copy cursor
|
||||
ROR FLASHER
|
||||
ASL FLASHER ; Ensure b0=0
|
||||
ASL FLASHER ; Ensure b0=0
|
||||
LDA #$42
|
||||
ORA VDUSTATUS
|
||||
STA VDUSTATUS ; Turn cursor editing on
|
||||
STA VDUSTATUS ; Turn cursor editing on
|
||||
COPYMOVE2 PLA
|
||||
AND #3 ; Convert to 8/9/10/11
|
||||
AND #3 ; Convert to 8/9/10/11
|
||||
ORA #8
|
||||
COPYMOVE3 JMP OUTCHARGO ; Move edit cursor
|
||||
COPYMOVE3 JMP OUTCHARGO ; Move edit cursor
|
||||
|
||||
* Swap between edit and copy cursors
|
||||
COPYSWAP1 CLC ; CC=Swap TEXT and COPY
|
||||
COPYSWAP1 CLC ; CC=Swap TEXT and COPY
|
||||
COPYSWAP2 LDX #1
|
||||
COPYSWAPLP LDY VDUCOPYX,X
|
||||
LDA VDUTEXTX,X
|
||||
STA VDUCOPYX,X
|
||||
BCS COPYSWAP3 ; CS=Copy TEXT to COPY
|
||||
BCS COPYSWAP3 ; CS=Copy TEXT to COPY
|
||||
TYA
|
||||
STA VDUTEXTX,X
|
||||
COPYSWAP3 DEX
|
||||
@ -284,75 +284,75 @@ COPYSWAP4 RTS
|
||||
|
||||
|
||||
* Perform backspace & delete operation
|
||||
VDU127 JSR VDU08 ; Move cursor back
|
||||
LDA #' ' ; Overwrite with a space
|
||||
VDU127 JSR VDU08 ; Move cursor back
|
||||
LDA #' ' ; Overwrite with a space
|
||||
BNE PUTCHRC
|
||||
|
||||
* Display character at current (TEXTX,TEXTY)
|
||||
PRCHRC PHA ; Save character
|
||||
PRCHRC PHA ; Save character
|
||||
LDA $C000
|
||||
BPL :RESUME ; No key pressed
|
||||
BPL :RESUME ; No key pressed
|
||||
EOR #$80
|
||||
:PAUSE1 JSR KBDCHKESC ; Ask KBD to test if Escape
|
||||
:PAUSE1 JSR KBDCHKESC ; Ask KBD to test if Escape
|
||||
BIT ESCFLAG
|
||||
BMI :RESUMEACK ; Escape, skip pausing
|
||||
BMI :RESUMEACK ; Escape, skip pausing
|
||||
CMP #$13
|
||||
BNE :RESUME ; Not Ctrl-S
|
||||
STA $C010 ; Ack. keypress
|
||||
BNE :RESUME ; Not Ctrl-S
|
||||
STA $C010 ; Ack. keypress
|
||||
:PAUSE2 LDA $C000
|
||||
BPL :PAUSE2 ; Loop until keypress
|
||||
BPL :PAUSE2 ; Loop until keypress
|
||||
EOR #$80
|
||||
CMP #$11 ; Ctrl-Q
|
||||
BEQ :RESUMEACK ; Stop pausing
|
||||
JSR KBDCHKESC ; Ask KBD to test if Escape
|
||||
CMP #$11 ; Ctrl-Q
|
||||
BEQ :RESUMEACK ; Stop pausing
|
||||
JSR KBDCHKESC ; Ask KBD to test if Escape
|
||||
BIT ESCFLAG
|
||||
BPL :PAUSE2 ; No Escape, keep pausing
|
||||
:RESUMEACK STA $C010 ; Ack. keypress
|
||||
BPL :PAUSE2 ; No Escape, keep pausing
|
||||
:RESUMEACK STA $C010 ; Ack. keypress
|
||||
:RESUME PLA
|
||||
|
||||
* Put character to screen
|
||||
PUTCHRC LDY VDUBYTES
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BNE PRCHRSOFT ; Graphics mode
|
||||
EOR #$80 ; Convert character
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BNE PRCHRSOFT ; Graphics mode
|
||||
EOR #$80 ; Convert character
|
||||
TAY
|
||||
AND #$A0
|
||||
BNE PRCHR4
|
||||
CPY #$20
|
||||
BCS PRCHR3 ; Not $80-$9F
|
||||
BCS PRCHR3 ; Not $80-$9F
|
||||
BIT VDUSCREEN
|
||||
BVC PRCHR3 ; Not teletext
|
||||
LDY #$E0 ; Convert $80-$9F to space
|
||||
BVC PRCHR3 ; Not teletext
|
||||
LDY #$E0 ; Convert $80-$9F to space
|
||||
PRCHR3 TYA
|
||||
EOR #$40
|
||||
TAY
|
||||
PRCHR4 PHY
|
||||
JSR CHARADDR ; Find character address
|
||||
PLA ; Get character back
|
||||
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
|
||||
JSR CHARADDR ; Find character address
|
||||
PLA ; Get character back
|
||||
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
|
||||
RTS
|
||||
PRCHRSOFT RTS ; *TODO* Jump to gfx
|
||||
PRCHRSOFT RTS ; *TODO* Jump to gfx
|
||||
|
||||
* Fetch character from screen at (TEXTX,TEXTY) and return MODE in Y
|
||||
BYTE87
|
||||
GETCHRC LDY VDUBYTES
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BNE GETCHRSOFT ; Graphics mode
|
||||
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
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BNE GETCHRSOFT ; Graphics mode
|
||||
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 GETCHR7
|
||||
TYA
|
||||
@ -360,30 +360,30 @@ GETCHR6 LDA (VDUADDR),Y ; Get character
|
||||
TAY
|
||||
GETCHR7 TYA
|
||||
EOR #$80
|
||||
LDY VDUMODE ; Y=MODE
|
||||
TAX ; X=char
|
||||
LDY VDUMODE ; Y=MODE
|
||||
TAX ; X=char
|
||||
GETCHROK RTS
|
||||
GETCHRSOFT RTS ; *TODO* Jump to gfx
|
||||
GETCHRSOFT RTS ; *TODO* Jump to gfx
|
||||
|
||||
* Get text cursor position
|
||||
BYTE86 LDY VDUTEXTY ; ROW ; $86 = read cursor pos
|
||||
LDX VDUTEXTX ; COL
|
||||
BYTE86 LDY VDUTEXTY ; ROW ; $86 = read cursor pos
|
||||
LDX VDUTEXTX ; COL
|
||||
RTS
|
||||
|
||||
* Calculate character address
|
||||
CHARADDR LDA VDUTEXTY
|
||||
ASL
|
||||
TAX
|
||||
LDA SCNTAB+0,X ; LSB of row address
|
||||
LDA SCNTAB+0,X ; LSB of row address
|
||||
STA VDUADDR+0
|
||||
LDA SCNTAB+1,X ; 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
|
||||
CHARADDR40 TAY ; Y=offset into this row
|
||||
RTS
|
||||
* (VDUADDR),Y=>character address
|
||||
* CC=auxmem
|
||||
@ -391,63 +391,63 @@ CHARADDR40 TAY ; Y=offset into this row
|
||||
|
||||
|
||||
* Move cursor left
|
||||
VDU08 LDA VDUTEXTX ; COL
|
||||
VDU08 LDA VDUTEXTX ; COL
|
||||
BEQ :S1
|
||||
DEC VDUTEXTX ; COL
|
||||
DEC VDUTEXTX ; COL
|
||||
BRA :S3
|
||||
:S1 LDA VDUTEXTY ; ROW
|
||||
:S1 LDA VDUTEXTY ; ROW
|
||||
BEQ :S3
|
||||
DEC VDUTEXTY ; ROW
|
||||
DEC VDUTEXTY ; ROW
|
||||
LDA #39
|
||||
BIT $C01F
|
||||
BPL :S2
|
||||
LDA #79
|
||||
:S2 STA VDUTEXTX ; COL
|
||||
:S2 STA VDUTEXTX ; COL
|
||||
:S3 RTS
|
||||
|
||||
* Move cursor right
|
||||
VDU09 LDA VDUTEXTX ; COL
|
||||
VDU09 LDA VDUTEXTX ; COL
|
||||
CMP #39
|
||||
BCC :S2
|
||||
BIT $C01F
|
||||
BPL :T11
|
||||
CMP #79
|
||||
BCC :S2
|
||||
:T11 STZ VDUTEXTX ; COL
|
||||
LDA VDUTEXTY ; ROW
|
||||
:T11 STZ VDUTEXTX ; COL
|
||||
LDA VDUTEXTY ; ROW
|
||||
CMP #23
|
||||
BEQ SCROLL
|
||||
INC VDUTEXTY ; ROW
|
||||
INC VDUTEXTY ; ROW
|
||||
:DONE RTS
|
||||
:S2 INC VDUTEXTX ; COL
|
||||
:S2 INC VDUTEXTX ; COL
|
||||
BRA :DONE
|
||||
SCROLL JSR SCROLLER
|
||||
JSR CLREOL
|
||||
RTS
|
||||
|
||||
* Move cursor down
|
||||
VDU10 LDA VDUTEXTY ; ROW
|
||||
VDU10 LDA VDUTEXTY ; ROW
|
||||
CMP #23
|
||||
BEQ :TOSCRL ; JGH
|
||||
INC VDUTEXTY ; ROW
|
||||
BEQ :TOSCRL ; JGH
|
||||
INC VDUTEXTY ; ROW
|
||||
RTS
|
||||
:TOSCRL JMP SCROLL ; JGH
|
||||
:TOSCRL JMP SCROLL ; JGH
|
||||
|
||||
* Move cursor up
|
||||
VDU11 LDA VDUTEXTY ; ROW
|
||||
VDU11 LDA VDUTEXTY ; ROW
|
||||
BEQ :DONE
|
||||
DEC VDUTEXTY ; ROW
|
||||
DEC VDUTEXTY ; ROW
|
||||
:DONE RTS
|
||||
|
||||
* Move to start of line
|
||||
VDU13 LDA #$BF
|
||||
JSR CLRSTATUS ; Turn copy cursor off
|
||||
STZ VDUTEXTX ; COL
|
||||
JSR CLRSTATUS ; Turn copy cursor off
|
||||
STZ VDUTEXTX ; COL
|
||||
RTS
|
||||
|
||||
* Move to (0,0)
|
||||
VDU30 STZ VDUTEXTY ; ROW
|
||||
STZ VDUTEXTX ; COL
|
||||
VDU30 STZ VDUTEXTY ; ROW
|
||||
STZ VDUTEXTX ; COL
|
||||
RTS
|
||||
|
||||
* Move to (X,Y)
|
||||
@ -461,8 +461,8 @@ VDU31 LDY VDUQ+8
|
||||
BMI :T9A
|
||||
CPX #40
|
||||
BCS :DONE
|
||||
:T9A STX VDUTEXTX ; COL
|
||||
STY VDUTEXTY ; ROW
|
||||
:T9A STX VDUTEXTX ; COL
|
||||
STY VDUTEXTY ; ROW
|
||||
:DONE RTS
|
||||
|
||||
|
||||
@ -495,14 +495,14 @@ VDUINIT STA VDUQ+8
|
||||
VDU22 LDA VDUQ+8
|
||||
AND #$07
|
||||
STA VDUMODE
|
||||
TAX ; Set up MODE
|
||||
LDA #'_' ; Set up default cursors
|
||||
STA CURSOR ; Normal cursor
|
||||
STA CURSORCP ; Copy cursor when editing
|
||||
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
|
||||
STA CURSORED ; Edit cursor when editing
|
||||
LDA #$01
|
||||
JSR CLRSTATUS ; Clear everything except PrinterEcho
|
||||
JSR CLRSTATUS ; Clear everything except PrinterEcho
|
||||
JSR VDU26A
|
||||
*
|
||||
LDA SCNBYTES,X
|
||||
@ -511,27 +511,27 @@ VDU22 LDA VDUQ+8
|
||||
STA VDUCOLOURS
|
||||
LDA SCNTYPE,X
|
||||
STA VDUSCREEN
|
||||
BMI VDU22G ; b7=1, graphics mode
|
||||
BMI VDU22G ; b7=1, graphics mode
|
||||
* TEMP
|
||||
CPX #2
|
||||
BEQ VDU22G ; Jump out for MODE 2
|
||||
BEQ VDU22G ; Jump out for MODE 2
|
||||
* TEMP
|
||||
*
|
||||
AND #$01 ; 40col/80col bit
|
||||
AND #$01 ; 40col/80col bit
|
||||
TAX
|
||||
STA $C00C,X ; Select 40col/80col
|
||||
STA $C051 ; Enable Text
|
||||
STA $C055 ; PAGE2
|
||||
STA $C052 ; Clear MIXED
|
||||
STA $C00F ; Enable alt charset
|
||||
STA $C00C,X ; Select 40col/80col
|
||||
STA $C051 ; Enable Text
|
||||
STA $C055 ; PAGE2
|
||||
STA $C052 ; Clear MIXED
|
||||
STA $C00F ; Enable alt charset
|
||||
BRA VDU22CLR
|
||||
|
||||
|
||||
VDU22G STA $C050 ; Enable Graphics
|
||||
STA $C057 ; Hi-Res
|
||||
STA $C054 ; PAGE1
|
||||
STA $C052 ; Clear MIXED
|
||||
JMP VDU16 ; Clear HGR screen
|
||||
|
||||
VDU22G STA $C050 ; Enable Graphics
|
||||
STA $C057 ; Hi-Res
|
||||
STA $C054 ; PAGE1
|
||||
STA $C052 ; Clear MIXED
|
||||
JMP VDU16 ; Clear HGR screen
|
||||
|
||||
VDU22CLR
|
||||
* JSR VDU15 ; Turn off paged scrolling
|
||||
@ -541,38 +541,38 @@ VDU22CLR
|
||||
|
||||
|
||||
VDU12 LDY VDUBYTES
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BNE VDU12SOFT ; Graphics mode
|
||||
DEY ; If VDUBYTE=1, text mode
|
||||
BNE VDU12SOFT ; Graphics mode
|
||||
JMP CLEAR
|
||||
|
||||
* Clear the screen
|
||||
CLEAR STZ VDUTEXTY ; ROW
|
||||
STZ VDUTEXTX ; COL
|
||||
CLEAR STZ VDUTEXTY ; ROW
|
||||
STZ VDUTEXTX ; COL
|
||||
:L1 JSR CLREOL
|
||||
:S2 LDA VDUTEXTY ; ROW
|
||||
:S2 LDA VDUTEXTY ; ROW
|
||||
CMP #23
|
||||
BEQ :S3
|
||||
INC VDUTEXTY ; ROW
|
||||
INC VDUTEXTY ; ROW
|
||||
BRA :L1
|
||||
:S3 STZ VDUTEXTY ; ROW
|
||||
STZ VDUTEXTX ; COL
|
||||
:S3 STZ VDUTEXTY ; ROW
|
||||
STZ VDUTEXTX ; COL
|
||||
RTS
|
||||
VDU12SOFT JMP VDU16 ; *TEMP*
|
||||
VDU12SOFT JMP VDU16 ; *TEMP*
|
||||
|
||||
|
||||
* Clear to EOL
|
||||
CLREOL LDA VDUTEXTY ; ROW
|
||||
CLREOL LDA VDUTEXTY ; ROW
|
||||
ASL
|
||||
TAX
|
||||
LDA SCNTAB,X ; LSB of row
|
||||
LDA SCNTAB,X ; LSB of row
|
||||
STA ZP1
|
||||
LDA SCNTAB+1,X ; MSB of row
|
||||
LDA SCNTAB+1,X ; MSB of row
|
||||
STA ZP1+1
|
||||
LDA VDUTEXTX ; COL
|
||||
LDA VDUTEXTX ; COL
|
||||
PHA
|
||||
STZ VDUTEXTX ; COL
|
||||
STZ VDUTEXTX ; COL
|
||||
:L1
|
||||
LDA VDUTEXTX ; COL
|
||||
LDA VDUTEXTX ; COL
|
||||
LSR
|
||||
TAY
|
||||
BCC :S1
|
||||
@ -580,13 +580,13 @@ CLREOL LDA VDUTEXTY ; ROW
|
||||
:S1 LDA #" "
|
||||
STA (ZP1),Y
|
||||
>>> WRTAUX
|
||||
LDA VDUTEXTX ; COL
|
||||
LDA VDUTEXTX ; COL
|
||||
CMP #79
|
||||
BEQ :S2
|
||||
INC VDUTEXTX ; COL
|
||||
INC VDUTEXTX ; COL
|
||||
BRA :L1
|
||||
:S2 PLA
|
||||
STA VDUTEXTX ; COL
|
||||
STA VDUTEXTX ; COL
|
||||
RTS
|
||||
|
||||
* Scroll whole screen one line
|
||||
@ -598,7 +598,7 @@ SCROLLER LDA #$00
|
||||
CMP #23
|
||||
BNE :L1
|
||||
BIT VDUSTATUS
|
||||
BVC :L2 ; Copy cursor not active
|
||||
BVC :L2 ; Copy cursor not active
|
||||
JSR COPYSWAP1
|
||||
LDA #11
|
||||
JSR OUTCHARGO
|
||||
@ -606,13 +606,13 @@ SCROLLER LDA #$00
|
||||
:L2 RTS
|
||||
|
||||
* Copy line A+1 to line A
|
||||
SCR1LINE ASL ; Dest addr->ZP1
|
||||
SCR1LINE ASL ; Dest addr->ZP1
|
||||
TAX
|
||||
LDA SCNTAB,X
|
||||
STA ZP1
|
||||
LDA SCNTAB+1,X
|
||||
STA ZP1+1
|
||||
INX ; Source addr->ZP2
|
||||
INX ; Source addr->ZP2
|
||||
INX
|
||||
LDA SCNTAB,X
|
||||
STA ZP2
|
||||
@ -621,11 +621,11 @@ SCR1LINE ASL ; Dest addr->ZP1
|
||||
LDY #$00
|
||||
:L1 LDA (ZP2),Y
|
||||
STA (ZP1),Y
|
||||
STA $C002 ; Read main mem
|
||||
STA $C002 ; Read main mem
|
||||
>>> WRTMAIN
|
||||
LDA (ZP2),Y
|
||||
STA (ZP1),Y
|
||||
STA $C003 ; Read aux mem
|
||||
STA $C003 ; Read aux mem
|
||||
>>> WRTAUX
|
||||
INY
|
||||
CPY #40
|
||||
@ -649,25 +649,25 @@ VDU16RET >>> ENTAUX
|
||||
VDU17 RTS
|
||||
|
||||
* VDU 18 - GCOL k,a - select graphics colour and plot action
|
||||
VDU18 LDA VDUQ+7 ; Argument 'k'
|
||||
CMP #$04 ; k=4 means XOR
|
||||
LDA #$00 ; Normal drawing mode
|
||||
VDU18 LDA VDUQ+7 ; Argument 'k'
|
||||
CMP #$04 ; k=4 means XOR
|
||||
LDA #$00 ; Normal drawing mode
|
||||
BNE :NORM
|
||||
LDA #$01 ; XOR mode
|
||||
LDA #$01 ; XOR mode
|
||||
:NORM >>> WRTMAIN
|
||||
STA LINETYPE
|
||||
STA FDRAWADDR+5
|
||||
>>> WRTAUX
|
||||
>>> XF2MAIN,SETLINE
|
||||
VDU18RET1 >>> ENTAUX
|
||||
:NORM LDA VDUQ+8 ; Argument 'a'
|
||||
BPL :FOREGND ; <128 is foreground
|
||||
:NORM LDA VDUQ+8 ; Argument 'a'
|
||||
BPL :FOREGND ; <128 is foreground
|
||||
>>> WRTMAIN
|
||||
STA BGCOLOR ; Stored in main memory
|
||||
STA BGCOLOR ; Stored in main memory
|
||||
>>> WRTAUX
|
||||
RTS
|
||||
:FOREGND >>> WRTMAIN
|
||||
STA FGCOLOR ; Stored in main memory
|
||||
STA FGCOLOR ; Stored in main memory
|
||||
>>> WRTAUX
|
||||
RTS
|
||||
|
||||
@ -687,29 +687,29 @@ VDU24 RTS
|
||||
* x is in VDUQ+7,VDUQ+8
|
||||
* y is in VDUQ+5,VDUQ+6
|
||||
* k is in VDUQ+4
|
||||
VDU25 JSR CVTCOORD ; Convert coordinate system
|
||||
VDU25 JSR CVTCOORD ; Convert coordinate system
|
||||
LDA VDUQ+4
|
||||
AND #$04 ; Bit 2 set -> absolute
|
||||
AND #$04 ; Bit 2 set -> absolute
|
||||
BNE :ABS
|
||||
JSR RELCOORD ; Add coords to XPIXEL/YPIXEL
|
||||
JSR RELCOORD ; Add coords to XPIXEL/YPIXEL
|
||||
:ABS LDA VDUQ+4
|
||||
AND #$03
|
||||
CMP #$0 ; Bits 0,1 clear -> just move
|
||||
CMP #$0 ; Bits 0,1 clear -> just move
|
||||
BNE :NOTMOVE
|
||||
JMP HGRPOS ; Just update pos
|
||||
JMP HGRPOS ; Just update pos
|
||||
:NOTMOVE LDA VDUQ+4
|
||||
AND #$C0
|
||||
CMP #$40 ; Bit 7 clr, bit 6 set -> point
|
||||
CMP #$40 ; Bit 7 clr, bit 6 set -> point
|
||||
BNE :LINE
|
||||
>>> WRTMAIN
|
||||
LDA VDUQ+4
|
||||
STA PLOTMODE
|
||||
LDA VDUQ+5
|
||||
STA FDRAWADDR+6 ; LSB of X1
|
||||
STA FDRAWADDR+6 ; LSB of X1
|
||||
LDA VDUQ+6
|
||||
STA FDRAWADDR+7 ; MSB of X1
|
||||
STA FDRAWADDR+7 ; MSB of X1
|
||||
LDA VDUQ+7
|
||||
STA FDRAWADDR+8 ; Y1
|
||||
STA FDRAWADDR+8 ; Y1
|
||||
>>> WRTAUX
|
||||
>>> XF2MAIN,DRAWPNT
|
||||
:LINE >>> WRTMAIN
|
||||
@ -722,11 +722,11 @@ VDU25 JSR CVTCOORD ; Convert coordinate system
|
||||
LDA YPIXEL
|
||||
STA FDRAWADDR+8
|
||||
LDA VDUQ+5
|
||||
STA FDRAWADDR+9 ; LSB of X1
|
||||
STA FDRAWADDR+9 ; LSB of X1
|
||||
LDA VDUQ+6
|
||||
STA FDRAWADDR+10 ; MSB of X1
|
||||
STA FDRAWADDR+10 ; MSB of X1
|
||||
LDA VDUQ+7
|
||||
STA FDRAWADDR+11 ; Y1
|
||||
STA FDRAWADDR+11 ; Y1
|
||||
>>> WRTAUX
|
||||
>>> XF2MAIN,DRAWLINE
|
||||
VDU25RET >>> ENTAUX
|
||||
@ -739,8 +739,8 @@ HGRPOS LDA VDUQ+5
|
||||
LDA VDUQ+7
|
||||
STA YPIXEL
|
||||
RTS
|
||||
XPIXEL DW $0000 ; Previous plot x-coord
|
||||
YPIXEL DB $00 ; Previous plot y-coord
|
||||
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
|
||||
@ -753,7 +753,7 @@ VDU29 RTS
|
||||
|
||||
* OSBYTE &A0 - Read VDU variable
|
||||
********************************
|
||||
BYTEA0 CPX #$40 ; Index into VDU variables
|
||||
BYTEA0 CPX #$40 ; Index into VDU variables
|
||||
BCC BYTEA02
|
||||
TXA
|
||||
SBC #$20
|
||||
|
@ -30,15 +30,6 @@ START JSR CROUT
|
||||
CLC ; Load into main
|
||||
JSR LOADCODE
|
||||
|
||||
LDA #<:FNTFILE
|
||||
STA OPENPL+1
|
||||
LDA #>:FNTFILE
|
||||
STA OPENPL+2
|
||||
LDA #>FONTADDR ; Address in main
|
||||
LDX #<FONTADDR
|
||||
CLC ; Load into main
|
||||
JSR LOADCODE
|
||||
|
||||
LDA #<MOSSHIM ; Start address of MOS shim
|
||||
STA A1L
|
||||
LDA #>MOSSHIM
|
||||
@ -78,7 +69,6 @@ START JSR CROUT
|
||||
>>> XF2AUX,AUXMOS1
|
||||
|
||||
:FDFILE STR "FDRAW.FAST" ; Filename for FDraw lib
|
||||
:FNTFILE STR "FONT.DAT" ; Filename for bitmap font
|
||||
|
||||
* Load image from file into memory
|
||||
* On entry: OPENPL set up to point to file to load
|
||||
|
@ -1129,11 +1129,6 @@ GFXINIT JSR FDRAWADDR+0 ; Initialize FDRAW library
|
||||
JSR FDRAWADDR+22 ; FDRAW: clear HGR screen
|
||||
RTS
|
||||
|
||||
* Draw character on graphics screen (byte aligned)
|
||||
* On entry: Character in A
|
||||
DRAWCHAR
|
||||
RTS
|
||||
|
||||
FGCOLOR DB $00 ; Foreground colour
|
||||
BGCOLOR DB $00 ; Background colour
|
||||
LINETYPE DB $00 ; 0 normal, 1 XOR
|
||||
|
Loading…
Reference in New Issue
Block a user