From f6ef599f4d95f2129e53ad0d4a4967f38c8c3dcc Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Tue, 7 Oct 2008 21:26:39 +0000 Subject: [PATCH] There's a regression bug in Sengoku Mahjong that doesn't make the controls work from when the V30 CPU core has been converted to 16-bit.Specifically,the game accesses the multiplexer with a word write instead of a byte write.This snippet will fix it. --- src/mame/drivers/sengokmj.c | 103 +++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/src/mame/drivers/sengokmj.c b/src/mame/drivers/sengokmj.c index 757bcef7a10..6dd863c7c0b 100644 --- a/src/mame/drivers/sengokmj.c +++ b/src/mame/drivers/sengokmj.c @@ -67,12 +67,12 @@ static READ16_HANDLER( mahjong_panel_r ) { switch(sengokumj_mux_data) { - case 1: return input_port_read(machine, "KEY0"); - case 2: return input_port_read(machine, "KEY1"); - case 4: return input_port_read(machine, "KEY2"); - case 8: return input_port_read(machine, "KEY3"); - case 0x10: return input_port_read(machine, "KEY4"); - case 0x20: return input_port_read(machine, "UNUSED"); + case 0x0100: return input_port_read(machine, "KEY0"); + case 0x0200: return input_port_read(machine, "KEY1"); + case 0x0400: return input_port_read(machine, "KEY2"); + case 0x0800: return input_port_read(machine, "KEY3"); + case 0x1000: return input_port_read(machine, "KEY4"); + case 0x2000: return input_port_read(machine, "UNUSED"); } return 0xffff; @@ -80,8 +80,7 @@ static READ16_HANDLER( mahjong_panel_r ) static WRITE16_HANDLER( mahjong_panel_w ) { - if (ACCESSING_BITS_8_15) - sengokumj_mux_data = data >> 8; + sengokumj_mux_data = data; } static WRITE16_HANDLER( sengokmj_out_w ) @@ -167,57 +166,63 @@ static INPUT_PORTS_START( sengokmj ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("UNUSED") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("DSW2") PORT_DIPNAME( 0x0001, 0x0001, "Door" )