Previous 199869 Revisions Next

r17423 Thursday 23rd August, 2012 at 13:32:57 UTC by Robbbert
Flicker: added remaining inputs, some notes, sound (of sorts), marked as working. [Robbbert]
[src/mame/drivers]flicker.c

trunk/src/mame/drivers/flicker.c
r17422r17423
1212  Some clues from PinMAME
1313
1414ToDo:
15- Add remaining inputs
15- Better artwork
16- It freezes when F3 pressed or game tilted
1617
1718
1819************************************************************************************/
1920
2021#include "emu.h"
2122#include "cpu/i4004/i4004.h"
23#include "sound/beep.h"
2224#include "flicker.lh"
2325
2426class flicker_state : public driver_device
r17422r17423
2628public:
2729   flicker_state(const machine_config &mconfig, device_type type, const char *tag)
2830      : driver_device(mconfig, type, tag),
29        m_maincpu(*this, "maincpu")
31   m_maincpu(*this, "maincpu"),
32   m_beeper(*this, BEEPER_TAG)
3033   { }
34
3135   DECLARE_WRITE8_MEMBER(port00_w);
3236   DECLARE_WRITE8_MEMBER(port01_w);
3337   DECLARE_WRITE8_MEMBER(port10_w);
r17422r17423
3741
3842   // devices
3943   required_device<cpu_device> m_maincpu;
44   required_device<device_t> m_beeper;
4045
4146   // driver_device overrides
4247   virtual void machine_reset();
43public:
44   DECLARE_DRIVER_INIT(flicker);
4548};
4649
4750
r17422r17423
5356   AM_RANGE(0x0000, 0x00FF) AM_RAM
5457ADDRESS_MAP_END
5558
56static ADDRESS_MAP_START( flicker_io , AS_IO, 8, flicker_state )
59static ADDRESS_MAP_START( flicker_io, AS_IO, 8, flicker_state )
5760   AM_RANGE(0x0000, 0x0000) AM_WRITE(port00_w)
5861   AM_RANGE(0x0001, 0x0001) AM_WRITE(port01_w)
5962   AM_RANGE(0x0002, 0x0002) AM_READ(port02_r)
6063   AM_RANGE(0x0010, 0x0010) AM_WRITE(port10_w)
6164ADDRESS_MAP_END
6265
63// from us patent 4093232
6466static INPUT_PORTS_START( flicker )
6567   PORT_START("TEST")
6668   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Door Slam") PORT_CODE(KEYCODE_HOME)
67   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4 coins")
68   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3 coins")
69   PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2 coins")
7069   PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1 coin credit") PORT_CODE(KEYCODE_5)
7170   PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2 credit") PORT_CODE(KEYCODE_6)
7271   PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3 credit") PORT_CODE(KEYCODE_7)
r17422r17423
7574   PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6 credit") PORT_CODE(KEYCODE_0)
7675   PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tilt") PORT_CODE(KEYCODE_T)
7776   PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Start") PORT_CODE(KEYCODE_1)
78   PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Test") PORT_CODE(KEYCODE_W)
77   PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Test")
7978
79   PORT_START("B0")
80   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left Lane Target") PORT_CODE(KEYCODE_W)
81   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("/B Target") PORT_CODE(KEYCODE_E)
82   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left Lane 1000") PORT_CODE(KEYCODE_R)
83   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("/A Target") PORT_CODE(KEYCODE_Y)
8084   PORT_START("B1")
81   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bumper") PORT_CODE(KEYCODE_M)
85   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right Lane Target") PORT_CODE(KEYCODE_U)
86   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("/C Target") PORT_CODE(KEYCODE_I)
87   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right Lane 1000") PORT_CODE(KEYCODE_O)
88   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("/D Target") PORT_CODE(KEYCODE_A)
89   PORT_START("B2")
90   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Spinner") PORT_CODE(KEYCODE_S)
91   PORT_START("B3")
92   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("10's Target") PORT_CODE(KEYCODE_D)
93   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("100's Target") PORT_CODE(KEYCODE_F)
94   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Pot Bumper") PORT_CODE(KEYCODE_G)
95   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3000 Hole") PORT_CODE(KEYCODE_H)
96   PORT_START("B4")
97   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1000 Bonus") PORT_CODE(KEYCODE_J)
98   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("500 Target") PORT_CODE(KEYCODE_K)
99   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Out Hole") PORT_CODE(KEYCODE_X)
100   PORT_START("B5")
101   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left 500 Out") PORT_CODE(KEYCODE_L)
102   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left Bumper") PORT_CODE(KEYCODE_Z)
103   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right 500 Out") PORT_CODE(KEYCODE_C)
104   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right Bumper") PORT_CODE(KEYCODE_V)
105   PORT_START("B6")
106   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A Target") PORT_CODE(KEYCODE_B)
107   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("B target") PORT_CODE(KEYCODE_N)
108   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C target") PORT_CODE(KEYCODE_M)
109   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("D Target") PORT_CODE(KEYCODE_COMMA)
82110INPUT_PORTS_END
83111
84112READ8_MEMBER( flicker_state::port02_r )
85113{
86114   offset = cpu_get_reg(m_maincpu, I4004_RAM) - 0x20; // we need the full address
87115
88   if (offset == 0)
89      return ioport("B1")->read();
90   else
91      return 0;
116   if (offset < 7)
117   {
118      char kbdrow[6];
119      sprintf(kbdrow,"B%X",offset);
120      return ioport(kbdrow)->read();
121   }
122   return 0;
92123}
93124
94125WRITE8_MEMBER( flicker_state::port00_w )
r17422r17423
100131
101132WRITE8_MEMBER( flicker_state::port01_w )
102133{
134// The output lines operate the various lamps (44 of them)
103135   offset = cpu_get_reg(m_maincpu, I4004_RAM) - 0x10; // we need the full address
104136
105137   if (offset < 0x10)
r17422r17423
108140
109141WRITE8_MEMBER( flicker_state::port10_w )
110142{
111   //offset = cpu_get_reg(m_maincpu, I4004_RAM) - 0x10; // we need the full address
143/* Outputs depend on data:
144    1 = tens chime
145    2 = hundreds chime
146    3 = thousands chime
147    4 = left bumper
148    5 = right bumper
149    6 = pot bumper
150    7 = out hole
151    8 = 3000 hole
152    9 = knocker
153    A = coin counter
154    B = coin acceptor */
155   offset = cpu_get_reg(m_maincpu, I4004_RAM) - 0x10; // we need the full address
156   if (data && data != offset)
157   {
158      switch (offset)
159      {
160         case 0x01:
161            beep_set_state(m_beeper, 1);
162            beep_set_frequency(m_beeper, 2000);
163            break;
164         case 0x02:
165            beep_set_state(m_beeper, 1);
166            beep_set_frequency(m_beeper, 1500);
167            break;
168         case 0x03:
169            beep_set_state(m_beeper, 1);
170            beep_set_frequency(m_beeper, 800);
171            break;
172         case 0x09:
173            beep_set_state(m_beeper, 1);
174            beep_set_frequency(m_beeper, 200);
175            break;
176         case 0x0a:
177            coin_counter_w(machine(), 0, 1);
178            coin_counter_w(machine(), 0, 0);
179            break;
180         default:
181            break;
182      }
183   }
184   else
185      beep_set_state(m_beeper, 0);
112186}
113187
114188
r17422r17423
116190{
117191}
118192
119DRIVER_INIT_MEMBER(flicker_state,flicker)
120{
121}
122
123193static MACHINE_CONFIG_START( flicker, flicker_state )
124194   /* basic machine hardware */
125195   MCFG_CPU_ADD("maincpu", I4004, XTAL_5MHz / 8)
r17422r17423
129199
130200   /* Video */
131201   MCFG_DEFAULT_LAYOUT(layout_flicker)
202
203   /* Sound */
204   MCFG_SPEAKER_STANDARD_MONO("mono")
205   MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
206   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
132207MACHINE_CONFIG_END
133208
134209
r17422r17423
138213ROM_END
139214
140215//   YEAR    GAME     PARENT  MACHINE   INPUT    CLASS           INIT      ORIENTATION    COMPANY             DESCRIPTION             FLAGS
141GAME(1974,  flicker,  0,      flicker,  flicker, flicker_state,  flickerROT0,        "Nutting Associates", "Flicker (Prototype)", GAME_IS_SKELETON_MECHANICAL)
216GAME(1974,  flicker,  0,      flicker,  flicker, driver_device0,        ROT0,        "Nutting Associates", "Flicker (Prototype)", GAME_MECHANICAL )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team