softlist_dev.cpp: get some stuff out of the global namespace (nw)

This commit is contained in:
Vas Crabb 2019-12-08 04:00:49 +11:00
parent d4b3128e0d
commit d8ef34be9a
23 changed files with 53 additions and 51 deletions

View File

@ -86,7 +86,7 @@ void bbc_tube_zep100_device::device_add_mconfig(machine_config &config)
RAM(config, m_ram).set_default_size("64K").set_default_value(0x00);
/* software lists */
SOFTWARE_LIST(config, "flop_ls_torch").set_type("bbc_flop_torch", SOFTWARE_LIST_ORIGINAL_SYSTEM).set_filter("Z80");
SOFTWARE_LIST(config, "flop_ls_torch").set_original("bbc_flop_torch").set_filter("Z80");
}
//-------------------------------------------------

View File

@ -269,7 +269,7 @@ void econet_e01_device::device_add_mconfig(machine_config &config)
}
software_list_device &softlist(SOFTWARE_LIST(config, "flop_ls_e01"));
softlist.set_type("e01_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
softlist.set_original("e01_flop");
CENTRONICS(config, m_centronics, centronics_devices, "printer");
m_centronics->ack_handler().set(R6522_TAG, FUNC(via6522_device::write_ca1));

View File

@ -80,9 +80,9 @@ bool image_software_list_loader::load_software(device_image_interface &image, so
// software_list_device - constructor
//-------------------------------------------------
software_list_device::software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, SOFTWARE_LIST, tag, owner, clock),
m_list_type(SOFTWARE_LIST_ORIGINAL_SYSTEM),
software_list_device::software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
device_t(mconfig, SOFTWARE_LIST, tag, owner, clock),
m_list_type(softlist_type::ORIGINAL_SYSTEM),
m_filter(nullptr),
m_parsed(false),
m_file(mconfig.options().hash_path(), OPEN_FLAG_READ),
@ -220,7 +220,7 @@ void software_list_device::display_matches(const machine_config &config, const c
if (matches[0] != nullptr)
{
// different output depending on original system or compatible
if (swlistdev.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM)
if (swlistdev.is_original())
osd_printf_error("* Software list \"%s\" (%s) matches: \n", swlistdev.list_name(), swlistdev.description());
else
osd_printf_error("* Compatible software list \"%s\" (%s) matches: \n", swlistdev.list_name(), swlistdev.description());

View File

@ -25,12 +25,6 @@
#define SOFTWARE_SUPPORTED_PARTIAL 1
#define SOFTWARE_SUPPORTED_NO 2
enum softlist_type
{
SOFTWARE_LIST_ORIGINAL_SYSTEM,
SOFTWARE_LIST_COMPATIBLE_SYSTEM
};
enum software_compatibility
{
SOFTWARE_IS_COMPATIBLE,
@ -100,18 +94,26 @@ class software_list_device : public device_t
friend class softlist_parser;
public:
enum class softlist_type
{
ORIGINAL_SYSTEM,
COMPATIBLE_SYSTEM
};
// construction/destruction
software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
// inline configuration helpers
software_list_device &set_type(const char *list, softlist_type list_type) { m_list_name.assign(list); m_list_type = list_type; return *this; }
software_list_device &set_original(const char *list) { return set_type(list, SOFTWARE_LIST_ORIGINAL_SYSTEM); }
software_list_device &set_compatible(const char *list) { return set_type(list, SOFTWARE_LIST_COMPATIBLE_SYSTEM); }
software_list_device &set_original(const char *list) { return set_type(list, softlist_type::ORIGINAL_SYSTEM); }
software_list_device &set_compatible(const char *list) { return set_type(list, softlist_type::COMPATIBLE_SYSTEM); }
software_list_device &set_filter(const char *filter) { m_filter = filter; return *this; }
// getters
const std::string &list_name() const { return m_list_name; }
softlist_type list_type() const { return m_list_type; }
bool is_original() const { return softlist_type::ORIGINAL_SYSTEM == m_list_type; }
bool is_compatible() const { return softlist_type::COMPATIBLE_SYSTEM == m_list_type; }
const char *filter() const { return m_filter; }
const char *filename() { return m_file.filename(); }

View File

@ -1273,7 +1273,7 @@ void cli_frontend::verifysoftware(const std::vector<std::string> &args)
for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config()->root_device()))
{
if (swlistdev.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM)
if (swlistdev.is_original())
{
if (list_map.insert(swlistdev.list_name()).second)
{

View File

@ -1940,7 +1940,7 @@ void output_software_list(std::ostream &out, device_t &root)
{
for (const software_list_device &swlist : software_list_device_iterator(root))
{
out << util::string_format("\t\t<softwarelist name=\"%s\" status=\"%s\"", normalize_string(swlist.list_name().c_str()), (swlist.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM) ? "original" : "compatible");
out << util::string_format("\t\t<softwarelist name=\"%s\" status=\"%s\"", normalize_string(swlist.list_name().c_str()), swlist.is_original() ? "original" : "compatible");
if (swlist.filter())
out << util::string_format(" filter=\"%s\"", normalize_string(swlist.filter()));
out << "/>\n";

View File

@ -357,7 +357,7 @@ void menu_software::populate(float &customtop, float &custombottom)
// Add original software lists for this system
software_list_device_iterator iter(machine().config().root_device());
for (software_list_device &swlistdev : iter)
if (swlistdev.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM)
if (swlistdev.is_original())
if (!swlistdev.get_info().empty() && m_interface != nullptr)
{
bool found = false;
@ -374,7 +374,7 @@ void menu_software::populate(float &customtop, float &custombottom)
// add compatible software lists for this system
for (software_list_device &swlistdev : iter)
if (swlistdev.list_type() == SOFTWARE_LIST_COMPATIBLE_SYSTEM)
if (swlistdev.is_compatible())
if (!swlistdev.get_info().empty() && m_interface != nullptr)
{
bool found = false;

View File

@ -842,7 +842,7 @@ void interpro_state::interpro(machine_config &config)
config.set_default_layout(layout_interpro);
// software lists
SOFTWARE_LIST(config, m_softlist).set_type("interpro", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, m_softlist).set_original("interpro");
}
void emerald_state::emerald(machine_config &config)

View File

@ -151,7 +151,7 @@ void lisa_state::lisa(machine_config &config)
sonydriv_floppy_image_device::legacy_2_drives_add(config, &lisa_floppy_interface);
/* software lists */
SOFTWARE_LIST(config, "disk_list").set_type("lisa", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "disk_list").set_original("lisa");
/* via */
VIA6522(config, m_via0, 20.37504_MHz_XTAL / 40); // CPU E clock (nominally 500 kHz)

View File

@ -950,7 +950,7 @@ void mac_state::add_scsi(machine_config &config, bool cdrom)
m_ncr5380->set_scsi_port("scsi");
m_ncr5380->irq_callback().set(FUNC(mac_state::mac_scsi_irq));
SOFTWARE_LIST(config, "hdd_list").set_type("mac_hdd", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd");
}
void mac_state::add_via1_adb(machine_config &config, bool macii)
@ -1089,7 +1089,7 @@ void mac_state::add_macplus_additions(machine_config &config)
m_ram->set_extra_options("1M,2M,2560K,4M");
// software list
SOFTWARE_LIST(config, "flop35_list").set_type("mac_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
}
void mac_state::add_nubus(machine_config &config, bool bank1, bool bank2)
@ -1225,7 +1225,7 @@ void mac_state::macii(machine_config &config, bool cpu, asc_device::asc_type asc
m_ram->set_default_size("2M");
m_ram->set_extra_options("8M,32M,64M,96M,128M");
SOFTWARE_LIST(config, "flop35_list").set_type("mac_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
}
void mac_state::maciihmu(machine_config &config)
@ -1260,7 +1260,7 @@ void mac_state::maciifx(machine_config &config)
m_ram->set_default_size("4M");
m_ram->set_extra_options("8M,16M,32M,64M,96M,128M");
SOFTWARE_LIST(config, "flop35_list").set_type("mac_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
add_nubus(config);
}
@ -1421,7 +1421,7 @@ void mac_state::macse30(machine_config &config)
m_ram->set_default_size("2M");
m_ram->set_extra_options("8M,16M,32M,48M,64M,96M,128M");
SOFTWARE_LIST(config, "flop35_list").set_type("mac_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
}
void mac_state::macpb140(machine_config &config)
@ -1446,7 +1446,7 @@ void mac_state::macpb140(machine_config &config)
m_ram->set_default_size("2M");
m_ram->set_extra_options("4M,6M,8M");
SOFTWARE_LIST(config, "flop35_list").set_type("mac_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
}
// PowerBook 145 = 140 @ 25 MHz (still 2MB RAM - the 145B upped that to 4MB)
@ -1491,7 +1491,7 @@ void mac_state::macpb160(machine_config &config)
m_ram->set_default_size("4M");
m_ram->set_extra_options("8M,12M,16M");
SOFTWARE_LIST(config, "flop35_list").set_type("mac_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
}
void mac_state::macpb180(machine_config &config)
@ -1678,7 +1678,7 @@ void mac_state::macqd700(machine_config &config)
m_ram->set_default_size("4M");
m_ram->set_extra_options("8M,16M,32M,64M,68M,72M,80M,96M,128M");
SOFTWARE_LIST(config, "flop35_list").set_type("mac_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
}
static INPUT_PORTS_START( macadb )

View File

@ -1401,8 +1401,8 @@ void mac128_state::mac512ke(machine_config &config)
MACPDS_SLOT(config, "pds", "macpds", mac_pds_cards, nullptr);
// software list
SOFTWARE_LIST(config, "flop35_list").set_type("mac_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "hdd_list").set_type("mac_hdd", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd");
}
void mac128_state::mac128k(machine_config &config)

View File

@ -118,7 +118,7 @@ void macpci_state::pippin(machine_config &config)
cdrom_image_device &cdrom(CDROM(config, "cdrom", 0));
cdrom.set_interface("pippin_cdrom");
SOFTWARE_LIST(config, "cd_list").set_type("pippin", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cd_list").set_original("pippin");
RAM(config, m_ram);
m_ram->set_default_size("32M");

View File

@ -2009,7 +2009,7 @@ void mvs_led_state::mv1(machine_config &config)
cartslot_config(config, 1);
SOFTWARE_LIST(config, "cart_list").set_type("neogeo", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list").set_original("neogeo");
}
void mvs_led_state::mv1f(machine_config &config)
@ -2024,7 +2024,7 @@ void mvs_led_state::mv1f(machine_config &config)
cartslot_config(config, 1);
SOFTWARE_LIST(config, "cart_list").set_type("neogeo", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list").set_original("neogeo");
}
void mvs_state::mv1fz(machine_config &config)
@ -2036,7 +2036,7 @@ void mvs_state::mv1fz(machine_config &config)
cartslot_config(config, 1);
SOFTWARE_LIST(config, "cart_list").set_type("neogeo", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list").set_original("neogeo");
}
void mvs_led_el_state::mv2f(machine_config &config)
@ -2053,7 +2053,7 @@ void mvs_led_el_state::mv2f(machine_config &config)
cartslot_config(config, 2);
SOFTWARE_LIST(config, "cart_list").set_type("neogeo", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list").set_original("neogeo");
}
void mvs_led_el_state::mv4f(machine_config &config)
@ -2070,7 +2070,7 @@ void mvs_led_el_state::mv4f(machine_config &config)
cartslot_config(config, 4);
SOFTWARE_LIST(config, "cart_list").set_type("neogeo", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list").set_original("neogeo");
}
void mvs_led_el_state::mv6f(machine_config &config)
@ -2087,7 +2087,7 @@ void mvs_led_el_state::mv6f(machine_config &config)
cartslot_config(config, 6);
SOFTWARE_LIST(config, "cart_list").set_type("neogeo", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list").set_original("neogeo");
}
void mvs_led_state::mv1_fixed(machine_config &config)
@ -2146,7 +2146,7 @@ void aes_state::aes(machine_config &config)
NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_controls, "joy", false);
NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_controls, "joy", false);
SOFTWARE_LIST(config, "cart_list").set_type("neogeo", SOFTWARE_LIST_ORIGINAL_SYSTEM).set_filter("AES");
SOFTWARE_LIST(config, "cart_list").set_original("neogeo").set_filter("AES");
}

View File

@ -1065,7 +1065,7 @@ void ngcd_state::neocd(machine_config &config)
NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_controls, "joy", false);
CDROM(config, "cdrom").set_interface("neocd_cdrom");
SOFTWARE_LIST(config, "cd_list").set_type("neocd", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cd_list").set_original("neocd");
m_ym->set_addrmap(0, &ngcd_state::neocd_ym_map);
}

View File

@ -207,14 +207,14 @@ void partner_state::partner(machine_config &config)
cassette.add_route(ALL_OUTPUTS, "mono", 0.05);
cassette.set_interface("partner_cass");
SOFTWARE_LIST(config, "cass_list").set_type("partner_cass", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cass_list").set_original("partner_cass");
FD1793(config, "wd1793", 16_MHz_XTAL / 16);
FLOPPY_CONNECTOR(config, "fd0", "525qd", FLOPPY_525_QD, true, floppy_formats);
FLOPPY_CONNECTOR(config, "fd1", "525qd", FLOPPY_525_QD, true, floppy_formats);
SOFTWARE_LIST(config, "flop_list").set_type("partner_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop_list").set_original("partner_flop");
/* internal ram */
RAM(config, m_ram);

View File

@ -209,7 +209,7 @@ void rmnimbus_state::nimbus(machine_config &config)
msm5205.set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */
msm5205.add_route(ALL_OUTPUTS, MONO_TAG, 0.75);
SOFTWARE_LIST(config, "disk_list").set_type("nimbus", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "disk_list").set_original("nimbus");
}

View File

@ -973,7 +973,7 @@ void ti99_4x_state::ti99_4_common(machine_config& config)
RAM(config, TI99_EXPRAM_TAG).set_default_size("32K").set_default_value(0);
// Software list
SOFTWARE_LIST(config, "cart_list_ti99").set_type("ti99_cart", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list_ti99").set_original("ti99_cart");
// Cassette drives. Second drive is record-only.
SPEAKER(config, "cass_out").front_center();

View File

@ -723,7 +723,7 @@ void ti99_8_state::ti99_8(machine_config& config)
RAM(config, TI998_DRAM_TAG).set_default_size("64K").set_default_value(0);
// Software list
SOFTWARE_LIST(config, "cart_list_ti99").set_type("ti99_cart", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list_ti99").set_original("ti99_cart");
// I/O port
TI99_IOPORT(config, m_ioport, 0, ti99_ioport_options_plain, nullptr);

View File

@ -775,7 +775,7 @@ void tutor_state::tutor(machine_config &config)
GENERIC_CARTSLOT(config, "cartslot", generic_linear_slot, "tutor_cart", "bin");
// software lists
SOFTWARE_LIST(config, "cart_list").set_type("tutor", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list").set_original("tutor");
}

View File

@ -142,7 +142,7 @@ void vectrex_state::vectrex(machine_config &config)
vectrex_cart(slot);
/* software lists */
SOFTWARE_LIST(config, "cart_list").set_type("vectrex", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "cart_list").set_original("vectrex");
}
ROM_START(vectrex)

View File

@ -846,9 +846,9 @@ void vic20_state::vic20(machine_config &config, const char* softlist_filter)
QUICKLOAD(config, "quickload", "p00,prg", CBM_QUICKLOAD_DELAY).set_load_callback(FUNC(vic20_state::quickload_vc20));
SOFTWARE_LIST(config, "cart_list").set_type("vic1001_cart", SOFTWARE_LIST_ORIGINAL_SYSTEM).set_filter(softlist_filter);
SOFTWARE_LIST(config, "cass_list").set_type("vic1001_cass", SOFTWARE_LIST_ORIGINAL_SYSTEM).set_filter(softlist_filter);
SOFTWARE_LIST(config, "flop_list").set_type("vic1001_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM).set_filter(softlist_filter);
SOFTWARE_LIST(config, "cart_list").set_original("vic1001_cart").set_filter(softlist_filter);
SOFTWARE_LIST(config, "cass_list").set_original("vic1001_cass").set_filter(softlist_filter);
SOFTWARE_LIST(config, "flop_list").set_original("vic1001_flop").set_filter(softlist_filter);
RAM(config, m_ram);
m_ram->set_default_size("5K");

View File

@ -793,7 +793,7 @@ void victor9k_state::victor9k(machine_config &config)
RAM(config, m_ram).set_default_size("128K");
SOFTWARE_LIST(config, "flop_list").set_type("victor9k_flop", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop_list").set_original("victor9k_flop");
}

View File

@ -850,7 +850,7 @@ void wicat_state::wicat(machine_config &config)
FLOPPY_CONNECTOR(config, "fdc:2", wicat_floppies, nullptr, floppy_image_device::default_floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, "fdc:3", wicat_floppies, nullptr, floppy_image_device::default_floppy_formats).enable_sound(true);
SOFTWARE_LIST(config, "flop_list").set_type("wicat", SOFTWARE_LIST_ORIGINAL_SYSTEM);
SOFTWARE_LIST(config, "flop_list").set_original("wicat");
}
/* ROM definition */