mirror of
https://github.com/sethm/symon.git
synced 2024-06-22 23:29:38 +00:00
New ROMs. Better backspace handling.
This commit is contained in:
parent
e0d6017d95
commit
4796b65390
|
@ -44,13 +44,7 @@ RES_vec
|
||||||
TXS ; set the stack
|
TXS ; set the stack
|
||||||
|
|
||||||
;; Initialize the CRTC
|
;; Initialize the CRTC
|
||||||
LDA #$70
|
JSR CLRVID
|
||||||
STA CADDR_H
|
|
||||||
LDA #$00 ; Set cursor start to $7000
|
|
||||||
STA CADDR_L
|
|
||||||
STA C_ROW
|
|
||||||
STA C_COL
|
|
||||||
JSR SET_CURSOR
|
|
||||||
;; TODO: Initialize params on CRTC
|
;; TODO: Initialize params on CRTC
|
||||||
|
|
||||||
; Initialize the ACIA
|
; Initialize the ACIA
|
||||||
|
@ -115,7 +109,6 @@ ACIAout:
|
||||||
;;; 3. Store new cursor position in CRTC.
|
;;; 3. Store new cursor position in CRTC.
|
||||||
|
|
||||||
CRTCout:
|
CRTCout:
|
||||||
STA COUTC ; Store the character going out
|
|
||||||
JSR ACIAout ; Also echo to terminal for debugging.
|
JSR ACIAout ; Also echo to terminal for debugging.
|
||||||
|
|
||||||
;; In parallel, we're maintaining two states:
|
;; In parallel, we're maintaining two states:
|
||||||
|
@ -135,14 +128,29 @@ CRTCout:
|
||||||
;; Carriage Return
|
;; Carriage Return
|
||||||
CMP #$0d
|
CMP #$0d
|
||||||
BEQ DO_CR
|
BEQ DO_CR
|
||||||
;; Any other character
|
;; Any other character...
|
||||||
|
CMP #'a'
|
||||||
|
STA COUTC ; Store the character going out
|
||||||
JSR COUT1
|
JSR COUT1
|
||||||
JSR INC_CADDR
|
JSR INC_CADDR
|
||||||
INC C_COL
|
INC C_COL
|
||||||
JSR SET_CURSOR
|
JSR SET_CURSOR
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
DO_BS: RTS
|
;; Handle a back-space character.
|
||||||
|
DO_BS: LDA C_COL
|
||||||
|
BNE @l1 ; Skip next bit
|
||||||
|
LDA #$27
|
||||||
|
STA C_COL
|
||||||
|
BNE @l2
|
||||||
|
@l1: DEC C_COL
|
||||||
|
@l2: JSR DEC_CADDR ; Back up
|
||||||
|
JSR SET_CURSOR
|
||||||
|
|
||||||
|
@l3: LDA #$20
|
||||||
|
STA COUTC ; Echo a space ($20)
|
||||||
|
JSR COUT1
|
||||||
|
RTS
|
||||||
|
|
||||||
DO_LF: RTS ; Just swallow LF. CR emulates it.
|
DO_LF: RTS ; Just swallow LF. CR emulates it.
|
||||||
|
|
||||||
|
@ -175,7 +183,6 @@ DO_CR: SEC
|
||||||
JSR SET_CURSOR
|
JSR SET_CURSOR
|
||||||
;; Move the cursor
|
;; Move the cursor
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
|
||||||
SET_CURSOR:
|
SET_CURSOR:
|
||||||
LDA #14
|
LDA #14
|
||||||
|
@ -187,7 +194,41 @@ SET_CURSOR:
|
||||||
LDA CADDR_L
|
LDA CADDR_L
|
||||||
STA $9001
|
STA $9001
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
;; Clear the video window and put the cursor at the home
|
||||||
|
;; position
|
||||||
|
CLRVID:
|
||||||
|
LDA #$70
|
||||||
|
STA CADDR_H
|
||||||
|
LDA #$00 ; Set cursor start to $7000
|
||||||
|
STA CADDR_L
|
||||||
|
STA C_ROW
|
||||||
|
STA C_COL
|
||||||
|
JSR SET_CURSOR
|
||||||
|
;; Fill with space character
|
||||||
|
STY TMPY
|
||||||
|
LDA #$20 ; Space
|
||||||
|
LDY #$00
|
||||||
|
@l1: STA $7000,Y
|
||||||
|
INY
|
||||||
|
BNE @l1
|
||||||
|
@l2: STA $7100,Y
|
||||||
|
INY
|
||||||
|
BNE @l2
|
||||||
|
@l3: STA $7200,Y
|
||||||
|
INY
|
||||||
|
BNE @l3
|
||||||
|
@l4: STA $7300,Y
|
||||||
|
INY
|
||||||
|
BNE @l4
|
||||||
|
@l5: STA $7400,Y
|
||||||
|
INY
|
||||||
|
BNE @l5
|
||||||
|
|
||||||
|
LDY TMPY
|
||||||
|
|
||||||
|
RTS
|
||||||
|
|
||||||
;; Handle a scroll request
|
;; Handle a scroll request
|
||||||
DO_SCROLL:
|
DO_SCROLL:
|
||||||
;; Copy $7028 through $70FF to $7000 through $70D7
|
;; Copy $7028 through $70FF to $7000 through $70D7
|
||||||
|
@ -224,13 +265,13 @@ DO_SCROLL:
|
||||||
STA CADDR_H
|
STA CADDR_H
|
||||||
LDY TMPY ; Restore Y
|
LDY TMPY ; Restore Y
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
;; Decrement the cursor address
|
;; Decrement the cursor address
|
||||||
INC_CADDR:
|
INC_CADDR:
|
||||||
INC CADDR_L
|
INC CADDR_L
|
||||||
BNE @l1 ; Did we increment to 0?
|
BNE @l1 ; Did we increment to 0?
|
||||||
INC CADDR_H ; Yes, also increment high
|
INC CADDR_H ; Yes, also increment high
|
||||||
@l1 RTS
|
@l1 RTS
|
||||||
|
|
||||||
;; Increment the cursor address
|
;; Increment the cursor address
|
||||||
DEC_CADDR:
|
DEC_CADDR:
|
||||||
|
@ -240,14 +281,14 @@ DEC_CADDR:
|
||||||
@l1 DEC CADDR_L
|
@l1 DEC CADDR_L
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
COUT1:
|
COUT1:
|
||||||
STY TMPY
|
STY TMPY
|
||||||
LDY #$00
|
LDY #$00
|
||||||
LDA COUTC
|
LDA COUTC
|
||||||
STA (CADDR_L),Y
|
STA (CADDR_L),Y
|
||||||
LDY TMPY
|
LDY TMPY
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
;
|
;
|
||||||
; byte in from ACIA. This subroutine will also force
|
; byte in from ACIA. This subroutine will also force
|
||||||
; all lowercase letters to be uppercase.
|
; all lowercase letters to be uppercase.
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class VideoWindow extends JFrame implements DeviceChangeListener {
|
||||||
|
|
||||||
this.scheduler = Executors.newSingleThreadScheduledExecutor();
|
this.scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||||
this.crtc = crtc;
|
this.crtc = crtc;
|
||||||
this.charRom = loadCharRom("/cga8.rom");
|
this.charRom = loadCharRom("/ascii.rom");
|
||||||
this.scaleX = scaleX;
|
this.scaleX = scaleX;
|
||||||
this.scaleY = scaleY;
|
this.scaleY = scaleY;
|
||||||
this.shouldScale = (scaleX > 1 || scaleY > 1);
|
this.shouldScale = (scaleX > 1 || scaleY > 1);
|
||||||
|
|
BIN
src/main/resources/ascii.rom
Normal file
BIN
src/main/resources/ascii.rom
Normal file
Binary file not shown.
BIN
src/main/resources/mod.rom
Normal file
BIN
src/main/resources/mod.rom
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user