diff options
author | 2012-11-07 15:30:50 +0000 | |
---|---|---|
committer | 2012-11-07 15:30:50 +0000 | |
commit | 4a85620161a27421ae74217890408d60c26059db (patch) | |
tree | d82d061f315cc450727c4c98822b1cf87d8e6151 /src/mess/machine/adamnet.h | |
parent | 491d28aba000e610603073cd42f2c73274e8337f (diff) |
(MESS) adam: Created an ADAMnet slot interface and separated the ADAMnet devices from the driver. [Curt Coder]
Diffstat (limited to 'src/mess/machine/adamnet.h')
-rw-r--r-- | src/mess/machine/adamnet.h | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/src/mess/machine/adamnet.h b/src/mess/machine/adamnet.h new file mode 100644 index 00000000000..e791ccbbc84 --- /dev/null +++ b/src/mess/machine/adamnet.h @@ -0,0 +1,139 @@ +/********************************************************************** + + Coleco ADAMnet bus emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __ADAMNET__ +#define __ADAMNET__ + +#include "emu.h" + + + +//************************************************************************** +// CONSTANTS +//************************************************************************** + +#define ADAMNET_TAG "adamnet" + + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_ADAMNET_BUS_ADD() \ + MCFG_DEVICE_ADD(ADAMNET_TAG, ADAMNET, 0) + +#define MCFG_ADAMNET_SLOT_ADD(_tag, _slot_intf, _def_slot, _def_inp) \ + MCFG_DEVICE_ADD(_tag, ADAMNET_SLOT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class device_adamnet_card_interface; + +// ======================> adamnet_device + +class adamnet_device : public device_t +{ +public: + // construction/destruction + adamnet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + void add_device(device_t *target); + + DECLARE_READ_LINE_MEMBER( rxd_r ); + int rxd_r(device_t *device); + DECLARE_WRITE_LINE_MEMBER( txd_w ); + void txd_w(device_t *device, int state); + + DECLARE_READ_LINE_MEMBER( reset_r ); + DECLARE_WRITE_LINE_MEMBER( reset_w ); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_stop(); + +private: + class daisy_entry + { + public: + daisy_entry(device_t *device); + daisy_entry *next() const { return m_next; } + + daisy_entry * m_next; // next device + device_t * m_device; // associated device + device_adamnet_card_interface * m_interface; // associated device's daisy interface + + int m_txd; + }; + + simple_list<daisy_entry> m_device_list; + + int m_txd; + int m_reset; +}; + + +// ======================> adamnet_slot_device + +class adamnet_slot_device : public device_t, + public device_slot_interface +{ +public: + // construction/destruction + adamnet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start(); + +protected: + // configuration + adamnet_device *m_bus; +}; + + +// ======================> device_adamnet_card_interface + +class device_adamnet_card_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_adamnet_card_interface(const machine_config &mconfig, device_t &device); + virtual ~device_adamnet_card_interface(); + + virtual void adamnet_reset_w(int state) = 0; + + adamnet_device *m_bus; +}; + + +// device type definitions +extern const device_type ADAMNET; +extern const device_type ADAMNET_SLOT; + + +// slot devices +#include "machine/adam_ddp.h" +#include "machine/adam_fdc.h" +#include "machine/adam_kb.h" +#include "machine/adam_prn.h" +#include "machine/adam_spi.h" + +SLOT_INTERFACE_EXTERN( adamnet_devices ); + + + +#endif |