From 84288bb15c70e0220f15f8e03d296ae0ebb25a69 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 25 Nov 2016 11:14:04 +1100 Subject: [PATCH 1/2] Fix build (nw) --- src/mame/drivers/rainbow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp index 40b29d3c3d1..21959f7f154 100644 --- a/src/mame/drivers/rainbow.cpp +++ b/src/mame/drivers/rainbow.cpp @@ -698,7 +698,7 @@ private: // GDC RESET MACRO - used in "machine_reset" & GDC_EXTRA_REGISTER_w ! #define GDC_RESET_MACRO \ -m_PORT50 = 0; \ \ +m_PORT50 = 0; \ m_GDC_INDIRECT_REGISTER = 0; \ m_GDC_MODE_REGISTER = 0; \ m_GDC_WRITE_MASK = 0; \ From 51f33cf106e99180aff696d74638fd8197faac24 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 25 Nov 2016 12:10:14 +1100 Subject: [PATCH 2/2] Fix key names with -keyboardprovider win32 --- src/osd/modules/input/input_win32.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/osd/modules/input/input_win32.cpp b/src/osd/modules/input/input_win32.cpp index edd378be25d..a4e00eec17f 100644 --- a/src/osd/modules/input/input_win32.cpp +++ b/src/osd/modules/input/input_win32.cpp @@ -14,12 +14,14 @@ // standard windows headers #define WIN32_LEAN_AND_MEAN #include +#include #undef interface #undef min #undef max // MAME headers #include "emu.h" +#include "strconv.h" // MAMEOS headers #include "winmain.h" @@ -81,13 +83,15 @@ public: for (int keynum = 0; keynum < MAX_KEYS; keynum++) { input_item_id itemid = table.map_di_scancode_to_itemid(keynum); - char name[20]; + TCHAR keyname[100]; - // generate/fetch the name - _snprintf(name, ARRAY_LENGTH(name), "Scan%03d", keynum); + // generate the name + if (GetKeyNameText(((keynum & 0x7f) << 16) | ((keynum & 0x80) << 17), keyname, ARRAY_LENGTH(keyname)) == 0) + _sntprintf(keyname, ARRAY_LENGTH(keyname), TEXT("Scan%03d"), keynum); + std::string name = osd::text::from_tstring(keyname); // add the item to the device - devinfo->device()->add_item(name, itemid, generic_button_get_state, &devinfo->keyboard.state[keynum]); + devinfo->device()->add_item(name.c_str(), itemid, generic_button_get_state, &devinfo->keyboard.state[keynum]); } }