diff --git a/src/emu/cpu/mcs48/mcs48.h b/src/emu/cpu/mcs48/mcs48.h index 67a45704ded..52a32815bda 100644 --- a/src/emu/cpu/mcs48/mcs48.h +++ b/src/emu/cpu/mcs48/mcs48.h @@ -87,6 +87,9 @@ enum MACROS ***************************************************************************/ +#define MCS48_LC_CLOCK(_L, _C) \ + (1 / (2 * 3.14159265358979323846 * sqrt(_L * _C))) + #define MCS48_ALE_CLOCK(_clock) \ attotime::from_hz(_clock/(3*5)) diff --git a/src/emu/machine/rescap.h b/src/emu/machine/rescap.h index e751623ae6d..73b69a06746 100644 --- a/src/emu/machine/rescap.h +++ b/src/emu/machine/rescap.h @@ -8,6 +8,9 @@ #define CAP_U(cap) ((double)(cap) * 1e-6) #define CAP_N(cap) ((double)(cap) * 1e-9) #define CAP_P(cap) ((double)(cap) * 1e-12) +#define IND_U(ind) ((double)(ind) * 1e-6) +#define IND_N(ind) ((double)(ind) * 1e-9) +#define IND_P(ind) ((double)(ind) * 1e-12) /* vin --/\r1/\-- out --/\r2/\-- gnd */ #define RES_VOLTAGE_DIVIDER(r1, r2) ((double)(r2) / ((double)(r1) + (double)(r2))) diff --git a/src/mess/machine/kb_pcxt83.c b/src/mess/machine/kb_pcxt83.c index 674897eedc6..3a05a3ca25e 100644 --- a/src/mess/machine/kb_pcxt83.c +++ b/src/mess/machine/kb_pcxt83.c @@ -1,6 +1,6 @@ /********************************************************************** - IBM PC/XT 5150/5160 83-key keyboard emulation + IBM Model F PC/XT 5150/5160 83-key keyboard emulation Copyright MESS Team. Visit http://mamedev.org for licensing and usage restrictions. @@ -33,6 +33,8 @@ const device_type PC_KBD_IBM_PC_XT_83 = &device_creatorreset(); } //------------------------------------------------- -// clock_write - +// bus_w - //------------------------------------------------- -WRITE_LINE_MEMBER( ibm_pc_xt_83_keyboard_device::clock_write ) +WRITE8_MEMBER( ibm_pc_xt_83_keyboard_device::bus_w ) { + m_cnt = data; } //------------------------------------------------- -// data_write - +// p1_r - //------------------------------------------------- -WRITE_LINE_MEMBER( ibm_pc_xt_83_keyboard_device::data_write ) +READ8_MEMBER( ibm_pc_xt_83_keyboard_device::p1_r ) { + /* + + bit description + + 0 -REQ IN + 1 DATA IN + 2 + 3 + 4 + 5 + 6 + 7 + + */ + + UINT8 data = 0; + + data |= clock_signal(); + data |= data_signal() << 1; + + return data; +} + + +//------------------------------------------------- +// p2_w - +//------------------------------------------------- + +WRITE8_MEMBER( ibm_pc_xt_83_keyboard_device::p2_w ) +{ + /* + + bit description + + 0 -MATRIX STROBE + 1 CLOCK OUT + 2 DATA OUT + 3 + 4 + 5 + 6 + 7 + + */ + + m_pc_kbdc->clock_write_from_kb(BIT(data, 1)); + m_pc_kbdc->data_write_from_kb(BIT(data, 2)); +} + + +//------------------------------------------------- +// t1_r - +//------------------------------------------------- + +READ8_MEMBER( ibm_pc_xt_83_keyboard_device::t1_r ) +{ + return m_key_depressed; } diff --git a/src/mess/machine/kb_pcxt83.h b/src/mess/machine/kb_pcxt83.h index 042e1698685..7a9aa3bd579 100644 --- a/src/mess/machine/kb_pcxt83.h +++ b/src/mess/machine/kb_pcxt83.h @@ -1,6 +1,6 @@ /********************************************************************** - IBM PC/XT 5150/5160 83-key keyboard emulation + IBM Model F PC/XT 5150/5160 83-key keyboard emulation Copyright MESS Team. Visit http://mamedev.org for licensing and usage restrictions. @@ -15,6 +15,7 @@ #include "emu.h" #include "cpu/mcs48/mcs48.h" #include "machine/pc_kbdc.h" +#include "machine/rescap.h" @@ -36,17 +37,25 @@ public: virtual machine_config_constructor device_mconfig_additions() const; virtual ioport_constructor device_input_ports() const; + DECLARE_WRITE8_MEMBER( bus_w ); + DECLARE_READ8_MEMBER( p1_r ); + DECLARE_WRITE8_MEMBER( p2_w ); + DECLARE_READ8_MEMBER( t1_r ); + protected: // device-level overrides virtual void device_start(); virtual void device_reset(); // device_pc_kbd_interface overrides - virtual DECLARE_WRITE_LINE_MEMBER( clock_write ); - virtual DECLARE_WRITE_LINE_MEMBER( data_write ); + virtual DECLARE_WRITE_LINE_MEMBER( clock_write ) { }; + virtual DECLARE_WRITE_LINE_MEMBER( data_write ) { }; private: required_device m_maincpu; + + UINT8 m_cnt; + int m_key_depressed; }; diff --git a/src/mess/machine/pc_keyboards.h b/src/mess/machine/pc_keyboards.h index e4462c69d3b..c7c3cd19726 100644 --- a/src/mess/machine/pc_keyboards.h +++ b/src/mess/machine/pc_keyboards.h @@ -10,7 +10,7 @@ // PC XT protocol keyboards #define STR_KBD_KEYTRONIC_PC3270 "keytronc_pc3270" -#define STR_KBD_IBM_PC_XT_83 "pcxt83" +#define STR_KBD_IBM_PC_XT_83 "pcxt" SLOT_INTERFACE_EXTERN(pc_xt_keyboards);