Skip to content

Commit 33966f3

Browse files
committed
proprly index players in 2 player variant
1 parent 5f335f8 commit 33966f3

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

src/mame/konami/bishi.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class bishi_state : public driver_device
119119
{ }
120120

121121
void bishi(machine_config &config);
122+
void bishi2p(machine_config &config);
122123

123124
protected:
124125
virtual void machine_start() override ATTR_COLD;
@@ -141,6 +142,7 @@ class bishi_state : public driver_device
141142
/* misc */
142143
uint16_t m_cur_control = 0U;
143144
uint16_t m_cur_control2 = 0U;
145+
bool m_is_2players = false;
144146

145147
/* video-related */
146148
uint16_t m_layer_colorbase[4]{};
@@ -238,12 +240,15 @@ void bishi_state::control2_w(offs_t offset, uint16_t data, uint16_t mem_mask)
238240
void bishi_state::lamp_w(offs_t offset, uint16_t data, uint16_t mem_mask)
239241
{
240242
uint16_t new_state = ~data & 0xfff;
241-
for (int i = 0; i < 3; i++)
243+
for (int lamp_index = 0, i = 0; i < 3; i++)
242244
{
243-
m_red_button_lamps[i] = (new_state >> (i * 3 + 0)) & 1;
244-
m_green_button_lamps[i] = (new_state >> (i * 3 + 1)) & 1;
245-
m_blue_button_lamps[i] = (new_state >> (i * 3 + 2)) & 1;
246-
m_start_button_lamps[i] = (new_state >> (i + 9)) & 1;
245+
// Only 1st and 3rd player in the 2 player variant.
246+
if (i == 1 && m_is_2players) continue;
247+
m_red_button_lamps[lamp_index] = (new_state >> (i * 3 + 0)) & 1;
248+
m_green_button_lamps[lamp_index] = (new_state >> (i * 3 + 1)) & 1;
249+
m_blue_button_lamps[lamp_index] = (new_state >> (i * 3 + 2)) & 1;
250+
m_start_button_lamps[lamp_index] = (new_state >> (i + 9)) & 1;
251+
lamp_index++;
247252
}
248253
}
249254

@@ -557,6 +562,12 @@ void bishi_state::bishi(machine_config &config)
557562
ymz.add_route(1, "speaker", 1.0, 1);
558563
}
559564

565+
void bishi_state::bishi2p(machine_config &config)
566+
{
567+
bishi(config);
568+
m_is_2players = true;
569+
}
570+
560571
// ROM definitions
561572

562573

@@ -648,6 +659,6 @@ ROM_END
648659
} // anonymous namespace
649660

650661
GAME( 1996, bishi, 0, bishi, bishi, bishi_state, empty_init, ROT0, "Konami", "Bishi Bashi Champ Mini Game Senshuken (ver JAA, 3 Players)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
651-
GAME( 1998, sbishi, 0, bishi, bishi2p, bishi_state, empty_init, ROT0, "Konami", "Super Bishi Bashi Champ (ver JAA, 2 Players)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
662+
GAME( 1998, sbishi, 0, bishi2p, bishi2p, bishi_state, empty_init, ROT0, "Konami", "Super Bishi Bashi Champ (ver JAA, 2 Players)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
652663
GAME( 1998, sbishik, sbishi, bishi, bishi, bishi_state, empty_init, ROT0, "Konami", "Super Bishi Bashi Champ (ver KAB, 3 Players)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
653664
GAME( 1998, sbishika, sbishi, bishi, bishi, bishi_state, empty_init, ROT0, "Konami", "Super Bishi Bashi Champ (ver KAA, 3 Players)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )

0 commit comments

Comments
 (0)