trunk/src/mame/drivers/kurukuru.c
| r19763 | r19764 | |
| 10 | 10 | This hardware seems to be a derivative of MSX2 'on steroids'. |
| 11 | 11 | It has many similarites with sothello.c and tonton.c |
| 12 | 12 | |
| 13 | Special thanks to Charles MacDonald, for all the hardware traces: clocks, |
| 14 | ports, descriptions and a lot of things... :) |
| 13 | 15 | |
| 16 | |
| 14 | 17 | ******************************************************************************* |
| 15 | 18 | |
| 16 | 19 | Technical Notes.... |
| r19763 | r19764 | |
| 117 | 120 | Kuru is the frog sound, and Pyon is the sound of jumps. |
| 118 | 121 | |
| 119 | 122 | 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. |
| 122 | 124 | |
| 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 |
| 124 | 126 | RESET (key 0), and the game will reset to default values (even all counters |
| 125 | 127 | will be cleared). |
| 126 | 128 | |
| r19763 | r19764 | |
| 191 | 193 | |
| 192 | 194 | TODO: |
| 193 | 195 | |
| 194 | | - Out latch (Hopper emulation?). |
| 195 | | - Find why the use of payout always jam. Hopper related? |
| 196 | - Check interrupts against Charles HW traces. |
| 196 | 197 | |
| 198 | |
| 197 | 199 | ******************************************************************************/ |
| 198 | 200 | |
| 199 | 201 | #include "emu.h" |
| r19763 | r19764 | |
| 201 | 203 | #include "sound/ay8910.h" |
| 202 | 204 | #include "sound/msm5205.h" |
| 203 | 205 | #include "video/v9938.h" |
| 206 | #include "machine/ticket.h" |
| 204 | 207 | #include "machine/nvram.h" |
| 205 | 208 | |
| 206 | 209 | class kurukuru_state : public driver_device |
| r19763 | r19764 | |
| 236 | 239 | |
| 237 | 240 | #define MAIN_CLOCK XTAL_21_4772MHz |
| 238 | 241 | #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 |
| 240 | 243 | #define M5205_CLOCK XTAL_384kHz |
| 241 | 244 | |
| 245 | #define HOPPER_PULSE 50 // time between hopper pulses in milliseconds |
| 242 | 246 | #define VDP_MEM 0x30000 |
| 243 | 247 | |
| 244 | 248 | /* from MSX2 driver, may be not accurate for this HW */ |
| r19763 | r19764 | |
| 305 | 309 | /* |
| 306 | 310 | 00-0f is output latch (controls jamma output pins) |
| 307 | 311 | |
| 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 |
| 312 | 322 | |
| 313 | 323 | */ |
| 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) |
| 315 | 330 | logerror("kurukuru_out_latch_w %02X @ %04X\n", data, space.device().safe_pc()); |
| 316 | 331 | } |
| 317 | 332 | |
| r19763 | r19764 | |
| 354 | 369 | AM_RANGE(0x20, 0x20) AM_MIRROR(0x0f) AM_WRITE(kurukuru_soundlatch_w) |
| 355 | 370 | AM_RANGE(0x80, 0x83) AM_DEVREADWRITE( "v9938", v9938_device, read, write ) |
| 356 | 371 | 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") |
| 358 | 373 | AM_RANGE(0xb0, 0xb0) AM_MIRROR(0x0f) AM_READ_PORT("IN1") |
| 359 | 374 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE_LEGACY("ym2149", ay8910_r, ay8910_address_w) |
| 360 | 375 | AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_DEVWRITE_LEGACY("ym2149", ay8910_data_w) |
| r19763 | r19764 | |
| 431 | 446 | |
| 432 | 447 | static INPUT_PORTS_START( kurukuru ) |
| 433 | 448 | 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 | */ |
| 434 | 452 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("1st (Bote)") |
| 435 | 453 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("2nd (Oume)") |
| 436 | 454 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("3rd (Pyoko)") |
| 437 | 455 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_V) PORT_NAME("4th (Kunio)") |
| 438 | 456 | 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") |
| 441 | 459 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 442 | 460 | |
| 443 | 461 | 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 | */ |
| 444 | 465 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Bookkeeping") |
| 445 | 466 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal In") |
| 446 | 467 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_0) PORT_NAME("Reset Button") |
| 447 | 468 | 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 ) |
| 452 | 473 | |
| 453 | 474 | PORT_START("DSW1") // found in the PCB: 11111111 |
| 454 | 475 | PORT_DIPNAME( 0x07, 0x00, "Coinage A (100 Y)" ) PORT_DIPLOCATION("DSW1:1,2,3") |
| r19763 | r19764 | |
| 574 | 595 | MCFG_PALETTE_LENGTH(512) |
| 575 | 596 | MCFG_PALETTE_INIT( v9938 ) |
| 576 | 597 | |
| 598 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) |
| 599 | |
| 577 | 600 | /* sound hardware */ |
| 578 | 601 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 579 | 602 | MCFG_SOUND_ADD("ym2149", YM2149, YM2149_CLOCK) |