diff options
Diffstat (limited to 'src/emu/bus/coco/coco_dwsock.h')
-rw-r--r-- | src/emu/bus/coco/coco_dwsock.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/emu/bus/coco/coco_dwsock.h b/src/emu/bus/coco/coco_dwsock.h new file mode 100644 index 00000000000..9abbc240244 --- /dev/null +++ b/src/emu/bus/coco/coco_dwsock.h @@ -0,0 +1,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_ */ + |