26
26
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
27
; POSSIBILITY OF SUCH DAMAGE.
28
28
29
- os_num = 0
30
-
31
- macro ports? v , lock , unlock
32
- match major.mid.minor.build , v
33
- db major , mid , minor
34
- dl build
35
- end match
36
- dl lock
37
- dl unlock
38
- os_num = os_num + 1
39
- end macro
40
-
41
- os_table:
42
- ports 5 . 6 . 1 . 0012 , port_os560. lock , port_os561.unlock
43
- ports 5 . 6 . 0 . 0020 , port_os560. lock , port_os560.unlock
44
- ports 5 . 5 . 5 . 0011 , port_os560. lock , port_os555.unlock
45
- ports 5 . 5 . 2 . 0044 , port_os560. lock , port_os552.unlock
46
- ports 5 . 5 . 1 . 0038 , port_os560. lock , port_os551.unlock
47
-
48
29
port_setup:
49
30
di
50
- call $ 21ED4
31
+ ld b , 1
32
+ or a , a
33
+ sbc hl , hl
34
+ .find:
35
+ ld a , (hl)
36
+ inc hl
37
+ cp a , $ 80
38
+ jq z , .found_80
39
+ cp a , $ ed
40
+ jq nz , .find
41
+ ld a , (hl)
42
+ sub a , $ 41
43
+ jq z , .found_ed41
44
+ cp a , $ 73
45
+ jq nz , .find
46
+ dec b
47
+ dec hl
48
+ ld (port_new.target) , hl
49
+ inc hl
50
+ jq .find
51
+ .found_80:
52
+ ld a , (hl)
53
+ cp a , $ 0f
54
+ jq nz , .find
55
+ and a , b
56
+ ret nz
57
+ ld hl , port_new.unlock
58
+ jq .store_smc
59
+ .found_ed41:
60
+ dec hl
61
+ ld (port_old.target) , hl
62
+ inc hl
51
63
push hl
52
64
pop ix
53
- lea de , ix + 6
54
- ld a , (de)
55
- cp a , 5
56
- jq nz , .invalid_os
57
- inc de
58
- ld a , (de)
59
- cp a , 5
60
- jq c , .ospre55
61
- dec de
62
- ld b , os_num
63
- ld ix , os_table
64
- .find:
65
- lea hl , ix
66
- push de , bc
67
- ld b , 6
68
- call ti.StrCmpre
69
- pop bc , de
70
- jq z , .found
71
- lea ix , ix + 12
72
- djnz .find
73
- .invalid_os:
74
- inc a
75
- ret
76
- .found:
77
- ld de , (ix + 6 )
78
- ld hl , (ix + 9 )
65
+ bit 0 , (ix + 4 )
66
+ jq nz , .find
67
+ ld hl , port_old.unlock
79
68
.store_smc:
80
69
ld (port_unlock.code) , hl
81
- ld (port_lock.code) , de
82
- xor a , a
83
70
ret
84
- .ospre55:
85
- ld hl , port_ospre55.unlock
86
- ld de , port_ospre55. lock
87
- jq .store_smc
88
71
89
- port_ospre55 :
72
+ port_old :
90
73
.unlock:
91
- ld bc , $ 24
74
+ call .unlockhelper
75
+ .unlockfinish:
92
76
ld a , $ 8c
93
- call .write
94
- ld bc , $ 06
95
- call .read
77
+ out0 ( $ 24 ) , a
78
+ in0 a , ( $ 06 )
96
79
or a , 4
97
- call .write
98
- ld bc , $ 28
99
- ld a , $ 4
100
- jq .write
101
- . lock :
102
- ld bc , $ 28
103
- xor a , a
104
- call .write
105
- ld bc , $ 06
106
- call .read
107
- res 2 , a
108
- call .write
109
- ld bc , $ 24
110
- ld a , $ 88
111
- jq .write
80
+ out0 ( $ 06 ) , a
81
+ ret
82
+ .unlockhelper:
83
+ call ti._frameset0
84
+ push de
85
+ ld bc , $ 0022
86
+ jp 0
87
+ .target := $ - 3
112
88
.write:
113
89
ld de , $ c979ed
114
90
ld hl , ti.heapBot - 3
@@ -120,59 +96,34 @@ port_ospre55:
120
96
ld (hl) , de
121
97
jp (hl)
122
98
123
- port_os555 :
99
+ port_new :
124
100
.unlock:
125
- ld ix , $ b96df
126
- jq port_os560.unlock0
127
-
128
- port_os552:
129
- .unlock:
130
- ld ix , $ bd573
131
- jq port_os560.unlock0
132
-
133
- port_os551:
134
- .unlock:
135
- ld ix , $ bd55f
136
- jq port_os560.unlock0
137
-
138
- port_os561:
139
- .unlock:
140
- ld ix , $ 4a5ac
141
- ld hl , port_os560.unlockhelper
142
- push hl
101
+ ld de , $ d19881
102
+ push de
103
+ or a , a
104
+ sbc hl , hl
143
105
push hl
144
- ld de , ti. flags
106
+ ld de , $ 03d1
145
107
push de
146
- ld bc , $ 22
147
- ld a , (ix)
148
- cp a , $ ed
149
- jr z , . 84
150
- . 83 :
151
- ld ixl , $ 8f
152
- . 84 :
153
- xor a , a
154
- jp (ix)
155
-
156
- port_os560:
157
- .unlock:
158
- ld ix , $ b99bb
159
- .unlock0:
160
- ld hl , .unlockhelper
161
108
push hl
162
- ld hl , $ d09466
109
+ call .unlockhelper
110
+ ld hl , 12
111
+ add hl , sp
112
+ ld sp , hl
113
+ jq port_old.unlockfinish
114
+ .unlockhelper:
115
+ push hl
116
+ ex ( sp ) , ix
117
+ add ix , sp
163
118
push hl
164
119
push de
165
- xor a , a
166
- jp (ix)
167
- .unlockhelper:
168
- ld a , $ 8c
169
- out0 ( $ 24 ) , a
170
- in0 a , ( $ 06 )
171
- or a , $ 04
172
- out0 ( $ 06 ) , a
173
- ld a , $ 04
174
- out0 ( $ 28 ) , a
175
- ret
120
+ ld de , $ 887c00
121
+ push de
122
+ ld bc , $ 10de
123
+ ld de , $ 0f22
124
+ add hl , sp
125
+ jp 0
126
+ .target := $ - 3
176
127
. lock :
177
128
xor a , a
178
129
out0 ( $ 28 ) , a
@@ -187,12 +138,12 @@ port_os560:
187
138
188
139
port_read:
189
140
push de , bc , hl
190
- call port_ospre55 .read
141
+ call port_old .read
191
142
jq port_lock. pop
192
143
193
144
port_write:
194
145
push de , bc , hl
195
- call port_ospre55 .write
146
+ call port_old .write
196
147
jq port_lock. pop
197
148
198
149
port_unlock:
@@ -203,8 +154,7 @@ port_unlock:
203
154
204
155
port_lock:
205
156
push de , bc , hl
206
- call 0
207
- .code := $ - 3
157
+ call port_new. lock
208
158
. pop :
209
159
pop hl , bc , de
210
160
ret
0 commit comments