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
/*
* UAE - The Un*x Amiga Emulator
*
* Not a parser, but parallel and serial emulation for Linux
*
* Copyright 2010 Mustafa TUFAN
*/
#include "sysconfig.h"
#undef SERIAL_ENET
#include "sysdeps.h"
#include "options.h"
#include "gensound.h"
#include "events.h"
#include "uae.h"
#include "include/memory.h"
#include "custom.h"
#include "autoconf.h"
#include "newcpu.h"
#include "traps.h"
#include "threaddep/thread.h"
#include "serial.h"
#include "savestate.h"
#include "xwin.h"
#include "drawing.h"
#define MIN_PRTBYTES 10
struct uaeserialdata
{
long hCom;
long evtr, evtw, evtt, evtwce;
long olr, olw, olwce;
int writeactive;
void *readdata, *writedata;
volatile int threadactive;
uae_sem_t change_sem, sync_sem;
void *user;
};
int uaeser_getdatalength (void)
{
return sizeof (struct uaeserialdata);
}
void uaeser_initdata (void *vsd, void *user)
{
}
int uaeser_query (void *vsd, uae_u16 *status, uae_u32 *pending)
{
return 0;
}
int uaeser_break (void *vsd, int brklen)
{
return 0;
}
int uaeser_setparams (void *vsd, int baud, int rbuffer, int bits, int sbits, int rtscts, int parity, uae_u32 xonxoff)
{
return 0;
}
void uaeser_trigger (void *vsd)
{
}
int uaeser_write (void *vsd, uae_u8 *data, uae_u32 len)
{
return 0;
}
int uaeser_read (void *vsd, uae_u8 *data, uae_u32 len)
{
return 0;
}
void uaeser_clearbuffers (void *vsd)
{
}
int uaeser_open (void *vsd, void *user, int unit)
{
return 0;
}
void uaeser_close (void *vsd)
{
}
#define SERIAL_WRITE_BUFFER 100
#define SERIAL_READ_BUFFER 100
static uae_u8 outputbuffer[SERIAL_WRITE_BUFFER];
static uae_u8 outputbufferout[SERIAL_WRITE_BUFFER];
static uae_u8 inputbuffer[SERIAL_READ_BUFFER];
static int datainoutput;
static int dataininput, dataininputcnt;
static int writepending;