-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathatarisio.src
99 lines (86 loc) · 1.76 KB
/
atarisio.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
; atarisio - helper for atarisio remote control
;
; Copyright (c) 2019 by 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.
;
SWAP_DRIVES
LDX #<PARAM_SWAP
LDY #>PARAM_SWAP
JSR CALL_SIO
BMI SWAP_FAILED
LDX #<PARAM_STATUS
LDY #>PARAM_STATUS
JSR CALL_SIO
BMI SWAP_FAILED
LDA STATUS_BUF
CMP #1
BNE SWAP_FAILED
LDX #<PARAM_NOP
LDY #>PARAM_NOP
JSR CALL_SIO
BPUT 0, TSWAPOKL, TSWAPOK
CLC
RTS
SWAP_FAILED
BPUT 0, TSWAPERRL, TSWAPERR
SEC
RTS
CALL_SIO
STX TMPVEC
STY TMPVEC+1
LDY #$0B
CALL_SIO_L1
LDA (TMPVEC),Y
STA $300,Y
DEY
BPL CALL_SIO_L1
JMP $E459
PARAM_SWAP
.BYTE 'a
.BYTE 1
.BYTE 'C
.BYTE $80
.WORD SWAP_CMD
.BYTE 7,0
.WORD SWAP_CMD_L
.WORD SWAP_CMD_L
SWAP_CMD
.BYTE "xc 1 2"
SWAP_CMD_L = * - SWAP_CMD
PARAM_STATUS
.BYTE 'a
.BYTE 1
.BYTE 'S
.BYTE $40
.WORD STATUS_BUF
.BYTE 7,0
.WORD 4
.WORD 0
STATUS_BUF
.DC 4 0
PARAM_NOP
.BYTE 'a
.BYTE 1
.BYTE 'C
.BYTE $00
.WORD STATUS_BUF
.BYTE 7,0
.WORD 0
.WORD 0
TSWAPOK .BYTE "swapped AtariSIO drives D1: and D2:",155
TSWAPOKL = * - TSWAPOK
TSWAPERR .BYTE "AtariSIO remote control failed",155
TSWAPERRL = * - TSWAPERR