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

trunk/src/mame/drivers/tonton.c
r19765r19766
77  Driver by Angelo Salese & Roberto Fresca.
88
99
10  TODO:
10***************************************************************************
1111
12  - Hopper mechanism.
13
14===========================================================================
15
1612  WAKUWAKU DOUBUTSU LAND TONTON (ANIMAL VIDEO SLOT)
1713  (c)SUCCESS / CABINET :TAIYO JIDOKI (SUN AUTO MACHINE)
1814
r19765r19766
2218
2319  TONTON.BIN  : MAIN ROM
2420
21
2522***************************************************************************/
2623
2724#include "emu.h"
2825#include "cpu/z80/z80.h"
2926#include "sound/ay8910.h"
3027#include "video/v9938.h"
28#include "machine/ticket.h"
3129#include "machine/nvram.h"
3230
3331class tonton_state : public driver_device
r19765r19766
4644   TIMER_DEVICE_CALLBACK_MEMBER(tonton_interrupt);
4745};
4846
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
5050
51#define HOPPER_PULSE   50         // time between hopper pulses in milliseconds
52#define VDP_MEM         0x30000
5153
54
5255/* from MSX2 driver, may be not accurate for this HW */
5356#define MSX2_XBORDER_PIXELS      16
5457#define MSX2_YBORDER_PIXELS      28
r19765r19766
7477
7578WRITE8_MEMBER(tonton_state::tonton_outport_w)
7679{
77   /* lockout perhaps? */
7880   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 */
7983
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());
8488}
8589
8690
r19765r19766
97101static ADDRESS_MAP_START( tonton_io, AS_IO, 8, tonton_state )
98102   ADDRESS_MAP_GLOBAL_MASK(0xff)
99103   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
104   AM_RANGE(0x00, 0x00) AM_WRITE(tonton_outport_w)
100105   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
101   AM_RANGE(0x00, 0x01) AM_WRITE(tonton_outport_w)
106   AM_RANGE(0x01, 0x01) AM_WRITENOP   // write the same to outport 00h
102107   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW1")
103108   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW2")
104109   AM_RANGE(0x88, 0x8b) AM_DEVREADWRITE( "v9938", v9938_device, read, write )
r19765r19766
123128   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
124129
125130   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")
129134   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
130   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown 1")
135   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown A")
131136   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
132   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S) PORT_NAME("Unknown 2")
137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r)   // hopper feedback
133138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
134139
135140   PORT_START("DSW1")
r19765r19766
240245   DEVCB_NULL,               /* Seems unused */
241246   DEVCB_NULL,               /* Seems unused */
242247   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 */
244249};
245250
246251
r19765r19766
251256static MACHINE_CONFIG_START( tonton, tonton_state )
252257
253258   /* basic machine hardware */
254   MCFG_CPU_ADD("maincpu",Z80,MAIN_CLOCK/6)   /* Guess. According to other MSX2 based gambling games */
259   MCFG_CPU_ADD("maincpu",Z80, CPU_CLOCK)   /* Guess. According to other MSX2 based gambling games */
255260   MCFG_CPU_PROGRAM_MAP(tonton_map)
256261   MCFG_CPU_IO_MAP(tonton_io)
257262   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tonton_state, tonton_interrupt, "screen", 0, 1)
r19765r19766
262267   /* video hardware */
263268   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
264269
265   MCFG_V9938_ADD("v9938", "screen", 0x40000)
270   MCFG_V9938_ADD("v9938", "screen", VDP_MEM)
266271   MCFG_V99X8_INTERRUPT_CALLBACK_STATIC(tonton_vdp0_interrupt)
267272
268273   MCFG_SCREEN_ADD("screen",RASTER)
r19765r19766
276281   MCFG_PALETTE_LENGTH(512)
277282   MCFG_PALETTE_INIT( v9938 )
278283
284   MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW )
285
279286   /* sound hardware */
280287   MCFG_SPEAKER_STANDARD_MONO("mono")
281   MCFG_SOUND_ADD("aysnd", YM2149, MAIN_CLOCK/12)   /* Guess. According to other MSX2 based gambling games */
288   MCFG_SOUND_ADD("aysnd", YM2149, YM2149_CLOCK)   /* Guess. According to other MSX2 based gambling games */
282289   MCFG_SOUND_CONFIG(ay8910_intf)
283290   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
284291MACHINE_CONFIG_END
r19765r19766
296303ROM_END
297304
298305
299/*    YEAR  NAME     PARENT  MACHINE  INPUT   INIT  ROT    COMPANY                   FULLNAME                                 FLAGS  */
306/*    YEAR  NAME     PARENT  MACHINE  INPUT   STATE          INIT  ROT    COMPANY                   FULLNAME                                 FLAGS  */
300307GAME( 199?, tonton,  0,      tonton,  tonton, driver_device, 0,    ROT0, "Success / Taiyo Jidoki", "Waku Waku Doubutsu Land TonTon (Japan)", 0 )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team