summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/namco/gaplus_m.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/namco/gaplus_m.cpp')
-rw-r--r--src/mame/namco/gaplus_m.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/mame/namco/gaplus_m.cpp b/src/mame/namco/gaplus_m.cpp
new file mode 100644
index 00000000000..a7fb22b2d0f
--- /dev/null
+++ b/src/mame/namco/gaplus_m.cpp
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:Manuel Abadia, Ernesto Corvi, Nicola Salmoria
+/***************************************************************************
+
+ gaplus.cpp
+
+ Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
+ I/O ports)
+
+***************************************************************************/
+
+#include "emu.h"
+#include "sound/samples.h"
+#include "gaplus.h"
+
+
+/************************************************************************************
+* *
+* Gaplus custom I/O chips (preliminary) *
+* *
+************************************************************************************/
+
+void gaplus_base_state::customio_3_w(offs_t offset, uint8_t data)
+{
+ if ((offset == 0x09) && (data >= 0x0f))
+ m_samples->start(0,0);
+
+ m_customio_3[offset] = data;
+}
+
+
+uint8_t gaplus_base_state::customio_3_r(offs_t offset)
+{
+ int mode = m_customio_3[8];
+
+ switch (offset)
+ {
+ case 0:
+ return ioport("IN2")->read(); /* cabinet & test mode */
+ case 1:
+ return (mode == 2) ? m_customio_3[offset] : 0x0f;
+ case 2:
+ return (mode == 2) ? 0x0f : 0x0e;
+ case 3:
+ return (mode == 2) ? m_customio_3[offset] : 0x01;
+ default:
+ return m_customio_3[offset];
+ }
+}