summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-01-12 18:17:13 +1100
committer Vas Crabb <vas@vastheman.com>2019-01-12 18:17:13 +1100
commit19612b1f10214581e73e72ba42e9531ac48e4ffe (patch)
tree778992ae06d3226d5f2e1c1a4bb01dd7f4f2f3da
parentb053f0d4839853f8f862a80a75f18d63ae2f3e99 (diff)
apply -verbose after processing command-line options and after first pass over .ini files (nw)
-rw-r--r--src/frontend/mame/clifront.cpp10
-rw-r--r--src/frontend/mame/mame.cpp30
-rw-r--r--src/frontend/mame/mame.h20
-rw-r--r--src/frontend/mame/mameopts.cpp4
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp32
-rw-r--r--src/osd/modules/lib/osdobj_common.h3
-rw-r--r--src/osd/osdepend.h5
7 files changed, 55 insertions, 49 deletions
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index 07ad2e18a9d..97147c76dc9 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -183,9 +183,9 @@ void print_summary(
//-------------------------------------------------
cli_frontend::cli_frontend(emu_options &options, osd_interface &osd)
- : m_options(options),
- m_osd(osd),
- m_result(EMU_ERR_NONE)
+ : m_options(options)
+ , m_osd(osd)
+ , m_result(EMU_ERR_NONE)
{
m_options.add_entries(cli_option_entries);
}
@@ -211,6 +211,7 @@ void cli_frontend::start_execution(mame_machine_manager *manager, const std::vec
try
{
m_options.parse_command_line(args, OPTION_PRIORITY_CMDLINE);
+ m_osd.set_verbose(m_options.verbose());
}
catch (options_exception &ex)
{
@@ -234,7 +235,10 @@ void cli_frontend::start_execution(mame_machine_manager *manager, const std::vec
// read INI's, if appropriate
if (m_options.read_config())
+ {
mame_options::parse_standard_inis(m_options, option_errors);
+ m_osd.set_verbose(m_options.verbose());
+ }
// otherwise, check for a valid system
load_translation(m_options);
diff --git a/src/frontend/mame/mame.cpp b/src/frontend/mame/mame.cpp
index 528a1717a4a..e1eb535ea68 100644
--- a/src/frontend/mame/mame.cpp
+++ b/src/frontend/mame/mame.cpp
@@ -31,12 +31,11 @@
mame_machine_manager* mame_machine_manager::m_manager = nullptr;
-mame_machine_manager* mame_machine_manager::instance(emu_options &options,osd_interface &osd)
+mame_machine_manager* mame_machine_manager::instance(emu_options &options, osd_interface &osd)
{
- if(!m_manager)
- {
- m_manager = global_alloc(mame_machine_manager(options,osd));
- }
+ if (!m_manager)
+ m_manager = global_alloc(mame_machine_manager(options, osd));
+
return m_manager;
}
@@ -49,13 +48,13 @@ mame_machine_manager* mame_machine_manager::instance()
// mame_machine_manager - constructor
//-------------------------------------------------
-mame_machine_manager::mame_machine_manager(emu_options &options,osd_interface &osd)
- : machine_manager(options, osd),
- m_plugins(std::make_unique<plugin_options>()),
- m_lua(global_alloc(lua_engine)),
- m_new_driver_pending(nullptr),
- m_firstrun(true),
- m_autoboot_timer(nullptr)
+mame_machine_manager::mame_machine_manager(emu_options &options,osd_interface &osd) :
+ machine_manager(options, osd),
+ m_plugins(std::make_unique<plugin_options>()),
+ m_lua(global_alloc(lua_engine)),
+ m_new_driver_pending(nullptr),
+ m_firstrun(true),
+ m_autoboot_timer(nullptr)
{
}
@@ -100,7 +99,8 @@ std::vector<std::string> split(const std::string &text, char sep)
{
std::vector<std::string> tokens;
std::size_t start = 0, end = 0;
- while ((end = text.find(sep, start)) != std::string::npos) {
+ while ((end = text.find(sep, start)) != std::string::npos)
+ {
std::string temp = text.substr(start, end - start);
if (temp != "") tokens.push_back(temp);
start = end + 1;
@@ -120,8 +120,8 @@ void mame_machine_manager::start_luaengine()
{
m_plugins->parse_json(pluginpath);
}
- std::vector<std::string> include = split(options().plugin(),',');
- std::vector<std::string> exclude = split(options().no_plugin(),',');
+ std::vector<std::string> include = split(options().plugin(), ',');
+ std::vector<std::string> exclude = split(options().no_plugin(), ',');
{
// parse the file
// attempt to open the output file
diff --git a/src/frontend/mame/mame.h b/src/frontend/mame/mame.h
index 3700aaab81b..01a7235972b 100644
--- a/src/frontend/mame/mame.h
+++ b/src/frontend/mame/mame.h
@@ -15,26 +15,20 @@
class plugin_options;
class osd_interface;
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
class lua_engine;
class cheat_manager;
class inifile_manager;
class favorite_manager;
class mame_ui_manager;
-namespace ui {
-} // namespace ui
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
// ======================> machine_manager
class mame_machine_manager : public machine_manager
{
- DISABLE_COPYING(mame_machine_manager);
-private:
- // construction/destruction
- mame_machine_manager(emu_options &options, osd_interface &osd);
public:
static mame_machine_manager *instance(emu_options &options, osd_interface &osd);
static mame_machine_manager *instance();
@@ -64,7 +58,15 @@ public:
cheat_manager &cheat() const { assert(m_cheat != nullptr); return *m_cheat; }
inifile_manager &inifile() const { assert(m_inifile != nullptr); return *m_inifile; }
favorite_manager &favorite() const { assert(m_favorite != nullptr); return *m_favorite; }
+
private:
+ // construction
+ mame_machine_manager(emu_options &options, osd_interface &osd);
+ mame_machine_manager(mame_machine_manager const &) = delete;
+ mame_machine_manager(mame_machine_manager &&) = delete;
+ mame_machine_manager &operator=(mame_machine_manager const &) = delete;
+ mame_machine_manager &operator=(mame_machine_manager &&) = delete;
+
std::unique_ptr<plugin_options> m_plugins; // pointer to plugin options
lua_engine * m_lua;
diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp
index d6c1e1044cf..47f1a71c595 100644
--- a/src/frontend/mame/mameopts.cpp
+++ b/src/frontend/mame/mameopts.cpp
@@ -39,8 +39,8 @@ void mame_options::parse_standard_inis(emu_options &options, std::ostream &error
parse_one_ini(options, "debug", OPTION_PRIORITY_DEBUG_INI, &error_stream);
// if we have a valid system driver, parse system-specific INI files
- const game_driver *cursystem = (driver == nullptr) ? system(options) : driver;
- if (cursystem == nullptr)
+ game_driver const *const cursystem = !driver ? system(options) : driver;
+ if (!cursystem)
return;
// parse "vertical.ini" or "horizont.ini"
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp
index 3cb67e6ded4..d3f5f35192e 100644
--- a/src/osd/modules/lib/osdobj_common.cpp
+++ b/src/osd/modules/lib/osdobj_common.cpp
@@ -163,7 +163,7 @@ const options_entry osd_options::s_option_entries[] =
};
osd_options::osd_options()
-: emu_options()
+ : emu_options()
{
add_entries(osd_options::s_option_entries);
}
@@ -176,20 +176,20 @@ std::list<std::shared_ptr<osd_window>> osd_common_t::s_window_list;
//-------------------------------------------------
osd_common_t::osd_common_t(osd_options &options)
- : osd_output(), m_machine(nullptr),
- m_options(options),
- m_print_verbose(false),
- m_font_module(nullptr),
- m_sound(nullptr),
- m_debugger(nullptr),
- m_midi(nullptr),
- m_keyboard_input(nullptr),
- m_mouse_input(nullptr),
- m_lightgun_input(nullptr),
- m_joystick_input(nullptr),
- m_output(nullptr),
- m_monitor_module(nullptr),
- m_watchdog(nullptr)
+ : osd_output(), m_machine(nullptr)
+ , m_options(options)
+ , m_print_verbose(false)
+ , m_font_module(nullptr)
+ , m_sound(nullptr)
+ , m_debugger(nullptr)
+ , m_midi(nullptr)
+ , m_keyboard_input(nullptr)
+ , m_mouse_input(nullptr)
+ , m_lightgun_input(nullptr)
+ , m_joystick_input(nullptr)
+ , m_output(nullptr)
+ , m_monitor_module(nullptr)
+ , m_watchdog(nullptr)
{
osd_output::push(this);
}
@@ -409,7 +409,6 @@ void osd_common_t::output_callback(osd_output_channel channel, const char *msg,
void osd_common_t::init(running_machine &machine)
{
- //
// This function is responsible for initializing the OSD-specific
// video and input functionality, and registering that functionality
// with the MAME core.
@@ -437,7 +436,6 @@ void osd_common_t::init(running_machine &machine)
//
// Audio initialization may eventually move into here as well,
// instead of relying on independent callbacks from each system.
- //
m_machine = &machine;
diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h
index 8c275ebf48d..af4d2d332bc 100644
--- a/src/osd/modules/lib/osdobj_common.h
+++ b/src/osd/modules/lib/osdobj_common.h
@@ -245,11 +245,12 @@ public:
// osd_output interface ...
virtual void output_callback(osd_output_channel channel, const char *msg, va_list args) override;
bool verbose() const { return m_print_verbose; }
- void set_verbose(bool print_verbose) { m_print_verbose = print_verbose; }
+ virtual void set_verbose(bool print_verbose) override { m_print_verbose = print_verbose; }
void notify(const char *outname, int32_t value) const { m_output->notify(outname, value); }
static std::list<std::shared_ptr<osd_window>> s_window_list;
+
protected:
virtual bool input_init();
virtual void input_pause();
diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h
index 07f6ddd99f1..2587b93e560 100644
--- a/src/osd/osdepend.h
+++ b/src/osd/osdepend.h
@@ -7,11 +7,11 @@
OS-dependent code interface.
*******************************************************************c********/
+#ifndef MAME_OSD_OSDEPEND_H
+#define MAME_OSD_OSDEPEND_H
#pragma once
-#ifndef MAME_OSD_OSDEPEND_H
-#define MAME_OSD_OSDEPEND_H
#include "emucore.h"
#include "osdcore.h"
@@ -64,6 +64,7 @@ public:
// general overridables
virtual void init(running_machine &machine) = 0;
virtual void update(bool skip_redraw) = 0;
+ virtual void set_verbose(bool print_verbose) = 0;
// debugger overridables
virtual void init_debugger() = 0;