diff options
author | 2012-08-21 10:41:19 +0000 | |
---|---|---|
committer | 2012-08-21 10:41:19 +0000 | |
commit | 7285b359d259b2ae0fdf85096571c386ec8c991a (patch) | |
tree | a027aff57f1a255f9ec6cfd3b68cabe4b6683998 /src/mess/machine/tandy2kb.h | |
parent | 67c425e90757876a6716b7867df30c0149912e74 (diff) |
Merge of MESS sources (no whatsnew)
Diffstat (limited to 'src/mess/machine/tandy2kb.h')
-rw-r--r-- | src/mess/machine/tandy2kb.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/src/mess/machine/tandy2kb.h b/src/mess/machine/tandy2kb.h new file mode 100644 index 00000000000..1988f0ccc81 --- /dev/null +++ b/src/mess/machine/tandy2kb.h @@ -0,0 +1,104 @@ +/********************************************************************** + + Tandy 2000 keyboard emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +*********************************************************************/ + +#pragma once + +#ifndef __TANDY2K_KEYBOARD__ +#define __TANDY2K_KEYBOARD__ + + +#include "emu.h" +#include "cpu/mcs48/mcs48.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define TANDY2K_KEYBOARD_TAG "tandy2kb" + + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_TANDY2K_KEYBOARD_ADD(_config) \ + MCFG_DEVICE_ADD(TANDY2K_KEYBOARD_TAG, TANDY2K_KEYBOARD, 0) \ + MCFG_DEVICE_CONFIG(_config) + + +#define TANDY2K_KEYBOARD_INTERFACE(_name) \ + const tandy2k_keyboard_interface (_name) = + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> tandy2k_keyboard_interface + +struct tandy2k_keyboard_interface +{ + devcb_write_line m_out_clock_cb; + devcb_write_line m_out_data_cb; +}; + + +// ======================> tandy2k_keyboard_device + +class tandy2k_keyboard_device : public device_t, + public tandy2k_keyboard_interface +{ +public: + // construction/destruction + tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual const rom_entry *device_rom_region() const; + virtual machine_config_constructor device_mconfig_additions() const; + virtual ioport_constructor device_input_ports() const; + + DECLARE_WRITE_LINE_MEMBER( power_w ); + DECLARE_WRITE_LINE_MEMBER( reset_w ); + DECLARE_WRITE_LINE_MEMBER( busy_w ); + DECLARE_READ_LINE_MEMBER( data_r ); + + // not really public + DECLARE_READ8_MEMBER( kb_p1_r ); + DECLARE_WRITE8_MEMBER( kb_p1_w ); + DECLARE_WRITE8_MEMBER( kb_p2_w ); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + virtual void device_config_complete() { m_shortname = "tandy2kb"; } + +private: + devcb_resolved_write_line m_out_clock_func; + devcb_resolved_write_line m_out_data_func; + + required_device<cpu_device> m_maincpu; + + UINT16 m_keylatch; + + int m_clock; + int m_data; +}; + + +// device type definition +extern const device_type TANDY2K_KEYBOARD; + + + +#endif |