Skip to content

Commit 619e0cf

Browse files
committed
nintendo/snesb.cpp: fill in missing DIP switches for several games, add continue counter init for Wild Guns
1 parent e092cb6 commit 619e0cf

File tree

2 files changed

+89
-68
lines changed

2 files changed

+89
-68
lines changed

Diff for: src/mame/nintendo/snes_m.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,8 @@ uint8_t snes_state::snes_r_bank1(offs_t offset)
727727
}
728728
else
729729
{
730-
logerror("(PC=%06x) snes_r_bank1: Unmapped external chip read: %X\n", m_maincpu->pc(), offset);
730+
if (!machine().side_effects_disabled())
731+
logerror("(PC=%06x) snes_r_bank1: Unmapped external chip read: %X\n", m_maincpu->pc(), offset);
731732
value = snes_open_bus_r(); /* Reserved */
732733
}
733734
}
@@ -774,7 +775,8 @@ uint8_t snes_state::snes_r_bank2(offs_t offset)
774775
}
775776
else
776777
{
777-
logerror("(PC=%06x) snes_r_bank2: Unmapped external chip read: %X\n", m_maincpu->pc(), offset);
778+
if (!machine().side_effects_disabled())
779+
logerror("(PC=%06x) snes_r_bank2: Unmapped external chip read: %X\n", m_maincpu->pc(), offset);
778780
value = snes_open_bus_r(); /* Reserved */
779781
}
780782
}

Diff for: src/mame/nintendo/snesb.cpp

+85-66
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,10 @@
2727
- kinstb : fix gfx glitches, missing texts
2828
- ffight2b : remove hack for starting credits (RAM - mainly 0x7eadce where credits are stored - is filled with 0x55,
2929
so you are awarded 55 credits on a hard reset)
30-
- sblast2b : dipswitches
3130
- sblast2b : pressing start during gameplay changes the character used. Intentional?
3231
- denseib,2: fix gfx glitches, missing texts
33-
- legendsb : unknown dipswitches
34-
- rushbets : dipswitches (stored at memory locations $785006 and $785008)
3532
- venom : gfx glitches on second level
36-
- wldgunsb : dipswitches
37-
- wldgunsb : sometimes continue counter doesn't start from '9', verify if protection is involved.
38-
- tmntmwb : dipswitches
33+
- wldgunsb : remove hack for continue counter (values at 0x781010 and 0x781012 are expected to be initialized on reset/boot)
3934
4035
***************************************************************************
4136
@@ -214,6 +209,7 @@ class snesb_state : public snes_state
214209
uint8_t tmntmwb_7132cc_r(offs_t offset);
215210

216211
DECLARE_MACHINE_RESET(ffight2b);
212+
DECLARE_MACHINE_RESET(wldgunsb);
217213
void snesb_map(address_map &map);
218214
void spc_map(address_map &map);
219215
void endless_map(address_map &map);
@@ -230,7 +226,9 @@ class snesb_state : public snes_state
230226
uint8_t snesb_state::prot_cnt_r()
231227
{
232228
// protection check
233-
return ++m_cnt;
229+
if (!machine().side_effects_disabled())
230+
m_cnt++;
231+
return m_cnt;
234232
}
235233

236234

@@ -359,8 +357,11 @@ void snesb_state::extrainp_map(address_map &map)
359357
snesb_map(map);
360358

361359
map(0x770071, 0x770071).portr("DSW1");
360+
map(0x770072, 0x770072).nopr();
362361
map(0x770073, 0x770073).portr("DSW2");
362+
map(0x770074, 0x770074).nopr();
363363
map(0x770079, 0x770079).portr("COIN");
364+
map(0x77007a, 0x77007a).nopr();
364365
}
365366

366367
void snesb_state::kinstb_map(address_map &map)
@@ -409,16 +410,13 @@ void snesb_state::venom_map(address_map &map)
409410

