From 36cbaa12b19c3ad2ec1914a239f11ab5bf8c80b4 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 19 Sep 2019 13:16:01 +1000 Subject: [PATCH] (nw) misc cleanup: * Fix path for coleco cartridge bus header * Remove some assert_always * Fix some comments that seem to have been victims of scripted editing --- scripts/src/bus.lua | 2 +- src/devices/bus/nscsi/cd.cpp | 3 ++- src/devices/bus/sms_ctrl/lphaser.cpp | 2 +- src/devices/bus/sms_ctrl/sports.cpp | 2 +- src/devices/bus/ti99/gromport/cartridges.cpp | 8 +++++--- src/devices/machine/28fxxx.cpp | 3 ++- src/mame/drivers/mekd5.cpp | 2 +- src/mame/drivers/namcona1.cpp | 8 ++++---- src/mame/includes/h01x.h | 1 - src/mame/video/namcona1.cpp | 2 +- 10 files changed, 18 insertions(+), 15 deletions(-) diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 88d02bb592e..d068bf9a1de 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -761,7 +761,7 @@ end --------------------------------------------------- -- ---@src/devices/bus/coleco/exp.h,BUSES["COLECO_CART"] = true +--@src/devices/bus/coleco/cartridge/exp.h,BUSES["COLECO_CART"] = true --------------------------------------------------- if (BUSES["COLECO_CART"]~=null) then diff --git a/src/devices/bus/nscsi/cd.cpp b/src/devices/bus/nscsi/cd.cpp index 19b32cc785a..93424f493fa 100644 --- a/src/devices/bus/nscsi/cd.cpp +++ b/src/devices/bus/nscsi/cd.cpp @@ -104,7 +104,8 @@ int nscsi_cdrom_device::to_msf(int frame) void nscsi_cdrom_device::set_block_size(u32 block_size) { - assert_always(bytes_per_sector % block_size == 0, "block size must be a factor of sector size"); + if (bytes_per_sector % block_size) + throw emu_fatalerror("nscsi_cdrom_device(%s): block size must be a factor of sector size", tag()); bytes_per_block = block_size; }; diff --git a/src/devices/bus/sms_ctrl/lphaser.cpp b/src/devices/bus/sms_ctrl/lphaser.cpp index 72b086af587..2dead793887 100644 --- a/src/devices/bus/sms_ctrl/lphaser.cpp +++ b/src/devices/bus/sms_ctrl/lphaser.cpp @@ -297,6 +297,6 @@ void sms_light_phaser_device::device_timer(emu_timer &timer, device_timer_id id, sensor_check(); break; default: - assert_always(false, "Unknown id in sms_light_phaser_device::device_timer"); + throw emu_fatalerror("sms_light_phaser_device(%s): Unknown timer ID", tag()); } } diff --git a/src/devices/bus/sms_ctrl/sports.cpp b/src/devices/bus/sms_ctrl/sports.cpp index 5a4809d3573..dee6af4eb63 100644 --- a/src/devices/bus/sms_ctrl/sports.cpp +++ b/src/devices/bus/sms_ctrl/sports.cpp @@ -74,7 +74,7 @@ void sms_sports_pad_device::device_timer(emu_timer &timer, device_timer_id id, i break; default: - assert_always(false, "Unknown id in sms_sports_pad_device::device_timer"); + throw emu_fatalerror("sms_sports_pad_device(%s): Unknown timer ID", tag()); } } diff --git a/src/devices/bus/ti99/gromport/cartridges.cpp b/src/devices/bus/ti99/gromport/cartridges.cpp index 91e2aabdf5f..b56e3dbb4f9 100644 --- a/src/devices/bus/ti99/gromport/cartridges.cpp +++ b/src/devices/bus/ti99/gromport/cartridges.cpp @@ -1514,7 +1514,8 @@ void ti99_cartridge_device::rpk::close() if (socket.second->persistent_ram()) { // try to open the battery file and write it if possible - assert_always(socket.second->get_contents() && (socket.second->get_content_length() > 0), "Buffer is null or length is 0"); + if (!socket.second->get_contents() || (socket.second->get_content_length() <= 0)) + throw emu_fatalerror("ti99_cartridge_device::rpk::close: Buffer is null or length is 0"); emu_file file(m_options.nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); osd_file::error filerr = file.open(socket.second->get_pathname()); @@ -1699,12 +1700,13 @@ std::unique_ptr ti99_cartridge_device::rpk_re LOGMASKED(LOG_RPK, "[RPK handler] Loading NVRAM contents from '%s'\n", ram_pname.c_str()); // Load the NVRAM contents - int bytes_read = 0; - assert_always(contents && (length > 0), "Buffer is null or length is 0"); + if (!contents || (length <= 0)) + throw emu_fatalerror("ti99_cartridge_device::rpk_reader::load_ram_resource: Buffer is null or length is 0"); // try to open the battery file and read it if possible emu_file file(options.nvram_directory(), OPEN_FLAG_READ); osd_file::error filerr = file.open(ram_pname); + int bytes_read = 0; if (filerr == osd_file::error::NONE) bytes_read = file.read(contents, length); diff --git a/src/devices/machine/28fxxx.cpp b/src/devices/machine/28fxxx.cpp index 6218ada4548..0643685589a 100644 --- a/src/devices/machine/28fxxx.cpp +++ b/src/devices/machine/28fxxx.cpp @@ -58,7 +58,8 @@ base_28fxxx_device::base_28fxxx_device(const machine_config &mconfig, device_typ , m_program_power(CLEAR_LINE) , m_state(STATE_READ_MEMORY) { - assert_always((m_size & (m_size - 1)) == 0, "memory size must be an exact power of two"); + if (m_size & (m_size - 1)) + throw emu_fatalerror("%s(%s): memory size must be an exact power of two", type.shortname(), tag); } intel_28f010_device::intel_28f010_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) diff --git a/src/mame/drivers/mekd5.cpp b/src/mame/drivers/mekd5.cpp index 56b00f13b7e..3c0eeb521c2 100644 --- a/src/mame/drivers/mekd5.cpp +++ b/src/mame/drivers/mekd5.cpp @@ -253,7 +253,7 @@ void mekd5_state::device_timer(emu_timer &timer, device_timer_id id, int param, m_kpd_pia->cb2_w(0); break; default: - assert_always(false, "Unknown id in mekd5_state::device_timer"); + throw emu_fatalerror("Unknown id in mekd5_state::device_timer"); } } diff --git a/src/mame/drivers/namcona1.cpp b/src/mame/drivers/namcona1.cpp index 47f3dd46577..2ea2c8b5a0b 100644 --- a/src/mame/drivers/namcona1.cpp +++ b/src/mame/drivers/namcona1.cpp @@ -1231,10 +1231,10 @@ ROM_END This bootleg is running on the older type rom board (Cosmo Gang etc). Super World Court normally runs on the newer type 'B' board with extra chip at 6J. It has a small pcb replacement keycus with a 74hc4060 , LS04 and 2 chips with the ID scratched (possibly PAL chips). Program ROMs are almost identical. They hacked the keycus routine and the copyright year (from 1992 to 1994): -sc2-ep0l.4c [2 / 2] 0l.0l [2 / 2] IDENTICAL -sc2-ep0u.4f [2 / 2] 0u.0u [2 / 2] IDENTICAL -sc2-ep0u.4f [1 / 2] 0u.0u [1 / 2] 99.997711% -sc2-ep0l.4c [1 / 2] 0l.0l [1 / 2] 99.997330% +sc2-ep0l.4c [2/2] 0l.0l [2/2] IDENTICAL +sc2-ep0u.4f [2/2] 0u.0u [2/2] IDENTICAL +sc2-ep0u.4f [1/2] 0u.0u [1/2] 99.997711% +sc2-ep0l.4c [1/2] 0l.0l [1/2] 99.997330% GFX ROMs are 27c040's double stacked with flying wires to the PAL board. They are the same as the 801 dumps, chopped in half. Pin 22 of OLH and OUH go to C pad on custom board. Pin 22 of 1LH and 1UH go to B pad on custom board. All Lower pin '22's are tied high. diff --git a/src/mame/includes/h01x.h b/src/mame/includes/h01x.h index a51220279a9..5caec560eca 100644 --- a/src/mame/includes/h01x.h +++ b/src/mame/includes/h01x.h @@ -9,7 +9,6 @@ #pragma once -#include "emu.h" #include "screen.h" #include "speaker.h" #include "emupal.h" diff --git a/src/mame/video/namcona1.cpp b/src/mame/video/namcona1.cpp index 228bf817fd9..34f3d89e0a2 100644 --- a/src/mame/video/namcona1.cpp +++ b/src/mame/video/namcona1.cpp @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Phil Stroffolino -/* Namco System NA1 / 2 Video Hardware */ +/* Namco System NA1/2 Video Hardware */ /* Notes: