summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules')
-rw-r--r--src/osd/modules/debugger/debuggdbstub.cpp4
-rw-r--r--src/osd/modules/font/font_dwrite.cpp2
-rw-r--r--src/osd/modules/font/font_osx.cpp6
-rw-r--r--src/osd/modules/font/font_sdl.cpp6
-rw-r--r--src/osd/modules/input/input_sdlcommon.h2
-rw-r--r--src/osd/modules/input/input_x11.cpp4
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp37
-rw-r--r--src/osd/modules/lib/osdobj_common.h4
-rw-r--r--src/osd/modules/monitor/monitor_dxgi.cpp2
-rw-r--r--src/osd/modules/monitor/monitor_mac.cpp2
-rw-r--r--src/osd/modules/monitor/monitor_sdl.cpp5
-rw-r--r--src/osd/modules/monitor/monitor_win32.cpp2
-rw-r--r--src/osd/modules/render/bgfx/effect.cpp2
-rw-r--r--src/osd/modules/render/bgfx/targetmanager.cpp2
-rw-r--r--src/osd/modules/render/drawd3d.cpp4
15 files changed, 44 insertions, 40 deletions
diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp
index 4c7e4e3707e..e30f8712d2f 100644
--- a/src/osd/modules/debugger/debuggdbstub.cpp
+++ b/src/osd/modules/debugger/debuggdbstub.cpp
@@ -544,7 +544,7 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop)
uint64_t datamask = entry->datamask();
int index = entry->index();
const std::string &format_string = entry->format_string();
- osd_printf_info("[%3d] datasize %d mask %016" PRIx64 " [%s] [%s]\n", index, datasize, datamask, symbol, format_string.c_str());
+ osd_printf_info("[%3d] datasize %d mask %016" PRIx64 " [%s] [%s]\n", index, datasize, datamask, symbol, format_string);
}
#endif
@@ -583,7 +583,7 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop)
#if 0
for ( const auto &reg: m_gdb_registers )
- osd_printf_info(" %3d (%d) %d %d [%s]\n", reg.gdb_regnum, reg.state_index, reg.gdb_bitsize, reg.gdb_type, reg.gdb_name.c_str());
+ osd_printf_info(" %3d (%d) %d %d [%s]\n", reg.gdb_regnum, reg.state_index, reg.gdb_bitsize, reg.gdb_type, reg.gdb_name);
#endif
std::string socket_name = string_format("socket.localhost:%d", m_debugger_port);
diff --git a/src/osd/modules/font/font_dwrite.cpp b/src/osd/modules/font/font_dwrite.cpp
index f60ef7580c4..04ccf11a7ce 100644
--- a/src/osd/modules/font/font_dwrite.cpp
+++ b/src/osd/modules/font/font_dwrite.cpp
@@ -624,7 +624,7 @@ private:
HR_RETHR(fonts->FindFamilyName(familyName.c_str(), &family_index, &exists));
if (!exists)
{
- osd_printf_error("Font with family name %S does not exist.\n", familyName.c_str());
+ osd_printf_error("Font with family name %s does not exist.\n", osd::text::from_wstring(familyName));
return E_FAIL;
}
diff --git a/src/osd/modules/font/font_osx.cpp b/src/osd/modules/font/font_osx.cpp
index 5074c1f4bcd..e621a715675 100644
--- a/src/osd/modules/font/font_osx.cpp
+++ b/src/osd/modules/font/font_osx.cpp
@@ -54,7 +54,7 @@ private:
bool osd_font_osx::open(std::string const &font_path, std::string const &name, int &height)
{
- osd_printf_verbose("osd_font_osx::open: name=\"%s\"\n", name.c_str());
+ osd_printf_verbose("osd_font_osx::open: name=\"%s\"\n", name);
CFStringRef const font_name(CFStringCreateWithCString(nullptr, name.c_str(), kCFStringEncodingUTF8));
if (!font_name)
{
@@ -73,7 +73,7 @@ bool osd_font_osx::open(std::string const &font_path, std::string const &name, i
CFRelease(font_name);
if (!font_descriptor)
{
- osd_printf_verbose("osd_font_osx::open: failed to create CoreText font descriptor for \"%s\"\n", name.c_str());
+ osd_printf_verbose("osd_font_osx::open: failed to create CoreText font descriptor for \"%s\"\n", name);
return false;
}
@@ -81,7 +81,7 @@ bool osd_font_osx::open(std::string const &font_path, std::string const &name, i
CFRelease(font_descriptor);
if (!ct_font)
{
- osd_printf_verbose("osd_font_osx::open: failed to create CoreText font for \"%s\"\n", name.c_str());
+ osd_printf_verbose("osd_font_osx::open: failed to create CoreText font for \"%s\"\n", name);
return false;
}
diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp
index 62a97d39149..a473b71b35a 100644
--- a/src/osd/modules/font/font_sdl.cpp
+++ b/src/osd/modules/font/font_sdl.cpp
@@ -88,7 +88,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name,
// if no success, try the font path
if (!font)
{
- osd_printf_verbose("Searching font %s in -%s path/s\n", family.c_str(), font_path.c_str());
+ osd_printf_verbose("Searching font %s in -%s path/s\n", family, font_path);
//emu_file file(options().font_path(), OPEN_FLAG_READ);
emu_file file(font_path.c_str(), OPEN_FLAG_READ);
if (file.open(family.c_str()) == osd_file::error::NONE)
@@ -96,7 +96,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name,
std::string full_name = file.fullpath();
font = TTF_OpenFont_Magic(full_name, POINT_SIZE, 0);
if (font)
- osd_printf_verbose("Found font %s\n", full_name.c_str());
+ osd_printf_verbose("Found font %s\n", full_name);
}
}
@@ -112,7 +112,7 @@ bool osd_font_sdl::open(std::string const &font_path, std::string const &_name,
{
if (!BDF_Check_Magic(name))
{
- osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.c_str());
+ osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name);
}
return false;
}
diff --git a/src/osd/modules/input/input_sdlcommon.h b/src/osd/modules/input/input_sdlcommon.h
index 377b04d71c9..ee13ce307dd 100644
--- a/src/osd/modules/input/input_sdlcommon.h
+++ b/src/osd/modules/input/input_sdlcommon.h
@@ -195,7 +195,7 @@ static inline void devmap_init(running_machine &machine, device_map_t *devmap, c
{
// remove the spaces from the name store it in the index
devmap->map[dev].name = remove_spaces(dev_name);
- osd_printf_verbose("%s: Logical id %d: %s\n", label, dev + 1, devmap->map[dev].name.c_str());
+ osd_printf_verbose("%s: Logical id %d: %s\n", label, dev + 1, devmap->map[dev].name);
devmap->initialized = 1;
}
}
diff --git a/src/osd/modules/input/input_x11.cpp b/src/osd/modules/input/input_x11.cpp
index 40df3d528b6..07ade15c764 100644
--- a/src/osd/modules/input/input_x11.cpp
+++ b/src/osd/modules/input/input_x11.cpp
@@ -469,7 +469,7 @@ public:
// Register and add the device
devinfo = create_lightgun_device(machine, index);
- osd_printf_verbose("%i: %s\n", index, name.c_str());
+ osd_printf_verbose("%i: %s\n", index, name);
// Find the device info associated with the name
info = find_device_info(m_display, name.c_str(), 0);
@@ -477,7 +477,7 @@ public:
// If we couldn't find the device, skip
if (info == nullptr)
{
- osd_printf_verbose("Can't find device %s!\n", name.c_str());
+ osd_printf_verbose("Can't find device %s!\n", name);
continue;
}
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp
index 51474b810b0..3cba4c81cfb 100644
--- a/src/osd/modules/lib/osdobj_common.cpp
+++ b/src/osd/modules/lib/osdobj_common.cpp
@@ -13,6 +13,9 @@
#include "osdepend.h"
#include "modules/lib/osdobj_common.h"
+#include <iostream>
+
+
const options_entry osd_options::s_option_entries[] =
{
{ nullptr, nullptr, OPTION_HEADER, "OSD KEYBOARD MAPPING OPTIONS" },
@@ -381,28 +384,28 @@ void osd_common_t::update_option(const std::string &key, std::vector<const char
//-------------------------------------------------
// output_callback - callback for osd_printf_...
//-------------------------------------------------
-void osd_common_t::output_callback(osd_output_channel channel, const char *msg, va_list args)
+void osd_common_t::output_callback(osd_output_channel channel, const util::format_argument_pack<std::ostream> &args)
{
switch (channel)
{
- case OSD_OUTPUT_CHANNEL_ERROR:
- case OSD_OUTPUT_CHANNEL_WARNING:
- vfprintf(stderr, msg, args);
- break;
- case OSD_OUTPUT_CHANNEL_INFO:
- case OSD_OUTPUT_CHANNEL_LOG:
- vfprintf(stdout, msg, args);
- break;
- case OSD_OUTPUT_CHANNEL_VERBOSE:
- if (verbose()) vfprintf(stdout, msg, args);
- break;
- case OSD_OUTPUT_CHANNEL_DEBUG:
+ case OSD_OUTPUT_CHANNEL_ERROR:
+ case OSD_OUTPUT_CHANNEL_WARNING:
+ util::stream_format(std::cerr, args);
+ break;
+ case OSD_OUTPUT_CHANNEL_INFO:
+ case OSD_OUTPUT_CHANNEL_LOG:
+ util::stream_format(std::cout, args);
+ break;
+ case OSD_OUTPUT_CHANNEL_VERBOSE:
+ if (verbose()) util::stream_format(std::cout, args);
+ break;
+ case OSD_OUTPUT_CHANNEL_DEBUG:
#ifdef MAME_DEBUG
- vfprintf(stdout, msg, args);
+ util::stream_format(std::cout, args);
#endif
- break;
- default:
- break;
+ break;
+ default:
+ break;
}
}
diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h
index 37e043f53ad..4a377276855 100644
--- a/src/osd/modules/lib/osdobj_common.h
+++ b/src/osd/modules/lib/osdobj_common.h
@@ -245,7 +245,7 @@ public:
virtual osd_options &options() { return m_options; }
// osd_output interface ...
- virtual void output_callback(osd_output_channel channel, const char *msg, va_list args) override;
+ virtual void output_callback(osd_output_channel channel, const util::format_argument_pack<std::ostream> &args) override;
bool verbose() const { return m_print_verbose; }
virtual void set_verbose(bool print_verbose) override { m_print_verbose = print_verbose; }
@@ -279,7 +279,7 @@ private:
opt_val = "";
else if (!m_mod_man.type_has_name(opt_name.c_str(), opt_val.c_str()))
{
- osd_printf_warning("Value %s not supported for option %s - falling back to auto\n", opt_val.c_str(), opt_name.c_str());
+ osd_printf_warning("Value %s not supported for option %s - falling back to auto\n", opt_val, opt_name);
opt_val = "";
}
return m_mod_man.select_module(opt_name.c_str(), opt_val.c_str());
diff --git a/src/osd/modules/monitor/monitor_dxgi.cpp b/src/osd/modules/monitor/monitor_dxgi.cpp
index 3eadadced24..6638f98806c 100644
--- a/src/osd/modules/monitor/monitor_dxgi.cpp
+++ b/src/osd/modules/monitor/monitor_dxgi.cpp
@@ -166,7 +166,7 @@ protected:
{
for (auto monitor : list())
{
- osd_printf_verbose("Video: Monitor %I64u = \"%s\" %s\n", monitor->oshandle(), monitor->devicename().c_str(), monitor->is_primary() ? "(primary)" : "");
+ osd_printf_verbose("Video: Monitor %I64u = \"%s\" %s\n", monitor->oshandle(), monitor->devicename(), monitor->is_primary() ? "(primary)" : "");
}
}
diff --git a/src/osd/modules/monitor/monitor_mac.cpp b/src/osd/modules/monitor/monitor_mac.cpp
index 74523105cf0..8e79978433b 100644
--- a/src/osd/modules/monitor/monitor_mac.cpp
+++ b/src/osd/modules/monitor/monitor_mac.cpp
@@ -115,7 +115,7 @@ protected:
// allocate a new monitor info
std::shared_ptr<osd_monitor_info> monitor = std::make_shared<mac_monitor_info>(*this, displayList[disp], temp, 1.0f);
- osd_printf_verbose("Adding monitor %s (%d x %d)\n", monitor->devicename().c_str(),
+ osd_printf_verbose("Adding monitor %s (%d x %d)\n", monitor->devicename(),
monitor->position_size().width(), monitor->position_size().height());
// guess the aspect ratio assuming square pixels
diff --git a/src/osd/modules/monitor/monitor_sdl.cpp b/src/osd/modules/monitor/monitor_sdl.cpp
index b32ade230e1..e3a97fef7ec 100644
--- a/src/osd/modules/monitor/monitor_sdl.cpp
+++ b/src/osd/modules/monitor/monitor_sdl.cpp
@@ -118,8 +118,9 @@ protected:
// allocate a new monitor info
std::shared_ptr<osd_monitor_info> monitor = std::make_shared<sdl_monitor_info>(*this, i, temp, 1.0f);
- osd_printf_verbose("Adding monitor %s (%d x %d)\n", monitor->devicename().c_str(),
- monitor->position_size().width(), monitor->position_size().height());
+ osd_printf_verbose("Adding monitor %s (%d x %d)\n",
+ monitor->devicename(),
+ monitor->position_size().width(), monitor->position_size().height());
// guess the aspect ratio assuming square pixels
monitor->set_aspect(static_cast<float>(monitor->position_size().width()) / static_cast<float>(monitor->position_size().height()));
diff --git a/src/osd/modules/monitor/monitor_win32.cpp b/src/osd/modules/monitor/monitor_win32.cpp
index 5a7405c463c..6bcd6094e83 100644
--- a/src/osd/modules/monitor/monitor_win32.cpp
+++ b/src/osd/modules/monitor/monitor_win32.cpp
@@ -96,7 +96,7 @@ protected:
{
for (auto monitor : list())
{
- osd_printf_verbose("Video: Monitor %I64u = \"%s\" %s\n", monitor->oshandle(), monitor->devicename().c_str(), monitor->is_primary() ? "(primary)" : "");
+ osd_printf_verbose("Video: Monitor %I64u = \"%s\" %s\n", monitor->oshandle(), monitor->devicename(), monitor->is_primary() ? "(primary)" : "");
}
}
diff --git a/src/osd/modules/render/bgfx/effect.cpp b/src/osd/modules/render/bgfx/effect.cpp
index fb3d7d933ba..da5207f114b 100644
--- a/src/osd/modules/render/bgfx/effect.cpp
+++ b/src/osd/modules/render/bgfx/effect.cpp
@@ -21,7 +21,7 @@ bgfx_effect::bgfx_effect(uint64_t state, bgfx::ShaderHandle vertex_shader, bgfx:
{
if (m_uniforms[uniforms[i]->name()] != nullptr)
{
- osd_printf_verbose("Uniform %s appears to be duplicated in one or more effects, please double-check the effect JSON files.\n", uniforms[i]->name().c_str());
+ osd_printf_verbose("Uniform %s appears to be duplicated in one or more effects, please double-check the effect JSON files.\n", uniforms[i]->name());
delete uniforms[i];
continue;
}
diff --git a/src/osd/modules/render/bgfx/targetmanager.cpp b/src/osd/modules/render/bgfx/targetmanager.cpp
index dfc1678ee34..35973ee584f 100644
--- a/src/osd/modules/render/bgfx/targetmanager.cpp
+++ b/src/osd/modules/render/bgfx/targetmanager.cpp
@@ -81,7 +81,7 @@ bgfx_target* target_manager::target(uint32_t screen, std::string name)
bgfx_target* target = m_targets[full_name];
if (target == nullptr)
{
- osd_printf_verbose("Warning: Attempting to retrieve a nonexistent target '%s' for screen %d\n", name.c_str(), screen);
+ osd_printf_verbose("Warning: Attempting to retrieve a nonexistent target '%s' for screen %d\n", name, screen);
}
return target;
}
diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp
index fd1331c47eb..140315620d9 100644
--- a/src/osd/modules/render/drawd3d.cpp
+++ b/src/osd/modules/render/drawd3d.cpp
@@ -1227,7 +1227,7 @@ int renderer_d3d9::config_adapter_mode()
// make sure it's a pixel format we can get behind
if (m_pixformat != D3DFMT_X1R5G5B5 && m_pixformat != D3DFMT_R5G6B5 && m_pixformat != D3DFMT_X8R8G8B8)
{
- osd_printf_error("Device %s currently in an unsupported mode\n", win->monitor()->devicename().c_str());
+ osd_printf_error("Device %s currently in an unsupported mode\n", win->monitor()->devicename());
return 1;
}
}
@@ -1250,7 +1250,7 @@ int renderer_d3d9::config_adapter_mode()
result = d3dintf->d3dobj->CheckDeviceType(m_adapter, D3DDEVTYPE_HAL, m_pixformat, m_pixformat, !win->fullscreen());
if (FAILED(result))
{
- osd_printf_error("Proposed video mode not supported on device %s\n", win->monitor()->devicename().c_str());
+ osd_printf_error("Proposed video mode not supported on device %s\n", win->monitor()->devicename());
return 1;
}