From b2003b6f46a1e4d7cea560940ec597b19ac102b2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 21 Aug 2011 07:10:25 +0000 Subject: [PATCH] Sync with MESS, changes by Oliver Galibert (no whatsnew) --- .gitattributes | 2 ++ src/emu/emu.mak | 1 + src/emu/machine/am8530h.c | 57 +++++++++++++++++++++++++++++++++++++++ src/emu/machine/am8530h.h | 42 +++++++++++++++++++++++++++++ src/emu/machine/mc68901.c | 8 ++++++ 5 files changed, 110 insertions(+) create mode 100644 src/emu/machine/am8530h.c create mode 100644 src/emu/machine/am8530h.h diff --git a/.gitattributes b/.gitattributes index 9654869c0e1..b36b68334ad 100644 --- a/.gitattributes +++ b/.gitattributes @@ -791,6 +791,8 @@ src/emu/machine/adc1213x.c svneol=native#text/plain src/emu/machine/adc1213x.h svneol=native#text/plain src/emu/machine/am53cf96.c svneol=native#text/plain src/emu/machine/am53cf96.h svneol=native#text/plain +src/emu/machine/am8530h.c svneol=native#text/plain +src/emu/machine/am8530h.h svneol=native#text/plain src/emu/machine/at28c16.c svneol=native#text/plain src/emu/machine/at28c16.h svneol=native#text/plain src/emu/machine/cdp1852.c svneol=native#text/plain diff --git a/src/emu/emu.mak b/src/emu/emu.mak index 03d7e2d433b..c61202b4e26 100644 --- a/src/emu/emu.mak +++ b/src/emu/emu.mak @@ -159,6 +159,7 @@ EMUMACHINEOBJS = \ $(EMUMACHINE)/adc1038.o \ $(EMUMACHINE)/adc1213x.o \ $(EMUMACHINE)/am53cf96.o \ + $(EMUMACHINE)/am8530h.o \ $(EMUMACHINE)/at28c16.o \ $(EMUMACHINE)/cdp1852.o \ $(EMUMACHINE)/cdp1871.o \ diff --git a/src/emu/machine/am8530h.c b/src/emu/machine/am8530h.c new file mode 100644 index 00000000000..7c5e311f908 --- /dev/null +++ b/src/emu/machine/am8530h.c @@ -0,0 +1,57 @@ +#include "am8530h.h" + +const device_type AM8530H = &device_creator; + +am8530h_device::am8530h_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, AM8530H, "AM8530H", tag, owner, clock) +{ +} + +void am8530h_device::set_int_change_cb(int_cb_t _int_change_cb) +{ + int_change_cb = _int_change_cb; +} + + +void am8530h_device::device_start() +{ +} + +READ8_MEMBER( am8530h_device::ca_r ) +{ + return 0xff; +} + +READ8_MEMBER( am8530h_device::cb_r ) +{ + return 0xff; +} + +READ8_MEMBER( am8530h_device::da_r ) +{ + return 0x40; +} + +READ8_MEMBER( am8530h_device::db_r ) +{ + return 0x40; +} + +WRITE8_MEMBER( am8530h_device::ca_w ) +{ + fprintf(stderr, "ca_w %x, %02x\n", offset, data); +} + +WRITE8_MEMBER( am8530h_device::cb_w ) +{ + fprintf(stderr, "cb_w %x, %02x\n", offset, data); +} + +WRITE8_MEMBER( am8530h_device::da_w ) +{ + fprintf(stderr, "da_w %x, %02x\n", offset, data); +} + +WRITE8_MEMBER( am8530h_device::db_w ) +{ + fprintf(stderr, "db_w %x, %02x\n", offset, data); +} diff --git a/src/emu/machine/am8530h.h b/src/emu/machine/am8530h.h new file mode 100644 index 00000000000..6797e16e20c --- /dev/null +++ b/src/emu/machine/am8530h.h @@ -0,0 +1,42 @@ +#ifndef __AM8530H_H__ +#define __AM8530H_H__ + +#include "emu.h" + +#define MCFG_AM8530H_ADD(_tag, _int_change_cb) \ + MCFG_DEVICE_ADD(_tag, AM8530H, 0) \ + downcast(device)->set_int_change_cb(_int_change_cb); + +class am8530h_device : public device_t { +public: + typedef delegate int_cb_t; + + am8530h_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + void set_int_change_cb(int_cb_t int_change_cb); + + DECLARE_READ8_MEMBER(ca_r); + DECLARE_READ8_MEMBER(cb_r); + DECLARE_READ8_MEMBER(da_r); + DECLARE_READ8_MEMBER(db_r); + + DECLARE_WRITE8_MEMBER(ca_w); + DECLARE_WRITE8_MEMBER(cb_w); + DECLARE_WRITE8_MEMBER(da_w); + DECLARE_WRITE8_MEMBER(db_w); + + void data_a_w(UINT8 val); + void data_b_w(UINT8 val); + + void int_ack(); + bool int_level_get(); + +protected: + virtual void device_start(); + +private: + int_cb_t int_change_cb; +}; + +extern const device_type AM8530H; + +#endif diff --git a/src/emu/machine/mc68901.c b/src/emu/machine/mc68901.c index a374d81c58d..186b705e25b 100644 --- a/src/emu/machine/mc68901.c +++ b/src/emu/machine/mc68901.c @@ -844,6 +844,14 @@ void mc68901_device::device_start() void mc68901_device::device_reset() { + m_xmit_state = XMIT_OFF; + m_rx_state = SERIAL_STOP; + m_rx_buffer = 0; + m_tx_buffer = 0; + + // Avoid read-before-write + m_ipr = m_imr = 0; + register_w(REGISTER_GPIP, 0); register_w(REGISTER_AER, 0); register_w(REGISTER_DDR, 0);