mirror of
https://github.com/ksherlock/itty-bitty-vtty.git
synced 2024-06-14 06:29:29 +00:00
add command-L to toggle local/online
add command-Q to quit. Since ROM 1 doesn't have _RemoveCDA in ROM, the control panel is only installed in ROM 3. (TODO -- check at runtime in case launched from GS/OS)
This commit is contained in:
parent
90e807ba46
commit
a687a08b0b
1
vt.equ.S
1
vt.equ.S
|
@ -93,7 +93,6 @@ read_q_tail ds 2
|
|||
write_q_head ds 2
|
||||
write_q_tail ds 2
|
||||
|
||||
master_id ds 2
|
||||
|
||||
do *>256
|
||||
err "too big"
|
||||
|
|
35
vt100.cda.S
35
vt100.cda.S
|
@ -34,10 +34,19 @@ ptr ds 2
|
|||
dend
|
||||
|
||||
|
||||
init_cda ent
|
||||
*
|
||||
* rom 0/1 doesn't include _RemoveCDA in ROM so it can't be removed.
|
||||
* additionally, _InstallCDA has bugs.
|
||||
* so, for now, disable on ROM 1.
|
||||
|
||||
cda_startup ent
|
||||
php
|
||||
rep #$30
|
||||
|
||||
jsr $fe1f ; idroutine. y = rom
|
||||
cpy #3
|
||||
bcc :nope
|
||||
|
||||
*
|
||||
* rom 1 IIgs InstallCDA clobbers $3c-$43 on the direct page
|
||||
*
|
||||
|
@ -51,9 +60,31 @@ init_cda ent
|
|||
|
||||
pld
|
||||
|
||||
:nope
|
||||
plp
|
||||
rts
|
||||
|
||||
cda_shutdown ent
|
||||
mx %00
|
||||
|
||||
jsr $fe1f ; idroutine. y = rom
|
||||
cpy #3
|
||||
bcc :nope
|
||||
|
||||
phd
|
||||
pea #0
|
||||
pld
|
||||
|
||||
|
||||
psl #handle
|
||||
_RemoveCDA
|
||||
|
||||
pld
|
||||
|
||||
:nope
|
||||
rts
|
||||
|
||||
|
||||
handle adrl Header ; can use a fake handle for now, until we need to _RemoveCDA
|
||||
Header
|
||||
str 'Virtual Terminal'
|
||||
|
@ -101,9 +132,11 @@ main
|
|||
|
||||
|
||||
:keyloop
|
||||
sep #$30
|
||||
lda KBD
|
||||
bpl :keyloop
|
||||
sta KEYSTROBE
|
||||
rep #$30
|
||||
|
||||
and #$7f
|
||||
|
||||
|
|
62
vt100.key.S
62
vt100.key.S
|
@ -4,6 +4,8 @@
|
|||
xc
|
||||
xc
|
||||
|
||||
tbx on
|
||||
|
||||
use vt.equ
|
||||
use apple2gs.equ
|
||||
use debug
|
||||
|
@ -74,7 +76,7 @@ keypress ent
|
|||
bne command
|
||||
|
||||
bit #kmKeypad
|
||||
bne keypad
|
||||
jne keypad
|
||||
bit #kmControl
|
||||
bne :ctrl
|
||||
|
||||
|
@ -112,11 +114,15 @@ command ; or option
|
|||
beq :bs
|
||||
cmp #$0d
|
||||
beq :lf
|
||||
cmp #'l'
|
||||
beq :local
|
||||
cmp #'L'
|
||||
beq :local
|
||||
|
||||
cmp #'a'
|
||||
bcc :0
|
||||
cmp #'z'+1
|
||||
bcs :0
|
||||
|
||||
and #$df ; ~ $20
|
||||
|
||||
:0
|
||||
cmp #:MIN
|
||||
blt :rts
|
||||
cmp #:MAX+1
|
||||
|
@ -147,16 +153,58 @@ command ; or option
|
|||
stz LOCAL
|
||||
jmp enable_modem
|
||||
|
||||
:quit
|
||||
ext quit
|
||||
jmp quit
|
||||
rts
|
||||
|
||||
:reset
|
||||
* TODO
|
||||
rts
|
||||
|
||||
:clear
|
||||
* TODO
|
||||
rts
|
||||
|
||||
|
||||
:MIN equ 49
|
||||
:MAX equ 52
|
||||
|
||||
:MAX equ 82
|
||||
|
||||
:table
|
||||
dw pf1 ; 1
|
||||
dw pf2 ; 2
|
||||
dw pf3 ; 3
|
||||
dw pf4 ; 4
|
||||
dw :rts ; 5
|
||||
dw :rts ; 6
|
||||
dw :rts ; 7
|
||||
dw :rts ; 8
|
||||
dw :rts ; 9
|
||||
dw :rts ; :
|
||||
dw :rts ; ;
|
||||
dw :rts ; <
|
||||
dw :rts ; =
|
||||
dw :rts ; >
|
||||
dw :rts ; ?
|
||||
dw :rts ; @
|
||||
dw :rts ; A
|
||||
dw :rts ; B
|
||||
dw :rts ; C
|
||||
dw :rts ; D
|
||||
dw :rts ; E
|
||||
dw :rts ; F
|
||||
dw :rts ; G
|
||||
dw :rts ; H
|
||||
dw :rts ; I
|
||||
dw :rts ; J
|
||||
dw :clear ; K
|
||||
dw :local ; L
|
||||
dw :rts ; M
|
||||
dw :rts ; N
|
||||
dw :rts ; O
|
||||
dw :rts ; P
|
||||
dw :quit ; Q
|
||||
dw :reset ; R
|
||||
|
||||
|
||||
|
||||
|
|
65
vt100.main.S
65
vt100.main.S
|
@ -13,13 +13,14 @@
|
|||
|
||||
ext scroll_down
|
||||
ext recalc_cursor,recalc_cursor_x,recalc_cursor_y
|
||||
ext modem_io,init_modem,modem_vector,reset_modem_buffer
|
||||
ext modem_io,modem_vector,reset_modem_buffer
|
||||
ext modem_startup,modem_shutdown
|
||||
ext keypress
|
||||
ext disable_cursor,enable_cursor,cursor_vector
|
||||
ext erase_screen,fill_screen
|
||||
ext init_tabs
|
||||
ext init_audio
|
||||
ext init_cda
|
||||
ext cda_startup,cda_shutdown
|
||||
|
||||
main debug main
|
||||
|
||||
|
@ -119,12 +120,14 @@ init
|
|||
sta state
|
||||
|
||||
* jsr erase_screen
|
||||
jsr init_modem
|
||||
jsr modem_startup
|
||||
jsr init_tabs
|
||||
jsr init_audio
|
||||
jsr init_cda
|
||||
jsr cda_startup
|
||||
rts
|
||||
|
||||
|
||||
MasterID dw 0
|
||||
init_mem
|
||||
*
|
||||
* see prodos technote #27
|
||||
|
@ -135,7 +138,7 @@ init_mem
|
|||
|
||||
mx %00
|
||||
|
||||
stz master_id
|
||||
stz MasterID
|
||||
_TLStartUp
|
||||
pha
|
||||
_MMStartUp
|
||||
|
@ -148,14 +151,15 @@ init_mem
|
|||
pea #$1000
|
||||
_GetNewID
|
||||
pla
|
||||
sta master_id
|
||||
sta MasterID
|
||||
|
||||
* bank 0
|
||||
pha
|
||||
pha
|
||||
pea #$0000
|
||||
pea #$b800
|
||||
pei master_id
|
||||
lda MasterID
|
||||
pha
|
||||
pea #$c013
|
||||
pea #0000
|
||||
pea #0800
|
||||
|
@ -168,7 +172,8 @@ init_mem
|
|||
pha
|
||||
pea #$0000
|
||||
pea #$b800
|
||||
pei master_id
|
||||
lda MasterID
|
||||
pha
|
||||
pea #$c013
|
||||
pea #$0001
|
||||
pea #$0800
|
||||
|
@ -243,6 +248,50 @@ reset ent
|
|||
rts
|
||||
|
||||
|
||||
quit ent
|
||||
|
||||
* need to disable modem interrupts
|
||||
|
||||
|
||||
sep #$30
|
||||
lda #4
|
||||
trb VGCINT ; disable 1-sec interrupt.
|
||||
stz SCANINT ; reset 1-sec interrupt
|
||||
|
||||
jsr modem_shutdown
|
||||
|
||||
rep #$30
|
||||
|
||||
jsr cda_shutdown
|
||||
|
||||
lda MasterID
|
||||
beq :e
|
||||
|
||||
pha
|
||||
pha
|
||||
_DisposeAll
|
||||
_DeleteID
|
||||
|
||||
:e
|
||||
pea #0
|
||||
pld
|
||||
|
||||
sec
|
||||
xce
|
||||
mx %00
|
||||
inc $3f4 ; invalidate power-up bit
|
||||
jsr $bf00
|
||||
db $65
|
||||
dw :parms
|
||||
brk $ea
|
||||
|
||||
:parms db 4
|
||||
db 0
|
||||
dw 0
|
||||
db 0
|
||||
dw 0
|
||||
|
||||
|
||||
*dispatch ent
|
||||
* mx %11
|
||||
** a = character to xmit
|
||||
|
|
|
@ -30,7 +30,7 @@ SerFlag equ $e10104 ;
|
|||
*
|
||||
* see IIgs TN #18 - Do-It-Yourself SCC Access
|
||||
|
||||
init_modem ent
|
||||
modem_startup ent
|
||||
enable_modem ent
|
||||
* sep #$30
|
||||
|
||||
|
@ -112,6 +112,27 @@ disable_modem ent
|
|||
rts
|
||||
|
||||
|
||||
modem_shutdown ent
|
||||
|
||||
mx %11
|
||||
php
|
||||
sei
|
||||
|
||||
lda SCCBREG ; sync access
|
||||
lda #9
|
||||
sta SCCBREG
|
||||
lda #%01_0_1_0_0_0_1 ; reset channel B.
|
||||
sta SCCBREG
|
||||
|
||||
|
||||
lda >SerFlag
|
||||
and #%11_111_000 ; channel B interrupts.
|
||||
sta >SerFlag
|
||||
|
||||
plp
|
||||
rts
|
||||
|
||||
|
||||
write_modem_sync ent
|
||||
mx %11
|
||||
* a: byte to send
|
||||
|
|
Loading…
Reference in New Issue
Block a user