From 4a412e9cfa1b86fa6f096900614d307c5f6c1838 Mon Sep 17 00:00:00 2001 From: "R. Belmont" Date: Sun, 23 Sep 2012 16:22:00 +0000 Subject: [PATCH] (MESS) Apple II: Add preliminary support for TME Arcade Board [R. Belmont] --- .gitattributes | 2 + src/mess/drivers/apple2.c | 2 + src/mess/machine/a2arcadebd.c | 145 ++++++++++++++++++++++++++++++++++ src/mess/machine/a2arcadebd.h | 51 ++++++++++++ src/mess/mess.mak | 1 + 5 files changed, 201 insertions(+) create mode 100644 src/mess/machine/a2arcadebd.c create mode 100644 src/mess/machine/a2arcadebd.h diff --git a/.gitattributes b/.gitattributes index 8223a091f72..f6d3f7e49ea 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6369,6 +6369,8 @@ src/mess/machine/990_tap.c svneol=native#text/plain src/mess/machine/990_tap.h svneol=native#text/plain src/mess/machine/a2alfam2.c svneol=native#text/plain src/mess/machine/a2alfam2.h svneol=native#text/plain +src/mess/machine/a2arcadebd.c svneol=native#text/plain +src/mess/machine/a2arcadebd.h svneol=native#text/plain src/mess/machine/a2bus.c svneol=native#text/plain src/mess/machine/a2bus.h svneol=native#text/plain src/mess/machine/a2cffa.c svneol=native#text/plain diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c index 7fc9fb8a9ef..755fffd4f8b 100644 --- a/src/mess/drivers/apple2.c +++ b/src/mess/drivers/apple2.c @@ -209,6 +209,7 @@ Apple 3.5 and Apple 5.25 drives - up to three devices #include "machine/a2alfam2.h" #include "machine/laser128.h" #include "machine/a2echoii.h" +#include "machine/a2arcadebd.h" /*************************************************************************** PARAMETERS @@ -632,6 +633,7 @@ static SLOT_INTERFACE_START(apple2_cards) SLOT_INTERFACE("ap16alt", A2BUS_IBSAP16ALT) /* IBS AP16 (German VideoTerm clone), alternate revision */ SLOT_INTERFACE("vtc1", A2BUS_VTC1) /* Unknown VideoTerm clone #1 */ SLOT_INTERFACE("vtc2", A2BUS_VTC2) /* Unknown VideoTerm clone #2 */ + SLOT_INTERFACE("arcbd", A2BUS_ARCADEBOARD) /* Third Millenium Engineering Arcade Board */ // SLOT_INTERFACE("scsi", A2BUS_SCSI) /* Apple II SCSI Card */ SLOT_INTERFACE_END diff --git a/src/mess/machine/a2arcadebd.c b/src/mess/machine/a2arcadebd.c new file mode 100644 index 00000000000..6638261bfec --- /dev/null +++ b/src/mess/machine/a2arcadebd.c @@ -0,0 +1,145 @@ +/********************************************************************* + + a2arcadeboard.c + + Implementation of the Third Millenium Engineering Arcade Board + +*********************************************************************/ + +#include "emu.h" +#include "machine/a2arcadebd.h" + + +/*************************************************************************** + PARAMETERS +***************************************************************************/ + +#define TMS_TAG "arcbd_tms" +#define AY_TAG "arcbd_ay" +#define SCREEN_TAG "screen" + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type A2BUS_ARCADEBOARD = &device_creator; + +static const ay8910_interface arcadeboard_ay8910_interface = +{ + AY8910_LEGACY_OUTPUT, + AY8910_DEFAULT_LOADS, + DEVCB_NULL +}; + +static TMS9928A_INTERFACE(arcadeboard_tms9918a_interface) +{ + SCREEN_TAG, + 0x4000, // 16k of VRAM + DEVCB_NULL // VBL interrupt +}; + +MACHINE_CONFIG_FRAGMENT( arcadeboard ) + MCFG_TMS9928A_ADD( TMS_TAG, TMS9918A, arcadeboard_tms9918a_interface ) + MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG ) + MCFG_SCREEN_UPDATE_DEVICE( TMS_TAG, tms9918a_device, screen_update ) + + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD(AY_TAG, AY8910, 1022727) + MCFG_SOUND_CONFIG(arcadeboard_ay8910_interface) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) +MACHINE_CONFIG_END + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor a2bus_arcboard_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( arcadeboard ); +} + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, A2BUS_ARCADEBOARD, "Third Millenium Engineering Arcade Board", tag, owner, clock), + device_a2bus_card_interface(mconfig, *this), + m_tms(*this, TMS_TAG), + m_ay(*this, AY_TAG) +{ + m_shortname = "a2arcbd"; +} + +a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, type, name, tag, owner, clock), + device_a2bus_card_interface(mconfig, *this), + m_tms(*this, TMS_TAG), + m_ay(*this, AY_TAG) +{ + m_shortname = "a2arcbd"; +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void a2bus_arcboard_device::device_start() +{ + // set_a2bus_device makes m_slot valid + set_a2bus_device(); +} + +void a2bus_arcboard_device::device_reset() +{ +} + +/* + C0nx map: + 0 - TMS read vram + 1 - TMS read status + 2 - TMS write vram + 3 - TMS write register + 5 - AY register select + 6 - AY data +*/ + + UINT8 a2bus_arcboard_device::read_c0nx(address_space &space, UINT8 offset) +{ + switch (offset) + { + case 0: + return m_tms->vram_read(space, 0); + + case 1: + return m_tms->register_read(space, 0); + + case 6: + return ay8910_r(m_ay, space, 0); + } + + return 0xff; +} + +void a2bus_arcboard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +{ + switch (offset) + { + case 2: + m_tms->vram_write(space, 0, data); + break; + + case 3: + m_tms->register_write(space, 0, data); + break; + + case 5: + ay8910_address_w(m_ay, space, 0, data); + break; + + case 6: + ay8910_data_w(m_ay, space, 0, data); + break; + } +} diff --git a/src/mess/machine/a2arcadebd.h b/src/mess/machine/a2arcadebd.h new file mode 100644 index 00000000000..31d03758f23 --- /dev/null +++ b/src/mess/machine/a2arcadebd.h @@ -0,0 +1,51 @@ +/********************************************************************* + + a2arcadebd.h + + Third Millenium Engineering Arcade Board + +*********************************************************************/ + +#ifndef __A2BUS_ARCADEBOARD__ +#define __A2BUS_ARCADEBOARD__ + +#include "emu.h" +#include "machine/a2bus.h" +#include "video/tms9928a.h" +#include "sound/ay8910.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class a2bus_arcboard_device: + public device_t, + public device_a2bus_card_interface +{ +public: + // construction/destruction + a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_arcboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + +protected: + virtual void device_start(); + virtual void device_reset(); + + // overrides of standard a2bus slot functions + virtual UINT8 read_c0nx(address_space &space, UINT8 offset); + virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data); + + required_device m_tms; + required_device m_ay; + +private: +}; + +// device type definition +extern const device_type A2BUS_ARCADEBOARD; + +#endif /* __A2BUS_ARCADEBOARD__ */ + diff --git a/src/mess/mess.mak b/src/mess/mess.mak index 1e25ba3aba3..e4bfc7beff2 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -678,6 +678,7 @@ $(MESSOBJ)/apple.a: \ $(MESS_MACHINE)/a2alfam2.o \ $(MESS_MACHINE)/laser128.o \ $(MESS_MACHINE)/a2echoii.o \ + $(MESS_MACHINE)/a2arcadebd.o \ $(MESS_MACHINE)/lisa.o \ $(MESS_DRIVERS)/lisa.o \ $(MESS_MACHINE)/nubus.o \