diff --git a/src/mame/drivers/20pacgal.c b/src/mame/drivers/20pacgal.c index 4b982ca348d..e2d276a919c 100644 --- a/src/mame/drivers/20pacgal.c +++ b/src/mame/drivers/20pacgal.c @@ -43,7 +43,6 @@ #include "20pacgal.h" - /************************************* * * Clocks @@ -106,29 +105,6 @@ static const eeprom_interface _20pacgal_eeprom_intf = }; -static READ8_DEVICE_HANDLER( eeprom_r ) -{ - _20pacgal_state *state = (_20pacgal_state *)device->machine->driver_data; - - /* bit 7 is EEPROM data */ - return eepromdev_read_bit(state->eeprom) << 7; -} - - -static WRITE8_DEVICE_HANDLER( eeprom_w ) -{ - _20pacgal_state *state = (_20pacgal_state *)device->machine->driver_data; - - /* bit 7 is data */ - /* bit 6 is clock (active high) */ - /* bit 5 is cs (active low) */ - eepromdev_write_bit(state->eeprom, data & 0x80); - eepromdev_set_cs_line(state->eeprom, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); - eepromdev_set_clock_line(state->eeprom, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); -} - - - /************************************* * * Coin counter @@ -219,7 +195,7 @@ static ADDRESS_MAP_START( 20pacgal_io_map, ADDRESS_SPACE_IO, 8 ) AM_RANGE(0x81, 0x81) AM_WRITENOP /* ??? pulsed by the timer irq */ AM_RANGE(0x82, 0x82) AM_WRITE(irqack_w) AM_RANGE(0x85, 0x86) AM_WRITENOP /* stars: rng seed (lo/hi) */ - AM_RANGE(0x87, 0x87) AM_DEVREADWRITE("eeprom", eeprom_r, eeprom_w) + AM_RANGE(0x87, 0x87) AM_READ_PORT("EEPROMIN") AM_WRITE_PORT("EEPROMOUT") AM_RANGE(0x88, 0x88) AM_WRITE(rom_bank_select_w) AM_RANGE(0x89, 0x89) AM_DEVWRITE("dac", dac_signed_w) AM_RANGE(0x8a, 0x8a) AM_WRITENOP /* stars: bits 3-4 = active set; bit 5 = enable */ @@ -265,6 +241,14 @@ static INPUT_PORTS_START( 20pacgal ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) + + PORT_START( "EEPROMIN" ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit) /* bit 7 is EEPROM data */ + + PORT_START( "EEPROMOUT" ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line) /* bit 5 is cs (active low) */ + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line) /* bit 6 is clock (active high) */ + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit) /* bit 7 is data */ INPUT_PORTS_END @@ -278,16 +262,12 @@ INPUT_PORTS_END static MACHINE_START( 20pacgal ) { _20pacgal_state *state = (_20pacgal_state *)machine->driver_data; - - state->eeprom = devtag_get_device(machine, "eeprom"); - state_save_register_global(machine, state->game_selected); } static MACHINE_RESET( 20pacgal ) { _20pacgal_state *state = (_20pacgal_state *)machine->driver_data; - state->game_selected = 0; } diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c index bfd45c924ea..5ac5a009880 100644 --- a/src/mame/drivers/albazg.c +++ b/src/mame/drivers/albazg.c @@ -78,9 +78,6 @@ struct _albazg_state UINT8 mux_data; int bank; UINT8 prot_lock; - - /* devices */ - const device_config *eeprom; }; @@ -169,21 +166,6 @@ static WRITE8_HANDLER( prot_lock_w ) state->prot_lock = data; } -static WRITE8_HANDLER( eeprom_w ) -{ - albazg_state *state = (albazg_state *)space->machine->driver_data; - eepromdev_write_bit(state->eeprom, data & 0x04); - eepromdev_set_cs_line(state->eeprom, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); - eepromdev_set_clock_line(state->eeprom, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE); -} - - -static READ8_DEVICE_HANDLER( eeprom_r ) -{ - albazg_state *state = (albazg_state *)device->machine->driver_data; - return ((~eepromdev_read_bit(state->eeprom) & 0x01) << 6) | (input_port_read(device->machine, "SYSTEM") & ~0x40); -} - static READ8_DEVICE_HANDLER( mux_r ) { albazg_state *state = (albazg_state *)device->machine->driver_data; @@ -255,8 +237,8 @@ static const mc6845_interface mc6845_intf = static const ppi8255_interface ppi8255_intf = { - DEVCB_NULL, /* Port A read */ - DEVCB_HANDLER(eeprom_r), /* Port B read */ + DEVCB_NULL, /* Port A read */ + DEVCB_INPUT_PORT("SYSTEM"), /* Port B read */ DEVCB_HANDLER(mux_r), /* Port C read */ DEVCB_HANDLER(mux_w), /* Port A write */ DEVCB_NULL, /* Port B write */ @@ -269,7 +251,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x9fff) AM_ROMBANK(1) AM_RANGE(0xa7fc, 0xa7fc) AM_WRITE(prot_lock_w) - AM_RANGE(0xa7ff, 0xa7ff) AM_WRITE(eeprom_w) + AM_RANGE(0xa7ff, 0xa7ff) AM_WRITE_PORT("EEPROMOUT") AM_RANGE(0xaf80, 0xafff) AM_READWRITE(custom_ram_r, custom_ram_w) AM_BASE_MEMBER(albazg_state, cus_ram) AM_RANGE(0xb000, 0xb07f) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_split1_w) AM_BASE(&paletteram) AM_RANGE(0xb080, 0xb0ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_split2_w) AM_BASE(&paletteram_2) @@ -288,6 +270,106 @@ static ADDRESS_MAP_START( port_map, ADDRESS_SPACE_IO, 8 ) AM_RANGE(0xc0, 0xc0) AM_WRITE(watchdog_reset_w) ADDRESS_MAP_END +/***************************************************************************************/ + +static INPUT_PORTS_START( yumefuda ) + PORT_START("SYSTEM") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset SW") //doesn't work? + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Meter SW") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Coin Out") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Init SW") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Flip-Flop") PORT_CODE(KEYCODE_Y) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Coupon") PORT_IMPULSE(2) //coupon + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note") PORT_IMPULSE(2) //note + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN1") + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + + PORT_START("IN2") + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + + PORT_START("IN3") + PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + + /* Some bits of these three are actually used if you use the Royal Panel type */ + PORT_START("IN4") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN5") + PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) + + PORT_START("IN6") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START( "EEPROMOUT" ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit) + + /* Unused, on the PCB there's just one bank */ + PORT_START("DSW1") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + /*Added by translating the manual*/ + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Learn Mode" )//SW Dip-Switches + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_SERVICE( 0x02, IP_ACTIVE_LOW ) + PORT_DIPNAME( 0x04, 0x04, "Hopper Payout" ) + PORT_DIPSETTING( 0x04, "Hanafuda Type" )//hanaawase + PORT_DIPSETTING( 0x00, "Royal Type" ) + PORT_DIPNAME( 0x08, 0x08, "Panel Type" ) + PORT_DIPSETTING( 0x08, "Hanafuda Panel" )//hanaawase + PORT_DIPSETTING( 0x00, "Royal Panel" ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )//Screen Orientation + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )//Screen Flip + PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )//pressing Flip-Flop button makes the screen flip +INPUT_PORTS_END + +/***************************************************************************************/ + static MACHINE_START( yumefuda ) { albazg_state *state = (albazg_state *)machine->driver_data; @@ -295,8 +377,6 @@ static MACHINE_START( yumefuda ) memory_configure_bank(machine, 1, 0, 4, &ROM[0x10000], 0x2000); - state->eeprom = devtag_get_device(machine, "eeprom"); - state_save_register_global(machine, state->mux_data); state_save_register_global(machine, state->bank); state_save_register_global(machine, state->prot_lock); @@ -356,99 +436,6 @@ MACHINE_DRIVER_END /***************************************************************************************/ -static INPUT_PORTS_START( yumefuda ) - PORT_START("SYSTEM") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset SW") //doesn't work? - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Meter SW") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Coin Out") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Init SW") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) //eeprom read bit - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Flip-Flop") PORT_CODE(KEYCODE_Y) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Coupon") PORT_IMPULSE(2) //coupon - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note") PORT_IMPULSE(2) //note - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) - PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN1") - PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - - PORT_START("IN2") - PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - - PORT_START("IN3") - PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - - /* Some bits of these three are actually used if you use the Royal Panel type */ - PORT_START("IN4") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN5") - PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) - - PORT_START("IN6") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - /* Unused, on the PCB there's just one bank */ - PORT_START("DSW1") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - /*Added by translating the manual*/ - PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Learn Mode" )//SW Dip-Switches - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_SERVICE( 0x02, IP_ACTIVE_LOW ) - PORT_DIPNAME( 0x04, 0x04, "Hopper Payout" ) - PORT_DIPSETTING( 0x04, "Hanafuda Type" )//hanaawase - PORT_DIPSETTING( 0x00, "Royal Type" ) - PORT_DIPNAME( 0x08, 0x08, "Panel Type" ) - PORT_DIPSETTING( 0x08, "Hanafuda Panel" )//hanaawase - PORT_DIPSETTING( 0x00, "Royal Panel" ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )//Screen Orientation - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )//Screen Flip - PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )//pressing Flip-Flop button makes the screen flip -INPUT_PORTS_END - -/***************************************************************************************/ - ROM_START( yumefuda ) ROM_REGION( 0x18000, "maincpu", 0 ) /* code */ diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c index 189b98a73a2..a05c8d52605 100644 --- a/src/mame/drivers/astrocorp.c +++ b/src/mame/drivers/astrocorp.c @@ -25,9 +25,6 @@ struct _astrocrp_state /* video-related */ UINT16 screen_enable; - - /* devices */ - const device_config *eeprom; }; @@ -109,27 +106,12 @@ static VIDEO_UPDATE(astrocorp) Memory Maps ***************************************************************************/ -static READ16_HANDLER( astrocorp_eeprom_r ) -{ - astrocrp_state *state = (astrocrp_state *)space->machine->driver_data; - - return 0xfff7 | (eepromdev_read_bit(state->eeprom) << 3); -} static WRITE16_HANDLER( astrocorp_eeprom_w ) { - astrocrp_state *state = (astrocrp_state *)space->machine->driver_data; - if (ACCESSING_BITS_0_7) { - // latch the bit - eepromdev_write_bit(state->eeprom, data & 0x01); - - // reset line asserted: reset. - eepromdev_set_cs_line(state->eeprom, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); - - // clock line asserted: write latch or select next bit to read - eepromdev_set_clock_line(state->eeprom, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE); + input_port_write(space->machine, "EEPROMOUT", data, 0xff); } } @@ -195,7 +177,7 @@ static ADDRESS_MAP_START( showhand_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE( 0x054000, 0x054001 ) AM_READ_PORT("INPUTS") AM_RANGE( 0x058000, 0x058001 ) AM_WRITE(astrocorp_eeprom_w) AM_RANGE( 0x05a000, 0x05a001 ) AM_WRITE(astrocorp_outputs_w) - AM_RANGE( 0x05e000, 0x05e001 ) AM_READ(astrocorp_eeprom_r) + AM_RANGE( 0x05e000, 0x05e001 ) AM_READ_PORT("EEPROMIN") AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_BASE_MEMBER(astrocrp_state, paletteram16) AM_RANGE( 0x070000, 0x073fff ) AM_RAM AM_RANGE( 0x080000, 0x080001 ) AM_DEVWRITE("oki", astrocorp_sound_bank_w) @@ -212,7 +194,7 @@ static ADDRESS_MAP_START( showhanc_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE( 0x084000, 0x084001 ) AM_READ_PORT("INPUTS") AM_RANGE( 0x088000, 0x088001 ) AM_WRITE(astrocorp_eeprom_w) AM_RANGE( 0x08a000, 0x08a001 ) AM_WRITE(astrocorp_outputs_w) - AM_RANGE( 0x08e000, 0x08e001 ) AM_READ(astrocorp_eeprom_r) + AM_RANGE( 0x08e000, 0x08e001 ) AM_READ_PORT("EEPROMIN") AM_RANGE( 0x090000, 0x093fff ) AM_RAM AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE(astrocorp_enable_w) AM_RANGE( 0x0e0000, 0x0e0001 ) AM_READ(astrocorp_unk_r) AM_DEVWRITE8("oki", okim6295_w, 0xff00) @@ -240,6 +222,15 @@ static INPUT_PORTS_START( showhand ) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ? PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN2 ) // key in PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SPECIAL ) // coin sensor + + PORT_START( "EEPROMIN" ) + PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit) + + PORT_START( "EEPROMOUT" ) + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line) INPUT_PORTS_END static INPUT_PORTS_START( showhanc ) @@ -260,6 +251,15 @@ static INPUT_PORTS_START( showhanc ) PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL ) // must be 0 for inputs to work PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) // key in (shows an error) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START( "EEPROMIN" ) + PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("eeprom", eepromdev_read_bit) + + PORT_START( "EEPROMOUT" ) + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_write_bit) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_clock_line) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eepromdev_set_cs_line) INPUT_PORTS_END /*************************************************************************** @@ -289,16 +289,12 @@ GFXDECODE_END static MACHINE_START( showhand ) { astrocrp_state *state = (astrocrp_state *)machine->driver_data; - - state->eeprom = devtag_get_device(machine, "eeprom"); - state_save_register_global(machine, state->screen_enable); } static MACHINE_RESET( showhand ) { astrocrp_state *state = (astrocrp_state *)machine->driver_data; - state->screen_enable = 0; }