diff --git a/src/mame/drivers/mexico86.cpp b/src/mame/drivers/mexico86.cpp index 70487d512c4..653706138b3 100644 --- a/src/mame/drivers/mexico86.cpp +++ b/src/mame/drivers/mexico86.cpp @@ -21,7 +21,7 @@ Notes: - kicknrun does a PS4 STOP ERROR shortly after boot, but works afterwards. PS4 is the MC6801U4 mcu. -- Kiki Kaikai suffers from random lock-up's. It happens when the sound +- Kiki Kaikai suffers from random lock-ups. It happens when the sound CPU misses CTS from YM2203. The processor will loop infinitely and the main CPU will in turn wait forever. It's difficult to meet the required level of synchronization. This is kludged by filtering the 2203's busy signal. @@ -35,9 +35,6 @@ Notes: figure it all out. Indeed, the 68705 code reads all the memory locations related to the missing collision detection, but does nothing with them. -- In the KiKi KaiKai MCU simulation, I don't bother supporting the coinage dip - switch settings. Therefore, it's hardwired to be 1 coin / 1 credit. - - Kick and Run is a rom swap for Kiki KaiKai as the pal chips are all A85-0x A85 is the Taito rom code for Kiki KaiKai. Even the MCU is socketed! @@ -224,8 +221,7 @@ static INPUT_PORTS_START( mexico86 ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("IN3") - /* the following is actually service coin 1 */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Advance") PORT_CODE(KEYCODE_F1) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) @@ -283,8 +279,8 @@ static INPUT_PORTS_START( kikikai ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // Ofuda in service mode + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) // Oharai PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -293,8 +289,8 @@ static INPUT_PORTS_START( kikikai ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -359,7 +355,7 @@ static INPUT_PORTS_START( kikikai ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("IN3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) @@ -417,7 +413,8 @@ void mexico86_state::machine_start() save_item(NAME(m_mcu_running)); save_item(NAME(m_mcu_initialised)); save_item(NAME(m_coin_last)); - + save_item(NAME(m_coin_fract)); + save_item(NAME(m_charbank)); } @@ -438,7 +435,9 @@ void mexico86_state::machine_reset() m_mcu_running = 0; m_mcu_initialised = 0; - m_coin_last = 0; + m_coin_last[0] = false; + m_coin_last[1] = false; + m_coin_fract = 0; m_charbank = 0; } diff --git a/src/mame/drivers/namcos1.cpp b/src/mame/drivers/namcos1.cpp index 7ffb0a192a8..00ec8e13b2a 100644 --- a/src/mame/drivers/namcos1.cpp +++ b/src/mame/drivers/namcos1.cpp @@ -30,7 +30,6 @@ Tank Force (c) 1991 Namco We are missing some alternate versions: - Alice In Wonderland (English version of Marchen Maze) - Face Off (6 sticks) -- Tank Force (4 players) @@ -2846,7 +2845,7 @@ GAME( 1988, wldcourt, 0, ns1, wldcourt, namcos1_state, wldcourt, ROT GAME( 1988, splatter, 0, ns1, splatter3,namcos1_state, splatter, ROT180, "Namco", "Splatter House (World, new version (SH3))", MACHINE_SUPPORTS_SAVE ) GAME( 1988, splatter2, splatter, ns1, splatter, namcos1_state, splatter, ROT180, "Namco", "Splatter House (World, old version (SH2))", MACHINE_SUPPORTS_SAVE ) GAME( 1988, splatterj, splatter, ns1, splatter, namcos1_state, splatter, ROT180, "Namco", "Splatter House (Japan, SH1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, faceoff, 0, ns1, faceoff, namcos1_state, faceoff, ROT180, "Namco", "Face Off (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, faceoff, 0, ns1, faceoff, namcos1_state, faceoff, ROT180, "Namco", "Face Off (Japan 2 Players)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, rompers, 0, ns1, ns1, namcos1_state, rompers, ROT90, "Namco", "Rompers (Japan, new version (Rev B))", MACHINE_SUPPORTS_SAVE ) GAME( 1989, romperso, rompers, ns1, ns1, namcos1_state, rompers, ROT90, "Namco", "Rompers (Japan, old version)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, blastoff, 0, ns1, ns1, namcos1_state, blastoff, ROT90, "Namco", "Blast Off (Japan)", MACHINE_SUPPORTS_SAVE ) @@ -2857,6 +2856,6 @@ GAME( 1990, pistoldm, 0, ns1, ns1, namcos1_state, pistoldm, ROT GAME( 1990, boxyboy, 0, ns1, boxyboy, namcos1_state, soukobdx, ROT0, "Namco", "Boxy Boy (SB?)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, soukobdx, boxyboy, ns1, boxyboy, namcos1_state, soukobdx, ROT0, "Namco", "Souko Ban Deluxe (Japan, SB1)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, puzlclub, 0, ns1, puzlclub, namcos1_state, puzlclub, ROT90, "Namco", "Puzzle Club (Japan prototype)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, tankfrce, 0, ns1, ns1, namcos1_state, tankfrce, ROT0, "Namco", "Tank Force (US, 2 Player)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, tankfrce4, tankfrce, ns1, tankfrc4, namcos1_state, tankfrc4, ROT0, "Namco", "Tank Force (US, 4 Player)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, tankfrce, 0, ns1, ns1, namcos1_state, tankfrce, ROT0, "Namco", "Tank Force (US, 2 Players)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, tankfrce4, tankfrce, ns1, tankfrc4, namcos1_state, tankfrc4, ROT0, "Namco", "Tank Force (US, 4 Players)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, tankfrcej, tankfrce, ns1, ns1, namcos1_state, tankfrce, ROT0, "Namco", "Tank Force (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/mexico86.h b/src/mame/includes/mexico86.h index 7083c202795..c9f14bda666 100644 --- a/src/mame/includes/mexico86.h +++ b/src/mame/includes/mexico86.h @@ -41,7 +41,8 @@ public: /* kikikai mcu simulation */ int m_mcu_running; int m_mcu_initialised; - int m_coin_last; + bool m_coin_last[2]; + UINT8 m_coin_fract; /* devices */ required_device m_maincpu; @@ -73,4 +74,5 @@ public: INTERRUPT_GEN_MEMBER(kikikai_interrupt); INTERRUPT_GEN_MEMBER(mexico86_m68705_interrupt); void mcu_simulate( ); + bool mcu_coin_counter_w(bool condition); }; diff --git a/src/mame/machine/mexico86.cpp b/src/mame/machine/mexico86.cpp index dfffcf83b6a..a83e9131623 100644 --- a/src/mame/machine/mexico86.cpp +++ b/src/mame/machine/mexico86.cpp @@ -64,17 +64,47 @@ void mexico86_state::mcu_simulate( ) if (m_mcu_initialised) { int i; - int coin_curr; - - coin_curr = ~ioport("IN0")->read() & 1; - if (coin_curr && !m_coin_last && m_protection_ram[0x01] < 9) + bool coin_curr; + UINT8 coin_in_read = ioport("IN0")->read() & 3; + + // TODO: still needs Coinage B into account + for(int coin_idx = 0; coin_idx < 2; coin_idx++) { - m_protection_ram[0x01]++; // increase credits counter - m_protection_ram[0x0a] = 0x01; // set flag (coin inserted sound is not played otherwise) - } - m_coin_last = coin_curr; + coin_curr = (coin_in_read & (1 << coin_idx)) == 0; + if (coin_curr && m_coin_last[coin_idx] == false) + { + UINT8 coinage_setting = (ioport("DSW0")->read() >> (coin_idx*2 + 4)) & 3; + + // increase credits counter + switch(coinage_setting) + { + case 0: // 2c / 3c + case 1: // 2c / 1c + if(m_coin_fract == 1) + { + m_protection_ram[0x01]+= (coinage_setting == 0) ? 3 : 1; + m_coin_fract = 0; + } + else + m_coin_fract ++; - m_protection_ram[0x04] = 0x3c; // coin inputs + break; + case 2: // 1c / 2c + case 3: // 1c / 1c + m_protection_ram[0x01]+= (coinage_setting == 2) ? 2 : 1; + break; + + } + + m_protection_ram[0x0a] = 0x01; // set flag (coin inserted sound is not played otherwise) + } + m_coin_last[coin_idx] = coin_curr; + } + // Purge any coin counter higher than 9 TODO: is this limit correct? + if(m_protection_ram[0x01] > 9) + m_protection_ram[0x01] = 9; + + m_protection_ram[0x04] = 0x3c | (coin_in_read ^ 3); // coin inputs m_protection_ram[0x02] = BITSWAP8(ioport("IN1")->read(), 7,6,5,4,2,3,1,0); // player 1 m_protection_ram[0x03] = BITSWAP8(ioport("IN2")->read(), 7,6,5,4,2,3,1,0); // player 2