Previous 199869 Revisions Next

r19764 Monday 24th December, 2012 at 02:56:52 UTC by Roberto Fresca
Kuru Kuru Pyon Pyon: Added hopper emulation. The game is now working
properly without jams. Also added coin counters, coin lockout, and
some extra documentation from Charles MacDonald... [Roberto Fresca]
[src/mame/drivers]kurukuru.c

trunk/src/mame/drivers/kurukuru.c
r19763r19764
1010  This hardware seems to be a derivative of MSX2 'on steroids'.
1111  It has many similarites with sothello.c and tonton.c
1212
13  Special thanks to Charles MacDonald, for all the hardware traces: clocks,
14  ports, descriptions and a lot of things... :)
1315
16
1417*******************************************************************************
1518
1619  Technical Notes....
r19763r19764
117120  Kuru is the frog sound, and Pyon is the sound of jumps.
118121
119122  Coin 1 (key 5) could be set either as Coin 1 or as Payout button, through
120  a DIP switch. Once pressed, if it's set as payout, the game spits a message
121  that means "Jammed Medal". So set it to 'Normal' for normal behaviour...
123  a DIP switch.
122124
123  If you get the coin jam error, and the game is not responding anymore, press
125  If you get a 'medal jam' error, and the game is not responding anymore, press
124126  RESET (key 0), and the game will reset to default values (even all counters
125127  will be cleared).
126128
r19763r19764
191193
192194  TODO:
193195
194  - Out latch (Hopper emulation?).
195  - Find why the use of payout always jam. Hopper related?
196  - Check interrupts against Charles HW traces.
196197
198
197199******************************************************************************/
198200
199201#include "emu.h"
r19763r19764
201203#include "sound/ay8910.h"
202204#include "sound/msm5205.h"
203205#include "video/v9938.h"
206#include "machine/ticket.h"
204207#include "machine/nvram.h"
205208
206209class kurukuru_state : public driver_device
r19763r19764
236239
237240#define MAIN_CLOCK      XTAL_21_4772MHz
238241#define CPU_CLOCK      MAIN_CLOCK/6
239#define YM2149_CLOCK   MAIN_CLOCK/12
242#define YM2149_CLOCK   MAIN_CLOCK/6/2   // '/SEL' pin tied to GND, so internal divisor x2 is active
240243#define M5205_CLOCK      XTAL_384kHz
241244
245#define HOPPER_PULSE   50         // time between hopper pulses in milliseconds
242246#define VDP_MEM         0x30000
243247
244248/* from MSX2 driver, may be not accurate for this HW */
r19763r19764
305309/*
306310   00-0f is output latch (controls jamma output pins)
307311
308   assume hopper related:
309   $01 when coin 1
310   $20 when coin 2
311   $40 when payout (jams) ...to check
312    BIT  EDGE CONNECTOR       JAMMA FUNCTION
313   ----+--------------------+----------------
314    00 | Pin 08 top side    | coin counter 1
315    01 | Pin 09 top side    | coin lockout 1
316    02 | Pin 14 bottom side | service switch
317    03 | Pin 11 bottom side | unused
318    04 | Pin 11 top side    | unused
319    05 | Pin 08 bottom side | coin counter 2
320    06 | Pin 09 bottom side | coin lockout 2
321    07 | Not connected      | unused
312322
313323*/
314   if (data)
324   coin_counter_w(machine(), 0, data & 0x01);      /* Coin Counter 1 */
325   coin_counter_w(machine(), 1, data & 0x20);      /* Coin Counter 2 */
326   coin_lockout_global_w(machine(), data & 0x40);   /* Coin Lock */
327   machine().device<ticket_dispenser_device>("hopper")->write(space, 0, (data & 0x40));   /* Hopper Motor */
328
329   if (data & 0x9e)
315330      logerror("kurukuru_out_latch_w %02X @ %04X\n", data, space.device().safe_pc());
316331}
317332
r19763r19764
354369   AM_RANGE(0x20, 0x20) AM_MIRROR(0x0f) AM_WRITE(kurukuru_soundlatch_w)
355370   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE( "v9938", v9938_device, read, write )
356371   AM_RANGE(0x90, 0x90) AM_WRITE(kurukuru_bankswitch_w)
357   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0f) AM_READ_PORT("IN0")   // need mirror confirmation
372   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0f) AM_READ_PORT("IN0")
358373   AM_RANGE(0xb0, 0xb0) AM_MIRROR(0x0f) AM_READ_PORT("IN1")
359374   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE_LEGACY("ym2149", ay8910_r, ay8910_address_w)
360375   AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_DEVWRITE_LEGACY("ym2149", ay8910_data_w)
r19763r19764
431446
432447static INPUT_PORTS_START( kurukuru )
433448   PORT_START("IN0")
449/*  bits d0-d3 are JAMMA top side pins 20,21,22,23, bits d4-d7 are JAMMA bottom side pins 20,21,22,23
450    so that's player 1 left/right/button1/button2 then player 2 left/right/button1/button2
451*/
434452   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("1st (Bote)")
435453   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("2nd (Oume)")
436454   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("3rd (Pyoko)")
437455   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_V) PORT_NAME("4th (Kunio)")
438456   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_B) PORT_NAME("5th (Pyon Pyon)")
439   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_N) PORT_NAME("unknown N")
440   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_M) PORT_NAME("unknown M")
457   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_N) PORT_NAME("Unknown A0h - bit5")
458   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_M) PORT_NAME("Unknown A0h - bit6")
441459   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
442460
443461   PORT_START("IN1")
462/*  routed to JAMMA top side 15, bottom 15, top 16, bottom 16, top 17, bottom 17, top 24, bottom 24
463    so that's test, tilt/slam, coin 1, coin 2, p1 start, p2 start, p1 button 3, p2 button 3
464*/
444465   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Bookkeeping")
445466   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_NAME("Medal In")
446467   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_0) PORT_NAME("Reset Button")
447468   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
448   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER )   PORT_CODE(KEYCODE_A) PORT_NAME("Unknown 1")
449   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE (2)                        // coin 1 jams if is set as payout
450   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )   PORT_CODE(KEYCODE_S) PORT_NAME("Unknown 2")
451   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )                                 // payout writes the pulses, but jams.
469   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER )   PORT_CODE(KEYCODE_A) PORT_NAME("Unknown B0h - bit4")
470   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE (2)
471   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r)   // hopper feedback
472   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
452473
453474   PORT_START("DSW1")   // found in the PCB: 11111111
454475   PORT_DIPNAME( 0x07, 0x00, "Coinage A (100 Y)" )   PORT_DIPLOCATION("DSW1:1,2,3")
r19763r19764
574595   MCFG_PALETTE_LENGTH(512)
575596   MCFG_PALETTE_INIT( v9938 )
576597
598   MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW )
599
577600   /* sound hardware */
578601   MCFG_SPEAKER_STANDARD_MONO("mono")
579602   MCFG_SOUND_ADD("ym2149", YM2149, YM2149_CLOCK)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team