From ce4d549672db2f19c93512769b5c746f5c2d7521 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 29 Jan 2009 08:48:46 +0000 Subject: [PATCH] From: Fabio Priuli [doge.fabio@gmail.com] Sent: Friday, January 23, 2009 8:44 AM To: submit Subject: two more bugfixes Hi, enclosed please find fixes for the following bugs in MT * 2697.diff : this fixes MT02697, i.e. the wrong input mappings of hkagerou. Basically, this game has a dip to choose between an hanafuda & a mahjong panel, but this switch only changes the onscreen indicators (1->6 vs. A->F). Actual input bits are the same in both configurations. Previous mapping was using mahjong inputs for P2 inputs and keys in the numpad for P1 inputs. With this patch, it will only use the default mahjong keys for both players (but in the UI menu, I put also the hanafuda label to help users) * arka.diff : this fixes MT02719 (which I introduced with my changes in MAME 0.126u5), making a few bootlegs working again. Regards, Fabio Priuli --- src/mame/drivers/ddenlovr.c | 107 ++++++++++++++++++------------------ src/mame/machine/arkanoid.c | 8 +-- 2 files changed, 57 insertions(+), 58 deletions(-) diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c index ef077710b8b..1ec78457927 100644 --- a/src/mame/drivers/ddenlovr.c +++ b/src/mame/drivers/ddenlovr.c @@ -4435,96 +4435,95 @@ INPUT_PORTS_END static INPUT_PORTS_START( hkagerou ) - PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) // Test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) // data clear - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // note + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // note PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) // A - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) // E - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // I - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME(DEF_STR(Yes)) PORT_CODE(KEYCODE_Y) // M - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Kan + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_NAME("P2 1 (Hanafuda) / P2 A (Mahjong)") PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_NAME("P2 5 (Hanafuda) / P2 E (Mahjong)") PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 I (not used) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Yes") // P2 M + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 Kan (not used) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) // B - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) // F - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // J - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME(DEF_STR(No)) PORT_CODE(KEYCODE_N) // N - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Reach - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) // BET + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_NAME("P2 2 (Hanafuda) / P2 B (Mahjong)") PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_NAME("P2 6 (Hanafuda) / P2 F (Mahjong)") PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 J (not used) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 No") // P2 N + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 Reach (not used) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) // P2 BET PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) // C - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) // G - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // K - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Chi - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Ron + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_NAME("P2 3 (Hanafuda) / P2 C (Mahjong)") PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 G (not used) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 K (not used) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 Chi (not used) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 Ron (not used) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) // D - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) // H - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // L - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PON + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_NAME("P2 4 (Hanafuda) / P2 D (Mahjong)") PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 H (not used) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 L (not used) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P2 PON (not used) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) // "t" - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) // "w" - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2) // Flip Flop - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2) // "b" - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) // "s" + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) // P2 ?? (not used) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) // P2 t (Take) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) // P2 w (W.Up) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2) // P2 f (Flip Flop) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2) // P2 b (Big) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) // P2 s (Small) PORT_START("KEY5") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1") PORT_CODE(KEYCODE_1_PAD) // A - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("5") PORT_CODE(KEYCODE_5_PAD) // E - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // I - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME(DEF_STR(Yes)) PORT_CODE(KEYCODE_ENTER_PAD) // M - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) // "t" + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_NAME("P1 1 (Hanafuda) / P1 A (Mahjong)") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_NAME("P1 5 (Hanafuda) / P1 E (Mahjong)") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 I (not used) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Yes") PORT_CODE(KEYCODE_Y) // P1 M + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 Kan (not used) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_START("KEY6") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2") PORT_CODE(KEYCODE_2_PAD) // B - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("6") PORT_CODE(KEYCODE_6_PAD) // F - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // J - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME(DEF_STR(No)) PORT_CODE(KEYCODE_DEL_PAD) // N - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) // "s" - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) // BET + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_NAME("P1 2 (Hanafuda) / P1 B (Mahjong)") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_NAME("P1 6 (Hanafuda) / P1 F (Mahjong)") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 J (not used) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 No") PORT_CODE(KEYCODE_N) // P1 N + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 Reach (not used) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) // P1 BET PORT_START("KEY7") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3") PORT_CODE(KEYCODE_3_PAD) // C - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("7") PORT_CODE(KEYCODE_7_PAD) // G - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // K - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) // "b" - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Ron + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_NAME("P1 3 (Hanafuda) / P1 C (Mahjong)") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 G (not used) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 K (not used) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 Chi (not used) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 Ron (not used) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("KEY8") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("4") PORT_CODE(KEYCODE_4_PAD) // D - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("8") PORT_CODE(KEYCODE_8_PAD) // H - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // L - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) // "w" + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_NAME("P1 4 (Hanafuda) / P1 D (Mahjong)") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 H (not used) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 L (not used) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // P1 PON (not used) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("KEY9") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) // "t" - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) // "w" - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) // Flip Flop - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) // "b" - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) // "s" + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN) // P1 ?? (not used) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) // P1 t (Take) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) // P1 w (W.Up) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) // P1 f (Flip Flop) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) // P1 b (Big) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) // P1 s (Small) PORT_START("DSW1") PORT_DIPNAME( 0x07, 0x07, "Unknown 1-0&1&2" ) diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c index a67011a3da2..ddaed96eaa2 100644 --- a/src/mame/machine/arkanoid.c +++ b/src/mame/machine/arkanoid.c @@ -16,12 +16,11 @@ UINT8 arkanoid_paddle_select; -static UINT8 arkanoid_paddle_value; -static UINT8 z80write,fromz80,m68705write,toz80; +static UINT8 z80write, fromz80, m68705write, toz80; -static UINT8 portA_in,portA_out,ddrA; -static UINT8 portC_out,ddrC; +static UINT8 portA_in, portA_out, ddrA; +static UINT8 portC_out, ddrC; MACHINE_START( arkanoid ) @@ -519,6 +518,7 @@ READ8_HANDLER( arkanoid_bootleg_d008_r ) { UINT8 arkanoid_bootleg_d008_bit[8]; UINT8 arkanoid_bootleg_d008_val; + UINT8 arkanoid_paddle_value = input_port_read(space->machine, "MUX"); int b; arkanoid_bootleg_d008_bit[4] = arkanoid_bootleg_d008_bit[6] = arkanoid_bootleg_d008_bit[7] = 0; /* untested bits */