-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathremote.src
158 lines (144 loc) · 2.26 KB
/
remote.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
; remote - atariserver remote console
;
; Copyright (C) 2005 Matthias Reichl <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
CONSOLE LDA 560
PHA
LDA 561
PHA
LDA $301
PHA
JSR GR0
LDA #0
STA 82
STA 710
STA 702
BPUT 0, CTLEN, CTITLE
LOOPC PUT 0, '>
INPUT 0, BUFFER
BPL GOTCMD
CPY #128
BNE LOOPC
LDA #2
STA 82
JSR GR0
LDA #$40
STA 702
LDA #$31
STA $300
PLA
STA $301
PLA
STA 561
PLA
STA 560
RTS
GOTCMD JSR SETSIO
LDA ICBLL
BEQ LOOPC
SEC
SBC #1
STA $308
STA $30A
BEQ IMM
LDA #$80
STA $303
IMM JSR $E459
BPL CMDOK
CPY #144
BEQ CMDOK
ERROR TYA
LSR
LSR
LSR
LSR
TAX
LDA HEXTAB,X
STA ERRCOD
TYA
AND #$0F
TAX
LDA HEXTAB,X
STA ERRCOD+1
PRINT 0, ERRTXT
JMP LOOPC
CMDOK LDA #$53
STA $302
LDA #4
STA $308
LDA #$40
STA $303
JSR $E459
BMI ERROR
LDA BUFFER+2
STA RESLEN
LDA BUFFER+3
STA RESLEN+1
ORA RESLEN
BNE RES1
JMP LOOPC
RES1 LDA #$52
STA $302
LDA #0
STA $30A
STA $30B
RESLP LDA RESLEN
ORA RESLEN+1
BEQ ENDRES
LDA #$80
STA $308
LDA #$40
STA $303
JSR $E459
BPL RES2
JMP ERROR
RES2 LDA RESLEN+1
BNE RES3
LDA RESLEN
BMI RES3
STA $308
RES3 BPUT2 0, $308, BUFFER
SEC
LDA RESLEN
SBC $308
STA RESLEN
BCS RES4
DEC RESLEN+1
RES4 INC $30A
BNE RESLP
INC $30B
BNE RESLP
ENDRES JSR SETSIO
JSR $E459
JMP LOOPC
SETSIO LDX #$0B
SETSIO1 LDA SIOTAB,X
STA $300,X
DEX
BPL SETSIO1
RTS
SIOTAB .BYTE $61, 1, $43, 0
.WORD BUFFER
.BYTE 20, 0
.WORD 0, 0
CTITLE .BYTE 125
.BYTE "atariserver remote console", 155
.BYTE "press <break> to exit", 155, 155
CTLEN = * - CTITLE
ERRTXT .BYTE 253, "ERROR $"
ERRCOD .BYTE "00", 155
HEXTAB .BYTE "0123456789ABCDEF"
RESLEN .WORD 0