410411
void snesb_state::wldgunsb_map(address_map &map)
411412
{
412-
snesb_map(map);
413+
extrainp_map(map);
413414

414415
map(0x721197, 0x721197).r(FUNC(snesb_state::wldgunsb_721197_r));
415416
map(0x722262, 0x722262).r(FUNC(snesb_state::wldgunsb_722262_r));
416417
map(0x723363, 0x723363).r(FUNC(snesb_state::wldgunsb_723364_r));
417418
map(0x72443a, 0x72443a).r(FUNC(snesb_state::wldgunsb_72443a_r));
418419
map(0x72553b, 0x72553b).r(FUNC(snesb_state::wldgunsb_72553b_r));
419-
map(0x770071, 0x770071).portr("DSW1");
420-
map(0x770072, 0x770072).portr("DSW2");
421-
map(0x770079, 0x770079).portr("COIN");
422420
map(0x781000, 0x781021).ram().share(m_shared_ram[0]);
423421
map(0x7bf45b, 0x7bf45b).r(FUNC(snesb_state::prot_cnt_r));
424422
}
@@ -445,11 +443,7 @@ uint8_t snesb_state::tmntmwb_7010f1_r(offs_t offset)
445443

446444
void snesb_state::tmntmwb_map(address_map &map)
447445
{
448-
snesb_map(map);
449-
450-
map(0x770071, 0x770072).portr("DSW1");
451-
map(0x770073, 0x770074).portr("DSW2");
452-
map(0x770079, 0x770079).portr("COIN");
446+
extrainp_map(map);
453447

454448
map(0x7103cd, 0x7103ce).r(FUNC(snesb_state::tmntmwb_7103cd_r));
455449
map(0x7065f0, 0x7065f1).r(FUNC(snesb_state::tmntmwb_7065f0_r));
@@ -814,7 +808,7 @@ static INPUT_PORTS_START( endless )
814808
PORT_DIPSETTING( 0xc0, "99" ) // "LIMIT"
815809
PORT_DIPSETTING( 0x80, "60" ) // undefined
816810
PORT_DIPSETTING( 0x40, "30" ) // undefined
817-
PORT_DIPSETTING( 0x00, "Infinite" ) // "NO LIMIT"
811+
PORT_DIPSETTING( 0x00, DEF_STR( Infinite ) ) // "NO LIMIT"
818812

819813
PORT_START("DSW2")
820814
PORT_DIPUNUSED( 0x01, IP_ACTIVE_LOW )
@@ -831,7 +825,7 @@ static INPUT_PORTS_START( endless )
831825
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
832826
INPUT_PORTS_END
833827

834-
static INPUT_PORTS_START( rushbets )
828+
static INPUT_PORTS_START( legendsb )
835829
PORT_INCLUDE(snes_common)
836830

837831
PORT_START("DSW1")
@@ -844,20 +838,25 @@ static INPUT_PORTS_START( rushbets )
844838
PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
845839
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
846840
PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
847-
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Unknown ) )
848-
PORT_DIPSETTING( 0x38, "0" )
849-
PORT_DIPSETTING( 0x30, "1" )
850-
PORT_DIPSETTING( 0x28, "2" )
851-
PORT_DIPSETTING( 0x20, "2" )
852-
PORT_DIPSETTING( 0x18, "2" )
853-
PORT_DIPSETTING( 0x10, "2" )
854-
PORT_DIPSETTING( 0x08, "2" )
855-
PORT_DIPSETTING( 0x00, "2" )
856-
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Unknown ) )
857-
PORT_DIPSETTING( 0xc0, "0" )
858-
PORT_DIPSETTING( 0x80, "1" )
859-
PORT_DIPSETTING( 0x40, "2" )
860-
PORT_DIPSETTING( 0x00, "3" )
841+
PORT_DIPNAME( 0x38, 0x30, DEF_STR( Difficulty ) )
842+
PORT_DIPSETTING( 0x38, DEF_STR( Easy ))
843+
PORT_DIPSETTING( 0x30, DEF_STR( Normal ))
844+
PORT_DIPSETTING( 0x28, DEF_STR( Hard )) // all other values are equivalent to this
845+
PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) )
846+
PORT_DIPSETTING( 0xc0, "1" )
847+
PORT_DIPSETTING( 0x80, "2" )
848+
PORT_DIPSETTING( 0x40, "3" )
849+
PORT_DIPSETTING( 0x00, "4" )
850+
851+
PORT_START("DSW2")
852+
PORT_DIPUNUSED( 0x01, IP_ACTIVE_LOW )
853+
PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW )
854+
PORT_DIPUNUSED( 0x04, IP_ACTIVE_LOW )
855+
PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
856+
PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
857+
PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )
858+
PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
859+
PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
861860

