13
-Add coin counter,coin lock etc.;
14
-Controls dynamically changes if you turn on the Panel Type DIP-SW,I'd imagine that the "royal
15
panel" is just a dedicated panel for this game;
13
-Player-2 inputs are unemulated;
16
14
-"Custom RAM" emulation: might be a (weak) protection device or related to the "Back-up RAM NG"
17
15
msg that pops up at every start-up.
18
-Video emulation requires a major conversion to the HD46505SP C.R.T. chip (MC6845 clone)
16
-Video emulation requires a major conversion to the HD46505SP C.R.T. chip (MC6845 clone),
17
there's an heavy x offsetting with the flip screen right now due of that (sets register
18
0x0d to 0x80 when the screen is upside-down)
19
-You can actually configure the coin chutes / coin lockout active high/low (!), obviously
20
MAME isn't really suitable for it at the current time;
20
22
============================================================================================
145
149
eeprom_set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
148
static WRITE8_HANDLER( port_c0_w )
150
// logerror("PC %04x (Port $c0) value written %02x\n",cpu_get_pc(space->cpu),data);
154
static READ8_HANDLER( eeprom_r )
156
return ((~eeprom_read_bit() & 0x01)<<6) | (0xff & ~0x40);
159
static READ8_HANDLER( mux_r )
153
static READ8_DEVICE_HANDLER( eeprom_r )
155
return ((~eeprom_read_bit() & 0x01)<<6) | (input_port_read(device->machine, "SYSTEM") & ~0x40);
158
static READ8_DEVICE_HANDLER( mux_r )
163
case 0x00: return input_port_read(space->machine, "IN0");
164
case 0x01: return input_port_read(space->machine, "IN1");
165
case 0x02: return input_port_read(space->machine, "IN2");
166
case 0x04: return input_port_read(space->machine, "IN3");
167
case 0x08: return input_port_read(space->machine, "IN4");
168
case 0x10: return input_port_read(space->machine, "IN5");
169
case 0x20: return input_port_read(space->machine, "IN6");
162
case 0x00: return input_port_read(device->machine, "IN0");
163
case 0x01: return input_port_read(device->machine, "IN1");
164
case 0x02: return input_port_read(device->machine, "IN2");
165
case 0x04: return input_port_read(device->machine, "IN3");
166
case 0x08: return input_port_read(device->machine, "IN4");
167
case 0x10: return input_port_read(device->machine, "IN5");
168
case 0x20: return input_port_read(device->machine, "IN6");
172
//popmessage("%02x",mux_data);
176
static WRITE8_HANDLER( mux_w )
174
static WRITE8_DEVICE_HANDLER( mux_w )
178
176
int new_bank = (data&0xc0)>>6;
182
180
//0x14000 bonus game
184
182
if(bank!=new_bank) {
185
UINT8 *ROM = memory_region(space->machine, "maincpu");
183
UINT8 *ROM = memory_region(device->machine, "maincpu");
186
184
UINT32 bankaddress;
189
187
bankaddress = 0x10000 + 0x2000 * bank;
190
memory_set_bankptr(space->machine, 1, &ROM[bankaddress]);
188
memory_set_bankptr(device->machine, 1, &ROM[bankaddress]);
193
191
mux_data = data & ~0xc0;
196
static WRITE8_HANDLER( yumefuda_videoregs_w )
194
static WRITE8_DEVICE_HANDLER( yumefuda_output_w )
198
static UINT8 address;
206
case 0x0d: flip_screen_set(space->machine, data & 0x80); break;
208
logerror("Video Register %02x called with %02x data\n",address,data);
196
coin_counter_w(0,~data & 4);
197
coin_counter_w(1,~data & 2);
198
coin_lockout_global_w(data & 1);
199
//data & 0x10 hopper-c (active LOW)
200
//data & 0x08 divider (active HIGH)
201
flip_screen_set(device->machine, ~data & 0x20);
213
204
static const ay8910_interface ay8910_config =
216
207
AY8910_DEFAULT_LOADS,
217
208
DEVCB_INPUT_PORT("DSW1"),
218
209
DEVCB_INPUT_PORT("DSW2"),
210
DEVCB_HANDLER(yumefuda_output_w),
214
static const mc6845_interface mc6845_intf =
216
"screen", /* screen we are acting on */
217
8, /* number of pixels per video memory address */
218
NULL, /* before pixel update callback */
219
NULL, /* row update callback */
220
NULL, /* after pixel update callback */
221
DEVCB_NULL, /* callback for display state changes */
222
DEVCB_NULL, /* callback for cursor state changes */
223
DEVCB_NULL, /* HSYNC callback */
224
DEVCB_NULL, /* VSYNC callback */
225
NULL /* update address callback */
228
static const ppi8255_interface ppi8255_intf =
230
DEVCB_NULL, /* Port A read */
231
DEVCB_HANDLER(eeprom_r), /* Port B read */
232
DEVCB_HANDLER(mux_r), /* Port C read */
233
DEVCB_HANDLER(mux_w), /* Port A write */
234
DEVCB_NULL, /* Port B write */
235
DEVCB_NULL /* Port C write */
223
238
/***************************************************************************************/
225
240
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
238
253
static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 )
239
254
ADDRESS_MAP_GLOBAL_MASK(0xff)
240
AM_RANGE(0x00, 0x01) AM_WRITE(yumefuda_videoregs_w) // HD46505SP video registers
255
AM_RANGE(0x00, 0x00) AM_DEVWRITE("crtc", mc6845_address_w)
256
AM_RANGE(0x01, 0x01) AM_DEVWRITE("crtc", mc6845_register_w)
241
257
AM_RANGE(0x40, 0x40) AM_DEVREAD("ay", ay8910_r)
242
258
AM_RANGE(0x40, 0x41) AM_DEVWRITE("ay", ay8910_address_data_w)
243
AM_RANGE(0x80, 0x80) AM_WRITE(mux_w)
244
AM_RANGE(0x81, 0x81) AM_READ(eeprom_r)
245
AM_RANGE(0x82, 0x82) AM_READ(mux_r)
246
AM_RANGE(0xc0, 0xc0) AM_WRITE(port_c0_w) // video timing
259
AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)
260
AM_RANGE(0xc0, 0xc0) AM_WRITE(watchdog_reset_w)
249
263
static MACHINE_RESET( yumefuda )
289
309
/***************************************************************************************/
291
311
static INPUT_PORTS_START( yumefuda )
313
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset SW") //doesn't work?
314
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Meter SW")
315
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
316
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Coin Out")
317
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out")
318
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Init SW")
319
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) //eeprom read bit
320
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
293
323
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Flip-Flop") PORT_CODE(KEYCODE_F)
294
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Coupon Credit") PORT_CODE(KEYCODE_7) PORT_IMPULSE(2) //coupon
295
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Note Credit") PORT_CODE(KEYCODE_6) PORT_IMPULSE(2) //note
324
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Coupon") PORT_IMPULSE(2) //coupon
325
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note") PORT_IMPULSE(2) //note
296
326
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
297
327
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
300
330
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
301
331
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button 1") PORT_CODE(KEYCODE_Z) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
302
332
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button 2") PORT_CODE(KEYCODE_X) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
307
337
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
308
338
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
311
341
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
312
342
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Button 5") PORT_CODE(KEYCODE_B) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
313
343
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P1 No Button") PORT_CODE(KEYCODE_A) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
318
348
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button 1") PORT_CODE(KEYCODE_Z) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
319
349
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Button 4") PORT_CODE(KEYCODE_V) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
322
352
PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
323
353
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
324
354
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_2) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
326
356
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Button 5") PORT_CODE(KEYCODE_B) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
328
358
/* Some bits of these three are actually used if you use the Royal Panel type */
330
360
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
333
363
PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
334
364
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
335
365
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
336
366
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P1 No Button") PORT_CODE(KEYCODE_A) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
337
367
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 Yes Button") PORT_CODE(KEYCODE_Q) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
340
370
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
342
372
/*Unused,on the PCB there's just one bank*/
344
374
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
346
376
/*Added by translating the manual*/
348
378
PORT_DIPNAME( 0x01, 0x01, "Learn Mode" )//SW Dip-Switches
349
379
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
350
380
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
351
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Service_Mode ) )
352
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
353
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
381
PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
354
382
PORT_DIPNAME( 0x04, 0x04, "Hopper Payout" )
355
383
PORT_DIPSETTING( 0x04, "Hanafuda Type" )//hanaawase
356
384
PORT_DIPSETTING( 0x00, "Royal Type" )
357
PORT_DIPNAME( 0x08, 0x08, "Panel Type" )
358
PORT_DIPSETTING( 0x08, "Hanafuda Panel" )//hanaawase
359
PORT_DIPSETTING( 0x00, "Royal Panel" )
360
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
361
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
362
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
363
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
364
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
365
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
366
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Flip_Screen ) )//Screen Orientation
367
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
368
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
369
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )//Screen Flip
370
PORT_DIPSETTING( 0x80, DEF_STR( Upright ) )
371
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )//pressing Flip-Flop button makes the screen flip
385
PORT_DIPNAME( 0x08, 0x08, "Panel Type" )
386
PORT_DIPSETTING( 0x08, "Hanafuda Panel" )//hanaawase
387
PORT_DIPSETTING( 0x00, "Royal Panel" )
388
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
389
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
390
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
391
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
392
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
393
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
394
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )//Screen Orientation
395
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
396
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
397
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )//Screen Flip
398
PORT_DIPSETTING( 0x80, DEF_STR( Upright ) )
399
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )//pressing Flip-Flop button makes the screen flip
374
402
/***************************************************************************************/