diff --git a/docs/source/techspecs/layout_script.rst b/docs/source/techspecs/layout_script.rst
index 7e5b7419bb7..b520a0690a4 100644
--- a/docs/source/techspecs/layout_script.rst
+++ b/docs/source/techspecs/layout_script.rst
@@ -495,8 +495,8 @@ providing what’s needed:
* ``emu.print_verbose``, ``emu.print_error``, ``emu.print_warning``,
``emu.print_info`` and ``emu.print_debug`` functions for diagnostic output.
* Standard Lua ``tonumber``, ``tostring``, ``pairs`` and ``ipairs`` functions,
- and ``table`` and ``string`` objects for manipulating strings, tables and
- other containers.
+ and ``math``, ``table`` and ``string`` objects for manipulating numbers,r
+ strings, tables and other containers.
* Standard Lua ``print`` function for text output to the console.
diff --git a/plugins/layout/init.lua b/plugins/layout/init.lua
index e4466a15912..d4c9a535f34 100644
--- a/plugins/layout/init.lua
+++ b/plugins/layout/init.lua
@@ -41,6 +41,7 @@ function layout.startplugin()
print_info = emu.print_info,
print_debug = emu.print_debug },
file = file,
+ math = math,
print = print,
pairs = pairs,
ipairs = ipairs,
diff --git a/src/frontend/mame/ui/tapectrl.cpp b/src/frontend/mame/ui/tapectrl.cpp
index b18c680ab3b..a80e5856ed1 100644
--- a/src/frontend/mame/ui/tapectrl.cpp
+++ b/src/frontend/mame/ui/tapectrl.cpp
@@ -69,12 +69,6 @@ menu_tape_control::menu_tape_control(mame_ui_manager &mui, render_container &con
if (device)
{
- m_notifier = device->add_media_change_notifier(
- [this] (device_image_interface::media_change_event ev)
- {
- // repopulate the menu if an image is mounted or unmounted
- reset(reset_options::REMEMBER_POSITION);
- });
}
}
@@ -94,9 +88,17 @@ menu_tape_control::~menu_tape_control()
void menu_tape_control::populate()
{
+ m_notifier.reset();
m_slider_item_index = -1;
if (current_device())
{
+ // repopulate the menu if an image is mounted or unmounted
+ m_notifier = current_device()->add_media_change_notifier(
+ [this] (device_image_interface::media_change_event ev)
+ {
+ reset(reset_options::REMEMBER_POSITION);
+ });
+
// name of tape
item_append(current_display_name(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", current_display_flags(), TAPECMD_SELECT);
diff --git a/src/mame/layout/mtouchxl.lay b/src/mame/layout/mtouchxl.lay
new file mode 100644
index 00000000000..32b8d1235f6
--- /dev/null
+++ b/src/mame/layout/mtouchxl.lay
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/mame/merit/mtouchxl.cpp b/src/mame/merit/mtouchxl.cpp
index b422d8cc417..95537dae9e0 100644
--- a/src/mame/merit/mtouchxl.cpp
+++ b/src/mame/merit/mtouchxl.cpp
@@ -30,26 +30,30 @@
//#define REAL_PCI_CHIPSET
#include "emu.h"
+
#include "bus/ata/atapicdr.h"
#include "bus/ata/hdd.h"
#include "bus/isa/isa_cards.h"
#include "cpu/i386/i386.h"
-#include "machine/at.h"
-#include "machine/ram.h"
#include "machine/8042kbdc.h"
-#include "machine/nvram.h"
-#include "machine/ins8250.h"
-#include "machine/microtch.h"
+#include "machine/at.h"
#include "machine/bankdev.h"
-#include "machine/intelfsh.h"
-#include "machine/ds128x.h"
#include "machine/ds1205.h"
+#include "machine/ds128x.h"
+#include "machine/ins8250.h"
+#include "machine/intelfsh.h"
+#include "machine/microtch.h"
+#include "machine/nvram.h"
+#include "machine/ram.h"
#ifdef REAL_PCI_CHIPSET
#include "machine/sis85c496.h"
#endif
#include "sound/ad1848.h"
+
#include "speaker.h"
+#include "mtouchxl.lh"
+
namespace {
@@ -287,6 +291,8 @@ void mtxl_state::at486(machine_config &config)
// FIXME: This MCFG fragment does not compile. -R
//MCFG_SIS85C496_ADD(":pci:05.0", ":maincpu", 32*1024*1024)
#endif
+
+ config.set_default_layout(layout_mtouchxl);
}
void mtxl_state::at486hd(machine_config &config)
@@ -346,6 +352,8 @@ void mtxl_state::at486hd(machine_config &config)
// FIXME: This MCFG fragment does not compile. -R
//MCFG_SIS85C496_ADD(":pci:05.0", ":maincpu", 32*1024*1024)
#endif
+
+ config.set_default_layout(layout_mtouchxl);
}
#ifdef REAL_PCI_CHIPSET
diff --git a/src/osd/modules/debugger/debugwin.cpp b/src/osd/modules/debugger/debugwin.cpp
index 43d20ae371d..6498a95fcd3 100644
--- a/src/osd/modules/debugger/debugwin.cpp
+++ b/src/osd/modules/debugger/debugwin.cpp
@@ -214,7 +214,7 @@ void debugger_windows::wait_for_debugger(device_t &device, bool firststop)
// process everything else
default:
- winwindow_dispatch_message(*m_machine, &message);
+ winwindow_dispatch_message(*m_machine, message);
break;
}
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index c4929f1d82c..cdd847cca8c 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -464,7 +464,7 @@ void windows_osd_interface::process_events(bool ingame, bool nodispatch)
// dispatch if necessary
if (dispatch)
- winwindow_dispatch_message(machine(), &message);
+ winwindow_dispatch_message(machine(), message);
}
}
while (ui_temp_pause > 0);
@@ -480,12 +480,12 @@ void windows_osd_interface::process_events(bool ingame, bool nodispatch)
// (main thread)
//============================================================
-void winwindow_dispatch_message(running_machine &machine, MSG *message)
+void winwindow_dispatch_message(running_machine &machine, MSG const &message)
{
assert(GetCurrentThreadId() == main_threadid);
// dispatch our special communication messages
- switch (message->message)
+ switch (message.message)
{
// special case for quit
case WM_QUIT:
@@ -494,8 +494,8 @@ void winwindow_dispatch_message(running_machine &machine, MSG *message)
// everything else dispatches normally
default:
- TranslateMessage(message);
- DispatchMessage(message);
+ TranslateMessage(&message);
+ DispatchMessage(&message);
break;
}
}
@@ -2293,17 +2293,17 @@ std::vector::iterator win_window_info::find_m
bool winwindow_qt_filter(void *message)
{
- MSG *msg = (MSG *)message;
+ MSG *const msg = reinterpret_cast(message);
- if(is_mame_window(msg->hwnd) || (!msg->hwnd && (msg->message >= WM_USER)))
+ if (is_mame_window(msg->hwnd) || (!msg->hwnd && (msg->message >= WM_USER)))
{
LONG_PTR ptr;
- if(msg->hwnd) // get the machine associated with this window
+ if (msg->hwnd) // get the machine associated with this window
ptr = GetWindowLongPtr(msg->hwnd, GWLP_USERDATA);
else // any one will have to do
ptr = (LONG_PTR)osd_common_t::window_list().front().get();
- winwindow_dispatch_message(((win_window_info *)ptr)->machine(), msg);
+ winwindow_dispatch_message(reinterpret_cast(ptr)->machine(), *msg);
return true;
}
return false;
diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h
index bdfd8a79b61..ada71f1cba7 100644
--- a/src/osd/windows/window.h
+++ b/src/osd/windows/window.h
@@ -207,7 +207,7 @@ void winwindow_toggle_fsfx(void);
void winwindow_ui_pause(running_machine &machine, int pause);
int winwindow_ui_is_paused(running_machine &machine);
-void winwindow_dispatch_message(running_machine &machine, MSG *message);
+void winwindow_dispatch_message(running_machine &machine, MSG const &message);