From ddfa89f822f821580dc96b3ab172537693dfa00c Mon Sep 17 00:00:00 2001 From: Luca Elia Date: Tue, 24 Nov 2009 22:24:15 +0000 Subject: [PATCH] Added sprites list stop to igs017.c. Implemented joystick mode in mgdh and sdmg2 [Luca Elia] --- src/mame/drivers/igs011.c | 2 +- src/mame/drivers/igs017.c | 78 ++++++++++++++++++++++++++++++--------- 2 files changed, 62 insertions(+), 18 deletions(-) diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c index 4856c484005..874979aff37 100644 --- a/src/mame/drivers/igs011.c +++ b/src/mame/drivers/igs011.c @@ -3621,7 +3621,7 @@ GAME( 1996, xymg, 0, xymg, xymg, xymg, ROT0, "IG GAME( 1996, wlcc, xymg, wlcc, wlcc, wlcc, ROT0, "IGS", "Wan Li Chang Cheng (China, V638C)", 0 ) GAME( 1996, vbowl, 0, vbowl, vbowl, vbowl, ROT0, "IGS", "Virtua Bowling (World, V101XCM)", GAME_IMPERFECT_SOUND ) GAME( 1996, vbowlj, vbowl, vbowl, vbowlj, vbowlj, ROT0, "IGS / Alta", "Virtua Bowling (Japan, V100JCM)", GAME_IMPERFECT_SOUND ) -GAME( 1998, nkishusp, 0, lhb2, lhb2, nkishusp, ROT0, "IGS / Alta", "Mahjong Nenrikishu SP", 0 ) +GAME( 1998, nkishusp, lhb2, lhb2, lhb2, nkishusp, ROT0, "IGS / Alta", "Mahjong Nenrikishu SP", GAME_NOT_WORKING ) GAME( 1997, drgnwrld, 0, drgnwrld, drgnwrld, drgnwrld, ROT0, "IGS", "Dragon World (World, V040O)", 0 ) GAME( 1995, drgnwrldv30, drgnwrld, drgnwrld, drgnwrld, drgnwrldv30, ROT0, "IGS", "Dragon World (World, V030O)", 0 ) diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c index 9cb6fb5594e..808e3355aee 100644 --- a/src/mame/drivers/igs017.c +++ b/src/mame/drivers/igs017.c @@ -250,6 +250,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan sx = (x & 0x1ff) - (x & 0x200); sy = (y & 0x1ff) - (y & 0x200); + // sprites list stop (used by mgdh & sdmg2 during don den) + if (sy == -0x200) + break; + color = (s[7] & 0xe0) >> 5; draw_sprite(machine, bitmap, cliprect, sx, sy, dimx, dimy, flipx, flipy, color, addr); @@ -1254,6 +1258,8 @@ static READ8_HANDLER( sdmg2_keys_r ) if (~input_select & 0x08) return input_port_read(space->machine, "KEY3"); if (~input_select & 0x10) return input_port_read(space->machine, "KEY4"); + if (input_select == 0x1f) return input_port_read(space->machine, "KEY0"); // in joystick mode + logerror("%s: warning, reading key with input_select = %02x\n", cpuexec_describe_context(space->machine), input_select); return 0xff; } @@ -1398,6 +1404,9 @@ static READ16_HANDLER( mgdh_magic_r ) case 0x00: return mgdh_keys_r(space, 0); + case 0x01: + return input_port_read(space->machine, "BUTTONS"); + case 0x02: return BITSWAP8(input_port_read(space->machine, "DSW2"), 0,1,2,3,4,5,6,7); @@ -1725,18 +1734,33 @@ static INPUT_PORTS_START( sdmg2 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) // shown in test mode + + // Keyboard mode: + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // shown in test mode + // Joystick mode: + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) 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_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + // Keyboard mode: + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) + // Joystick mode: + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) PORT_START("KEY1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) @@ -1842,14 +1866,24 @@ static INPUT_PORTS_START( mgdh ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) 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_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + // Keyboard mode: + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02) + // Joystick mode: + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00) PORT_START("KEY1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) @@ -1891,6 +1925,16 @@ static INPUT_PORTS_START( mgdh ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_START("BUTTONS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) + INPUT_PORTS_END