From 49e5d2f6c852865bc30a76d261928ddc382d9939 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 28 Nov 2020 16:16:23 +1100 Subject: [PATCH] Miscellaneous cleanup/fixes: segac2.cpp: Fixed bloxeedu credits to start DIP switches. luaengine*.cpp: Used unchecked optional getter after explicit check. informer_213.cpp: Comment out very noisy logerror. votrhv.cpp: XTAL is for crystals/resonators, not any old oscillator. --- src/devices/bus/spc1000/fdd.cpp | 2 +- src/frontend/mame/luaengine.ipp | 4 ++-- src/frontend/mame/luaengine_render.cpp | 8 ++++---- src/mame/drivers/informer_213.cpp | 2 +- src/mame/drivers/segac2.cpp | 26 +++++++++++++++----------- src/mame/drivers/votrhv.cpp | 6 ++++-- src/mame/video/m72.cpp | 2 +- 7 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/devices/bus/spc1000/fdd.cpp b/src/devices/bus/spc1000/fdd.cpp index 15025d7cf76..bb9fa2f82d6 100644 --- a/src/devices/bus/spc1000/fdd.cpp +++ b/src/devices/bus/spc1000/fdd.cpp @@ -82,7 +82,7 @@ static void sd725_floppies(device_slot_interface &device) } //------------------------------------------------- -// device_add_mconfigfloppy_image +// device_add_mconfig //------------------------------------------------- void spc1000_fdd_exp_device::device_add_mconfig(machine_config &config) diff --git a/src/frontend/mame/luaengine.ipp b/src/frontend/mame/luaengine.ipp index 811940cdd1f..8af5a937eb4 100644 --- a/src/frontend/mame/luaengine.ipp +++ b/src/frontend/mame/luaengine.ipp @@ -92,9 +92,9 @@ protected: auto p(sol::stack::unqualified_check_get(L, 1)); if (!p) luaL_error(L, "sol: 'self' is not of type '%s' (pass 'self' as first argument with ':' or call on proper type)", sol::detail::demangle().c_str()); - if (!p.value()) + if (*p) luaL_error(L, "sol: 'self' argument is nil (pass 'self' as first argument with ':' or call on a '%s' type", sol::detail::demangle().c_str()); - return *p.value(); + return **p; } struct indexed_iterator diff --git a/src/frontend/mame/luaengine_render.cpp b/src/frontend/mame/luaengine_render.cpp index 3e5db2f52c3..68113f0650b 100644 --- a/src/frontend/mame/luaengine_render.cpp +++ b/src/frontend/mame/luaengine_render.cpp @@ -429,7 +429,7 @@ void lua_engine::initialize_render() auto result(invoke(cbfunc).get >()); if (result) { - return result.value(); + return *result; } else { @@ -458,7 +458,7 @@ void lua_engine::initialize_render() auto result(invoke(cbfunc).get >()); if (result) { - return result.value(); + return *result; } else { @@ -487,7 +487,7 @@ void lua_engine::initialize_render() auto result(invoke(cbfunc).get >()); if (result) { - b = result.value(); + b = *result; } else { @@ -516,7 +516,7 @@ void lua_engine::initialize_render() auto result(invoke(cbfunc).get >()); if (result) { - c = result.value(); + c = *result; } else { diff --git a/src/mame/drivers/informer_213.cpp b/src/mame/drivers/informer_213.cpp index 3803f7ae877..ab445f83930 100644 --- a/src/mame/drivers/informer_213.cpp +++ b/src/mame/drivers/informer_213.cpp @@ -167,7 +167,7 @@ uint32_t informer_213_state::screen_update(screen_device &screen, bitmap_rgb32 & uint8_t code = m_program.read_byte(addr); uint8_t attr = m_program.read_byte(addr+0x1000); - logerror("%02d.%02d %04x %02x %02x\n", x, y, addr, code, attr); + //logerror("%02d.%02d %04x %02x %02x\n", x, y, addr, code, attr); if (code == 0xc0 || code == 0xe8) line_attr = attr; diff --git a/src/mame/drivers/segac2.cpp b/src/mame/drivers/segac2.cpp index 59f91ce334d..79afbf560f1 100644 --- a/src/mame/drivers/segac2.cpp +++ b/src/mame/drivers/segac2.cpp @@ -1327,23 +1327,25 @@ static INPUT_PORTS_START( bloxeedc ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* Button 3 Unused */ PORT_MODIFY("DSW") - PORT_DIPNAME( 0x01, 0x01, "Credits to Start (VS)" ) PORT_DIPLOCATION("SW2:1") - PORT_DIPSETTING( 0x00, "Same as Normal" ) - PORT_DIPSETTING( 0x01, "Double" ) - PORT_DIPNAME( 0x02, 0x02, "Credits to Start (Normal)" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPNAME( 0x01, 0x01, "Credits to Start (VS)" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x00, "1" ) PORT_CONDITION("DSW", 0x02, EQUALS, 0x02) + PORT_DIPSETTING( 0x01, "2" ) PORT_CONDITION("DSW", 0x02, EQUALS, 0x02) + PORT_DIPSETTING( 0x00, "2" ) PORT_CONDITION("DSW", 0x02, EQUALS, 0x00) + PORT_DIPSETTING( 0x01, "4" ) PORT_CONDITION("DSW", 0x02, EQUALS, 0x00) + PORT_DIPNAME( 0x02, 0x02, "Credits to Start (Normal)" ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x02, "1" ) PORT_DIPSETTING( 0x00, "2" ) //"SW2:3" unused - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:4") + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6") PORT_DIPSETTING( 0x20, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) //"SW2:7" unused - PORT_DIPNAME( 0x80, 0x00, "High Speed Mode" ) PORT_DIPLOCATION("SW2:8") + PORT_DIPNAME( 0x80, 0x00, "High Speed Mode" ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x80, DEF_STR( On ) ) INPUT_PORTS_END @@ -1352,10 +1354,12 @@ INPUT_PORTS_END static INPUT_PORTS_START( bloxeedu ) PORT_INCLUDE( bloxeedc ) - PORT_MODIFY("DSW") //"SW2:1" has opposite effect in US version - PORT_DIPNAME( 0x01, 0x00, "Credits to Start (VS)" ) PORT_DIPLOCATION("SW2:1") - PORT_DIPSETTING( 0x01, "Same as Normal" ) - PORT_DIPSETTING( 0x00, "Double" ) + PORT_MODIFY("DSW") + PORT_DIPNAME( 0x03, 0x03, "Credits to Start (Normal / VS)" ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x01, "1 / 1" ) + PORT_DIPSETTING( 0x03, "1 / 2" ) + PORT_DIPSETTING( 0x02, "1 / 2" ) + PORT_DIPSETTING( 0x00, "2 / 4" ) INPUT_PORTS_END diff --git a/src/mame/drivers/votrhv.cpp b/src/mame/drivers/votrhv.cpp index a787d3093ac..f1aa42a1443 100644 --- a/src/mame/drivers/votrhv.cpp +++ b/src/mame/drivers/votrhv.cpp @@ -445,7 +445,7 @@ WRITE_LINE_MEMBER( votrhv_state::reset_counter ) // is the timer already running/non-zero? if not, start it. if (!m_resume_timer->enabled()) { - m_resume_timer->adjust(attotime::from_hz((XTAL(2'000'000)/2)/0x20)); + m_resume_timer->adjust(attotime::from_hz(2'000'000/2/0x20)); } } else // state == ASSERT_LINE @@ -659,7 +659,9 @@ uint8_t hc120_state::input_r() void votrhv_state::votrhv(machine_config &config) { /* basic machine hardware */ - M6800(config, m_maincpu, XTAL(2'000'000) / 2 ); // ~1'000'000 done using two 74L123 multivibrators with cap 100pf res 11k, which each oscillate at 1.8-2.5mhz, but since you need two clock phases for the 6800, each multivibrator does one phase and the falling edge of one triggers the other, so the actual clock rate is half the rate of each. + // ~1MHz done using two 74L123 multivibrators with cap 100pf res 11k, which each oscillate at 1.8-2.5mhz + // since you need two clock phases for the 6800, each multivibrator does one phase and the falling edge of one triggers the other, so the actual clock rate is half the rate of each + M6800(config, m_maincpu, 2'000'000 / 2 ); m_maincpu->set_addrmap(AS_PROGRAM, &votrhv_state::mem_map); INPUT_MERGER_ALL_LOW(config, m_reset).output_handler().set(FUNC(votrhv_state::reset_counter)); diff --git a/src/mame/video/m72.cpp b/src/mame/video/m72.cpp index 2d1329b67d3..c7f5ca9957e 100644 --- a/src/mame/video/m72.cpp +++ b/src/mame/video/m72.cpp @@ -435,7 +435,7 @@ void m72_state::majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &clip { u16 *spriteram16_2 = m_spriteram2; - for (int offs = 0; offs < m_spriteram2.bytes()/2; offs += 4) + for (int offs = 0; offs < m_spriteram2.length(); offs += 4) { const int code = spriteram16_2[offs+1]; const u32 color = spriteram16_2[offs+2] & 0x0f;