summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/bus/coco/coco_dwsock.h
blob: 9abbc24024419d5c7ea8e19382b3c09ae0226902 (plain) (blame)
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
#ifndef _DWSOCK_H_
#define _DWSOCK_H_

#include "emu.h"
#include "osdcore.h"

//**************************************************************************
//  MACROS / CONSTANTS
//**************************************************************************

#define DRIVEWIRE_PORT_TAG          "drivewire_port"

//**************************************************************************
//  INTERFACE CONFIGURATION MACROS
//**************************************************************************

//**************************************************************************
//  TYPE DEFINITIONS
//**************************************************************************

// ======================> beckerport_device

class beckerport_device : public device_t
{
public:
    beckerport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
    virtual ~beckerport_device();

    // optional information overrides
    virtual ioport_constructor device_input_ports() const;

    virtual void device_start(void);
    virtual void device_stop(void);
    virtual void device_config_complete(void);

    void    update_port(void);

    // driver update handlers
    DECLARE_INPUT_CHANGED_MEMBER(drivewire_port_changed);

    virtual DECLARE_READ8_MEMBER(read);
    virtual DECLARE_WRITE8_MEMBER(write);

    // types
    enum dwsock_ports {
	    DWS_STATUS,
	    DWS_DATA
    };

private:
    /* IP hostname */
    const char *            m_hostname;

	/* IP port */
	required_ioport         m_dwconfigport;
	int                     m_dwtcpport;

	osd_file *m_pSocket;

	unsigned int m_rx_pending;
	unsigned int m_head;
	char m_buf[0x80];
};

// device type definition
extern const device_type COCO_DWSOCK;

// device iterator
typedef device_type_iterator<&device_creator<beckerport_device>, beckerport_device> beckerport_device_iterator;

#endif /* _DWSOCK_H_ */