summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2021-10-26 04:25:45 +1100
committer Robbbert <Robbbert@users.noreply.github.com>2021-10-26 04:25:45 +1100
commitfbc3f7ce8bcadf90b9fc8fedd9d807fb2eeccc0e (patch)
treea46a27a902f90b20c182663b736a915356db6e66 /src/mame
parentcc0ecd4d37f932a28a684f8861643d70b8887d22 (diff)
macp.cpp: added some flesh to the skeleton. 2 games are playable.
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/macp.cpp385
-rw-r--r--src/mame/layout/macp.lay134
2 files changed, 478 insertions, 41 deletions
diff --git a/src/mame/drivers/macp.cpp b/src/mame/drivers/macp.cpp
index 25f3546a8a4..608df187de4 100644
--- a/src/mame/drivers/macp.cpp
+++ b/src/mame/drivers/macp.cpp
@@ -1,84 +1,385 @@
// license:BSD-3-Clause
-// copyright-holders:Ivan Vangelista
+// copyright-holders:Robbbert
// PINBALL
-// Skeleton driver for MAC S.A. and CICPlay pinballs. ROM definitions taken from PinMAME.
+/***************************************************************************************************************
+Skeleton driver for MAC S.A. and CICPlay pinballs. ROM definitions taken from PinMAME.
+
+There's a number of undumped PAL-type devices, so had to guess a few things.
+Unknown chips: SIVP47, MAC P01, MAC D01, MAC A01 (=MAC A.A4, MAC A.A5).
+Schematic has errors and omissions (no input or output matrix, no wiring between boards).
+Although the coin slots are not working, you can add credits by changing 0xC011 in the memory view.
+
+Status:
+- Some games are playable
+-- macgalxy (Outhole is Z and X)
+-- macjungl (Outhole is E)
+-- glxplay2 (Outhole unknown)
+- Other machines can generally accept credits and start, but then cannot score.
+- Display has intolerable flicker.
+
+ToDo
+- MSM sound
+- Inputs not responding
+- DIPs to be checked
+- Fix flicker on displays
+- CIC games need a different layout
+
+***************************************************************************************************************/
#include "emu.h"
#include "machine/genpin.h"
#include "cpu/z80/z80.h"
+#include "machine/clock.h"
#include "machine/i8279.h"
#include "sound/ay8910.h"
#include "sound/msm5205.h"
+#include "speaker.h"
+#include "macp.lh"
+
+namespace {
class macp_state : public genpin_class
{
public:
macp_state(const machine_config &mconfig, device_type type, const char *tag)
: genpin_class(mconfig, type, tag)
- , m_maincpu(*this, "maincpu") { }
-
- void macp(machine_config &config);
- void macpmsm(machine_config &config);
- void macp0(machine_config &config);
- void macp0_map(address_map &map);
- void macp_io(address_map &map);
- void macp_map(address_map &map);
+ , m_maincpu(*this, "maincpu")
+ , m_ay8910(*this, "ay%u", 0U)
+ , m_io_keyboard(*this, "X%u", 0)
+ , m_digits(*this, "digit%u", 0U)
+ , m_io_outputs(*this, "out%u", 0U)
+ { }
+
+ void mac16k(machine_config &config);
+ void mac32k(machine_config &config);
+ void mem16k_map(address_map &map);
+ void io16k_map(address_map &map);
+ void mem32k_map(address_map &map);
+ void io32k_map(address_map &map);
+
private:
- required_device<cpu_device> m_maincpu;
+ DECLARE_WRITE_LINE_MEMBER(clock_tick);
+ DECLARE_WRITE_LINE_MEMBER(irq_w);
+ void scanlines_w(u8);
+ void digit_w(u8);
+ void ay0_a_w(u8);
+ void ay0_b_w(u8);
+ void ay1_a_w(u8);
+ void ay1_b_w(u8);
+ u8 ay1_b_r();
+ u8 kbd_r();
+ u8 m_t_c = 0;
+ u8 m_digit = 0;
+ u8 m_ay1_b = 0;
+ u8 m_ay1_a = 0;
+ u8 m_relay_ctrl = 0;
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ required_device<z80_device> m_maincpu;
+ required_device_array<ay8910_device, 2> m_ay8910;
+ required_ioport_array<8> m_io_keyboard;
+ output_finder<40> m_digits;
+ output_finder<85> m_io_outputs; // 12+4+1 solenoids + 48+16 lamps
};
-void macp_state::macp_map(address_map &map)
+void macp_state::mem16k_map(address_map &map)
+{
+ map.unmap_value_high();
+ map.global_mask(0x7fff); // A15 only goes to the expansion socket and a PAL
+ map(0x0000, 0x3fff).rom();
+ map(0x4000, 0x47ff).ram().share("nvram"); // 6116
+ map(0x6000, 0x6001).rw("i8279", FUNC(i8279_device::read), FUNC(i8279_device::write));
+}
+
+void macp_state::mem32k_map(address_map &map)
{
map.unmap_value_high();
map(0x0000, 0x7fff).rom();
- map(0xc000, 0xc7ff).ram();
+ map(0xc000, 0xdfff).ram().share("nvram"); // DS1225 (8k RAM with inbuilt battery), only first 2k used.
}
-void macp_state::macp0_map(address_map &map)
+void macp_state::io16k_map(address_map &map)
{
map.unmap_value_high();
- map(0x0000, 0x3fff).rom();
- map(0x4000, 0x47ff).ram();
+ map.global_mask(0xff);
+ map(0x08, 0x08).w(m_ay8910[0], FUNC(ay8910_device::address_w));
+ map(0x0a, 0x0a).w(m_ay8910[0], FUNC(ay8910_device::data_w));
+ map(0x18, 0x18).w(m_ay8910[1], FUNC(ay8910_device::address_w));
+ map(0x19, 0x19).r(m_ay8910[1], FUNC(ay8910_device::data_r));
+ map(0x1a, 0x1a).w(m_ay8910[1], FUNC(ay8910_device::data_w));
}
-void macp_state::macp_io(address_map &map)
+void macp_state::io32k_map(address_map &map)
{
map.unmap_value_high();
map.global_mask(0xff);
+ map(0x08, 0x08).w(m_ay8910[0], FUNC(ay8910_device::address_w));
+ map(0x0a, 0x0a).w(m_ay8910[0], FUNC(ay8910_device::data_w));
+ map(0x28, 0x28).w(m_ay8910[1], FUNC(ay8910_device::address_w));
+ map(0x29, 0x29).r(m_ay8910[1], FUNC(ay8910_device::data_r));
+ map(0x2a, 0x2a).w(m_ay8910[1], FUNC(ay8910_device::data_w));
+ map(0x40, 0x41).rw("i8279", FUNC(i8279_device::read), FUNC(i8279_device::write));
}
static INPUT_PORTS_START( macp )
+ PORT_START("X0")
+ PORT_DIPNAME( 0x01, 0x01, "DIP A1")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x01, DEF_STR(Off))
+ PORT_DIPNAME( 0x02, 0x02, "DIP A2")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x02, DEF_STR(Off))
+ PORT_DIPNAME( 0x04, 0x04, "DIP A3")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x04, DEF_STR(Off))
+ PORT_DIPNAME( 0x08, 0x08, "DIP A4")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x08, DEF_STR(Off))
+ PORT_DIPNAME( 0x10, 0x10, "DIP A5")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x10, DEF_STR(Off))
+ PORT_DIPNAME( 0x20, 0x20, "DIP A6")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x20, DEF_STR(Off))
+ PORT_DIPNAME( 0x40, 0x40, "DIP A7")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x40, DEF_STR(Off))
+
+ PORT_START("X1")
+ PORT_DIPNAME( 0x01, 0x01, "DIP B1")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x01, DEF_STR(Off))
+ PORT_DIPNAME( 0x02, 0x02, "DIP B2")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x02, DEF_STR(Off))
+ PORT_DIPNAME( 0x04, 0x04, "DIP B3")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x04, DEF_STR(Off))
+ PORT_DIPNAME( 0x08, 0x08, "DIP B4")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x08, DEF_STR(Off))
+ PORT_DIPNAME( 0x10, 0x10, "DIP B5")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x10, DEF_STR(Off))
+ PORT_DIPNAME( 0x20, 0x20, "DIP B6")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x20, DEF_STR(Off))
+ PORT_DIPNAME( 0x40, 0x40, "DIP B7")
+ PORT_DIPSETTING( 0x00, DEF_STR(On))
+ PORT_DIPSETTING( 0x40, DEF_STR(Off))
+
+ PORT_START("X2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Tilt")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("Slam Tilt")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Reset RAM")
+
+ PORT_START("X3")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("INP30")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("INP31")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("INP32")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("INP33")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("INP34")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("INP35")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("INP36")
+
+ PORT_START("X4")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("INP40")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("INP41")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("INP42")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_K) PORT_NAME("INP43")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("INP44")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("INP45")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("INP46")
+
+ PORT_START("X5")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("INP50")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("INP51")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("INP52")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("INP53")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("INP54")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("INP55")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("INP56")
+
+ PORT_START("X6")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("INP60")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("INP61")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("INP62")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("INP63")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("INP64")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("INP65")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_NAME("INP66")
+
+ PORT_START("X7")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("INP70")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_COLON) PORT_NAME("INP71")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_QUOTE) PORT_NAME("INP72")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("INP73")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("INP74")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("INP75")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_NAME("INP76")
INPUT_PORTS_END
static INPUT_PORTS_START( cicplay )
+ PORT_INCLUDE( macp )
INPUT_PORTS_END
-void macp_state::macp(machine_config &config)
+void macp_state::scanlines_w(u8 data)
+{
+ m_digit = data & 15;
+}
+
+void macp_state::digit_w(u8 data)
+{
+ static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // guess, because custom PAL
+ m_digits[m_digit] = patterns[BIT(data, 0, 4)];
+ m_digits[m_digit+20] = patterns[BIT(data, 4, 4)];
+ // This isn't right obviously, but if score > 999999 and bit 7 of PAL, then illuminate some extra lamps on the backboard
+ u8 i,j = BIT(data, 0, 4);
+ if (j > 9)
+ for (i = 0; i < 8; i++)
+ m_io_outputs[69+i] = BIT(data, i);
+ j = BIT(data, 4, 4);
+ if (j > 9)
+ for (i = 0; i < 8; i++)
+ m_io_outputs[77+i] = BIT(data, i);
+}
+
+u8 macp_state::kbd_r()
+{
+ return (m_io_keyboard[m_digit & 7]->read() & 0x7f )| (BIT(m_ay1_b, 4) ? 0x80 : 0);
+}
+
+void macp_state::ay0_a_w(u8 data)
+{
+ // d4-7 solenoids
+ for (u8 i = 4; i < 8; i++)
+ m_io_outputs[4+i] = BIT(data, i);
+
+ // d0-3 lamps
+ data &= 15;
+ if (data < 6)
+ for (u8 i = 0; i < 8; i++)
+ m_io_outputs[17+data*8+i] = BIT(m_ay1_a, i);
+}
+
+void macp_state::ay0_b_w(u8 data)
+{
+ // d0-7 solenoids
+ for (u8 i = 0; i < 8; i++)
+ m_io_outputs[i] = BIT(data, i);
+}
+
+void macp_state::ay1_a_w(u8 data)
+{
+ m_ay1_a = data;
+}
+
+void macp_state::ay1_b_w(u8 data)
+{
+ m_ay1_b = data;
+ // d0-3 solenoids: Coin Lock (probably lockout), Coin In (probably coin counter), Ext Play, Ext Ball.
+ for (u8 i = 0; i < 4; i++)
+ m_io_outputs[12+i] = BIT(data, i);
+ // d4 goes to RL7 (kbd_r)
+ // d5 another solenoid
+ m_io_outputs[16] = BIT(data, 5);
+ // Relay control: 0 = not set; 1 = K1 relay enables 12v supply; 2 = K2 relay enables 40v supply; 3= normal operation
+ // K2 is pulsed by a watchdog circuit. The K2 relay needs both bits enabled before it will turn on.
+ m_relay_ctrl = BIT(data, 5, 2);
+}
+
+u8 macp_state::ay1_b_r()
+{
+ return 0x7f | (m_relay_ctrl == 3) ? 0 : 1; // BIT 7 low indicates 40volt supply is available
+}
+
+WRITE_LINE_MEMBER( macp_state::irq_w )
+{
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
+}
+
+WRITE_LINE_MEMBER( macp_state::clock_tick )
+{
+ if (state)
+ {
+ if (m_t_c > 0xf0)
+ m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
+ else
+ m_t_c++;
+ }
+}
+
+void macp_state::machine_start()
+{
+ genpin_class::machine_start();
+
+ m_digits.resolve();
+ m_io_outputs.resolve();
+
+ save_item(NAME(m_digit));
+ save_item(NAME(m_t_c));
+ save_item(NAME(m_ay1_a));
+ save_item(NAME(m_ay1_b));
+}
+
+void macp_state::machine_reset()
+{
+ genpin_class::machine_reset();
+ m_t_c = 0;
+ m_relay_ctrl = 0;
+}
+
+void macp_state::mac16k(machine_config &config)
{
/* basic machine hardware */
- Z80(config, m_maincpu, 2500000);
- m_maincpu->set_addrmap(AS_PROGRAM, &macp_state::macp_map);
- m_maincpu->set_addrmap(AS_IO, &macp_state::macp_io);
+ Z80(config, m_maincpu, 3'800'000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &macp_state::mem16k_map);
+ m_maincpu->set_addrmap(AS_IO, &macp_state::io16k_map);
+
+ clock_device &cpoint_clock(CLOCK(config, "cpoint_clock", 50)); // crosspoint detector
+ cpoint_clock.signal_handler().set(FUNC(macp_state::clock_tick));
+
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* video hardware */
- //config.set_default_layout();
+ config.set_default_layout(layout_macp);
//I8279
+ i8279_device &kbdc(I8279(config, "i8279", 3'800'000)); // based on divider
+ kbdc.out_sl_callback().set(FUNC(macp_state::scanlines_w)); // scan SL lines
+ kbdc.out_disp_callback().set(FUNC(macp_state::digit_w)); // display A&B
+ kbdc.in_rl_callback().set(FUNC(macp_state::kbd_r)); // kbd RL lines
+ kbdc.out_irq_callback().set(FUNC(macp_state::irq_w));
/* sound hardware */
- //2x AY8910
genpin_audio(config);
-}
-void macp_state::macp0(machine_config &config)
-{
- macp(config);
- m_maincpu->set_addrmap(AS_PROGRAM, &macp_state::macp0_map);
+ //2x AY8910
+ SPEAKER(config, "lspkr").front_left();
+ AY8910(config, m_ay8910[0], 3'800'000/2);
+ m_ay8910[0]->set_resistors_load(10e3,10e3,10e3);
+ m_ay8910[0]->port_a_write_callback().set(FUNC(macp_state::ay0_a_w));
+ m_ay8910[0]->port_b_write_callback().set(FUNC(macp_state::ay0_b_w));
+ m_ay8910[0]->add_route(ALL_OUTPUTS, "lspkr", 0.50);
+
+ SPEAKER(config, "rspkr").front_right();
+ AY8910(config, m_ay8910[1], 3'800'000/2);
+ m_ay8910[1]->set_resistors_load(10e3,10e3,10e3);
+ m_ay8910[1]->port_a_write_callback().set(FUNC(macp_state::ay1_a_w));
+ m_ay8910[1]->port_b_write_callback().set(FUNC(macp_state::ay1_b_w));
+ m_ay8910[1]->port_b_read_callback().set(FUNC(macp_state::ay1_b_r));
+ m_ay8910[1]->add_route(ALL_OUTPUTS, "rspkr", 0.50);
}
-void macp_state::macpmsm(machine_config &config)
+void macp_state::mac32k(machine_config &config)
{
- macp(config);
+ mac16k(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &macp_state::mem32k_map);
+ m_maincpu->set_addrmap(AS_IO, &macp_state::io32k_map);
// MSM5205
}
@@ -155,17 +456,19 @@ ROM_START(glxplay2)
ROM_LOAD("1382-2.cpu", 0x2000, 0x2000, CRC(945c90fd) SHA1(8367992f8db8b402d82e4a3f02a35b796756ce0f))
ROM_END
+} // Anonymous namespace
+
// MAC S.A. pinballs
-GAME( 1986, macgalxy, 0, macp0, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC's Galaxy", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 1987, macjungl, 0, macp0, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC Jungle", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 1987, spctrain, 0, macp, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Train (Pinball)", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 1987, spctraino, spctrain, macp0, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Train (Pinball, old hardware)", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 1988, spcpnthr, 0, macpmsm, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Panther", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 19??, mac_1808, 0, macpmsm, macp, macp_state, empty_init, ROT0, "MAC S.A.", "unknown game (MAC #1808)", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 1995, macjungn, 0, macpmsm, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC Jungle (New version)", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 1996, nbamac, 0, macpmsm, macp, macp_state, empty_init, ROT0, "MAC S.A.", "NBA MAC", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1986, macgalxy, 0, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC's Galaxy", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1987, macjungl, 0, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC Jungle", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1987, spctrain, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Train (Pinball)", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1987, spctraino, spctrain, mac16k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Train (Pinball, old hardware)", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1988, spcpnthr, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "Space Panther", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 19??, mac_1808, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "unknown game (MAC #1808)", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1995, macjungn, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "MAC Jungle (New version)", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1996, nbamac, 0, mac32k, macp, macp_state, empty_init, ROT0, "MAC S.A.", "NBA MAC", MACHINE_IS_SKELETON_MECHANICAL )
// CICPlay pinballs
-GAME( 1985, glxplay, 0, macp0, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Galaxy Play", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 1986, kidnap, 0, macp0, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Kidnap", MACHINE_IS_SKELETON_MECHANICAL )
-GAME( 1987, glxplay2, 0, macp0, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Galaxy Play 2", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1985, glxplay, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Galaxy Play", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1986, kidnap, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Kidnap", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 1987, glxplay2, 0, mac16k, cicplay, macp_state, empty_init, ROT0, "CICPlay", "Galaxy Play 2", MACHINE_IS_SKELETON_MECHANICAL )
diff --git a/src/mame/layout/macp.lay b/src/mame/layout/macp.lay
new file mode 100644
index 00000000000..ff29b4396c7
--- /dev/null
+++ b/src/mame/layout/macp.lay
@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<!--
+license:CC0
+-->
+
+<mamelayout version="2">
+
+ <element name="digit7" defstate="0">
+ <led7seg>
+ <color red="0.0" green="0.75" blue="1.0" />
+ </led7seg>
+ </element>
+
+ <view name="Default Layout">
+ <bounds left="0" top="25" right="325" bottom="205" />
+
+ <!-- Top Row -->
+ <element name="digit0" ref="digit7">
+ <bounds left="10" top="45" right="30" bottom="84" />
+ </element>
+ <element name="digit1" ref="digit7">
+ <bounds left="34" top="45" right="54" bottom="84" />
+ </element>
+ <element name="digit2" ref="digit7">
+ <bounds left="58" top="45" right="78" bottom="84" />
+ </element>
+ <element name="digit3" ref="digit7">
+ <bounds left="87" top="45" right="107" bottom="84" />
+ </element>
+ <element name="digit4" ref="digit7">
+ <bounds left="111" top="45" right="131" bottom="84" />
+ </element>
+ <element name="digit5" ref="digit7">
+ <bounds left="135" top="45" right="155" bottom="84" />
+ </element>
+
+ <element name="digit20" ref="digit7">
+ <bounds left="170" top="45" right="190" bottom="84" />
+ </element>
+ <element name="digit21" ref="digit7">
+ <bounds left="194" top="45" right="214" bottom="84" />
+ </element>
+ <element name="digit22" ref="digit7">
+ <bounds left="218" top="45" right="238" bottom="84" />
+ </element>
+ <element name="digit23" ref="digit7">
+ <bounds left="247" top="45" right="267" bottom="84" />
+ </element>
+ <element name="digit24" ref="digit7">
+ <bounds left="271" top="45" right="291" bottom="84" />
+ </element>
+ <element name="digit25" ref="digit7">
+ <bounds left="295" top="45" right="315" bottom="84" />
+ </element>
+
+ <!-- Middle Row -->
+ <element name="digit6" ref="digit7">
+ <bounds left="10" top="100" right="30" bottom="139" />
+ </element>
+ <element name="digit7" ref="digit7">
+ <bounds left="34" top="100" right="54" bottom="139" />
+ </element>
+ <element name="digit8" ref="digit7">
+ <bounds left="58" top="100" right="78" bottom="139" />
+ </element>
+ <element name="digit9" ref="digit7">
+ <bounds left="87" top="100" right="107" bottom="139" />
+ </element>
+ <element name="digit10" ref="digit7">
+ <bounds left="111" top="100" right="131" bottom="139" />
+ </element>
+ <element name="digit11" ref="digit7">
+ <bounds left="135" top="100" right="155" bottom="139" />
+ </element>
+
+ <element name="digit26" ref="digit7">
+ <bounds left="170" top="100" right="190" bottom="139" />
+ </element>
+ <element name="digit27" ref="digit7">
+ <bounds left="194" top="100" right="214" bottom="139" />
+ </element>
+ <element name="digit28" ref="digit7">
+ <bounds left="218" top="100" right="238" bottom="139" />
+ </element>
+ <element name="digit29" ref="digit7">
+ <bounds left="247" top="100" right="267" bottom="139" />
+ </element>
+ <element name="digit30" ref="digit7">
+ <bounds left="271" top="100" right="291" bottom="139" />
+ </element>
+ <element name="digit31" ref="digit7">
+ <bounds left="295" top="100" right="315" bottom="139" />
+ </element>
+
+ <!-- Bottom Row -->
+ <element name="digit15" ref="digit7">
+ <bounds left="10" top="155" right="30" bottom="194" />
+ </element>
+ <element name="unused1" ref="digit7">
+ <bounds left="34" top="155" right="54" bottom="194" />
+ </element>
+ <element name="digit14" ref="digit7">
+ <bounds left="58" top="155" right="78" bottom="194" />
+ </element>
+ <element name="unused2" ref="digit7">
+ <bounds left="87" top="155" right="107" bottom="194" />
+ </element>
+ <element name="digit13" ref="digit7">
+ <bounds left="111" top="155" right="131" bottom="194" />
+ </element>
+ <element name="digit12" ref="digit7">
+ <bounds left="135" top="155" right="155" bottom="194" />
+ </element>
+
+ <element name="digit32" ref="digit7">
+ <bounds left="170" top="155" right="190" bottom="194" />
+ </element>
+ <element name="digit33" ref="digit7">
+ <bounds left="194" top="155" right="214" bottom="194" />
+ </element>
+ <element name="digit34" ref="digit7">
+ <bounds left="218" top="155" right="238" bottom="194" />
+ </element>
+ <element name="digit35" ref="digit7">
+ <bounds left="247" top="155" right="267" bottom="194" />
+ </element>
+ <element name="digit35" ref="digit7">
+ <bounds left="271" top="155" right="291" bottom="194" />
+ </element>
+ <element name="digit35" ref="digit7">
+ <bounds left="295" top="155" right="315" bottom="194" />
+ </element>
+ </view>
+</mamelayout>