Skip to content

Commit 27e32d0

Browse files
committed
Finish out SwiftLink support. Send File, Trasmit Buffer, Punter, XModem file transfers
now work.
1 parent 418b90f commit 27e32d0

File tree

3 files changed

+174
-25
lines changed

3 files changed

+174
-25
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Version 2016a
77
- Fixed 2400 baud support using code from "Toward 2400" article
88
in Transactor, Vol 9 Issue 3.
99
- Fixed XModem upload last character drop bug
10-
- Experimental SwiftLink support (DE00 only)
10+
- Add CMD SwiftLink support ($DE00)
1111

1212
Version 5.5+ (09/14/2016)
1313
------------------------

ccgmsterm.s

Lines changed: 148 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ historical = 0 ; define to 1 to make this source produce an exact image of
4545
toward24 = MODERN ; Enable "Toward 2400" new modem chrout/chkin/nmi routines by George Hug
4646
xmodfix = MODERN ; Enable XModem last char fix
4747
nohayes12 = MODERN ; Don't downgrade to 1200 baud to send commands on Hayes modems
48+
autocrlf = MODERN ; ASCII converts CR to CR/LF
4849

4950
v55plus = 1 ; Enable the bug fix and minor changes made in 5.5+
5051
hack24 = 0 ; Enable 2400 baud hack from alwyz (superceded by toward24 fix)
51-
swiftlib = 0;MODERN ; Experimental/unfinished
52+
swiftlib = MODERN ; Experimental/unfinished
5253