862861
PORT_START("COIN")
863862
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -880,8 +879,11 @@ static INPUT_PORTS_START( venom )
880879
PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
881880
PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
882881
PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )
883-
PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
884-
PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
882+
PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) )
883+
PORT_DIPSETTING( 0xc0, "1" )
884+
PORT_DIPSETTING( 0x80, "2" )
885+
PORT_DIPSETTING( 0x40, "3" )
886+
PORT_DIPSETTING( 0x00, "4" )
885887

886888
PORT_START("DSW2")
887889
PORT_DIPUNUSED( 0x01, IP_ACTIVE_LOW )
@@ -923,7 +925,22 @@ static INPUT_PORTS_START( wldgunsb )
923925
PORT_INCLUDE( venom )
924926

925927
PORT_MODIFY("DSW1")
926-
PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) )
928+
PORT_DIPNAME( 0x38, 0x30, DEF_STR( Difficulty ) )
929+
PORT_DIPSETTING( 0x38, DEF_STR( Easy ))
930+
PORT_DIPSETTING( 0x30, DEF_STR( Normal ))
931+
PORT_DIPSETTING( 0x28, DEF_STR( Hard )) // all other values are equivalent to this
932+
933+
PORT_MODIFY("DSW2")
934+
PORT_DIPNAME( 0x38, 0x30, DEF_STR( Bonus_Life ) )
935+
PORT_DIPSETTING( 0x38, "Every 360k")
936+
PORT_DIPSETTING( 0x30, "Every 400k")
937+
PORT_DIPSETTING( 0x28, "Every 450k")
938+
PORT_DIPSETTING( 0x20, "Every 480k")
939+
PORT_DIPSETTING( 0x18, "Every 500k")
940+
PORT_DIPSETTING( 0x10, "Every 550k")
941+
PORT_DIPSETTING( 0x08, "Every 580k")
942+
PORT_DIPSETTING( 0x00, "Every 600k")
943+
PORT_DIPNAME( 0xc0, 0x40, "Bombs" )
927944
PORT_DIPSETTING( 0xc0, "1" )
928945
PORT_DIPSETTING( 0x80, "2" )
929946
PORT_DIPSETTING( 0x40, "3" )
@@ -943,39 +960,31 @@ static INPUT_PORTS_START( tmntmwb )
943960
PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
944961
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
945962
PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
946-
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Unknown ) )
947-
PORT_DIPSETTING( 0x38, "0" )
948-
PORT_DIPSETTING( 0x30, "1" )
949-
PORT_DIPSETTING( 0x28, "2" )
950-
PORT_DIPSETTING( 0x20, "2" )
951-
PORT_DIPSETTING( 0x18, "2" )
952-
PORT_DIPSETTING( 0x10, "2" )
953-
PORT_DIPSETTING( 0x08, "2" )
954-
PORT_DIPSETTING( 0x00, "2" )
955-
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Unknown ) )
956-
PORT_DIPSETTING( 0xc0, "0" )
957-
PORT_DIPSETTING( 0x80, "1" )
958-
PORT_DIPSETTING( 0x40, "2" )
959-
PORT_DIPSETTING( 0x00, "3" )
963+
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Difficulty ) ) // corresponds to levels 3-7 on SNES
964+
PORT_DIPSETTING( 0x38, DEF_STR( Easier )) // default on SNES
965+
PORT_DIPSETTING( 0x30, DEF_STR( Easy ))
966+
PORT_DIPSETTING( 0x28, DEF_STR( Normal ))
967+
PORT_DIPSETTING( 0x20, DEF_STR( Hard ))
968+
PORT_DIPSETTING( 0x18, DEF_STR( Harder )) // all other values are equivalent to this
969+
PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Game_Time ) )
970+
PORT_DIPSETTING( 0xc0, "99" )
971+
PORT_DIPSETTING( 0x80, "60" )
972+
PORT_DIPSETTING( 0x40, "30" )
973+
PORT_DIPSETTING( 0x00, DEF_STR( Infinite ) )
960974

