summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Robbbert <robbbert@users.noreply.github.com>2012-10-10 08:41:56 +0000
committer Robbbert <robbbert@users.noreply.github.com>2012-10-10 08:41:56 +0000
commitdb939b8f51ea5560430ec38852309ba3eaa74dc4 (patch)
tree97b8ba814d8fc95ca54f1a5f54f3eaa428bed993
parent74da5a1e83765ea402c44d13131164408b9cfa8e (diff)
atari_s2 : wip and placeholder
-rw-r--r--.gitattributes1
-rw-r--r--src/mame/drivers/atari_s2.c88
-rw-r--r--src/mame/layout/atari_s2.lay142
-rw-r--r--src/mame/mame.mak2
4 files changed, 212 insertions, 21 deletions
diff --git a/.gitattributes b/.gitattributes
index 60ac4f28bd7..014f096732d 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -4261,6 +4261,7 @@ src/mame/layout/arimk4nz.lay svneol=native#text/plain
src/mame/layout/aristmk4.lay svneol=native#text/plain
src/mame/layout/armora.lay svneol=native#text/plain
src/mame/layout/atari_s1.lay svneol=native#text/plain
+src/mame/layout/atari_s2.lay svneol=native#text/plain
src/mame/layout/atarifb.lay svneol=native#text/plain
src/mame/layout/atarifb4.lay svneol=native#text/plain
src/mame/layout/avalnche.lay svneol=native#text/plain
diff --git a/src/mame/drivers/atari_s2.c b/src/mame/drivers/atari_s2.c
index e6153337ace..711b71e7eea 100644
--- a/src/mame/drivers/atari_s2.c
+++ b/src/mame/drivers/atari_s2.c
@@ -3,64 +3,110 @@
Pinball
Atari Generation/System 2
+ Manuals and PinMAME used as references (couldn't find full schematics).
+
+
************************************************************************************/
-#include "emu.h"
+#include "machine/genpin.h"
#include "cpu/m6800/m6800.h"
+#include "machine/nvram.h"
+#include "atari_s2.lh"
+
class atari_s2_state : public driver_device
{
public:
atari_s2_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu")
+ m_maincpu(*this, "maincpu"),
+ m_samples(*this, "samples")
{ }
+ DECLARE_WRITE8_HANDLER(intack_w);
+
+
+ TIMER_DEVICE_CALLBACK_MEMBER(irq);
protected:
// devices
required_device<cpu_device> m_maincpu;
+ required_device<samples_device> m_samples;
// driver_device overrides
virtual void machine_reset();
-public:
- DECLARE_DRIVER_INIT(atari_s2);
+private:
+ UINT8 m_t_c;
};
static ADDRESS_MAP_START( atari_s2_map, AS_PROGRAM, 8, atari_s2_state )
ADDRESS_MAP_GLOBAL_MASK(0x3fff)
AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0700) AM_RAM
- AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0700) AM_RAM // NVRAM
- //AM_RANGE(0x1000, 0x1007) AM_READ(sw_r)
- //AM_RANGE(0x1800, 0x1800) AM_WRITE(sound0_w)
- //AM_RANGE(0x1820, 0x1820) AM_WRITE(sound1_w)
- //AM_RANGE(0x1840, 0x1846) AM_WRITE(disp0_w)
- //AM_RANGE(0x1847, 0x1847) AM_WRITE(disp1_w)
- //AM_RANGE(0x1860, 0x1867) AM_WRITE(lamp_w)
- //AM_RANGE(0x1880, 0x1880) AM_WRITE(sol0_w)
- //AM_RANGE(0x18a0, 0x18a7) AM_WRITE(sol1_w)
- //AM_RANGE(0x18c0, 0x18c1) AM_WRITE(watchdog_w)
- //AM_RANGE(0x18e0, 0x18e0) AM_WRITE(intack_w)
- //AM_RANGE(0x2000, 0x2003) AM_READWRITE(dip_r,dip_w)
+ AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0700) AM_RAM AM_SHARE("nvram") // battery backed
+ //AM_RANGE(0x1000, 0x1007) AM_MIRROR(0x07F8) AM_READ(sw_r)
+ //AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x071F) AM_WRITE(sound0_w)
+ //AM_RANGE(0x1820, 0x1820) AM_MIRROR(0x071F) AM_WRITE(sound1_w)
+ //AM_RANGE(0x1840, 0x1847) AM_MIRROR(0x0718) AM_WRITE(disp_w)
+ //AM_RANGE(0x1860, 0x1867) AM_MIRROR(0x0718) AM_WRITE(lamp_w)
+ //AM_RANGE(0x1880, 0x1880) AM_MIRROR(0x071F) AM_WRITE(sol0_w)
+ //AM_RANGE(0x18a0, 0x18a7) AM_MIRROR(0x0718) AM_WRITE(sol1_w)
+ AM_RANGE(0x18c0, 0x18c0) AM_MIRROR(0x071F) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x18e0, 0x18e0) AM_MIRROR(0x071F) AM_WRITE(intack_w)
+ //AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x07FC) AM_READWRITE(dip_r,dip_w)
AM_RANGE(0x2800, 0x3fff) AM_ROM
ADDRESS_MAP_END
static INPUT_PORTS_START( atari_s2 )
INPUT_PORTS_END
-void atari_s2_state::machine_reset()
+WRITE8_MEMBER( atari_s2_state::intack_w )
{
+ m_maincpu->set_input_line(M6800_IRQ_LINE, CLEAR_LINE);
}
-DRIVER_INIT_MEMBER(atari_s2_state,atari_s2)
+TIMER_DEVICE_CALLBACK_MEMBER( atari_s2_state::irq )
+{
+// static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511
+// m_bit6++;
+ if (m_t_c > 0x40)
+ m_maincpu->set_input_line(M6800_IRQ_LINE, HOLD_LINE);
+ else
+ m_t_c++;
+
+// m_out_offs++;
+// m_out_offs &= 0x1f;
+// if ((m_out_offs & 3) == 3)
+// {
+// // Player number
+// char wordnum[8];
+// sprintf(wordnum,"text%d",m_out_offs>>2);
+// output_set_value(wordnum, !BIT(patterns[m_p_ram[m_out_offs]&15], 6)); // uses 'g' segment
+// }
+// else
+// {
+// // Digits
+// output_set_digit_value(m_out_offs << 1, patterns[m_p_ram[m_out_offs]>>4]);
+// output_set_digit_value((m_out_offs << 1)+1, patterns[m_p_ram[m_out_offs]&15]);
+// }
+}
+
+void atari_s2_state::machine_reset()
{
}
static MACHINE_CONFIG_START( atari_s2, atari_s2_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6800, 1000000)
+ MCFG_CPU_ADD("maincpu", M6800, XTAL_4MHz / 4)
MCFG_CPU_PROGRAM_MAP(atari_s2_map)
+ MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("irq", atari_s2_state, irq, attotime::from_hz(XTAL_4MHz / 8192))
+
+ /* Sound */
+ MCFG_FRAGMENT_ADD( genpin_audio )
+
+ /* Video */
+ MCFG_DEFAULT_LAYOUT(layout_atari_s2)
MACHINE_CONFIG_END
/*-------------------------------------------------------------------
@@ -90,5 +136,5 @@ ROM_START(hercules)
ROM_END
-GAME( 1979, supermap, 0, atari_s2, atari_s2, atari_s2_state, atari_s2, ROT0, "Atari", "Superman (Pinball)", GAME_IS_SKELETON_MECHANICAL)
-GAME( 1979, hercules, 0, atari_s2, atari_s2, atari_s2_state, atari_s2, ROT0, "Atari", "Hercules", GAME_IS_SKELETON_MECHANICAL)
+GAME( 1979, supermap, 0, atari_s2, atari_s2, driver_device, 0, ROT0, "Atari", "Superman (Pinball)", GAME_IS_SKELETON_MECHANICAL)
+GAME( 1979, hercules, 0, atari_s2, atari_s2, driver_device, 0, ROT0, "Atari", "Hercules", GAME_IS_SKELETON_MECHANICAL)
diff --git a/src/mame/layout/atari_s2.lay b/src/mame/layout/atari_s2.lay
new file mode 100644
index 00000000000..0ffde5da27b
--- /dev/null
+++ b/src/mame/layout/atari_s2.lay
@@ -0,0 +1,142 @@
+<!-- atari_s2.lay -->
+
+<!-- 2012-10-10: Initial version. [Robbbert] -->
+
+<mamelayout version="2">
+
+ <element name="digit" defstate="0">
+ <led7seg>
+ <color red="1.0" green="0.25" blue="0.0" />
+ </led7seg>
+ </element>
+
+ <element name="background">
+ <rect>
+ <bounds left="0" top="0" right="1" bottom="1" />
+ <color red="0.0" green="0.0" blue="0.0" />
+ </rect>
+ </element>
+ <element name="P0"><text string="Ball / Match"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="P1"><text string="Credits"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="P3"><text string="Player 1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="P4"><text string="Player 2"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="P5"><text string="Player 3"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <element name="P6"><text string="Player 4"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+
+ <view name="Default Layout">
+
+ <!-- Background -->
+ <backdrop element="background">
+ <bounds left="0" top="20" right="274" bottom="394" />
+ </backdrop>
+
+ <!-- LEDs -->
+
+ <!-- Player 1 Score -->
+
+ <bezel name="digit28" element="digit">
+ <bounds left="10" top="45" right="44" bottom="84" />
+ </bezel>
+ <bezel name="digit29" element="digit">
+ <bounds left="54" top="45" right="88" bottom="84" />
+ </bezel>
+ <bezel name="digit26" element="digit">
+ <bounds left="98" top="45" right="132" bottom="84" />
+ </bezel>
+ <bezel name="digit27" element="digit">
+ <bounds left="142" top="45" right="176" bottom="84" />
+ </bezel>
+ <bezel name="digit24" element="digit">
+ <bounds left="186" top="45" right="220" bottom="84" />
+ </bezel>
+ <bezel name="digit25" element="digit">
+ <bounds left="230" top="45" right="264" bottom="84" />
+ </bezel>
+
+ <!-- Player 2 Score -->
+ <bezel name="digit20" element="digit">
+ <bounds left="10" top="105" right="44" bottom="144" />
+ </bezel>
+ <bezel name="digit21" element="digit">
+ <bounds left="54" top="105" right="88" bottom="144" />
+ </bezel>
+ <bezel name="digit18" element="digit">
+ <bounds left="98" top="105" right="132" bottom="144" />
+ </bezel>
+ <bezel name="digit19" element="digit">
+ <bounds left="142" top="105" right="176" bottom="144" />
+ </bezel>
+ <bezel name="digit16" element="digit">
+ <bounds left="186" top="105" right="220" bottom="144" />
+ </bezel>
+ <bezel name="digit17" element="digit">
+ <bounds left="230" top="105" right="264" bottom="144" />
+ </bezel>
+
+ <!-- Player 3 Score -->
+ <bezel name="digit12" element="digit">
+ <bounds left="10" top="165" right="44" bottom="204" />
+ </bezel>
+ <bezel name="digit13" element="digit">
+ <bounds left="54" top="165" right="88" bottom="204" />
+ </bezel>
+ <bezel name="digit10" element="digit">
+ <bounds left="98" top="165" right="132" bottom="204" />
+ </bezel>
+ <bezel name="digit11" element="digit">
+ <bounds left="142" top="165" right="176" bottom="204" />
+ </bezel>
+ <bezel name="digit8" element="digit">
+ <bounds left="186" top="165" right="220" bottom="204" />
+ </bezel>
+ <bezel name="digit9" element="digit">
+ <bounds left="230" top="165" right="264" bottom="204" />
+ </bezel>
+
+ <!-- Player 4 Score -->
+ <bezel name="digit4" element="digit">
+ <bounds left="10" top="225" right="44" bottom="264" />
+ </bezel>
+ <bezel name="digit5" element="digit">
+ <bounds left="54" top="225" right="88" bottom="264" />
+ </bezel>
+ <bezel name="digit2" element="digit">
+ <bounds left="98" top="225" right="132" bottom="264" />
+ </bezel>
+ <bezel name="digit3" element="digit">
+ <bounds left="142" top="225" right="176" bottom="264" />
+ </bezel>
+ <bezel name="digit0" element="digit">
+ <bounds left="186" top="225" right="220" bottom="264" />
+ </bezel>
+ <bezel name="digit1" element="digit">
+ <bounds left="230" top="225" right="264" bottom="264" />
+ </bezel>
+
+ <!-- Credits and Balls -->
+ <bezel name="digit58" element="digit">
+ <bounds left="10" top="345" right="44" bottom="384" />
+ </bezel>
+ <bezel name="digit59" element="digit">
+ <bounds left="54" top="345" right="88" bottom="384" />
+ </bezel>
+ <bezel name="digit70" element="digit">
+ <bounds left="98" top="345" right="132" bottom="384" />
+ </bezel>
+ <bezel name="digit71" element="digit">
+ <bounds left="142" top="345" right="176" bottom="384" />
+ </bezel>
+ <bezel name="digit56" element="digit">
+ <bounds left="186" top="345" right="220" bottom="384" />
+ </bezel>
+ <bezel name="digit57" element="digit">
+ <bounds left="230" top="345" right="264" bottom="384" />
+ </bezel>
+ <bezel element="P0"><bounds left="200" right="258" top="330" bottom="342" /></bezel>
+ <bezel element="P1"><bounds left="30" right="88" top="330" bottom="342" /></bezel>
+ <bezel name="text3" element="P3"><bounds left="100" right="180" top="30" bottom="42" /></bezel>
+ <bezel name="text2" element="P4"><bounds left="100" right="180" top="90" bottom="102" /></bezel>
+ <bezel name="text1" element="P5"><bounds left="100" right="180" top="150" bottom="162" /></bezel>
+ <bezel name="text0" element="P6"><bounds left="100" right="180" top="210" bottom="222" /></bezel>
+ </view>
+</mamelayout>
diff --git a/src/mame/mame.mak b/src/mame/mame.mak
index 6162bdfb7d3..12d0902c013 100644
--- a/src/mame/mame.mak
+++ b/src/mame/mame.mak
@@ -1981,6 +1981,8 @@ $(DRIVERS)/atarifb.o: $(LAYOUT)/atarifb.lh \
$(DRIVERS)/atari_s1.o: $(LAYOUT)/atari_s1.lh
+$(DRIVERS)/atari_s2.o: $(LAYOUT)/atari_s2.lh
+
$(DRIVERS)/avalnche.o: $(LAYOUT)/avalnche.lh
$(DRIVERS)/balsente.o: $(LAYOUT)/stocker.lh