5354
.if historical
5455
.feature pc_assignment
@@ -275,7 +276,29 @@ pnt37 lda #$00
275276
sta $96
276277
rts
277278
nop
278-
pnt38 jmp pnt122
279+
pnt38
280+
.if swiftlib
281+
lda swiftout
282+
beq pnt38c
283+
tya
284+
pha
285+
jsr slGetByte
286+
bcs pnt38a
287+
ldy #0
288+
cpx #0
289+
bne pnt38b
290+
pnt38a
291+
lda #0
292+
ldy #2
293+
pnt38b
294+
sty $96
295+
sta pnt10
296+
pla
297+
tay
298+
rts
299+
pnt38c
300+
.endif
301+
jmp pnt122
279302
nop
280303
nop
281304
pnt39 cmp pnt13
@@ -1166,9 +1189,8 @@ mnback
11661189
jmp main2
11671190
mainop
11681191
.if swiftlib
1169-
ldx motype
1170-
cpx #mtswiftl
1171-
bne :+
1192+
ldx swiftout
1193+
beq :+
11721194
jsr slPutByte ; .A=byte -> .CS=err#.A
11731195
jmp :++
11741196
:
@@ -1223,9 +1245,8 @@ specc2
12231245
stx 53272
12241246
specc3
12251247
.if swiftlib
1226-
ldx motype
1227-
cpx #mtswiftl
1228-
beq :+
1248+
ldx swiftout
1249+
bne :+
12291250
.endif
12301251
ldx #modemln
12311252
jsr chkin
@@ -1698,15 +1719,22 @@ drcont
16981719
ldy #0
16991720
drcon2 jsr getin
17001721
jsr chrout
1722+
.if swiftlib
1723+
.else
17011724
lda #$fd
17021725
sta $a2
17031726
drcodl lda $a2
17041727
bne drcodl
1728+
.endif
17051729
iny
17061730
cpy #27
17071731
bcc drcon2
17081732
lda #$0d
17091733
jsr chrout
1734+
.if autocrlf
1735+
lda #$0a
1736+
jsr chrout
1737+
.endif
17101738
jsr clrchn
17111739
lda #$0d
17121740
jsr chrout
@@ -2629,7 +2657,28 @@ xmmget
26292657
lda #0
26302658
sta $a1
26312659
sta $a2
2660+
.if swiftlib
2661+
lda swiftout
2662+
bne xmogt0
2663+
.endif
26322664
jsr $f04f ;"chkin" modem
2665+
.if swiftlib
2666+
clc
2667+
bcc xmogt1
2668+
xmogt0
2669+
tya
2670+
pha
2671+
jsr slGetByte
2672+
bcs xmmgt2s
2673+
cpx #0
2674+
beq xmmgt2s
2675+
tax
2676+
pla
2677+
tay
2678+
txa
2679+
ldx #0
2680+
rts
2681+
.endif
26332682
xmogt1
26342683
jsr $f14e ;rs232 input
26352684
tax
@@ -2639,15 +2688,30 @@ xmogt1
26392688
txa
26402689
ldx #0
26412690
rts
2691+
.if swiftlib
2692+
xmmgt2s
2693+
pla
2694+
tay
2695+
.endif
26422696
xmmgt2
26432697
jsr xchkcm
26442698
lda $a1
26452699
cmp xmodel
2700+
.if swiftlib
2701+
bcc xmmgt3
2702+
.else
26462703
bcc xmogt1
2704+
.endif
26472705
jsr clrchn
26482706
and #0
26492707
ldx #1
26502708
rts
2709+
.if swiftlib
2710+
xmmgt3
2711+
lda swiftout
2712+
beq xmogt1
2713+
bne xmogt0
2714+
.endif
26512715
xincbd
26522716
lda #':'
26532717
jsr goobad
@@ -2702,8 +2766,8 @@ xmoex4
27022766
xmorcv
27032767
tsx
27042768
stx xmostk
2705-
jsr 61310
2706-
jsr 61310
2769+
jsr $ef7e
2770+
jsr $ef7e
27072771
jsr xmoset
27082772
beq xmorcp
27092773
xmorc0
@@ -3214,7 +3278,7 @@ dwwait
32143278
lda $a2
32153279
cmp #85
32163280
bcc dwwait
3217-
jsr 61310
3281+
jsr $ef7e
32183282
jsr p49173
32193283
jsr p49155
32203284
jmp xfrend
@@ -3271,7 +3335,7 @@ sndfil
32713335
tay
32723336
jsr setlfs
32733337
jsr open
3274-
ldx #$05
3338+
ldx #modemln
32753339
jsr chkout
32763340
lda #15
32773341
jsr chrout
@@ -3313,9 +3377,12 @@ dskmo
33133377
jsr chkin
33143378
jsr getin
33153379
timdel
3380+
.if swiftlib
3381+
.else
33163382
bit bufflg
33173383
bvc chstat
33183384
jsr tmsetl
3385+
.endif
33193386
chstat
33203387
pha
33213388
lda status
@@ -3333,12 +3400,18 @@ chstat
33333400
pla
33343401
jmp chkkey
33353402
dskmo1
3336-
ldx #05
3403+
ldx #modemln
33373404
jsr chkout
33383405
pla
33393406
ldx grasfl
33403407
beq dskmo2
33413408
jsr catosa
3409+
.if autocrlf
3410+
cmp #$0d
3411+
bne dskmo2
3412+
jsr chrout
3413+
lda #$0a
3414+
.endif
33423415
dskmo2
33433416
jsr chrout
33443417
chkkey
@@ -5992,6 +6065,10 @@ losve2 jsr getin
59926065
jmp clrchn
59936066
;
59946067
selmdm
6068+
.if swiftlib
6069+
lda #0
6070+
sta swiftout
6071+
.endif
59956072
lda motype
59966073
bne selmd2
59976074
md1650
@@ -6072,6 +6149,8 @@ paradm
60726149
jmp mnewsd
60736150
.if swiftlib
60746151
swiftlnk
6152+
lda #1
6153+
sta swiftout
60756154
lda #mtswiftl
60766155
sta motype
60776156
jmp mnewsd
@@ -6538,9 +6617,8 @@ f7chs1
65386617
lda #bps12
65396618
:
65406619
.if swiftlib
6541-
ldx motype
6542-
cpx #mtswiftl
6543-
bne :+
6620+
ldx swiftout
6621+
beq :+
65446622
cmp #bpsslmax
65456623
bcc :++
65466624
:
@@ -6687,9 +6765,8 @@ bdaddc .byt $81,$02,$d0,$e5,$60
66876765
parabd .byt '%s',0
66886766
baud
66896767
.if swiftlib
6690-
lda motype
6691-
cmp #mtswiftl
6692-
beq slset
6768+
lda swiftout
6769+
bne slset
66936770
jsr slShutdown
66946771
lda baudrt
66956772
cmp #bpsmax
@@ -6806,9 +6883,8 @@ baud4
68066883
baudfin
68076884
.if toward24
68086885
.if swiftlib
6809-
lda motype
6810-
cmp #mtswiftl
6811-
beq baudfin2
6886+
lda swiftout
6887+
bne baudfin2
68126888
.endif
68136889
jsr rssetup ; use George Hug's NMI/chkin/receive kernel patches
68146890
; but for some reason his chrout/bsout doesn't work for 2400
@@ -6853,15 +6929,22 @@ op2txt .byt '1650 compatibles '
68536929
.byt 'SwiftLink/Hayes '
68546930
.endif
68556931
op3txt .byt 'Punter','XModem'
6932+
.if swiftlib
6933+
swiftout .byt 0 ; 1 = output using swiftlink lib
6934+
.endif
68566935
mt1650 = 0
68576936
mthes = 1
68586937
mt1660 = 2
68596938
mt1660cd= 3
68606939
mtm1604 = 4
68616940
mt1670 = 5
68626941
mtparadm= 6
6942+
.if swiftlib
68636943
mtswiftl= 7
68646944
mtlast = 7
6945+
.else
6946+
mtlast = 6
6947+
.endif
68656948
prmtab
68666949
lda #$0d
68676950
jsr chrout
@@ -6954,8 +7037,28 @@ notogm lda #<ttntxt
69547037
ldy #>ttntxt
69557038
bne prtogm
69567039
;
7040+
.if swiftlib
7041+
nckout
7042+
cpx #5
7043+
bne :++
7044+
ldx swiftout
7045+
beq :+
7046+
ldx #2
7047+
stx $9a
7048+
rts
7049+
:
7050+
ldx #5
7051+
:
7052+
jmp $f250
7053+
.endif
69577054
prtvec .byt $ca,$f1
69587055
outvec ;change chrout vec.
7056+
.if swiftlib
7057+
lda #<nckout
7058+
sta $0320
7059+
lda #>nckout
7060+
sta $0321
7061+
.endif
69597062
lda $0326
69607063
cmp #<printv
69617064
bne outv1
@@ -6995,7 +7098,28 @@ outndl
69957098
outv3 bcc outv4
69967099
pla
69977100
jmp (prtvec)
6998-
outv4 lsr a
7101+
outv4
7102+
.if swiftlib
7103+
lda swiftout
7104+
beq :+
7105+
pla
7106+
sta $9e
7107+
txa
7108+
pha
7109+
tya
7110+
pha
7111+
lda $9e
7112+
jsr slPutByte
7113+
pla
7114+
tay
7115+
pla
7116+
tax
7117+
lda $9e
7118+
rts
7119+
:
7120+
lda $9a
7121+
.endif
7122+
lsr a
69997123
pla
70007124
sta $9e
70017125
txa
@@ -7083,6 +7207,7 @@ motype .byt $05 ; make Hayes default
70837207
;4=vip mpp 1064
70847208
;5=1670/hayes
70857209
;6=paradyne dtu
7210+
;7=swiftlink rs-232
70867211
;
70877212
.if toward24
70887213
.include "newmodem2400.s"

0 commit comments

Comments
 (0)