961975
PORT_START("DSW2")
962976
PORT_DIPUNUSED( 0x01, IP_ACTIVE_LOW )
963977
PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW )
964-
PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Unknown ) )
965-
PORT_DIPSETTING( 0x00, "0" )
966-
PORT_DIPSETTING( 0x04, "1" )
967-
PORT_DIPSETTING( 0x08, "2" )
968-
PORT_DIPSETTING( 0x0c, "3" )
969-
PORT_DIPSETTING( 0x10, "4" )
970-
PORT_DIPSETTING( 0x14, "5" )
971-
PORT_DIPSETTING( 0x18, "6" )
972-
PORT_DIPSETTING( 0x1c, "7" )
978+
PORT_DIPNAME( 0x1c, 0x1c, "Unlock Bosses" )
979+
PORT_DIPSETTING( 0x1c, DEF_STR( None ) ) // all other values are equivalent to this
980+
PORT_DIPSETTING( 0x18, "Rat King" )
981+
PORT_DIPSETTING( 0x08, "Both" )
973982
PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )
974-
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Unknown ) )
975-
PORT_DIPSETTING( 0xc0, "0" )
976-
PORT_DIPSETTING( 0x80, "1" )
977-
PORT_DIPSETTING( 0x40, "2" )
978-
PORT_DIPSETTING( 0x00, "3" )
983+
PORT_DIPNAME( 0xc0, 0x00, "Speed" )
984+
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
985+
PORT_DIPSETTING( 0xc0, "Fast" )
986+
PORT_DIPSETTING( 0x80, "Faster" )
987+
PORT_DIPSETTING( 0x40, "Fastest" )
979988

980989
PORT_START("COIN")
981990
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -1074,11 +1083,21 @@ void snesb_state::venom(machine_config &config)
10741083
m_maincpu->set_addrmap(AS_PROGRAM, &snesb_state::venom_map);
10751084
}
10761085

1086+
MACHINE_RESET_MEMBER( snesb_state, wldgunsb )
1087+
{
1088+
snes_state::machine_reset();
1089+
1090+
// initialize continue counter
1091+
m_shared_ram[0][0x10] = 9;
1092+
m_shared_ram[0][0x12] = 0;
1093+
}
1094+
10771095
void snesb_state::wldgunsb(machine_config &config)
10781096
{
10791097
base(config);
10801098

10811099
m_maincpu->set_addrmap(AS_PROGRAM, &snesb_state::wldgunsb_map);
1100+
MCFG_MACHINE_RESET_OVERRIDE( snesb_state, wldgunsb )
10821101
}
10831102

10841103
void snesb_state::tmntmwb(machine_config &config)
@@ -1809,7 +1828,7 @@ GAME( 1997, sblast2b, 0, sblast2b, sblast2b, snesb_state, init_sb
18091828
GAME( 1997, tmntmwb, 0, tmntmwb, tmntmwb, snesb_state, init_tmntmwb, ROT0, "bootleg", "Teenage Mutant Ninja Turtles - Mutant Warriors (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
18101829
GAME( 1996, endless, 0, endless, endless, snesb_state, init_endless, ROT0, "bootleg", "Gundam Wing: Endless Duel (SNES bootleg, set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
18111830
GAME( 1996, endlessa, endless, endless, endless, snesb_state, init_endless, ROT0, "bootleg", "Gundam Wing: Endless Duel (SNES bootleg, set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
1812-
GAME( 1996, legendsb, 0, extrainp, kinstb, snesb_state, init_legendsb, ROT0, "bootleg", "Legend (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
1813-
GAME( 1997, rushbets, 0, rushbets, rushbets, snesb_state, init_rushbets, ROT0, "bootleg", "Rushing Beat Shura (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
1831+
GAME( 1996, legendsb, 0, extrainp, legendsb, snesb_state, init_legendsb, ROT0, "bootleg", "Legend (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
1832+
GAME( 1997, rushbets, 0, rushbets, legendsb, snesb_state, init_rushbets, ROT0, "bootleg", "Rushing Beat Shura (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
18141833
GAME( 1997, venom, 0, venom, venom, snesb_state, init_venom, ROT0, "bootleg", "Venom & Spider-Man - Separation Anxiety (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
1815-
GAME( 1996, wldgunsb, 0, wldgunsb, wldgunsb, snesb_state, init_wldgunsb, ROT0, "bootleg", "Wild Guns (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // based off Japanese version
1834+
GAME( 1996, wldgunsb, 0, wldgunsb, wldgunsb, snesb_state, init_wldgunsb, ROT0, "bootleg", "Wild Guns (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // based off Japanese version

0 commit comments

Comments
 (0)