summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp1
-rw-r--r--src/osd/modules/lib/osdobj_common.h2
-rw-r--r--src/osd/modules/render/aviwrite.cpp13
-rw-r--r--src/osd/modules/render/aviwrite.h4
-rw-r--r--src/osd/modules/render/drawbgfx.cpp2
5 files changed, 13 insertions, 9 deletions
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp
index 7659905ec88..a5e02f2efaf 100644
--- a/src/osd/modules/lib/osdobj_common.cpp
+++ b/src/osd/modules/lib/osdobj_common.cpp
@@ -147,6 +147,7 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_BGFX_DEBUG, "0", OPTION_BOOLEAN, "enable BGFX debugging statistics" },
{ OSDOPTION_BGFX_SCREEN_CHAINS, "default", OPTION_STRING, "comma-delimited list of screen chain JSON names, colon-delimited per-window" },
{ OSDOPTION_BGFX_SHADOW_MASK, "slot-mask.png", OPTION_STRING, "shadow mask texture name" },
+ { OSDOPTION_BGFX_AVI_NAME, OSDOPTVAL_AUTO, OPTION_STRING, "filename for BGFX output logging" },
// End of list
{ nullptr }
diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h
index 8b7e5c1f117..7d4238fcbbd 100644
--- a/src/osd/modules/lib/osdobj_common.h
+++ b/src/osd/modules/lib/osdobj_common.h
@@ -83,6 +83,7 @@
#define OSDOPTION_BGFX_DEBUG "bgfx_debug"
#define OSDOPTION_BGFX_SCREEN_CHAINS "bgfx_screen_chains"
#define OSDOPTION_BGFX_SHADOW_MASK "bgfx_shadow_mask"
+#define OSDOPTION_BGFX_AVI_NAME "bgfx_avi_name"
//============================================================
// TYPE DEFINITIONS
@@ -156,6 +157,7 @@ public:
bool bgfx_debug() const { return bool_value(OSDOPTION_BGFX_DEBUG); }
const char *bgfx_screen_chains() const { return value(OSDOPTION_BGFX_SCREEN_CHAINS); }
const char *bgfx_shadow_mask() const { return value(OSDOPTION_BGFX_SHADOW_MASK); }
+ const char *bgfx_avi_name() const { return value(OSDOPTION_BGFX_AVI_NAME); }
private:
static const options_entry s_option_entries[];
diff --git a/src/osd/modules/render/aviwrite.cpp b/src/osd/modules/render/aviwrite.cpp
index 38bc55f1c0c..64594ff4c91 100644
--- a/src/osd/modules/render/aviwrite.cpp
+++ b/src/osd/modules/render/aviwrite.cpp
@@ -27,14 +27,14 @@ avi_write::~avi_write()
}
}
-void avi_write::record()
+void avi_write::record(const char *name)
{
if (m_recording)
{
end_avi_recording();
}
- begin_avi_recording();
+ begin_avi_recording(name);
}
void avi_write::stop()
@@ -43,7 +43,7 @@ void avi_write::stop()
end_avi_recording();
}
-void avi_write::begin_avi_recording()
+void avi_write::begin_avi_recording(const char *name)
{
// stop any existing recording
end_avi_recording();
@@ -75,13 +75,14 @@ void avi_write::begin_avi_recording()
// create a new temporary movie file
emu_file tempfile(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
-
- osd_file::error filerr = m_machine.video().open_next(tempfile, "avi");
+ const osd_file::error filerr = (!name || !std::strcmp(name, OSDOPTVAL_AUTO))
+ ? m_machine.video().open_next(tempfile, "avi")
+ : tempfile.open(name);
// if we succeeded, make a copy of the name and create the real file over top
if (filerr == osd_file::error::NONE)
{
- std::string fullpath = tempfile.fullpath();
+ const std::string fullpath = tempfile.fullpath();
tempfile.close();
// create the file and free the string
diff --git a/src/osd/modules/render/aviwrite.h b/src/osd/modules/render/aviwrite.h
index cfa7779cf15..3a35ccda52b 100644
--- a/src/osd/modules/render/aviwrite.h
+++ b/src/osd/modules/render/aviwrite.h
@@ -22,7 +22,7 @@ public:
avi_write(running_machine& machine, uint32_t width, uint32_t height);
~avi_write();
- void record();
+ void record(const char *name);
void stop();
void audio_frame(const INT16 *buffer, int samples_this_frame);
void video_frame(bitmap_rgb32& snap);
@@ -31,7 +31,7 @@ public:
bool recording() const { return m_recording; }
private:
- void begin_avi_recording();
+ void begin_avi_recording(const char *name);
void end_avi_recording();
running_machine& m_machine;
diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp
index 79b7c5d4a70..dec0110157a 100644
--- a/src/osd/modules/render/drawbgfx.cpp
+++ b/src/osd/modules/render/drawbgfx.cpp
@@ -270,7 +270,7 @@ void renderer_bgfx::record()
}
else
{
- m_avi_writer->record();
+ m_avi_writer->record(m_options.bgfx_avi_name());
m_avi_target = m_targets->create_target("avibuffer", bgfx::TextureFormat::RGBA8, m_width[0], m_height[0], TARGET_STYLE_CUSTOM, false, true, 1, 0);
m_avi_texture = bgfx::createTexture2D(m_width[0], m_height[0], 1, bgfx::TextureFormat::RGBA8, BGFX_TEXTURE_BLIT_DST | BGFX_TEXTURE_READ_BACK);
}