1 |
|
/* |
2 |
|
* serial.cpp - Serial device driver |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2001 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
70 |
|
the_port->cum_errors = 0; |
71 |
|
|
72 |
|
// Open port |
73 |
< |
int16 res = the_port->Open(ReadMacInt16(0x1fc + (port & 2))); |
73 |
> |
int16 res = the_port->open(ReadMacInt16(0x1fc + (port & 2))); |
74 |
|
if (res) |
75 |
|
return res; |
76 |
|
|
79 |
|
r.d[0] = SIZEOF_serdt * 2; |
80 |
|
Execute68kTrap(0xa71e, &r); // NewPtrSysClear() |
81 |
|
if (r.a[0] == 0) { |
82 |
< |
the_port->Close(); |
82 |
> |
the_port->close(); |
83 |
|
return openErr; |
84 |
|
} |
85 |
|
uint32 input_dt = the_port->input_dt = r.a[0]; |
128 |
|
printf("FATAL: SerialPrimeIn() called while request is pending\n"); |
129 |
|
return readErr; |
130 |
|
} else |
131 |
< |
return the_port->PrimeIn(pb, dce); |
131 |
> |
return the_port->prime_in(pb, dce); |
132 |
|
} else { |
133 |
|
if (the_port->write_pending) { |
134 |
|
printf("FATAL: SerialPrimeOut() called while request is pending\n"); |
135 |
|
return readErr; |
136 |
|
} else |
137 |
< |
return the_port->PrimeOut(pb, dce); |
137 |
> |
return the_port->prime_out(pb, dce); |
138 |
|
} |
139 |
|
} |
140 |
|
|
158 |
|
return noErr; |
159 |
|
|
160 |
|
default: |
161 |
< |
return the_port->Control(pb, dce, code); |
161 |
> |
return the_port->control(pb, dce, code); |
162 |
|
} |
163 |
|
} |
164 |
|
|
189 |
|
return noErr; |
190 |
|
|
191 |
|
default: |
192 |
< |
return the_port->Status(pb, dce, code); |
192 |
> |
return the_port->status(pb, dce, code); |
193 |
|
} |
194 |
|
} |
195 |
|
|
212 |
|
// Close port if open |
213 |
|
SERDPort *the_port = the_serd_port[port >> 1]; |
214 |
|
if (the_port->is_open) { |
215 |
< |
int16 res = the_port->Close(); |
215 |
> |
int16 res = the_port->close(); |
216 |
|
M68kRegisters r; // Free Deferred Task structures |
217 |
|
r.a[0] = the_port->input_dt; |
218 |
|
Execute68kTrap(0xa01f, &r); // DisposePtr() |
232 |
|
{ |
233 |
|
if (p->is_open) { |
234 |
|
if (p->read_pending && p->read_done) { |
235 |
< |
Enqueue(p->input_dt, 0xd92); |
235 |
> |
EnqueueMac(p->input_dt, 0xd92); |
236 |
|
p->read_pending = p->read_done = false; |
237 |
|
} |
238 |
|
if (p->write_pending && p->write_done) { |
239 |
< |
Enqueue(p->output_dt, 0xd92); |
239 |
> |
EnqueueMac(p->output_dt, 0xd92); |
240 |
|
p->write_pending = p->write_done = false; |
241 |
|
} |
242 |
|
} |