From 3ecdaafea65c7cedb2dffc4bd865611f069ec289 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 3 Mar 2017 21:25:16 +1100 Subject: clean up a few more device issues, add basic device validation --- src/devices/bus/compis/graphics.cpp | 2 +- src/devices/bus/vc4000/slot.cpp | 34 ++++++--- src/devices/bus/vc4000/slot.h | 17 +++-- src/devices/cpu/mcs96/i8x9x.cpp | 2 +- src/devices/machine/rf5c296.cpp | 7 +- src/emu/validity.cpp | 140 +++++++++++++++++++++++++++++++++--- src/emu/validity.h | 3 +- src/frontend/mame/clifront.cpp | 34 ++++----- src/mame/drivers/galgames.cpp | 51 +++++++++---- src/mame/video/kaneko_spr.cpp | 23 +++--- src/mame/video/kaneko_spr.h | 15 ++-- 11 files changed, 253 insertions(+), 75 deletions(-) diff --git a/src/devices/bus/compis/graphics.cpp b/src/devices/bus/compis/graphics.cpp index 7a52e547b35..879c75b5b47 100644 --- a/src/devices/bus/compis/graphics.cpp +++ b/src/devices/bus/compis/graphics.cpp @@ -39,7 +39,7 @@ device_compis_graphics_card_interface::device_compis_graphics_card_interface(con //------------------------------------------------- compis_graphics_slot_t::compis_graphics_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, COMPIS_GRAPHICS_SLOT, "Compis graphics slot", tag, owner, clock, "isbx_slot", __FILE__), + device_t(mconfig, COMPIS_GRAPHICS_SLOT, "Compis graphics slot", tag, owner, clock, "compisgfx_slot", __FILE__), device_slot_interface(mconfig, *this), m_write_dma_request(*this), m_card(nullptr) diff --git a/src/devices/bus/vc4000/slot.cpp b/src/devices/bus/vc4000/slot.cpp index 7d87357d229..82764eaa1d1 100644 --- a/src/devices/bus/vc4000/slot.cpp +++ b/src/devices/bus/vc4000/slot.cpp @@ -27,9 +27,9 @@ const device_type H21_CART_SLOT = device_creator; //------------------------------------------------- device_vc4000_cart_interface::device_vc4000_cart_interface(const machine_config &mconfig, device_t &device) - : device_slot_card_interface(mconfig, device), - m_rom(nullptr), - m_rom_size(0) + : device_slot_card_interface(mconfig, device) + , m_rom(nullptr) + , m_rom_size(0) { } @@ -73,11 +73,25 @@ void device_vc4000_cart_interface::ram_alloc(uint32_t size) //------------------------------------------------- // vc4000_cart_slot_device - constructor //------------------------------------------------- -vc4000_cart_slot_device::vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, VC4000_CART_SLOT, "Interton VC 4000 Cartridge Slot", tag, owner, clock, "vc4000_cart_slot", __FILE__), - device_image_interface(mconfig, *this), - device_slot_interface(mconfig, *this), - m_type(VC4000_STD), m_cart(nullptr) +vc4000_cart_slot_device::vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vc4000_cart_slot_device(mconfig, VC4000_CART_SLOT, "Interton VC 4000 Cartridge Slot", tag, owner, clock, "vc4000_cart_slot", __FILE__) +{ +} + +vc4000_cart_slot_device::vc4000_cart_slot_device( + const machine_config &mconfig, + device_type type, + const char *name, + const char *tag, + device_t *owner, + uint32_t clock, + const char *shortname, + const char *source) + : device_t(mconfig, VC4000_CART_SLOT, name, tag, owner, clock, shortname, source) + , device_image_interface(mconfig, *this) + , device_slot_interface(mconfig, *this) + , m_type(VC4000_STD) + , m_cart(nullptr) { } @@ -103,8 +117,8 @@ void vc4000_cart_slot_device::device_start() // trq h-21 slot //------------------------------------------------- -h21_cart_slot_device::h21_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - vc4000_cart_slot_device(mconfig, tag, owner, clock) +h21_cart_slot_device::h21_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vc4000_cart_slot_device(mconfig, H21_CART_SLOT, "TRQ H-21 Cartridge Slot", tag, owner, clock, "h21_cart_slot", __FILE__) { } diff --git a/src/devices/bus/vc4000/slot.h b/src/devices/bus/vc4000/slot.h index a7f384f6edd..01a37560898 100644 --- a/src/devices/bus/vc4000/slot.h +++ b/src/devices/bus/vc4000/slot.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Fabio Priuli -#ifndef __VC4000_SLOT_H -#define __VC4000_SLOT_H +#ifndef MAME_BUS_VC4000_SLOT_H +#define MAME_BUS_VC4000_SLOT_H #include "softlist_dev.h" @@ -95,9 +95,18 @@ public: virtual DECLARE_WRITE8_MEMBER(write_ram); protected: + vc4000_cart_slot_device( + const machine_config &mconfig, + device_type type, + const char *name, + const char *tag, + device_t *owner, + uint32_t clock, + const char *shortname, + const char *source); int m_type; - device_vc4000_cart_interface* m_cart; + device_vc4000_cart_interface *m_cart; }; class h21_cart_slot_device : public vc4000_cart_slot_device @@ -129,4 +138,4 @@ extern const device_type H21_CART_SLOT; MCFG_DEVICE_ADD(_tag, H21_CART_SLOT, 0) \ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) -#endif +#endif // MAME_BUS_VC4000_SLOT_H diff --git a/src/devices/cpu/mcs96/i8x9x.cpp b/src/devices/cpu/mcs96/i8x9x.cpp index 6f78e7d00a9..151a4809cb8 100644 --- a/src/devices/cpu/mcs96/i8x9x.cpp +++ b/src/devices/cpu/mcs96/i8x9x.cpp @@ -369,6 +369,6 @@ p8098_device::p8098_device(const machine_config &mconfig, const char *tag, devic } const device_type C8095 = device_creator; -const device_type P8098 = device_creator; +const device_type P8098 = C8095; #include "cpu/mcs96/i8x9x.hxx" diff --git a/src/devices/machine/rf5c296.cpp b/src/devices/machine/rf5c296.cpp index abb0884b9e2..dc88babbdb7 100644 --- a/src/devices/machine/rf5c296.cpp +++ b/src/devices/machine/rf5c296.cpp @@ -7,8 +7,11 @@ const device_type RF5C296 = device_creator; -rf5c296_device::rf5c296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, PCCARD_SLOT, "PCCARD SLOT", tag, owner, clock, "pccard", __FILE__), m_rf5c296_reg(0), m_pccard(nullptr), m_pccard_name(nullptr) +rf5c296_device::rf5c296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, RF5C296, "RF5C296 PC Card controller", tag, owner, clock, "rf5c296", __FILE__) + , m_rf5c296_reg(0) + , m_pccard(nullptr) + , m_pccard_name(nullptr) { } diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index c8201da63a1..cab87352a5e 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -15,6 +15,9 @@ #include "video/rgbutil.h" #include +#include +#include +#include //************************************************************************** @@ -126,15 +129,15 @@ void validity_checker::validate_tag(const char *tag) //------------------------------------------------- validity_checker::validity_checker(emu_options &options) - : m_drivlist(options), - m_errors(0), - m_warnings(0), - m_print_verbose(options.verbose()), - m_current_driver(nullptr), - m_current_config(nullptr), - m_current_device(nullptr), - m_current_ioport(nullptr), - m_validate_all(false) + : m_drivlist(options) + , m_errors(0) + , m_warnings(0) + , m_print_verbose(options.verbose()) + , m_current_driver(nullptr) + , m_current_config(nullptr) + , m_current_device(nullptr) + , m_current_ioport(nullptr) + , m_validate_all(false) { // pre-populate the defstr map with all the default strings for (int strnum = 1; strnum < INPUT_STRING_COUNT; strnum++) @@ -220,6 +223,10 @@ bool validity_checker::check_all_matching(const char *string) if (m_drivlist.matches(string, m_drivlist.driver().name)) validate_one(m_drivlist.driver()); + // validate devices + if (!string) + validate_device_types(); + // cleanup validate_end(); @@ -1853,6 +1860,119 @@ void validity_checker::validate_devices() } +//------------------------------------------------- +// validate_devices_types - check validity of +// registered device types +//------------------------------------------------- + +void validity_checker::validate_device_types() +{ + // reset error/warning state + int start_errors = m_errors; + int start_warnings = m_warnings; + m_error_text.clear(); + m_warning_text.clear(); + m_verbose_text.clear(); + + std::unordered_map > device_name_map, device_shortname_map; + std::unordered_set device_types; + machine_config config(GAME_NAME(___empty), m_drivlist.options()); + for (device_type type : registered_device_types) + { + if (!device_types.emplace(type.type()).second) + { + osd_printf_error("Device class '%s' registered multiple times\n", type.type().name()); + } + else + { + device_t *const dev = config.device_add(&config.root_device(), "_tmp", type, 0); + + char const *name((dev->shortname() && *dev->shortname()) ? dev->shortname() : type.type().name()); + std::string const description((dev->source() && *dev->source()) ? util::string_format("%s(%s)", core_filename_extract_base(dev->source()).c_str(), name) : name); + + // ensure shortname exists + if (!dev->shortname() || !*dev->shortname()) + { + osd_printf_error("Device %s does not have short name defined\n", description.c_str()); + } + else + { + // check for invalid characters in shortname + for (char const *s = dev->shortname(); *s; ++s) + { + if (((*s < '0') || (*s > '9')) && ((*s < 'a') || (*s > 'z')) && (*s != '_')) + { + osd_printf_error("Device %s short name contains invalid characters\n", description.c_str()); + break; + } + } + + // check for name conflicts + auto const drvname(m_names_map.find(dev->shortname())); + auto const devname(device_shortname_map.emplace(dev->shortname(), &type)); + if (m_names_map.end() != drvname) + { + game_driver const &dup(*drvname->second); + osd_printf_error("Device %s short name is a duplicate of %s(%s)\n", description.c_str(), core_filename_extract_base(dup.source_file).c_str(), dup.name); + } + else if (!devname.second) + { + device_t *const dup = config.device_add(&config.root_device(), "_dup", *devname.first->second, 0); + osd_printf_error("Device %s short name is a duplicate of %s(%s)\n", description.c_str(), core_filename_extract_base(dup->source()).c_str(), dup->shortname()); + config.device_remove(&config.root_device(), "_dup"); + } + } + + // ensure name exists + if (!dev->name() || !*dev->name()) + { + osd_printf_error("Device %s does not have name defined\n", description.c_str()); + } + else + { + // check for description conflicts + auto const drvdesc(m_descriptions_map.find(dev->name())); + auto const devdesc(device_name_map.emplace(dev->name(), &type)); + if (m_names_map.end() != drvdesc) + { + game_driver const &dup(*drvdesc->second); + osd_printf_error("Device %s name is a duplicate of %s(%s)\n", description.c_str(), core_filename_extract_base(dup.source_file).c_str(), dup.name); + } + else if (!devdesc.second) + { + device_t *const dup = config.device_add(&config.root_device(), "_dup", *devdesc.first->second, 0); + osd_printf_error("Device %s name is a duplicate of %s(%s)\n", description.c_str(), core_filename_extract_base(dup->source()).c_str(), dup->shortname()); + config.device_remove(&config.root_device(), "_dup"); + } + } + + // ensure source exists + if (!dev->source() || !*dev->source()) + osd_printf_error("Device %s does not have source defined\n", description.c_str()); + + // check that reported type matches supplied type + if (dev->type().type() != type.type()) + osd_printf_error("Device %s reports type '%s' (created with '%s')\n", description.c_str(), dev->type().type().name(), type.type().name()); + + config.device_remove(&config.root_device(), "_tmp"); + } + } + + // if we had warnings or errors, output + if (m_errors > start_errors || m_warnings > start_warnings || !m_verbose_text.empty()) + { + output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "%d errors, %d warnings\n", m_errors - start_errors, m_warnings - start_warnings); + if (m_errors > start_errors) + output_indented_errors(m_error_text, "Errors"); + if (m_warnings > start_warnings) + output_indented_errors(m_warning_text, "Warnings"); + if (!m_verbose_text.empty()) + output_indented_errors(m_verbose_text, "Messages"); + output_via_delegate(OSD_OUTPUT_CHANNEL_ERROR, "\n"); + } +} + + //------------------------------------------------- // build_output_prefix - create a prefix // indicating the current source file, driver, @@ -1866,7 +1986,7 @@ void validity_checker::build_output_prefix(std::string &str) // if we have a current (non-root) device, indicate that if (m_current_device != nullptr && m_current_device->owner() != nullptr) - str.append(m_current_device->name()).append(" device '").append(m_current_device->tag()+1).append("': "); + str.append(m_current_device->name()).append(" device '").append(m_current_device->tag() + 1).append("': "); // if we have a current port, indicate that as well if (m_current_ioport != nullptr) diff --git a/src/emu/validity.h b/src/emu/validity.h index 52d78cbcde6..05b2ac5cf63 100644 --- a/src/emu/validity.h +++ b/src/emu/validity.h @@ -34,7 +34,7 @@ public: // getters int errors() const { return m_errors; } int warnings() const { return m_warnings; } - int validate_all() const { return m_validate_all; } + bool validate_all() const { return m_validate_all; } // setter void set_verbose(bool verbose) { m_print_verbose = verbose; } @@ -82,6 +82,7 @@ private: void validate_condition(ioport_condition &condition, device_t &device, std::unordered_set &port_map); void validate_inputs(); void validate_devices(); + void validate_device_types(); // output helpers void build_output_prefix(std::string &str); diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 88b99b84f60..007568260bd 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -78,34 +78,34 @@ const options_entry cli_option_entries[] = { /* core commands */ { nullptr, nullptr, OPTION_HEADER, "CORE COMMANDS" }, - { CLICOMMAND_HELP ";h;?", "0", OPTION_COMMAND, "show help message" }, - { CLICOMMAND_VALIDATE ";valid", "0", OPTION_COMMAND, "perform driver validation on all game drivers" }, + { CLICOMMAND_HELP ";h;?", "0", OPTION_COMMAND, "show help message" }, + { CLICOMMAND_VALIDATE ";valid", "0", OPTION_COMMAND, "perform driver validation on all game drivers" }, /* configuration commands */ { nullptr, nullptr, OPTION_HEADER, "CONFIGURATION COMMANDS" }, - { CLICOMMAND_CREATECONFIG ";cc", "0", OPTION_COMMAND, "create the default configuration file" }, - { CLICOMMAND_SHOWCONFIG ";sc", "0", OPTION_COMMAND, "display running parameters" }, - { CLICOMMAND_SHOWUSAGE ";su", "0", OPTION_COMMAND, "show this help" }, + { CLICOMMAND_CREATECONFIG ";cc", "0", OPTION_COMMAND, "create the default configuration file" }, + { CLICOMMAND_SHOWCONFIG ";sc", "0", OPTION_COMMAND, "display running parameters" }, + { CLICOMMAND_SHOWUSAGE ";su", "0", OPTION_COMMAND, "show this help" }, /* frontend commands */ { nullptr, nullptr, OPTION_HEADER, "FRONTEND COMMANDS" }, - { CLICOMMAND_LISTXML ";lx", "0", OPTION_COMMAND, "all available info on driver in XML format" }, - { CLICOMMAND_LISTFULL ";ll", "0", OPTION_COMMAND, "short name, full name" }, - { CLICOMMAND_LISTSOURCE ";ls", "0", OPTION_COMMAND, "driver sourcefile" }, - { CLICOMMAND_LISTCLONES ";lc", "0", OPTION_COMMAND, "show clones" }, - { CLICOMMAND_LISTBROTHERS ";lb", "0", OPTION_COMMAND, "show \"brothers\", or other drivers from same sourcefile" }, + { CLICOMMAND_LISTXML ";lx", "0", OPTION_COMMAND, "all available info on driver in XML format" }, + { CLICOMMAND_LISTFULL ";ll", "0", OPTION_COMMAND, "short name, full name" }, + { CLICOMMAND_LISTSOURCE ";ls", "0", OPTION_COMMAND, "driver sourcefile" }, + { CLICOMMAND_LISTCLONES ";lc", "0", OPTION_COMMAND, "show clones" }, + { CLICOMMAND_LISTBROTHERS ";lb", "0", OPTION_COMMAND, "show \"brothers\", or other drivers from same sourcefile" }, { CLICOMMAND_LISTCRC, "0", OPTION_COMMAND, "CRC-32s" }, - { CLICOMMAND_LISTROMS ";lr", "0", OPTION_COMMAND, "list required roms for a driver" }, + { CLICOMMAND_LISTROMS ";lr", "0", OPTION_COMMAND, "list required roms for a driver" }, { CLICOMMAND_LISTSAMPLES, "0", OPTION_COMMAND, "list optional samples for a driver" }, { CLICOMMAND_VERIFYROMS, "0", OPTION_COMMAND, "report romsets that have problems" }, { CLICOMMAND_VERIFYSAMPLES, "0", OPTION_COMMAND, "report samplesets that have problems" }, { CLICOMMAND_ROMIDENT, "0", OPTION_COMMAND, "compare files with known MAME roms" }, - { CLICOMMAND_LISTDEVICES ";ld", "0", OPTION_COMMAND, "list available devices" }, - { CLICOMMAND_LISTSLOTS ";lslot", "0", OPTION_COMMAND, "list available slots and slot devices" }, - { CLICOMMAND_LISTMEDIA ";lm", "0", OPTION_COMMAND, "list available media for the system" }, - { CLICOMMAND_LISTSOFTWARE ";lsoft", "0", OPTION_COMMAND, "list known software for the system" }, + { CLICOMMAND_LISTDEVICES ";ld", "0", OPTION_COMMAND, "list available devices" }, + { CLICOMMAND_LISTSLOTS ";lslot", "0", OPTION_COMMAND, "list available slots and slot devices" }, + { CLICOMMAND_LISTMEDIA ";lm", "0", OPTION_COMMAND, "list available media for the system" }, + { CLICOMMAND_LISTSOFTWARE ";lsoft", "0", OPTION_COMMAND, "list known software for the system" }, { CLICOMMAND_VERIFYSOFTWARE ";vsoft", "0", OPTION_COMMAND, "verify known software for the system" }, - { CLICOMMAND_GETSOFTLIST ";glist", "0", OPTION_COMMAND, "retrieve software list by name" }, + { CLICOMMAND_GETSOFTLIST ";glist", "0", OPTION_COMMAND, "retrieve software list by name" }, { CLICOMMAND_VERIFYSOFTLIST ";vlist", "0", OPTION_COMMAND, "verify software list by name" }, { nullptr } }; @@ -1411,7 +1411,7 @@ void cli_frontend::execute_commands(const char *exename) validity_checker valid(m_options); valid.set_validate_all(true); const char *sysname = m_options.system_name(); - bool result = valid.check_all_matching((sysname[0] == 0) ? "*" : sysname); + bool result = valid.check_all_matching((sysname[0] == 0) ? nullptr : sysname); if (!result) throw emu_fatalerror(EMU_ERR_FAILED_VALIDITY, "Validity check failed (%d errors, %d warnings in total)\n", valid.errors(), valid.warnings()); return; diff --git a/src/mame/drivers/galgames.cpp b/src/mame/drivers/galgames.cpp index 67d71171c56..88f9ead0c23 100644 --- a/src/mame/drivers/galgames.cpp +++ b/src/mame/drivers/galgames.cpp @@ -54,19 +54,25 @@ Notes: ***************************************************************************/ class galgames_slot_device; +extern const device_type GALGAMES_CART; +extern const device_type GALGAMES_BIOS_CART; +extern const device_type GALGAMES_STARPAK2_CART; +extern const device_type GALGAMES_STARPAK3_CART; +extern const device_type GALGAMES_SLOT; // CART declaration -class galgames_cart_device : public device_t, - public device_rom_interface +class galgames_cart_device : public device_t, public device_rom_interface { public: // construction/destruction - galgames_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + galgames_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + galgames_cart_device(mconfig, GALGAMES_CART, "Galaxy Games StarPak Cartridge", tag, owner, clock, "starpak_cart", __FILE__) + { } // static configuration static void static_set_cart(device_t &device, uint8_t cart) { downcast(device).m_cart = cart; } - static void static_set_pic_bits(device_t &device, int clk, int in, int out, int dis) { downcast(device).set_pic_bits(clk, in, out, dis); } + static void static_set_pic_bits(device_t &device, int clk, int in, int out, int dis) { downcast(device).set_pic_bits(clk, in, out, dis); } // ROM DECLARE_READ16_MEMBER(rom_r) { return read_word(offset*2); } @@ -87,6 +93,16 @@ public: DECLARE_WRITE8_MEMBER(int_pic_bank_w); protected: + galgames_cart_device( + const machine_config &mconfig, + device_type type, + const char *name, + const char *tag, + device_t *owner, + uint32_t clock, + const char *shortname, + const char *source); + // device-level overrides virtual void device_start() override { } virtual void device_reset() override; @@ -135,12 +151,12 @@ static MACHINE_CONFIG_FRAGMENT( bios ) MCFG_EEPROM_SERIAL_93C76_8BIT_ADD("eeprom") MACHINE_CONFIG_END -class galgames_bios_cart_device : public galgames_cart_device +class galgames_bios_cart_device : public galgames_cart_device { public: // construction/destruction galgames_bios_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - galgames_cart_device(mconfig, tag, owner, clock) + galgames_cart_device(mconfig, GALGAMES_BIOS_CART, "Galaxy Games BIOS Cartridge", tag, owner, clock, "galgames_bios_cart", __FILE__) { } protected: // device-level overrides @@ -165,12 +181,12 @@ static MACHINE_CONFIG_FRAGMENT( starpak2 ) MCFG_EEPROM_SERIAL_93C76_8BIT_ADD("eeprom") MACHINE_CONFIG_END -class galgames_starpak2_cart_device : public galgames_cart_device +class galgames_starpak2_cart_device : public galgames_cart_device { public: // construction/destruction galgames_starpak2_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - galgames_cart_device(mconfig, tag, owner, clock) + galgames_cart_device(mconfig, GALGAMES_STARPAK2_CART, "Galaxy Games StarPak 3 Cartridge", tag, owner, clock, "starpak2_cart", __FILE__) { } protected: // device-level overrides @@ -197,12 +213,12 @@ static MACHINE_CONFIG_FRAGMENT( starpak3 ) MCFG_EEPROM_SERIAL_93C76_8BIT_ADD("eeprom") MACHINE_CONFIG_END -class galgames_starpak3_cart_device : public galgames_cart_device +class galgames_starpak3_cart_device : public galgames_cart_device { public: // construction/destruction galgames_starpak3_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - galgames_cart_device(mconfig, tag, owner, clock) + galgames_cart_device(mconfig, GALGAMES_STARPAK3_CART, "Galaxy Games StarPak 3 Cartridge", tag, owner, clock, "starpak3_cart", __FILE__) { } protected: // device-level overrides @@ -226,8 +242,7 @@ const device_type GALGAMES_STARPAK3_CART = device_creator; // CART implementation -galgames_cart_device::galgames_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, GALGAMES_CART, "Galaxy Games StarPak Cartridge", tag, owner, clock, "starpak_cart", __FILE__), +galgames_cart_device::galgames_cart_device( + const machine_config &mconfig, + device_type type, + const char *name, + const char *tag, + device_t *owner, + uint32_t clock, + const char *shortname, + const char *source): + device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_rom_interface(mconfig, *this, 21, ENDIANNESS_BIG, 16), m_mconfig_additions(nullptr), m_cart(0), diff --git a/src/mame/video/kaneko_spr.cpp b/src/mame/video/kaneko_spr.cpp index 67021ac58a7..106e74a7b63 100644 --- a/src/mame/video/kaneko_spr.cpp +++ b/src/mame/video/kaneko_spr.cpp @@ -28,12 +28,19 @@ #include "kaneko_spr.h" #include "screen.h" -//const device_type KANEKO16_SPRITE = device_creator; // we have pure virtual functions const device_type KANEKO_VU002_SPRITE = device_creator; const device_type KANEKO_KC002_SPRITE = device_creator; -kaneko16_sprite_device::kaneko16_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, device_type type) - : device_t(mconfig, type, "Kaneko 16-bit Sprites", tag, owner, clock, "kaneko16_sprite", __FILE__) +kaneko16_sprite_device::kaneko16_sprite_device( + const machine_config &mconfig, + device_type type, + const char *name, + const char *tag, + device_t *owner, + uint32_t clock, + const char *shortname, + const char *source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , device_video_interface(mconfig, *this) , m_gfxdecode(*this, finder_base::DUMMY_TAG) { @@ -116,12 +123,6 @@ void kaneko16_sprite_device::set_offsets(device_t &device, int xoffs, int yoffs) } - - - - - - /*************************************************************************** Sprites Drawing @@ -618,12 +619,12 @@ void kaneko16_sprite_device::kaneko16_render_sprites_common(_BitmapClass &bitmap } kaneko_vu002_sprite_device::kaneko_vu002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : kaneko16_sprite_device(mconfig, tag, owner, clock, KANEKO_VU002_SPRITE) + : kaneko16_sprite_device(mconfig, KANEKO_VU002_SPRITE, "Kaneko VU002 Sprites", tag, owner, clock, "kaneko_vu002", __FILE__) { } kaneko_kc002_sprite_device::kaneko_kc002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : kaneko16_sprite_device(mconfig, tag, owner, clock, KANEKO_KC002_SPRITE) + : kaneko16_sprite_device(mconfig, KANEKO_KC002_SPRITE, "Kaneko KC002 Sprites", tag, owner, clock, "kaneko_kc002", __FILE__) { } diff --git a/src/mame/video/kaneko_spr.h b/src/mame/video/kaneko_spr.h index 8f2abd929f0..88dff484812 100644 --- a/src/mame/video/kaneko_spr.h +++ b/src/mame/video/kaneko_spr.h @@ -27,12 +27,9 @@ struct kan_tempsprite -class kaneko16_sprite_device : public device_t, - public device_video_interface +class kaneko16_sprite_device : public device_t, public device_video_interface { public: - kaneko16_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, device_type type); - // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); static void set_fliptype(device_t &device, int fliptype); @@ -56,6 +53,16 @@ public: DECLARE_WRITE16_MEMBER(kaneko16_sprites_regs_w); protected: + kaneko16_sprite_device( + const machine_config &mconfig, + device_type type, + const char *name, + const char *tag, + device_t *owner, + uint32_t clock, + const char *shortname, + const char *source); + virtual void device_start() override; virtual void device_reset() override; -- cgit v1.2.3