From 26ceb7aa5051054bb737a2a8a26fb5df36c8e3f9 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 23 Oct 2021 12:25:20 -0400 Subject: [PATCH] start of a CDA to control vt100 parameters. --- apple2gs.equ.S | 3 + vt100.cda.S | 191 +++++++++++++++++++++++++++++++++++++++++++++++++ vt100.link.S | 2 + vt100.main.S | 2 + 4 files changed, 198 insertions(+) create mode 100644 vt100.cda.S diff --git a/apple2gs.equ.S b/apple2gs.equ.S index cc986ce..8a4f31d 100644 --- a/apple2gs.equ.S +++ b/apple2gs.equ.S @@ -1,4 +1,7 @@ + +CLR80VID equ $c00c SET80VID equ $c00d +CLRALTCHAR equ $c00e SETALTCHAR equ $c00f TXTSET equ $c051 KEYMOD equ $c025 diff --git a/vt100.cda.S b/vt100.cda.S new file mode 100644 index 0000000..583c56e --- /dev/null +++ b/vt100.cda.S @@ -0,0 +1,191 @@ + + + lst off + rel + + xc + xc + cas se + tbx on ; qasm + + use apple2gs.equ + + +* alternate character set +* $00-$1f = upper inverse ( asci value - $40) +* $20-$3f = special inverse (ascii value) +* $40-$4f = mouse text +* $60-$7f = lower inverse (= ascii value) +* $80-$9f = upper [redundant] +* $a0-$bf = special (high ascii) +* $c0-$df = upper (high ascii) +* $e0-$ff = lower (high ascii) + + +* 40-column control panel +* TODO - if 80 column set in preferences, draw centered in 80-column mode + +init_cda ent + php + rep #$30 + psl #handle + _InstallCDA + plp + rts + +handle adrl Header ; can use a fake handle for now, until we need to _RemoveCDA +Header + str 'Virtual Terminal' + adrl start + adrl shutdown + +shutdown + mx %00 + rtl + +start + mx %00 + + phb + phd + + phk + plb + + sep #$30 + sta TXTSET + sta CLR80VID + sta SETALTCHAR + rep #$30 + + jsr clear + jsr box + + +:keyloop + lda KBD + bpl :keyloop + sta KEYSTROBE + + pld + plb + rtl + + +clear + ldx #23*2 + lda #" " +:loop + ldy text,x + +]offset equ 0 + lup 20 + sta |0+]offset,y +]offset equ ]offset+2 + --^ + + dex + dex + bpl :loop + rts + + +box + php + +* top line + lda #"_ " + sta $0400+38 + + lda #" _" + sta $0400 + + lda #"__" + ldx #34 + +]loop sta $0400+2,x + dex + dex + bpl ]loop + +* bottom line. +* 'L' = $4c = _ but high + lda #'L '!$8000 ; keep ' ' high ascii. + sta $07d0+38 + + lda #' L'!$0080 ; keep ' ' high ascii. + sta $07d0 + + lda #'LL' + ldx #34 + +]loop sta $07d0+2,x + dex + dex + bpl ]loop + + +* sides + sep #$20 + lda #'Z' + ldx #21*2 ; skip top/bottom lines. +]loop ldy text+2,x + sta |$0,y + dex + dex + bpl ]loop + + sep #$20 + lda #'_' + ldx #21*2 ; skip top/bottom lines. +]loop ldy text+2,x + sta |$0+39,y + dex + dex + bpl ]loop + + + plp + rts + +text + dw $0400 + dw $0480 + dw $0500 + dw $0580 + dw $0600 + dw $0680 + dw $0700 + dw $0780 + dw $0428 + dw $04a8 + dw $0528 + dw $05a8 + dw $0628 + dw $06a8 + dw $0728 + dw $07a8 + dw $0450 + dw $04d0 + dw $0550 + dw $05d0 + dw $0650 + dw $06d0 + dw $0750 + dw $07d0 + +*box +* asc " ______________________________________ " +* asc da," Terminal ",' ',df +* db $da +* ds 38,$cc +* db $df + + +* asc da," Select: ",c8,df,ca,cb," Cancel: Esc Save: ",cd,df +* asc " " +* ds 38,$cc +* asc " " + + + sav vt100.cda.L \ No newline at end of file diff --git a/vt100.link.S b/vt100.link.S index b96ce8e..1211750 100644 --- a/vt100.link.S +++ b/vt100.link.S @@ -15,6 +15,7 @@ asm vt100.modem.S asm vt100.key.S asm vt100.beep.S + asm vt100.cda.S * lnk boot.S @@ -34,6 +35,7 @@ lnk vt100.modem.L lnk vt100.key.L lnk vt100.beep.L + lnk vt100.cda.L typ $ff sav vt100.sys diff --git a/vt100.main.S b/vt100.main.S index 80164b2..fa185da 100644 --- a/vt100.main.S +++ b/vt100.main.S @@ -16,6 +16,7 @@ ext erase_screen ext init_tabs ext init_audio + ext init_cda main debug main @@ -98,6 +99,7 @@ init jsr init_modem jsr init_tabs jsr init_audio + jsr init_cda rts