| Previous | 199869 Revisions | Next |
| r19766 Monday 24th December, 2012 at 05:58:05 UTC by Roberto Fresca |
|---|
| Waku Waku Doubutsu Land TonTon improvements... [Roberto Fresca] - Added hopper emulation. - Fixed the VDP V9938 VRAM. - Defined clocks for CPU and YM2149. - Fixed inputs to be consistent with other Success games. - Added coin lockout. |
| [src/mame/drivers] | tonton.c |
| r19765 | r19766 | |
|---|---|---|
| 7 | 7 | Driver by Angelo Salese & Roberto Fresca. |
| 8 | 8 | |
| 9 | 9 | |
| 10 | ||
| 10 | *************************************************************************** | |
| 11 | 11 | |
| 12 | - Hopper mechanism. | |
| 13 | ||
| 14 | =========================================================================== | |
| 15 | ||
| 16 | 12 | WAKUWAKU DOUBUTSU LAND TONTON (ANIMAL VIDEO SLOT) |
| 17 | 13 | (c)SUCCESS / CABINET :TAIYO JIDOKI (SUN AUTO MACHINE) |
| 18 | 14 | |
| r19765 | r19766 | |
| 22 | 18 | |
| 23 | 19 | TONTON.BIN : MAIN ROM |
| 24 | 20 | |
| 21 | ||
| 25 | 22 | ***************************************************************************/ |
| 26 | 23 | |
| 27 | 24 | #include "emu.h" |
| 28 | 25 | #include "cpu/z80/z80.h" |
| 29 | 26 | #include "sound/ay8910.h" |
| 30 | 27 | #include "video/v9938.h" |
| 28 | #include "machine/ticket.h" | |
| 31 | 29 | #include "machine/nvram.h" |
| 32 | 30 | |
| 33 | 31 | class tonton_state : public driver_device |
| r19765 | r19766 | |
| 46 | 44 | TIMER_DEVICE_CALLBACK_MEMBER(tonton_interrupt); |
| 47 | 45 | }; |
| 48 | 46 | |
| 49 | #define MAIN_CLOCK XTAL_21_4772MHz | |
| 47 | #define MAIN_CLOCK XTAL_21_4772MHz | |
| 48 | #define CPU_CLOCK MAIN_CLOCK/6 | |
| 49 | #define YM2149_CLOCK MAIN_CLOCK/6/2 // '/SEL' pin tied to GND, so internal divisor x2 is active | |
| 50 | 50 | |
| 51 | #define HOPPER_PULSE 50 // time between hopper pulses in milliseconds | |
| 52 | #define VDP_MEM 0x30000 | |
| 51 | 53 | |
| 54 | ||
| 52 | 55 | /* from MSX2 driver, may be not accurate for this HW */ |
| 53 | 56 | #define MSX2_XBORDER_PIXELS 16 |
| 54 | 57 | #define MSX2_YBORDER_PIXELS 28 |
| r19765 | r19766 | |
| 74 | 77 | |
| 75 | 78 | WRITE8_MEMBER(tonton_state::tonton_outport_w) |
| 76 | 79 | { |
| 77 | /* lockout perhaps? */ | |
| 78 | 80 | coin_counter_w(machine(), offset, data & 0x01); |
| 81 | coin_lockout_global_w(machine(), data & 0x02); /* Coin Lock */ | |
| 82 | machine().device<ticket_dispenser_device>("hopper")->write(space, 0, (data & 0x02)); /* Hopper Motor */ | |
| 79 | 83 | |
| 80 | // data & 2 is hopper related | |
| 81 | ||
| 82 | if(data & 0xfe) | |
| 83 | logerror("%02x %02x\n",data,offset); | |
| 84 | // if(data & 0xfe) | |
| 85 | // logerror("%02x %02x\n",data,offset); | |
| 86 | if (data) | |
| 87 | logerror("tonton_outport_w %02X @ %04X\n", data, space.device().safe_pc()); | |
| 84 | 88 | } |
| 85 | 89 | |
| 86 | 90 | |
| r19765 | r19766 | |
| 97 | 101 | static ADDRESS_MAP_START( tonton_io, AS_IO, 8, tonton_state ) |
| 98 | 102 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 99 | 103 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 104 | AM_RANGE(0x00, 0x00) AM_WRITE(tonton_outport_w) | |
| 100 | 105 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 101 | AM_RANGE(0x0 | |
| 106 | AM_RANGE(0x01, 0x01) AM_WRITENOP // write the same to outport 00h | |
| 102 | 107 | AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW1") |
| 103 | 108 | AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW2") |
| 104 | 109 | AM_RANGE(0x88, 0x8b) AM_DEVREADWRITE( "v9938", v9938_device, read, write ) |
| r19765 | r19766 | |
| 123 | 128 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| 124 | 129 | |
| 125 | 130 | PORT_START("IN1") |
| 126 | PORT_SERVICE( 0x01, IP_ACTIVE_LOW ) | |
| 127 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 128 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Reset Button") | |
| 131 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_TOGGLE PORT_NAME("Bookkeeping") | |
| 132 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal In") | |
| 133 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_0) PORT_NAME("Reset Button") | |
| 129 | 134 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 130 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown | |
| 135 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown A") | |
| 131 | 136 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 132 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_ | |
| 137 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback | |
| 133 | 138 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) |
| 134 | 139 | |
| 135 | 140 | PORT_START("DSW1") |
| r19765 | r19766 | |
| 240 | 245 | DEVCB_NULL, /* Seems unused */ |
| 241 | 246 | DEVCB_NULL, /* Seems unused */ |
| 242 | 247 | DEVCB_DRIVER_MEMBER(tonton_state,ay_aout_w), /* Write all bits twice, and then reset them at boot */ |
| 243 | DEVCB_DRIVER_MEMBER(tonton_state,ay_bout_w) /* Write all bits twice, and then reset them at boot */ | |
| 248 | DEVCB_DRIVER_MEMBER(tonton_state,ay_bout_w) /* Write all bits twice, and then reset them at boot */ | |
| 244 | 249 | }; |
| 245 | 250 | |
| 246 | 251 | |
| r19765 | r19766 | |
| 251 | 256 | static MACHINE_CONFIG_START( tonton, tonton_state ) |
| 252 | 257 | |
| 253 | 258 | /* basic machine hardware */ |
| 254 | MCFG_CPU_ADD("maincpu",Z80, | |
| 259 | MCFG_CPU_ADD("maincpu",Z80, CPU_CLOCK) /* Guess. According to other MSX2 based gambling games */ | |
| 255 | 260 | MCFG_CPU_PROGRAM_MAP(tonton_map) |
| 256 | 261 | MCFG_CPU_IO_MAP(tonton_io) |
| 257 | 262 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tonton_state, tonton_interrupt, "screen", 0, 1) |
| r19765 | r19766 | |
| 262 | 267 | /* video hardware */ |
| 263 | 268 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 264 | 269 | |
| 265 | MCFG_V9938_ADD("v9938", "screen", | |
| 270 | MCFG_V9938_ADD("v9938", "screen", VDP_MEM) | |
| 266 | 271 | MCFG_V99X8_INTERRUPT_CALLBACK_STATIC(tonton_vdp0_interrupt) |
| 267 | 272 | |
| 268 | 273 | MCFG_SCREEN_ADD("screen",RASTER) |
| r19765 | r19766 | |
| 276 | 281 | MCFG_PALETTE_LENGTH(512) |
| 277 | 282 | MCFG_PALETTE_INIT( v9938 ) |
| 278 | 283 | |
| 284 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ) | |
| 285 | ||
| 279 | 286 | /* sound hardware */ |
| 280 | 287 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 281 | MCFG_SOUND_ADD("aysnd", YM2149, M | |
| 288 | MCFG_SOUND_ADD("aysnd", YM2149, YM2149_CLOCK) /* Guess. According to other MSX2 based gambling games */ | |
| 282 | 289 | MCFG_SOUND_CONFIG(ay8910_intf) |
| 283 | 290 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) |
| 284 | 291 | MACHINE_CONFIG_END |
| r19765 | r19766 | |
| 296 | 303 | ROM_END |
| 297 | 304 | |
| 298 | 305 | |
| 299 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ | |
| 306 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ | |
| 300 | 307 | GAME( 199?, tonton, 0, tonton, tonton, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Waku Waku Doubutsu Land TonTon (Japan)", 0 ) |
| Previous | 199869 Revisions | Next |