1 |
|
/* |
2 |
|
* serial_amiga.cpp - Serial device driver, AmigaOS specific stuff |
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 |
26 |
|
#include <dos/dostags.h> |
27 |
|
#include <devices/serial.h> |
28 |
|
#include <devices/parallel.h> |
29 |
+ |
#define __USE_SYSBASE |
30 |
|
#include <proto/exec.h> |
31 |
|
#include <proto/dos.h> |
32 |
+ |
#include <inline/exec.h> |
33 |
+ |
#include <inline/dos.h> |
34 |
|
|
35 |
|
#include "sysdeps.h" |
36 |
|
#include "cpu_emulation.h" |
88 |
|
{ |
89 |
|
} |
90 |
|
|
91 |
< |
virtual int16 Open(uint16 config); |
92 |
< |
virtual int16 PrimeIn(uint32 pb, uint32 dce); |
93 |
< |
virtual int16 PrimeOut(uint32 pb, uint32 dce); |
94 |
< |
virtual int16 Control(uint32 pb, uint32 dce, uint16 code); |
95 |
< |
virtual int16 Status(uint32 pb, uint32 dce, uint16 code); |
96 |
< |
virtual int16 Close(void); |
91 |
> |
virtual int16 open(uint16 config); |
92 |
> |
virtual int16 prime_in(uint32 pb, uint32 dce); |
93 |
> |
virtual int16 prime_out(uint32 pb, uint32 dce); |
94 |
> |
virtual int16 control(uint32 pb, uint32 dce, uint16 code); |
95 |
> |
virtual int16 status(uint32 pb, uint32 dce, uint16 code); |
96 |
> |
virtual int16 close(void); |
97 |
|
|
98 |
|
private: |
99 |
|
bool configure(uint16 config); |
150 |
|
* Open serial port |
151 |
|
*/ |
152 |
|
|
153 |
< |
int16 ASERDPort::Open(uint16 config) |
153 |
> |
int16 ASERDPort::open(uint16 config) |
154 |
|
{ |
155 |
|
// Don't open NULL name devices |
156 |
|
if (device_name == NULL) |
169 |
|
proc_arg = this; |
170 |
|
SetSignal(0, SIGF_SINGLE); |
171 |
|
serial_proc = CreateNewProcTags( |
172 |
< |
NP_Entry, serial_func, |
173 |
< |
NP_Name, "Basilisk II Serial Task", |
172 |
> |
NP_Entry, (ULONG)serial_func, |
173 |
> |
NP_Name, (ULONG)"Basilisk II Serial Task", |
174 |
|
NP_Priority, 1, |
175 |
|
TAG_END |
176 |
|
); |
202 |
|
* Read data from port |
203 |
|
*/ |
204 |
|
|
205 |
< |
int16 ASERDPort::PrimeIn(uint32 pb, uint32 dce) |
205 |
> |
int16 ASERDPort::prime_in(uint32 pb, uint32 dce) |
206 |
|
{ |
207 |
|
// Send input command to serial process |
208 |
|
D(bug("primein\n")); |
218 |
|
* Write data to port |
219 |
|
*/ |
220 |
|
|
221 |
< |
int16 ASERDPort::PrimeOut(uint32 pb, uint32 dce) |
221 |
> |
int16 ASERDPort::prime_out(uint32 pb, uint32 dce) |
222 |
|
{ |
223 |
|
// Send output command to serial process |
224 |
|
D(bug("primeout\n")); |
234 |
|
* Control calls |
235 |
|
*/ |
236 |
|
|
237 |
< |
int16 ASERDPort::Control(uint32 pb, uint32 dce, uint16 code) |
237 |
> |
int16 ASERDPort::control(uint32 pb, uint32 dce, uint16 code) |
238 |
|
{ |
239 |
|
D(bug("control(%ld)\n", (uint32)code)); |
240 |
|
switch (code) { |
329 |
|
* Status calls |
330 |
|
*/ |
331 |
|
|
332 |
< |
int16 ASERDPort::Status(uint32 pb, uint32 dce, uint16 code) |
332 |
> |
int16 ASERDPort::status(uint32 pb, uint32 dce, uint16 code) |
333 |
|
{ |
334 |
|
D(bug("status(%ld)\n", (uint32)code)); |
335 |
|
switch (code) { |
384 |
|
* Close serial port |
385 |
|
*/ |
386 |
|
|
387 |
< |
int16 ASERDPort::Close() |
387 |
> |
int16 ASERDPort::close() |
388 |
|
{ |
389 |
|
// Stop process |
390 |
|
if (serial_proc) { |
672 |
|
((IOExtPar *)read_io)->io_ParFlags = PARF_SHARED; |
673 |
|
else |
674 |
|
read_io->io_SerFlags = SERF_SHARED | SERF_7WIRE; |
675 |
< |
if (OpenDevice((UBYTE *)dev_name, dev_unit, (struct IORequest *)read_io, 0) || read_io->IOSer.io_Device == NULL) |
675 |
> |
if (OpenDevice((UBYTE *) dev_name, dev_unit, (struct IORequest *)read_io, 0) || read_io->IOSer.io_Device == NULL) |
676 |
|
goto quit; |
677 |
|
opened = true; |
678 |
|
|