Previous 199869 Revisions Next

r31709 Wednesday 20th August, 2014 at 00:08:20 UTC by Robbbert
ltd.c : system-4 games display but not playable.
[src/mame/drivers]ltd.c

trunk/src/mame/drivers/ltd.c
r31708r31709
99
1010  Used PinMAME as a reference.
1111
12  System 3: NMI is connected "FICHA" (coin slot). RST is connected to "TILT".
12  System 3: NMI is connected to "FICHA" (coin slot). RST is connected to "TILT".
1313
1414  The manual mentions these machines:
1515  Arizona, Atlantis, Galaxia, Hustler, Martian Queen.
r31708r31709
2525  (unknown year): Viking King
2626
2727ToDo:
28- System 4, everything
29- System 3, sound
28- No mechanical sounds
29- System 3, no sound
30- System 3, slam tilt to connect to reset line
3031- Zephy, no playfield inputs
32- System 4, no playfield inputs
33- System 4, can randomly freeze MAME for no reason
34- Alcapone, display needs fixing
3135- Outputs
3236- Mechanical
3337
r31708r31709
5357   DECLARE_DRIVER_INIT(ltd);
5458   DECLARE_READ8_MEMBER(io_r);
5559   DECLARE_WRITE8_MEMBER(io_w);
60   DECLARE_READ8_MEMBER(port1_r);
61   DECLARE_WRITE8_MEMBER(port1_w);
62   DECLARE_READ8_MEMBER(port2_r);
63   DECLARE_WRITE8_MEMBER(port2_w);
64   DECLARE_WRITE8_MEMBER(count_reset_w);
5665   DECLARE_INPUT_CHANGED_MEMBER(ficha);
5766   TIMER_DEVICE_CALLBACK_MEMBER(timer_r);
5867private:
5968   bool m_timer_r;
69   bool m_clear;
70   UINT8 m_counter;
71   UINT8 m_digit;
6072   UINT8 m_game;
6173   UINT8 m_out_offs;
74   UINT8 m_port2;
6275   virtual void machine_reset();
6376   required_device<cpu_device> m_maincpu;
6477   required_shared_ptr<UINT8> m_p_ram;
r31708r31709
7689   AM_RANGE(0x0000, 0x001f) AM_RAM // internal to the cpu
7790   AM_RANGE(0x0080, 0x00ff) AM_RAM
7891   AM_RANGE(0x0100, 0x01ff) AM_RAM AM_SHARE("nvram")
79   //AM_RANGE(0x0800, 0x0800) AM_WRITE(cycle_reset_w)
92   AM_RANGE(0x0800, 0x0800) AM_WRITE(count_reset_w)
8093   AM_RANGE(0x0c00, 0x0c00) AM_DEVWRITE("aysnd_1", ay8910_device, reset_w)
8194   AM_RANGE(0x1000, 0x1000) AM_DEVWRITE("aysnd_0", ay8910_device, address_w)
8295   AM_RANGE(0x1400, 0x1400) AM_DEVWRITE("aysnd_0", ay8910_device, reset_w)
r31708r31709
88101ADDRESS_MAP_END
89102
90103static ADDRESS_MAP_START( ltd4_io, AS_IO, 8, ltd_state )
91   //AM_RANGE(0x0100, 0x0100) AM_READWRITE
92   //AM_RANGE(0x0101, 0x0101) AM_WRITE(
104   AM_RANGE(0x0100, 0x0100) AM_READWRITE(port1_r,port1_w)
105   AM_RANGE(0x0101, 0x0101) AM_READWRITE(port2_r,port2_w)
93106ADDRESS_MAP_END
94107
108// bits 6,7 not connected to data bus
109// 1=does something in Atlantis; 2=does something in Black Hole; note that sometimes pressing G or H will reboot the machine.
95110static INPUT_PORTS_START( ltd3 )
96111   PORT_START("FICHA")
97112   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, ltd_state, ficha, 0)
r31708r31709
127142   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q) //2
128143   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W) //2
129144   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E) //2
145   PORT_BIT( 0x18, IP_ACTIVE_LOW, IPT_UNUSED )
146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START )
147   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
148
149   PORT_START("X7")
150   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X) PORT_NAME("Outhole") // 1,2
151   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
152INPUT_PORTS_END
153
154// this needs to be redone once inputs start to work
155static INPUT_PORTS_START( ltd4 )
156   PORT_START("X0")
157   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_0_PAD)
158   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1_PAD)
159   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2_PAD)
160   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3_PAD)
161   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4_PAD)
162   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) // tilt all
163   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
164
165   PORT_START("X1")
166   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
167   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
168   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_QUOTE) // start pecmen
169   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
170   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) //coin all
171   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) //coin cowboy,alcapone; start pecmen
172   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
173
174   PORT_START("X2")
175   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) //start cowboy,alcapone
176   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
177   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
178   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F)
179   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_G)
180   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_H)
181   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
182
183   PORT_START("X3")
184   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
185   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
186   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
130187   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R)
131188   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Y)
132   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START )
189   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
133190   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
134191
135192   PORT_START("X4")
r31708r31709
160217   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
161218
162219   PORT_START("X7")
163   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X) PORT_NAME("Outhole") // 1,2
220   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X)
164221   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_ASTERISK)
165222   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH_PAD)
166   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_MINUS_PAD)
223   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_MINUS_PAD) // credit pecmen
167224   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_PLUS_PAD)
168225   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_ENTER_PAD)
169226   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
170227INPUT_PORTS_END
171228
172static INPUT_PORTS_START( ltd4 )
173INPUT_PORTS_END
174
175229INPUT_CHANGED_MEMBER( ltd_state::ficha )
176230{
177231   if(newval)
r31708r31709
181235// switches
182236READ8_MEMBER( ltd_state::io_r )
183237{
184   if (offset==0) return ioport("X0")->read();
185   if (offset==1) return ioport("X1")->read();
186   if (offset==2) return ioport("X2")->read();
187   if (offset==3) return ioport("X3")->read();
188   if (offset==7) return ioport("X7")->read();
238   if (offset==0)
239      return ioport("X0")->read();
240   else
241   if (offset==1)
242      return ioport("X1")->read();
243   else
244   if (offset==2)
245      return ioport("X2")->read();
246   else
247   if (offset==3)
248      return ioport("X3")->read();
249   else
250   if (offset==7)
251      return ioport("X7")->read();
252
189253   return 0xff;
190254}
191255
r31708r31709
195259   offset >>= 10; // reduces offsets to 1 per bank
196260}
197261
262READ8_MEMBER( ltd_state:: port1_r )
263{
264   if (~m_port2 & 0x10)
265   {
266      UINT8 row = m_digit >> 4;
267
268      if (row==0)
269         return ioport("X0")->read();
270      else
271      if (row==1)
272         return ioport("X1")->read();
273      else
274      if (row==2)
275         return ioport("X2")->read();
276      else
277      if (row==3)
278         return ioport("X3")->read();
279      else
280      if (row==4)
281         return ioport("X4")->read();
282      else
283      if (row==5)
284         return ioport("X5")->read();
285      else
286      if (row==6)
287         return ioport("X6")->read();
288      else
289      //if (row==7)
290         return ioport("X7")->read();
291   }
292   return 0xff;
293}
294
295WRITE8_MEMBER( ltd_state::port1_w )
296{
297   if (m_port2 & 0x10)
298   {
299      UINT8 row = m_digit & 15;
300      UINT8 segment = BITSWAP8(data, 7, 0, 1, 2, 3, 4, 5, 6);
301
302      switch (m_counter)
303      {
304         case 0:
305            m_clear = (data < 0xff);
306            break;
307         case 6:
308            if (m_clear)
309               m_digit = data;
310            break;
311         case 7:
312            if (m_clear)
313            {
314               if (row>7)
315                  output_set_digit_value(row+2, segment); // P2
316               else
317                  output_set_digit_value(row, segment); // P1
318            }
319            break;
320         case 8:
321            if (m_clear)
322            {
323               if (row>13)
324                  output_set_digit_value(row+26, segment); // credits / ball
325               else
326               if (row>7)
327                  output_set_digit_value(row+22, segment); // P4
328               else
329                  output_set_digit_value(row+20, segment); // P3
330            }
331            break;
332      }
333   }
334}
335
336READ8_MEMBER( ltd_state:: port2_r )
337{
338   return m_port2;
339}
340
341WRITE8_MEMBER( ltd_state::port2_w )
342{
343   if (~m_port2 & data & 0x10)
344      m_counter++;
345
346   m_port2 = data;
347}
348
349WRITE8_MEMBER( ltd_state::count_reset_w )
350{
351   m_counter = 0;
352}
353
198354void ltd_state::machine_reset()
199355{
356   m_clear = 0;
357   m_counter = 0;
200358   m_out_offs = 0;
201359   m_timer_r = 0;
202360}
r31708r31709
347505
348506      }
349507   }
350//   else
351//   if (m_out_offs == 0x4a) // outhole
352//   {
353//      if (BIT(m_p_ram[m_out_offs], 0))
354//         m_samples->start(0, 5);
355//   }
356//   else
357//   if (m_out_offs == 0x4b) // knocker
358//   {
359//      if (BIT(m_p_ram[m_out_offs], 0))
360//         m_samples->start(0, 6);
361//   }
362508}
363509
364510static MACHINE_CONFIG_START( ltd3, ltd_state )
r31708r31709
379525
380526static MACHINE_CONFIG_START( ltd4, ltd_state )
381527   /* basic machine hardware */
382   MCFG_CPU_ADD("maincpu", M6803, XTAL_3_579545MHz)
528   MCFG_CPU_ADD("maincpu", M6803, XTAL_3_579545MHz) // guess, no details available
383529   MCFG_CPU_PROGRAM_MAP(ltd4_map)
384530   MCFG_CPU_IO_MAP(ltd4_io)
385531
r31708r31709
466612GAME(1981, zephy,    0,  ltd3,  ltd3, ltd_state, zephy,    ROT0, "LTD", "Zephy",              GAME_IS_SKELETON_MECHANICAL)
467613
468614// system 4
469GAME(1981, cowboy,   0,  ltd4,  ltd4, ltd_state, ltd,      ROT0, "LTD", "Cowboy Eight Ball", GAME_IS_SKELETON_MECHANICAL)
615GAME(1981, cowboy,   0,  ltd4,  ltd4, ltd_state, ltd,      ROT0, "LTD", "Cowboy Eight Ball 2", GAME_IS_SKELETON_MECHANICAL)
470616GAME(1981, pecmen,   0,  ltd4,  ltd4, ltd_state, ltd,      ROT0, "LTD", "Mr. & Mrs. Pec-Men", GAME_IS_SKELETON_MECHANICAL)
471617GAME(1981, alcapone, 0,  ltd4,  ltd4, ltd_state, ltd,      ROT0, "LTD", "Al Capone",          GAME_IS_SKELETON_MECHANICAL)
472618GAME(1982, columbia, 0,  ltd4,  ltd4, ltd_state, ltd,      ROT0, "LTD", "Columbia",           GAME_IS_SKELETON_MECHANICAL)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team