summaryrefslogtreecommitdiffstats
path: root/docs/release/src/osd
diff options
context:
space:
mode:
Diffstat (limited to 'docs/release/src/osd')
-rw-r--r--docs/release/src/osd/modules/render/drawd3d.cpp2753
-rw-r--r--docs/release/src/osd/windows/winmain.cpp700
-rw-r--r--docs/release/src/osd/windows/winmain.h360
-rw-r--r--docs/release/src/osd/winui/bitmask.cpp146
-rw-r--r--docs/release/src/osd/winui/bitmask.h33
-rw-r--r--docs/release/src/osd/winui/columnedit.cpp426
-rw-r--r--docs/release/src/osd/winui/columnedit.h15
-rw-r--r--docs/release/src/osd/winui/datamap.cpp765
-rw-r--r--docs/release/src/osd/winui/datamap.h73
-rw-r--r--docs/release/src/osd/winui/dialogs.cpp847
-rw-r--r--docs/release/src/osd/winui/dialogs.h18
-rw-r--r--docs/release/src/osd/winui/dijoystick.cpp758
-rw-r--r--docs/release/src/osd/winui/dijoystick.h63
-rw-r--r--docs/release/src/osd/winui/directinput.cpp143
-rw-r--r--docs/release/src/osd/winui/directinput.h23
-rw-r--r--docs/release/src/osd/winui/directories.cpp703
-rw-r--r--docs/release/src/osd/winui/directories.h83
-rw-r--r--docs/release/src/osd/winui/dirwatch.cpp346
-rw-r--r--docs/release/src/osd/winui/dirwatch.h14
-rw-r--r--docs/release/src/osd/winui/game_opts.h367
-rw-r--r--docs/release/src/osd/winui/hbmame.rc20
-rw-r--r--docs/release/src/osd/winui/hbmameui.rc1466
-rw-r--r--docs/release/src/osd/winui/help.cpp107
-rw-r--r--docs/release/src/osd/winui/help.h47
-rw-r--r--docs/release/src/osd/winui/help/cntx_help.txt220
-rw-r--r--docs/release/src/osd/winui/help/docs/Command Line Settings.htm1377
-rw-r--r--docs/release/src/osd/winui/help/docs/Mame License.htm57
-rw-r--r--docs/release/src/osd/winui/help/docs/Mame Statement of Purpose.htm79
-rw-r--r--docs/release/src/osd/winui/help/docs/whatsnew.txt511
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_art.htm139
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_changes.txt2132
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_credits.htm141
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_download.htm62
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_filemenu.htm625
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_help.htm86
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_installprocedures.htm176
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_optionsmenu.htm639
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_overview.htm529
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_playing.htm136
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_properties.htm1034
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_settings.htm96
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_support.htm739
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_systemreq.htm82
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_viewmenu.htm160
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_visual_elements.htm155
-rw-r--r--docs/release/src/osd/winui/help/html/mameui_whatsnew32.htm2058
-rw-r--r--docs/release/src/osd/winui/help/images/1.jpgbin0 -> 33410 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/2.jpgbin0 -> 30360 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/3.jpgbin0 -> 27190 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/4.jpgbin0 -> 22673 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/5.jpgbin0 -> 26135 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/6.jpgbin0 -> 27544 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/7.jpgbin0 -> 27304 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/8.jpgbin0 -> 20064 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/bkground.gifbin0 -> 22558 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/folder.gifbin0 -> 4741 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/int.jpgbin0 -> 72956 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/mame321.gifbin0 -> 917 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/statusbar.gifbin0 -> 1388 bytes
-rw-r--r--docs/release/src/osd/winui/help/images/toolbar.gifbin0 -> 1548 bytes
-rw-r--r--docs/release/src/osd/winui/help/mameui.hhc122
-rw-r--r--docs/release/src/osd/winui/help/mameui.hhk9
-rw-r--r--docs/release/src/osd/winui/help/mameui.hhp24
-rw-r--r--docs/release/src/osd/winui/help/mameui.hm135
-rw-r--r--docs/release/src/osd/winui/help/reshelp.h4
-rw-r--r--docs/release/src/osd/winui/help/stoplist.stp88
-rw-r--r--docs/release/src/osd/winui/helpids.cpp125
-rw-r--r--docs/release/src/osd/winui/history.cpp665
-rw-r--r--docs/release/src/osd/winui/history.h13
-rw-r--r--docs/release/src/osd/winui/ini_opts.h441
-rw-r--r--docs/release/src/osd/winui/layout.cpp249
-rw-r--r--docs/release/src/osd/winui/mameui.rc1467
-rw-r--r--docs/release/src/osd/winui/mkhelp.cpp152
-rw-r--r--docs/release/src/osd/winui/mui_audit.cpp482
-rw-r--r--docs/release/src/osd/winui/mui_audit.h21
-rw-r--r--docs/release/src/osd/winui/mui_main.cpp22
-rw-r--r--docs/release/src/osd/winui/mui_opts.cpp2599
-rw-r--r--docs/release/src/osd/winui/mui_opts.h543
-rw-r--r--docs/release/src/osd/winui/mui_util.cpp859
-rw-r--r--docs/release/src/osd/winui/mui_util.h102
-rw-r--r--docs/release/src/osd/winui/newui.h38
-rw-r--r--docs/release/src/osd/winui/newuires.h64
-rw-r--r--docs/release/src/osd/winui/picker.cpp1603
-rw-r--r--docs/release/src/osd/winui/picker.h89
-rw-r--r--docs/release/src/osd/winui/properties.cpp3695
-rw-r--r--docs/release/src/osd/winui/properties.h58
-rw-r--r--docs/release/src/osd/winui/res/about.bmpbin0 -> 93054 bytes
-rw-r--r--docs/release/src/osd/winui/res/bkgnd16.bmpbin0 -> 5362 bytes
-rw-r--r--docs/release/src/osd/winui/res/bkground.bmpbin0 -> 10124 bytes
-rw-r--r--docs/release/src/osd/winui/res/checkmark.icobin0 -> 6518 bytes
-rw-r--r--docs/release/src/osd/winui/res/controller.icobin0 -> 2238 bytes
-rw-r--r--docs/release/src/osd/winui/res/cpu.icobin0 -> 6006 bytes
-rw-r--r--docs/release/src/osd/winui/res/custom.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/display.icobin0 -> 6518 bytes
-rw-r--r--docs/release/src/osd/winui/res/foldavail.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/folder.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/foldmanu.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/foldopen.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/foldsrc.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/foldunav.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/foldyear.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/harddisk.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/hbmame.icobin0 -> 4286 bytes
-rw-r--r--docs/release/src/osd/winui/res/hbmameui.icobin0 -> 4286 bytes
-rw-r--r--docs/release/src/osd/winui/res/header_down.icobin0 -> 502 bytes
-rw-r--r--docs/release/src/osd/winui/res/header_up.icobin0 -> 502 bytes
-rw-r--r--docs/release/src/osd/winui/res/horz.icobin0 -> 3262 bytes
-rw-r--r--docs/release/src/osd/winui/res/icon_asc.icobin0 -> 4846 bytes
-rw-r--r--docs/release/src/osd/winui/res/icon_des.icobin0 -> 4846 bytes
-rw-r--r--docs/release/src/osd/winui/res/icon_snd.icobin0 -> 4846 bytes
-rw-r--r--docs/release/src/osd/winui/res/icon_sndn.icobin0 -> 4846 bytes
-rw-r--r--docs/release/src/osd/winui/res/joystick.icobin0 -> 6518 bytes
-rw-r--r--docs/release/src/osd/winui/res/keyboard.icobin0 -> 6518 bytes
-rw-r--r--docs/release/src/osd/winui/res/mameui.manifest15
-rw-r--r--docs/release/src/osd/winui/res/manufact.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/nonwork.icobin0 -> 1406 bytes
-rw-r--r--docs/release/src/osd/winui/res/samples.icobin0 -> 1406 bytes
-rw-r--r--docs/release/src/osd/winui/res/sound.icobin0 -> 6518 bytes
-rw-r--r--docs/release/src/osd/winui/res/source.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/splith.curbin0 -> 518 bytes
-rw-r--r--docs/release/src/osd/winui/res/toolbar.bmpbin0 -> 1198 bytes
-rw-r--r--docs/release/src/osd/winui/res/vert.icobin0 -> 3262 bytes
-rw-r--r--docs/release/src/osd/winui/res/win_clone.icobin0 -> 2238 bytes
-rw-r--r--docs/release/src/osd/winui/res/win_imp.icobin0 -> 2238 bytes
-rw-r--r--docs/release/src/osd/winui/res/win_noro.icobin0 -> 2238 bytes
-rw-r--r--docs/release/src/osd/winui/res/win_redx.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/win_roms.icobin0 -> 6006 bytes
-rw-r--r--docs/release/src/osd/winui/res/win_unkn.icobin0 -> 2238 bytes
-rw-r--r--docs/release/src/osd/winui/res/working.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/res/year.icobin0 -> 3638 bytes
-rw-r--r--docs/release/src/osd/winui/resource.h503
-rw-r--r--docs/release/src/osd/winui/resource.hm122
-rw-r--r--docs/release/src/osd/winui/screenshot.cpp743
-rw-r--r--docs/release/src/osd/winui/screenshot.h60
-rw-r--r--docs/release/src/osd/winui/splitters.cpp371
-rw-r--r--docs/release/src/osd/winui/splitters.h80
-rw-r--r--docs/release/src/osd/winui/tabview.cpp270
-rw-r--r--docs/release/src/osd/winui/tabview.h44
-rw-r--r--docs/release/src/osd/winui/treeview.cpp2513
-rw-r--r--docs/release/src/osd/winui/treeview.h212
-rw-r--r--docs/release/src/osd/winui/ui_opts.h396
-rw-r--r--docs/release/src/osd/winui/winui.cpp6685
-rw-r--r--docs/release/src/osd/winui/winui.h108
143 files changed, 47300 insertions, 0 deletions
diff --git a/docs/release/src/osd/modules/render/drawd3d.cpp b/docs/release/src/osd/modules/render/drawd3d.cpp
new file mode 100644
index 00000000000..2336536d084
--- /dev/null
+++ b/docs/release/src/osd/modules/render/drawd3d.cpp
@@ -0,0 +1,2753 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+//============================================================
+//
+// drawd3d.cpp - Win32 Direct3D implementation
+//
+//============================================================
+
+// MAME headers
+#include "emu.h"
+#include "render.h"
+
+#include "rendutil.h"
+#include "emuopts.h"
+#include "aviio.h"
+
+// MAMEOS headers
+#include "winmain.h"
+#include "window.h"
+#include "drawd3d.h"
+#include "modules/render/d3d/d3dhlsl.h"
+#include "modules/monitor/monitor_module.h"
+#include <utility>
+
+//============================================================
+// TYPE DEFINITIONS
+//============================================================
+
+typedef IDirect3D9* (WINAPI *d3d9_create_fn)(UINT);
+
+
+//============================================================
+// CONSTANTS
+//============================================================
+
+enum
+{
+ TEXTURE_TYPE_PLAIN,
+ TEXTURE_TYPE_DYNAMIC,
+ TEXTURE_TYPE_SURFACE
+};
+
+
+//============================================================
+// INLINES
+//============================================================
+
+static inline BOOL GetClientRectExceptMenu(HWND hWnd, PRECT pRect, BOOL fullscreen)
+{
+ static HMENU last_menu;
+ static RECT last_rect;
+ static RECT cached_rect;
+ HMENU menu = GetMenu(hWnd);
+ BOOL result = GetClientRect(hWnd, pRect);
+
+ if (!fullscreen || !menu)
+ return result;
+
+ // to avoid flicker use cache if we can use
+ if (last_menu != menu || memcmp(&last_rect, pRect, sizeof *pRect) != 0)
+ {
+ last_menu = menu;
+ last_rect = *pRect;
+
+ SetMenu(hWnd, nullptr);
+ result = GetClientRect(hWnd, &cached_rect);
+ SetMenu(hWnd, menu);
+ }
+
+ *pRect = cached_rect;
+ return result;
+}
+
+
+static inline uint32_t ycc_to_rgb(uint8_t y, uint8_t cb, uint8_t cr)
+{
+ /* original equations:
+
+ C = Y - 16
+ D = Cb - 128
+ E = Cr - 128
+
+ R = clip(( 298 * C + 409 * E + 128) >> 8)
+ G = clip(( 298 * C - 100 * D - 208 * E + 128) >> 8)
+ B = clip(( 298 * C + 516 * D + 128) >> 8)
+
+ R = clip(( 298 * (Y - 16) + 409 * (Cr - 128) + 128) >> 8)
+ G = clip(( 298 * (Y - 16) - 100 * (Cb - 128) - 208 * (Cr - 128) + 128) >> 8)
+ B = clip(( 298 * (Y - 16) + 516 * (Cb - 128) + 128) >> 8)
+
+ R = clip(( 298 * Y - 298 * 16 + 409 * Cr - 409 * 128 + 128) >> 8)
+ G = clip(( 298 * Y - 298 * 16 - 100 * Cb + 100 * 128 - 208 * Cr + 208 * 128 + 128) >> 8)
+ B = clip(( 298 * Y - 298 * 16 + 516 * Cb - 516 * 128 + 128) >> 8)
+
+ R = clip(( 298 * Y - 298 * 16 + 409 * Cr - 409 * 128 + 128) >> 8)
+ G = clip(( 298 * Y - 298 * 16 - 100 * Cb + 100 * 128 - 208 * Cr + 208 * 128 + 128) >> 8)
+ B = clip(( 298 * Y - 298 * 16 + 516 * Cb - 516 * 128 + 128) >> 8)
+ */
+ int r, g, b, common;
+
+ common = 298 * y - 298 * 16;
+ r = (common + 409 * cr - 409 * 128 + 128) >> 8;
+ g = (common - 100 * cb + 100 * 128 - 208 * cr + 208 * 128 + 128) >> 8;
+ b = (common + 516 * cb - 516 * 128 + 128) >> 8;
+
+ if (r < 0) r = 0;
+ else if (r > 255) r = 255;
+ if (g < 0) g = 0;
+ else if (g > 255) g = 255;
+ if (b < 0) b = 0;
+ else if (b > 255) b = 255;
+
+ return rgb_t(0xff, r, g, b);
+}
+
+
+//============================================================
+// drawd3d_init
+//============================================================
+
+static d3d_base * d3dintf; // FIX ME
+
+
+//============================================================
+// drawd3d_window_init
+//============================================================
+
+int renderer_d3d9::create()
+{
+ if (!initialize())
+ {
+ osd_printf_error("Unable to initialize Direct3D 9\n");
+ return 1;
+ }
+
+ return 0;
+}
+
+void renderer_d3d9::toggle_fsfx()
+{
+ set_toggle(true);
+}
+
+void renderer_d3d9::record()
+{
+ if (m_shaders != nullptr)
+ {
+ m_shaders->record_movie();
+ }
+}
+
+void renderer_d3d9::add_audio_to_recording(const int16_t *buffer, int samples_this_frame)
+{
+ if (m_shaders != nullptr)
+ {
+ m_shaders->record_audio(buffer, samples_this_frame);
+ }
+}
+
+void renderer_d3d9::save()
+{
+ if (m_shaders != nullptr)
+ {
+ m_shaders->save_snapshot();
+ }
+}
+
+
+//============================================================
+// drawd3d_window_get_primitives
+//============================================================
+
+render_primitive_list *renderer_d3d9::get_primitives()
+{
+ RECT client;
+ auto win = try_getwindow();
+ if (win == nullptr)
+ return nullptr;
+
+ HWND hWnd = std::static_pointer_cast<win_window_info>(win)->platform_window();
+ if (IsIconic(hWnd))
+ return nullptr;
+
+ GetClientRectExceptMenu(hWnd, &client, win->fullscreen());
+ if (rect_width(&client) > 0 && rect_height(&client) > 0)
+ {
+ win->target()->set_bounds(rect_width(&client), rect_height(&client), win->pixel_aspect());
+ win->target()->set_max_update_rate((get_refresh() == 0) ? get_origmode().RefreshRate : get_refresh());
+ }
+ if (m_shaders != nullptr)
+ {
+ // do not transform primitives (scale, offset) if shaders are enabled, the shaders will handle the transformation
+ win->target()->set_transform_container(!m_shaders->enabled());
+ }
+ return &win->target()->get_primitives();
+}
+
+
+//============================================================
+// renderer_d3d9::init
+//============================================================
+
+bool renderer_d3d9::init(running_machine &machine)
+{
+ d3dintf = global_alloc(d3d_base);
+
+ d3dintf->d3d9_dll = osd::dynamic_module::open({ "d3d9.dll" });
+
+ d3d9_create_fn d3d9_create_ptr = d3dintf->d3d9_dll->bind<d3d9_create_fn>("Direct3DCreate9");
+ if (d3d9_create_ptr == nullptr)
+ {
+ osd_printf_verbose("Direct3D: Unable to find Direct3D 9 runtime library\n");
+ return true;
+ }
+
+ d3dintf->d3dobj = (*d3d9_create_ptr)(D3D_SDK_VERSION);
+ if (d3dintf->d3dobj == nullptr)
+ {
+ osd_printf_verbose("Direct3D: Unable to initialize Direct3D 9\n");
+ return true;
+ }
+
+ osd_printf_verbose("Direct3D: Using Direct3D 9\n");
+
+ return false;
+}
+
+
+//============================================================
+// drawd3d_window_draw
+//============================================================
+
+int renderer_d3d9::draw(const int update)
+{
+ int check = pre_window_draw_check();
+ if (check >= 0)
+ return check;
+
+ begin_frame();
+ process_primitives();
+ end_frame();
+
+ return 0;
+}
+
+void renderer_d3d9::set_texture(texture_info *texture)
+{
+ if (texture != m_last_texture)
+ {
+ m_last_texture = texture;
+ m_last_texture_flags = (texture == nullptr ? 0 : texture->get_flags());
+ HRESULT result = m_device->SetTexture(0, (texture == nullptr) ? get_default_texture()->get_finaltex() : texture->get_finaltex());
+ m_shaders->set_texture(texture);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device set_texture call\n", result);
+ }
+}
+
+void renderer_d3d9::set_filter(int filter)
+{
+ if (filter != m_last_filter)
+ {
+ m_last_filter = filter;
+ HRESULT result = m_device->SetSamplerState(0, D3DSAMP_MINFILTER, filter ? D3DTEXF_LINEAR : D3DTEXF_POINT);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetSamplerState call\n", result);
+ result = m_device->SetSamplerState(0, D3DSAMP_MAGFILTER, filter ? D3DTEXF_LINEAR : D3DTEXF_POINT);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetSamplerState call\n", result);
+ result = m_device->SetSamplerState(1, D3DSAMP_MINFILTER, filter ? D3DTEXF_LINEAR : D3DTEXF_POINT);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetSamplerState call\n", result);
+ result = m_device->SetSamplerState(1, D3DSAMP_MAGFILTER, filter ? D3DTEXF_LINEAR : D3DTEXF_POINT);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetSamplerState call\n", result);
+ }
+}
+
+void renderer_d3d9::set_wrap(unsigned int wrap)
+{
+ if (wrap != m_last_wrap)
+ {
+ m_last_wrap = wrap;
+ HRESULT result = m_device->SetSamplerState(0, D3DSAMP_ADDRESSU, wrap);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetSamplerState call\n", result);
+ result = m_device->SetSamplerState(0, D3DSAMP_ADDRESSV, wrap);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetSamplerState call\n", result);
+ result = m_device->SetSamplerState(1, D3DSAMP_ADDRESSU, wrap);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetSamplerState call\n", result);
+ result = m_device->SetSamplerState(1, D3DSAMP_ADDRESSV, wrap);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetSamplerState call\n", result);
+ }
+}
+
+void renderer_d3d9::set_modmode(int modmode)
+{
+ if (modmode != m_last_modmode)
+ {
+ m_last_modmode = modmode;
+ HRESULT result = m_device->SetTextureStageState(0, D3DTSS_COLOROP, modmode);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetTextureStageState call\n", result);
+ result = m_device->SetTextureStageState(1, D3DTSS_COLOROP, modmode);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetTextureStageState call\n", result);
+ }
+}
+
+void renderer_d3d9::set_blendmode(int blendmode)
+{
+ int blendenable;
+ int blendop;
+ int blendsrc;
+ int blenddst;
+
+ // choose the parameters
+ switch (blendmode)
+ {
+ default:
+ case BLENDMODE_NONE:
+ blendenable = FALSE;
+ blendop = D3DBLENDOP_ADD;
+ blendsrc = D3DBLEND_SRCALPHA;
+ blenddst = D3DBLEND_INVSRCALPHA;
+ break;
+ case BLENDMODE_ALPHA:
+ blendenable = TRUE;
+ blendop = D3DBLENDOP_ADD;
+ blendsrc = D3DBLEND_SRCALPHA;
+ blenddst = D3DBLEND_INVSRCALPHA;
+ break;
+ case BLENDMODE_RGB_MULTIPLY:
+ blendenable = TRUE;
+ blendop = D3DBLENDOP_ADD;
+ blendsrc = D3DBLEND_DESTCOLOR;
+ blenddst = D3DBLEND_ZERO;
+ break;
+ case BLENDMODE_ADD:
+ blendenable = TRUE;
+ blendop = D3DBLENDOP_ADD;
+ blendsrc = D3DBLEND_SRCALPHA;
+ blenddst = D3DBLEND_ONE;
+ break;
+ }
+
+ // adjust the bits that changed
+ if (blendenable != m_last_blendenable)
+ {
+ m_last_blendenable = blendenable;
+ HRESULT result = m_device->SetRenderState(D3DRS_ALPHABLENDENABLE, blendenable);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetRenderState call\n", result);
+ }
+
+ if (blendop != m_last_blendop)
+ {
+ m_last_blendop = blendop;
+ HRESULT result = m_device->SetRenderState(D3DRS_BLENDOP, blendop);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetRenderState call\n", result);
+ }
+
+ if (blendsrc != m_last_blendsrc)
+ {
+ m_last_blendsrc = blendsrc;
+ HRESULT result = m_device->SetRenderState(D3DRS_SRCBLEND, blendsrc);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetRenderState call\n", result);
+ }
+
+ if (blenddst != m_last_blenddst)
+ {
+ m_last_blenddst = blenddst;
+ HRESULT result = m_device->SetRenderState(D3DRS_DESTBLEND, blenddst);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetRenderState call\n", result);
+ }
+}
+
+void renderer_d3d9::reset_render_states()
+{
+ // this ensures subsequent calls to the above setters will force-update the data
+ m_last_texture = (texture_info *)~0;
+ m_last_filter = -1;
+ m_last_blendenable = -1;
+ m_last_blendop = -1;
+ m_last_blendsrc = -1;
+ m_last_blenddst = -1;
+ m_last_wrap = (D3DTEXTUREADDRESS)-1;
+}
+
+d3d_texture_manager::d3d_texture_manager(renderer_d3d9 *d3d)
+{
+ m_renderer = d3d;
+
+ m_default_texture = nullptr;
+
+ D3DCAPS9 caps;
+ HRESULT result = d3dintf->d3dobj->GetDeviceCaps(d3d->get_adapter(), D3DDEVTYPE_HAL, &caps);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during GetDeviceCaps call\n", result);
+
+ // check for dynamic texture support
+ m_dynamic_supported = ((caps.Caps2 & D3DCAPS2_DYNAMICTEXTURES) != 0);
+ if (m_dynamic_supported)
+ osd_printf_verbose("Direct3D: Using dynamic textures\n");
+
+ // check for stretchrect support
+ m_stretch_supported = ((caps.StretchRectFilterCaps & D3DPTFILTERCAPS_MAGFPOINT) != 0);
+ if (m_stretch_supported && video_config.prescale > 1)
+ osd_printf_verbose("Direct3D: Using StretchRect for prescaling\n");
+
+ // get texture caps
+ m_texture_caps = caps.TextureCaps;
+ m_texture_max_aspect = caps.MaxTextureAspectRatio;
+ m_texture_max_width = caps.MaxTextureWidth;
+ m_texture_max_height = caps.MaxTextureHeight;
+
+ // pick a YUV texture format
+ m_yuv_format = D3DFMT_UYVY;
+ result = d3dintf->d3dobj->CheckDeviceFormat(d3d->get_adapter(), D3DDEVTYPE_HAL, d3d->get_pixel_format(), 0, D3DRTYPE_TEXTURE, D3DFMT_UYVY);
+ if (FAILED(result))
+ {
+ m_yuv_format = D3DFMT_YUY2;
+ result = d3dintf->d3dobj->CheckDeviceFormat(d3d->get_adapter(), D3DDEVTYPE_HAL, d3d->get_pixel_format(), 0, D3DRTYPE_TEXTURE, D3DFMT_YUY2);
+ if (FAILED(result))
+ m_yuv_format = D3DFMT_A8R8G8B8;
+ }
+ osd_printf_verbose("Direct3D: YUV format = %s\n", (m_yuv_format == D3DFMT_YUY2) ? "YUY2" : (m_yuv_format == D3DFMT_UYVY) ? "UYVY" : "RGB");
+
+ auto win = d3d->assert_window();
+
+ // set the max texture size
+ win->target()->set_max_texture_size(m_texture_max_width, m_texture_max_height);
+ osd_printf_verbose("Direct3D: Max texture size = %dx%d\n", (int)m_texture_max_width, (int)m_texture_max_height);
+}
+
+void d3d_texture_manager::create_resources()
+{
+ auto win = m_renderer->assert_window();
+
+ m_default_bitmap.allocate(8, 8);
+ m_default_bitmap.fill(rgb_t(0xff,0xff,0xff,0xff));
+
+ if (m_default_bitmap.valid())
+ {
+ render_texinfo texture;
+
+ // fake in the basic data so it looks like it came from render.c
+ texture.base = m_default_bitmap.raw_pixptr(0);
+ texture.rowpixels = m_default_bitmap.rowpixels();
+ texture.width = m_default_bitmap.width();
+ texture.height = m_default_bitmap.height();
+ texture.palette = nullptr;
+ texture.seqid = 0;
+ texture.unique_id = ~0ULL;
+ texture.old_id = ~0ULL;
+
+ // now create it
+ auto tex = std::make_unique<texture_info>(this, &texture, win->prescale(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32));
+ m_default_texture = tex.get();
+ m_texture_list.push_back(std::move(tex));
+ }
+}
+
+void d3d_texture_manager::delete_resources()
+{
+ // is part of m_texlist and will be free'd there
+ //global_free(m_default_texture);
+ m_default_texture = nullptr;
+
+ // free all textures
+ m_texture_list.clear();
+}
+
+uint32_t d3d_texture_manager::texture_compute_hash(const render_texinfo *texture, uint32_t flags)
+{
+ return (uintptr_t)texture->base ^ (flags & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK));
+}
+
+texture_info *d3d_texture_manager::find_texinfo(const render_texinfo *texinfo, uint32_t flags)
+{
+ uint32_t hash = texture_compute_hash(texinfo, flags);
+
+ // find a match
+ for (auto it = m_texture_list.begin(); it != m_texture_list.end(); it++)
+ {
+ uint32_t test_screen = (uint32_t)((*it)->get_texinfo().unique_id >> 57);
+ uint32_t test_page = (uint32_t)((*it)->get_texinfo().unique_id >> 56) & 1;
+ uint32_t prim_screen = (uint32_t)(texinfo->unique_id >> 57);
+ uint32_t prim_page = (uint32_t)(texinfo->unique_id >> 56) & 1;
+ if (test_screen != prim_screen || test_page != prim_page)
+ continue;
+
+ if ((*it)->get_hash() == hash &&
+ (*it)->get_texinfo().base == texinfo->base &&
+ (*it)->get_texinfo().width == texinfo->width &&
+ (*it)->get_texinfo().height == texinfo->height &&
+ (((*it)->get_flags() ^ flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0)
+ {
+ return (*it).get();
+ }
+ }
+
+ return nullptr;
+}
+
+renderer_d3d9::renderer_d3d9(std::shared_ptr<osd_window> window)
+ : osd_renderer(window, FLAG_NONE), m_adapter(0), m_width(0), m_height(0), m_refresh(0), m_create_error_count(0), m_device(nullptr), m_gamma_supported(0), m_pixformat(),
+ m_vertexbuf(nullptr), m_lockedbuf(nullptr), m_numverts(0), m_vectorbatch(nullptr), m_batchindex(0), m_numpolys(0), m_toggle(false),
+ m_screen_format(), m_last_texture(nullptr), m_last_texture_flags(0), m_last_blendenable(0), m_last_blendop(0), m_last_blendsrc(0), m_last_blenddst(0), m_last_filter(0),
+ m_last_wrap(), m_last_modmode(0), m_shaders(nullptr), m_texture_manager(nullptr)
+{
+}
+
+int renderer_d3d9::initialize()
+{
+ osd_printf_verbose("Direct3D: Initialize\n");
+
+ // configure the adapter for the mode we want
+ if (config_adapter_mode())
+ {
+ return false;
+ }
+
+ // create the device immediately for the full screen case (defer for window mode in update_window_size())
+ auto win = assert_window();
+ if (win->fullscreen() && device_create(std::static_pointer_cast<win_window_info>(win->main_window())->platform_window()))
+ {
+ return false;
+ }
+
+ return true;
+}
+
+int renderer_d3d9::pre_window_draw_check()
+{
+ auto win = assert_window();
+
+ // if we're in the middle of resizing, leave things alone
+ if (win->m_resize_state == RESIZE_STATE_RESIZING)
+ return 0;
+
+ // check if shaders should be toggled
+ if (m_toggle)
+ {
+ m_toggle = false;
+
+ // free resources
+ device_delete_resources();
+
+ m_shaders->toggle();
+ m_sliders_dirty = true;
+
+ // re-create resources
+ if (device_create_resources())
+ {
+ osd_printf_verbose("Direct3D: failed to recreate resources for device; failing permanently\n");
+ device_delete();
+ return 1;
+ }
+ }
+
+ // if we have a device, check the cooperative level
+ if (m_device != nullptr)
+ {
+ if (device_test_cooperative())
+ {
+ return 1;
+ }
+ }
+
+ // in window mode, we need to track the window size
+ if (!win->fullscreen() || m_device == nullptr)
+ {
+ // if the size changes, skip this update since the render target will be out of date
+ if (update_window_size())
+ return 0;
+
+ // if we have no device, after updating the size, return an error so GDI can try
+ if (m_device == nullptr)
+ return 1;
+ }
+
+ return -1;
+}
+
+void d3d_texture_manager::update_textures()
+{
+ auto win = m_renderer->assert_window();
+
+ for (render_primitive &prim : *win->m_primlist)
+ {
+ if (prim.texture.base != nullptr)
+ {
+ texture_info *texture = find_texinfo(&prim.texture, prim.flags);
+ if (texture == nullptr)
+ {
+ int prescale = m_renderer->get_shaders()->enabled() ? 1 : win->prescale();
+
+ auto tex = std::make_unique<texture_info>(this, &prim.texture, prescale, prim.flags);
+ texture = tex.get();
+ m_texture_list.push_back(std::move(tex));
+ }
+ else
+ {
+ // if there is one, but with a different seqid, copy the data
+ if (texture->get_texinfo().seqid != prim.texture.seqid)
+ {
+ texture->set_data(&prim.texture, prim.flags);
+ texture->get_texinfo().seqid = prim.texture.seqid;
+ }
+ }
+ }
+ }
+
+ if (!m_renderer->get_shaders()->enabled())
+ {
+ return;
+ }
+
+ int screen_index = 0;
+ for (render_primitive &prim : *win->m_primlist)
+ {
+ if (PRIMFLAG_GET_SCREENTEX(prim.flags))
+ {
+ if (!m_renderer->get_shaders()->get_texture_target(&prim, prim.texture.width, prim.texture.height, screen_index))
+ {
+ if (!m_renderer->get_shaders()->create_texture_target(&prim, prim.texture.width, prim.texture.height, screen_index))
+ {
+ d3dintf->post_fx_available = false;
+ break;
+ }
+ }
+ screen_index++;
+ }
+ else if (PRIMFLAG_GET_VECTORBUF(prim.flags))
+ {
+ if (!m_renderer->get_shaders()->get_vector_target(&prim, screen_index))
+ {
+ if (!m_renderer->get_shaders()->create_vector_target(&prim, screen_index))
+ {
+ d3dintf->post_fx_available = false;
+ break;
+ }
+ }
+ screen_index++;
+ }
+ }
+}
+
+void renderer_d3d9::begin_frame()
+{
+ auto win = assert_window();
+
+ HRESULT result = m_device->Clear(0, nullptr, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device clear call\n", result);
+
+ win->m_primlist->acquire_lock();
+
+ // first update any textures
+ m_texture_manager->update_textures();
+
+ // begin the scene
+ result = m_device->BeginScene();
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device BeginScene call\n", result);
+
+ if (m_shaders->enabled())
+ m_shaders->init_fsfx_quad();
+}
+
+void renderer_d3d9::process_primitives()
+{
+ auto win = assert_window();
+
+ // loop over line primitives
+ int vector_count = 0;
+ for (render_primitive &prim : *win->m_primlist)
+ {
+ if (prim.type == render_primitive::LINE && PRIMFLAG_GET_VECTOR(prim.flags))
+ {
+ vector_count++;
+ }
+ }
+
+ // Rotating index for vector time offsets
+ for (render_primitive &prim : *win->m_primlist)
+ {
+ switch (prim.type)
+ {
+ case render_primitive::LINE:
+ if (PRIMFLAG_GET_VECTOR(prim.flags))
+ {
+ if (vector_count > 0)
+ {
+ batch_vectors(vector_count);
+ vector_count = 0;
+ }
+ }
+ else
+ {
+ draw_line(prim);
+ }
+ break;
+
+ case render_primitive::QUAD:
+ draw_quad(prim);
+ break;
+
+ default:
+ throw emu_fatalerror("Unexpected render_primitive type");
+ }
+ }
+}
+
+void renderer_d3d9::end_frame()
+{
+ auto win = assert_window();
+
+ win->m_primlist->release_lock();
+
+ // flush any pending polygons
+ primitive_flush_pending();
+
+ // finish the scene
+ HRESULT result = m_device->EndScene();
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device end_scene call\n", result);
+
+ // present the current buffers
+ result = m_device->Present(nullptr, nullptr, nullptr, nullptr);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device present call\n", result);
+}
+
+void renderer_d3d9::update_presentation_parameters()
+{
+ auto win = assert_window();
+
+ memset(&m_presentation, 0, sizeof(m_presentation));
+ m_presentation.BackBufferWidth = m_width;
+ m_presentation.BackBufferHeight = m_height;
+ m_presentation.BackBufferFormat = m_pixformat;
+ m_presentation.BackBufferCount = video_config.triplebuf ? 2 : 1;
+ m_presentation.MultiSampleType = D3DMULTISAMPLE_NONE;
+ m_presentation.SwapEffect = D3DSWAPEFFECT_DISCARD;
+ m_presentation.hDeviceWindow = std::static_pointer_cast<win_window_info>(win)->platform_window();
+ m_presentation.Windowed = !win->fullscreen() || win->win_has_menu();
+ m_presentation.EnableAutoDepthStencil = FALSE;
+ m_presentation.AutoDepthStencilFormat = D3DFMT_D16;
+ m_presentation.Flags = 0;
+ m_presentation.FullScreen_RefreshRateInHz = m_refresh;
+ m_presentation.PresentationInterval = (
+ (video_config.triplebuf && win->fullscreen())
+ || video_config.waitvsync
+ || video_config.syncrefresh)
+ ? D3DPRESENT_INTERVAL_ONE
+ : D3DPRESENT_INTERVAL_IMMEDIATE;
+}
+
+
+void renderer_d3d9::update_gamma_ramp()
+{
+ if (!m_gamma_supported)
+ {
+ return;
+ }
+
+ auto win = assert_window();
+
+ // set the gamma if we need to
+ if (win->fullscreen())
+ {
+ // only set the gamma if it's not 1.0
+ windows_options &options = downcast<windows_options &>(win->machine().options());
+ float brightness = options.full_screen_brightness();
+ float contrast = options.full_screen_contrast();
+ float gamma = options.full_screen_gamma();
+ if (brightness != 1.0f || contrast != 1.0f || gamma != 1.0f)
+ {
+ D3DGAMMARAMP ramp;
+
+ for (int i = 0; i < 256; i++)
+ {
+ ramp.red[i] = ramp.green[i] = ramp.blue[i] = apply_brightness_contrast_gamma(i, brightness, contrast, gamma) << 8;
+ }
+
+ m_device->SetGammaRamp(0, 0, &ramp);
+ }
+ }
+}
+
+
+//============================================================
+// device_create
+//============================================================
+
+int renderer_d3d9::device_create(HWND device_hwnd)
+{
+ // if a device exists, free it
+ if (m_device != nullptr)
+ {
+ device_delete();
+ }
+
+ // verify the caps
+ if (!device_verify_caps())
+ {
+ return 1;
+ }
+
+ m_texture_manager = global_alloc(d3d_texture_manager(this));
+
+try_again:
+ // try for XRGB first
+ m_screen_format = D3DFMT_X8R8G8B8;
+ HRESULT result = d3dintf->d3dobj->CheckDeviceFormat(m_adapter, D3DDEVTYPE_HAL, m_pixformat,
+ m_texture_manager->is_dynamic_supported()
+ ? D3DUSAGE_DYNAMIC
+ : 0,
+ D3DRTYPE_TEXTURE, m_screen_format);
+ if (FAILED(result))
+ {
+ // if not, try for ARGB
+ m_screen_format = D3DFMT_A8R8G8B8;
+ result = d3dintf->d3dobj->CheckDeviceFormat(m_adapter, D3DDEVTYPE_HAL, m_pixformat,
+ m_texture_manager->is_dynamic_supported()
+ ? D3DUSAGE_DYNAMIC
+ : 0,
+ D3DRTYPE_TEXTURE, m_screen_format);
+ if (FAILED(result) && m_texture_manager->is_dynamic_supported())
+ {
+ m_texture_manager->set_dynamic_supported(false);
+ goto try_again;
+ }
+ if (FAILED(result))
+ {
+ osd_printf_error("Error: unable to configure a screen texture format\n");
+ return 1;
+ }
+ }
+
+ // initialize the D3D presentation parameters
+ update_presentation_parameters();
+
+ // create the D3D device
+ result = d3dintf->d3dobj->CreateDevice(
+ m_adapter, D3DDEVTYPE_HAL, device_hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &m_presentation, &m_device);
+ if (FAILED(result))
+ {
+ // if we got a "DEVICELOST" error, it may be transitory; count it and only fail if
+ // we exceed a threshold
+ if (result == D3DERR_DEVICELOST)
+ {
+ m_create_error_count++;
+ if (m_create_error_count < 10)
+ {
+ return 0;
+ }
+ }
+
+ // fatal error if we just can't do it
+ osd_printf_error("Unable to create the Direct3D device (%08X)\n", (uint32_t)result);
+ return 1;
+ }
+ m_create_error_count = 0;
+ osd_printf_verbose("Direct3D: Device created at %dx%d\n", m_width, m_height);
+
+ update_gamma_ramp();
+
+ return device_create_resources();
+}
+
+
+//============================================================
+// device_create_resources
+//============================================================
+
+int renderer_d3d9::device_create_resources()
+{
+ auto win = assert_window();
+
+ // create shaders only once
+ if (m_shaders == nullptr)
+ {
+ m_shaders = (shaders*)global_alloc_clear<shaders>();
+ }
+
+ if (m_shaders->init(d3dintf, &win->machine(), this))
+ {
+ m_shaders->init_slider_list();
+ m_sliders_dirty = true;
+ }
+
+ // create resources
+ if (m_shaders->create_resources())
+ {
+ osd_printf_verbose("Direct3D: failed to create HLSL resources for device\n");
+ return 1;
+ }
+
+ // allocate a vertex buffer to use
+ HRESULT result = m_device->CreateVertexBuffer(
+ sizeof(vertex) * VERTEX_BUFFER_SIZE,
+ D3DUSAGE_DYNAMIC | D3DUSAGE_SOFTWAREPROCESSING | D3DUSAGE_WRITEONLY,
+ VERTEX_BASE_FORMAT | ((m_shaders->enabled())
+ ? D3DFVF_XYZW
+ : D3DFVF_XYZRHW),
+ D3DPOOL_DEFAULT, &m_vertexbuf, nullptr);
+ if (FAILED(result))
+ {
+ osd_printf_error("Error creating vertex buffer (%08X)\n", (uint32_t)result);
+ return 1;
+ }
+
+ // set the vertex format
+ result = m_device->SetFVF(
+ (D3DFORMAT)(VERTEX_BASE_FORMAT | ((m_shaders->enabled())
+ ? D3DFVF_XYZW
+ : D3DFVF_XYZRHW)));
+ if (FAILED(result))
+ {
+ osd_printf_error("Error setting vertex format (%08X)\n", (uint32_t)result);
+ return 1;
+ }
+
+ // set the fixed render state
+ result = m_device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
+ result = m_device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
+ result = m_device->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT);
+ result = m_device->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
+ result = m_device->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
+ result = m_device->SetRenderState(D3DRS_LASTPIXEL, TRUE);
+ result = m_device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
+ result = m_device->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS);
+ result = m_device->SetRenderState(D3DRS_ALPHAREF, 0);
+ result = m_device->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER);
+ result = m_device->SetRenderState(D3DRS_DITHERENABLE, FALSE);
+ result = m_device->SetRenderState(D3DRS_FOGENABLE, FALSE);
+ result = m_device->SetRenderState(D3DRS_SPECULARENABLE, FALSE);
+ result = m_device->SetRenderState(D3DRS_STENCILENABLE, FALSE);
+ result = m_device->SetRenderState(D3DRS_WRAP0, FALSE);
+ result = m_device->SetRenderState(D3DRS_CLIPPING, TRUE);
+ result = m_device->SetRenderState(D3DRS_LIGHTING, FALSE);
+ result = m_device->SetRenderState(D3DRS_COLORVERTEX, TRUE);
+
+ result = m_device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
+ result = m_device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
+ result = m_device->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE);
+ result = m_device->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
+
+ // reset the local states to force updates
+ reset_render_states();
+
+ // clear the buffer
+ result = m_device->Clear(0, nullptr, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ result = m_device->Present(nullptr, nullptr, nullptr, nullptr);
+
+ m_texture_manager->create_resources();
+
+ return 0;
+}
+
+
+//============================================================
+// device_delete
+//============================================================
+
+renderer_d3d9::~renderer_d3d9()
+{
+ device_delete();
+
+ // todo: throws error when switching from full screen to window mode
+ //if (m_shaders != nullptr)
+ //{
+ // // delete the HLSL interface
+ // global_free(m_shaders);
+ // m_shaders = nullptr;
+ //}
+}
+
+void renderer_d3d9::exit()
+{
+ if (d3dintf != nullptr)
+ {
+ d3dintf->d3dobj->Release();
+ global_free(d3dintf);
+ }
+}
+
+void renderer_d3d9::device_delete()
+{
+ // free our base resources
+ device_delete_resources();
+
+ // we do not delete the HLSL interface here
+
+ if (m_texture_manager != nullptr)
+ {
+ global_free(m_texture_manager);
+ m_texture_manager = nullptr;
+ }
+
+ // free the device itself
+ if (m_device != nullptr)
+ {
+ m_device->Release();
+ m_device = nullptr;
+ }
+}
+
+
+//============================================================
+// device_delete_resources
+//============================================================
+
+void renderer_d3d9::device_delete_resources()
+{
+ if (m_shaders != nullptr)
+ {
+ m_shaders->delete_resources();
+ }
+
+ if (m_texture_manager != nullptr)
+ {
+ m_texture_manager->delete_resources();
+ }
+
+ // free the vertex buffer
+ if (m_vertexbuf != nullptr)
+ {
+ m_vertexbuf->Release();
+ m_vertexbuf = nullptr;
+ }
+}
+
+
+//============================================================
+// device_verify_caps
+//============================================================
+
+bool renderer_d3d9::device_verify_caps()
+{
+ bool success = true;
+
+ D3DCAPS9 caps;
+ HRESULT result = d3dintf->d3dobj->GetDeviceCaps(m_adapter, D3DDEVTYPE_HAL, &caps);
+ if (FAILED(result))
+ {
+ osd_printf_verbose("Direct3D: Error %08lX during GetDeviceCaps call\n", result);
+ return false;
+ }
+
+ if (caps.MaxPixelShader30InstructionSlots < 512)
+ {
+ osd_printf_verbose("Direct3D: Warning - Device does not support Pixel Shader 3.0, falling back to non-PS rendering\n");
+ d3dintf->post_fx_available = false;
+ }
+
+ // verify presentation capabilities
+ if (!(caps.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE))
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not support immediate presentation.\n");
+ success = false;
+ }
+ if (!(caps.PresentationIntervals & D3DPRESENT_INTERVAL_ONE))
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not support per-refresh presentation.\n");
+ success = false;
+ }
+
+ // verify device capabilities
+ if (!(caps.DevCaps & D3DDEVCAPS_CANRENDERAFTERFLIP))
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not support rendering after a page\n");
+ osd_printf_verbose("flip.\n");
+ success = false;
+ }
+
+ if (!(caps.DevCaps & D3DDEVCAPS_HWRASTERIZATION))
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not support hardware rendering.\n");
+ success = false;
+ }
+
+ // verify texture operation capabilities
+ if (!(caps.TextureOpCaps & D3DTEXOPCAPS_MODULATE))
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not support modulate-type blending.\n");
+ success = false;
+ }
+
+ if (caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL)
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not fully support non-power-of-two\n");
+ osd_printf_verbose("textures.\n");
+ success = false;
+ }
+
+ if (caps.TextureCaps & D3DPTEXTURECAPS_POW2)
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not support non-power-of-two textures.\n");
+ success = false;
+ }
+
+ if (caps.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY)
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not support non-square textures.\n");
+ success = false;
+ }
+
+ // verify texture formats
+ result = d3dintf->d3dobj->CheckDeviceFormat(m_adapter, D3DDEVTYPE_HAL, m_pixformat, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8);
+ if (FAILED(result))
+ {
+ osd_printf_verbose("Direct3D Error: Your graphics card does not support the A8R8G8B8 texture format.\n");
+ success = false;
+ }
+
+ if (!success)
+ {
+ osd_printf_verbose("This feature or features are required to use the Direct3D renderer. Please\n");
+ osd_printf_verbose("select another renderer using the -video option or contact the MAME developers\n");
+ osd_printf_verbose("with information about your system.\n");
+ //return false;
+ }
+
+ m_gamma_supported = ((caps.Caps2 & D3DCAPS2_FULLSCREENGAMMA) != 0);
+ if (!m_gamma_supported)
+ {
+ osd_printf_warning("Direct3D: Warning - device does not support full screen gamma correction.\n");
+ }
+
+ return true;
+}
+
+
+//============================================================
+// device_test_cooperative
+//============================================================
+
+int renderer_d3d9::device_test_cooperative()
+{
+ // check our current status; if we lost the device, punt to GDI
+ HRESULT result = m_device->TestCooperativeLevel();
+ if (result == D3DERR_DEVICELOST)
+ return 1;
+
+ // if we're able to reset ourselves, try it
+ if (result == D3DERR_DEVICENOTRESET)
+ {
+ osd_printf_verbose("Direct3D: resetting device\n");
+
+ // free all existing resources and call reset on the device
+ device_delete_resources();
+ result = m_device->Reset(&m_presentation);
+
+ // if it didn't work, punt to GDI
+ if (FAILED(result))
+ {
+ osd_printf_error("Unable to reset, result %08lX\n", result);
+ return 1;
+ }
+
+ // try to create the resources again; if that didn't work, delete the whole thing
+ if (device_create_resources())
+ {
+ osd_printf_verbose("Direct3D: failed to recreate resources for device; failing permanently\n");
+ device_delete();
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+//============================================================
+// config_adapter_mode
+//============================================================
+
+int renderer_d3d9::config_adapter_mode()
+{
+ // choose the monitor number
+ m_adapter = get_adapter_for_monitor();
+
+ // get the identifier
+ D3DADAPTER_IDENTIFIER9 id;
+ HRESULT result = d3dintf->d3dobj->GetAdapterIdentifier(m_adapter, 0, &id);
+ if (FAILED(result))
+ {
+ osd_printf_error("Error getting identifier for adapter #%d\n", m_adapter);
+ return 1;
+ }
+
+ osd_printf_verbose("Direct3D: Configuring adapter #%d = %s\n", m_adapter, id.Description);
+
+ // get the current display mode
+ result = d3dintf->d3dobj->GetAdapterDisplayMode(m_adapter, &m_origmode);
+ if (FAILED(result))
+ {
+ osd_printf_error("Error getting mode for adapter #%d\n", m_adapter);
+ return 1;
+ }
+
+ auto win = assert_window();
+
+ // choose a resolution: window mode case
+ if (!win->fullscreen() || !video_config.switchres || win->win_has_menu())
+ {
+ RECT client;
+
+ // bounds are from the window client rect
+ GetClientRectExceptMenu(std::static_pointer_cast<win_window_info>(win)->platform_window(), &client, win->fullscreen());
+ m_width = client.right - client.left;
+ m_height = client.bottom - client.top;
+
+ // pix format is from the current mode
+ m_pixformat = m_origmode.Format;
+ m_refresh = 0;
+
+ // 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());
+ return 1;
+ }
+ }
+
+ // choose a resolution: full screen mode case
+ else
+ {
+ // default to the current mode exactly
+ m_width = m_origmode.Width;
+ m_height = m_origmode.Height;
+ m_pixformat = m_origmode.Format;
+ m_refresh = m_origmode.RefreshRate;
+
+ // if we're allowed to switch resolutions, override with something better
+ if (video_config.switchres)
+ pick_best_mode();
+ }
+
+ // see if we can handle the device type
+ 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());
+ return 1;
+ }
+
+ return 0;
+}
+
+
+//============================================================
+// get_adapter_for_monitor
+//============================================================
+
+int renderer_d3d9::get_adapter_for_monitor()
+{
+ int maxadapter = d3dintf->d3dobj->GetAdapterCount();
+
+ auto win = assert_window();
+
+ // iterate over adapters until we error or find a match
+ for (int adapternum = 0; adapternum < maxadapter; adapternum++)
+ {
+ // get the monitor for this adapter
+ HMONITOR curmonitor = d3dintf->d3dobj->GetAdapterMonitor(adapternum);
+
+ // if we match the proposed monitor, this is it
+ if (curmonitor == reinterpret_cast<HMONITOR>(win->monitor()->oshandle()))
+ {
+ return adapternum;
+ }
+ }
+
+ // default to the default
+ return D3DADAPTER_DEFAULT;
+}
+
+
+//============================================================
+// pick_best_mode
+//============================================================
+
+void renderer_d3d9::pick_best_mode()
+{
+ double target_refresh = 60.0;
+ int32_t minwidth, minheight;
+ float best_score = 0.0f;
+
+ auto win = assert_window();
+
+ // determine the refresh rate of the primary screen
+ const screen_device *primary_screen = screen_device_iterator(win->machine().root_device()).first();
+ if (primary_screen != nullptr)
+ {
+ target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh_attoseconds());
+ }
+
+ // determine the minimum width/height for the selected target
+ // note: technically we should not be calling this from an alternate window
+ // thread; however, it is only done during init time, and the init code on
+ // the main thread is waiting for us to finish, so it is safe to do so here
+ win->target()->compute_minimum_size(minwidth, minheight);
+
+ // use those as the target for now
+ int32_t target_width = minwidth;
+ int32_t target_height = minheight;
+
+ // determine the maximum number of modes
+ int maxmodes = d3dintf->d3dobj->GetAdapterModeCount(m_adapter, D3DFMT_X8R8G8B8);
+
+ // enumerate all the video modes and find the best match
+ osd_printf_verbose("Direct3D: Selecting video mode...\n");
+ for (int modenum = 0; modenum < maxmodes; modenum++)
+ {
+ // check this mode
+ D3DDISPLAYMODE mode;
+ HRESULT result = d3dintf->d3dobj->EnumAdapterModes(m_adapter, D3DFMT_X8R8G8B8, modenum, &mode);
+ if (FAILED(result))
+ break;
+
+ // skip non-32 bit modes
+ if (mode.Format != D3DFMT_X8R8G8B8)
+ continue;
+
+ // compute initial score based on difference between target and current
+ float size_score = 1.0f / (1.0f + fabs((float)(mode.Width - target_width)) + fabs((float)(mode.Height - target_height)));
+
+ // if the mode is too small, give a big penalty
+ if (mode.Width < minwidth || mode.Height < minheight)
+ size_score *= 0.01f;
+
+ // if mode is smaller than we'd like, it only scores up to 0.1
+ if (mode.Width < target_width || mode.Height < target_height)
+ size_score *= 0.1f;
+
+ // if we're looking for a particular mode, that's a winner
+ if (mode.Width == win->m_win_config.width && mode.Height == win->m_win_config.height)
+ size_score = 2.0f;
+
+ // compute refresh score
+ float refresh_score = 1.0f / (1.0f + fabs((double)mode.RefreshRate - target_refresh));
+
+ // if refresh is smaller than we'd like, it only scores up to 0.1
+ if ((double)mode.RefreshRate < target_refresh)
+ refresh_score *= 0.1f;
+
+ // if we're looking for a particular refresh, make sure it matches
+ if (mode.RefreshRate == win->m_win_config.refresh)
+ refresh_score = 2.0f;
+
+ // weight size and refresh equally
+ float final_score = size_score + refresh_score;
+
+ // best so far?
+ osd_printf_verbose(" %4dx%4d@%3dHz -> %f\n", mode.Width, mode.Height, mode.RefreshRate, final_score * 1000.0f);
+ if (final_score > best_score)
+ {
+ best_score = final_score;
+ m_width = mode.Width;
+ m_height = mode.Height;
+ m_pixformat = mode.Format;
+ m_refresh = mode.RefreshRate;
+ }
+ }
+ osd_printf_verbose("Direct3D: Mode selected = %4dx%4d@%3dHz\n", m_width, m_height, m_refresh);
+}
+
+
+//============================================================
+// update_window_size
+//============================================================
+
+bool renderer_d3d9::update_window_size()
+{
+ auto win = assert_window();
+
+ // get the current window bounds
+ RECT client;
+ GetClientRectExceptMenu(std::static_pointer_cast<win_window_info>(win)->platform_window(), &client, win->fullscreen());
+
+ // if we have a device and matching width/height, nothing to do
+ if (m_device != nullptr && rect_width(&client) == m_width && rect_height(&client) == m_height)
+ {
+ // clear out any pending resizing if the area didn't change
+ if (win->m_resize_state == RESIZE_STATE_PENDING)
+ win->m_resize_state = RESIZE_STATE_NORMAL;
+ return false;
+ }
+
+ // if we're in the middle of resizing, leave it alone as well
+ if (win->m_resize_state == RESIZE_STATE_RESIZING)
+ return false;
+
+ // set the new bounds and create the device again
+ m_width = rect_width(&client);
+ m_height = rect_height(&client);
+ if (device_create(std::static_pointer_cast<win_window_info>(win->main_window())->platform_window()))
+ return false;
+
+ // reset the resize state to normal, and indicate we made a change
+ win->m_resize_state = RESIZE_STATE_NORMAL;
+ return true;
+}
+
+
+//============================================================
+// batch_vectors
+//============================================================
+
+void renderer_d3d9::batch_vectors(int vector_count)
+{
+ auto win = assert_window();
+
+ float quad_width = 0.0f;
+ float quad_height = 0.0f;
+ float target_width = 0.0f;
+ float target_height = 0.0f;
+
+ int vertex_count = vector_count * 6;
+ int triangle_count = vector_count * 2;
+ m_vectorbatch = mesh_alloc(vertex_count);
+ m_batchindex = 0;
+
+ uint32_t cached_flags = 0;
+ for (render_primitive &prim : *win->m_primlist)
+ {
+ switch (prim.type)
+ {
+ case render_primitive::LINE:
+ if (PRIMFLAG_GET_VECTOR(prim.flags))
+ {
+ batch_vector(prim);
+ cached_flags = prim.flags;
+ }
+ break;
+
+ case render_primitive::QUAD:
+ if (PRIMFLAG_GET_VECTORBUF(prim.flags))
+ {
+ quad_width = prim.get_quad_width();
+ quad_height = prim.get_quad_height();
+ target_width = prim.get_full_quad_width();
+ target_height = prim.get_full_quad_height();
+ }
+ break;
+
+ default:
+ // Skip
+ break;
+ }
+ }
+
+ // handle orientation and rotation for vectors as they were a texture
+ if (m_shaders->enabled())
+ {
+ bool orientation_swap_xy =
+ (win->machine().system().flags & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY;
+ bool rotation_swap_xy =
+ (win->target()->orientation() & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY;
+ bool swap_xy = orientation_swap_xy ^ rotation_swap_xy;
+
+ bool rotation_0 = win->target()->orientation() == ROT0;
+ bool rotation_90 = win->target()->orientation() == ROT90;
+ bool rotation_180 = win->target()->orientation() == ROT180;
+ bool rotation_270 = win->target()->orientation() == ROT270;
+ bool flip_x =
+ ((rotation_0 || rotation_270) && orientation_swap_xy) ||
+ ((rotation_180 || rotation_270) && !orientation_swap_xy);
+ bool flip_y =
+ ((rotation_0 || rotation_90) && orientation_swap_xy) ||
+ ((rotation_180 || rotation_90) && !orientation_swap_xy);
+
+ float screen_width = float(this->get_width());
+ float screen_height = float(this->get_height());
+ float half_screen_width = screen_width * 0.5f;
+ float half_screen_height = screen_height * 0.5f;
+ float screen_swap_x_factor = 1.0f / screen_width * screen_height;
+ float screen_swap_y_factor = 1.0f / screen_height * screen_width;
+ float screen_target_ratio_x = screen_width / target_width;
+ float screen_target_ratio_y = screen_height / target_height;
+
+ if (swap_xy)
+ {
+ std::swap(screen_target_ratio_x, screen_target_ratio_y);
+ }
+
+ for (int batchindex = 0; batchindex < m_batchindex; batchindex++)
+ {
+ if (swap_xy)
+ {
+ m_vectorbatch[batchindex].x *= screen_swap_x_factor;
+ m_vectorbatch[batchindex].y *= screen_swap_y_factor;
+ std::swap(m_vectorbatch[batchindex].x, m_vectorbatch[batchindex].y);
+ }
+
+ if (flip_x)
+ {
+ m_vectorbatch[batchindex].x = screen_width - m_vectorbatch[batchindex].x;
+ }
+
+ if (flip_y)
+ {
+ m_vectorbatch[batchindex].y = screen_height - m_vectorbatch[batchindex].y;
+ }
+
+ // center
+ m_vectorbatch[batchindex].x -= half_screen_width;
+ m_vectorbatch[batchindex].y -= half_screen_height;
+
+ // correct screen/target ratio (vectors are created in screen coordinates and have to be adjusted for texture corrdinates of the target)
+ m_vectorbatch[batchindex].x *= screen_target_ratio_x;
+ m_vectorbatch[batchindex].y *= screen_target_ratio_y;
+
+ // un-center
+ m_vectorbatch[batchindex].x += half_screen_width;
+ m_vectorbatch[batchindex].y += half_screen_height;
+ }
+ }
+
+ // now add a polygon entry
+ m_poly[m_numpolys].init(D3DPT_TRIANGLELIST, triangle_count, vertex_count, cached_flags, nullptr, D3DTOP_MODULATE, quad_width, quad_height);
+ m_numpolys++;
+}
+
+void renderer_d3d9::batch_vector(const render_primitive &prim)
+{
+ // get a pointer to the vertex buffer
+ if (m_vectorbatch == nullptr)
+ {
+ return;
+ }
+
+ // compute the effective width based on the direction of the line
+ float effwidth = prim.width;
+ if (effwidth < 2.0f)
+ {
+ effwidth = 2.0f;
+ }
+
+ // determine the bounds of a quad to draw this line
+ render_bounds b0, b1;
+ render_line_to_quad(&prim.bounds, effwidth, effwidth, &b0, &b1);
+
+ float lx = b1.x1 - b0.x1;
+ float ly = b1.y1 - b0.y1;
+ float wx = b1.x1 - b1.x0;
+ float wy = b1.y1 - b1.y0;
+ float line_length = sqrtf(lx * lx + ly * ly);
+ float line_width = sqrtf(wx * wx + wy * wy);
+
+ m_vectorbatch[m_batchindex + 0].x = b0.x0;
+ m_vectorbatch[m_batchindex + 0].y = b0.y0;
+ m_vectorbatch[m_batchindex + 1].x = b0.x1;
+ m_vectorbatch[m_batchindex + 1].y = b0.y1;
+ m_vectorbatch[m_batchindex + 2].x = b1.x0;
+ m_vectorbatch[m_batchindex + 2].y = b1.y0;
+
+ m_vectorbatch[m_batchindex + 3].x = b0.x1;
+ m_vectorbatch[m_batchindex + 3].y = b0.y1;
+ m_vectorbatch[m_batchindex + 4].x = b1.x0;
+ m_vectorbatch[m_batchindex + 4].y = b1.y0;
+ m_vectorbatch[m_batchindex + 5].x = b1.x1;
+ m_vectorbatch[m_batchindex + 5].y = b1.y1;
+
+ if (m_shaders->enabled())
+ {
+ // procedural generated texture
+ m_vectorbatch[m_batchindex + 0].u0 = 0.0f;
+ m_vectorbatch[m_batchindex + 0].v0 = 0.0f;
+ m_vectorbatch[m_batchindex + 1].u0 = 0.0f;
+ m_vectorbatch[m_batchindex + 1].v0 = 1.0f;
+ m_vectorbatch[m_batchindex + 2].u0 = 1.0f;
+ m_vectorbatch[m_batchindex + 2].v0 = 0.0f;
+
+ m_vectorbatch[m_batchindex + 3].u0 = 0.0f;
+ m_vectorbatch[m_batchindex + 3].v0 = 1.0f;
+ m_vectorbatch[m_batchindex + 4].u0 = 1.0f;
+ m_vectorbatch[m_batchindex + 4].v0 = 0.0f;
+ m_vectorbatch[m_batchindex + 5].u0 = 1.0f;
+ m_vectorbatch[m_batchindex + 5].v0 = 1.0f;
+ }
+ else
+ {
+ vec2f& start = get_default_texture()->get_uvstart();
+ vec2f& stop = get_default_texture()->get_uvstop();
+
+ m_vectorbatch[m_batchindex + 0].u0 = start.c.x;
+ m_vectorbatch[m_batchindex + 0].v0 = start.c.y;
+ m_vectorbatch[m_batchindex + 1].u0 = start.c.x;
+ m_vectorbatch[m_batchindex + 1].v0 = stop.c.y;
+ m_vectorbatch[m_batchindex + 2].u0 = stop.c.x;
+ m_vectorbatch[m_batchindex + 2].v0 = start.c.y;
+
+ m_vectorbatch[m_batchindex + 3].u0 = start.c.x;
+ m_vectorbatch[m_batchindex + 3].v0 = stop.c.y;
+ m_vectorbatch[m_batchindex + 4].u0 = stop.c.x;
+ m_vectorbatch[m_batchindex + 4].v0 = start.c.y;
+ m_vectorbatch[m_batchindex + 5].u0 = stop.c.x;
+ m_vectorbatch[m_batchindex + 5].v0 = stop.c.y;
+ }
+
+ // determine the color of the line
+ int32_t r = (int32_t)(prim.color.r * 255.0f);
+ int32_t g = (int32_t)(prim.color.g * 255.0f);
+ int32_t b = (int32_t)(prim.color.b * 255.0f);
+ int32_t a = (int32_t)(prim.color.a * 255.0f);
+ DWORD color = D3DCOLOR_ARGB(a, r, g, b);
+
+ // set the color, Z parameters to standard values
+ for (int i = 0; i < 6; i++)
+ {
+ m_vectorbatch[m_batchindex + i].x -= 0.5f;
+ m_vectorbatch[m_batchindex + i].y -= 0.5f;
+ m_vectorbatch[m_batchindex + i].z = 0.0f;
+ m_vectorbatch[m_batchindex + i].rhw = 1.0f;
+ m_vectorbatch[m_batchindex + i].color = color;
+
+ // vector length/width
+ m_vectorbatch[m_batchindex + i].u1 = line_length;
+ m_vectorbatch[m_batchindex + i].v1 = line_width;
+ }
+
+ m_batchindex += 6;
+}
+
+
+//============================================================
+// draw_line
+//============================================================
+
+void renderer_d3d9::draw_line(const render_primitive &prim)
+{
+ // get a pointer to the vertex buffer
+ vertex *vertex = mesh_alloc(4);
+ if (vertex == nullptr)
+ {
+ return;
+ }
+
+ // compute the effective width based on the direction of the line
+ float effwidth = prim.width;
+ if (effwidth < 1.0f)
+ {
+ effwidth = 1.0f;
+ }
+
+ // determine the bounds of a quad to draw this line
+ render_bounds b0, b1;
+ render_line_to_quad(&prim.bounds, effwidth, 0.0f, &b0, &b1);
+
+ vertex[0].x = b0.x0;
+ vertex[0].y = b0.y0;
+ vertex[1].x = b0.x1;
+ vertex[1].y = b0.y1;
+ vertex[2].x = b1.x0;
+ vertex[2].y = b1.y0;
+ vertex[3].x = b1.x1;
+ vertex[3].y = b1.y1;
+
+ vec2f& start = get_default_texture()->get_uvstart();
+ vec2f& stop = get_default_texture()->get_uvstop();
+
+ vertex[0].u0 = start.c.x;
+ vertex[0].v0 = start.c.y;
+ vertex[1].u0 = start.c.x;
+ vertex[1].v0 = stop.c.y;
+ vertex[2].u0 = stop.c.x;
+ vertex[2].v0 = start.c.y;
+ vertex[3].u0 = stop.c.x;
+ vertex[3].v0 = stop.c.y;
+
+ // determine the color of the line
+ int32_t r = (int32_t)(prim.color.r * 255.0f);
+ int32_t g = (int32_t)(prim.color.g * 255.0f);
+ int32_t b = (int32_t)(prim.color.b * 255.0f);
+ int32_t a = (int32_t)(prim.color.a * 255.0f);
+ DWORD color = D3DCOLOR_ARGB(a, r, g, b);
+
+ // set the color, Z parameters to standard values
+ for (int i = 0; i < 4; i++)
+ {
+ vertex[i].z = 0.0f;
+ vertex[i].rhw = 1.0f;
+ vertex[i].color = color;
+ }
+
+ // now add a polygon entry
+ m_poly[m_numpolys].init(D3DPT_TRIANGLESTRIP, 2, 4, prim.flags, nullptr, D3DTOP_MODULATE, 0.0f, 0.0f);
+ m_numpolys++;
+}
+
+
+//============================================================
+// draw_quad
+//============================================================
+
+void renderer_d3d9::draw_quad(const render_primitive &prim)
+{
+ texture_info *texture = m_texture_manager->find_texinfo(&prim.texture, prim.flags);
+ if (texture == nullptr)
+ {
+ texture = get_default_texture();
+ }
+
+ // get a pointer to the vertex buffer
+ vertex *vertex = mesh_alloc(4);
+ if (vertex == nullptr)
+ {
+ return;
+ }
+
+ // fill in the vertexes clockwise
+ vertex[0].x = prim.bounds.x0;
+ vertex[0].y = prim.bounds.y0;
+ vertex[1].x = prim.bounds.x1;
+ vertex[1].y = prim.bounds.y0;
+ vertex[2].x = prim.bounds.x0;
+ vertex[2].y = prim.bounds.y1;
+ vertex[3].x = prim.bounds.x1;
+ vertex[3].y = prim.bounds.y1;
+ float quad_width = prim.get_quad_width();
+ float quad_height = prim.get_quad_height();
+
+ // set the texture coordinates
+ if (texture != nullptr)
+ {
+ vec2f& start = texture->get_uvstart();
+ vec2f& stop = texture->get_uvstop();
+ vec2f delta = stop - start;
+
+ vertex[0].u0 = start.c.x + delta.c.x * prim.texcoords.tl.u;
+ vertex[0].v0 = start.c.y + delta.c.y * prim.texcoords.tl.v;
+ vertex[1].u0 = start.c.x + delta.c.x * prim.texcoords.tr.u;
+ vertex[1].v0 = start.c.y + delta.c.y * prim.texcoords.tr.v;
+ vertex[2].u0 = start.c.x + delta.c.x * prim.texcoords.bl.u;
+ vertex[2].v0 = start.c.y + delta.c.y * prim.texcoords.bl.v;
+ vertex[3].u0 = start.c.x + delta.c.x * prim.texcoords.br.u;
+ vertex[3].v0 = start.c.y + delta.c.y * prim.texcoords.br.v;
+ }
+
+ // determine the color, allowing for over modulation
+ int32_t r = (int32_t)(prim.color.r * 255.0f);
+ int32_t g = (int32_t)(prim.color.g * 255.0f);
+ int32_t b = (int32_t)(prim.color.b * 255.0f);
+ int32_t a = (int32_t)(prim.color.a * 255.0f);
+ DWORD color = D3DCOLOR_ARGB(a, r, g, b);
+
+ // adjust half pixel X/Y offset, set the color, Z parameters to standard values
+ for (int i = 0; i < 4; i++)
+ {
+ vertex[i].x -= 0.5f;
+ vertex[i].y -= 0.5f;
+ vertex[i].z = 0.0f;
+ vertex[i].rhw = 1.0f;
+ vertex[i].color = color;
+ }
+
+ // now add a polygon entry
+ m_poly[m_numpolys].init(D3DPT_TRIANGLESTRIP, 2, 4, prim.flags, texture, D3DTOP_MODULATE, quad_width, quad_height);
+ m_numpolys++;
+}
+
+
+//============================================================
+// primitive_alloc
+//============================================================
+
+vertex *renderer_d3d9::mesh_alloc(int numverts)
+{
+ HRESULT result;
+
+ // if we're going to overflow, flush
+ if (m_lockedbuf != nullptr && m_numverts + numverts >= VERTEX_BUFFER_SIZE)
+ {
+ primitive_flush_pending();
+
+ if (m_shaders->enabled())
+ m_shaders->init_fsfx_quad();
+ }
+
+ // if we don't have a lock, grab it now
+ if (m_lockedbuf == nullptr)
+ {
+ result = m_vertexbuf->Lock(0, 0, (VOID **)&m_lockedbuf, D3DLOCK_DISCARD);
+ if (FAILED(result))
+ return nullptr;
+ }
+
+ // if we already have the lock and enough room, just return a pointer
+ if (m_lockedbuf != nullptr && m_numverts + numverts < VERTEX_BUFFER_SIZE)
+ {
+ int oldverts = m_numverts;
+ m_numverts += numverts;
+ return &m_lockedbuf[oldverts];
+ }
+
+ return nullptr;
+}
+
+
+//============================================================
+// primitive_flush_pending
+//============================================================
+
+void renderer_d3d9::primitive_flush_pending()
+{
+ // ignore if we're not locked
+ if (m_lockedbuf == nullptr)
+ return;
+
+ // unlock the buffer
+ HRESULT result = m_vertexbuf->Unlock();
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during vertex buffer unlock call\n", result);
+
+ m_lockedbuf = nullptr;
+
+ // set the stream
+ result = m_device->SetStreamSource(0, m_vertexbuf, 0, sizeof(vertex));
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetStreamSource call\n", result);
+
+ m_shaders->begin_draw();
+
+ int vertnum = 0;
+ if (m_shaders->enabled())
+ {
+ vertnum = 6;
+ }
+
+ // now do the polys
+ for (int polynum = 0; polynum < m_numpolys; polynum++)
+ {
+ uint32_t flags = m_poly[polynum].flags();
+ texture_info *texture = m_poly[polynum].texture();
+ int newfilter;
+
+ // set the texture if different
+ set_texture(texture);
+
+ // set filtering if different
+ if (texture != nullptr)
+ {
+ newfilter = FALSE;
+ if (PRIMFLAG_GET_SCREENTEX(flags))
+ newfilter = video_config.filter;
+ set_filter(newfilter);
+ set_wrap(PRIMFLAG_GET_TEXWRAP(flags) ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP);
+ set_modmode(m_poly[polynum].modmode());
+ }
+
+ if (vertnum + m_poly[polynum].numverts() > m_numverts)
+ {
+ osd_printf_error("Error: vertnum (%d) plus poly vertex count (%d) > %d\n", vertnum, m_poly[polynum].numverts(), m_numverts);
+ fflush(stdout);
+ }
+
+ assert(vertnum + m_poly[polynum].numverts() <= m_numverts);
+
+ if(m_shaders->enabled())
+ {
+ // reset blend mode (handled by shader passes)
+ set_blendmode(BLENDMODE_NONE);
+
+ m_shaders->render_quad(&m_poly[polynum], vertnum);
+ }
+ else
+ {
+ // set blend mode
+ set_blendmode(PRIMFLAG_GET_BLENDMODE(flags));
+
+ // add the primitives
+ result = m_device->DrawPrimitive(m_poly[polynum].type(), vertnum, m_poly[polynum].count());
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device draw_primitive call\n", result);
+ }
+
+ vertnum += m_poly[polynum].numverts();
+ }
+
+ m_shaders->end_draw();
+
+ // reset the vertex count
+ m_numverts = 0;
+ m_numpolys = 0;
+}
+
+
+std::vector<ui::menu_item> renderer_d3d9::get_slider_list()
+{
+ m_sliders_dirty = false;
+
+ std::vector<ui::menu_item> sliders;
+ sliders.insert(sliders.end(), m_sliders.begin(), m_sliders.end());
+
+ if (m_shaders != nullptr && m_shaders->enabled())
+ {
+ std::vector<ui::menu_item> s_slider = m_shaders->get_slider_list();
+ sliders.insert(sliders.end(), s_slider.begin(), s_slider.end());
+ }
+
+ return sliders;
+}
+
+void renderer_d3d9::set_sliders_dirty()
+{
+ m_sliders_dirty = true;
+}
+
+
+//============================================================
+// texture_info destructor
+//============================================================
+
+texture_info::~texture_info()
+{
+ if (m_d3dfinaltex != nullptr)
+ {
+ if (m_d3dtex == m_d3dfinaltex)
+ m_d3dtex = nullptr;
+
+ m_d3dfinaltex->Release();
+ }
+
+ if (m_d3dtex != nullptr)
+ m_d3dtex->Release();
+
+ if (m_d3dsurface != nullptr)
+ m_d3dsurface->Release();
+}
+
+
+//============================================================
+// texture_info constructor
+//============================================================
+
+texture_info::texture_info(d3d_texture_manager *manager, const render_texinfo* texsource, int prescale, uint32_t flags)
+{
+ HRESULT result;
+
+ // fill in the core data
+ m_texture_manager = manager;
+ m_renderer = m_texture_manager->get_d3d();
+ m_hash = m_texture_manager->texture_compute_hash(texsource, flags);
+ m_flags = flags;
+ m_texinfo = *texsource;
+ m_xprescale = prescale;
+ m_yprescale = prescale;
+
+ m_d3dtex = nullptr;
+ m_d3dsurface = nullptr;
+ m_d3dfinaltex = nullptr;
+
+ // determine texture type, required to compute texture size
+ if (!PRIMFLAG_GET_SCREENTEX(flags))
+ {
+ m_type = TEXTURE_TYPE_PLAIN;
+ }
+ else
+ {
+ if ((m_xprescale == 1 && m_yprescale == 1) || m_renderer->get_shaders()->enabled())
+ {
+ m_type = m_texture_manager->is_dynamic_supported() ? TEXTURE_TYPE_DYNAMIC : TEXTURE_TYPE_PLAIN;
+ }
+ else
+ {
+ if (m_texture_manager->is_stretch_supported() && PRIMFLAG_GET_TEXFORMAT(flags) != TEXFORMAT_YUY16)
+ {
+ m_type = TEXTURE_TYPE_SURFACE;
+ }
+ else
+ {
+ m_type = m_texture_manager->is_dynamic_supported() ? TEXTURE_TYPE_DYNAMIC : TEXTURE_TYPE_PLAIN;
+ }
+ }
+ }
+
+ // compute the size
+ compute_size(texsource->width, texsource->height);
+
+ // non-screen textures are easy
+ if (!PRIMFLAG_GET_SCREENTEX(flags))
+ {
+ assert(PRIMFLAG_TEXFORMAT(flags) != TEXFORMAT_YUY16);
+ result = m_renderer->get_device()->CreateTexture(m_rawdims.c.x, m_rawdims.c.y, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_d3dtex, nullptr);
+ if (FAILED(result))
+ goto error;
+ m_d3dfinaltex = m_d3dtex;
+ }
+
+ // screen textures are allocated differently
+ else
+ {
+ D3DFORMAT format;
+ DWORD usage = m_texture_manager->is_dynamic_supported() ? D3DUSAGE_DYNAMIC : 0;
+ D3DPOOL pool = m_texture_manager->is_dynamic_supported() ? D3DPOOL_DEFAULT : D3DPOOL_MANAGED;
+ int maxdim = std::max(m_renderer->get_presentation()->BackBufferWidth, m_renderer->get_presentation()->BackBufferHeight);
+
+ // pick the format
+ if (PRIMFLAG_GET_TEXFORMAT(flags) == TEXFORMAT_YUY16)
+ {
+ format = m_texture_manager->get_yuv_format();
+ }
+ else if (PRIMFLAG_GET_TEXFORMAT(flags) == TEXFORMAT_ARGB32 || PRIMFLAG_GET_TEXFORMAT(flags) == TEXFORMAT_PALETTEA16)
+ {
+ format = D3DFMT_A8R8G8B8;
+ }
+ else
+ {
+ format = m_renderer->get_screen_format();
+ }
+
+ // don't prescale above screen size
+ while (m_xprescale > 1 && m_rawdims.c.x * m_xprescale >= 2 * maxdim)
+ {
+ m_xprescale--;
+ }
+ while (m_xprescale > 1 && m_rawdims.c.x * m_xprescale > manager->get_max_texture_width())
+ {
+ m_xprescale--;
+ }
+ while (m_yprescale > 1 && m_rawdims.c.y * m_yprescale >= 2 * maxdim)
+ {
+ m_yprescale--;
+ }
+ while (m_yprescale > 1 && m_rawdims.c.y * m_yprescale > manager->get_max_texture_height())
+ {
+ m_yprescale--;
+ }
+
+ auto win = m_renderer->assert_window();
+
+ int prescale = win->prescale();
+ if (m_xprescale != prescale || m_yprescale != prescale)
+ {
+ osd_printf_verbose("Direct3D: adjusting prescale from %dx%d to %dx%d\n", prescale, prescale, m_xprescale, m_yprescale);
+ }
+
+ // loop until we allocate something or error
+ for (int attempt = 0; attempt < 2; attempt++)
+ {
+ // second attempt is always 1:1
+ if (attempt == 1)
+ {
+ m_xprescale = m_yprescale = 1;
+ }
+
+ // screen textures with no prescaling are pretty easy
+ if (m_xprescale == 1 && m_yprescale == 1)
+ {
+ result = m_renderer->get_device()->CreateTexture(m_rawdims.c.x, m_rawdims.c.y, 1, usage, format, pool, &m_d3dtex, nullptr);
+ if (result == D3D_OK)
+ {
+ m_d3dfinaltex = m_d3dtex;
+ break;
+ }
+ }
+ // screen textures with prescaling require two allocations
+ else
+ {
+ // use an offscreen plain surface for stretching if supported
+ // (won't work for YUY textures)
+ if (m_texture_manager->is_stretch_supported() && PRIMFLAG_GET_TEXFORMAT(flags) != TEXFORMAT_YUY16)
+ {
+ result = m_renderer->get_device()->CreateOffscreenPlainSurface(m_rawdims.c.x, m_rawdims.c.y, format, D3DPOOL_DEFAULT, &m_d3dsurface, nullptr);
+ if (FAILED(result))
+ {
+ continue;
+ }
+ }
+ // otherwise, we allocate a dynamic texture for the source
+ else
+ {
+ result = m_renderer->get_device()->CreateTexture(m_rawdims.c.x, m_rawdims.c.y, 1, usage, format, pool, &m_d3dtex, nullptr);
+ if (FAILED(result))
+ {
+ continue;
+ }
+ }
+
+ // for the target surface, we allocate a render target texture
+ int scwidth = m_rawdims.c.x * m_xprescale;
+ int scheight = m_rawdims.c.y * m_yprescale;
+
+ // target surfaces typically cannot be YCbCr, so we always pick RGB in that case
+ D3DFORMAT finalfmt = (format != m_texture_manager->get_yuv_format()) ? format : D3DFMT_A8R8G8B8;
+
+ result = m_renderer->get_device()->CreateTexture(scwidth, scheight, 1, D3DUSAGE_RENDERTARGET, finalfmt, D3DPOOL_DEFAULT, &m_d3dfinaltex, nullptr);
+ if (result == D3D_OK)
+ {
+ break;
+ }
+
+ m_d3dtex->Release();
+ m_d3dtex = nullptr;
+ }
+ }
+ }
+
+ // copy the data to the texture
+ set_data(texsource, flags);
+
+ return;
+
+error:
+ d3dintf->post_fx_available = false;
+ osd_printf_error("Direct3D: Critical warning: A texture failed to allocate. Expect things to get bad quickly.\n");
+ if (m_d3dsurface != nullptr)
+ m_d3dsurface->Release();
+ if (m_d3dtex != nullptr)
+ m_d3dtex->Release();
+}
+
+
+//============================================================
+// texture_info::compute_size_subroutine
+//============================================================
+
+void texture_info::compute_size_subroutine(int texwidth, int texheight, int* p_width, int* p_height)
+{
+ int finalheight = texheight;
+ int finalwidth = texwidth;
+
+ // adjust the aspect ratio if we need to
+ while (finalwidth < finalheight && finalheight / finalwidth > m_texture_manager->get_max_texture_aspect())
+ {
+ finalwidth *= 2;
+ }
+ while (finalheight < finalwidth && finalwidth / finalheight > m_texture_manager->get_max_texture_aspect())
+ {
+ finalheight *= 2;
+ }
+
+ *p_width = finalwidth;
+ *p_height = finalheight;
+}
+
+
+//============================================================
+// texture_info::compute_size
+//============================================================
+
+void texture_info::compute_size(int texwidth, int texheight)
+{
+ int finalheight = texheight;
+ int finalwidth = texwidth;
+
+ m_xborderpix = 0;
+ m_yborderpix = 0;
+
+ bool shaders_enabled = m_renderer->get_shaders()->enabled();
+ bool wrap_texture = (m_flags & PRIMFLAG_TEXWRAP_MASK) == PRIMFLAG_TEXWRAP_MASK;
+
+ // skip border when shaders are enabled
+ if (!shaders_enabled)
+ {
+ // if we're not wrapping, add a 1-2 pixel border on all sides
+ if (!wrap_texture)
+ {
+ // note we need 2 pixels in X for YUY textures
+ m_xborderpix = (PRIMFLAG_GET_TEXFORMAT(m_flags) == TEXFORMAT_YUY16) ? 2 : 1;
+ m_yborderpix = 1;
+ }
+ }
+
+ finalwidth += 2 * m_xborderpix;
+ finalheight += 2 * m_yborderpix;
+
+ // take texture size as given when shaders are enabled
+ if (!shaders_enabled)
+ {
+ compute_size_subroutine(finalwidth, finalheight, &finalwidth, &finalheight);
+
+ // if we added pixels for the border, and that just barely pushed us over, take it back
+ if (finalwidth > m_texture_manager->get_max_texture_width() || finalheight > m_texture_manager->get_max_texture_height())
+ {
+ finalheight = texheight;
+ finalwidth = texwidth;
+
+ m_xborderpix = 0;
+ m_yborderpix = 0;
+
+ compute_size_subroutine(finalwidth, finalheight, &finalwidth, &finalheight);
+ }
+ }
+
+ // if we're above the max width/height, do what?
+ if (finalwidth > m_texture_manager->get_max_texture_width() || finalheight > m_texture_manager->get_max_texture_height())
+ {
+ static bool printed = false;
+ if (!printed) osd_printf_warning("Texture too big! (wanted: %dx%d, max is %dx%d)\n", finalwidth, finalheight, (int)m_texture_manager->get_max_texture_width(), (int)m_texture_manager->get_max_texture_height());
+ printed = true;
+ }
+
+ // compute the U/V scale factors
+ m_start.c.x = (float)m_xborderpix / (float)finalwidth;
+ m_start.c.y = (float)m_yborderpix / (float)finalheight;
+ m_stop.c.x = (float)(texwidth + m_xborderpix) / (float)finalwidth;
+ m_stop.c.y = (float)(texheight + m_yborderpix) / (float)finalheight;
+
+ // set the final values
+ m_rawdims.c.x = finalwidth;
+ m_rawdims.c.y = finalheight;
+}
+
+
+//============================================================
+// copyline_palette16
+//============================================================
+
+inline void texture_info::copyline_palette16(uint32_t *dst, const uint16_t *src, int width, const rgb_t *palette, int xborderpix)
+{
+ if (xborderpix)
+ *dst++ = 0xff000000 | palette[*src];
+ for (int x = 0; x < width; x++)
+ *dst++ = 0xff000000 | palette[*src++];
+ if (xborderpix)
+ *dst++ = 0xff000000 | palette[*--src];
+}
+
+
+//============================================================
+// copyline_palettea16
+//============================================================
+
+inline void texture_info::copyline_palettea16(uint32_t *dst, const uint16_t *src, int width, const rgb_t *palette, int xborderpix)
+{
+ if (xborderpix)
+ *dst++ = palette[*src];
+ for (int x = 0; x < width; x++)
+ *dst++ = palette[*src++];
+ if (xborderpix)
+ *dst++ = palette[*--src];
+}
+
+
+//============================================================
+// copyline_rgb32
+//============================================================
+
+inline void texture_info::copyline_rgb32(uint32_t *dst, const uint32_t *src, int width, const rgb_t *palette, int xborderpix)
+{
+ if (palette != nullptr)
+ {
+ if (xborderpix)
+ {
+ rgb_t srcpix = *src;
+ *dst++ = 0xff000000 | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()];
+ }
+ for (int x = 0; x < width; x++)
+ {
+ rgb_t srcpix = *src++;
+ *dst++ = 0xff000000 | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()];
+ }
+ if (xborderpix)
+ {
+ rgb_t srcpix = *--src;
+ *dst++ = 0xff000000 | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()];
+ }
+ }
+ else
+ {
+ if (xborderpix)
+ *dst++ = 0xff000000 | *src;
+ for (int x = 0; x < width; x++)
+ *dst++ = 0xff000000 | *src++;
+ if (xborderpix)
+ *dst++ = 0xff000000 | *--src;
+ }
+}
+
+
+//============================================================
+// copyline_argb32
+//============================================================
+
+inline void texture_info::copyline_argb32(uint32_t *dst, const uint32_t *src, int width, const rgb_t *palette, int xborderpix)
+{
+ if (palette != nullptr)
+ {
+ if (xborderpix)
+ {
+ rgb_t srcpix = *src;
+ *dst++ = (srcpix & 0xff000000) | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()];
+ }
+ for (int x = 0; x < width; x++)
+ {
+ rgb_t srcpix = *src++;
+ *dst++ = (srcpix & 0xff000000) | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()];
+ }
+ if (xborderpix)
+ {
+ rgb_t srcpix = *--src;
+ *dst++ = (srcpix & 0xff000000) | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()];
+ }
+ }
+ else
+ {
+ if (xborderpix)
+ *dst++ = *src;
+ memcpy(dst, src, sizeof(uint32_t) * width);
+ dst += width;
+ src += width;
+ if (xborderpix)
+ *dst++ = *--src;
+ }
+}
+
+
+//============================================================
+// copyline_yuy16_to_yuy2
+//============================================================
+
+inline void texture_info::copyline_yuy16_to_yuy2(uint16_t *dst, const uint16_t *src, int width, const rgb_t *palette)
+{
+ assert(width % 2 == 0);
+
+ if (palette != nullptr) // palette (really RGB map) case
+ {
+ for (int x = 0; x < width; x += 2)
+ {
+ uint16_t srcpix0 = *src++;
+ uint16_t srcpix1 = *src++;
+ *dst++ = palette[0x000 + (srcpix0 >> 8)] | (srcpix0 << 8);
+ *dst++ = palette[0x000 + (srcpix1 >> 8)] | (srcpix1 << 8);
+ }
+ }
+ else // direct case
+ {
+ for (int x = 0; x < width; x += 2)
+ {
+ uint16_t srcpix0 = *src++;
+ uint16_t srcpix1 = *src++;
+ *dst++ = (srcpix0 >> 8) | (srcpix0 << 8);
+ *dst++ = (srcpix1 >> 8) | (srcpix1 << 8);
+ }
+ }
+}
+
+
+//============================================================
+// copyline_yuy16_to_uyvy
+//============================================================
+
+inline void texture_info::copyline_yuy16_to_uyvy(uint16_t *dst, const uint16_t *src, int width, const rgb_t *palette)
+{
+ assert(width % 2 == 0);
+
+ if (palette != nullptr) // palette (really RGB map) case
+ {
+ for (int x = 0; x < width; x += 2)
+ {
+ uint16_t srcpix0 = *src++;
+ uint16_t srcpix1 = *src++;
+ *dst++ = palette[0x100 + (srcpix0 >> 8)] | (srcpix0 & 0xff);
+ *dst++ = palette[0x100 + (srcpix1 >> 8)] | (srcpix1 & 0xff);
+ }
+ }
+
+ // direct case
+ else
+ {
+ memcpy(dst, src, sizeof(uint16_t) * width);
+ }
+}
+
+
+//============================================================
+// copyline_yuy16_to_argb
+//============================================================
+
+inline void texture_info::copyline_yuy16_to_argb(uint32_t *dst, const uint16_t *src, int width, const rgb_t *palette)
+{
+ assert(width % 2 == 0);
+
+ if (palette != nullptr) // palette (really RGB map) case
+ {
+ for (int x = 0; x < width / 2; x++)
+ {
+ uint16_t srcpix0 = *src++;
+ uint16_t srcpix1 = *src++;
+ uint8_t cb = srcpix0 & 0xff;
+ uint8_t cr = srcpix1 & 0xff;
+ *dst++ = ycc_to_rgb(palette[0x000 + (srcpix0 >> 8)], cb, cr);
+ *dst++ = ycc_to_rgb(palette[0x000 + (srcpix1 >> 8)], cb, cr);
+ }
+ }
+ else // direct case
+ {
+ for (int x = 0; x < width; x += 2)
+ {
+ uint16_t srcpix0 = *src++;
+ uint16_t srcpix1 = *src++;
+ uint8_t cb = srcpix0 & 0xff;
+ uint8_t cr = srcpix1 & 0xff;
+ *dst++ = ycc_to_rgb(srcpix0 >> 8, cb, cr);
+ *dst++ = ycc_to_rgb(srcpix1 >> 8, cb, cr);
+ }
+ }
+}
+
+
+//============================================================
+// texture_set_data
+//============================================================
+
+void texture_info::set_data(const render_texinfo *texsource, uint32_t flags)
+{
+ D3DLOCKED_RECT rect;
+ HRESULT result;
+
+ // lock the texture
+ switch (m_type)
+ {
+ default:
+ case TEXTURE_TYPE_PLAIN: result = m_d3dtex->LockRect(0, &rect, nullptr, 0); break;
+ case TEXTURE_TYPE_DYNAMIC: result = m_d3dtex->LockRect(0, &rect, nullptr, D3DLOCK_DISCARD); break;
+ case TEXTURE_TYPE_SURFACE: result = m_d3dsurface->LockRect(&rect, nullptr, D3DLOCK_DISCARD); break;
+ }
+ if (FAILED(result))
+ {
+ return;
+ }
+
+ // loop over Y
+ int tex_format = PRIMFLAG_GET_TEXFORMAT(flags);
+#if 0
+ if (tex_format == TEXFORMAT_ARGB32 && texsource->palette == nullptr && texsource->width == texsource->rowpixels && m_xborderpix == 0 && m_yborderpix == 0)
+ {
+ memcpy((BYTE *)rect.pBits, texsource->base, sizeof(uint32_t) * texsource->width * texsource->height);
+ }
+ else
+#endif
+ {
+ int miny = 0 - m_yborderpix;
+ int maxy = texsource->height + m_yborderpix;
+
+ for (int dsty = miny; dsty < maxy; dsty++)
+ {
+ int srcy = (dsty < 0) ? 0 : (dsty >= texsource->height) ? texsource->height - 1 : dsty;
+
+ void *dst = (BYTE *)rect.pBits + (dsty + m_yborderpix) * rect.Pitch;
+
+ switch (tex_format)
+ {
+ case TEXFORMAT_PALETTE16:
+ copyline_palette16((uint32_t *)dst, (uint16_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
+ break;
+
+ case TEXFORMAT_PALETTEA16:
+ copyline_palettea16((uint32_t *)dst, (uint16_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
+ break;
+
+ case TEXFORMAT_RGB32:
+ copyline_rgb32((uint32_t *)dst, (uint32_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
+ break;
+
+ case TEXFORMAT_ARGB32:
+ copyline_argb32((uint32_t *)dst, (uint32_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
+ break;
+
+ case TEXFORMAT_YUY16:
+ if (m_texture_manager->get_yuv_format() == D3DFMT_YUY2)
+ copyline_yuy16_to_yuy2((uint16_t *)dst, (uint16_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette);
+ else if (m_texture_manager->get_yuv_format() == D3DFMT_UYVY)
+ copyline_yuy16_to_uyvy((uint16_t *)dst, (uint16_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette);
+ else
+ copyline_yuy16_to_argb((uint32_t *)dst, (uint16_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette);
+ break;
+
+ default:
+ osd_printf_error("Unknown texture blendmode=%d format=%d\n", PRIMFLAG_GET_BLENDMODE(flags), PRIMFLAG_GET_TEXFORMAT(flags));
+ break;
+ }
+ }
+ }
+
+ // unlock
+ switch (m_type)
+ {
+ default:
+ case TEXTURE_TYPE_PLAIN: result = m_d3dtex->UnlockRect(0); break;
+ case TEXTURE_TYPE_DYNAMIC: result = m_d3dtex->UnlockRect(0); break;
+ case TEXTURE_TYPE_SURFACE: result = m_d3dsurface->UnlockRect(); break;
+ }
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during texture UnlockRect call\n", result);
+
+ // prescale
+ prescale();
+}
+
+
+//============================================================
+// texture_info::prescale
+//============================================================
+
+void texture_info::prescale()
+{
+ IDirect3DSurface9 *scale_surface;
+ HRESULT result;
+ int i;
+
+ // if we don't need to, just skip it
+ if (m_d3dtex == m_d3dfinaltex)
+ return;
+
+ // for all cases, we need to get the surface of the render target
+ result = m_d3dfinaltex->GetSurfaceLevel(0, &scale_surface);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during texture GetSurfaceLevel call\n", result);
+
+ // if we have an offscreen plain surface, we can just StretchRect to it
+ if (m_type == TEXTURE_TYPE_SURFACE)
+ {
+ assert(m_d3dsurface != nullptr);
+
+ // set the source bounds
+ RECT source;
+ source.left = source.top = 0;
+ source.right = m_texinfo.width + 2 * m_xborderpix;
+ source.bottom = m_texinfo.height + 2 * m_yborderpix;
+
+ // set the target bounds
+ RECT dest;
+ dest = source;
+ dest.right *= m_xprescale;
+ dest.bottom *= m_yprescale;
+
+ // do the stretchrect
+ result = m_renderer->get_device()->StretchRect(m_d3dsurface, &source, scale_surface, &dest, D3DTEXF_POINT);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device stretct_rect call\n", result);
+ }
+
+ // if we are using a texture render target, we need to do more preparations
+ else
+ {
+ IDirect3DSurface9 *backbuffer;
+
+ assert(m_d3dtex != nullptr);
+
+ // first remember the original render target and set the new one
+ result = m_renderer->get_device()->GetRenderTarget(0, &backbuffer);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device GetRenderTarget call\n", result);
+ result = m_renderer->get_device()->SetRenderTarget(0, scale_surface);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetRenderTarget call 1\n", result);
+ m_renderer->reset_render_states();
+
+ // start the scene
+ result = m_renderer->get_device()->BeginScene();
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device BeginScene call\n", result);
+
+ // configure the rendering pipeline
+ m_renderer->set_filter(FALSE);
+ m_renderer->set_blendmode(BLENDMODE_NONE);
+ result = m_renderer->get_device()->SetTexture(0, m_d3dtex);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetTexture call\n", result);
+
+ // lock the vertex buffer
+ vertex *lockedbuf;
+ result = m_renderer->get_vertex_buffer()->Lock(0, 0, (VOID **)&lockedbuf, D3DLOCK_DISCARD);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during vertex buffer lock call\n", result);
+
+ // configure the X/Y coordinates on the target surface
+ lockedbuf[0].x = -0.5f;
+ lockedbuf[0].y = -0.5f;
+ lockedbuf[1].x = (float)((m_texinfo.width + 2 * m_xborderpix) * m_xprescale) - 0.5f;
+ lockedbuf[1].y = -0.5f;
+ lockedbuf[2].x = -0.5f;
+ lockedbuf[2].y = (float)((m_texinfo.height + 2 * m_yborderpix) * m_yprescale) - 0.5f;
+ lockedbuf[3].x = (float)((m_texinfo.width + 2 * m_xborderpix) * m_xprescale) - 0.5f;
+ lockedbuf[3].y = (float)((m_texinfo.height + 2 * m_yborderpix) * m_yprescale) - 0.5f;
+
+ // configure the U/V coordintes on the source texture
+ lockedbuf[0].u0 = 0.0f;
+ lockedbuf[0].v0 = 0.0f;
+ lockedbuf[1].u0 = (float)(m_texinfo.width + 2 * m_xborderpix) / (float)m_rawdims.c.x;
+ lockedbuf[1].v0 = 0.0f;
+ lockedbuf[2].u0 = 0.0f;
+ lockedbuf[2].v0 = (float)(m_texinfo.height + 2 * m_yborderpix) / (float)m_rawdims.c.y;
+ lockedbuf[3].u0 = (float)(m_texinfo.width + 2 * m_xborderpix) / (float)m_rawdims.c.x;
+ lockedbuf[3].v0 = (float)(m_texinfo.height + 2 * m_yborderpix) / (float)m_rawdims.c.y;
+
+ // reset the remaining vertex parameters
+ for (i = 0; i < 4; i++)
+ {
+ lockedbuf[i].z = 0.0f;
+ lockedbuf[i].rhw = 1.0f;
+ lockedbuf[i].color = D3DCOLOR_ARGB(0xff,0xff,0xff,0xff);
+ }
+
+ // unlock the vertex buffer
+ result = m_renderer->get_vertex_buffer()->Unlock();
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during vertex buffer unlock call\n", result);
+
+ // set the stream and draw the triangle strip
+ result = m_renderer->get_device()->SetStreamSource(0, m_renderer->get_vertex_buffer(), 0, sizeof(vertex));
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetStreamSource call\n", result);
+ result = m_renderer->get_device()->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device DrawPrimitive call\n", result);
+
+ // end the scene
+ result = m_renderer->get_device()->EndScene();
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device end_scene call\n", result);
+
+ // reset the render target and release our reference to the backbuffer
+ result = m_renderer->get_device()->SetRenderTarget(0, backbuffer);
+ if (FAILED(result))
+ osd_printf_verbose("Direct3D: Error %08lX during device SetRenderTarget call 2\n", result);
+ backbuffer->Release();
+ m_renderer->reset_render_states();
+ }
+
+ // release our reference to the target surface
+ scale_surface->Release();
+}
+
+
+//============================================================
+// d3d_render_target::~d3d_render_target
+//============================================================
+
+d3d_render_target::~d3d_render_target()
+{
+ for (int index = 0; index < MAX_BLOOM_COUNT; index++)
+ {
+ if (bloom_texture[index] != nullptr)
+ bloom_texture[index]->Release();
+
+ if (bloom_surface[index] != nullptr)
+ bloom_surface[index]->Release();
+ }
+
+ for (int index = 0; index < 2; index++)
+ {
+ if (source_texture[index] != nullptr)
+ source_texture[index]->Release();
+
+ if (source_surface[index] != nullptr)
+ source_surface[index]->Release();
+
+ if (target_texture[index] != nullptr)
+ target_texture[index]->Release();
+
+ if (target_surface[index] != nullptr)
+ target_surface[index]->Release();
+ }
+
+ if (cache_texture != nullptr)
+ cache_texture->Release();
+
+ if (cache_surface != nullptr)
+ cache_surface->Release();
+}
+
+
+//============================================================
+// d3d_render_target::init - initializes a render target
+//============================================================
+
+bool d3d_render_target::init(renderer_d3d9 *d3d, int source_width, int source_height, int target_width, int target_height, int screen_index)
+{
+ HRESULT result;
+
+ this->width = source_width;
+ this->height = source_height;
+
+ this->target_width = target_width;
+ this->target_height = target_height;
+
+ this->screen_index = screen_index;
+
+ for (int index = 0; index < 2; index++)
+ {
+ result = d3d->get_device()->CreateTexture(source_width, source_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &source_texture[index], nullptr);
+ if (FAILED(result))
+ return false;
+
+ source_texture[index]->GetSurfaceLevel(0, &source_surface[index]);
+
+ result = d3d->get_device()->CreateTexture(target_width, target_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &target_texture[index], nullptr);
+ if (FAILED(result))
+ return false;
+
+ target_texture[index]->GetSurfaceLevel(0, &target_surface[index]);
+ }
+
+ result = d3d->get_device()->CreateTexture(target_width, target_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &cache_texture, nullptr);
+ if (FAILED(result))
+ return false;
+
+ cache_texture->GetSurfaceLevel(0, &cache_surface);
+
+ auto win = d3d->assert_window();
+
+ const screen_device *first_screen = screen_device_iterator(win->machine().root_device()).first();
+ bool vector_screen =
+ first_screen != nullptr &&
+ first_screen->screen_type() == SCREEN_TYPE_VECTOR;
+
+ float scale_factor = 0.75f;
+ int scale_count = vector_screen ? MAX_BLOOM_COUNT : HALF_BLOOM_COUNT;
+
+ float bloom_width = (float)source_width;
+ float bloom_height = (float)source_height;
+ float bloom_size = bloom_width < bloom_height ? bloom_width : bloom_height;
+ for (int bloom_index = 0; bloom_index < scale_count && bloom_size >= 2.0f; bloom_size *= scale_factor)
+ {
+ this->bloom_dims[bloom_index][0] = (int)bloom_width;
+ this->bloom_dims[bloom_index][1] = (int)bloom_height;
+
+ result = d3d->get_device()->CreateTexture((int)bloom_width, (int)bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index], nullptr);
+ if (FAILED(result))
+ return false;
+
+ bloom_texture[bloom_index]->GetSurfaceLevel(0, &bloom_surface[bloom_index]);
+
+ bloom_width *= scale_factor;
+ bloom_height *= scale_factor;
+
+ bloom_index++;
+
+ this->bloom_count = bloom_index;
+ }
+
+ return true;
+}
+
+texture_info *renderer_d3d9::get_default_texture()
+{
+ return m_texture_manager->get_default_texture();
+}
diff --git a/docs/release/src/osd/windows/winmain.cpp b/docs/release/src/osd/windows/winmain.cpp
new file mode 100644
index 00000000000..10fa5e3b836
--- /dev/null
+++ b/docs/release/src/osd/windows/winmain.cpp
@@ -0,0 +1,700 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+//============================================================
+//
+// winmain.cpp - Win32 main program
+//
+//============================================================
+
+// MAME headers
+#include "emu.h"
+#include "emuopts.h"
+#include "strconv.h"
+
+// MAMEOS headers
+#include "winmain.h"
+#include "window.h"
+#include "winutf8.h"
+#include "winutil.h"
+#include "winfile.h"
+#include "modules/diagnostics/diagnostics_module.h"
+#include "modules/monitor/monitor_common.h"
+
+// standard C headers
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+// standard windows headers
+#include <windows.h>
+#include <commctrl.h>
+#include <mmsystem.h>
+#include <tchar.h>
+#include <io.h>
+
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#include <wrl/client.h>
+using namespace Windows::Storage;
+using namespace Platform;
+using namespace Windows::ApplicationModel;
+using namespace Windows::ApplicationModel::Core;
+using namespace Windows::UI::Popups;
+#endif
+
+#define DEBUG_SLOW_LOCKS 0
+
+//**************************************************************************
+// MACROS
+//**************************************************************************
+
+#ifdef UNICODE
+#define UNICODE_POSTFIX "W"
+#else
+#define UNICODE_POSTFIX "A"
+#endif
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+//============================================================
+// winui_output_error
+//============================================================
+
+class winui_output_error : public osd_output
+{
+public:
+ virtual void output_callback(osd_output_channel channel, const char *msg, va_list args) override
+ {
+ if (channel == OSD_OUTPUT_CHANNEL_ERROR)
+ {
+ char buffer[1024];
+
+ // if we are in fullscreen mode, go to windowed mode
+ if ((video_config.windowed == 0) && !osd_common_t::s_window_list.empty())
+ winwindow_toggle_full_screen();
+
+ vsnprintf(buffer, ARRAY_LENGTH(buffer), msg, args);
+ win_message_box_utf8(!osd_common_t::s_window_list.empty() ? std::static_pointer_cast<win_window_info>(osd_common_t::s_window_list.front())->platform_window() : nullptr, buffer, emulator_info::get_appname(), MB_OK);
+ }
+ else
+ chain_output(channel, msg, args);
+ }
+};
+
+#else
+
+//============================================================
+// winuniversal_output_error
+//============================================================
+
+class winuniversal_output_error : public osd_output
+{
+public:
+ virtual void output_callback(osd_output_channel channel, const char *msg, va_list args) override
+ {
+ char buffer[2048];
+ if (channel == OSD_OUTPUT_CHANNEL_ERROR)
+ {
+ vsnprintf(buffer, ARRAY_LENGTH(buffer), msg, args);
+
+ std::wstring wcbuffer(osd::text::to_wstring(buffer));
+ std::wstring wcappname(osd::text::to_wstring(emulator_info::get_appname()));
+
+ auto dlg = ref new MessageDialog(ref new Platform::String(wcbuffer.data()), ref new Platform::String(wcbuffer.data()));
+ dlg->ShowAsync();
+ }
+ else if (channel == OSD_OUTPUT_CHANNEL_VERBOSE)
+ {
+ vsnprintf(buffer, ARRAY_LENGTH(buffer), msg, args);
+ std::wstring wcbuffer = osd::text::to_wstring(buffer);
+ OutputDebugString(wcbuffer.c_str());
+
+ // Chain to next anyway
+ chain_output(channel, msg, args);
+ }
+ else
+ chain_output(channel, msg, args);
+ }
+};
+
+#endif
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// this line prevents globbing on the command line
+int _CRT_glob = 0;
+
+//**************************************************************************
+// LOCAL VARIABLES
+//**************************************************************************
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+static int timeresult = !TIMERR_NOERROR;
+static TIMECAPS timecaps;
+#endif
+
+static running_machine *g_current_machine;
+
+
+//**************************************************************************
+// FUNCTION PROTOTYPES
+//**************************************************************************
+
+static BOOL WINAPI control_handler(DWORD type);
+static int is_double_click_start(int argc);
+
+
+//**************************************************************************
+// OPTIONS
+//**************************************************************************
+
+// struct definitions
+const options_entry windows_options::s_option_entries[] =
+{
+ // performance options
+ { nullptr, nullptr, OPTION_HEADER, "WINDOWS PERFORMANCE OPTIONS" },
+ { WINOPTION_PRIORITY "(-15-1)", "0", OPTION_INTEGER, "thread priority for the main game thread; range from -15 to 1" },
+ { WINOPTION_PROFILE, "0", OPTION_INTEGER, "enables profiling, specifying the stack depth to track" },
+
+ // video options
+ { nullptr, nullptr, OPTION_HEADER, "WINDOWS VIDEO OPTIONS" },
+ { WINOPTION_MENU, "0", OPTION_BOOLEAN, "enables menu bar if available by UI implementation" },
+
+ // post-processing options
+ { nullptr, nullptr, OPTION_HEADER, "DIRECT3D POST-PROCESSING OPTIONS" },
+ { WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to HLSL support files" },
+ { WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enable HLSL post-processing (PS3.0 required)" },
+ { WINOPTION_HLSL_OVERSAMPLING, "0", OPTION_BOOLEAN, "enable HLSL oversampling" },
+ { WINOPTION_HLSL_WRITE, OSDOPTVAL_AUTO, OPTION_STRING, "enable HLSL AVI writing (huge disk bandwidth suggested)" },
+ { WINOPTION_HLSL_SNAP_WIDTH, "2048", OPTION_STRING, "HLSL upscaled-snapshot width" },
+ { WINOPTION_HLSL_SNAP_HEIGHT, "1536", OPTION_STRING, "HLSL upscaled-snapshot height" },
+ { WINOPTION_SHADOW_MASK_TILE_MODE, "0", OPTION_INTEGER, "shadow mask tile mode (0 for screen based, 1 for source based)" },
+ { WINOPTION_SHADOW_MASK_ALPHA";fs_shadwa(0.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask alpha-blend value (1.0 is fully blended, 0.0 is no mask)" },
+ { WINOPTION_SHADOW_MASK_TEXTURE";fs_shadwt(0.0-1.0)", "shadow-mask.png", OPTION_STRING, "shadow mask texture name" },
+ { WINOPTION_SHADOW_MASK_COUNT_X";fs_shadww", "6", OPTION_INTEGER, "shadow mask tile width, in screen dimensions" },
+ { WINOPTION_SHADOW_MASK_COUNT_Y";fs_shadwh", "4", OPTION_INTEGER, "shadow mask tile height, in screen dimensions" },
+ { WINOPTION_SHADOW_MASK_USIZE";fs_shadwu(0.0-1.0)", "0.1875", OPTION_FLOAT, "shadow mask texture width, in U/V dimensions" },
+ { WINOPTION_SHADOW_MASK_VSIZE";fs_shadwv(0.0-1.0)", "0.25", OPTION_FLOAT, "shadow mask texture height, in U/V dimensions" },
+ { WINOPTION_SHADOW_MASK_UOFFSET";fs_shadwou(-1.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask texture offset, in U direction" },
+ { WINOPTION_SHADOW_MASK_VOFFSET";fs_shadwov(-1.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask texture offset, in V direction" },
+ { WINOPTION_DISTORTION";fs_dist(-1.0-1.0)", "0.0", OPTION_FLOAT, "screen distortion amount" },
+ { WINOPTION_CUBIC_DISTORTION";fs_cubedist(-1.0-1.0)", "0.0", OPTION_FLOAT, "screen cubic distortion amount" },
+ { WINOPTION_DISTORT_CORNER";fs_distc(0.0-1.0)", "0.0", OPTION_FLOAT, "screen distort corner amount" },
+ { WINOPTION_ROUND_CORNER";fs_rndc(0.0-1.0)", "0.0", OPTION_FLOAT, "screen round corner amount" },
+ { WINOPTION_SMOOTH_BORDER";fs_smob(0.0-1.0)", "0.0", OPTION_FLOAT, "screen smooth border amount" },
+ { WINOPTION_REFLECTION";fs_ref(0.0-1.0)", "0.0", OPTION_FLOAT, "screen reflection amount" },
+ { WINOPTION_VIGNETTING";fs_vig(0.0-1.0)", "0.0", OPTION_FLOAT, "image vignetting amount" },
+ /* Beam-related values below this line*/
+ { WINOPTION_SCANLINE_AMOUNT";fs_scanam(0.0-4.0)", "0.0", OPTION_FLOAT, "overall alpha scaling value for scanlines" },
+ { WINOPTION_SCANLINE_SCALE";fs_scansc(0.0-4.0)", "1.0", OPTION_FLOAT, "overall height scaling value for scanlines" },
+ { WINOPTION_SCANLINE_HEIGHT";fs_scanh(0.0-4.0)", "1.0", OPTION_FLOAT, "individual height scaling value for scanlines" },
+ { WINOPTION_SCANLINE_VARIATION";fs_scanv(0.0-4.0)", "1.0", OPTION_FLOAT, "individual height varying value for scanlines" },
+ { WINOPTION_SCANLINE_BRIGHT_SCALE";fs_scanbs(0.0-2.0)", "1.0", OPTION_FLOAT, "overall brightness scaling value for scanlines (multiplicative)" },
+ { WINOPTION_SCANLINE_BRIGHT_OFFSET";fs_scanbo(0.0-1.0)", "0.0", OPTION_FLOAT, "overall brightness offset value for scanlines (additive)" },
+ { WINOPTION_SCANLINE_JITTER";fs_scanjt(0.0-4.0)", "0.0", OPTION_FLOAT, "overall interlace jitter scaling value for scanlines" },
+ { WINOPTION_HUM_BAR_ALPHA";fs_humba(0.0-1.0)", "0.0", OPTION_FLOAT, "overall alpha scaling value for hum bar" },
+ { WINOPTION_DEFOCUS";fs_focus", "0.0,0.0", OPTION_STRING, "overall defocus value in screen-relative coords" },
+ { WINOPTION_CONVERGE_X";fs_convx", "0.0,0.0,0.0", OPTION_STRING, "convergence in screen-relative X direction" },
+ { WINOPTION_CONVERGE_Y";fs_convy", "0.0,0.0,0.0", OPTION_STRING, "convergence in screen-relative Y direction" },
+ { WINOPTION_RADIAL_CONVERGE_X";fs_rconvx", "0.0,0.0,0.0", OPTION_STRING, "radial convergence in screen-relative X direction" },
+ { WINOPTION_RADIAL_CONVERGE_Y";fs_rconvy", "0.0,0.0,0.0", OPTION_STRING, "radial convergence in screen-relative Y direction" },
+ /* RGB colorspace convolution below this line */
+ { WINOPTION_RED_RATIO";fs_redratio", "1.0,0.0,0.0", OPTION_STRING, "red output signal generated by input signal" },
+ { WINOPTION_GRN_RATIO";fs_grnratio", "0.0,1.0,0.0", OPTION_STRING, "green output signal generated by input signal" },
+ { WINOPTION_BLU_RATIO";fs_bluratio", "0.0,0.0,1.0", OPTION_STRING, "blue output signal generated by input signal" },
+ { WINOPTION_SATURATION";fs_sat(0.0-4.0)", "1.0", OPTION_FLOAT, "saturation scaling value" },
+ { WINOPTION_OFFSET";fs_offset", "0.0,0.0,0.0", OPTION_STRING, "signal offset value (additive)" },
+ { WINOPTION_SCALE";fs_scale", "1.0,1.0,1.0", OPTION_STRING, "signal scaling value (multiplicative)" },
+ { WINOPTION_POWER";fs_power", "1.0,1.0,1.0", OPTION_STRING, "signal power value (exponential)" },
+ { WINOPTION_FLOOR";fs_floor", "0.0,0.0,0.0", OPTION_STRING, "signal floor level" },
+ { WINOPTION_PHOSPHOR";fs_phosphor", "0.0,0.0,0.0", OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" },
+ { WINOPTION_CHROMA_MODE, "3", OPTION_INTEGER, "number of phosphors to use: 1 - monochrome, 2 - dichrome, 3 - trichrome (color)" },
+ { WINOPTION_CHROMA_CONVERSION_GAIN, "0.299,0.587,0.114", OPTION_STRING, "gain to be applied when summing RGB signal for monochrome and dichrome modes" },
+ { WINOPTION_CHROMA_A, "0.64,0.33", OPTION_STRING, "chromaticity coordinate for first phosphor" },
+ { WINOPTION_CHROMA_B, "0.30,0.60", OPTION_STRING, "chromaticity coordinate for second phosphor" },
+ { WINOPTION_CHROMA_C, "0.15,0.06", OPTION_STRING, "chromaticity coordinate for third phosphor" },
+ { WINOPTION_CHROMA_Y_GAIN, "0.2126,0.7152,0.0722", OPTION_STRING, "gain to be applied for each phosphor" },
+ /* NTSC simulation below this line */
+ { nullptr, nullptr, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
+ { WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enable YIQ-space HLSL post-processing" },
+ { WINOPTION_YIQ_JITTER";yiqj", "0.0", OPTION_FLOAT, "jitter for the NTSC signal processing" },
+ { WINOPTION_YIQ_CCVALUE";yiqcc", "3.57954545", OPTION_FLOAT, "color carrier frequency for NTSC signal processing" },
+ { WINOPTION_YIQ_AVALUE";yiqa", "0.5", OPTION_FLOAT, "A value for NTSC signal processing" },
+ { WINOPTION_YIQ_BVALUE";yiqb", "0.5", OPTION_FLOAT, "B value for NTSC signal processing" },
+ { WINOPTION_YIQ_OVALUE";yiqo", "0.0", OPTION_FLOAT, "outgoing Color Carrier phase offset for NTSC signal processing" },
+ { WINOPTION_YIQ_PVALUE";yiqp", "1.0", OPTION_FLOAT, "incoming Pixel Clock scaling value for NTSC signal processing" },
+ { WINOPTION_YIQ_NVALUE";yiqn", "1.0", OPTION_FLOAT, "Y filter notch width for NTSC signal processing" },
+ { WINOPTION_YIQ_YVALUE";yiqy", "6.0", OPTION_FLOAT, "Y filter cutoff frequency for NTSC signal processing" },
+ { WINOPTION_YIQ_IVALUE";yiqi", "1.2", OPTION_FLOAT, "I filter cutoff frequency for NTSC signal processing" },
+ { WINOPTION_YIQ_QVALUE";yiqq", "0.6", OPTION_FLOAT, "Q filter cutoff frequency for NTSC signal processing" },
+ { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "horizontal scanline duration for NTSC signal processing (microseconds)" },
+ { WINOPTION_YIQ_PHASE_COUNT";yiqpc", "2", OPTION_INTEGER, "phase count value for NTSC signal processing" },
+ /* Vector simulation below this line */
+ { nullptr, nullptr, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
+ { WINOPTION_VECTOR_BEAM_SMOOTH";vecsmooth", "0.0", OPTION_FLOAT, "vector beam smoothness" },
+ { WINOPTION_VECTOR_LENGTH_SCALE";vecscale", "0.5", OPTION_FLOAT, "maximum vector attenuation" },
+ { WINOPTION_VECTOR_LENGTH_RATIO";vecratio", "0.5", OPTION_FLOAT, "minimum vector length affected by attenuation (vector length to screen size ratio)" },
+ /* Bloom below this line */
+ { nullptr, nullptr, OPTION_HEADER, "BLOOM POST-PROCESSING OPTIONS" },
+ { WINOPTION_BLOOM_BLEND_MODE, "0", OPTION_INTEGER, "bloom blend mode (0 for brighten, 1 for darken)" },
+ { WINOPTION_BLOOM_SCALE, "0.0", OPTION_FLOAT, "intensity factor for bloom" },
+ { WINOPTION_BLOOM_OVERDRIVE, "1.0,1.0,1.0", OPTION_STRING, "overdrive factor for bloom" },
+ { WINOPTION_BLOOM_LEVEL0_WEIGHT, "1.0", OPTION_FLOAT, "bloom level 0 weight (full-size target)" },
+ { WINOPTION_BLOOM_LEVEL1_WEIGHT, "0.64", OPTION_FLOAT, "bloom level 1 weight (1/4 smaller that level 0 target)" },
+ { WINOPTION_BLOOM_LEVEL2_WEIGHT, "0.32", OPTION_FLOAT, "bloom level 2 weight (1/4 smaller that level 1 target)" },
+ { WINOPTION_BLOOM_LEVEL3_WEIGHT, "0.16", OPTION_FLOAT, "bloom level 3 weight (1/4 smaller that level 2 target)" },
+ { WINOPTION_BLOOM_LEVEL4_WEIGHT, "0.08", OPTION_FLOAT, "bloom level 4 weight (1/4 smaller that level 3 target)" },
+ { WINOPTION_BLOOM_LEVEL5_WEIGHT, "0.06", OPTION_FLOAT, "bloom level 5 weight (1/4 smaller that level 4 target)" },
+ { WINOPTION_BLOOM_LEVEL6_WEIGHT, "0.04", OPTION_FLOAT, "bloom level 6 weight (1/4 smaller that level 5 target)" },
+ { WINOPTION_BLOOM_LEVEL7_WEIGHT, "0.02", OPTION_FLOAT, "bloom level 7 weight (1/4 smaller that level 6 target)" },
+ { WINOPTION_BLOOM_LEVEL8_WEIGHT, "0.01", OPTION_FLOAT, "bloom level 8 weight (1/4 smaller that level 7 target)" },
+ { WINOPTION_LUT_TEXTURE, "", OPTION_STRING, "3D LUT texture filename for screen, PNG format" },
+ { WINOPTION_LUT_ENABLE, "0", OPTION_BOOLEAN, "Enables 3D LUT to be applied to screen after post-processing" },
+ { WINOPTION_UI_LUT_TEXTURE, "", OPTION_STRING, "3D LUT texture filename of UI, PNG format" },
+ { WINOPTION_UI_LUT_ENABLE, "0", OPTION_BOOLEAN, "enable 3D LUT to be applied to UI and artwork after post-processing" },
+
+ // full screen options
+ { nullptr, nullptr, OPTION_HEADER, "FULL SCREEN OPTIONS" },
+ { WINOPTION_TRIPLEBUFFER ";tb", "0", OPTION_BOOLEAN, "enable triple buffering" },
+ { WINOPTION_FULLSCREENBRIGHTNESS ";fsb(0.1-2.0)", "1.0", OPTION_FLOAT, "brightness value in full screen mode" },
+ { WINOPTION_FULLSCREENCONTRAST ";fsc(0.1-2.0)", "1.0", OPTION_FLOAT, "contrast value in full screen mode" },
+ { WINOPTION_FULLSCREENGAMMA ";fsg(0.1-3.0)", "1.0", OPTION_FLOAT, "gamma value in full screen mode" },
+
+ // input options
+ { nullptr, nullptr, OPTION_HEADER, "INPUT DEVICE OPTIONS" },
+ { WINOPTION_GLOBAL_INPUTS, "0", OPTION_BOOLEAN, "enable global inputs" },
+ { WINOPTION_DUAL_LIGHTGUN ";dual", "0", OPTION_BOOLEAN, "enable dual lightgun input" },
+
+ { nullptr }
+};
+
+//**************************************************************************
+// MAIN ENTRY POINT
+//**************************************************************************
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+//============================================================
+// main
+//============================================================
+//HBMAME start
+int main_(int argc, char *argv[])
+{
+ std::vector<std::string> args = osd_get_command_line(argc, argv);
+
+ // use small output buffers on non-TTYs (i.e. pipes)
+ if (!isatty(fileno(stdout)))
+ setvbuf(stdout, (char *) nullptr, _IOFBF, 64);
+ if (!isatty(fileno(stderr)))
+ setvbuf(stderr, (char *) nullptr, _IOFBF, 64);
+
+ // initialize common controls
+ InitCommonControls();
+
+ // set a handler to catch ctrl-c
+ SetConsoleCtrlHandler(control_handler, TRUE);
+
+ // Initialize crash diagnostics
+ diagnostics_module::get_instance()->init_crash_diagnostics();
+
+ // parse config and cmdline options
+ DWORD result;
+ {
+ windows_options options;
+ windows_osd_interface osd(options);
+ // if we're a GUI app, out errors to message boxes
+ // Initialize this after the osd interface so that we are first in the
+ // output order
+ winui_output_error winerror;
+ if (win_is_gui_application() || is_double_click_start(args.size()))
+ {
+ // if we are a GUI app, output errors to message boxes
+ osd_output::push(&winerror);
+ // make sure any console window that opened on our behalf is nuked
+ FreeConsole();
+ }
+ osd.register_options();
+ result = emulator_info::start_frontend(options, osd, args);
+ osd_output::pop(&winerror);
+ }
+
+ return result;
+}
+//HBMAME end
+int main(int argc, char *argv[])
+{
+ std::vector<std::string> args = osd_get_command_line(argc, argv);
+
+ // use small output buffers on non-TTYs (i.e. pipes)
+ if (!isatty(fileno(stdout)))
+ setvbuf(stdout, (char *) nullptr, _IOFBF, 64);
+ if (!isatty(fileno(stderr)))
+ setvbuf(stderr, (char *) nullptr, _IOFBF, 64);
+
+ // initialize common controls
+ InitCommonControls();
+
+ // set a handler to catch ctrl-c
+ SetConsoleCtrlHandler(control_handler, TRUE);
+
+ // Initialize crash diagnostics
+ diagnostics_module::get_instance()->init_crash_diagnostics();
+
+ // parse config and cmdline options
+ DWORD result;
+ {
+ windows_options options;
+ windows_osd_interface osd(options);
+ // if we're a GUI app, out errors to message boxes
+ // Initialize this after the osd interface so that we are first in the
+ // output order
+ winui_output_error winerror;
+ if (win_is_gui_application() || is_double_click_start(args.size()))
+ {
+ // if we are a GUI app, output errors to message boxes
+ osd_output::push(&winerror);
+ // make sure any console window that opened on our behalf is nuked
+ FreeConsole();
+ }
+ osd.register_options();
+ result = emulator_info::start_frontend(options, osd, args);
+ osd_output::pop(&winerror);
+ }
+
+ return result;
+}
+
+//============================================================
+// control_handler
+//============================================================
+
+static BOOL WINAPI control_handler(DWORD type)
+{
+ // indicate to the user that we detected something
+ switch (type)
+ {
+ case CTRL_C_EVENT: fprintf(stderr, "Caught Ctrl+C"); break;
+ case CTRL_BREAK_EVENT: fprintf(stderr, "Caught Ctrl+break"); break;
+ case CTRL_CLOSE_EVENT: fprintf(stderr, "Caught console close"); break;
+ case CTRL_LOGOFF_EVENT: fprintf(stderr, "Caught logoff"); break;
+ case CTRL_SHUTDOWN_EVENT: fprintf(stderr, "Caught shutdown"); break;
+ default: fprintf(stderr, "Caught unexpected console event"); break;
+ }
+
+ // if we don't have a machine yet, or if we are handling ctrl+c/ctrl+break,
+ // just terminate hard, without throwing or handling any atexit stuff
+ if (g_current_machine == nullptr || type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT)
+ {
+ fprintf(stderr, ", exiting\n");
+ TerminateProcess(GetCurrentProcess(), EMU_ERR_FATALERROR);
+ }
+
+ // all other situations attempt to do a clean exit
+ else
+ {
+ fprintf(stderr, ", exit requested\n");
+ g_current_machine->schedule_exit();
+ }
+
+ // in all cases we handled it
+ return TRUE;
+}
+
+#else
+
+// The main function is only used to initialize our IFrameworkView class.
+[Platform::MTAThread]
+int main(Platform::Array<Platform::String^>^ args)
+{
+ auto direct3DApplicationSource = ref new MameViewSource();
+ CoreApplication::Run(direct3DApplicationSource);
+ return 0;
+}
+
+MameMainApp::MameMainApp()
+{
+ // Turn off application view scaling so XBOX gets full screen
+ Windows::UI::ViewManagement::ApplicationViewScaling::TrySetDisableLayoutScaling(true);
+}
+
+void MameMainApp::Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView)
+{
+ // Register event handlers for app lifecycle.
+}
+
+// Called when the CoreWindow object is created (or re-created).
+void MameMainApp::SetWindow(Windows::UI::Core::CoreWindow^ window)
+{
+ // Attach event handlers on the window for input, etc.
+}
+
+// Initializes scene resources, or loads a previously saved app state.
+void MameMainApp::Load(Platform::String^ entryPoint)
+{
+}
+
+void MameMainApp::Run()
+{
+ // use small output buffers on non-TTYs (i.e. pipes)
+ if (!isatty(fileno(stdout)))
+ setvbuf(stdout, (char *) nullptr, _IOFBF, 64);
+ if (!isatty(fileno(stderr)))
+ setvbuf(stderr, (char *) nullptr, _IOFBF, 64);
+
+ // parse config and cmdline options
+ m_options = std::make_unique<windows_options>();
+ m_osd = std::make_unique<windows_osd_interface>(*m_options.get());
+
+ // Since we're a GUI app, out errors to message boxes
+ // Initialize this after the osd interface so that we are first in the
+ // output order
+ winuniversal_output_error winerror;
+ osd_output::push(&winerror);
+
+ m_osd->register_options();
+
+ // To satisfy the latter things, pass in the module path name
+ char exe_path[MAX_PATH];
+ GetModuleFileNameA(nullptr, exe_path, MAX_PATH);
+ char* args[3] = { exe_path, (char*)"-verbose", (char*)"-mouse" };
+
+ DWORD result = emulator_info::start_frontend(*m_options.get(), *m_osd.get(), ARRAY_LENGTH(args), args);
+ osd_output::pop(&winerror);
+}
+
+// Required for IFrameworkView.
+void MameMainApp::Uninitialize()
+{
+ // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
+ // class is torn down while the app is in the foreground.
+}
+
+IFrameworkView^ MameViewSource::CreateView()
+{
+ return ref new MameMainApp();
+}
+
+#endif
+
+
+//============================================================
+// windows_options
+//============================================================
+
+windows_options::windows_options()
+: osd_options()
+{
+ add_entries(s_option_entries);
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ String^ path = ApplicationData::Current->LocalFolder->Path + L"\\";
+ set_default_value(OPTION_INIPATH, (osd::text::from_wstring((LPCWSTR)path->Data()) + ";" + ini_path()).c_str());
+ set_default_value(OPTION_CFG_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + cfg_directory()).c_str());
+ set_default_value(OPTION_NVRAM_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + nvram_directory()).c_str());
+ set_default_value(OPTION_INPUT_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + input_directory()).c_str());
+ set_default_value(OPTION_STATE_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + state_directory()).c_str());
+ set_default_value(OPTION_SNAPSHOT_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + snapshot_directory()).c_str());
+ set_default_value(OPTION_DIFF_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + diff_directory()).c_str());
+ set_default_value(OPTION_COMMENT_DIRECTORY, (osd::text::from_wstring((LPCWSTR)path->Data()) + comment_directory()).c_str());
+
+ set_default_value(OPTION_HOMEPATH, osd::text::from_wstring((LPCWSTR)path->Data()).c_str());
+ set_default_value(OPTION_MEDIAPATH, (osd::text::from_wstring((LPCWSTR)path->Data()) + media_path()).c_str());
+#endif
+}
+
+
+//============================================================
+// output_oslog
+//============================================================
+
+void windows_osd_interface::output_oslog(const char *buffer)
+{
+ if (IsDebuggerPresent())
+ win_output_debug_string_utf8(buffer);
+ else
+ fputs(buffer, stderr);
+}
+
+
+//============================================================
+// constructor
+//============================================================
+
+windows_osd_interface::windows_osd_interface(windows_options &options)
+ : osd_common_t(options)
+ , m_options(options)
+{
+}
+
+
+//============================================================
+// destructor
+//============================================================
+
+windows_osd_interface::~windows_osd_interface()
+{
+}
+
+
+//============================================================
+// video_register
+//============================================================
+
+void windows_osd_interface::video_register()
+{
+ video_options_add("gdi", nullptr);
+ video_options_add("d3d", nullptr);
+#if USE_OPENGL
+ video_options_add("opengl", nullptr);
+#endif
+ video_options_add("bgfx", nullptr);
+ //video_options_add("auto", nullptr); // making d3d video default one
+}
+
+//============================================================
+// init
+//============================================================
+
+void windows_osd_interface::init(running_machine &machine)
+{
+ // call our parent
+ osd_common_t::init(machine);
+
+ const char *stemp;
+ windows_options &options = downcast<windows_options &>(machine.options());
+
+ // determine if we are benchmarking, and adjust options appropriately
+ int bench = options.bench();
+ if (bench > 0)
+ {
+ options.set_value(OPTION_THROTTLE, false, OPTION_PRIORITY_MAXIMUM);
+ options.set_value(OSDOPTION_SOUND, "none", OPTION_PRIORITY_MAXIMUM);
+ options.set_value(OSDOPTION_VIDEO, "none", OPTION_PRIORITY_MAXIMUM);
+ options.set_value(OPTION_SECONDS_TO_RUN, bench, OPTION_PRIORITY_MAXIMUM);
+ }
+
+ // determine if we are profiling, and adjust options appropriately
+ int profile = options.profile();
+ if (profile > 0)
+ {
+ options.set_value(OPTION_THROTTLE, false, OPTION_PRIORITY_MAXIMUM);
+ options.set_value(OSDOPTION_NUMPROCESSORS, 1, OPTION_PRIORITY_MAXIMUM);
+ }
+
+ // thread priority
+ if (!(machine.debug_flags & DEBUG_FLAG_OSD_ENABLED))
+ SetThreadPriority(GetCurrentThread(), options.priority());
+
+ // get number of processors
+ stemp = options.numprocessors();
+
+ osd_num_processors = 0;
+
+ if (strcmp(stemp, "auto") != 0)
+ {
+ osd_num_processors = atoi(stemp);
+ if (osd_num_processors < 1)
+ {
+ osd_printf_warning("Warning: numprocessors < 1 doesn't make much sense. Assuming auto ...\n");
+ osd_num_processors = 0;
+ }
+ }
+
+ // initialize the subsystems
+ osd_common_t::init_subsystems();
+
+ // notify listeners of screen configuration
+ for (auto info : osd_common_t::s_window_list)
+ {
+ machine.output().set_value(string_format("Orientation(%s)", info->monitor()->devicename()).c_str(), std::static_pointer_cast<win_window_info>(info)->m_targetorient);
+ }
+
+ // hook up the debugger log
+ if (options.oslog())
+ machine.add_logerror_callback(&windows_osd_interface::output_oslog);
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ // crank up the multimedia timer resolution to its max
+ // this gives the system much finer timeslices
+ timeresult = timeGetDevCaps(&timecaps, sizeof(timecaps));
+ if (timeresult == TIMERR_NOERROR)
+ timeBeginPeriod(timecaps.wPeriodMin);
+#endif
+
+ // create and start the profiler
+ if (profile > 0)
+ {
+ diagnostics_module::get_instance()->start_profiler(1000, profile - 1);
+ }
+
+ // initialize sockets
+ win_init_sockets();
+
+ // note the existence of a machine
+ g_current_machine = &machine;
+}
+
+
+//============================================================
+// osd_exit
+//============================================================
+
+void windows_osd_interface::osd_exit()
+{
+ // no longer have a machine
+ g_current_machine = nullptr;
+
+ // cleanup sockets
+ win_cleanup_sockets();
+
+ osd_common_t::osd_exit();
+
+ // stop the profiler
+ diagnostics_module::get_instance()->stop_profiler();
+ diagnostics_module::get_instance()->print_profiler_results();
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ // restore the timer resolution
+ if (timeresult == TIMERR_NOERROR)
+ timeEndPeriod(timecaps.wPeriodMin);
+#endif
+
+ // one last pass at events
+ winwindow_process_events(machine(), false, false);
+}
+
+
+//============================================================
+// osd_setup_osd_specific_emu_options
+//============================================================
+
+void osd_setup_osd_specific_emu_options(emu_options &opts)
+{
+ opts.add_entries(osd_options::s_option_entries);
+ opts.add_entries(windows_options::s_option_entries);
+}
+
+
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+//============================================================
+// check_for_double_click_start
+//============================================================
+
+static int is_double_click_start(int argc)
+{
+ STARTUPINFO startup_info = { sizeof(STARTUPINFO) };
+
+ // determine our startup information
+ GetStartupInfo(&startup_info);
+
+ // try to determine if MAME was simply double-clicked
+ return (argc <= 1 && startup_info.dwFlags && !(startup_info.dwFlags & STARTF_USESTDHANDLES));
+}
+
+#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
diff --git a/docs/release/src/osd/windows/winmain.h b/docs/release/src/osd/windows/winmain.h
new file mode 100644
index 00000000000..f6afec3bb2b
--- /dev/null
+++ b/docs/release/src/osd/windows/winmain.h
@@ -0,0 +1,360 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+//============================================================
+//
+// winmain.h - Win32 main program and core headers
+//
+//============================================================
+
+#ifndef __WINDOWS_WINMAIN_H__
+#define __WINDOWS_WINMAIN_H__
+
+#include <winapifamily.h>
+#include "osdepend.h"
+#include "modules/lib/osdobj_common.h"
+
+
+//============================================================
+// CONSTANTS
+//============================================================
+
+// performance options
+#define WINOPTION_PRIORITY "priority"
+#define WINOPTION_PROFILE "profile"
+
+// video options
+#define WINOPTION_MENU "menu"
+
+// core post-processing options
+#define WINOPTION_HLSLPATH "hlslpath"
+#define WINOPTION_HLSL_ENABLE "hlsl_enable"
+#define WINOPTION_HLSL_OVERSAMPLING "hlsl_oversampling"
+#define WINOPTION_HLSL_WRITE "hlsl_write"
+#define WINOPTION_HLSL_SNAP_WIDTH "hlsl_snap_width"
+#define WINOPTION_HLSL_SNAP_HEIGHT "hlsl_snap_height"
+#define WINOPTION_SHADOW_MASK_TILE_MODE "shadow_mask_tile_mode"
+#define WINOPTION_SHADOW_MASK_ALPHA "shadow_mask_alpha"
+#define WINOPTION_SHADOW_MASK_TEXTURE "shadow_mask_texture"
+#define WINOPTION_SHADOW_MASK_COUNT_X "shadow_mask_x_count"
+#define WINOPTION_SHADOW_MASK_COUNT_Y "shadow_mask_y_count"
+#define WINOPTION_SHADOW_MASK_USIZE "shadow_mask_usize"
+#define WINOPTION_SHADOW_MASK_VSIZE "shadow_mask_vsize"
+#define WINOPTION_SHADOW_MASK_UOFFSET "shadow_mask_uoffset"
+#define WINOPTION_SHADOW_MASK_VOFFSET "shadow_mask_voffset"
+#define WINOPTION_REFLECTION "reflection"
+#define WINOPTION_DISTORTION "distortion"
+#define WINOPTION_CUBIC_DISTORTION "cubic_distortion"
+#define WINOPTION_DISTORT_CORNER "distort_corner"
+#define WINOPTION_ROUND_CORNER "round_corner"
+#define WINOPTION_SMOOTH_BORDER "smooth_border"
+#define WINOPTION_VIGNETTING "vignetting"
+#define WINOPTION_SCANLINE_AMOUNT "scanline_alpha"
+#define WINOPTION_SCANLINE_SCALE "scanline_size"
+#define WINOPTION_SCANLINE_HEIGHT "scanline_height"
+#define WINOPTION_SCANLINE_VARIATION "scanline_variation"
+#define WINOPTION_SCANLINE_BRIGHT_SCALE "scanline_bright_scale"
+#define WINOPTION_SCANLINE_BRIGHT_OFFSET "scanline_bright_offset"
+#define WINOPTION_SCANLINE_JITTER "scanline_jitter"
+#define WINOPTION_HUM_BAR_ALPHA "hum_bar_alpha"
+#define WINOPTION_DEFOCUS "defocus"
+#define WINOPTION_CONVERGE_X "converge_x"
+#define WINOPTION_CONVERGE_Y "converge_y"
+#define WINOPTION_RADIAL_CONVERGE_X "radial_converge_x"
+#define WINOPTION_RADIAL_CONVERGE_Y "radial_converge_y"
+#define WINOPTION_RED_RATIO "red_ratio"
+#define WINOPTION_GRN_RATIO "grn_ratio"
+#define WINOPTION_BLU_RATIO "blu_ratio"
+#define WINOPTION_OFFSET "offset"
+#define WINOPTION_SCALE "scale"
+#define WINOPTION_POWER "power"
+#define WINOPTION_FLOOR "floor"
+#define WINOPTION_PHOSPHOR "phosphor_life"
+#define WINOPTION_SATURATION "saturation"
+#define WINOPTION_CHROMA_MODE "chroma_mode"
+#define WINOPTION_CHROMA_CONVERSION_GAIN "chroma_conversion_gain"
+#define WINOPTION_CHROMA_A "chroma_a"
+#define WINOPTION_CHROMA_B "chroma_b"
+#define WINOPTION_CHROMA_C "chroma_c"
+#define WINOPTION_CHROMA_Y_GAIN "chroma_y_gain"
+#define WINOPTION_YIQ_ENABLE "yiq_enable"
+#define WINOPTION_YIQ_JITTER "yiq_jitter"
+#define WINOPTION_YIQ_CCVALUE "yiq_cc"
+#define WINOPTION_YIQ_AVALUE "yiq_a"
+#define WINOPTION_YIQ_BVALUE "yiq_b"
+#define WINOPTION_YIQ_OVALUE "yiq_o"
+#define WINOPTION_YIQ_PVALUE "yiq_p"
+#define WINOPTION_YIQ_NVALUE "yiq_n"
+#define WINOPTION_YIQ_YVALUE "yiq_y"
+#define WINOPTION_YIQ_IVALUE "yiq_i"
+#define WINOPTION_YIQ_QVALUE "yiq_q"
+#define WINOPTION_YIQ_SCAN_TIME "yiq_scan_time"
+#define WINOPTION_YIQ_PHASE_COUNT "yiq_phase_count"
+#define WINOPTION_VECTOR_BEAM_SMOOTH "vector_beam_smooth"
+#define WINOPTION_VECTOR_LENGTH_SCALE "vector_length_scale"
+#define WINOPTION_VECTOR_LENGTH_RATIO "vector_length_ratio"
+#define WINOPTION_BLOOM_BLEND_MODE "bloom_blend_mode"
+#define WINOPTION_BLOOM_SCALE "bloom_scale"
+#define WINOPTION_BLOOM_OVERDRIVE "bloom_overdrive"
+#define WINOPTION_BLOOM_LEVEL0_WEIGHT "bloom_lvl0_weight"
+#define WINOPTION_BLOOM_LEVEL1_WEIGHT "bloom_lvl1_weight"
+#define WINOPTION_BLOOM_LEVEL2_WEIGHT "bloom_lvl2_weight"
+#define WINOPTION_BLOOM_LEVEL3_WEIGHT "bloom_lvl3_weight"
+#define WINOPTION_BLOOM_LEVEL4_WEIGHT "bloom_lvl4_weight"
+#define WINOPTION_BLOOM_LEVEL5_WEIGHT "bloom_lvl5_weight"
+#define WINOPTION_BLOOM_LEVEL6_WEIGHT "bloom_lvl6_weight"
+#define WINOPTION_BLOOM_LEVEL7_WEIGHT "bloom_lvl7_weight"
+#define WINOPTION_BLOOM_LEVEL8_WEIGHT "bloom_lvl8_weight"
+#define WINOPTION_LUT_TEXTURE "lut_texture"
+#define WINOPTION_LUT_ENABLE "lut_enable"
+#define WINOPTION_UI_LUT_TEXTURE "ui_lut_texture"
+#define WINOPTION_UI_LUT_ENABLE "ui_lut_enable"
+
+// full screen options
+#define WINOPTION_TRIPLEBUFFER "triplebuffer"
+#define WINOPTION_FULLSCREENBRIGHTNESS "full_screen_brightness"
+#define WINOPTION_FULLSCREENCONTRAST "full_screen_contrast"
+#define WINOPTION_FULLSCREENGAMMA "full_screen_gamma"
+
+// input options
+#define WINOPTION_GLOBAL_INPUTS "global_inputs"
+#define WINOPTION_DUAL_LIGHTGUN "dual_lightgun"
+
+//============================================================
+// TYPE DEFINITIONS
+//============================================================
+
+class windows_options : public osd_options
+{
+public:
+ // construction/destruction
+ windows_options();
+
+ // performance options
+ int priority() const { return int_value(WINOPTION_PRIORITY); }
+ int profile() const { return int_value(WINOPTION_PROFILE); }
+
+ // video options
+ bool menu() const { return bool_value(WINOPTION_MENU); }
+
+ // core post-processing options
+ const char *screen_post_fx_dir() const { return value(WINOPTION_HLSLPATH); }
+ bool d3d_hlsl_enable() const { return bool_value(WINOPTION_HLSL_ENABLE); }
+ bool d3d_hlsl_oversampling() const { return bool_value(WINOPTION_HLSL_OVERSAMPLING); }
+ const char *d3d_hlsl_write() const { return value(WINOPTION_HLSL_WRITE); }
+ int d3d_snap_width() const { return int_value(WINOPTION_HLSL_SNAP_WIDTH); }
+ int d3d_snap_height() const { return int_value(WINOPTION_HLSL_SNAP_HEIGHT); }
+ int screen_shadow_mask_tile_mode() const { return int_value(WINOPTION_SHADOW_MASK_TILE_MODE); }
+ float screen_shadow_mask_alpha() const { return float_value(WINOPTION_SHADOW_MASK_ALPHA); }
+ const char *screen_shadow_mask_texture() const { return value(WINOPTION_SHADOW_MASK_TEXTURE); }
+ int screen_shadow_mask_count_x() const { return int_value(WINOPTION_SHADOW_MASK_COUNT_X); }
+ int screen_shadow_mask_count_y() const { return int_value(WINOPTION_SHADOW_MASK_COUNT_Y); }
+ float screen_shadow_mask_u_size() const { return float_value(WINOPTION_SHADOW_MASK_USIZE); }
+ float screen_shadow_mask_v_size() const { return float_value(WINOPTION_SHADOW_MASK_VSIZE); }
+ float screen_shadow_mask_u_offset() const { return float_value(WINOPTION_SHADOW_MASK_UOFFSET); }
+ float screen_shadow_mask_v_offset() const { return float_value(WINOPTION_SHADOW_MASK_VOFFSET); }
+ float screen_scanline_amount() const { return float_value(WINOPTION_SCANLINE_AMOUNT); }
+ float screen_scanline_scale() const { return float_value(WINOPTION_SCANLINE_SCALE); }
+ float screen_scanline_height() const { return float_value(WINOPTION_SCANLINE_HEIGHT); }
+ float screen_scanline_variation() const { return float_value(WINOPTION_SCANLINE_VARIATION); }
+ float screen_scanline_bright_scale() const { return float_value(WINOPTION_SCANLINE_BRIGHT_SCALE); }
+ float screen_scanline_bright_offset() const { return float_value(WINOPTION_SCANLINE_BRIGHT_OFFSET); }
+ float screen_scanline_jitter() const { return float_value(WINOPTION_SCANLINE_JITTER); }
+ float screen_hum_bar_alpha() const { return float_value(WINOPTION_HUM_BAR_ALPHA); }
+ float screen_reflection() const { return float_value(WINOPTION_REFLECTION); }
+ float screen_distortion() const { return float_value(WINOPTION_DISTORTION); }
+ float screen_cubic_distortion() const { return float_value(WINOPTION_CUBIC_DISTORTION); }
+ float screen_distort_corner() const { return float_value(WINOPTION_DISTORT_CORNER); }
+ float screen_round_corner() const { return float_value(WINOPTION_ROUND_CORNER); }
+ float screen_smooth_border() const { return float_value(WINOPTION_SMOOTH_BORDER); }
+ float screen_vignetting() const { return float_value(WINOPTION_VIGNETTING); }
+ const char *screen_defocus() const { return value(WINOPTION_DEFOCUS); }
+ const char *screen_converge_x() const { return value(WINOPTION_CONVERGE_X); }
+ const char *screen_converge_y() const { return value(WINOPTION_CONVERGE_Y); }
+ const char *screen_radial_converge_x() const { return value(WINOPTION_RADIAL_CONVERGE_X); }
+ const char *screen_radial_converge_y() const { return value(WINOPTION_RADIAL_CONVERGE_Y); }
+ const char *screen_red_ratio() const { return value(WINOPTION_RED_RATIO); }
+ const char *screen_grn_ratio() const { return value(WINOPTION_GRN_RATIO); }
+ const char *screen_blu_ratio() const { return value(WINOPTION_BLU_RATIO); }
+ bool screen_yiq_enable() const { return bool_value(WINOPTION_YIQ_ENABLE); }
+ float screen_yiq_jitter() const { return float_value(WINOPTION_YIQ_JITTER); }
+ float screen_yiq_cc() const { return float_value(WINOPTION_YIQ_CCVALUE); }
+ float screen_yiq_a() const { return float_value(WINOPTION_YIQ_AVALUE); }
+ float screen_yiq_b() const { return float_value(WINOPTION_YIQ_BVALUE); }
+ float screen_yiq_o() const { return float_value(WINOPTION_YIQ_OVALUE); }
+ float screen_yiq_p() const { return float_value(WINOPTION_YIQ_PVALUE); }
+ float screen_yiq_n() const { return float_value(WINOPTION_YIQ_NVALUE); }
+ float screen_yiq_y() const { return float_value(WINOPTION_YIQ_YVALUE); }
+ float screen_yiq_i() const { return float_value(WINOPTION_YIQ_IVALUE); }
+ float screen_yiq_q() const { return float_value(WINOPTION_YIQ_QVALUE); }
+ float screen_yiq_scan_time() const { return float_value(WINOPTION_YIQ_SCAN_TIME); }
+ int screen_yiq_phase_count() const { return int_value(WINOPTION_YIQ_PHASE_COUNT); }
+ float screen_vector_beam_smooth() const { return float_value(WINOPTION_VECTOR_BEAM_SMOOTH); }
+ float screen_vector_length_scale() const { return float_value(WINOPTION_VECTOR_LENGTH_SCALE); }
+ float screen_vector_length_ratio() const { return float_value(WINOPTION_VECTOR_LENGTH_RATIO); }
+ int screen_bloom_blend_mode() const { return int_value(WINOPTION_BLOOM_BLEND_MODE); }
+ float screen_bloom_scale() const { return float_value(WINOPTION_BLOOM_SCALE); }
+ const char *screen_bloom_overdrive() const { return value(WINOPTION_BLOOM_OVERDRIVE); }
+ float screen_bloom_lvl0_weight() const { return float_value(WINOPTION_BLOOM_LEVEL0_WEIGHT); }
+ float screen_bloom_lvl1_weight() const { return float_value(WINOPTION_BLOOM_LEVEL1_WEIGHT); }
+ float screen_bloom_lvl2_weight() const { return float_value(WINOPTION_BLOOM_LEVEL2_WEIGHT); }
+ float screen_bloom_lvl3_weight() const { return float_value(WINOPTION_BLOOM_LEVEL3_WEIGHT); }
+ float screen_bloom_lvl4_weight() const { return float_value(WINOPTION_BLOOM_LEVEL4_WEIGHT); }
+ float screen_bloom_lvl5_weight() const { return float_value(WINOPTION_BLOOM_LEVEL5_WEIGHT); }
+ float screen_bloom_lvl6_weight() const { return float_value(WINOPTION_BLOOM_LEVEL6_WEIGHT); }
+ float screen_bloom_lvl7_weight() const { return float_value(WINOPTION_BLOOM_LEVEL7_WEIGHT); }
+ float screen_bloom_lvl8_weight() const { return float_value(WINOPTION_BLOOM_LEVEL8_WEIGHT); }
+ const char *screen_offset() const { return value(WINOPTION_OFFSET); }
+ const char *screen_scale() const { return value(WINOPTION_SCALE); }
+ const char *screen_power() const { return value(WINOPTION_POWER); }
+ const char *screen_floor() const { return value(WINOPTION_FLOOR); }
+ const char *screen_phosphor() const { return value(WINOPTION_PHOSPHOR); }
+ float screen_saturation() const { return float_value(WINOPTION_SATURATION); }
+ int screen_chroma_mode() const { return int_value(WINOPTION_CHROMA_MODE); }
+ const char *screen_chroma_a() const { return value(WINOPTION_CHROMA_A); }
+ const char *screen_chroma_b() const { return value(WINOPTION_CHROMA_B); }
+ const char *screen_chroma_c() const { return value(WINOPTION_CHROMA_C); }
+ const char *screen_chroma_conversion_gain() const { return value(WINOPTION_CHROMA_CONVERSION_GAIN); }
+ const char *screen_chroma_y_gain() const { return value(WINOPTION_CHROMA_Y_GAIN); }
+ const char *screen_lut_texture() const { return value(WINOPTION_LUT_TEXTURE); }
+ bool screen_lut_enable() const { return bool_value(WINOPTION_LUT_ENABLE); }
+ const char *ui_lut_texture() const { return value(WINOPTION_UI_LUT_TEXTURE); }
+ bool ui_lut_enable() const { return bool_value(WINOPTION_UI_LUT_ENABLE); }
+
+ // full screen options
+ bool triple_buffer() const { return bool_value(WINOPTION_TRIPLEBUFFER); }
+ float full_screen_brightness() const { return float_value(WINOPTION_FULLSCREENBRIGHTNESS); }
+ float full_screen_contrast() const { return float_value(WINOPTION_FULLSCREENCONTRAST); }
+ float full_screen_gamma() const { return float_value(WINOPTION_FULLSCREENGAMMA); }
+
+ // input options
+ bool global_inputs() const { return bool_value(WINOPTION_GLOBAL_INPUTS); }
+ bool dual_lightgun() const { return bool_value(WINOPTION_DUAL_LIGHTGUN); }
+
+ static const options_entry s_option_entries[];
+};
+
+//============================================================
+// TYPE DEFINITIONS
+//============================================================
+
+enum input_event
+{
+ INPUT_EVENT_KEYDOWN,
+ INPUT_EVENT_KEYUP,
+ INPUT_EVENT_RAWINPUT,
+ INPUT_EVENT_MOUSE_BUTTON
+};
+
+struct KeyPressEventArgs
+{
+ input_event event_id;
+ uint8_t vkey;
+ uint8_t scancode;
+};
+
+struct MouseButtonEventArgs
+{
+ int button;
+ int keydown;
+ int xpos;
+ int ypos;
+};
+
+// Forward declarations
+struct _EXCEPTION_POINTERS;
+
+class windows_osd_interface : public osd_common_t
+{
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ // Access to exception filter static method
+ friend int main(int argc, char *argv[]);
+ friend int main_(int argc, char *argv[]); //HBMAME
+#endif
+
+public:
+ // construction/destruction
+ windows_osd_interface(windows_options &options);
+ virtual ~windows_osd_interface();
+
+ // general overridables
+ virtual void init(running_machine &machine) override;
+ virtual void update(bool skip_redraw) override;
+
+ // input overrideables
+ virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) override;
+
+ // video overridables
+ virtual void add_audio_to_recording(const int16_t *buffer, int samples_this_frame) override;
+
+ virtual void video_register() override;
+
+ virtual bool video_init() override;
+ virtual bool window_init() override;
+
+ virtual void video_exit() override;
+ virtual void window_exit() override;
+
+ void extract_video_config();
+
+ // windows osd specific
+ bool handle_input_event(input_event eventid, void *eventdata) const;
+ bool should_hide_mouse() const;
+ void poll_input(running_machine &machine) const;
+
+ virtual windows_options &options() override { return m_options; }
+
+ int window_count();
+
+protected:
+ virtual void build_slider_list() override;
+ virtual void update_slider_list() override;
+
+ void check_osd_inputs();
+
+private:
+ virtual void osd_exit() override;
+ static void output_oslog(const char *buffer);
+
+ windows_options & m_options;
+
+ static const int DEFAULT_FONT_HEIGHT = 200;
+};
+
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+ref class MameMainApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
+{
+private:
+ std::unique_ptr<windows_options> m_options;
+ std::unique_ptr<windows_osd_interface> m_osd;
+
+public:
+ MameMainApp();
+
+ // IFrameworkView Methods.
+ virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
+ virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
+ virtual void Load(Platform::String^ entryPoint);
+ virtual void Run();
+ virtual void Uninitialize();
+};
+
+ref class MameViewSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
+{
+public:
+ virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
+};
+
+#endif
+
+//============================================================
+// GLOBAL VARIABLES
+//============================================================
+
+extern const options_entry mame_win_options[];
+
+// defined in winwork.c
+extern int osd_num_processors;
+
+
+#endif
diff --git a/docs/release/src/osd/winui/bitmask.cpp b/docs/release/src/osd/winui/bitmask.cpp
new file mode 100644
index 00000000000..062bbc39f0b
--- /dev/null
+++ b/docs/release/src/osd/winui/bitmask.cpp
@@ -0,0 +1,146 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+/* bitmask.c - Bitmask support routines - MSH 11/19/1998 */
+
+// standard windows headers
+#include <windows.h>
+
+// standard C headers
+#include <stdlib.h> /* For malloc and free */
+
+// MAME/MAMEUI headers
+#include "bitmask.h"
+/* Bit routines */
+static UCHAR maskTable[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+
+/* Create a new LPBITS struct and return the new structure
+ * initialized to 'all bits cleared'
+ *
+ * nLength is the number of desired bits
+ */
+LPBITS NewBits(UINT nLength)
+{
+ UINT nSize = (nLength+7) / 8;
+
+ LPBITS lpBits = (LPBITS)malloc(sizeof(BITS));
+ if (lpBits)
+ {
+ lpBits->m_lpBits = (UCHAR *)malloc(nSize);
+ if (lpBits->m_lpBits)
+ {
+ memset(lpBits->m_lpBits, '\0', nSize);
+ lpBits->m_nSize = nSize;
+ }
+ else
+ {
+ free(lpBits);
+ lpBits = 0;
+ }
+ }
+
+ return lpBits;
+}
+
+void DeleteBits(LPBITS lpBits)
+{
+ if (!lpBits)
+ return;
+
+ if (lpBits->m_nSize && lpBits->m_lpBits)
+ free(lpBits->m_lpBits);
+
+ free(lpBits);
+}
+
+/* Test the 'nBit'th bit */
+BOOL TestBit(LPBITS lpBits, UINT nBit)
+{
+ UINT offset;
+ UCHAR mask;
+
+ if (nBit < 0 || !lpBits || !lpBits->m_lpBits)
+ return FALSE;
+
+ offset = nBit >> 3;
+
+ if (offset >= lpBits->m_nSize)
+ return FALSE;
+
+ mask = maskTable[nBit & 7];
+ return (lpBits->m_lpBits[offset] & mask) ? TRUE : FALSE;
+}
+
+/* Set the 'nBit'th bit */
+void SetBit(LPBITS lpBits, UINT nBit)
+{
+ UINT offset;
+ UCHAR mask;
+
+ if (nBit < 0 || !lpBits || !lpBits->m_lpBits)
+ return;
+
+ offset = nBit >> 3;
+
+ if (offset >= lpBits->m_nSize)
+ return;
+
+ mask = maskTable[nBit & 7];
+ lpBits->m_lpBits[offset] |= mask;
+}
+
+/* Clear the 'nBit'th bit */
+void ClearBit(LPBITS lpBits, UINT nBit)
+{
+ UINT offset;
+ UCHAR mask;
+
+ if (nBit < 0 || !lpBits || !lpBits->m_lpBits)
+ return;
+
+ offset = nBit >> 3;
+
+ if (offset >= lpBits->m_nSize)
+ return;
+
+ mask = maskTable[nBit & 7];
+ lpBits->m_lpBits[offset] &= ~mask;
+}
+
+/* Set or Clear all bits as specified by 'bSet' */
+void SetAllBits(LPBITS lpBits, BOOL bSet)
+{
+ if (lpBits && lpBits->m_nSize != 0 && lpBits->m_lpBits)
+ memset(lpBits->m_lpBits, (!bSet) ? '\0' : '\xFF', lpBits->m_nSize);
+}
+
+/* Find next bit that matches 'bSet'
+ *
+ * 'nStartPos' specifies the bit to start search after
+ * 'bSet' specifies to search for a set or unset bit
+ *
+ * Returns -1 if no bits are found
+ */
+int FindBit(LPBITS lpBits, int nStartPos, BOOL bSet)
+{
+ UINT i = 0;
+
+ if (!lpBits || !lpBits->m_nSize || !lpBits->m_lpBits)
+ return -1;
+
+ UINT end = lpBits->m_nSize << 3;
+
+ if (nStartPos < 0)
+ nStartPos = 0;
+
+ for (i = nStartPos; i < end; i++)
+ {
+ BOOL res = (TestBit(lpBits, i)) ? TRUE : FALSE;
+ if ((res && bSet) || (!res && !bSet))
+ return i;
+ }
+
+ return -1;
+}
+
+/* End of source file */
diff --git a/docs/release/src/osd/winui/bitmask.h b/docs/release/src/osd/winui/bitmask.h
new file mode 100644
index 00000000000..ad21e6ae7ae
--- /dev/null
+++ b/docs/release/src/osd/winui/bitmask.h
@@ -0,0 +1,33 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef BITMASK_H
+#define BITMASK_H
+
+/* Bit array type */
+typedef struct
+{
+ UINT m_nSize;
+ UCHAR* m_lpBits;
+} BITS, * LPBITS;
+
+/* Bit functions */
+LPBITS NewBits(UINT nLength /* in bits */);
+void DeleteBits(LPBITS lpBits);
+BOOL TestBit(LPBITS lpBits, UINT nBit);
+void SetBit(LPBITS lpBits, UINT nBit);
+void ClearBit(LPBITS lpBits, UINT nBit);
+void SetAllBits(LPBITS lpBits, BOOL bSet);
+int FindBit(LPBITS lpBits, int nStartPos, BOOL bSet);
+
+/* Linked list type */
+typedef struct
+{
+ LPVOID data;
+ LPVOID next;
+ LPVOID prev;
+} NODE, * LPNODE;
+
+/* Linked list functions */
+
+#endif /* BITMASK_H */
diff --git a/docs/release/src/osd/winui/columnedit.cpp b/docs/release/src/osd/winui/columnedit.cpp
new file mode 100644
index 00000000000..43266f0c7bb
--- /dev/null
+++ b/docs/release/src/osd/winui/columnedit.cpp
@@ -0,0 +1,426 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ columnedit.c
+
+ Column Edit dialog
+
+***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+
+// MAME/MAMEUI headers
+#include "resource.h"
+#include "mui_opts.h"
+
+// Returns TRUE if successful
+static int DoExchangeItem(HWND hFrom, HWND hTo, int nMinItem)
+{
+ LV_ITEM lvi;
+ TCHAR buf[80];
+
+ lvi.iItem = ListView_GetNextItem(hFrom, -1, LVIS_SELECTED | LVIS_FOCUSED);
+ if (lvi.iItem < nMinItem)
+ {
+ if (lvi.iItem != -1) // Can't remove the first column
+ MessageBox(0, TEXT("Cannot Move Selected Item"), TEXT("Move Item"), IDOK);
+ SetFocus(hFrom);
+ return FALSE;
+ }
+ lvi.iSubItem = 0;
+ lvi.mask = LVIF_PARAM | LVIF_TEXT;
+ lvi.pszText = buf;
+ lvi.cchTextMax = ARRAY_LENGTH(buf);
+ if (ListView_GetItem(hFrom, &lvi))
+ {
+ // Add this item to the Show and delete it from Available
+ BOOL b_res = ListView_DeleteItem(hFrom, lvi.iItem);
+ b_res++;
+ lvi.iItem = ListView_GetItemCount(hTo);
+ (void)ListView_InsertItem(hTo, &lvi);
+ ListView_SetItemState(hTo, lvi.iItem, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ SetFocus(hTo);
+ return lvi.iItem;
+ }
+ return FALSE;
+}
+
+static void DoMoveItem( HWND hWnd, BOOL bDown)
+{
+ LV_ITEM lvi;
+ lvi.iItem = ListView_GetNextItem(hWnd, -1, LVIS_SELECTED | LVIS_FOCUSED);
+ int nMaxpos = ListView_GetItemCount(hWnd);
+ if (lvi.iItem == -1 ||
+ (lvi.iItem < 2 && bDown == FALSE) || // Disallow moving First column
+ (lvi.iItem == 0 && bDown == TRUE) || // ""
+ (lvi.iItem == nMaxpos - 1 && bDown == TRUE))
+ {
+ SetFocus(hWnd);
+ return;
+ }
+
+ TCHAR buf[80];
+ lvi.iSubItem = 0;
+ lvi.mask = LVIF_PARAM | LVIF_TEXT;
+ lvi.pszText = buf;
+ lvi.cchTextMax = ARRAY_LENGTH(buf);
+ if (ListView_GetItem(hWnd, &lvi))
+ {
+ // Add this item to the Show and delete it from Available
+ BOOL b_res = ListView_DeleteItem(hWnd, lvi.iItem);
+ b_res++;
+ lvi.iItem += (bDown) ? 1 : -1;
+ (void)ListView_InsertItem(hWnd,&lvi);
+ ListView_SetItemState(hWnd, lvi.iItem, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ if (lvi.iItem == nMaxpos - 1)
+ EnableWindow(GetDlgItem(GetParent(hWnd), IDC_BUTTONMOVEDOWN), FALSE);
+ else
+ EnableWindow(GetDlgItem(GetParent(hWnd), IDC_BUTTONMOVEDOWN), TRUE);
+
+ if (lvi.iItem < 2)
+ EnableWindow(GetDlgItem(GetParent(hWnd), IDC_BUTTONMOVEUP), FALSE);
+ else
+ EnableWindow(GetDlgItem(GetParent(hWnd), IDC_BUTTONMOVEUP), TRUE);
+
+ SetFocus(hWnd);
+ }
+}
+
+INT_PTR InternalColumnDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam,
+ int nColumnMax, int *shown, int *order,
+ const LPCTSTR *names, void (*pfnGetRealColumnOrder)(int *),
+ void (*pfnGetColumnInfo)(int *pnOrder, int *pnShown),
+ void (*pfnSetColumnInfo)(int *pnOrder, int *pnShown))
+{
+ static HWND hShown;
+ static HWND hAvailable;
+ static BOOL showMsg = FALSE;
+ int nShown = 0;
+ int nAvail = 0;
+ int i, nCount = 0;
+ LV_ITEM lvi;
+ DWORD dwShowStyle, dwAvailableStyle, dwView = 0;
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ hShown = GetDlgItem(hDlg, IDC_LISTSHOWCOLUMNS);
+ hAvailable = GetDlgItem(hDlg, IDC_LISTAVAILABLECOLUMNS);
+ /*Change Style to Always Show Selection */
+ dwShowStyle = GetWindowLong(hShown, GWL_STYLE);
+ dwAvailableStyle = GetWindowLong(hAvailable, GWL_STYLE);
+ dwView = LVS_SHOWSELALWAYS | LVS_LIST;
+
+ /* Only set the window style if the view bits have changed. */
+ if ((dwShowStyle & LVS_TYPEMASK) != dwView)
+ SetWindowLong(hShown, GWL_STYLE, (dwShowStyle & ~LVS_TYPEMASK) | dwView);
+ if ((dwAvailableStyle & LVS_TYPEMASK) != dwView)
+ SetWindowLong(hAvailable, GWL_STYLE, (dwAvailableStyle & ~LVS_TYPEMASK) | dwView);
+
+ pfnGetColumnInfo(order, shown);
+
+ showMsg = TRUE;
+ nShown = 0;
+ nAvail = 0;
+
+ lvi.mask = LVIF_TEXT | LVIF_PARAM;
+ lvi.stateMask = 0;
+ lvi.iSubItem = 0;
+ lvi.iImage = -1;
+
+ /* Get the Column Order and save it */
+ pfnGetRealColumnOrder(order);
+
+ for (i = 0 ; i < nColumnMax; i++)
+ {
+ lvi.pszText = (TCHAR *) names[order[i]];
+ lvi.lParam = order[i];
+
+ if (shown[order[i]])
+ {
+ lvi.iItem = nShown;
+ (void)ListView_InsertItem(hShown, &lvi);
+ nShown++;
+ }
+ else
+ {
+ lvi.iItem = nAvail;
+ (void)ListView_InsertItem(hAvailable, &lvi);
+ nAvail++;
+ }
+ }
+ if( nShown > 0)
+ {
+ /*Set to Second, because first is not allowed*/
+ ListView_SetItemState(hShown, 1, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ }
+ if( nAvail > 0)
+ {
+ ListView_SetItemState(hAvailable, 0, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ }
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONADD), TRUE);
+ return TRUE;
+
+ case WM_NOTIFY:
+ {
+ NMHDR *nm = (NMHDR *)lParam;
+ NM_LISTVIEW *pnmv;
+ int nPos = 0;
+
+ switch (nm->code)
+ {
+ case NM_DBLCLK:
+ // Do Data Exchange here, which ListView was double clicked?
+ switch (nm->idFrom)
+ {
+ case IDC_LISTAVAILABLECOLUMNS:
+ // Move selected Item from Available to Shown column
+ nPos = DoExchangeItem(hAvailable, hShown, 0);
+ if (nPos)
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONADD), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ }
+ break;
+
+ case IDC_LISTSHOWCOLUMNS:
+ // Move selected Item from Show to Available column
+ if (DoExchangeItem(hShown, hAvailable, 1))
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONADD), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ }
+ break;
+ }
+ return TRUE;
+
+ case LVN_ITEMCHANGED:
+ // Don't handle this message for now
+ pnmv = (NM_LISTVIEW *)nm;
+ if (//!(pnmv->uOldState & LVIS_SELECTED) &&
+ (pnmv->uNewState & LVIS_SELECTED))
+ {
+ if (pnmv->iItem == 0 && pnmv->hdr.idFrom == IDC_LISTSHOWCOLUMNS)
+ {
+ // Don't allow selecting the first item
+ ListView_SetItemState(hShown, pnmv->iItem,
+ LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ if (showMsg)
+ {
+ MessageBox(0, TEXT("Changing this item is not permitted"), TEXT("Select Item"), IDOK);
+ showMsg = FALSE;
+ }
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ /*Leave Focus on Control*/
+ //SetFocus(GetDlgItem(hDlg,IDOK));
+ return TRUE;
+ }
+ else
+ showMsg = TRUE;
+ }
+ if( pnmv->uOldState & LVIS_SELECTED && pnmv->iItem == 0 && pnmv->hdr.idFrom == IDC_LISTSHOWCOLUMNS )
+ {
+ /*we enable the buttons again, if the first Entry loses selection*/
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), TRUE);
+ //SetFocus(GetDlgItem(hDlg,IDOK));
+ }
+ break;
+ case NM_SETFOCUS:
+ {
+ switch (nm->idFrom)
+ {
+ case IDC_LISTAVAILABLECOLUMNS:
+ if (ListView_GetItemCount(nm->hwndFrom) != 0)
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONADD), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), FALSE);
+ }
+ break;
+ case IDC_LISTSHOWCOLUMNS:
+ if (ListView_GetItemCount(nm->hwndFrom) != 0)
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONADD), FALSE);
+
+ if (ListView_GetNextItem(hShown, -1, LVIS_SELECTED | LVIS_FOCUSED) == 0 )
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), FALSE);
+ }
+ else
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), TRUE);
+ }
+ }
+ break;
+ }
+ }
+ break;
+ case LVN_KEYDOWN:
+ case NM_CLICK:
+ pnmv = (NM_LISTVIEW *)nm;
+ if (//!(pnmv->uOldState & LVIS_SELECTED) &&
+ (pnmv->uNewState & LVIS_SELECTED))
+ {
+ if (pnmv->iItem == 0 && pnmv->hdr.idFrom == IDC_LISTSHOWCOLUMNS)
+ {
+ }
+ }
+ switch (nm->idFrom)
+ {
+ case IDC_LISTAVAILABLECOLUMNS:
+ if (ListView_GetItemCount(nm->hwndFrom) != 0)
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONADD), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), FALSE);
+ }
+ break;
+
+ case IDC_LISTSHOWCOLUMNS:
+ if (ListView_GetItemCount(nm->hwndFrom) != 0)
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONADD), FALSE);
+ if (ListView_GetNextItem(hShown, -1, LVIS_SELECTED | LVIS_FOCUSED) == 0 )
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), FALSE);
+ }
+ else
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), TRUE);
+ }
+ }
+ break;
+ }
+ //SetFocus( nm->hwndFrom );
+ return TRUE;
+ }
+ }
+ return FALSE;
+ case WM_COMMAND:
+ {
+ WORD wID = GET_WM_COMMAND_ID(wParam, lParam);
+ HWND hWndCtrl = GET_WM_COMMAND_HWND(wParam, lParam);
+ int nPos = 0;
+
+ switch (wID)
+ {
+ case IDC_LISTSHOWCOLUMNS:
+ break;
+ case IDC_BUTTONADD:
+ // Move selected Item in Available to Shown
+ nPos = DoExchangeItem(hAvailable, hShown, 0);
+ if (nPos)
+ {
+ EnableWindow(hWndCtrl,FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONREMOVE), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ }
+ break;
+
+ case IDC_BUTTONREMOVE:
+ // Move selected Item in Show to Available
+ if (DoExchangeItem( hShown, hAvailable, 1))
+ {
+ EnableWindow(hWndCtrl,FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONADD), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEUP), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BUTTONMOVEDOWN), FALSE);
+ }
+ break;
+
+ case IDC_BUTTONMOVEDOWN:
+ // Move selected item in the Show window up 1 item
+ DoMoveItem(hShown, TRUE);
+ break;
+
+ case IDC_BUTTONMOVEUP:
+ // Move selected item in the Show window down 1 item
+ DoMoveItem(hShown, FALSE);
+ break;
+
+ case IDOK:
+ // Save users choices
+ nShown = ListView_GetItemCount(hShown);
+ nAvail = ListView_GetItemCount(hAvailable);
+ nCount = 0;
+ for (i = 0; i < nShown; i++)
+ {
+ lvi.iSubItem = 0;
+ lvi.mask = LVIF_PARAM;
+ lvi.pszText = 0;
+ lvi.iItem = i;
+ BOOL b_res = ListView_GetItem(hShown, &lvi);
+ b_res++;
+ order[nCount++] = lvi.lParam;
+ shown[lvi.lParam] = TRUE;
+ }
+ for (i = 0; i < nAvail; i++)
+ {
+ lvi.iSubItem = 0;
+ lvi.mask = LVIF_PARAM;
+ lvi.pszText = 0;
+ lvi.iItem = i;
+ BOOL b_res = ListView_GetItem(hAvailable, &lvi);
+ b_res++;
+ order[nCount++] = lvi.lParam;
+ shown[lvi.lParam] = FALSE;
+ }
+ pfnSetColumnInfo(order, shown);
+ EndDialog(hDlg, 1);
+ return TRUE;
+
+ case IDCANCEL:
+ EndDialog(hDlg, 0);
+ return TRUE;
+ }
+ }
+ break;
+ }
+ return 0;
+}
+
+static void GetColumnInfo(int *order, int *shown)
+{
+ GetColumnOrder(order);
+ GetColumnShown(shown);
+}
+
+static void SetColumnInfo(int *order, int *shown)
+{
+ SetColumnOrder(order);
+ SetColumnShown(shown);
+}
+
+INT_PTR CALLBACK ColumnDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ static int shown[COLUMN_MAX];
+ static int order[COLUMN_MAX];
+ extern const LPCTSTR column_names[COLUMN_MAX]; // from winui.cpp, should improve
+
+ return InternalColumnDialogProc(hDlg, Msg, wParam, lParam, COLUMN_MAX, shown, order, column_names, GetRealColumnOrder, GetColumnInfo, SetColumnInfo);
+}
+
diff --git a/docs/release/src/osd/winui/columnedit.h b/docs/release/src/osd/winui/columnedit.h
new file mode 100644
index 00000000000..a3c499ed999
--- /dev/null
+++ b/docs/release/src/osd/winui/columnedit.h
@@ -0,0 +1,15 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef COLUMNEDIT_H
+#define COLUMNEDIT_H
+
+INT_PTR InternalColumnDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam,
+ int nColumnMax, int *shown, int *order,
+ const LPCTSTR *names, void (*pfnGetRealColumnOrder)(int *),
+ void (*pfnGetColumnInfo)(int *pnOrder, int *pnShown),
+ void (*pfnSetColumnInfo)(int *pnOrder, int *pnShown));
+
+INT_PTR CALLBACK ColumnDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+
+#endif
diff --git a/docs/release/src/osd/winui/datamap.cpp b/docs/release/src/osd/winui/datamap.cpp
new file mode 100644
index 00000000000..28d3cc0b854
--- /dev/null
+++ b/docs/release/src/osd/winui/datamap.cpp
@@ -0,0 +1,765 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+//============================================================
+//
+// datamap.c - Win32 dialog and options bridge code
+//
+//============================================================
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+#include <commctrl.h>
+#include <tchar.h>
+
+// standard C headers
+
+// MAME/MAMEUI headers
+#include "mui_opts.h"
+#include "datamap.h"
+#include "winutf8.h"
+
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+
+//============================================================
+// TYPE DEFINITIONS
+//============================================================
+
+enum _control_type
+{
+ CT_UNKNOWN,
+ CT_BUTTON,
+ CT_STATIC,
+ CT_EDIT,
+ CT_COMBOBOX,
+ CT_TRACKBAR,
+ CT_LISTVIEW
+};
+
+typedef enum _control_type control_type;
+
+
+typedef struct _datamap_entry datamap_entry;
+struct _datamap_entry
+{
+ // the basics about the entry
+ int dlgitem;
+ datamap_entry_type type;
+ const char *option_name;
+
+ // callbacks
+ datamap_callback callbacks[DCT_COUNT];
+ get_option_name_callback get_option_name;
+
+ // formats
+ const char *int_format;
+ const char *float_format;
+
+ // trackbar options
+ BOOL use_trackbar_options;
+ float trackbar_min;
+ float trackbar_max;
+ float trackbar_increments;
+};
+
+
+struct _datamap
+{
+ int entry_count;
+ datamap_entry entries[256]; // 256 options entries seems enough for now...
+};
+
+typedef void (*datamap_default_callback)(datamap *map, HWND control, windows_options *opts, datamap_entry *entry, const char *option_name);
+
+
+
+//============================================================
+// PROTOTYPES
+//============================================================
+
+static datamap_entry *find_entry(datamap *map, int dlgitem);
+static control_type get_control_type(HWND control);
+static int control_operation(datamap *map, HWND dialog, windows_options *opts, datamap_entry *entry, datamap_callback_type callback_type);
+static void read_control(datamap *map, HWND control, windows_options *opts, datamap_entry *entry, const char *option_name);
+static void populate_control(datamap *map, HWND control, windows_options *opts, datamap_entry *entry, const char *option_name);
+static char *tztrim(float float_value);
+
+
+//============================================================
+// datamap_create
+//============================================================
+
+datamap *datamap_create(void)
+{
+ datamap *map = (datamap *)malloc(sizeof(*map));
+ if (!map)
+ return NULL;
+
+ map->entry_count = 0;
+ return map;
+}
+
+
+
+//============================================================
+// datamap_free
+//============================================================
+
+void datamap_free(datamap *map)
+{
+ free(map);
+}
+
+
+
+//============================================================
+// datamap_add
+//============================================================
+
+void datamap_add(datamap *map, int dlgitem, datamap_entry_type type, const char *option_name)
+{
+ // sanity check for too many entries
+ if (!(map->entry_count < ARRAY_LENGTH(map->entries)))
+ {
+ printf("Datamap.cpp Line __LINE__ too many entries\n");
+ return;
+ }
+
+ // add entry to the datamap
+ memset(&map->entries[map->entry_count], 0, sizeof(map->entries[map->entry_count]));
+ map->entries[map->entry_count].dlgitem = dlgitem;
+ map->entries[map->entry_count].type = type;
+ map->entries[map->entry_count].option_name = option_name;
+ map->entry_count++;
+}
+
+
+
+//============================================================
+// datamap_set_callback
+//============================================================
+
+void datamap_set_callback(datamap *map, int dlgitem, datamap_callback_type callback_type, datamap_callback callback)
+{
+ datamap_entry *entry;
+
+ assert(callback_type >= 0);
+ assert(callback_type < DCT_COUNT);
+
+ entry = find_entry(map, dlgitem);
+ entry->callbacks[callback_type] = callback;
+}
+
+
+
+//============================================================
+// datamap_set_option_name_callback
+//============================================================
+
+void datamap_set_option_name_callback(datamap *map, int dlgitem, get_option_name_callback get_option_name)
+{
+ datamap_entry *entry;
+ entry = find_entry(map, dlgitem);
+ entry->get_option_name = get_option_name;
+}
+
+
+
+//============================================================
+// datamap_set_trackbar_range
+//============================================================
+
+void datamap_set_trackbar_range(datamap *map, int dlgitem, float min, float max, float increments)
+{
+ datamap_entry *entry = find_entry(map, dlgitem);
+ entry->use_trackbar_options = TRUE;
+ entry->trackbar_min = min;
+ entry->trackbar_max = max;
+ entry->trackbar_increments = increments;
+}
+
+
+
+//============================================================
+// datamap_set_int_format
+//============================================================
+
+void datamap_set_int_format(datamap *map, int dlgitem, const char *format)
+{
+ datamap_entry *entry = find_entry(map, dlgitem);
+ entry->int_format = format;
+}
+
+
+
+//============================================================
+// datamap_set_float_format
+//============================================================
+
+void datamap_set_float_format(datamap *map, int dlgitem, const char *format)
+{
+ datamap_entry *entry = find_entry(map, dlgitem);
+ entry->float_format = format;
+}
+
+
+
+//============================================================
+// datamap_read_control
+//============================================================
+
+BOOL datamap_read_control(datamap *map, HWND dialog, windows_options &opts, int dlgitem)
+{
+ datamap_entry *entry = find_entry(map, dlgitem);
+ return control_operation(map, dialog, &opts, entry, DCT_READ_CONTROL);
+}
+
+
+
+//============================================================
+// datamap_read_all_controls
+//============================================================
+
+void datamap_read_all_controls(datamap *map, HWND dialog, windows_options &opts)
+{
+ for (int i = 0; i < map->entry_count; i++)
+ control_operation(map, dialog, &opts, &map->entries[i], DCT_READ_CONTROL);
+}
+
+
+
+//============================================================
+// datamap_populate_control
+//============================================================
+
+void datamap_populate_control(datamap *map, HWND dialog, windows_options &opts, int dlgitem)
+{
+ datamap_entry *entry = find_entry(map, dlgitem);
+ control_operation(map, dialog, &opts, entry, DCT_POPULATE_CONTROL);
+}
+
+
+
+//============================================================
+// datamap_populate_all_controls
+//============================================================
+
+void datamap_populate_all_controls(datamap *map, HWND dialog, windows_options &opts)
+{
+ for (int i = 0; i < map->entry_count; i++)
+ control_operation(map, dialog, &opts, &map->entries[i], DCT_POPULATE_CONTROL);
+}
+
+
+
+//============================================================
+// datamap_update_control
+//============================================================
+
+void datamap_update_control(datamap *map, HWND dialog, windows_options &opts, int dlgitem)
+{
+ datamap_entry *entry = find_entry(map, dlgitem);
+ control_operation(map, dialog, &opts, entry, DCT_UPDATE_STATUS);
+}
+
+
+
+//============================================================
+// datamap_update_all_controls
+//============================================================
+
+void datamap_update_all_controls(datamap *map, HWND dialog, windows_options *opts)
+{
+ for (int i = 0; i < map->entry_count; i++)
+ control_operation(map, dialog, opts, &map->entries[i], DCT_UPDATE_STATUS);
+}
+
+
+
+//============================================================
+// find_entry
+//============================================================
+
+static datamap_entry *find_entry(datamap *map, int dlgitem)
+{
+ for (int i = 0; i < map->entry_count; i++)
+ if (map->entries[i].dlgitem == dlgitem)
+ return &map->entries[i];
+
+ // should not reach here
+ printf("Datamap.cpp line __LINE__ couldn't find an entry\n");
+ return NULL;
+}
+
+
+
+//============================================================
+// get_control_type
+//============================================================
+
+static control_type get_control_type(HWND control)
+{
+ control_type type;
+ TCHAR class_name[256];
+
+ GetClassName(control, class_name, ARRAY_LENGTH(class_name));
+ if (!_tcscmp(class_name, WC_BUTTON))
+ type = CT_BUTTON;
+ else if (!_tcscmp(class_name, WC_STATIC))
+ type = CT_STATIC;
+ else if (!_tcscmp(class_name, WC_EDIT))
+ type = CT_EDIT;
+ else if (!_tcscmp(class_name, WC_COMBOBOX))
+ type = CT_COMBOBOX;
+ else if (!_tcscmp(class_name, TRACKBAR_CLASS))
+ type = CT_TRACKBAR;
+ else if (!_tcscmp(class_name, WC_LISTVIEW))
+ type = CT_LISTVIEW;
+ else
+ type = CT_UNKNOWN;
+
+ return type;
+}
+
+
+
+//============================================================
+// is_control_displayonly
+//============================================================
+
+static BOOL is_control_displayonly(HWND control)
+{
+ BOOL displayonly = false;
+ switch(get_control_type(control))
+ {
+ case CT_STATIC:
+ displayonly = true;
+ break;
+
+ case CT_EDIT:
+ displayonly = (GetWindowLong(control, GWL_STYLE) & ES_READONLY) ? true : false;
+ break;
+
+ default:
+ displayonly = false;
+ break;
+ }
+
+ if (!IsWindowEnabled(control))
+ displayonly = true;
+ return displayonly;
+}
+
+
+
+//============================================================
+// broadcast_changes
+//============================================================
+
+static void broadcast_changes(datamap *map, HWND dialog, windows_options *opts, datamap_entry *entry, const char *option_name)
+{
+ HWND other_control;
+ const char *that_option_name;
+
+ for (int i = 0; i < map->entry_count; i++)
+ {
+ // search for an entry with the same option_name, but is not the exact
+ // same entry
+ that_option_name = map->entries[i].option_name;
+ if (map->entries[i].option_name && (&map->entries[i] != entry) && !strcmp(that_option_name, option_name))
+ {
+ // we've found a control sharing the same option; populate it
+ other_control = GetDlgItem(dialog, map->entries[i].dlgitem);
+ if (other_control)
+ populate_control(map, other_control, opts, &map->entries[i], that_option_name);
+ }
+ }
+}
+
+
+
+//============================================================
+// control_operation
+//============================================================
+
+static int control_operation(datamap *map, HWND dialog, windows_options *opts, datamap_entry *entry, datamap_callback_type callback_type)
+{
+ static const datamap_default_callback default_callbacks[DCT_COUNT] =
+ {
+ read_control,
+ populate_control,
+ NULL
+ };
+ int result = 0;
+ const char *option_name;
+ char option_name_buffer[64];
+ char option_value[1024] = {0, };
+
+ HWND control = GetDlgItem(dialog, entry->dlgitem);
+ if (control)
+ {
+ // don't do anything if we're reading from a display-only control
+ if ((callback_type != DCT_READ_CONTROL) || !is_control_displayonly(control))
+ {
+ // figure out the option_name
+ if (entry->get_option_name)
+ {
+ option_name_buffer[0] = '\0';
+ entry->get_option_name(map, dialog, control, option_name_buffer, ARRAY_LENGTH(option_name_buffer));
+ option_name = option_name_buffer;
+ }
+ else
+ option_name = entry->option_name;
+
+ // if reading, get the option value, solely for the purposes of comparison
+ if ((callback_type == DCT_READ_CONTROL) && option_name)
+ snprintf(option_value, ARRAY_LENGTH(option_value), "%s", opts->value(option_name));
+
+ if (entry->callbacks[callback_type])
+ {
+ // use custom callback
+ result = entry->callbacks[callback_type](map, dialog, control, opts, option_name);
+ }
+ else if (default_callbacks[callback_type] && option_name)
+ {
+ // use default callback
+ default_callbacks[callback_type](map, control, opts, entry, option_name);
+ }
+
+ // the result is dependent on the type of control
+ switch(callback_type)
+ {
+ case DCT_READ_CONTROL:
+ // For callbacks that returned TRUE, do not broadcast_changes.
+ if (!result) {
+ // do a check to see if the control changed
+ result = (option_name) && (strcmp(option_value, opts->value(option_name)) != 0);
+ if (result)
+ {
+ // the value has changed; we may need to broadcast the change
+ broadcast_changes(map, dialog, opts, entry, option_name);
+ }
+ }
+ break;
+
+ default:
+ // do nothing
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+
+
+//============================================================
+// trackbar_value_from_position
+//============================================================
+
+static float trackbar_value_from_position(datamap_entry *entry, int position)
+{
+ float position_f = position;
+
+ if (entry->use_trackbar_options)
+ position_f = (position_f * entry->trackbar_increments) + entry->trackbar_min;
+
+ return position_f;
+}
+
+
+
+//============================================================
+// trackbar_position_from_value
+//============================================================
+
+static int trackbar_position_from_value(datamap_entry *entry, float value)
+{
+ if (entry->use_trackbar_options)
+ value = floor((value - entry->trackbar_min) / entry->trackbar_increments + 0.5);
+
+ return (int) value;
+}
+
+
+
+//============================================================
+// read_control
+//============================================================
+
+static void read_control(datamap *map, HWND control, windows_options *opts, datamap_entry *entry, const char *option_name)
+{
+ BOOL bool_value = 0;
+ int int_value = 0;
+ float float_value = 0;
+ const char *string_value;
+ int selected_index = 0;
+ int trackbar_pos = 0;
+ // use default read value behavior
+ switch(get_control_type(control))
+ {
+ case CT_BUTTON:
+ //assert(entry->type == DM_BOOL);
+ bool_value = Button_GetCheck(control);
+ opts->set_value(option_name, bool_value, OPTION_PRIORITY_CMDLINE);
+ break;
+
+ case CT_COMBOBOX:
+ selected_index = ComboBox_GetCurSel(control);
+ if (selected_index >= 0)
+ {
+ switch(entry->type)
+ {
+ case DM_INT:
+ int_value = (int) ComboBox_GetItemData(control, selected_index);
+ opts->set_value(option_name, int_value, OPTION_PRIORITY_CMDLINE);
+ break;
+
+ case DM_STRING:
+ string_value = (const char *) ComboBox_GetItemData(control, selected_index);
+ opts->set_value(option_name, string_value ? string_value : "", OPTION_PRIORITY_CMDLINE);
+ break;
+
+ default:
+ break;
+ }
+ }
+ break;
+
+ case CT_TRACKBAR:
+ trackbar_pos = SendMessage(control, TBM_GETPOS, 0, 0);
+ float_value = trackbar_value_from_position(entry, trackbar_pos);
+ switch(entry->type)
+ {
+ case DM_INT:
+ int_value = (int) float_value;
+ if (int_value != opts->int_value(option_name)) {
+ opts->set_value(option_name, int_value, OPTION_PRIORITY_CMDLINE);
+ }
+ break;
+
+ case DM_FLOAT:
+ // Use tztrim(float_value) or we get trailing zero's that break options_equal().
+ if (float_value != opts->float_value(option_name)) {
+ opts->set_value(option_name, tztrim(float_value), OPTION_PRIORITY_CMDLINE);
+ }
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case CT_EDIT:
+ // NYI
+ break;
+
+ case CT_STATIC:
+ case CT_LISTVIEW:
+ case CT_UNKNOWN:
+ // non applicable
+ break;
+ }
+}
+
+
+
+//============================================================
+// populate_control
+//============================================================
+
+static void populate_control(datamap *map, HWND control, windows_options *opts, datamap_entry *entry, const char *option_name)
+{
+ int i = 0;
+ BOOL bool_value = 0;
+ int int_value = 0;
+ float float_value = 0;
+ const char *string_value;
+ const char *item_string;
+ int selected_index = 0;
+ char buffer[128];
+ int trackbar_range = 0;
+ int trackbar_pos = 0;
+ double trackbar_range_d = 0;
+
+ // use default populate control value
+ switch(get_control_type(control))
+ {
+ case CT_BUTTON:
+ assert(entry->type == DM_BOOL);
+ bool_value = opts->bool_value(option_name);
+ Button_SetCheck(control, bool_value);
+ break;
+
+ case CT_EDIT:
+ case CT_STATIC:
+ switch(entry->type)
+ {
+ case DM_STRING:
+ string_value = opts->value(option_name);
+ break;
+
+ case DM_INT:
+ int_value = opts->int_value(option_name);
+ if (entry->int_format != NULL)
+ snprintf(buffer, ARRAY_LENGTH(buffer), entry->int_format, int_value);
+ else
+ snprintf(buffer, ARRAY_LENGTH(buffer), "%d", int_value);
+ string_value = buffer;
+ break;
+
+ case DM_FLOAT:
+ float_value = opts->float_value(option_name);
+ if (entry->float_format != NULL)
+ snprintf(buffer, ARRAY_LENGTH(buffer), entry->float_format, float_value);
+ else
+ snprintf(buffer, ARRAY_LENGTH(buffer), "%f", float_value);
+ string_value = buffer;
+ break;
+
+ default:
+ string_value = "";
+ break;
+ }
+ if (string_value == NULL)
+ string_value = "";
+ win_set_window_text_utf8(control, string_value);
+ break;
+
+ case CT_COMBOBOX:
+ selected_index = 0;
+ switch(entry->type)
+ {
+ case DM_INT:
+ int_value = opts->int_value(option_name);
+ for (i = 0; i < ComboBox_GetCount(control); i++)
+ {
+ if (int_value == (int) ComboBox_GetItemData(control, i))
+ {
+ selected_index = i;
+ break;
+ }
+ }
+ break;
+
+ case DM_STRING:
+ string_value = opts->value(option_name);
+ for (i = 0; i < ComboBox_GetCount(control); i++)
+ {
+ item_string = (const char *) ComboBox_GetItemData(control, i);
+ if (!core_stricmp(string_value, item_string ? item_string : ""))
+ {
+ selected_index = i;
+ break;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ (void)ComboBox_SetCurSel(control, selected_index);
+ break;
+
+ case CT_TRACKBAR:
+ // do we need to set the trackbar options?
+/* if (!entry->use_trackbar_options)
+ {
+ switch(options_get_range_type(opts, option_name))
+ {
+ case OPTION_RANGE_NONE:
+ // do nothing
+ break;
+
+ case OPTION_RANGE_INT:
+ options_get_range_int(opts, option_name, &minval_int, &maxval_int);
+ entry->use_trackbar_options = TRUE;
+ entry->trackbar_min = minval_int;
+ entry->trackbar_max = maxval_int;
+ entry->trackbar_increments = 1;
+ break;
+
+ case OPTION_RANGE_FLOAT:
+ options_get_range_float(opts, option_name, &minval_float, &maxval_float);
+ entry->use_trackbar_options = TRUE;
+ entry->trackbar_min = minval_float;
+ entry->trackbar_max = maxval_float;
+ entry->trackbar_increments = (float)0.05;
+ break;
+ }
+ }
+ */
+
+ // do we specify default options for this control? if so, we need to specify
+ // the range
+ if (entry->use_trackbar_options)
+ {
+ trackbar_range_d = floor(((entry->trackbar_max - entry->trackbar_min)
+ / entry->trackbar_increments) + 0.5);
+ trackbar_range = (int) trackbar_range_d;
+ SendMessage(control, TBM_SETRANGEMIN, (WPARAM) FALSE, (LPARAM) 0);
+ SendMessage(control, TBM_SETRANGEMAX, (WPARAM) FALSE, (LPARAM) trackbar_range);
+ }
+
+ switch(entry->type)
+ {
+ case DM_INT:
+ int_value = opts->int_value(option_name);
+ trackbar_pos = trackbar_position_from_value(entry, int_value);
+ break;
+
+ case DM_FLOAT:
+ float_value = opts->float_value(option_name);
+ trackbar_pos = trackbar_position_from_value(entry, float_value);
+ break;
+
+ default:
+ trackbar_pos = 0;
+ break;
+ }
+ SendMessage(control, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) trackbar_pos);
+ break;
+
+ case CT_LISTVIEW:
+ case CT_UNKNOWN:
+ // non applicable
+ break;
+ }
+}
+
+// Return a string from a float value with trailing zeros removed.
+static char *tztrim(float float_value)
+{
+ static char tz_string[20];
+ char float_string[20];
+ int i = 0;
+
+ sprintf(float_string, "%f", float_value);
+
+ char* ptr = float_string;
+
+ // Copy before the '.'
+ while (*ptr && *ptr != '.')
+ tz_string[i++] = *ptr++;
+
+ // add the '.' and the next digit
+ if (*ptr == '.')
+ {
+ tz_string[i++] = *ptr++;
+ tz_string[i++] = *ptr++;
+ }
+ // Keep copying until we hit a '0'
+ while (*ptr && *ptr != '0')
+ tz_string[i++] = *ptr++;
+
+ // Null terminate
+ tz_string[i] = '\0';
+ return tz_string;
+}
+
diff --git a/docs/release/src/osd/winui/datamap.h b/docs/release/src/osd/winui/datamap.h
new file mode 100644
index 00000000000..045ae1245c4
--- /dev/null
+++ b/docs/release/src/osd/winui/datamap.h
@@ -0,0 +1,73 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+//============================================================
+//
+// datamap.c - Win32 dialog and options bridge code
+//
+//============================================================
+
+#ifndef _DATAMAP_H_
+#define _DATAMAP_H_
+
+#include "emu.h"
+
+
+//============================================================
+// TYPE DEFINITIONS
+//============================================================
+
+enum _datamap_entry_type
+{
+ DM_NONE = 0,
+ DM_BOOL,
+ DM_INT,
+ DM_FLOAT,
+ DM_STRING
+};
+typedef enum _datamap_entry_type datamap_entry_type;
+
+
+enum _datamap_callback_type
+{
+ DCT_READ_CONTROL,
+ DCT_POPULATE_CONTROL,
+ DCT_UPDATE_STATUS,
+
+ DCT_COUNT
+};
+
+typedef enum _datamap_callback_type datamap_callback_type;
+
+
+typedef struct _datamap datamap;
+// MSH - Callback can now return TRUE, signifying that changes have been made, but should NOT be broadcast.
+typedef BOOL (*datamap_callback)(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name);
+typedef void (*get_option_name_callback)(datamap *map, HWND dialog, HWND control, char *buffer, size_t buffer_size);
+
+
+//============================================================
+// PROTOTYPES
+//============================================================
+
+// datamap creation and disposal
+datamap *datamap_create(void);
+void datamap_free(datamap *map);
+
+// datamap setup
+void datamap_add(datamap *map, int dlgitem, datamap_entry_type type, const char *option_name);
+void datamap_set_callback(datamap *map, int dlgitem, datamap_callback_type callback_type, datamap_callback callback);
+void datamap_set_option_name_callback(datamap *map, int dlgitem, get_option_name_callback get_option_name);
+void datamap_set_trackbar_range(datamap *map, int dlgitem, float min, float max, float increments);
+void datamap_set_int_format(datamap *map, int dlgitem, const char *format);
+void datamap_set_float_format(datamap *map, int dlgitem, const char *format);
+
+// datamap operations
+BOOL datamap_read_control(datamap *map, HWND dialog, windows_options &opts, int dlgitem);
+void datamap_read_all_controls(datamap *map, HWND dialog, windows_options &opts);
+void datamap_populate_control(datamap *map, HWND dialog, windows_options &opts, int dlgitem);
+void datamap_populate_all_controls(datamap *map, HWND dialog, windows_options &opts);
+void datamap_update_control(datamap *map, HWND dialog, windows_options &opts, int dlgitem);
+void datamap_update_all_controls(datamap *map, HWND dialog, windows_options *opts);
+
+#endif // _DATAMAP_H_
diff --git a/docs/release/src/osd/winui/dialogs.cpp b/docs/release/src/osd/winui/dialogs.cpp
new file mode 100644
index 00000000000..fd74e636d2e
--- /dev/null
+++ b/docs/release/src/osd/winui/dialogs.cpp
@@ -0,0 +1,847 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ dialogs.c
+
+ Dialog box procedures go here
+
+***************************************************************************/
+
+
+#ifdef _MSC_VER
+#ifndef NONAMELESSUNION
+#define NONAMELESSUNION
+#endif
+#endif
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+#include <shellapi.h> // ShellExecute
+#include <commctrl.h>
+
+// standard C headers
+#include <tchar.h>
+
+// MAMEUI headers
+#include "bitmask.h"
+#include "treeview.h"
+#include "resource.h"
+#include "mui_opts.h"
+#include "help.h"
+#include "properties.h" // For GetHelpIDs
+
+// MAME headers
+#include "winutf8.h"
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+static struct ComboBoxHistoryTab
+{
+ const wchar_t* m_pText;
+ const int m_pData;
+} g_ComboBoxHistoryTab[] =
+{
+ { TEXT("Artwork"), TAB_ARTWORK },
+ { TEXT("Boss"), TAB_BOSSES },
+ { TEXT("Cabinet"), TAB_CABINET },
+ { TEXT("Control Panel"), TAB_CONTROL_PANEL },
+ { TEXT("Cover"), TAB_COVER },
+ { TEXT("End"), TAB_ENDS },
+ { TEXT("Flyer"), TAB_FLYER },
+ { TEXT("Game Over"), TAB_GAMEOVER },
+ { TEXT("How To"), TAB_HOWTO },
+ { TEXT("Logo"), TAB_LOGO },
+ { TEXT("Marquee"), TAB_MARQUEE },
+ { TEXT("PCB"), TAB_PCB },
+ { TEXT("Scores"), TAB_SCORES },
+ { TEXT("Select"), TAB_SELECT },
+ { TEXT("Snapshot"), TAB_SCREENSHOT },
+ { TEXT("Title"), TAB_TITLE },
+ { TEXT("Versus"), TAB_VERSUS },
+ { TEXT("All"), TAB_ALL },
+ { TEXT("None"), TAB_NONE }
+};
+
+
+static string g_FilterText;
+
+#define NUM_EXCLUSIONS 12
+#define NUMHISTORYTAB ARRAY_LENGTH(g_ComboBoxHistoryTab)
+
+/* Pairs of filters that exclude each other */
+static DWORD filterExclusion[NUM_EXCLUSIONS] =
+{
+ IDC_FILTER_CLONES, IDC_FILTER_ORIGINALS,
+ IDC_FILTER_NONWORKING, IDC_FILTER_WORKING,
+ IDC_FILTER_UNAVAILABLE, IDC_FILTER_AVAILABLE,
+ IDC_FILTER_RASTER, IDC_FILTER_VECTOR,
+ IDC_FILTER_HORIZONTAL, IDC_FILTER_VERTICAL,
+ IDC_FILTER_ARCADE, IDC_FILTER_MESS,
+};
+
+static void DisableFilterControls(HWND hWnd, LPCFOLDERDATA lpFilterRecord, LPCFILTER_ITEM lpFilterItem, DWORD dwFlags);
+static void EnableFilterExclusions(HWND hWnd, DWORD dwCtrlID);
+static DWORD ValidateFilters(LPCFOLDERDATA lpFilterRecord, DWORD dwFlags);
+static void OnHScroll(HWND hWnd, HWND hwndCtl, UINT code, int pos);
+
+/***************************************************************************/
+
+const char * GetFilterText(void)
+{
+ return g_FilterText.c_str();
+}
+
+INT_PTR CALLBACK ResetDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ BOOL resetFilters = false;
+ BOOL resetGames = false;
+ BOOL resetUI = false;
+ BOOL resetDefaults = false;
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ return true;
+
+ case WM_HELP:
+ /* User clicked the ? from the upper right on a control */
+ HelpFunction((HWND)((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP, HH_TP_HELP_WM_HELP, GetHelpIDs());
+ break;
+
+ case WM_CONTEXTMENU:
+ HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, GetHelpIDs());
+
+ break;
+
+ case WM_COMMAND :
+ switch (GET_WM_COMMAND_ID(wParam, lParam))
+ {
+ case IDOK :
+ resetFilters = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_FILTERS));
+ resetGames = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_GAMES));
+ resetDefaults = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_DEFAULT));
+ resetUI = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_UI));
+ if (resetFilters || resetGames || resetUI || resetDefaults)
+ {
+
+ TCHAR temp[400];
+ _tcscpy(temp, TEXT(MAMEUINAME));
+ _tcscat(temp, TEXT(" will now reset the following\n"));
+ _tcscat(temp, TEXT("to the default settings:\n\n"));
+
+ if (resetDefaults)
+ _tcscat(temp, TEXT("Global game options\n"));
+ if (resetGames)
+ _tcscat(temp, TEXT("Individual game options\n"));
+ if (resetFilters)
+ _tcscat(temp, TEXT("Custom folder filters\n"));
+ if (resetUI)
+ {
+ _tcscat(temp, TEXT("User interface settings\n\n"));
+ _tcscat(temp, TEXT("Resetting the User Interface options\n"));
+ _tcscat(temp, TEXT("requires exiting "));
+ _tcscat(temp, TEXT(MAMEUINAME));
+ _tcscat(temp, TEXT(".\n"));
+ }
+ _tcscat(temp, TEXT("\nDo you wish to continue?"));
+ if (MessageBox(hDlg, temp, TEXT("Restore Settings"), IDOK) == IDOK)
+ {
+ if (resetFilters)
+ ResetFilters();
+
+ if (resetGames)
+ ResetAllGameOptions();
+
+ if (resetDefaults)
+ ResetGameDefaults();
+
+ // This is the only case we need to exit and restart for.
+ if (resetUI)
+ {
+ ResetGUI();
+ EndDialog(hDlg, 1);
+ return true;
+ } else {
+ EndDialog(hDlg, 0);
+ return true;
+ }
+ } else {
+ // Give the user a chance to change what they want to reset.
+ break;
+ }
+ }
+ // Nothing was selected but OK, just fall through
+ case IDCANCEL :
+ EndDialog(hDlg, 0);
+ return true;
+ }
+ break;
+ }
+ return 0;
+}
+
+INT_PTR CALLBACK InterfaceDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ CHOOSECOLOR cc;
+ COLORREF choice_colors[16];
+ TCHAR tmp[4];
+ int i = 0;
+ BOOL bRedrawList = false;
+ int nCurSelection = 0;
+ int nHistoryTab = 0;
+ int nPatternCount = 0;
+ int value = 0;
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ Button_SetCheck(GetDlgItem(hDlg,IDC_START_GAME_CHECK),GetGameCheck());
+ Button_SetCheck(GetDlgItem(hDlg,IDC_JOY_GUI),GetJoyGUI());
+ Button_SetCheck(GetDlgItem(hDlg,IDC_KEY_GUI),GetKeyGUI());
+ Button_SetCheck(GetDlgItem(hDlg,IDC_OVERRIDE_REDX),GetOverrideRedX());
+ Button_SetCheck(GetDlgItem(hDlg,IDC_HIDE_MOUSE),GetHideMouseOnStartup());
+
+ // Get the current value of the control
+ SendDlgItemMessage(hDlg, IDC_CYCLETIMESEC, TBM_SETRANGE, (WPARAM)false, (LPARAM)MAKELONG(0, 60)); /* [0, 60] */
+ value = GetCycleScreenshot();
+ SendDlgItemMessage(hDlg,IDC_CYCLETIMESEC, TBM_SETPOS, true, value);
+ _itot(value,tmp,10);
+ SendDlgItemMessage(hDlg,IDC_CYCLETIMESECTXT,WM_SETTEXT,0, (WPARAM)tmp);
+
+ Button_SetCheck(GetDlgItem(hDlg,IDC_STRETCH_SCREENSHOT_LARGER), GetStretchScreenShotLarger());
+ Button_SetCheck(GetDlgItem(hDlg,IDC_FILTER_INHERIT), GetFilterInherit());
+ Button_SetCheck(GetDlgItem(hDlg,IDC_NOOFFSET_CLONES), GetOffsetClones());
+
+ for (int i = 0; i < NUMHISTORYTAB; i++)
+ {
+ (void)ComboBox_InsertString(GetDlgItem(hDlg, IDC_HISTORY_TAB), i, g_ComboBoxHistoryTab[i].m_pText);
+ (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_HISTORY_TAB), i, g_ComboBoxHistoryTab[i].m_pData);
+ }
+
+ if (GetHistoryTab() < MAX_TAB_TYPES)
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_HISTORY_TAB), GetHistoryTab());
+ else
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_HISTORY_TAB), GetHistoryTab()-TAB_SUBTRACT);
+
+ (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename"));
+ (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++, "%g");
+ (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename + Increment"));
+ (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++, "%g%i");
+ (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename/Gamename"));
+ (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++, "%g/%g");
+ (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename/Gamename + Increment"));
+ (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++, "%g/%g%i");
+ (void)ComboBox_AddString(GetDlgItem(hDlg, IDC_SNAPNAME), TEXT("Gamename/Increment"));
+ (void)ComboBox_SetItemData(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount, "%g/%i");
+ //Default to this setting
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), nPatternCount++);
+
+ {
+ const char* snapname = GetSnapName();
+ if (core_stricmp(snapname,"%g" )==0)
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 0);
+ else
+ if (core_stricmp(snapname,"%g%i" )==0)
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 1);
+ else
+ if (core_stricmp(snapname,"%g/%g" )==0)
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 2);
+ else
+ if (core_stricmp(snapname,"%g/%g%i" )==0)
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 3);
+ else
+ if (core_stricmp(snapname,"%g/%i" )==0)
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_SNAPNAME), 4);
+ }
+
+ SendDlgItemMessage(hDlg, IDC_SCREENSHOT_BORDERSIZE, TBM_SETRANGE, (WPARAM)false, (LPARAM)MAKELONG(0, 100)); /* [0, 100] */
+ value = GetScreenshotBorderSize();
+ SendDlgItemMessage(hDlg,IDC_SCREENSHOT_BORDERSIZE, TBM_SETPOS, true, value);
+ _itot(value,tmp,10);
+ SendDlgItemMessage(hDlg,IDC_SCREENSHOT_BORDERSIZETXT,WM_SETTEXT,0, (WPARAM)tmp);
+
+ //return true;
+ break;
+
+ case WM_HELP:
+ /* User clicked the ? from the upper right on a control */
+ HelpFunction((HWND)((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP, HH_TP_HELP_WM_HELP, GetHelpIDs());
+ break;
+
+ case WM_CONTEXTMENU:
+ HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, GetHelpIDs());
+ break;
+ case WM_HSCROLL:
+ HANDLE_WM_HSCROLL(hDlg, wParam, lParam, OnHScroll);
+ break;
+ case WM_COMMAND :
+ switch (GET_WM_COMMAND_ID(wParam, lParam))
+ {
+ case IDC_SCREENSHOT_BORDERCOLOR:
+ {
+ for (i=0;i<16;i++)
+ choice_colors[i] = GetCustomColor(i);
+
+ cc.lStructSize = sizeof(CHOOSECOLOR);
+ cc.hwndOwner = hDlg;
+ cc.rgbResult = GetScreenshotBorderColor();
+ cc.lpCustColors = choice_colors;
+ cc.Flags = CC_ANYCOLOR | CC_RGBINIT | CC_SOLIDCOLOR;
+ if (!ChooseColor(&cc))
+ return true;
+ for (i=0; i<16; i++)
+ SetCustomColor(i,choice_colors[i]);
+ SetScreenshotBorderColor(cc.rgbResult);
+ UpdateScreenShot();
+ return true;
+ }
+ case IDOK :
+ {
+ BOOL checked = false;
+
+ SetGameCheck(Button_GetCheck(GetDlgItem(hDlg, IDC_START_GAME_CHECK)));
+ SetJoyGUI(Button_GetCheck(GetDlgItem(hDlg, IDC_JOY_GUI)));
+ SetKeyGUI(Button_GetCheck(GetDlgItem(hDlg, IDC_KEY_GUI)));
+ SetOverrideRedX(Button_GetCheck(GetDlgItem(hDlg, IDC_OVERRIDE_REDX)));
+ SetHideMouseOnStartup(Button_GetCheck(GetDlgItem(hDlg,IDC_HIDE_MOUSE)));
+
+ if( Button_GetCheck(GetDlgItem(hDlg,IDC_RESET_PLAYSTATS ) ) )
+ {
+ ResetPlayCount( -1 );
+ ResetPlayTime( -1 );
+ bRedrawList = true;
+ }
+ value = SendDlgItemMessage(hDlg,IDC_CYCLETIMESEC, TBM_GETPOS, 0, 0);
+ if( GetCycleScreenshot() != value )
+ {
+ SetCycleScreenshot(value);
+ }
+ value = SendDlgItemMessage(hDlg,IDC_SCREENSHOT_BORDERSIZE, TBM_GETPOS, 0, 0);
+ if( GetScreenshotBorderSize() != value )
+ {
+ SetScreenshotBorderSize(value);
+ UpdateScreenShot();
+ }
+ value = SendDlgItemMessage(hDlg,IDC_HIGH_PRIORITY, TBM_GETPOS, 0, 0);
+ checked = Button_GetCheck(GetDlgItem(hDlg,IDC_STRETCH_SCREENSHOT_LARGER));
+ if (checked != GetStretchScreenShotLarger())
+ {
+ SetStretchScreenShotLarger(checked);
+ UpdateScreenShot();
+ }
+ checked = Button_GetCheck(GetDlgItem(hDlg,IDC_FILTER_INHERIT));
+ if (checked != GetFilterInherit())
+ {
+ SetFilterInherit(checked);
+ // LineUpIcons does just a ResetListView(), which is what we want here
+ PostMessage(GetMainWindow(),WM_COMMAND, MAKEWPARAM(ID_VIEW_LINEUPICONS, false),(LPARAM)NULL);
+ }
+ checked = Button_GetCheck(GetDlgItem(hDlg,IDC_NOOFFSET_CLONES));
+ if (checked != GetOffsetClones())
+ {
+ SetOffsetClones(checked);
+ // LineUpIcons does just a ResetListView(), which is what we want here
+ PostMessage(GetMainWindow(),WM_COMMAND, MAKEWPARAM(ID_VIEW_LINEUPICONS, false),(LPARAM)NULL);
+ }
+ nCurSelection = ComboBox_GetCurSel(GetDlgItem(hDlg,IDC_SNAPNAME));
+ if (nCurSelection != CB_ERR) {
+ const char* snapname_selection = (const char*)ComboBox_GetItemData(GetDlgItem(hDlg,IDC_SNAPNAME), nCurSelection);
+ if (snapname_selection) {
+ SetSnapName(snapname_selection);
+ }
+ }
+ EndDialog(hDlg, 0);
+
+ nCurSelection = ComboBox_GetCurSel(GetDlgItem(hDlg,IDC_HISTORY_TAB));
+ if (nCurSelection != CB_ERR)
+ nHistoryTab = ComboBox_GetItemData(GetDlgItem(hDlg,IDC_HISTORY_TAB), nCurSelection);
+ EndDialog(hDlg, 0);
+ if( GetHistoryTab() != nHistoryTab )
+ {
+ SetHistoryTab(nHistoryTab, true);
+ ResizePickerControls(GetMainWindow());
+ UpdateScreenShot();
+ }
+ if( bRedrawList )
+ {
+ UpdateListView();
+ }
+ return true;
+ }
+ case IDCANCEL :
+ EndDialog(hDlg, 0);
+ return true;
+ }
+ break;
+ }
+ return 0;
+}
+
+INT_PTR CALLBACK FilterDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ static DWORD dwFilters;
+ static DWORD dwpFilters;
+ static LPCFOLDERDATA lpFilterRecord;
+ string strText;
+ int i = 0;
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ {
+ LPTREEFOLDER folder = GetCurrentFolder();
+ LPTREEFOLDER lpParent = NULL;
+ LPCFILTER_ITEM g_lpFilterList = GetFilterList();
+
+ dwFilters = 0;
+
+ if (folder)
+ {
+ char tmp[80];
+
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_EDIT), g_FilterText.c_str());
+ Edit_SetSel(GetDlgItem(hDlg, IDC_FILTER_EDIT), 0, -1);
+ // Mask out non filter flags
+ dwFilters = folder->m_dwFlags & F_MASK;
+ // Display current folder name in dialog titlebar
+ snprintf(tmp,ARRAY_LENGTH(tmp),"Filters for %s Folder",folder->m_lpTitle);
+ win_set_window_text_utf8(hDlg, tmp);
+ if ( GetFilterInherit() )
+ {
+ BOOL bShowExplanation = false;
+ lpParent = GetFolder( folder->m_nParent );
+ if( lpParent )
+ {
+ /* Check the Parent Filters and inherit them on child,
+ * No need to promote all games to parent folder, works as is */
+ dwpFilters = lpParent->m_dwFlags & F_MASK;
+ /*Check all possible Filters if inherited solely from parent, e.g. not being set explicitly on our folder*/
+ if( (dwpFilters & F_CLONES) && !(dwFilters & F_CLONES) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_CLONES)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_CLONES), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_NONWORKING) && !(dwFilters & F_NONWORKING) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_NONWORKING)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_NONWORKING), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_UNAVAILABLE) && !(dwFilters & F_UNAVAILABLE) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_UNAVAILABLE)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_UNAVAILABLE), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_VECTOR) && !(dwFilters & F_VECTOR) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_VECTOR)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_VECTOR), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_RASTER) && !(dwFilters & F_RASTER) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_RASTER)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_RASTER), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_ORIGINALS) && !(dwFilters & F_ORIGINALS) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_ORIGINALS)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_ORIGINALS), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_WORKING) && !(dwFilters & F_WORKING) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_WORKING)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_WORKING), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_AVAILABLE) && !(dwFilters & F_AVAILABLE) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_AVAILABLE)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_AVAILABLE), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_HORIZONTAL) && !(dwFilters & F_HORIZONTAL) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_HORIZONTAL)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_HORIZONTAL), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_VERTICAL) && !(dwFilters & F_VERTICAL) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_VERTICAL)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_VERTICAL), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_ARCADE) && !(dwFilters & F_ARCADE) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_ARCADE)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_ARCADE), strText.c_str());
+ bShowExplanation = true;
+ }
+ if( (dwpFilters & F_MESS) && !(dwFilters & F_MESS) )
+ {
+ /*Add a Specifier to the Checkbox to show it was inherited from the parent*/
+ strText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_MESS)).append(" (*)");
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_MESS), strText.c_str());
+ bShowExplanation = true;
+ }
+ /*Do not or in the Values of the parent, so that the values of the folder still can be set*/
+ //dwFilters |= dwpFilters;
+ }
+ if( ! bShowExplanation )
+ {
+ ShowWindow(GetDlgItem(hDlg, IDC_INHERITED), false );
+ }
+ }
+ else
+ ShowWindow(GetDlgItem(hDlg, IDC_INHERITED), false );
+
+ // Find the matching filter record if it exists
+ lpFilterRecord = FindFilter(folder->m_nFolderId);
+
+ // initialize and disable appropriate controls
+ for (i = 0; g_lpFilterList[i].m_dwFilterType; i++)
+ DisableFilterControls(hDlg, lpFilterRecord, &g_lpFilterList[i], dwFilters);
+ }
+ SetFocus(GetDlgItem(hDlg, IDC_FILTER_EDIT));
+ return false;
+ }
+ case WM_HELP:
+ // User clicked the ? from the upper right on a control
+ HelpFunction((HWND)((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP,
+ HH_TP_HELP_WM_HELP, GetHelpIDs());
+ break;
+
+ case WM_CONTEXTMENU:
+ HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, GetHelpIDs());
+ break;
+
+ case WM_COMMAND:
+ {
+ WORD wID = GET_WM_COMMAND_ID(wParam, lParam);
+ WORD wNotifyCode = GET_WM_COMMAND_CMD(wParam, lParam);
+ LPTREEFOLDER folder = GetCurrentFolder();
+ LPCFILTER_ITEM g_lpFilterList = GetFilterList();
+
+ switch (wID)
+ {
+ case IDOK:
+ dwFilters = 0;
+
+ g_FilterText = win_get_window_text_utf8(GetDlgItem(hDlg, IDC_FILTER_EDIT));
+
+ // see which buttons are checked
+ for (i = 0; g_lpFilterList[i].m_dwFilterType; i++)
+ if (Button_GetCheck(GetDlgItem(hDlg, g_lpFilterList[i].m_dwCtrlID)))
+ dwFilters |= g_lpFilterList[i].m_dwFilterType;
+
+ // Mask out invalid filters
+ dwFilters = ValidateFilters(lpFilterRecord, dwFilters);
+
+ // Keep non filter flags
+ folder->m_dwFlags &= ~F_MASK;
+
+ // put in the set filters
+ folder->m_dwFlags |= dwFilters;
+
+ EndDialog(hDlg, 1);
+ return true;
+
+ case IDCANCEL:
+ EndDialog(hDlg, 0);
+ return true;
+
+ default:
+ // Handle unchecking mutually exclusive filters
+ if (wNotifyCode == BN_CLICKED)
+ EnableFilterExclusions(hDlg, wID);
+ }
+ }
+ break;
+ }
+ return 0;
+}
+
+INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ {
+ HBITMAP hBmp;
+ hBmp = (HBITMAP)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT), IMAGE_BITMAP, 0, 0, LR_SHARED);
+ SendDlgItemMessage(hDlg, IDC_ABOUT, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBmp);
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_VERSION), GetVersionString());
+ }
+ return 1;
+
+ case WM_COMMAND:
+ EndDialog(hDlg, 0);
+ return 1;
+ }
+ return 0;
+}
+
+INT_PTR CALLBACK AddCustomFileDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ static LPTREEFOLDER default_selection = NULL;
+ static int driver_index = 0;
+ BOOL res = 0;
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TREEFOLDER **folders;
+ int num_folders = 0;
+ int i = 0;
+ TVINSERTSTRUCT tvis;
+ TVITEM tvi;
+ BOOL first_entry = true;
+ HIMAGELIST treeview_icons = GetTreeViewIconList();
+
+ // current game passed in using DialogBoxParam()
+ driver_index = lParam;
+
+ (void)TreeView_SetImageList(GetDlgItem(hDlg,IDC_CUSTOM_TREE), treeview_icons, LVSIL_NORMAL);
+
+ GetFolders(&folders,&num_folders);
+
+ // should add "New..."
+
+ // insert custom folders into our tree view
+ for (i=0;i<num_folders;i++)
+ {
+ if (folders[i]->m_dwFlags & F_CUSTOM)
+ {
+ HTREEITEM hti;
+ int jj = 0;
+
+ if (folders[i]->m_nParent == -1)
+ {
+ memset(&tvi, '\0', sizeof(tvi));
+ tvis.hParent = TVI_ROOT;
+ tvis.hInsertAfter = TVI_SORT;
+ tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.pszText = folders[i]->m_lptTitle;
+ tvi.lParam = (LPARAM)folders[i];
+ tvi.iImage = GetTreeViewIconIndex(folders[i]->m_nIconId);
+ tvi.iSelectedImage = 0;
+#if !defined(NONAMELESSUNION)
+ tvis.item = tvi;
+#else
+ tvis.DUMMYUNIONNAME.item = tvi;
+#endif
+
+ hti = TreeView_InsertItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),&tvis);
+
+ /* look for children of this custom folder */
+ for (jj=0; jj<num_folders; jj++)
+ {
+ if (folders[jj]->m_nParent == i)
+ {
+ HTREEITEM hti_child;
+ tvis.hParent = hti;
+ tvis.hInsertAfter = TVI_SORT;
+ tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.pszText = folders[jj]->m_lptTitle;
+ tvi.lParam = (LPARAM)folders[jj];
+ tvi.iImage = GetTreeViewIconIndex(folders[jj]->m_nIconId);
+ tvi.iSelectedImage = 0;
+#if !defined(NONAMELESSUNION)
+ tvis.item = tvi;
+#else
+ tvis.DUMMYUNIONNAME.item = tvi;
+#endif
+ hti_child = TreeView_InsertItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),&tvis);
+ if (folders[jj] == default_selection)
+ res = TreeView_SelectItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti_child);
+ }
+ }
+
+ /*TreeView_Expand(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti,TVE_EXPAND);*/
+ if (first_entry || folders[i] == default_selection)
+ {
+ res = TreeView_SelectItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),hti);
+ first_entry = false;
+ }
+ }
+ }
+ }
+
+ win_set_window_text_utf8(GetDlgItem(hDlg,IDC_CUSTOMFILE_GAME), ModifyThe(driver_list::driver(driver_index).type.fullname()));
+
+ res++;
+ return true;
+ }
+ case WM_COMMAND:
+ switch (GET_WM_COMMAND_ID(wParam, lParam))
+ {
+ case IDOK:
+ {
+ TVITEM tvi;
+ tvi.hItem = TreeView_GetSelection(GetDlgItem(hDlg,IDC_CUSTOM_TREE));
+ tvi.mask = TVIF_PARAM;
+ if (TreeView_GetItem(GetDlgItem(hDlg,IDC_CUSTOM_TREE),&tvi) == true)
+ {
+ /* should look for New... */
+ default_selection = (LPTREEFOLDER)tvi.lParam; /* start here next time */
+ AddToCustomFolder((LPTREEFOLDER)tvi.lParam,driver_index);
+ }
+
+ EndDialog(hDlg, 0);
+ return true;
+ }
+ case IDCANCEL:
+ EndDialog(hDlg, 0);
+ return true;
+
+ }
+ break;
+ }
+ return 0;
+}
+
+INT_PTR CALLBACK DirectXDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ HWND hEdit;
+
+ const char *directx_help = MAMEUINAME " requires DirectX version 9 or later.\r\n";
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ hEdit = GetDlgItem(hDlg, IDC_DIRECTX_HELP);
+ Edit_SetSel(hEdit, Edit_GetTextLength(hEdit), Edit_GetTextLength(hEdit));
+ Edit_ReplaceSel(hEdit, directx_help);
+ return 1;
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDB_WEB_PAGE)
+ ShellExecute(GetMainWindow(), NULL, TEXT("http://www.microsoft.com/directx"), NULL, NULL, SW_SHOWNORMAL);
+
+ if (LOWORD(wParam) == IDCANCEL || LOWORD(wParam) == IDB_WEB_PAGE)
+ EndDialog(hDlg, 0);
+ return 1;
+ }
+ return 0;
+}
+
+/***************************************************************************
+ private functions
+ ***************************************************************************/
+
+static void DisableFilterControls(HWND hWnd, LPCFOLDERDATA lpFilterRecord, LPCFILTER_ITEM lpFilterItem, DWORD dwFlags)
+{
+ HWND hWndCtrl = GetDlgItem(hWnd, lpFilterItem->m_dwCtrlID);
+ DWORD dwFilterType = lpFilterItem->m_dwFilterType;
+
+ /* Check the appropriate control */
+ if (dwFilterType & dwFlags)
+ Button_SetCheck(hWndCtrl, MF_CHECKED);
+
+ /* No special rules for this folder? */
+ if (!lpFilterRecord)
+ return;
+
+ /* If this is an excluded filter */
+ if (lpFilterRecord->m_dwUnset & dwFilterType)
+ {
+ /* uncheck it and disable the control */
+ Button_SetCheck(hWndCtrl, MF_UNCHECKED);
+ EnableWindow(hWndCtrl, false);
+ }
+
+ /* If this is an implied filter, check it and disable the control */
+ if (lpFilterRecord->m_dwSet & dwFilterType)
+ {
+ Button_SetCheck(hWndCtrl, MF_CHECKED);
+ EnableWindow(hWndCtrl, false);
+ }
+}
+
+// Handle disabling mutually exclusive controls
+static void EnableFilterExclusions(HWND hWnd, DWORD dwCtrlID)
+{
+ int i;
+
+ for (i = 0; i < NUM_EXCLUSIONS; i++)
+ {
+ // is this control in the list?
+ if (filterExclusion[i] == dwCtrlID)
+ {
+ // found the control id
+ break;
+ }
+ }
+
+ // if the control was found
+ if (i < NUM_EXCLUSIONS)
+ {
+ DWORD id;
+ // find the opposing control id
+ if (i % 2)
+ id = filterExclusion[i - 1];
+ else
+ id = filterExclusion[i + 1];
+
+ // Uncheck the other control
+ Button_SetCheck(GetDlgItem(hWnd, id), MF_UNCHECKED);
+ }
+}
+
+// Validate filter setting, mask out inappropriate filters for this folder
+static DWORD ValidateFilters(LPCFOLDERDATA lpFilterRecord, DWORD dwFlags)
+{
+ DWORD dwFilters = 0;
+
+ if (lpFilterRecord != (LPFOLDERDATA)0)
+ {
+ // Mask out implied and excluded filters
+ dwFilters = lpFilterRecord->m_dwSet | lpFilterRecord->m_dwUnset;
+ return dwFlags & ~dwFilters;
+ }
+
+ // No special cases - all filters apply
+ return dwFlags;
+}
+
+static void OnHScroll(HWND hwnd, HWND hwndCtl, UINT code, int pos)
+{
+ int value = 0;
+ TCHAR tmp[4];
+ if (hwndCtl == GetDlgItem(hwnd, IDC_CYCLETIMESEC))
+ {
+ value = SendDlgItemMessage(hwnd,IDC_CYCLETIMESEC, TBM_GETPOS, 0, 0);
+ _itot(value,tmp,10);
+ SendDlgItemMessage(hwnd,IDC_CYCLETIMESECTXT,WM_SETTEXT,0, (WPARAM)tmp);
+ }
+ else
+ if (hwndCtl == GetDlgItem(hwnd, IDC_SCREENSHOT_BORDERSIZE))
+ {
+ value = SendDlgItemMessage(hwnd,IDC_SCREENSHOT_BORDERSIZE, TBM_GETPOS, 0, 0);
+ _itot(value,tmp,10);
+ SendDlgItemMessage(hwnd,IDC_SCREENSHOT_BORDERSIZETXT,WM_SETTEXT,0, (WPARAM)tmp);
+ }
+}
diff --git a/docs/release/src/osd/winui/dialogs.h b/docs/release/src/osd/winui/dialogs.h
new file mode 100644
index 00000000000..07bff2075e6
--- /dev/null
+++ b/docs/release/src/osd/winui/dialogs.h
@@ -0,0 +1,18 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef DIALOGS_H
+#define DIALOGS_H
+
+const char * GetFilterText(void);
+
+INT_PTR CALLBACK ResetDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK InterfaceDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK FilterDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK AddCustomFileDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DirectXDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+
+
+#endif
+
diff --git a/docs/release/src/osd/winui/dijoystick.cpp b/docs/release/src/osd/winui/dijoystick.cpp
new file mode 100644
index 00000000000..3350ea2f5d4
--- /dev/null
+++ b/docs/release/src/osd/winui/dijoystick.cpp
@@ -0,0 +1,758 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ dijoystick.cpp
+
+ ***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+
+// standard C headers
+#include <tchar.h>
+
+// MAMEUI headers
+#include "winui.h"
+#include "directinput.h"
+#include "dijoystick.h"
+#include "mui_util.h" // For ErrorMsg
+
+/***************************************************************************
+ function prototypes
+ ***************************************************************************/
+
+static int DIJoystick_init(void);
+static void DIJoystick_exit(void);
+static void DIJoystick_poll_joysticks(void);
+static int DIJoystick_is_joy_pressed(int joycode);
+static BOOL DIJoystick_Available(void);
+
+static BOOL CALLBACK DIJoystick_EnumDeviceProc(LPDIDEVICEINSTANCE pdidi, LPVOID pv);
+
+/***************************************************************************
+ External variables
+ ***************************************************************************/
+
+const struct OSDJoystick DIJoystick =
+{
+ DIJoystick_init, /* init */
+ DIJoystick_exit, /* exit */
+ DIJoystick_is_joy_pressed, /* joy_pressed */
+ DIJoystick_poll_joysticks, /* poll_joysticks */
+ DIJoystick_Available, /* Available */
+};
+
+/***************************************************************************
+ Internal structures
+ ***************************************************************************/
+
+#define MAX_PHYSICAL_JOYSTICKS 20
+#define MAX_AXES 20
+
+typedef struct
+{
+ GUID guid;
+ TCHAR *name;
+
+ int offset; /* offset in dijoystate */
+} axis_type;
+
+typedef struct
+{
+ BOOL use_joystick;
+
+ GUID guidDevice;
+ TCHAR *name;
+
+ BOOL is_light_gun;
+
+ LPDIRECTINPUTDEVICE2 did;
+
+ DWORD num_axes;
+ axis_type axes[MAX_AXES];
+
+ DWORD num_pov;
+ DWORD num_buttons;
+
+ DIJOYSTATE dijs;
+
+} joystick_type;
+
+struct tDIJoystick_private
+{
+ int use_count; /* the gui and game can both init/exit us, so keep track */
+ BOOL m_bCoinSlot;
+
+ DWORD num_joysticks;
+ joystick_type joysticks[MAX_PHYSICAL_JOYSTICKS]; /* actual joystick data! */
+};
+
+/* internal functions needing our declarations */
+static BOOL CALLBACK DIJoystick_EnumAxisObjectsProc(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef);
+static BOOL CALLBACK DIJoystick_EnumPOVObjectsProc(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef);
+static BOOL CALLBACK DIJoystick_EnumButtonObjectsProc(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef);
+static void ClearJoyState(DIJOYSTATE *pdijs);
+static void InitJoystick(joystick_type *joystick);
+static void ExitJoystick(joystick_type *joystick);
+const char * DirectXDecodeError(HRESULT errorval);
+
+/***************************************************************************
+ Internal variables
+ ***************************************************************************/
+
+static struct tDIJoystick_private This;
+
+static const GUID guidNULL = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
+
+/***************************************************************************
+ External OSD functions
+ ***************************************************************************/
+/*
+ put here anything you need to do when the program is started. Return 0 if
+ initialization was successful, nonzero otherwise.
+*/
+static int DIJoystick_init(void)
+{
+ This.use_count++;
+ This.num_joysticks = 0;
+
+ LPDIRECTINPUT di = GetDirectInput();
+ if (di == NULL)
+ {
+ ErrorMsg("DirectInput not initialized");
+ return 1;
+ }
+
+ /* enumerate for joystick devices */
+ HRESULT hr = IDirectInput_EnumDevices(di, DIDEVTYPE_JOYSTICK, (LPDIENUMDEVICESCALLBACK)DIJoystick_EnumDeviceProc, NULL, DIEDFL_ATTACHEDONLY );
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInput EnumDevices() failed: %s", DirectXDecodeError(hr));
+ return 0;
+ }
+
+ /* create each joystick device, enumerate each joystick for axes, etc */
+ for (DWORD i = 0; i < This.num_joysticks; i++)
+ InitJoystick(&This.joysticks[i]);
+
+ /* Are there any joysticks attached? */
+ if (This.num_joysticks < 1)
+ /*ErrorMsg("DirectInput EnumDevices didn't find any joysticks");*/
+ return 1;
+
+ return 0;
+}
+
+/*
+ put here cleanup routines to be executed when the program is terminated.
+*/
+static void DIJoystick_exit(void)
+{
+ This.use_count--;
+ if (This.use_count > 0)
+ return;
+
+ for (DWORD i = 0; i < This.num_joysticks; i++)
+ ExitJoystick(&This.joysticks[i]);
+
+ This.num_joysticks = 0;
+}
+
+static void DIJoystick_poll_joysticks(void)
+{
+ HRESULT hr;
+ This.m_bCoinSlot = 0;
+
+ for (DWORD i = 0; i < This.num_joysticks; i++)
+ {
+ /* start by clearing the structure, then fill it in if possible */
+
+ ClearJoyState(&This.joysticks[i].dijs);
+
+ if (This.joysticks[i].did == NULL)
+ continue;
+
+ if (This.joysticks[i].use_joystick == FALSE)
+ continue;
+
+ hr = IDirectInputDevice2_Poll(This.joysticks[i].did);
+
+ hr = IDirectInputDevice2_GetDeviceState(This.joysticks[i].did,sizeof(DIJOYSTATE), &This.joysticks[i].dijs);
+ if (FAILED(hr))
+ {
+ if (hr == DIERR_INPUTLOST || hr == DIERR_NOTACQUIRED)
+ hr = IDirectInputDevice2_Acquire(This.joysticks[i].did);
+
+ continue;
+ }
+ }
+}
+
+/*
+ check if the DIJoystick is moved in the specified direction, defined in
+ osdepend.h. Return 0 if it is not pressed, nonzero otherwise.
+*/
+
+static int DIJoystick_is_joy_pressed(int joycode)
+{
+ int axis = 0;
+ int dir = 0;
+ int value = 0;
+ int dz = 60;
+ int joy_num = GET_JOYCODE_JOY(joycode);
+
+ /* do we have as many sticks? */
+ if (joy_num == 0 || This.num_joysticks < joy_num)
+ return 0;
+ joy_num--;
+
+ if (This.joysticks[joy_num].use_joystick == FALSE)
+ return 0;
+
+ DIJOYSTATE dijs = This.joysticks[joy_num].dijs;
+
+ int stick = GET_JOYCODE_STICK(joycode);
+
+ if (stick == JOYCODE_STICK_BTN)
+ {
+ /* buttons */
+ int button;
+
+ button = GET_JOYCODE_BUTTON(joycode);
+ button--;
+
+ if (button >= This.joysticks[joy_num].num_buttons
+ || GET_JOYCODE_DIR(joycode) != JOYCODE_DIR_BTN)
+ return 0;
+
+ return dijs.rgbButtons[button] != 0;
+ }
+
+ if (stick == JOYCODE_STICK_POV)
+ {
+ /* POV */
+ int pov_value = 0;
+ int angle = 0;
+ int axis_value = 0;
+
+ int num_pov = GET_JOYCODE_BUTTON(joycode) / 4;
+ int code = GET_JOYCODE_BUTTON(joycode) % 4;
+ axis = code / 2;
+ dir = code % 2;
+
+ if (num_pov >= This.joysticks[joy_num].num_pov)
+ return 0;
+
+ pov_value = dijs.rgdwPOV[num_pov];
+ if (LOWORD(pov_value) == 0xffff)
+ return 0;
+
+ angle = (pov_value + 27000) % 36000;
+ angle = (36000 - angle) % 36000;
+ angle /= 100;
+
+ /* angle is now in degrees counterclockwise from x axis*/
+ if (axis == 1)
+ axis_value = 128 + (int)(127 * cos(2 * M_PI * angle / 360.0)); /* x */
+ else
+ axis_value = 128 + (int)(127 * sin(2 * M_PI * angle / 360.0)); /* y */
+
+ if (dir == 1)
+ return axis_value <= (128 - 128 * dz / 100);
+ else
+ return axis_value >= (128 + 128 * dz / 100);
+ }
+
+ /* sticks */
+
+ axis = GET_JOYCODE_AXIS(joycode);
+ dir = GET_JOYCODE_DIR(joycode);
+
+ if (axis == 0 || This.joysticks[joy_num].num_axes < axis)
+ return 0;
+ axis--;
+
+ value = *(int *)(((byte *)&dijs) + This.joysticks[joy_num].axes[axis].offset);
+
+ if (dir == JOYCODE_DIR_NEG)
+ return value <= (128 - 128 * dz / 100);
+ else
+ return value >= (128 + 128 * dz / 100);
+}
+
+static BOOL DIJoystick_Available(void)
+{
+ static BOOL bBeenHere = false;
+ static BOOL bAvailable = false;
+ LPDIRECTINPUT di = GetDirectInput();
+
+ if (di == NULL)
+ return false;
+
+ if (bBeenHere == false)
+ bBeenHere = true;
+ else
+ return bAvailable;
+
+ /* enumerate for joystick devices */
+ GUID guidDevice = guidNULL;
+ HRESULT hr = IDirectInput_EnumDevices(di, DIDEVTYPE_JOYSTICK, inputEnumDeviceProc, &guidDevice, DIEDFL_ATTACHEDONLY );
+ if (FAILED(hr))
+ {
+ return false;
+ }
+
+ /* Are there any joysticks attached? */
+ if (IsEqualGUID(guidDevice, guidNULL))
+ return false;
+
+ LPDIRECTINPUTDEVICE didTemp;
+ hr = IDirectInput_CreateDevice(di, guidDevice, &didTemp, NULL);
+ if (FAILED(hr))
+ return false;
+
+ /* Determine if DX5 is available by a QI for a DX5 interface. */
+ LPDIRECTINPUTDEVICE didJoystick;
+ hr = IDirectInputDevice_QueryInterface(didTemp, IID_IDirectInputDevice2, (void**)&didJoystick);
+ if (FAILED(hr))
+ bAvailable = false;
+ else
+ {
+ bAvailable = true;
+ IDirectInputDevice_Release(didJoystick);
+ }
+
+ /* dispose of the temp interface */
+ IDirectInputDevice_Release(didTemp);
+
+ return bAvailable;
+}
+
+int DIJoystick_GetNumPhysicalJoysticks()
+{
+ return This.num_joysticks;
+}
+
+TCHAR* DIJoystick_GetPhysicalJoystickName(int num_joystick)
+{
+ return This.joysticks[num_joystick].name;
+}
+
+int DIJoystick_GetNumPhysicalJoystickAxes(int num_joystick)
+{
+ return This.joysticks[num_joystick].num_axes;
+}
+
+TCHAR* DIJoystick_GetPhysicalJoystickAxisName(int num_joystick, int num_axis)
+{
+ return This.joysticks[num_joystick].axes[num_axis].name;
+}
+
+/***************************************************************************
+ Internal functions
+ ***************************************************************************/
+
+BOOL CALLBACK DIJoystick_EnumDeviceProc(LPDIDEVICEINSTANCE pdidi, LPVOID pv)
+{
+ TCHAR buffer[5000];
+
+ This.joysticks[This.num_joysticks].guidDevice = pdidi->guidInstance;
+
+ _stprintf(buffer, TEXT("%s (%s)"), pdidi->tszProductName, pdidi->tszInstanceName);
+ This.joysticks[This.num_joysticks].name = (TCHAR *)malloc((_tcslen(buffer) + 1) * sizeof(TCHAR));
+ _tcscpy(This.joysticks[This.num_joysticks].name, buffer);
+
+ This.num_joysticks++;
+
+ return DIENUM_CONTINUE;
+}
+
+static BOOL CALLBACK DIJoystick_EnumAxisObjectsProc(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
+{
+ joystick_type* joystick = (joystick_type*)pvRef;
+ joystick->axes[joystick->num_axes].guid = lpddoi->guidType;
+ joystick->axes[joystick->num_axes].name = (TCHAR *)malloc((_tcslen(lpddoi->tszName) + 1) * sizeof(TCHAR));
+ _tcscpy(joystick->axes[joystick->num_axes].name, lpddoi->tszName);
+ joystick->axes[joystick->num_axes].offset = lpddoi->dwOfs;
+
+ /*ErrorMsg("got axis %s, offset %i",lpddoi->tszName, lpddoi->dwOfs);*/
+
+ DIPROPRANGE diprg;
+ diprg.diph.dwSize = sizeof(diprg);
+ diprg.diph.dwHeaderSize = sizeof(diprg.diph);
+ diprg.diph.dwObj = lpddoi->dwOfs;
+ diprg.diph.dwHow = DIPH_BYOFFSET;
+ diprg.lMin = 0;
+ diprg.lMax = 255;
+
+ HRESULT hr = IDirectInputDevice2_SetProperty(joystick->did, DIPROP_RANGE, &diprg.diph);
+ if (FAILED(hr)) /* if this fails, don't use this axis */
+ {
+ free(joystick->axes[joystick->num_axes].name);
+ joystick->axes[joystick->num_axes].name = NULL;
+ return DIENUM_CONTINUE;
+ }
+
+#ifdef JOY_DEBUG
+ if (FAILED(hr))
+ ErrorMsg("DirectInput SetProperty() joystick axis %s failed - %s\n", joystick->axes[joystick->num_axes].name, DirectXDecodeError(hr));
+#endif
+
+ /* Set axis dead zone to 0; we need accurate #'s for analog joystick reading. */
+
+ hr = SetDIDwordProperty(joystick->did, DIPROP_DEADZONE, lpddoi->dwOfs, DIPH_BYOFFSET, 0);
+
+#ifdef JOY_DEBUG
+ if (FAILED(hr))
+ ErrorMsg("DirectInput SetProperty() joystick axis %s dead zone failed - %s\n", joystick->axes[joystick->num_axes].name, DirectXDecodeError(hr));
+#endif
+
+ joystick->num_axes++;
+
+ return DIENUM_CONTINUE;
+}
+
+static BOOL CALLBACK DIJoystick_EnumPOVObjectsProc(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
+{
+ joystick_type* joystick = (joystick_type*)pvRef;
+ joystick->num_pov++;
+
+ return DIENUM_CONTINUE;
+}
+
+static BOOL CALLBACK DIJoystick_EnumButtonObjectsProc(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
+{
+ joystick_type* joystick = (joystick_type*)pvRef;
+ joystick->num_buttons++;
+
+ return DIENUM_CONTINUE;
+}
+
+static void ClearJoyState(DIJOYSTATE *pdijs)
+{
+ memset(pdijs, 0, sizeof(DIJOYSTATE));
+ pdijs->lX = 128;
+ pdijs->lY = 128;
+ pdijs->lZ = 128;
+ pdijs->lRx = 128;
+ pdijs->lRy = 128;
+ pdijs->lRz = 128;
+ pdijs->rglSlider[0] = 128;
+ pdijs->rglSlider[1] = 128;
+ pdijs->rgdwPOV[0] = -1;
+ pdijs->rgdwPOV[1] = -1;
+ pdijs->rgdwPOV[2] = -1;
+ pdijs->rgdwPOV[3] = -1;
+}
+
+static void InitJoystick(joystick_type *joystick)
+{
+ joystick->use_joystick = false;
+ joystick->did = NULL;
+ joystick->num_axes = 0;
+ joystick->is_light_gun = (_tcscmp(joystick->name, TEXT("ACT LABS GS (ACT LABS GS)")) == 0);
+
+ /* get a did1 interface first... */
+ LPDIRECTINPUT di = GetDirectInput();
+ LPDIRECTINPUTDEVICE didTemp;
+ HRESULT hr = IDirectInput_CreateDevice(di, joystick->guidDevice, &didTemp, NULL);
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInput CreateDevice() joystick failed: %s\n", DirectXDecodeError(hr));
+ return;
+ }
+
+ /* get a did2 interface to work with polling (most) joysticks */
+ hr = IDirectInputDevice_QueryInterface(didTemp, IID_IDirectInputDevice2, (void**)&joystick->did);
+
+ /* dispose of the temp interface */
+ IDirectInputDevice_Release(didTemp);
+
+ /* check result of getting the did2 */
+ if (FAILED(hr))
+ {
+ /* no error message because this happens in dx3 */
+ /* ErrorMsg("DirectInput QueryInterface joystick failed\n"); */
+ joystick->did = NULL;
+ return;
+ }
+
+
+ hr = IDirectInputDevice2_SetCooperativeLevel(joystick->did, GetMainWindow(), DISCL_NONEXCLUSIVE | DISCL_BACKGROUND);
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInput SetCooperativeLevel() joystick failed: %s\n", DirectXDecodeError(hr));
+ return;
+ }
+
+
+ hr = IDirectInputDevice2_SetDataFormat(joystick->did, &c_dfDIJoystick);
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInput SetDataFormat() joystick failed: %s\n", DirectXDecodeError(hr));
+ return;
+ }
+
+ if (joystick->is_light_gun)
+ {
+ /* setup light gun to report raw screen pixel data */
+
+ DIPROPDWORD diprop;
+ memset(&diprop, 0, sizeof(diprop));
+ diprop.diph.dwSize = sizeof(DIPROPDWORD);
+ diprop.diph.dwHeaderSize = sizeof(DIPROPHEADER);
+ diprop.diph.dwObj = 0;
+ diprop.diph.dwHow = DIPH_DEVICE;
+ diprop.dwData = DIPROPCALIBRATIONMODE_RAW;
+
+ IDirectInputDevice2_SetProperty(joystick->did, DIPROP_CALIBRATIONMODE, &diprop.diph);
+ }
+ else
+ {
+ /* enumerate our axes */
+ hr = IDirectInputDevice_EnumObjects(joystick->did, DIJoystick_EnumAxisObjectsProc, joystick, DIDFT_AXIS);
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInput EnumObjects() Axes failed: %s\n", DirectXDecodeError(hr));
+ return;
+ }
+
+ /* enumerate our POV hats */
+ joystick->num_pov = 0;
+ hr = IDirectInputDevice_EnumObjects(joystick->did, DIJoystick_EnumPOVObjectsProc, joystick, DIDFT_POV);
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInput EnumObjects() POVs failed: %s\n", DirectXDecodeError(hr));
+ return;
+ }
+ }
+
+ /* enumerate our buttons */
+
+ joystick->num_buttons = 0;
+ hr = IDirectInputDevice_EnumObjects(joystick->did, DIJoystick_EnumButtonObjectsProc, joystick, DIDFT_BUTTON);
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInput EnumObjects() Buttons failed: %s\n", DirectXDecodeError(hr));
+ return;
+ }
+
+ hr = IDirectInputDevice2_Acquire(joystick->did);
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInputDevice Acquire joystick failed!\n");
+ return;
+ }
+
+ /* start by clearing the structures */
+
+ ClearJoyState(&joystick->dijs);
+
+ joystick->use_joystick = TRUE;
+}
+
+static void ExitJoystick(joystick_type *joystick)
+{
+ if (joystick->did)
+ {
+ IDirectInputDevice_Unacquire(joystick->did);
+ IDirectInputDevice_Release(joystick->did);
+ joystick->did = NULL;
+ }
+
+ for (DWORD i = 0; i < joystick->num_axes; i++)
+ {
+ if (joystick->axes[i].name)
+ free(joystick->axes[i].name);
+ joystick->axes[i].name = NULL;
+ }
+
+ if (joystick->name)
+ {
+ free(joystick->name);
+ joystick->name = NULL;
+ }
+}
+
+/***************************************************************************
+ DXdecode stuff
+ ***************************************************************************/
+
+typedef struct tagERRORCODE
+{
+ HRESULT hr;
+ const char *szError;
+} ERRORCODE, * LPERRORCODE;
+
+#include <ddraw.h>
+static const ERRORCODE g_ErrorCode[] =
+{
+ { DDERR_ALREADYINITIALIZED, "DDERR_ALREADYINITIALIZED"},
+ { DDERR_CANNOTATTACHSURFACE, "DDERR_CANNOTATTACHSURFACE"},
+ { DDERR_CANNOTDETACHSURFACE, "DDERR_CANNOTDETACHSURFACE"},
+ { DDERR_CURRENTLYNOTAVAIL, "DDERR_CURRENTLYNOTAVAIL"},
+ { DDERR_EXCEPTION, "DDERR_EXCEPTION"},
+ { DDERR_GENERIC, "DDERR_GENERIC"},
+ { DDERR_HEIGHTALIGN, "DDERR_HEIGHTALIGN"},
+ { DDERR_INCOMPATIBLEPRIMARY, "DDERR_INCOMPATIBLEPRIMARY"},
+ { DDERR_INVALIDCAPS, "DDERR_INVALIDCAPS"},
+ { DDERR_INVALIDCLIPLIST, "DDERR_INVALIDCLIPLIST"},
+ { DDERR_INVALIDMODE, "DDERR_INVALIDMODE"},
+ { DDERR_INVALIDOBJECT, "DDERR_INVALIDOBJECT"},
+ { DDERR_INVALIDPARAMS, "DDERR_INVALIDPARAMS"},
+ { DDERR_INVALIDPIXELFORMAT, "DDERR_INVALIDPIXELFORMAT"},
+ { DDERR_INVALIDRECT, "DDERR_INVALIDRECT"},
+ { DDERR_LOCKEDSURFACES, "DDERR_LOCKEDSURFACES"},
+ { DDERR_NO3D, "DDERR_NO3D"},
+ { DDERR_NOALPHAHW, "DDERR_NOALPHAHW"},
+ { DDERR_NOCLIPLIST, "DDERR_NOCLIPLIST"},
+ { DDERR_NOCOLORCONVHW, "DDERR_NOCOLORCONVHW"},
+ { DDERR_NOCOOPERATIVELEVELSET, "DDERR_NOCOOPERATIVELEVELSET"},
+ { DDERR_NOCOLORKEY, "DDERR_NOCOLORKEY"},
+ { DDERR_NOCOLORKEYHW, "DDERR_NOCOLORKEYHW"},
+ { DDERR_NODIRECTDRAWSUPPORT, "DDERR_NODIRECTDRAWSUPPORT"},
+ { DDERR_NOEXCLUSIVEMODE, "DDERR_NOEXCLUSIVEMODE"},
+ { DDERR_NOFLIPHW, "DDERR_NOFLIPHW"},
+ { DDERR_NOGDI, "DDERR_NOGDI"},
+ { DDERR_NOMIRRORHW, "DDERR_NOMIRRORHW"},
+ { DDERR_NOTFOUND, "DDERR_NOTFOUND"},
+ { DDERR_NOOVERLAYHW, "DDERR_NOOVERLAYHW"},
+ { DDERR_NORASTEROPHW, "DDERR_NORASTEROPHW"},
+ { DDERR_NOROTATIONHW, "DDERR_NOROTATIONHW"},
+ { DDERR_NOSTRETCHHW, "DDERR_NOSTRETCHHW"},
+ { DDERR_NOT4BITCOLOR, "DDERR_NOT4BITCOLOR"},
+ { DDERR_NOT4BITCOLORINDEX, "DDERR_NOT4BITCOLORINDEX"},
+ { DDERR_NOT8BITCOLOR, "DDERR_NOT8BITCOLOR"},
+ { DDERR_NOTEXTUREHW, "DDERR_NOTEXTUREHW"},
+ { DDERR_NOVSYNCHW, "DDERR_NOVSYNCHW"},
+ { DDERR_NOZBUFFERHW, "DDERR_NOZBUFFERHW"},
+ { DDERR_NOZOVERLAYHW, "DDERR_NOZOVERLAYHW"},
+ { DDERR_OUTOFCAPS, "DDERR_OUTOFCAPS"},
+ { DDERR_OUTOFMEMORY, "DDERR_OUTOFMEMORY"},
+ { DDERR_OUTOFVIDEOMEMORY, "DDERR_OUTOFVIDEOMEMORY"},
+ { DDERR_OVERLAYCANTCLIP, "DDERR_OVERLAYCANTCLIP"},
+ { DDERR_OVERLAYCOLORKEYONLYONEACTIVE, "DDERR_OVERLAYCOLORKEYONLYONEACTIVE"},
+ { DDERR_PALETTEBUSY, "DDERR_PALETTEBUSY"},
+ { DDERR_COLORKEYNOTSET, "DDERR_COLORKEYNOTSET"},
+ { DDERR_SURFACEALREADYATTACHED, "DDERR_SURFACEALREADYATTACHED"},
+ { DDERR_SURFACEALREADYDEPENDENT, "DDERR_SURFACEALREADYDEPENDENT"},
+ { DDERR_SURFACEBUSY, "DDERR_SURFACEBUSY"},
+ { DDERR_CANTLOCKSURFACE, "DDERR_CANTLOCKSURFACE"},
+ { DDERR_SURFACEISOBSCURED, "DDERR_SURFACEISOBSCURED"},
+ { DDERR_SURFACELOST, "DDERR_SURFACELOST"},
+ { DDERR_SURFACENOTATTACHED, "DDERR_SURFACENOTATTACHED"},
+ { DDERR_TOOBIGHEIGHT, "DDERR_TOOBIGHEIGHT"},
+ { DDERR_TOOBIGSIZE, "DDERR_TOOBIGSIZE"},
+ { DDERR_TOOBIGWIDTH, "DDERR_TOOBIGWIDTH"},
+ { DDERR_UNSUPPORTED, "DDERR_UNSUPPORTED"},
+ { DDERR_UNSUPPORTEDFORMAT, "DDERR_UNSUPPORTEDFORMAT"},
+ { DDERR_UNSUPPORTEDMASK, "DDERR_UNSUPPORTEDMASK"},
+ { DDERR_VERTICALBLANKINPROGRESS, "DDERR_VERTICALBLANKINPROGRESS"},
+ { DDERR_WASSTILLDRAWING, "DDERR_WASSTILLDRAWING"},
+ { DDERR_XALIGN, "DDERR_XALIGN"},
+ { DDERR_INVALIDDIRECTDRAWGUID, "DDERR_INVALIDDIRECTDRAWGUID"},
+ { DDERR_DIRECTDRAWALREADYCREATED, "DDERR_DIRECTDRAWALREADYCREATED"},
+ { DDERR_NODIRECTDRAWHW, "DDERR_NODIRECTDRAWHW"},
+ { DDERR_PRIMARYSURFACEALREADYEXISTS, "DDERR_PRIMARYSURFACEALREADYEXISTS"},
+ { DDERR_NOEMULATION, "DDERR_NOEMULATION"},
+ { DDERR_REGIONTOOSMALL, "DDERR_REGIONTOOSMALL"},
+ { DDERR_CLIPPERISUSINGHWND, "DDERR_CLIPPERISUSINGHWND"},
+ { DDERR_NOCLIPPERATTACHED, "DDERR_NOCLIPPERATTACHED"},
+ { DDERR_NOHWND, "DDERR_NOHWND"},
+ { DDERR_HWNDSUBCLASSED, "DDERR_HWNDSUBCLASSED"},
+ { DDERR_HWNDALREADYSET, "DDERR_HWNDALREADYSET"},
+ { DDERR_NOPALETTEATTACHED, "DDERR_NOPALETTEATTACHED"},
+ { DDERR_NOPALETTEHW, "DDERR_NOPALETTEHW"},
+ { DDERR_BLTFASTCANTCLIP, "DDERR_BLTFASTCANTCLIP"},
+ { DDERR_NOBLTHW, "DDERR_NOBLTHW"},
+ { DDERR_NODDROPSHW, "DDERR_NODDROPSHW"},
+ { DDERR_OVERLAYNOTVISIBLE, "DDERR_OVERLAYNOTVISIBLE"},
+ { DDERR_NOOVERLAYDEST, "DDERR_NOOVERLAYDEST"},
+ { DDERR_INVALIDPOSITION, "DDERR_INVALIDPOSITION"},
+ { DDERR_NOTAOVERLAYSURFACE, "DDERR_NOTAOVERLAYSURFACE"},
+ { DDERR_EXCLUSIVEMODEALREADYSET, "DDERR_EXCLUSIVEMODEALREADYSET"},
+ { DDERR_NOTFLIPPABLE, "DDERR_NOTFLIPPABLE"},
+ { DDERR_CANTDUPLICATE, "DDERR_CANTDUPLICATE"},
+ { DDERR_NOTLOCKED, "DDERR_NOTLOCKED"},
+ { DDERR_CANTCREATEDC, "DDERR_CANTCREATEDC"},
+ { DDERR_NODC, "DDERR_NODC"},
+ { DDERR_WRONGMODE, "DDERR_WRONGMODE"},
+ { DDERR_IMPLICITLYCREATED, "DDERR_IMPLICITLYCREATED"},
+ { DDERR_NOTPALETTIZED, "DDERR_NOTPALETTIZED"},
+ { DDERR_UNSUPPORTEDMODE, "DDERR_UNSUPPORTEDMODE"},
+ { DDERR_NOMIPMAPHW, "DDERR_NOMIPMAPHW"},
+ { DDERR_INVALIDSURFACETYPE, "DDERR_INVALIDSURFACETYPE"},
+
+ { DDERR_NOOPTIMIZEHW, "DDERR_NOOPTIMIZEHW"},
+ { DDERR_NOTLOADED, "DDERR_NOTLOADED"},
+
+ { DDERR_DCALREADYCREATED, "DDERR_DCALREADYCREATED"},
+
+ { DDERR_NONONLOCALVIDMEM, "DDERR_NONONLOCALVIDMEM"},
+ { DDERR_CANTPAGELOCK, "DDERR_CANTPAGELOCK"},
+ { DDERR_CANTPAGEUNLOCK, "DDERR_CANTPAGEUNLOCK"},
+ { DDERR_NOTPAGELOCKED, "DDERR_NOTPAGELOCKED"},
+
+ { DDERR_MOREDATA, "DDERR_MOREDATA"},
+ { DDERR_VIDEONOTACTIVE, "DDERR_VIDEONOTACTIVE"},
+ { DDERR_DEVICEDOESNTOWNSURFACE, "DDERR_DEVICEDOESNTOWNSURFACE"},
+ { DDERR_NOTINITIALIZED, "DDERR_NOTINITIALIZED"},
+
+ { DIERR_OLDDIRECTINPUTVERSION, "DIERR_OLDDIRECTINPUTVERSION" },
+ { DIERR_BETADIRECTINPUTVERSION, "DIERR_BETADIRECTINPUTVERSION" },
+ { DIERR_BADDRIVERVER, "DIERR_BADDRIVERVER" },
+ { DIERR_DEVICENOTREG, "DIERR_DEVICENOTREG" },
+ { DIERR_NOTFOUND, "DIERR_NOTFOUND" },
+ { DIERR_OBJECTNOTFOUND, "DIERR_OBJECTNOTFOUND" },
+ { DIERR_INVALIDPARAM, "DIERR_INVALIDPARAM" },
+ { DIERR_NOINTERFACE, "DIERR_NOINTERFACE" },
+ { DIERR_GENERIC, "DIERR_GENERIC" },
+ { DIERR_OUTOFMEMORY, "DIERR_OUTOFMEMORY" },
+ { DIERR_UNSUPPORTED, "DIERR_UNSUPPORTED" },
+ { DIERR_NOTINITIALIZED, "DIERR_NOTINITIALIZED" },
+ { DIERR_ALREADYINITIALIZED, "DIERR_ALREADYINITIALIZED" },
+ { DIERR_NOAGGREGATION, "DIERR_NOAGGREGATION" },
+ { DIERR_OTHERAPPHASPRIO, "DIERR_OTHERAPPHASPRIO" },
+ { DIERR_INPUTLOST, "DIERR_INPUTLOST" },
+ { DIERR_ACQUIRED, "DIERR_ACQUIRED" },
+ { DIERR_NOTACQUIRED, "DIERR_NOTACQUIRED" },
+ { DIERR_READONLY, "DIERR_READONLY" },
+ { DIERR_HANDLEEXISTS, "DIERR_HANDLEEXISTS" },
+ { E_PENDING, "E_PENDING" },
+ { (HRESULT)DIERR_INSUFFICIENTPRIVS, "DIERR_INSUFFICIENTPRIVS" },
+ { (HRESULT)DIERR_DEVICEFULL, "DIERR_DEVICEFULL" },
+ { (HRESULT)DIERR_MOREDATA, "DIERR_MOREDATA" },
+ { (HRESULT)DIERR_NOTDOWNLOADED, "DIERR_NOTDOWNLOADED" },
+ { (HRESULT)DIERR_HASEFFECTS, "DIERR_HASEFFECTS" },
+ { (HRESULT)DIERR_NOTEXCLUSIVEACQUIRED,"DIERR_NOTEXCLUSIVEACQUIRED" },
+ { (HRESULT)DIERR_INCOMPLETEEFFECT, "DIERR_INCOMPLETEEFFECT" },
+ { (HRESULT)DIERR_NOTBUFFERED, "DIERR_NOTBUFFERED" },
+ { (HRESULT)DIERR_EFFECTPLAYING, "DIERR_EFFECTPLAYING" },
+ //{ (HRESULT)DIERR_UNPLUGGED, "DIERR_UNPLUGGED" },
+
+ { E_NOINTERFACE, "E_NOINTERFACE" }
+
+};
+
+
+/****************************************************************************
+ DirectXDecodeError: Return a string description of the given DirectX
+ error code.
+*****************************************************************************/
+const char * DirectXDecodeError(HRESULT errorval)
+{
+ for (int i = 0; i < (sizeof(g_ErrorCode) / sizeof(g_ErrorCode[0])); i++)
+ {
+ if (g_ErrorCode[i].hr == errorval)
+ {
+ return g_ErrorCode[i].szError;
+ }
+ }
+ static char tmp[64];
+ sprintf(tmp, "UNKNOWN: 0x%x", (unsigned int)errorval);
+ return tmp;
+}
+
diff --git a/docs/release/src/osd/winui/dijoystick.h b/docs/release/src/osd/winui/dijoystick.h
new file mode 100644
index 00000000000..560b5b8fb20
--- /dev/null
+++ b/docs/release/src/osd/winui/dijoystick.h
@@ -0,0 +1,63 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef DIJOYSTICK_H
+#define DIJOYSTICK_H
+
+/*
+ limits:
+ - 7 joysticks
+ - 15 sticks on each joystick (15?)
+ - 63 buttons on each joystick
+
+ - 256 total inputs
+
+
+ 1 1 1 1 1 1
+ 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+ +---+-----------+---------+-----+
+ |Dir|Axis/Button| Stick | Joy |
+ +---+-----------+---------+-----+
+
+ Stick: 0 for buttons 1 for axis
+ Joy: 1 for Mouse/track buttons
+
+*/
+#define JOYCODE(joy, stick, axis_or_button, dir) \
+ ((((dir) & 0x03) << 14) | \
+ (((axis_or_button) & 0x3f) << 8) | \
+ (((stick) & 0x1f) << 3) | \
+ (((joy) & 0x07) << 0))
+
+#define GET_JOYCODE_JOY(code) (((code) >> 0) & 0x07)
+#define GET_JOYCODE_STICK(code) (((code) >> 3) & 0x1f)
+#define GET_JOYCODE_AXIS(code) (((code) >> 8) & 0x3f)
+#define GET_JOYCODE_BUTTON(code) GET_JOYCODE_AXIS(code)
+#define GET_JOYCODE_DIR(code) (((code) >>14) & 0x03)
+
+#define JOYCODE_STICK_BTN 0
+#define JOYCODE_STICK_AXIS 1
+#define JOYCODE_STICK_POV 2
+
+#define JOYCODE_DIR_BTN 0
+#define JOYCODE_DIR_NEG 1
+#define JOYCODE_DIR_POS 2
+
+struct OSDJoystick
+{
+ int (*init)(void);
+ void (*exit)(void);
+ int (*is_joy_pressed)(int joycode);
+ void (*poll_joysticks)(void);
+ BOOL (*Available)(void);
+};
+
+extern const struct OSDJoystick DIJoystick;
+
+extern int DIJoystick_GetNumPhysicalJoysticks(void);
+extern TCHAR* DIJoystick_GetPhysicalJoystickName(int num_joystick);
+
+extern int DIJoystick_GetNumPhysicalJoystickAxes(int num_joystick);
+extern TCHAR* DIJoystick_GetPhysicalJoystickAxisName(int num_joystick, int num_axis);
+
+#endif
diff --git a/docs/release/src/osd/winui/directinput.cpp b/docs/release/src/osd/winui/directinput.cpp
new file mode 100644
index 00000000000..33977913b14
--- /dev/null
+++ b/docs/release/src/osd/winui/directinput.cpp
@@ -0,0 +1,143 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ directinput.cpp
+
+ Direct Input routines.
+
+ ***************************************************************************/
+// standard windows headers
+#include <windows.h>
+
+// MAME/MAMEUI headers
+#include "mui_util.h" // For ErrorMsg
+#include "directinput.h"
+
+/***************************************************************************
+ function prototypes
+ ***************************************************************************/
+
+/***************************************************************************
+ External variables
+ ***************************************************************************/
+
+/***************************************************************************
+ Internal structures
+ ***************************************************************************/
+
+/***************************************************************************
+ Internal variables
+ ***************************************************************************/
+
+static LPDIRECTINPUT di = NULL;
+
+static HANDLE hDLL = NULL;
+
+/***************************************************************************
+ External functions
+ ***************************************************************************/
+
+/****************************************************************************
+ * DirectInputInitialize
+ *
+ * Initialize the DirectInput variables.
+ *
+ * This entails the following functions:
+ *
+ * DirectInputCreate
+ *
+ ****************************************************************************/
+
+typedef HRESULT (WINAPI *dic_proc)(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUT *ppDI, LPUNKNOWN punkOuter);
+
+BOOL DirectInputInitialize()
+{
+ if (hDLL)
+ return TRUE;
+
+ /* Turn off error dialog for this call */
+ UINT error_mode = SetErrorMode(0);
+ hDLL = LoadLibrary(TEXT("dinput.dll"));
+ SetErrorMode(error_mode);
+
+ if (hDLL == NULL)
+ return FALSE;
+
+ dic_proc dic;
+#ifdef UNICODE
+ dic = (dic_proc)GetProcAddress((HINSTANCE)hDLL, "DirectInputCreateW");
+#else
+ dic = (dic_proc)GetProcAddress((HINSTANCE)hDLL, "DirectInputCreateA");
+#endif
+ if (dic == NULL)
+ return false;
+
+ HRESULT hr = dic(GetModuleHandle(NULL), 0x0700, &di, NULL); // setup DIRECT INPUT 7 for the GUI
+
+ if (FAILED(hr))
+ {
+ hr = dic(GetModuleHandle(NULL), 0x0500, &di, NULL); // if failed, try with version 5
+
+ if (FAILED(hr))
+ {
+ ErrorMsg("DirectInputCreate failed! error=%x\n", (unsigned int)hr);
+ di = NULL;
+ return false;
+ }
+ }
+ return true;
+}
+
+/****************************************************************************
+ *
+ * DirectInputClose
+ *
+ * Terminate our usage of DirectInput.
+ *
+ ****************************************************************************/
+
+void DirectInputClose()
+{
+ /* Release any lingering IDirectInput object. */
+ if (di)
+ {
+ IDirectInput_Release(di);
+ di = NULL;
+ }
+}
+
+BOOL CALLBACK inputEnumDeviceProc(LPCDIDEVICEINSTANCE pdidi, LPVOID pv)
+{
+ GUID *pguidDevice;
+
+ /* report back the instance guid of the device we enumerated */
+ if (pv)
+ {
+ pguidDevice = (GUID *)pv;
+ *pguidDevice = pdidi->guidInstance;
+ }
+
+ /* BUGBUG for now, stop after the first device has been found */
+ return DIENUM_STOP;
+}
+
+HRESULT SetDIDwordProperty(LPDIRECTINPUTDEVICE2 pdev, REFGUID guidProperty, DWORD dwObject, DWORD dwHow, DWORD dwValue)
+{
+ DIPROPDWORD dipdw;
+
+ dipdw.diph.dwSize = sizeof(dipdw);
+ dipdw.diph.dwHeaderSize = sizeof(dipdw.diph);
+ dipdw.diph.dwObj = dwObject;
+ dipdw.diph.dwHow = dwHow;
+ dipdw.dwData = dwValue;
+
+ return IDirectInputDevice2_SetProperty(pdev, guidProperty, &dipdw.diph);
+}
+
+LPDIRECTINPUT GetDirectInput(void)
+{
+ return di;
+}
diff --git a/docs/release/src/osd/winui/directinput.h b/docs/release/src/osd/winui/directinput.h
new file mode 100644
index 00000000000..7af72dab981
--- /dev/null
+++ b/docs/release/src/osd/winui/directinput.h
@@ -0,0 +1,23 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef DIRECTINPUT_H
+#define DIRECTINPUT_H
+
+#undef WINNT
+#ifdef DIRECTINPUT_VERSION
+#undef DIRECTINPUT_VERSION
+#endif
+#define DIRECTINPUT_VERSION 0x0700
+#include <dinput.h>
+
+extern BOOL DirectInputInitialize(void);
+extern void DirectInputClose(void);
+
+extern BOOL CALLBACK inputEnumDeviceProc(LPCDIDEVICEINSTANCE pdidi, LPVOID pv);
+
+extern HRESULT SetDIDwordProperty(LPDIRECTINPUTDEVICE2 pdev, REFGUID guidProperty, DWORD dwObject, DWORD dwHow, DWORD dwValue);
+
+LPDIRECTINPUT GetDirectInput(void);
+
+#endif
diff --git a/docs/release/src/osd/winui/directories.cpp b/docs/release/src/osd/winui/directories.cpp
new file mode 100644
index 00000000000..034ed91f2fa
--- /dev/null
+++ b/docs/release/src/osd/winui/directories.cpp
@@ -0,0 +1,703 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ directories.c
+
+***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+
+// standard C headers
+#include <sys/stat.h> // S_IFDIR
+#include <tchar.h>
+
+// MAME/MAMEUI headers
+#include "directories.h"
+#include "resource.h"
+#include "mui_util.h"
+
+// SHELL DIR header
+#include <shlobj.h>
+
+#define MAX_DIRS 256
+
+/***************************************************************************
+ Internal structures
+ ***************************************************************************/
+
+typedef struct
+{
+ TCHAR m_Directories[MAX_DIRS][MAX_PATH];
+ int m_NumDirectories;
+ BOOL m_bModified;
+} tPath;
+
+typedef struct
+{
+ tPath *m_Path;
+ TCHAR *m_tDirectory;
+} tDirInfo;
+
+/***************************************************************************
+ Function prototypes
+ ***************************************************************************/
+
+static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
+BOOL BrowseForDirectory(HWND hwnd, LPCTSTR pStartDir, TCHAR* pResult);
+
+static void DirInfo_SetDir(tDirInfo *pInfo, int nType, int nItem, LPCTSTR pText);
+static TCHAR* DirInfo_Dir(tDirInfo *pInfo, int nType);
+static TCHAR* DirInfo_Path(tDirInfo *pInfo, int nType, int nItem);
+static void DirInfo_SetModified(tDirInfo *pInfo, int nType, BOOL bModified);
+static BOOL DirInfo_Modified(tDirInfo *pInfo, int nType);
+static TCHAR* FixSlash(TCHAR *s);
+
+static void UpdateDirectoryList(HWND hDlg);
+
+static void Directories_OnSelChange(HWND hDlg);
+static BOOL Directories_OnInitDialog(HWND hDlg, HWND hwndFocus, LPARAM lParam);
+static void Directories_OnDestroy(HWND hDlg);
+static void Directories_OnClose(HWND hDlg);
+static void Directories_OnOk(HWND hDlg);
+static void Directories_OnCancel(HWND hDlg);
+static void Directories_OnInsert(HWND hDlg);
+static void Directories_OnBrowse(HWND hDlg);
+static void Directories_OnDelete(HWND hDlg);
+static BOOL Directories_OnBeginLabelEdit(HWND hDlg, NMHDR* pNMHDR);
+static BOOL Directories_OnEndLabelEdit(HWND hDlg, NMHDR* pNMHDR);
+static void Directories_OnCommand(HWND hDlg, int id, HWND hwndCtl, UINT codeNotify);
+static BOOL Directories_OnNotify(HWND hDlg, int id, NMHDR* pNMHDR);
+
+/***************************************************************************
+ External variables
+ ***************************************************************************/
+
+/***************************************************************************
+ Internal variables
+ ***************************************************************************/
+
+static tDirInfo *g_pDirInfo;
+
+/***************************************************************************
+ External function definitions
+ ***************************************************************************/
+
+INT_PTR CALLBACK DirectoriesDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ BOOL bReturn = false;
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ return (BOOL)HANDLE_WM_INITDIALOG(hDlg, wParam, lParam, Directories_OnInitDialog);
+
+ case WM_COMMAND:
+ HANDLE_WM_COMMAND(hDlg, wParam, lParam, Directories_OnCommand);
+ bReturn = true;
+ break;
+
+ case WM_NOTIFY:
+ return (BOOL)HANDLE_WM_NOTIFY(hDlg, wParam, lParam, Directories_OnNotify);
+
+ case WM_CLOSE:
+ HANDLE_WM_CLOSE(hDlg, wParam, lParam, Directories_OnClose);
+ break;
+
+ case WM_DESTROY:
+ HANDLE_WM_DESTROY(hDlg, wParam, lParam, Directories_OnDestroy);
+ break;
+
+ default:
+ break;
+ }
+ return bReturn;
+}
+
+/***************************************************************************
+ Internal function definitions
+ ***************************************************************************/
+
+static BOOL IsMultiDir(int nType)
+{
+ return g_directoryInfo[nType].bMulti;
+}
+
+static void DirInfo_SetDir(tDirInfo *pInfo, int nType, int nItem, LPCTSTR pText)
+{
+ TCHAR *t_s;
+ TCHAR *t_pOldText;
+
+ if (IsMultiDir(nType))
+ {
+ assert(nItem >= 0);
+ _tcscpy(DirInfo_Path(pInfo, nType, nItem), pText);
+ DirInfo_SetModified(pInfo, nType, TRUE);
+ }
+ else
+ {
+ t_s = win_tstring_strdup(pText);
+ if (!t_s)
+ return;
+ t_pOldText = pInfo[nType].m_tDirectory;
+ if (t_pOldText)
+ free(t_pOldText);
+ pInfo[nType].m_tDirectory = t_s; // don't free t_s else directory name is corrupted
+ }
+}
+
+static TCHAR* DirInfo_Dir(tDirInfo *pInfo, int nType)
+{
+ // if a multipath exists in a single-path-only area then truncate it
+ return _tcstok(pInfo[nType].m_tDirectory, TEXT(";"));
+}
+
+static TCHAR* DirInfo_Path(tDirInfo *pInfo, int nType, int nItem)
+{
+ return pInfo[nType].m_Path->m_Directories[nItem];
+}
+
+static void DirInfo_SetModified(tDirInfo *pInfo, int nType, BOOL bModified)
+{
+ //assert(IsMultiDir(nType));
+ pInfo[nType].m_Path->m_bModified = bModified;
+}
+
+static BOOL DirInfo_Modified(tDirInfo *pInfo, int nType)
+{
+ //assert(IsMultiDir(nType));
+ return pInfo[nType].m_Path->m_bModified;
+}
+
+#define DirInfo_NumDir(pInfo, path) \
+ ((pInfo)[(path)].m_Path->m_NumDirectories)
+
+/* lop off trailing backslash if it exists */
+static TCHAR * FixSlash(TCHAR *s)
+{
+ int len = 0;
+
+ if (s)
+ len = _tcslen(s);
+
+ if (len>3 && s[len - 1] == '\\')
+ s[len - 1] = '\0';
+
+ return s;
+}
+
+static void UpdateDirectoryList(HWND hDlg)
+{
+ HWND hList = GetDlgItem(hDlg, IDC_DIR_LIST);
+ HWND hCombo = GetDlgItem(hDlg, IDC_DIR_COMBO);
+
+ /* Remove previous */
+ BOOL b_res = ListView_DeleteAllItems(hList);
+
+ /* Update list */
+ LV_ITEM Item;
+ memset(&Item, 0, sizeof(LV_ITEM));
+ Item.mask = LVIF_TEXT;
+
+ int nType = ComboBox_GetCurSel(hCombo);
+ if (IsMultiDir(nType))
+ {
+ Item.pszText = (TCHAR*) TEXT(DIRLIST_NEWENTRYTEXT); // puts the < > empty entry in
+ (void)ListView_InsertItem(hList, &Item);
+ int t = DirInfo_NumDir(g_pDirInfo, nType);
+ // directories are inserted in reverse order
+ for (int i = t; 0 < i; i--)
+ {
+ Item.pszText = DirInfo_Path(g_pDirInfo, nType, i-1);
+ (void)ListView_InsertItem(hList, &Item);
+ }
+ }
+ else
+ {
+ Item.pszText = DirInfo_Dir(g_pDirInfo, nType);
+ (void)ListView_InsertItem(hList, &Item);
+ }
+
+ /* select first one */
+
+ ListView_SetItemState(hList, 0, LVIS_SELECTED, LVIS_SELECTED);
+ b_res++;
+}
+
+static void Directories_OnSelChange(HWND hDlg)
+{
+ UpdateDirectoryList(hDlg);
+
+ HWND hCombo = GetDlgItem(hDlg, IDC_DIR_COMBO);
+ int nType = ComboBox_GetCurSel(hCombo);
+ if (IsMultiDir(nType))
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_DIR_DELETE), TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_DIR_INSERT), TRUE);
+ }
+ else
+ {
+ EnableWindow(GetDlgItem(hDlg, IDC_DIR_DELETE), FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_DIR_INSERT), FALSE);
+ }
+}
+
+static BOOL Directories_OnInitDialog(HWND hDlg, HWND hwndFocus, LPARAM lParam)
+{
+ RECT rectClient;
+ LVCOLUMN LVCol;
+ int i = 0;
+ std::string s;
+ TCHAR *token;
+ TCHAR buf[MAX_PATH * MAX_DIRS];
+ TCHAR* t_s = NULL;
+ HRESULT res = 0;
+
+ /* count how many dirinfos there are */
+ int nDirInfoCount = 0;
+ while(g_directoryInfo[nDirInfoCount].lpName)
+ nDirInfoCount++;
+
+ g_pDirInfo = (tDirInfo *) malloc(sizeof(tDirInfo) * nDirInfoCount);
+ if (!g_pDirInfo) /* bummer */
+ goto error;
+ memset(g_pDirInfo, 0, sizeof(tDirInfo) * nDirInfoCount);
+
+ for (i = nDirInfoCount - 1; i >= 0; i--)
+ {
+ t_s = ui_wstring_from_utf8(g_directoryInfo[i].lpName);
+ if( !t_s )
+ return FALSE;
+ (void)ComboBox_InsertString(GetDlgItem(hDlg, IDC_DIR_COMBO), 0, win_tstring_strdup(t_s));
+ free(t_s);
+ t_s = NULL;
+ }
+
+ (void)ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO), 0);
+
+ GetClientRect(GetDlgItem(hDlg, IDC_DIR_LIST), &rectClient);
+
+ memset(&LVCol, 0, sizeof(LVCOLUMN));
+ LVCol.mask = LVCF_WIDTH;
+ LVCol.cx = rectClient.right - rectClient.left - GetSystemMetrics(SM_CXHSCROLL);
+
+ res = ListView_InsertColumn(GetDlgItem(hDlg, IDC_DIR_LIST), 0, &LVCol);
+ res++;
+
+ /* Keep a temporary copy of the directory strings in g_pDirInfo. */
+ for (i = 0; i < nDirInfoCount; i++)
+ {
+ s = g_directoryInfo[i].pfnGetTheseDirs();
+ t_s = ui_wstring_from_utf8(s.c_str());
+ if( !t_s )
+ return false;
+ /* Copy the string to our own buffer so that we can mutilate it */
+ _tcscpy(buf, t_s);
+
+ if (IsMultiDir(i))
+ {
+ g_pDirInfo[i].m_Path = (tPath*)malloc(sizeof(tPath));
+ if (!g_pDirInfo[i].m_Path)
+ goto error;
+
+ g_pDirInfo[i].m_Path->m_NumDirectories = 0;
+ token = _tcstok(buf, TEXT(";"));
+ while ((DirInfo_NumDir(g_pDirInfo, i) < MAX_DIRS) && token)
+ {
+ _tcscpy(DirInfo_Path(g_pDirInfo, i, DirInfo_NumDir(g_pDirInfo, i)), token);
+ DirInfo_NumDir(g_pDirInfo, i)++;
+ token = _tcstok(NULL, TEXT(";"));
+ }
+ DirInfo_SetModified(g_pDirInfo, i, FALSE);
+ }
+ else
+ {
+ // multi not supported so get first directory only
+ token = _tcstok(buf, TEXT(";"));
+ if (token)
+ DirInfo_SetDir(g_pDirInfo, i, -1, token);
+ else
+ DirInfo_SetDir(g_pDirInfo, i, -1, t_s);
+ }
+ free(t_s);
+ t_s = NULL;
+ }
+
+ UpdateDirectoryList(hDlg);
+ return true;
+
+error:
+ if( t_s )
+ free(t_s);
+ Directories_OnDestroy(hDlg);
+ EndDialog(hDlg, -1);
+ return false;
+}
+
+static void Directories_OnDestroy(HWND hDlg)
+{
+ if (g_pDirInfo)
+ {
+ /* count how many dirinfos there are */
+ int nDirInfoCount = 0;
+ while(g_directoryInfo[nDirInfoCount].lpName)
+ nDirInfoCount++;
+
+ for (int i = 0; i < nDirInfoCount; i++)
+ {
+ if (g_pDirInfo[i].m_Path)
+ free(g_pDirInfo[i].m_Path);
+ if (g_pDirInfo[i].m_tDirectory)
+ free(g_pDirInfo[i].m_tDirectory);
+ }
+ free(g_pDirInfo);
+ g_pDirInfo = NULL;
+ }
+}
+
+static void Directories_OnClose(HWND hDlg)
+{
+ EndDialog(hDlg, IDCANCEL);
+}
+
+static int RetrieveDirList(int nDir, int nFlagResult, void (*SetTheseDirs)(const char *s))
+{
+ int nResult = 0;
+
+ if (DirInfo_Modified(g_pDirInfo, nDir))
+ {
+ TCHAR buf[MAX_PATH * MAX_DIRS];
+ memset(buf, 0, sizeof(buf));
+ int nPaths = DirInfo_NumDir(g_pDirInfo, nDir);
+ for (int i = 0; i < nPaths; i++)
+ {
+ _tcscat(buf, FixSlash(DirInfo_Path(g_pDirInfo, nDir, i)));
+
+ if (i < nPaths - 1)
+ _tcscat(buf, TEXT(";"));
+ }
+ char* utf8_buf = ui_utf8_from_wstring(buf);
+ SetTheseDirs(utf8_buf);
+ free(utf8_buf);
+
+ nResult |= nFlagResult;
+ }
+ return nResult;
+}
+
+static void Directories_OnOk(HWND hDlg)
+{
+ int nResult = 0;
+
+ for (int i = 0; g_directoryInfo[i].lpName; i++)
+ {
+ if (IsMultiDir(i))
+ nResult |= RetrieveDirList(i, g_directoryInfo[i].nDirDlgFlags, g_directoryInfo[i].pfnSetTheseDirs);
+ else
+ {
+ LPTSTR s = FixSlash(DirInfo_Dir(g_pDirInfo, i));
+ char* utf8_s = ui_utf8_from_wstring(s);
+ g_directoryInfo[i].pfnSetTheseDirs(utf8_s);
+ free(utf8_s);
+ }
+ }
+ EndDialog(hDlg, nResult);
+}
+
+static void Directories_OnCancel(HWND hDlg)
+{
+ EndDialog(hDlg, IDCANCEL);
+}
+
+static void Directories_OnInsert(HWND hDlg)
+{
+ HWND hList = GetDlgItem(hDlg, IDC_DIR_LIST);
+ int nItem = ListView_GetNextItem(hList, -1, LVNI_SELECTED);
+
+ TCHAR buf[MAX_PATH];
+ if (BrowseForDirectory(hDlg, NULL, buf) == true)
+ {
+ /* list was empty */
+ if (nItem == -1)
+ nItem = 0;
+
+ int nType = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO));
+ if (IsMultiDir(nType))
+ {
+ if (MAX_DIRS <= DirInfo_NumDir(g_pDirInfo, nType))
+ return;
+
+ for (int i = DirInfo_NumDir(g_pDirInfo, nType); nItem < i; i--)
+ _tcscpy(DirInfo_Path(g_pDirInfo, nType, i), DirInfo_Path(g_pDirInfo, nType, i - 1));
+
+ _tcscpy(DirInfo_Path(g_pDirInfo, nType, nItem), buf);
+ DirInfo_NumDir(g_pDirInfo, nType)++;
+ DirInfo_SetModified(g_pDirInfo, nType, true);
+ }
+
+ UpdateDirectoryList(hDlg);
+
+ ListView_SetItemState(hList, nItem, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ }
+}
+
+static void Directories_OnBrowse(HWND hDlg)
+{
+ HWND hList = GetDlgItem(hDlg, IDC_DIR_LIST);
+ int nItem = ListView_GetNextItem(hList, -1, LVNI_SELECTED);
+
+ if (nItem == -1)
+ return;
+
+ int nType = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO));
+ if (IsMultiDir(nType))
+ {
+ /* Last item is placeholder for append */
+ if (nItem == ListView_GetItemCount(hList) - 1)
+ {
+ Directories_OnInsert(hDlg);
+ return;
+ }
+ }
+
+ TCHAR inbuf[MAX_PATH], outbuf[MAX_PATH];
+ ListView_GetItemText(hList, nItem, 0, inbuf, MAX_PATH);
+
+ if (BrowseForDirectory(hDlg, inbuf, outbuf) == true)
+ {
+ nType = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO));
+ DirInfo_SetDir(g_pDirInfo, nType, nItem, outbuf);
+ UpdateDirectoryList(hDlg);
+ }
+}
+
+static void Directories_OnDelete(HWND hDlg)
+{
+ HWND hList = GetDlgItem(hDlg, IDC_DIR_LIST);
+ int nItem = ListView_GetNextItem(hList, -1, LVNI_SELECTED | LVNI_ALL);
+
+ if (nItem == -1)
+ return;
+
+ /* Don't delete "Append" placeholder. */
+ if (nItem == ListView_GetItemCount(hList) - 1)
+ return;
+
+ int nType = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO));
+ if (IsMultiDir(nType))
+ {
+ for (int i = nItem; i < DirInfo_NumDir(g_pDirInfo, nType) - 1; i++)
+ _tcscpy(DirInfo_Path(g_pDirInfo, nType, i), DirInfo_Path(g_pDirInfo, nType, i + 1));
+
+ _tcscpy(DirInfo_Path(g_pDirInfo, nType, DirInfo_NumDir(g_pDirInfo, nType) - 1), TEXT(""));
+ DirInfo_NumDir(g_pDirInfo, nType)--;
+
+ DirInfo_SetModified(g_pDirInfo, nType, TRUE);
+ }
+
+ UpdateDirectoryList(hDlg);
+
+ int nCount = ListView_GetItemCount(hList);
+ if (nCount <= 1)
+ return;
+
+ /* If the last item was removed, select the item above. */
+ int nSelect;
+ if (nItem == nCount - 1)
+ nSelect = nCount - 2;
+ else
+ nSelect = nItem;
+
+ ListView_SetItemState(hList, nSelect, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+}
+
+static BOOL Directories_OnBeginLabelEdit(HWND hDlg, NMHDR* pNMHDR)
+{
+ BOOL bResult = false;
+ NMLVDISPINFO* pDispInfo = (NMLVDISPINFO*)pNMHDR;
+ LVITEM* pItem = &pDispInfo->item;
+
+ int nType = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO));
+ if (IsMultiDir(nType))
+ {
+ /* Last item is placeholder for append */
+ if (pItem->iItem == ListView_GetItemCount(GetDlgItem(hDlg, IDC_DIR_LIST)) - 1)
+ {
+ if (MAX_DIRS <= DirInfo_NumDir(g_pDirInfo, nType))
+ return true; /* don't edit */
+
+ HWND hEdit = (HWND)(LRESULT)(int)SendDlgItemMessage(hDlg, IDC_DIR_LIST, LVM_GETEDITCONTROL, 0, 0);
+ Edit_SetText(hEdit, TEXT(""));
+ }
+ }
+
+ return bResult;
+}
+
+static BOOL Directories_OnEndLabelEdit(HWND hDlg, NMHDR* pNMHDR)
+{
+ BOOL bResult = false;
+ NMLVDISPINFO* pDispInfo = (NMLVDISPINFO*)pNMHDR;
+ LVITEM* pItem = &pDispInfo->item;
+
+ if (pItem->pszText)
+ {
+ struct _stat file_stat;
+
+ /* Don't allow empty entries. */
+ if (!_tcscmp(pItem->pszText, TEXT("")))
+ return false;
+
+ /* Check validity of edited directory. */
+ if (_tstat(pItem->pszText, &file_stat) == 0
+ && (file_stat.st_mode & S_IFDIR))
+ bResult = true;
+ else
+ if (MessageBox(NULL, TEXT("Directory does not exist, continue anyway?"), TEXT(MAMEUINAME), MB_OKCANCEL) == IDOK)
+ bResult = true;
+ }
+
+ if (bResult == true)
+ {
+ int nType = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_DIR_COMBO));
+ if (IsMultiDir(nType))
+ {
+ /* Last item is placeholder for append */
+ if (pItem->iItem == ListView_GetItemCount(GetDlgItem(hDlg, IDC_DIR_LIST)) - 1)
+ {
+ if (MAX_DIRS <= DirInfo_NumDir(g_pDirInfo, nType))
+ return false;
+
+ for (int i = DirInfo_NumDir(g_pDirInfo, nType); pItem->iItem < i; i--)
+ _tcscpy(DirInfo_Path(g_pDirInfo, nType, i), DirInfo_Path(g_pDirInfo, nType, i - 1));
+
+ _tcscpy(DirInfo_Path(g_pDirInfo, nType, pItem->iItem), pItem->pszText);
+
+ DirInfo_SetModified(g_pDirInfo, nType, true);
+ DirInfo_NumDir(g_pDirInfo, nType)++;
+ }
+ else
+ DirInfo_SetDir(g_pDirInfo, nType, pItem->iItem, pItem->pszText);
+ }
+ else
+ DirInfo_SetDir(g_pDirInfo, nType, pItem->iItem, pItem->pszText);
+
+ UpdateDirectoryList(hDlg);
+ ListView_SetItemState(GetDlgItem(hDlg, IDC_DIR_LIST), pItem->iItem, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ }
+
+ return bResult;
+}
+
+static void Directories_OnCommand(HWND hDlg, int id, HWND hwndCtl, UINT codeNotify)
+{
+ switch (id)
+ {
+ case IDOK:
+ if (codeNotify == BN_CLICKED)
+ Directories_OnOk(hDlg);
+ break;
+
+ case IDCANCEL:
+ if (codeNotify == BN_CLICKED)
+ Directories_OnCancel(hDlg);
+ break;
+
+ case IDC_DIR_BROWSE:
+ if (codeNotify == BN_CLICKED)
+ Directories_OnBrowse(hDlg);
+ break;
+
+ case IDC_DIR_INSERT:
+ if (codeNotify == BN_CLICKED)
+ Directories_OnInsert(hDlg);
+ break;
+
+ case IDC_DIR_DELETE:
+ if (codeNotify == BN_CLICKED)
+ Directories_OnDelete(hDlg);
+ break;
+
+ case IDC_DIR_COMBO:
+ switch (codeNotify)
+ {
+ case CBN_SELCHANGE:
+ Directories_OnSelChange(hDlg);
+ break;
+ }
+ break;
+ }
+}
+
+static BOOL Directories_OnNotify(HWND hDlg, int id, NMHDR* pNMHDR)
+{
+ switch (id)
+ {
+ case IDC_DIR_LIST:
+ switch (pNMHDR->code)
+ {
+ case LVN_ENDLABELEDIT:
+ return Directories_OnEndLabelEdit(hDlg, pNMHDR);
+
+ case LVN_BEGINLABELEDIT:
+ return Directories_OnBeginLabelEdit(hDlg, pNMHDR);
+ }
+ }
+ return FALSE;
+}
+
+/**************************************************************************
+
+ Use the shell to select a Directory.
+
+ **************************************************************************/
+
+static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
+{
+ /*
+ Called just after the dialog is initialized
+ Select the dir passed in BROWSEINFO.lParam
+ */
+ if (uMsg == BFFM_INITIALIZED)
+ {
+ if ((const char*)lpData)
+ SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
+ }
+
+ return 0;
+}
+
+BOOL BrowseForDirectory(HWND hwnd, LPCTSTR pStartDir, TCHAR* pResult)
+{
+ BOOL bResult = false;
+ TCHAR buf[MAX_PATH];
+
+ BROWSEINFO Info;
+ Info.hwndOwner = hwnd;
+ Info.pidlRoot = NULL;
+ Info.pszDisplayName = buf;
+ Info.lpszTitle = TEXT("Select a directory:");
+ Info.ulFlags = BIF_RETURNONLYFSDIRS | BIF_USENEWUI;
+ Info.lpfn = BrowseCallbackProc;
+ Info.lParam = (LPARAM)pStartDir;
+
+ LPITEMIDLIST pItemIDList = SHBrowseForFolder(&Info);
+
+ if (pItemIDList)
+ {
+ if (SHGetPathFromIDList(pItemIDList, buf) == true)
+ {
+ _sntprintf(pResult, MAX_PATH, TEXT("%s"), buf);
+ bResult = true;
+ }
+ }
+ else
+ bResult = false;
+
+ return bResult;
+}
+
diff --git a/docs/release/src/osd/winui/directories.h b/docs/release/src/osd/winui/directories.h
new file mode 100644
index 00000000000..f4e033cd7b5
--- /dev/null
+++ b/docs/release/src/osd/winui/directories.h
@@ -0,0 +1,83 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+#ifndef DIRECTORIES_H
+#define DIRECTORIES_H
+
+/* Dialog return codes - do these do anything??? */
+#define DIRDLG_ROMS 0x0010 // this one does
+#define DIRDLG_SAMPLES 0x0020 // this one does
+#define DIRDLG_INI 0x0040
+#define DIRDLG_CFG 0x0100
+#define DIRDLG_IMG 0x0400
+#define DIRDLG_INP 0x0800
+#define DIRDLG_CTRLR 0x1000
+#define DIRDLG_SW 0x4000 // this one does
+#define DIRDLG_CHEAT 0x8000
+
+#define DIRLIST_NEWENTRYTEXT "< >"
+
+#include "mui_opts.h"
+
+typedef struct
+{
+ LPCSTR lpName; // name to display
+ const std::string (*pfnGetTheseDirs)(void); // function to get existing setting
+ void (*pfnSetTheseDirs)(LPCSTR lpDirs); // function to save new setting
+ BOOL bMulti; // true = it supports multiple directories
+ int nDirDlgFlags; // if changed, a refresh needs to be done
+}
+DIRECTORYINFO;
+
+const DIRECTORYINFO g_directoryInfo[] =
+{
+ { "ROMs", GetRomDirs, SetRomDirs, true, DIRDLG_ROMS },
+ { "Samples", GetSampleDirs, SetSampleDirs, true, DIRDLG_SAMPLES },
+ { "Software File Base", GetSWDir, SetSWDir, false, DIRDLG_SW }, // core cannot handle multiple path, even though we can.
+ { "Artwork", GetArtDir, SetArtDir, true, 0 },
+ { "Artwork Previews", GetArtworkDir, SetArtworkDir, true, 0 },
+ { "Bosses", GetBossesDir, SetBossesDir, true, 0 },
+ { "Cabinets", GetCabinetDir, SetCabinetDir, true, 0 },
+ { "Cheats", GetCheatDir, SetCheatDir, true, DIRDLG_CHEAT },
+ { "Config", GetCfgDir, SetCfgDir, false, DIRDLG_CFG },
+ { "Control Panels", GetControlPanelDir, SetControlPanelDir, true, 0 },
+ { "Controller Files", GetCtrlrDir, SetCtrlrDir, true, DIRDLG_CTRLR },
+ { "Covers", GetCoversDir, SetCoversDir, true, 0 },
+ { "Crosshairs", GetCrosshairDir, SetCrosshairDir, true, 0 },
+ { "DAT files", GetDatsDir, SetDatsDir, false, 0 },
+ { "Ends", GetEndsDir, SetEndsDir, true, 0 },
+ { "Flyers", GetFlyerDir, SetFlyerDir, true, 0 },
+ { "Folders", GetFolderDir, SetFolderDir, false, 0 },
+ { "Fonts", GetFontDir, SetFontDir, true, 0 },
+ { "Game Overs", GetGameOverDir, SetGameOverDir, true, 0 },
+ { "Hash", GetHashDirs, SetHashDirs, true, 0 },
+ { "Hard Drive Difference", GetDiffDir, SetDiffDir, true, 0 },
+ { "HLSL", GetHLSLDir, SetHLSLDir, false, 0 },
+ { "How To", GetHowToDir, SetHowToDir, true, 0 },
+ { "Icons", GetIconsDir, SetIconsDir, false, 0 },
+// { "Ini Files", GetIniDir, SetIniDir, false, DIRDLG_INI }, // 2017-02-03 hardcoded to 'ini' now
+ { "Input files", GetInpDir, SetInpDir, true, DIRDLG_INP },
+ { "Language", GetLangDir, SetLangDir, false, 0 },
+ { "Logos", GetLogoDir, SetLogoDir, true, 0 },
+ { "Manuals (PDF)", GetManualsDir, SetManualsDir, false, 0 },
+ { "Marquees", GetMarqueeDir, SetMarqueeDir, true, 0 },
+ { "NVRAM", GetNvramDir, SetNvramDir, true, 0 },
+ { "PCBs", GetPcbDir, SetPcbDir, true, 0 },
+ { "Plugins", GetPluginsDir, SetPluginsDir, false, 0 },
+ { "Scores", GetScoresDir, SetScoresDir, true, 0 },
+ { "Selects", GetSelectDir, SetSelectDir, true, 0 },
+ { "Snapshots", GetImgDir, SetImgDir, true, DIRDLG_IMG },
+ { "State", GetStateDir, SetStateDir, true, 0 },
+ { "Titles", GetTitlesDir, SetTitlesDir, true, 0 },
+ { "Versus", GetVersusDir, SetVersusDir, true, 0 },
+ { "Videos and Movies", GetVideoDir, SetVideoDir, false, 0 },
+ { NULL }
+};
+
+
+INT_PTR CALLBACK DirectoriesDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+
+#endif /* DIRECTORIES_H */
+
+
diff --git a/docs/release/src/osd/winui/dirwatch.cpp b/docs/release/src/osd/winui/dirwatch.cpp
new file mode 100644
index 00000000000..e67b625e491
--- /dev/null
+++ b/docs/release/src/osd/winui/dirwatch.cpp
@@ -0,0 +1,346 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+// standard windows headers
+#include <windows.h>
+
+// MAME/MAMEUI headers
+#include "dirwatch.h"
+#include "mui_util.h"
+
+typedef BOOL (WINAPI *READDIRECTORYCHANGESFUNC)(HANDLE hDirectory, LPVOID lpBuffer,
+ DWORD nBufferLength, BOOL bWatchSubtree, DWORD dwNotifyFilter,
+ LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped,
+ LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
+
+
+struct DirWatcherEntry
+{
+ struct DirWatcherEntry *pNext;
+ HANDLE hDir;
+ WORD nIndex;
+ WORD nSubIndex;
+ BOOL bWatchSubtree;
+ OVERLAPPED overlapped;
+
+ union
+ {
+ FILE_NOTIFY_INFORMATION notify;
+ BYTE buffer[1024];
+ } u;
+
+ char szDirPath[1];
+};
+
+
+
+struct DirWatcher
+{
+ HMODULE hKernelModule;
+ READDIRECTORYCHANGESFUNC pfnReadDirectoryChanges;
+
+ HWND hwndTarget;
+ UINT nMessage;
+
+ HANDLE hRequestEvent;
+ HANDLE hResponseEvent;
+ HANDLE hThread;
+ CRITICAL_SECTION crit;
+ struct DirWatcherEntry *pEntries;
+
+ // These are posted externally
+ BOOL bQuit;
+ BOOL bWatchSubtree;
+ WORD nIndex;
+ LPCSTR pszPathList;
+};
+
+
+
+static void DirWatcher_SetupWatch(PDIRWATCHER pWatcher, struct DirWatcherEntry *pEntry)
+{
+ DWORD nDummy;
+
+ memset(&pEntry->u, 0, sizeof(pEntry->u));
+
+ pWatcher->pfnReadDirectoryChanges(pEntry->hDir,
+ &pEntry->u,
+ sizeof(pEntry->u),
+ pEntry->bWatchSubtree,
+ FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_SIZE,
+ &nDummy,
+ &pEntry->overlapped,
+ NULL);
+}
+
+
+
+static void DirWatcher_FreeEntry(struct DirWatcherEntry *pEntry)
+{
+ if (pEntry->hDir)
+ CloseHandle(pEntry->hDir);
+ free(pEntry);
+}
+
+
+
+static BOOL DirWatcher_WatchDirectory(PDIRWATCHER pWatcher, int nIndex, int nSubIndex, LPCSTR pszPath, BOOL bWatchSubtree)
+{
+ struct DirWatcherEntry *pEntry;
+ HANDLE hDir;
+
+ pEntry = (DirWatcherEntry *)malloc(sizeof(*pEntry) + strlen(pszPath));
+ if (!pEntry)
+ goto error;
+ memset(pEntry, 0, sizeof(*pEntry));
+ strcpy(pEntry->szDirPath, pszPath);
+ pEntry->overlapped.hEvent = pWatcher->hRequestEvent;
+
+ hDir = win_create_file_utf8(pszPath, FILE_LIST_DIRECTORY,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL);
+ if (!hDir || (hDir == INVALID_HANDLE_VALUE))
+ goto error;
+
+ // Populate the entry
+ pEntry->hDir = hDir;
+ pEntry->bWatchSubtree = bWatchSubtree;
+ pEntry->nIndex = nIndex;
+ pEntry->nSubIndex = nSubIndex;
+
+ // Link in the entry
+ pEntry->pNext = pWatcher->pEntries;
+ pWatcher->pEntries = pEntry;
+
+ DirWatcher_SetupWatch(pWatcher, pEntry);
+ return true;
+
+error:
+ if (pEntry)
+ DirWatcher_FreeEntry(pEntry);
+ return false;
+}
+
+
+
+static void DirWatcher_Signal(PDIRWATCHER pWatcher, struct DirWatcherEntry *pEntry)
+{
+ LPSTR pszFileName;
+ BOOL bPause = 0;
+ HANDLE hFile;
+
+ {
+ int nLength = WideCharToMultiByte(CP_ACP, 0, pEntry->u.notify.FileName, -1, NULL, 0, NULL, NULL);
+ pszFileName = (LPSTR) alloca(nLength * sizeof(*pszFileName));
+ WideCharToMultiByte(CP_ACP, 0, pEntry->u.notify.FileName, -1, pszFileName, nLength, NULL, NULL);
+ }
+
+ // get the full path to this new file
+ LPSTR pszFullFileName = (LPSTR) alloca(strlen(pEntry->szDirPath) + strlen(pszFileName) + 2);
+ strcpy(pszFullFileName, pEntry->szDirPath);
+ strcat(pszFullFileName, "\\");
+ strcat(pszFullFileName, pszFileName);
+
+ // attempt to busy wait until any result other than ERROR_SHARING_VIOLATION
+ // is generated
+ int nTries = 100;
+ do
+ {
+ hFile = win_create_file_utf8(pszFullFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
+ if (hFile != INVALID_HANDLE_VALUE)
+ CloseHandle(hFile);
+
+ bPause = (nTries--) && (hFile == INVALID_HANDLE_VALUE) && (GetLastError() == ERROR_SHARING_VIOLATION);
+ if (bPause)
+ Sleep(10);
+ }
+ while(bPause);
+
+ // send the message (assuming that we have a target)
+ if (pWatcher->hwndTarget)
+ {
+ TCHAR* t_filename = ui_wstring_from_utf8(pszFileName);
+ if( !t_filename )
+ return;
+ SendMessage(pWatcher->hwndTarget, pWatcher->nMessage, (pEntry->nIndex << 16) | (pEntry->nSubIndex << 0), (LPARAM)(LPCTSTR) win_tstring_strdup(t_filename));
+ free(t_filename);
+ }
+
+ DirWatcher_SetupWatch(pWatcher, pEntry);
+}
+
+
+
+static DWORD WINAPI DirWatcher_ThreadProc(LPVOID lpParameter)
+{
+ LPSTR pszPathList, s;
+ int nSubIndex = 0;
+ PDIRWATCHER pWatcher = (PDIRWATCHER) lpParameter;
+ struct DirWatcherEntry *pEntry;
+ struct DirWatcherEntry **ppEntry;
+
+ do
+ {
+ WaitForSingleObject(pWatcher->hRequestEvent, INFINITE);
+
+ if (pWatcher->pszPathList)
+ {
+ // remove any entries with the same nIndex
+ ppEntry = &pWatcher->pEntries;
+ while(*ppEntry)
+ {
+ if ((*ppEntry)->nIndex == pWatcher->nIndex)
+ {
+ pEntry = *ppEntry;
+ *ppEntry = pEntry->pNext;
+ DirWatcher_FreeEntry(pEntry);
+ }
+ else
+ {
+ ppEntry = &(*ppEntry)->pNext;
+ }
+ }
+
+ // allocate our own copy of the path list
+ pszPathList = (LPSTR) alloca(strlen(pWatcher->pszPathList) + 1);
+ strcpy(pszPathList, pWatcher->pszPathList);
+
+ nSubIndex = 0;
+ do
+ {
+ s = strchr(pszPathList, ';');
+ if (s)
+ *s = '\0';
+
+ if (*pszPathList)
+ {
+ DirWatcher_WatchDirectory(pWatcher, pWatcher->nIndex,
+ nSubIndex++, pszPathList, pWatcher->bWatchSubtree);
+ }
+
+ pszPathList = s ? s + 1 : NULL;
+ }
+ while(pszPathList);
+
+ pWatcher->pszPathList = NULL;
+ pWatcher->bWatchSubtree = FALSE;
+ }
+ else
+ {
+ // we have to go through the list and find what has been hit
+ for (pEntry = pWatcher->pEntries; pEntry; pEntry = pEntry->pNext)
+ {
+ if (pEntry->u.notify.Action != 0)
+ {
+ DirWatcher_Signal(pWatcher, pEntry);
+ }
+ }
+ }
+
+ SetEvent(pWatcher->hResponseEvent);
+ }
+ while(!pWatcher->bQuit);
+ return 0;
+}
+
+
+
+PDIRWATCHER DirWatcher_Init(HWND hwndTarget, UINT nMessage)
+{
+ DWORD nThreadID = 0;
+ struct DirWatcher *pWatcher = NULL;
+
+ // This feature does not exist on Win9x
+ if (GetVersion() >= 0x80000000)
+ goto error;
+
+ pWatcher = (DirWatcher *)malloc(sizeof(struct DirWatcher));
+ if (!pWatcher)
+ goto error;
+ memset(pWatcher, 0, sizeof(*pWatcher));
+ InitializeCriticalSection(&pWatcher->crit);
+
+ pWatcher->hKernelModule = LoadLibrary(TEXT("kernel32.dll"));
+ if (!pWatcher->hKernelModule)
+ goto error;
+
+ pWatcher->pfnReadDirectoryChanges = (READDIRECTORYCHANGESFUNC)
+ GetProcAddress(pWatcher->hKernelModule, "ReadDirectoryChangesW");
+ if (!pWatcher->pfnReadDirectoryChanges)
+ goto error;
+
+ pWatcher->hRequestEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (!pWatcher->hRequestEvent)
+ goto error;
+
+ pWatcher->hResponseEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (!pWatcher->hRequestEvent)
+ goto error;
+
+ pWatcher->hThread = CreateThread(NULL, 0, DirWatcher_ThreadProc,
+ (LPVOID) pWatcher, 0, &nThreadID);
+
+ pWatcher->hwndTarget = hwndTarget;
+ pWatcher->nMessage = nMessage;
+ return pWatcher;
+
+error:
+ if (pWatcher)
+ DirWatcher_Free(pWatcher);
+ return NULL;
+}
+
+
+
+BOOL DirWatcher_Watch(PDIRWATCHER pWatcher, WORD nIndex, const std::string pszPathList, BOOL bWatchSubtrees)
+{
+ EnterCriticalSection(&pWatcher->crit);
+
+ pWatcher->nIndex = nIndex;
+ pWatcher->pszPathList = pszPathList.c_str();
+ pWatcher->bWatchSubtree = bWatchSubtrees;
+ SetEvent(pWatcher->hRequestEvent);
+
+ WaitForSingleObject(pWatcher->hResponseEvent, INFINITE);
+ LeaveCriticalSection(&pWatcher->crit);
+ return true;
+}
+
+
+
+void DirWatcher_Free(PDIRWATCHER pWatcher)
+{
+ struct DirWatcherEntry *pEntry;
+ struct DirWatcherEntry *pNextEntry;
+
+ if (pWatcher->hThread)
+ {
+ EnterCriticalSection(&pWatcher->crit);
+ pWatcher->bQuit = true;
+ SetEvent(pWatcher->hRequestEvent);
+ WaitForSingleObject(pWatcher->hThread, 1000);
+ LeaveCriticalSection(&pWatcher->crit);
+ CloseHandle(pWatcher->hThread);
+ }
+
+ DeleteCriticalSection(&pWatcher->crit);
+
+ pEntry = pWatcher->pEntries;
+ while(pEntry)
+ {
+ pNextEntry = pEntry->pNext;
+ DirWatcher_FreeEntry(pEntry);
+ pEntry = pNextEntry;
+ }
+
+ if (pWatcher->hKernelModule)
+ FreeLibrary(pWatcher->hKernelModule);
+ if (pWatcher->hRequestEvent)
+ CloseHandle(pWatcher->hRequestEvent);
+ if (pWatcher->hResponseEvent)
+ CloseHandle(pWatcher->hResponseEvent);
+ free(pWatcher);
+}
+
diff --git a/docs/release/src/osd/winui/dirwatch.h b/docs/release/src/osd/winui/dirwatch.h
new file mode 100644
index 00000000000..302a8de70b2
--- /dev/null
+++ b/docs/release/src/osd/winui/dirwatch.h
@@ -0,0 +1,14 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef DIRWATCHER_H
+#define DIRWATCHER_H
+
+#include <string>
+typedef struct DirWatcher *PDIRWATCHER;
+
+PDIRWATCHER DirWatcher_Init(HWND hwndTarget, UINT nMessage);
+BOOL DirWatcher_Watch(PDIRWATCHER pWatcher, WORD nIndex, const std::string t, BOOL bWatchSubtrees);
+void DirWatcher_Free(PDIRWATCHER pWatcher);
+
+#endif
diff --git a/docs/release/src/osd/winui/game_opts.h b/docs/release/src/osd/winui/game_opts.h
new file mode 100644
index 00000000000..65bca005ea4
--- /dev/null
+++ b/docs/release/src/osd/winui/game_opts.h
@@ -0,0 +1,367 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+#ifndef WINUI_GAMEOPTS_H
+#define WINUI_GAMEOPTS_H
+
+class winui_game_options
+{
+ uint32_t m_total;
+ uint32_t m_cache;
+ uint32_t m_version;
+ bool m_rebuild;
+
+ struct driver_options
+ {
+ uint32_t game_number;
+ int rom;
+ int sample;
+ uint32_t cache_lower;
+ uint32_t cache_upper;
+ uint32_t play_count;
+ uint32_t play_time;
+ };
+
+ std::vector<driver_options> m_list;
+
+ // convert audit cache - normally only 1 digit, although we can do 2. If the input is -1, it is treated as invalid and -1 is returned.
+ int convert_to_int(const char* inp)
+ {
+ if (!inp)
+ return -1;
+ int c = inp[0];
+ if (c < 0x30 || c > 0x39)
+ return -1;
+ int oup = c - 0x30;
+ c = inp[1];
+ if (c < 0x30 || c > 0x39)
+ return oup;
+ else
+ return oup * 10 + (c - 0x30);
+ }
+
+ // convert all other numbers, up to end-of-string/invalid-character. If number is too large, return 0.
+ uint32_t convert_to_uint(const char* inp)
+ {
+ if (!inp)
+ return 0;
+ uint32_t oup = 0;
+ for (int i = 0; i < 11; i++)
+ {
+ int c = inp[i];
+ if (c >= 0x30 && c <= 0x39)
+ oup = oup * 10 + (c - 0x30);
+ else
+ return oup;
+ }
+ return 0; // numeric overflow
+ }
+
+ // true = recache needed
+ bool create_index(std::ifstream &fp)
+ {
+ // does file exist?
+ if (!fp.good())
+ return true;
+
+ // check first line is ok
+ string file_line;
+ std::getline(fp, file_line);
+ if (file_line.empty())
+ return true;
+
+ char s1[file_line.length()+1];
+ strcpy(s1, file_line.c_str());
+
+ // check that totals match
+ const char* s2 = strtok(s1, ",");
+ if (!s2)
+ return true; // file is corrupt
+
+ uint32_t total = convert_to_uint(s2);
+ if (total == m_total)
+ m_rebuild = false; // everything is fine so far
+
+ // check that versions match
+ s2 = strtok(NULL, ",");
+ if (!s2)
+ return true; // file is corrupt or old version
+
+ uint32_t version = convert_to_uint(s2);
+ if (version != m_version)
+ return true; // file is old version, complete rebuild necessary
+
+ // all good, read file to memory. If rebuild needed, it will overwrite cache, but we need the rest.
+ int index; // must be int for validity check below
+ bool is_ready = false;
+ std::getline(fp, file_line);
+ while (fp.good())
+ {
+ if (is_ready)
+ {
+ char s[file_line.length()+1];
+ strcpy(s, file_line.c_str());
+
+ const char* name = strtok(s, "\t"); // get driver name
+ index = driver_list::find(name);
+ if (index > -1)
+ {
+ char* data = strtok(NULL, ","); // get next part (old game number, ignore)
+ m_list[index].game_number = index; // get new game number
+ data = strtok(NULL, ","); // get next part
+ if (data)
+ m_list[index].rom = convert_to_int(data);
+ data = strtok(NULL, ","); // get next part
+ if (data)
+ m_list[index].sample = convert_to_int(data);
+ data = strtok(NULL, ","); // get next part
+ if (data)
+ m_list[index].cache_lower = convert_to_uint(data);
+ data = strtok(NULL, ","); // get next part
+ if (data)
+ m_list[index].cache_upper = convert_to_uint(data);
+ data = strtok(NULL, ","); // get next part
+ if (data)
+ m_list[index].play_count = convert_to_uint(data);
+ data = strtok(NULL, ","); // get next part
+ if (data)
+ m_list[index].play_time = convert_to_uint(data);
+ }
+ }
+ else
+ {
+ if (file_line == "$start")
+ is_ready = true;
+ }
+
+ std::getline(fp, file_line);
+ }
+
+ fp.close();
+ return m_rebuild;
+ }
+
+public:
+ // construction - runs before main
+ winui_game_options()
+ {
+ m_version = 1;
+ m_rebuild = true;
+ m_total = driver_list::total();
+ m_list.resize(m_total);
+ std::fill(m_list.begin(), m_list.end(), driver_options{0, -1, -1, 0, 0, 0, 0});
+ }
+
+ int rom(uint32_t index)
+ {
+ if (index < m_total)
+ return m_list[index].rom;
+ else
+ return -1;
+ }
+
+ void rom(uint32_t index, int val)
+ {
+ if (index < m_total)
+ m_list[index].rom = val;
+ }
+
+ int sample(uint32_t index)
+ {
+ if (index < m_total)
+ return m_list[index].sample;
+ else
+ return -1;
+ }
+
+ void sample(uint32_t index, int val)
+ {
+ if (index < m_total)
+ m_list[index].sample = val;
+ }
+
+ uint32_t cache_lower(uint32_t index)
+ {
+ if (index < m_total)
+ return m_list[index].cache_lower;
+ else
+ return 0;
+ }
+
+ uint32_t cache_upper(uint32_t index)
+ {
+ if (index < m_total)
+ return m_list[index].cache_upper;
+ else
+ return 0;
+ }
+
+ void cache_upper(uint32_t index, uint32_t val)
+ {
+ if (index < m_total)
+ m_list[index].cache_upper = val;
+ }
+
+ uint32_t play_count(uint32_t index)
+ {
+ if (index < m_total)
+ return m_list[index].play_count;
+ else
+ return 0;
+ }
+
+ void play_count(uint32_t index, int val)
+ {
+ if (index < m_total)
+ m_list[index].play_count = val;
+ }
+
+ uint32_t play_time(uint32_t index)
+ {
+ if (index < m_total)
+ return m_list[index].play_time;
+ else
+ return 0;
+ }
+
+ void play_time(uint32_t index, int val)
+ {
+ if (index < m_total)
+ m_list[index].play_time = val;
+ }
+
+ bool rebuild()
+ {
+ return m_rebuild;
+ }
+
+ void force_rebuild()
+ {
+ m_rebuild = true;
+ }
+
+ void load_file(const char *filename)
+ {
+ std::ifstream infile (filename);
+ if (create_index(infile))
+ {
+ // rebuild the cache
+ device_t::feature_type ft;
+ const game_driver *drv;
+ windows_options dummy;
+ printf("game_opts.cpp::load_file : Rebuilding cache\n");fflush(stdout);
+ for (uint32_t i = 0; i < m_total; i++)
+ {
+ uint32_t t = 0;
+ // BITS 0,1 = arcade, console, computer, other
+ drv = &driver_list::driver(i);
+ ui::machine_static_info const info(machine_config(*drv, dummy));
+ if ((info.machine_flags() & machine_flags::MASK_TYPE) == machine_flags::TYPE_CONSOLE)
+ t = 1;
+ else
+ if ((info.machine_flags() & machine_flags::MASK_TYPE) == machine_flags::TYPE_COMPUTER)
+ t = 2;
+ else
+ if ((info.machine_flags() & machine_flags::MASK_TYPE) == machine_flags::TYPE_OTHER)
+ t = 3;
+ m_cache = t;
+ // BIT 2 = SWAP_XY
+ t = (drv->flags & ORIENTATION_SWAP_XY) ? 0x0004 : 0;
+ m_cache |= t;
+ // BIT 6 = NOT_WORKING
+ t = (info.machine_flags() & machine_flags::NOT_WORKING) ? 0x0040 : 0;
+ m_cache |= t;
+ // BIT 7 = SUPPORTS_SAVE
+ t = (info.machine_flags() & machine_flags::SUPPORTS_SAVE) ? 0: 0x0080;
+ m_cache |= t;
+ // BIT 8 = NO_COCKTAIL
+ t = (info.machine_flags() & machine_flags::NO_COCKTAIL) ? 0x0100 : 0;
+ m_cache |= t;
+ // BIT 9 = IS_BIOS_ROOT
+ t = (info.machine_flags() & machine_flags::IS_BIOS_ROOT) ? 0x0200 : 0;
+ m_cache |= t;
+ // BIT 10 = REQUIRES_ARTWORK
+ t = (info.machine_flags() & machine_flags::REQUIRES_ARTWORK) ? 0x0400 : 0;
+ m_cache |= t;
+ // BIT 11 = CLICKABLE_ARTWORK
+ t = (info.machine_flags() & machine_flags::CLICKABLE_ARTWORK) ? 0x0800 : 0;
+ m_cache |= t;
+ // BIT 12 = UNOFFICIAL
+ t = (info.machine_flags() & machine_flags::UNOFFICIAL) ? 0x1000 : 0;
+ m_cache |= t;
+ // BIT 13 = NO_SOUND_HW
+ t = (info.machine_flags() & machine_flags::NO_SOUND_HW) ? 0x2000 : 0;
+ m_cache |= t;
+ // BIT 14 = MECHANICAL
+ t = (info.machine_flags() & machine_flags::MECHANICAL) ? 0x4000 : 0;
+ m_cache |= t;
+ // BIT 15 = IS_INCOMPLETE
+ t = (info.machine_flags() & machine_flags::IS_INCOMPLETE) ? 0x8000 : 0;
+ m_cache |= t;
+
+ ft = info.imperfect_features();
+ // BIT 16 = IMPERFECT_SOUND
+ t = (ft & device_t::feature::SOUND) ? 0x10000 : 0;
+ m_cache |= t;
+ // BIT 18 = IMPERFECT_GRAPHICS
+ t = (ft & device_t::feature::GRAPHICS) ? 0x40000 : 0;
+ m_cache |= t;
+ // BIT 20 = IMPERFECT_COLOUR
+ t = (ft & device_t::feature::PALETTE) ? 0x100000 : 0;
+ m_cache |= t;
+ // BIT 22 = PROTECTION
+ t = (ft & device_t::feature::PROTECTION) ? 0x400000 : 0;
+ m_cache |= t;
+ // BIT 23 = IMPERFECT_CONTROLS
+ t = (ft & device_t::feature::CONTROLS) ? 0x800000 : 0;
+ m_cache |= t;
+
+ ft = info.unemulated_features();
+ // BIT 17 = NO_SOUND
+ t = (ft & device_t::feature::SOUND) ? 0x20000 : 0;
+ m_cache |= t;
+ // BIT 19 = NO_GRAPHICS
+ t = (ft & device_t::feature::GRAPHICS) ? 0x80000 : 0;
+ m_cache |= t;
+ // BIT 21 = NO_COLOUR
+ t = (ft & device_t::feature::PALETTE) ? 0x200000 : 0;
+ m_cache |= t;
+
+ m_list[i].cache_lower = m_cache;
+ m_list[i].cache_upper = 0;
+ }
+ printf("game_opts.cpp::load_file : Finished Rebuilding cache\n");fflush(stdout);
+ }
+ }
+
+ void save_file(const char *filename)
+ {
+ string inistring = std::to_string(m_total).append(",").append(std::to_string(m_version)).append("\n");
+ inistring.append("YOU CAN SAFELY DELETE THIS FILE TO RESET THE GAME STATS.\n\n$start\n");
+
+ for (uint32_t i = 0; i < m_total; i++)
+ {
+ // 1:Game number(for debugging only), 2:Rom, 3:Sample, 4:Cache(New), 5:Cache(Legacy) 6:Play Count, 7:Play Time
+ inistring.append(driver_list::driver(i).name).append("\t");
+ inistring.append(std::to_string(m_list[i].game_number)).append(",");
+ inistring.append(std::to_string(m_list[i].rom)).append(",");
+ inistring.append(std::to_string(m_list[i].sample)).append(",");
+ inistring.append(std::to_string(m_list[i].cache_lower)).append(",");
+ inistring.append(std::to_string(m_list[i].cache_upper)).append(",");
+ inistring.append(std::to_string(m_list[i].play_count)).append(",");
+ inistring.append(std::to_string(m_list[i].play_time)).append("\n");
+ }
+
+ std::ofstream outfile (filename, std::ios::out | std::ios::trunc);
+ size_t size = inistring.size();
+ char t1[size+1];
+ strcpy(t1, inistring.c_str());
+ outfile.write(t1, size);
+ outfile.close();
+ return;
+ }
+};
+
+#endif // __GAME_OPTS_H__
+
diff --git a/docs/release/src/osd/winui/hbmame.rc b/docs/release/src/osd/winui/hbmame.rc
new file mode 100644
index 00000000000..f90e47d750c
--- /dev/null
+++ b/docs/release/src/osd/winui/hbmame.rc
@@ -0,0 +1,20 @@
+#include "windows.h"
+#include "commctrl.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+//
+// Icon
+//
+
+2 ICON DISCARDABLE "res\\hbmame.ico"
+#endif // English (U.S.) resources
+
+#include "hbmameui.rc"
diff --git a/docs/release/src/osd/winui/hbmameui.rc b/docs/release/src/osd/winui/hbmameui.rc
new file mode 100644
index 00000000000..d230328a41f
--- /dev/null
+++ b/docs/release/src/osd/winui/hbmameui.rc
@@ -0,0 +1,1466 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "newuires.h"
+#include "resource.h"
+
+// Generated Help ID header file
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "resource.hm"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "windows.h"
+#include "commctrl.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (USA) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MAIN_MENU MENU DISCARDABLE
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Exit", ID_FILE_EXIT
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "&About HBMAMEUI", ID_ABOUT
+ END
+END
+
+IDR_UI_MENU MENU DISCARDABLE
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Play", ID_FILE_PLAY
+ MENUITEM SEPARATOR
+ MENUITEM "Play and &Record Input...", ID_FILE_PLAY_RECORD
+ MENUITEM "P&layback Input...", ID_FILE_PLAY_BACK
+ MENUITEM SEPARATOR
+ MENUITEM "Play and Record &Wave Output...", ID_FILE_PLAY_RECORD_WAVE
+ MENUITEM SEPARATOR
+ MENUITEM "Play and Record &MNG Output...", ID_FILE_PLAY_RECORD_MNG
+ MENUITEM SEPARATOR
+ MENUITEM "Play and Record &uncompressed AVI Output...",
+ ID_FILE_PLAY_RECORD_AVI
+ MENUITEM SEPARATOR
+ MENUITEM "Loa&d Savestate...", ID_FILE_LOADSTATE
+ MENUITEM SEPARATOR
+ MENUITEM "Pr&operties", ID_GAME_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "Audi&t existing sets", ID_FILE_AUDIT_X
+ MENUITEM "&Audit all sets", ID_FILE_AUDIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Refresh Roms\tF5", ID_UPDATE_GAMELIST
+ MENUITEM "Refresh Cache", ID_UPDATE_CACHE
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_FILE_EXIT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "&Toolbar\tAlt+T", ID_VIEW_TOOLBARS
+ MENUITEM "&Status bar\tAlt+S", ID_VIEW_STATUS
+ MENUITEM "Fold&er List\tAlt+D", ID_VIEW_FOLDERS
+ MENUITEM "&Picture Area\tAlt+P", ID_VIEW_PICTURE_AREA
+ MENUITEM "Screenshot Ta&b\tAlt+B", ID_VIEW_PAGETAB
+ MENUITEM SEPARATOR
+ MENUITEM "&Fullscreen\tF11", ID_VIEW_FULLSCREEN
+ MENUITEM SEPARATOR
+ POPUP "S&how Pictures"
+ BEGIN
+ MENUITEM "Artwork", ID_TOGGLE_TAB_ARTWORK
+ MENUITEM "Boss", ID_TOGGLE_TAB_BOSSES
+ MENUITEM "Cabinet", ID_TOGGLE_TAB_CABINET
+ MENUITEM "Control Panel", ID_TOGGLE_TAB_CONTROL_PANEL
+ MENUITEM "Cover", ID_TOGGLE_TAB_COVER
+ MENUITEM "End", ID_TOGGLE_TAB_ENDS
+ MENUITEM "Flyer", ID_TOGGLE_TAB_FLYER
+ MENUITEM "Game Over", ID_TOGGLE_TAB_GAMEOVER
+ MENUITEM "History", ID_TOGGLE_TAB_HISTORY
+ MENUITEM "How To", ID_TOGGLE_TAB_HOWTO
+ MENUITEM "Logo", ID_TOGGLE_TAB_LOGO
+ MENUITEM "Marquee", ID_TOGGLE_TAB_MARQUEE
+ MENUITEM "PCB", ID_TOGGLE_TAB_PCB
+ MENUITEM "Scores", ID_TOGGLE_TAB_SCORES
+ MENUITEM "Select", ID_TOGGLE_TAB_SELECT
+ MENUITEM "Snapshot", ID_TOGGLE_TAB_SCREENSHOT
+ MENUITEM "Title", ID_TOGGLE_TAB_TITLE
+ MENUITEM "Versus", ID_TOGGLE_TAB_VERSUS
+ END
+ MENUITEM SEPARATOR
+ MENUITEM "L&arge Icons", ID_VIEW_LARGE_ICON
+ MENUITEM "S&mall Icons", ID_VIEW_SMALL_ICON
+ MENUITEM "&List", ID_VIEW_LIST_MENU
+ MENUITEM "&Details", ID_VIEW_DETAIL
+ MENUITEM "&Grouped", ID_VIEW_GROUPED
+ MENUITEM SEPARATOR
+ POPUP "Arrange &Icons"
+ BEGIN
+ MENUITEM "by &Name", ID_VIEW_BYGAME
+ MENUITEM "by D&irectory", ID_VIEW_BYDIRECTORY
+ MENUITEM "by &Manufacturer", ID_VIEW_BYMANUFACTURER
+ MENUITEM "by Times &Played", ID_VIEW_BYTIMESPLAYED
+ MENUITEM "by &Type", ID_VIEW_BYTYPE
+ MENUITEM "by &Date", ID_VIEW_BYYEAR
+ END
+ MENUITEM "Line &Up Icons", ID_VIEW_LINEUPICONS
+ MENUITEM SEPARATOR
+ MENUITEM "&Custom Filters...\tCtrl+F", ID_CONTEXT_FILTERS
+ MENUITEM "Customi&ze Fields...", ID_CUSTOMIZE_FIELDS
+ END
+ POPUP "&Options"
+ BEGIN
+ MENUITEM "&Interface Options", ID_OPTIONS_INTERFACE
+ MENUITEM "Default Game &Options", ID_OPTIONS_DEFAULTS
+ MENUITEM "&Directories", ID_OPTIONS_DIR
+ MENUITEM SEPARATOR
+ MENUITEM "Game List &Font", ID_OPTIONS_FONT
+ MENUITEM "Game List &Clone Color", ID_OPTIONS_CLONE_COLOR
+ MENUITEM SEPARATOR
+
+ MENUITEM "&Background Image", ID_OPTIONS_BG
+ MENUITEM SEPARATOR
+ MENUITEM "&Reset to Default", ID_OPTIONS_RESET_DEFAULTS
+
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "What's New in MAME", ID_HELP_WHATS_NEW
+ MENUITEM "&Contents\tF1", ID_HELP_CONTENTS
+ MENUITEM "&About", ID_HELP_ABOUT
+ END
+END
+
+IDR_CONTEXT_MENU MENU
+BEGIN
+ POPUP "Context Menu"
+ BEGIN
+ MENUITEM "&Play", ID_FILE_PLAY
+ MENUITEM SEPARATOR
+ MENUITEM "Play and &Record Input...", ID_FILE_PLAY_RECORD
+ MENUITEM "Play ProgettoSnaps MP4 movie",ID_VIDEO_SNAP
+ MENUITEM "Read the PDF Manual", ID_MANUAL
+ MENUITEM SEPARATOR
+ MENUITEM "&Add to Custom Folder...", ID_CONTEXT_ADD_CUSTOM
+ MENUITEM "R&emove From This Folder", ID_CONTEXT_REMOVE_CUSTOM
+ MENUITEM "&Custom Filters...", ID_CONTEXT_FILTERS
+ MENUITEM SEPARATOR
+ MENUITEM "&Select Random Game", ID_CONTEXT_SELECT_RANDOM
+ MENUITEM SEPARATOR
+ MENUITEM "Rese&t Play Stats", ID_CONTEXT_RESET_PLAYSTATS
+ MENUITEM SEPARATOR
+ MENUITEM "A&udit", ID_GAME_AUDIT
+ MENUITEM SEPARATOR
+ MENUITEM "Pr&operties", ID_GAME_PROPERTIES
+ MENUITEM "Source properties", ID_FOLDER_SOURCEPROPERTIES
+// MENUITEM "&Vector properties", ID_FOLDER_VECTORPROPERTIES
+ END
+END
+
+IDR_CONTEXT_HEADER MENU
+BEGIN
+ POPUP "Header Context Menu"
+ BEGIN
+ MENUITEM "Sort &Ascending", ID_SORT_ASCENDING
+ MENUITEM "Sort &Descending", ID_SORT_DESCENDING
+ MENUITEM SEPARATOR
+ MENUITEM "Customi&ze Fields...", ID_CUSTOMIZE_FIELDS
+ END
+END
+
+IDR_CONTEXT_TREE MENU
+BEGIN
+ POPUP "Context Menu Tree"
+ BEGIN
+ MENUITEM "&Rename", ID_CONTEXT_RENAME_CUSTOM
+ MENUITEM "&Custom Filters...", ID_CONTEXT_FILTERS
+ MENUITEM SEPARATOR
+ POPUP "&Show Folders"
+ BEGIN
+ MENUITEM "overridden by code", ID_CONTEXT_SHOW_FOLDER_START
+
+ END
+ MENUITEM SEPARATOR
+ MENUITEM "&Audit", ID_FOLDER_AUDIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Properties", ID_FOLDER_PROPERTIES
+ END
+END
+
+IDR_CONTEXT_SCREENSHOT MENU
+BEGIN
+ POPUP "Context Screen Shot"
+ BEGIN
+ MENUITEM "Show Tab &Control", ID_VIEW_PAGETAB
+ MENUITEM SEPARATOR
+ POPUP "S&how Pictures"
+ BEGIN
+ MENUITEM "Artwork", ID_TOGGLE_TAB_ARTWORK
+ MENUITEM "Boss", ID_TOGGLE_TAB_BOSSES
+ MENUITEM "Cabinet", ID_TOGGLE_TAB_CABINET
+ MENUITEM "Control Panel", ID_TOGGLE_TAB_CONTROL_PANEL
+ MENUITEM "Cover", ID_TOGGLE_TAB_COVER
+ MENUITEM "End", ID_TOGGLE_TAB_ENDS
+ MENUITEM "Flyer", ID_TOGGLE_TAB_FLYER
+ MENUITEM "Game Over", ID_TOGGLE_TAB_GAMEOVER
+ MENUITEM "History", ID_TOGGLE_TAB_HISTORY
+ MENUITEM "How To", ID_TOGGLE_TAB_HOWTO
+ MENUITEM "Logo", ID_TOGGLE_TAB_LOGO
+ MENUITEM "Marquee", ID_TOGGLE_TAB_MARQUEE
+ MENUITEM "PCB", ID_TOGGLE_TAB_PCB
+ MENUITEM "Scores", ID_TOGGLE_TAB_SCORES
+ MENUITEM "Select", ID_TOGGLE_TAB_SELECT
+ MENUITEM "Snapshot", ID_TOGGLE_TAB_SCREENSHOT
+ MENUITEM "Title", ID_TOGGLE_TAB_TITLE
+ MENUITEM "Versus", ID_TOGGLE_TAB_VERSUS
+ END
+ MENUITEM SEPARATOR
+ MENUITEM "Artwork", ID_VIEW_TAB_ARTWORK
+ MENUITEM "Boss", ID_VIEW_TAB_BOSSES
+ MENUITEM "Cabinet", ID_VIEW_TAB_CABINET
+ MENUITEM "Control Panel", ID_VIEW_TAB_CONTROL_PANEL
+ MENUITEM "Cover", ID_VIEW_TAB_COVER
+ MENUITEM "End", ID_VIEW_TAB_ENDS
+ MENUITEM "Flyer", ID_VIEW_TAB_FLYER
+ MENUITEM "Game Over", ID_VIEW_TAB_GAMEOVER
+ MENUITEM "History", ID_VIEW_TAB_HISTORY
+ MENUITEM "How To", ID_VIEW_TAB_HOWTO
+ MENUITEM "Logo", ID_VIEW_TAB_LOGO
+ MENUITEM "Marquee", ID_VIEW_TAB_MARQUEE
+ MENUITEM "PCB", ID_VIEW_TAB_PCB
+ MENUITEM "Scores", ID_VIEW_TAB_SCORES
+ MENUITEM "Select", ID_VIEW_TAB_SELECT
+ MENUITEM "Snapshot", ID_VIEW_TAB_SCREENSHOT
+ MENUITEM "Title", ID_VIEW_TAB_TITLE
+ MENUITEM "Versus", ID_VIEW_TAB_VERSUS
+ END
+END
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_RUNTIME_MENU MENU
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Load State...", ID_FILE_LOADSTATE_NEWUI, GRAYED
+ MENUITEM "&Save State", ID_FILE_SAVESTATE, GRAYED
+ MENUITEM "S&ave State As...", ID_FILE_SAVESTATE_AS, GRAYED
+ MENUITEM SEPARATOR
+ MENUITEM "Save Sc&reenshot", ID_FILE_SAVESCREENSHOT
+ MENUITEM SEPARATOR
+ MENUITEM "&Hide Menubar", ID_FILE_TOGGLEMENUBAR
+ MENUITEM "&Full Screen\tAlt+Enter", ID_FILE_FULLSCREEN
+ MENUITEM "Partial Keyboard Emulation", ID_FILE_UIACTIVE
+ MENUITEM "Show Tab Menu", ID_FILE_OLDUI
+ MENUITEM SEPARATOR
+ MENUITEM "&Exit", ID_FILE_EXIT_NEWUI
+ END
+ POPUP "&Edit"
+ BEGIN
+ MENUITEM "Paste", ID_EDIT_PASTE
+ END
+ POPUP "&Options"
+ BEGIN
+ MENUITEM "&Pause", ID_OPTIONS_PAUSE, GRAYED
+ MENUITEM "Soft &Reset", ID_OPTIONS_SOFTRESET
+ MENUITEM "Ha&rd Reset", ID_OPTIONS_HARDRESET
+ MENUITEM SEPARATOR
+ POPUP "&Keyboard"
+ BEGIN
+ MENUITEM "Emulated", ID_KEYBOARD_EMULATED
+ MENUITEM "Natural", ID_KEYBOARD_NATURAL
+ MENUITEM SEPARATOR
+ MENUITEM "Customise Emulated Keyboard...", ID_KEYBOARD_CUSTOMIZE
+ END
+ MENUITEM "&Joysticks", ID_OPTIONS_JOYSTICKS, GRAYED
+ POPUP "&Video"
+ BEGIN
+ MENUITEM SEPARATOR
+ MENUITEM "Rotate 0 degrees", ID_VIDEO_ROTATE_0
+ MENUITEM "Rotate 90 degrees", ID_VIDEO_ROTATE_90
+ MENUITEM "Rotate 180 degrees", ID_VIDEO_ROTATE_180
+ MENUITEM "Rotate 270 degrees", ID_VIDEO_ROTATE_270
+ END
+ MENUITEM "&Configuration...", ID_OPTIONS_CONFIGURATION
+ MENUITEM "&DIP Switches...", ID_OPTIONS_DIPSWITCHES
+ MENUITEM "&Miscellaneous Inputs...", ID_OPTIONS_MISCINPUT
+ MENUITEM "&Analog Controls...", ID_OPTIONS_ANALOGCONTROLS
+ MENUITEM SEPARATOR
+ POPUP "&Frameskip"
+ BEGIN
+ MENUITEM "Auto", ID_FRAMESKIP_AUTO
+ END
+ POPUP "Maximum &Speed"
+ BEGIN
+ MENUITEM "50%", ID_THROTTLE_50
+ MENUITEM "100%", ID_THROTTLE_100
+ MENUITEM "200%", ID_THROTTLE_200
+ MENUITEM "500%", ID_THROTTLE_500
+ MENUITEM "1000%", ID_THROTTLE_1000
+ MENUITEM "Unlimited", ID_THROTTLE_UNTHROTTLED
+ END
+ MENUITEM "Show &FPS", ID_OPTIONS_TOGGLEFPS
+ END
+ POPUP "&Media"
+ BEGIN
+ MENUITEM SEPARATOR
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "About This System...", ID_HELP_ABOUTSYSTEM
+ MENUITEM "&About HBMAME...", ID_HELP_ABOUT_NEWUI
+ END
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "resource.h\\r\n"
+ "newuires.h\0"
+END
+
+2 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "#define NOWINRES\r\n"
+ "#include ""windows.h""\r\n"
+ "#include ""commctrl.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "#include ""hbmamevers.rc"" // Version block\r\n"
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAMEUI_ICON ICON "res\\hbmameui.ico"
+IDI_WIN_ROMS ICON "res\\win_roms.ico"
+IDI_WIN_NOROMS ICON "res\\win_noro.ico"
+IDI_WIN_UNKNOWN ICON "res\\win_unkn.ico"
+IDI_WIN_CLONE ICON "res\\win_clone.ico"
+IDI_WIN_REDX ICON "res\\win_redx.ico"
+IDI_WIN_IMPERFECT ICON "res\\win_imp.ico"
+IDI_FOLDER_AVAILABLE ICON "res\\foldavail.ico"
+IDI_FOLDER ICON "res\\folder.ico"
+IDI_FOLDER_MANUFACTURER ICON "res\\foldmanu.ico"
+IDI_FOLDER_OPEN ICON "res\\foldopen.ico"
+IDI_FOLDER_UNAVAILABLE ICON "res\\foldunav.ico"
+IDI_FOLDER_HORIZONTAL ICON "res\\horz.ico"
+IDI_FOLDER_VERTICAL ICON "res\\vert.ico"
+IDI_MANUFACTURER ICON "res\\manufact.ico"
+IDI_FOLDER_YEAR ICON "res\\foldyear.ico"
+IDI_FOLDER_SOURCE ICON "res\\foldsrc.ico"
+IDI_WORKING ICON "res\\working.ico"
+IDI_NONWORKING ICON "res\\nonwork.ico"
+IDI_YEAR ICON "res\\year.ico"
+IDI_KEYBOARD ICON "res\\keyboard.ico"
+IDI_JOYSTICK ICON "res\\joystick.ico"
+IDI_CPU ICON "res\\cpu.ico"
+IDI_SOUND ICON "res\\samples.ico"
+IDI_SOUNDTAB ICON "res\\sound.ico"
+IDI_SOURCE ICON "res\\source.ico"
+IDI_HARDDISK ICON "res\\harddisk.ico"
+IDI_DISPLAY ICON "res\\display.ico"
+IDI_CHECKMARK ICON "res\\checkmark.ico"
+IDI_HEADER_UP ICON "res\\header_up.ico"
+IDI_HEADER_DOWN ICON "res\\header_down.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUT DIALOG DISCARDABLE 0, 0, 296, 129
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About HBMAMEUI"
+FONT 8, "Tahoma"
+BEGIN
+ DEFPUSHBUTTON "&OK",IDOK,200,109,50,14,WS_GROUP
+ CTEXT "HomeBrew MAME",IDC_STATIC,147,7,142,
+ 11,NOT WS_GROUP
+ CTEXT "Version 0",IDC_VERSION,147,18,142,11,NOT WS_GROUP
+ CTEXT "Copyright (C) 1997-2018 The HBMAME Team",IDC_STATIC,147,
+ 29,142,10,NOT WS_GROUP
+ CTEXT "MAMEUI version by",IDC_STATIC,147,51,142,10,NOT
+ WS_GROUP
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,147,44,142,1
+ CTEXT "Christopher Kirmse and the MAMEUI team",IDC_STATIC,147,
+ 62,142,9,NOT WS_GROUP
+ CTEXT "Additional MAMEUI code by",IDC_STATIC,147,74,142,9
+ CTEXT "Mike Haaland, Andrew Kirmse, Jeff Miller",IDC_STATIC,
+ 147,85,142,9
+ CTEXT "John Hardy IV and Michael Soderstrom",IDC_STATIC,147,96,
+ 142,9
+ CONTROL "",IDC_ABOUT,"Static",SS_BITMAP | SS_SUNKEN,7,7,16,14
+END
+
+IDD_DIRECTX DIALOG DISCARDABLE 0, 0, 236, 69
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "MAMEUI"
+FONT 8, "Tahoma"
+BEGIN
+ DEFPUSHBUTTON "Go to Microsoft's DirectX Web Page",IDB_WEB_PAGE,48,52,
+ 140,14
+ EDITTEXT IDC_DIRECTX_HELP,7,0,222,48,ES_MULTILINE |
+ ES_AUTOHSCROLL | ES_READONLY
+END
+
+IDD_AUDIT DIALOG DISCARDABLE 0, 0, 283, 188
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "File Audit"
+FONT 8, "Tahoma"
+BEGIN
+ PUSHBUTTON "&Pause",IDPAUSE,98,168,40,14
+ PUSHBUTTON "&Cancel",IDCANCEL,144,168,40,14
+ GROUPBOX "ROMs",IDC_STATIC,6,4,132,65
+ LTEXT "Correct:",IDC_STATIC,51,28,32,8
+ CONTROL "Progress1",IDC_ROMS_PROGRESS,"msctls_progress32",
+ PBS_SMOOTH | WS_BORDER,14,16,116,8
+ LTEXT "Incorrect:",IDC_STATIC,51,42,32,8
+ LTEXT "Total:",IDC_STATIC,51,56,32,8
+ LTEXT "0",IDC_ROMS_CORRECT,87,28,20,8
+ LTEXT "0",IDC_ROMS_INCORRECT,87,42,20,8
+ LTEXT "0",IDC_ROMS_TOTAL,87,56,20,8
+ GROUPBOX "Samples",IDC_STATIC,145,4,132,65
+ CONTROL "Progress1",IDC_SAMPLES_PROGRESS,"msctls_progress32",
+ PBS_SMOOTH | WS_BORDER,153,16,116,8
+ LTEXT "Correct:",IDC_STATIC,191,28,33,8
+ LTEXT "Incorrect:",IDC_STATIC,191,42,33,8
+ LTEXT "Total:",IDC_STATIC,191,56,33,8
+ LTEXT "0",IDC_SAMPLES_CORRECT,227,28,20,8
+ LTEXT "0",IDC_SAMPLES_INCORRECT,227,42,20,8
+ LTEXT "0",IDC_SAMPLES_TOTAL,227,56,20,8
+ GROUPBOX "Details",IDC_STATIC,6,72,271,90
+ EDITTEXT IDC_AUDIT_DETAILS,12,82,259,74,ES_MULTILINE |
+ ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL |
+ NOT WS_TABSTOP
+END
+
+IDD_DIRECTORIES DIALOG DISCARDABLE 0, 0, 230, 107
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Directories"
+FONT 8, "Tahoma"
+BEGIN
+ LTEXT "Show directories for:",IDC_STATIC,6,6,67,10
+ COMBOBOX IDC_DIR_COMBO,6,18,160,79,CBS_DROPDOWNLIST | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "Directories:",IDC_STATIC,6,38,38,10
+ CONTROL "List1",IDC_DIR_LIST,"SysListView32",LVS_REPORT |
+ LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_EDITLABELS |
+ LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER |
+ WS_TABSTOP,6,50,160,51
+ DEFPUSHBUTTON "OK",IDOK,173,8,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,173,26,50,14
+ PUSHBUTTON "Browse...",IDC_DIR_BROWSE,173,50,50,14
+ PUSHBUTTON "Insert",IDC_DIR_INSERT,173,68,50,14
+ PUSHBUTTON "Delete",IDC_DIR_DELETE,173,87,50,14
+END
+
+IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 302, 145
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Customize Fields"
+FONT 8, "Tahoma"
+BEGIN
+ LTEXT "Available fields:",IDC_STATIC,6,6,80,10,SS_CENTERIMAGE
+ CONTROL "List1",IDC_LISTAVAILABLECOLUMNS,"SysListView32",
+ LVS_LIST | LVS_SINGLESEL | LVS_NOCOLUMNHEADER |
+ LVS_NOSORTHEADER | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6,
+ 18,90,100
+ PUSHBUTTON "Add ->",IDC_BUTTONADD,102,18,46,14,WS_DISABLED
+ PUSHBUTTON "<- Remove",IDC_BUTTONREMOVE,102,36,46,14,WS_DISABLED
+ LTEXT "Show these fields in this order:",IDC_STATIC,154,6,96,
+ 10,SS_CENTERIMAGE
+ CONTROL "List1",IDC_LISTSHOWCOLUMNS,"SysListView32",LVS_LIST |
+ LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER |
+ WS_BORDER | WS_HSCROLL | WS_TABSTOP,154,18,90,100
+ PUSHBUTTON "Move Up",IDC_BUTTONMOVEUP,250,18,46,14,WS_DISABLED
+ PUSHBUTTON "Move Down",IDC_BUTTONMOVEDOWN,250,36,46,14,WS_DISABLED
+ DEFPUSHBUTTON "OK",IDOK,105,124,44,14
+ PUSHBUTTON "Cancel",IDCANCEL,155,124,44,14
+END
+
+IDD_PROP_CONTROLLER DIALOGEX 0, 0, 220, 240
+STYLE DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Controller Mapping"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_JOYSTICK,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ GROUPBOX "Paddle device",IDC_STATIC,4,40,102,28
+ COMBOBOX IDC_PADDLE,10,50,91,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_PADDLE
+ GROUPBOX "ADStick device",IDC_STATIC,4,71,102,28
+ COMBOBOX IDC_ADSTICK,10,80,91,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_ADSTICK
+ GROUPBOX "Pedal device",IDC_STATIC,4,102,102,28
+ COMBOBOX IDC_PEDAL,10,112,91,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_PEDAL
+ GROUPBOX "Mouse device",IDC_STATIC,4,133,102,28
+ COMBOBOX IDC_MOUSE,10,142,90,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_MOUSE
+ GROUPBOX "Dial device",IDC_STATIC,113,40,102,28
+ COMBOBOX IDC_DIAL,119,50,90,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_DIAL
+ GROUPBOX "Trackball device",IDC_STATIC,113,71,102,28
+ COMBOBOX IDC_TRACKBALL,119,80,90,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_TRACKBALL
+ GROUPBOX "Lightgun device",IDC_STATIC,113,102,102,28
+ COMBOBOX IDC_LIGHTGUNDEVICE,119,112,90,62,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP,0,HIDC_LIGHTGUNDEVICE
+ GROUPBOX "Positional device",IDC_STATIC,113,133,102,28
+ COMBOBOX IDC_POSITIONAL,119,142,90,62,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP,0,HIDC_POSITIONAL
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
+ 0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_SCREEN DIALOGEX 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Screen"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_DISPLAY,IDC_STATIC,20,10,21,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
+
+ GROUPBOX "Number of screens",IDC_STATIC,4,40,103,24
+ CONTROL "GammaSlider",IDC_NUMSCREENS,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,50,75,10,0,HIDC_NUMSCREENS
+ RTEXT "1",IDC_NUMSCREENSDISP,84,49,14,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Screen",IDC_STATIC,4,66,103,29
+ COMBOBOX IDC_SCREEN,10,76,91,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SCREEN
+
+ GROUPBOX "",IDC_STATIC,4,97,103,28
+ CONTROL "Autoselect aspect",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,97,73,10,0,HIDC_ASPECT
+ LTEXT "Aspect ratio",IDC_ASPECTRATIOTEXT,17,108,40,11,SS_CENTERIMAGE | NOT WS_GROUP
+ EDITTEXT IDC_ASPECTRATION,60,108,14,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,0,HIDC_ASPECTRATION
+ LTEXT ":",IDC_STATIC,76,108,8,10,SS_CENTERIMAGE | NOT WS_GROUP
+ EDITTEXT IDC_ASPECTRATIOD,80,108,14,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,0,HIDC_ASPECTRATIOD
+
+ GROUPBOX "View",IDC_STATIC,4,128,103,28
+ COMBOBOX IDC_VIEW,10,137,91,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_VIEW
+
+ GROUPBOX "Screennumber",IDC_SCREENSELECTTEXT,113,40,102,28
+ COMBOBOX IDC_SCREENSELECT,119,50,90,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SCREENSELECT
+
+ GROUPBOX "Resolution",IDC_STATIC,113,71,102,76,WS_GROUP
+ GROUPBOX "Size",IDC_STATIC,119,81,90,28,WS_GROUP
+ COMBOBOX IDC_SIZES,126,91,77,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SIZES
+
+ GROUPBOX "Refresh",IDC_REFRESHTEXT,119,112,90,28,WS_GROUP
+ COMBOBOX IDC_REFRESH,126,121,77,76,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_REFRESH
+ CONTROL "Switch resolutions to fit",IDC_SWITCHRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,151,93,10,0,HIDC_SWITCHRES
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_GAME DIALOG DISCARDABLE 0, 0, 220, 276
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "General"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_MAMEUI_ICON,IDC_GAME_ICON,20,10,21,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,38,178,1
+ LTEXT "Manufactured:",IDC_STATIC,18,43,47,8
+ LTEXT "Static",IDC_PROP_MANUFACTURED,65,43,155,9,SS_NOPREFIX
+ LTEXT "Status:",IDC_STATIC,18,52,47,8
+ LTEXT "Static",IDC_PROP_STATUS,65,52,155,32
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,85,178,1
+ LTEXT "CPU:",IDC_STATIC,18,90,47,8
+ LTEXT "Static\nStatic\nStatic\nStatic\nStatic",IDC_PROP_CPU,65,90,155,40
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,130,178,1
+ LTEXT "Sound:",IDC_STATIC,18,135,47,8
+ LTEXT "Static\nStatic\nStatic\nStatic\nStatic",IDC_PROP_SOUND,65,135,155,45
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,181,178,1
+ LTEXT "Screen:",IDC_STATIC,18,186,47,8
+ LTEXT "Static\nStatic\nStatic",IDC_PROP_SCREEN,65,186,155,27
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,218,178,1
+ LTEXT "Source:",IDC_STATIC,16,223,47,8
+ LTEXT "Static",IDC_PROP_SOURCE,65,223,139,8
+ LTEXT "Clone of:",IDC_PROP_CLONEOF_TEXT,16,232,50,8
+ LTEXT "Static",IDC_PROP_CLONEOF,65,232,130,33
+END
+
+IDD_PROP_AUDIT DIALOG DISCARDABLE 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Audit"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_CHECKMARK,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ LTEXT "ROM check:",IDC_STATIC,10,40,50,8
+ LTEXT "Checking...",IDC_PROP_ROMS,66,40,139,8
+ LTEXT "Sample check:",IDC_STATIC,10,52,50,8
+ LTEXT "Checking...",IDC_PROP_SAMPLES,66,52,139,8
+ GROUPBOX "Details",IDC_STATIC,4,64,211,171
+ EDITTEXT IDC_AUDIT_DETAILS_PROP,10,74,199,155,ES_MULTILINE |
+ ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL |
+ NOT WS_TABSTOP
+END
+
+IDD_PROP_DISPLAY DIALOGEX 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Display"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_DISPLAY,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,169,25,SS_NOPREFIX
+
+ CONTROL "Run in a window",IDC_WINDOWED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,69,10,0,HIDC_WINDOWED
+ CONTROL "Start out maximized",IDC_MAXIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,52,80,10,0,HIDC_MAXIMIZE
+ CONTROL "Enforce aspect ratio",IDC_KEEPASPECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,64,77,10,0,HIDC_KEEPASPECT
+ CONTROL "Throttle",IDC_THROTTLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,39,10,0,HIDC_THROTTLE
+
+ GROUPBOX "Bitmap prescaling",IDC_PRESCALETEXT,4,89,103,24
+ CONTROL "GammaSlider",IDC_PRESCALE,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,99,71,10,0,HIDC_PRESCALE
+ RTEXT "1.00",IDC_PRESCALEDISP,84,98,14,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Gamma Correction",IDC_STATIC,4,115,103,24
+ CONTROL "GammaSlider",IDC_GAMMA,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,125,71,10,0,HIDC_GAMMA
+ RTEXT "2.00",IDC_GAMMADISP,84,124,14,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Brightness Correction",IDC_STATIC,4,141,103,24
+ CONTROL "GammaSlider",IDC_BRIGHTCORRECT,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,151,71,10,0,HIDC_BRIGHTCORRECT
+ RTEXT "1.00",IDC_BRIGHTCORRECTDISP,84,150,14,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Contrast Correction",IDC_STATIC,4,167,103,24
+ CONTROL "GammaSlider",IDC_CONTRAST,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,176,71,10,0,HIDC_CONTRAST
+ RTEXT "1.00",IDC_CONTRASTDISP,84,175,14,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Pause Brightness",IDC_STATIC,4,193,103,24
+ CONTROL "Slider1",IDC_PAUSEBRIGHT,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,203,71,10,0,HIDC_PAUSEBRIGHT
+ RTEXT "0.65",IDC_PAUSEBRIGHTDISP,84,202,14,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Video Mode",IDC_STATIC,113,40,102,28
+ COMBOBOX IDC_VIDEO_MODE,119,50,90,50,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP,0,HIDC_VIDEO_MODE
+
+ GROUPBOX "Rotation",IDC_STATIC,113,71,102,55
+ COMBOBOX IDC_ROTATE,119,81,90,57,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_ROTATE
+ CONTROL "Flip screen upside-down",IDC_FLIPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,98,91,10,0,HIDC_FLIPY
+ CONTROL "Flip screen left-right",IDC_FLIPX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,110,77,10,0,HIDC_FLIPX
+
+ GROUPBOX "Direct3D",IDC_STATIC,113,128,102,57
+ CONTROL "Use Bilinear filtering",IDC_D3D_FILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,138,85,10,0,HIDC_D3D_FILTER
+
+// GROUPBOX "Version",IDC_STATIC,119,150,90,28
+// COMBOBOX IDC_D3D_VERSION,125,160,78,95,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_D3D_VERSION
+
+// GROUPBOX "DirectDraw",IDC_STATIC,113,187,102,26
+// CONTROL "Stretch using hardware",IDC_HWSTRETCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,197,85,10,0,HIDC_HWSTRETCH
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_SOUND DIALOGEX 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Sound"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_SOUNDTAB,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
+
+ GROUPBOX "",IDC_STATIC,4,40,211,155
+
+ GROUPBOX "Sound Mode",IDC_STATIC,60,50,100,28
+ COMBOBOX IDC_SOUND_MODE,66,60,88,50,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP,0,HIDC_VIDEO_MODE
+
+ CONTROL "Use samples",IDC_SAMPLES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,60,84,55,10,0,HIDC_SAMPLES
+
+ GROUPBOX "Sample rate",IDC_RATETEXT,60,96,100,28
+ COMBOBOX IDC_SAMPLERATE,66,106,88,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SAMPLERATE
+
+ GROUPBOX "Volume attenuation",IDC_VOLUMETEXT,60,127,100,28
+ CONTROL "Slider1",IDC_VOLUME,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,66,139,68,10,0,HIDC_VOLUME
+ RTEXT "0dB",IDC_VOLUMEDISP,132,138,20,11,SS_CENTERIMAGE
+
+ GROUPBOX "Audio latency",IDC_AUDIO_LATENCY_TEXT,60,158,100,28
+ CONTROL "Slider1",IDC_AUDIO_LATENCY,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,66,170,68,10,0,HIDC_AUDIO_LATENCY
+ RTEXT "1/5",IDC_AUDIO_LATENCY_DISP,132,169,20,11,SS_CENTERIMAGE
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_ADVANCED DIALOGEX 0, 0, 220, 255
+STYLE DS_FIXEDSYS | WS_CHILD | WS_CAPTION
+CAPTION "Advanced"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_DISPLAY,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
+
+ CONTROL "Triple buffering",IDC_TRIPLE_BUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,93,10,0,HIDC_TRIPLE_BUFFER
+ CONTROL "Sync to monitor refresh",IDC_SYNCREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,52,93,10,0,HIDC_SYNCREFRESH
+ CONTROL "Wait for vertical sync",IDC_WAITVSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,64,93,10,0,HIDC_WAITVSYNC
+ CONTROL "Refresh speed",IDC_REFRESHSPEED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,93,10,0,HIDC_REFRESHSPEED
+
+ GROUPBOX "Frame skipping",IDC_STATIC,4,104,103,42
+ CONTROL "Automatic",IDC_AUTOFRAMESKIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,114,77,10,0,HIDC_AUTOFRAMESKIP
+ COMBOBOX IDC_FRAMESKIP,10,127,91,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_FRAMESKIP
+
+ GROUPBOX "Full screen gamma",IDC_FSGAMMATEXT,113,40,102,24
+ CONTROL "Slider1",IDC_FSGAMMA,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,119,50,71,10,0,HIDC_FSGAMMA
+ RTEXT "2.00",IDC_FSGAMMADISP,193,49,16,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Full screen brightness",IDC_FSBRIGHTNESSTEXT,113,67,102,24
+ CONTROL "Slider1",IDC_FSBRIGHTNESS,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,119,77,71,10,0,HIDC_FSBRIGHTNESS
+ RTEXT "2.00",IDC_FSBRIGHTNESSDISP,193,76,16,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Full screen contrast",IDC_FSCONTRASTTEXT,113,94,102,24
+ CONTROL "Slider1",IDC_FSCONTRAST,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,119,104,71,10,0,HIDC_FSCONTRAST
+ RTEXT "2.00",IDC_FSCONTRASTDISP,193,103,16,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Seconds to run",IDC_SECONDSTORUNTEXT,113,122,102,24
+ CONTROL "",IDC_SECONDSTORUN,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,119,132,71,10,0,HIDC_SECONDSTORUN
+ RTEXT "60",IDC_SECONDSTORUNDISP,193,130,16,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Emulation speed",IDC_SPEEDTEXT,4,155,211,24
+ CONTROL "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,12,165,180,10,0,HIDC_SPEED
+ RTEXT "1.00",IDC_SPEEDDISP,191,164,20,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Effect",IDC_STATIC,4,182,211,50
+ EDITTEXT IDC_EFFECT,12,192,200,14,ES_AUTOHSCROLL | WS_DISABLED
+ PUSHBUTTON "Select Effect",IDC_SELECT_EFFECT,12,211,60,14,0,0,HIDC_SELECT_EFFECT
+ PUSHBUTTON "Reset Effect",IDC_RESET_EFFECT,152,211,60,14,0,0,HIDC_RESET_EFFECT
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,238,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,120,238,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_DEBUG DIALOGEX 0, 0, 220, 255
+STYLE DS_FIXEDSYS | WS_CHILD | WS_CAPTION
+CAPTION "Debug"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_MANUFACTURER,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
+
+ CONTROL "Output log to Windows Debugger",IDC_OSLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,124,10,0,HIDC_OSLOG
+ CONTROL "Output log to Logfile",IDC_LOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,52,93,10,0,HIDC_LOG
+ CONTROL "Output diagnostic information",IDC_VERBOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,64,111,10,0,HIDC_VERBOSE
+ CONTROL "Update Main window during paused emulation",IDC_UPDATEINPAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,171,10,0,HIDC_UPDATEINPAUSE
+ CONTROL "Activate Integrated Debugger",IDC_DEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,88,118,10,0,HIDC_DEBUG
+
+ GROUPBOX "Debugscript",IDC_STATIC,6,104,211,50
+ EDITTEXT IDC_DEBUGSCRIPT,14,114,200,14,ES_AUTOHSCROLL | WS_DISABLED
+ PUSHBUTTON "Select Debugscript",IDC_SELECT_DEBUGSCRIPT,14,133,67,14,0,0,HIDC_SELECT_DEBUGSCRIPT
+ PUSHBUTTON "Reset Debugscript",IDC_RESET_DEBUGSCRIPT,149,133,65,14,0,0,HIDC_RESET_DEBUGSCRIPT
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,238,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,120,238,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_INPUT DIALOGEX 0, 0, 220, 240
+STYLE DS_FIXEDSYS | WS_CHILD | WS_CAPTION
+CAPTION "Controllers"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_JOYSTICK,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ CONTROL "Enable mouse input",IDC_USE_MOUSE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,40,86,10,0,
+ HIDC_USE_MOUSE
+ CONTROL "Enable steadykey support",IDC_STEADYKEY,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,52,95,10,0,
+ HIDC_STEADYKEY
+ GROUPBOX "",IDC_STATIC,4,64,103,74
+ CONTROL "Enable joystick input",IDC_JOYSTICK,"Button",
+ BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,10,64,78,10,0,
+ HIDC_JOYSTICK
+ GROUPBOX "Joystick deadzone",IDC_JDZTEXT,10,76,91,28
+ CONTROL "IntensitySlider",IDC_JDZ,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,15,88,60,10,0,HIDC_JDZ
+ RTEXT "0.3",IDC_JDZDISP,76,87,16,11,SS_CENTERIMAGE | NOT
+ WS_GROUP
+ GROUPBOX "Default input layout",IDC_STATIC,113,40,102,28
+ COMBOBOX IDC_DEFAULT_INPUT,119,50,90,53,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP,0,HIDC_DEFAULT_INPUT
+ GROUPBOX "",IDC_STATIC,113,71,102,66
+ CONTROL "Enable lightgun input",IDC_LIGHTGUN,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,71,80,10,0,
+ HIDC_LIGHTGUN
+ CONTROL "Offscreen shots reload",IDC_RELOAD,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,83,86,10,0,HIDC_RELOAD
+ CONTROL "Dual lightguns",IDC_DUAL_LIGHTGUN,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,96,86,10,0,
+ HIDC_DUAL_LIGHTGUN
+ CONTROL "Multiple keyboards",IDC_MULTIKEYBOARD,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,109,75,10,0,
+ HIDC_MULTIKEYBOARD
+ CONTROL "Multiple mice",IDC_MULTIMOUSE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,122,56,10,0,HIDC_MULTIMOUSE
+ GROUPBOX "Joystick saturation",IDC_JSATTEXT,10,106,91,28
+ CONTROL "IntensitySlider",IDC_JSAT,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,16,118,60,10,0,HIDC_JSAT
+ RTEXT "0.85",IDC_JSATDISP,76,116,16,11,SS_CENTERIMAGE | NOT
+ WS_GROUP
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
+ 0,0,HIDC_USE_DEFAULT
+ GROUPBOX "Joystickmap",IDC_STATIC,4,143,211,50
+ EDITTEXT IDC_JOYSTICKMAP,12,153,200,14,ES_AUTOHSCROLL |
+ WS_DISABLED
+ PUSHBUTTON "Select Joystickmap",IDC_SELECT_JOYSTICKMAP,12,172,67,14,
+ 0,0,HIDC_SELECT_JOYSTICKMAP
+ PUSHBUTTON "Reset Joystickmap",IDC_RESET_JOYSTICKMAP,147,172,65,14,
+ 0,0,HIDC_RESET_JOYSTICKMAP
+END
+
+IDD_PROP_MISC DIALOGEX 0, 0, 220, 240
+STYLE DS_FIXEDSYS | WS_CHILD | WS_CAPTION
+CAPTION "Miscellaneous"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_MAMEUI_ICON,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ CONTROL "Enable cheats",IDC_CHEAT,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,10,40,86,10,0,HIDC_CHEAT
+ CONTROL "Sleep when possible",IDC_SLEEP,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,10,52,86,10,0,HIDC_SLEEP
+
+ CONTROL "Skip game info",IDC_SKIP_GAME_INFO,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,64,96,10,0,
+ HIDC_SKIP_GAME_INFO
+ CONTROL "Save game state on exit",IDC_ENABLE_AUTOSAVE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,76,96,10,0,
+ HIDC_ENABLE_AUTOSAVE
+ CONTROL "Coin lockout",IDC_COINLOCKOUT,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,10,100,96,10,0,HIDC_COINLOCKOUT
+ GROUPBOX "Thread Priority",IDC_HIGH_PRIORITY_TEXT,7,112,103,34
+ CONTROL "Slider1",IDC_HIGH_PRIORITY,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,13,122,75,10,0,
+ HIDC_HIGH_PRIORITY
+ LTEXT "idle",IDC_STATIC,17,132,12,8
+ RTEXT "-15",IDC_HIGH_PRIORITYTXT,87,122,14,10,SS_CENTERIMAGE
+ RTEXT "real-time",IDC_STATIC,57,134,28,8
+ GROUPBOX "Snapshot view",IDC_STATIC,7,148,103,28
+ COMBOBOX IDC_SNAPVIEW,13,158,90,60,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_SNAPVIEW
+ GROUPBOX "Artwork options",IDC_STATIC,113,40,102,85
+ CONTROL "Backdrops",IDC_BACKDROPS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,50,86,10,0,HIDC_BACKDROPS
+ CONTROL "Bezels",IDC_BEZELS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,62,86,10,0,HIDC_BEZELS
+ CONTROL "Overlays",IDC_OVERLAYS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,74,84,10,0,HIDC_OVERLAYS
+ CONTROL "CPanels",IDC_CPANELS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,86,84,10,0
+ CONTROL "Marquees",IDC_MARQUEES,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,98,84,10,0
+ CONTROL "Crop artwork",IDC_ARTWORK_CROP,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,110,53,10,0,HIDC_ARTWORK_CROP
+ GROUPBOX "BIOS",IDC_STATIC,113,128,102,28
+ COMBOBOX IDC_BIOS,119,138,90,60,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_BIOS
+ GROUPBOX "",IDC_STATIC,7,178,208,28
+ CONTROL "Autoselect snapshot size",IDC_SNAPSIZE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,178,95,10,0,
+ HIDC_SNAPSIZE
+ LTEXT "Snapshotsize",IDC_SNAPSIZETEXT,11,189,44,11,
+ SS_CENTERIMAGE | NOT WS_GROUP
+ EDITTEXT IDC_SNAPSIZEWIDTH,122,187,32,12,ES_RIGHT |
+ ES_AUTOHSCROLL | ES_NUMBER,0,HIDC_SNAPSIZEWIDTH
+ EDITTEXT IDC_SNAPSIZEHEIGHT,172,187,32,12,ES_RIGHT |
+ ES_AUTOHSCROLL | ES_NUMBER,0,HIDC_SNAPSIZEHEIGHT
+ LTEXT "x",IDC_SNAPSIZEX,162,189,8,8
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
+ 0,0,HIDC_USE_DEFAULT
+// CONTROL "Show Menu",IDC_SHOW_MENU,"Button",
+// BS_AUTOCHECKBOX | WS_TABSTOP,119,160,86,10,0
+END
+
+IDD_PROP_VECTOR DIALOGEX 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Vector"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_MAMEUI_ICON,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+// CONTROL "Draw antialiased vectors",IDC_ANTIALIAS,"Button",
+// BS_AUTOCHECKBOX | WS_TABSTOP,10,40,92,10,0,
+// HIDC_ANTIALIAS
+ GROUPBOX "Beam width",IDC_BEAMTEXT,60,53,100,28
+ CONTROL "BeamSlider",IDC_BEAM,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,66,65,64,10,0,HIDC_BEAM
+ RTEXT "16.00",IDC_BEAMDISP,132,64,20,11,SS_CENTERIMAGE
+ GROUPBOX "Flicker",IDC_FLICKERTEXT,60,84,100,28
+ CONTROL "FlickerSlider",IDC_FLICKER,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,66,96,64,10,0,HIDC_FLICKER
+ RTEXT "100.00",IDC_FLICKERDISP,128,95,24,11,SS_CENTERIMAGE |
+ NOT WS_GROUP
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
+ 0,0,HIDC_USE_DEFAULT
+END
+
+IDD_MAIN DIALOGEX 0, 0, 364, 206
+STYLE DS_3DLOOK | DS_NOFAILCREATE | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | DS_SETFONT
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "MAMEUI - overwritten at runtime"
+CLASS "MainClass"
+FONT 8, "Verdana"
+BEGIN
+ CONTROL "",IDC_DIVIDER,"Static",SS_ETCHEDHORZ,0,5,304,1
+ CONTROL "Tree1",IDC_TREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS |
+ TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,5,28,48,172
+ CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE |
+ LVS_SHAREIMAGELISTS | LVS_OWNERDRAWFIXED | WS_BORDER | WS_TABSTOP,65,28,42,172
+ GROUPBOX "",IDC_SPLITTER,55,28,8,172,BS_NOTIFY | NOT WS_VISIBLE
+ GROUPBOX "",IDC_SPLITTER2,109,28,8,172,BS_NOTIFY | NOT WS_VISIBLE
+ CONTROL "",IDC_SSFRAME,"Static",SS_ETCHEDFRAME | SS_NOTIFY,121,11,181,194
+ CONTROL "",IDC_SSTAB,"SysTabControl32",TCS_HOTTRACK,121,0,181,18
+ CONTROL "",IDC_SSPICTURE,"Static",SS_BITMAP | NOT WS_VISIBLE,141,18,141,127
+ EDITTEXT IDC_HISTORY,129,150,167,49,ES_MULTILINE | ES_READONLY | NOT WS_BORDER | WS_VSCROLL | NOT WS_TABSTOP,0, HIDC_HISTORY
+END
+
+IDD_FILTERS DIALOGEX 0, 0, 190, 196
+STYLE DS_MODALFRAME | DS_CENTER | DS_3DLOOK | WS_POPUP | WS_CAPTION |
+ WS_SYSMENU
+EXSTYLE WS_EX_CONTEXTHELP
+CAPTION "Game Filters"
+FONT 8, "Tahoma"
+BEGIN
+ GROUPBOX "Game filters",IDC_STATIC,6,4,178,99
+ CONTROL "&Vector Graphics",IDC_FILTER_VECTOR,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,16,70,10,0,
+ HIDC_FILTER_VECTOR
+ CONTROL "C&lones",IDC_FILTER_CLONES,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,14,30,41,10,0,HIDC_FILTER_CLONES
+ CONTROL "Non-Wor&king",IDC_FILTER_NONWORKING,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,44,61,10,0,
+ HIDC_FILTER_NONWORKING
+ CONTROL "&Horizontal",IDC_FILTER_HORIZONTAL,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,58,57,10,0,
+ HIDC_FILTER_HORIZONTAL
+ CONTROL "&Unavailable",IDC_FILTER_UNAVAILABLE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,72,57,10,0,
+ HIDC_FILTER_UNAVAILABLE
+ CONTROL "Arcade",IDC_FILTER_ARCADE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,86,57,10,0
+ CONTROL "&Raster Graphics",IDC_FILTER_RASTER,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,100,16,70,10,0,
+ HIDC_FILTER_RASTER
+ CONTROL "Ori&ginals",IDC_FILTER_ORIGINALS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,100,30,47,10,0,
+ HIDC_FILTER_ORIGINALS
+ CONTROL "&Working",IDC_FILTER_WORKING,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,100,44,47,10,0,HIDC_FILTER_WORKING
+ CONTROL "&Vertical",IDC_FILTER_VERTICAL,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,100,58,47,10,0,HIDC_FILTER_VERTICAL
+ CONTROL "&Mechanical",IDC_FILTER_MECHANICAL,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,100,72,58,10,0,HIDC_FILTER_MECHANICAL
+ CONTROL "MESS",IDC_FILTER_MESS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,100,86,58,10,0,HIDC_FILTER_MECHANICAL
+ LTEXT "(*) = inherited from parent folder",IDC_INHERITED,14,72,
+ 99,10
+ CTEXT "Game filters allow customizing the games that are displayed in each folder by hiding games that match the filters applied.",
+ IDC_STATIC,6,108,178,27
+ GROUPBOX "&Description filter",IDC_STATIC,6,136,178,33
+ EDITTEXT IDC_FILTER_EDIT,14,148,162,13,ES_AUTOHSCROLL,0,
+ HIDC_FILTER_EDIT
+ DEFPUSHBUTTON "&OK",IDOK,42,175,50,14
+ PUSHBUTTON "&Cancel",IDCANCEL,98,175,50,14
+END
+
+IDD_RESET DIALOGEX 0, 0, 190, 122
+STYLE DS_MODALFRAME | DS_CENTER | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTEXTHELP
+CAPTION "Reset Options"
+FONT 8, "Tahoma"
+BEGIN
+ GROUPBOX "Categories",IDC_STATIC,6,4,178,70
+ CONTROL "&User Interface (Fonts, Colors, Sizes)",IDC_RESET_UI,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,146,10,0,
+ HIDC_RESET_UI
+ CONTROL "&Default game options",IDC_RESET_DEFAULT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,30,146,10,0,
+ HIDC_RESET_DEFAULT
+ CONTROL "&All games to use default options",IDC_RESET_GAMES,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,146,10,0,
+ HIDC_RESET_GAMES
+ CONTROL "&Folder 'filters'",IDC_RESET_FILTERS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,58,146,10,0,
+ HIDC_RESET_FILTERS
+ CTEXT "Select the options to be restored to the default settings.",
+ IDC_STATIC,6,79,178,20
+ DEFPUSHBUTTON "&OK",IDOK,42,101,50,14
+ PUSHBUTTON "&Cancel",IDCANCEL,98,101,50,14
+END
+
+
+IDD_INTERFACE_OPTIONS DIALOGEX 0, 0, 378, 225
+STYLE DS_MODALFRAME | DS_CENTER | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTEXTHELP
+CAPTION "Interface Options"
+FONT 8, "Tahoma"
+BEGIN
+ GROUPBOX "Machine Selection",IDC_STATIC,6,4,189,194
+ CONTROL "&Search for new machines on start",IDC_START_GAME_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,120,10,0,HIDC_START_GAME_CHECK
+ CONTROL "Allow selection by &joystick (requires restart)",IDC_JOY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30,180,10,0,HIDC_JOY_GUI
+ CONTROL "Allow selection by custom &key sequences",IDC_KEY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,176,10
+ CONTROL "Override Not Working icon with driver icon",IDC_OVERRIDE_REDX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,168,10
+ CONTROL "Hide &mouse cursor (requires restart)",IDC_HIDE_MOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,86,136,10,0,HIDC_HIDE_MOUSE
+ CONTROL "Inheritable Filters",IDC_FILTER_INHERIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,100,68,10
+ CONTROL "No offset for clones missing parent in view",IDC_NOOFFSET_CLONES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,114,148,10
+ GROUPBOX "Show History on Tab",IDC_STATIC,14,128,173,28
+ COMBOBOX IDC_HISTORY_TAB,57,138,88,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Snapshot Pattern",IDC_STATIC,202,4,170,28
+ GROUPBOX "Bookkeeping",IDC_STATIC,202,36,170,43
+ CONTROL "Reset all Play Statistics",IDC_RESET_PLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,48,100,10
+ GROUPBOX "Screenshot Area",IDC_STATIC,202,83,170,115
+ CONTROL "S&tretch screenshot larger than natural size",
+ IDC_STRETCH_SCREENSHOT_LARGER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,95,148,10,0,HIDC_STRETCH_SCREENSHOT_LARGER
+ GROUPBOX "Screenshot Cycletime in Seconds",IDC_STATIC,210,109,154,28
+ CONTROL "Slider1",IDC_CYCLETIMESEC,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,218,121,120,10,0,HIDC_CYCLETIMESEC
+ RTEXT "60",IDC_CYCLETIMESECTXT,340,120,13,10,SS_CENTERIMAGE
+ GROUPBOX "Screenshot Bordersize",IDC_STATIC,210,141,154,28
+ CONTROL "Slider1",IDC_SCREENSHOT_BORDERSIZE,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,218,153,120,10
+ RTEXT "100",IDC_SCREENSHOT_BORDERSIZETXT,340,152,13,10,SS_CENTERIMAGE
+ PUSHBUTTON "Set Screenshot Border Color",IDC_SCREENSHOT_BORDERCOLOR,210,176,154,14
+ DEFPUSHBUTTON "&OK",IDOK,136,204,50,14
+ PUSHBUTTON "&Cancel",IDCANCEL,192,204,50,14
+ COMBOBOX IDC_SNAPNAME,209,14,155,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SNAPNAME
+END
+
+IDD_CUSTOM_FILE DIALOG DISCARDABLE 0, 0, 190, 135
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Add Game To Custom Folder"
+FONT 8, "Tahoma"
+BEGIN
+ LTEXT "",IDC_CUSTOMFILE_GAME,6,6,175,10,SS_NOPREFIX |
+ SS_CENTERIMAGE
+ CONTROL "CustomTree",IDC_CUSTOM_TREE,"SysTreeView32",
+ TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
+ TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS |
+ TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,6,18,178,90
+ DEFPUSHBUTTON "OK",IDOK,42,114,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,98,114,50,14
+END
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDA_TAB_KEYS ACCELERATORS MOVEABLE PURE
+BEGIN
+ "1", ID_VIEW_TAB_SCREENSHOT, VIRTKEY, ALT, NOINVERT
+ "2", ID_VIEW_TAB_FLYER, VIRTKEY, ALT, NOINVERT
+ "3", ID_VIEW_TAB_CABINET, VIRTKEY, ALT, NOINVERT
+ "4", ID_VIEW_TAB_MARQUEE, VIRTKEY, ALT, NOINVERT
+ "5", ID_VIEW_TAB_TITLE, VIRTKEY, ALT, NOINVERT
+ "6", ID_VIEW_TAB_CONTROL_PANEL, VIRTKEY, ALT, NOINVERT
+ "7", ID_VIEW_TAB_PCB, VIRTKEY, ALT, NOINVERT
+ "8", ID_VIEW_TAB_HISTORY, VIRTKEY, ALT, NOINVERT
+ "A", ID_GAME_AUDIT, VIRTKEY, ALT, NOINVERT
+ "B", ID_VIEW_PAGETAB, VIRTKEY, ALT, NOINVERT
+ "D", ID_VIEW_FOLDERS, VIRTKEY, ALT, NOINVERT
+ "E", ID_TOOLBAR_EDIT, VIRTKEY, CONTROL, NOINVERT
+ "F", ID_CONTEXT_FILTERS, VIRTKEY, CONTROL, NOINVERT
+ "U", ID_FOLDER_AUDIT, VIRTKEY, ALT, NOINVERT
+ "P", ID_VIEW_PICTURE_AREA, VIRTKEY, ALT, NOINVERT
+ "R", ID_CONTEXT_SELECT_RANDOM, VIRTKEY, CONTROL, NOINVERT
+ "S", ID_VIEW_STATUS, VIRTKEY, ALT, NOINVERT
+ "T", ID_VIEW_TOOLBARS, VIRTKEY, ALT, NOINVERT
+ VK_F1, ID_HELP_CONTENTS, VIRTKEY, NOINVERT
+ VK_F11, ID_VIEW_FULLSCREEN, VIRTKEY, NOINVERT
+ VK_F5, ID_UPDATE_GAMELIST, VIRTKEY, NOINVERT
+ VK_NEXT, ID_UI_HISTORY_DOWN, VIRTKEY, CONTROL, NOINVERT
+ VK_PRIOR, ID_UI_HISTORY_UP, VIRTKEY, CONTROL, NOINVERT
+ VK_RETURN, ID_GAME_PROPERTIES, VIRTKEY, ALT, NOINVERT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO MOVEABLE PURE
+BEGIN
+ IDD_ABOUT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 289
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 123
+ END
+
+ IDD_DIRECTX, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 229
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 62
+ END
+
+ IDD_AUDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 280
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 187
+ HORZGUIDE, 19
+ END
+
+ IDD_DIRECTORIES, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 224
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 98
+ END
+
+ IDD_COLUMNS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 301
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 143
+ END
+
+ IDD_PROP_CONTROLLER, DIALOG
+ BEGIN
+ RIGHTMARGIN, 210
+ BOTTOMMARGIN, 154
+ END
+
+ IDD_PROP_SCREEN, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ VERTGUIDE, 7
+ VERTGUIDE, 123
+ BOTTOMMARGIN, 199
+ HORZGUIDE, 179
+ END
+
+ IDD_PROP_GAME, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 19
+ VERTGUIDE, 66
+ VERTGUIDE, 74
+ VERTGUIDE, 201
+ BOTTOMMARGIN, 268
+ END
+
+ IDD_PROP_AUDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 12
+ VERTGUIDE, 208
+ BOTTOMMARGIN, 198
+ HORZGUIDE, 38
+ END
+
+ IDD_PROP_DISPLAY, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ VERTGUIDE, 7
+ VERTGUIDE, 123
+ HORZGUIDE, 179
+ END
+
+ IDD_PROP_SOUND, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 50
+ BOTTOMMARGIN, 198
+ END
+
+ IDD_PROP_ADVANCED, DIALOG
+ BEGIN
+ LEFTMARGIN, 10
+ BOTTOMMARGIN, 240
+ END
+
+ IDD_PROP_INPUT, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 215
+ VERTGUIDE, 50
+ VERTGUIDE, 170
+ END
+
+ IDD_PROP_MISC, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 25
+ VERTGUIDE, 40
+ VERTGUIDE, 104
+ VERTGUIDE, 114
+ VERTGUIDE, 204
+ BOTTOMMARGIN, 236
+ END
+
+ IDD_PROP_VECTOR, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 50
+ BOTTOMMARGIN, 198
+ END
+
+ IDD_FILTERS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 178
+ END
+
+ IDD_RESET, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 175
+ VERTGUIDE, 18
+ VERTGUIDE, 164
+ TOPMARGIN, 7
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+
+
+
+IDB_ABOUT BITMAP "res\\about.bmp"
+IDB_TOOLBAR BITMAP "res\\toolbar.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Cursor
+//
+
+IDC_CURSOR_HSPLIT CURSOR "res\\splith.cur"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// RT_MANIFEST
+//
+
+1 RT_MANIFEST "res\\mameui.manifest"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_UI_FILE "Contains commands for working with the selected items"
+ IDS_UI_VIEW "Contains commands for manipulating the view"
+ IDS_UI_OPTIONS "Contains commands for user interface options"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_UI_HELP "Contains commands for displaying help"
+ IDS_VIEW_TOOLBAR "Show or hide the toolbar"
+ IDS_VIEW_STATUSBAR "Show or hide the status bar"
+ IDS_VIEW_FOLDERLIST "Show or hide the folder list"
+ IDS_VIEW_SCREENSHOT "Show or hide the screen shot"
+ IDS_VIEW_PICTURETABS "Show or hide tabs in the picture area"
+ IDS_VIEW_SPACER1 "Spacer"
+ IDS_VIEW_FULLSCREEN "Toggle full screen mode"
+ IDS_VIEW_SPACER2 "Spacer"
+ IDS_VIEW_SHOWPICTURES "Contains commands to select tabs shown in the picture area"
+ IDS_VIEW_SPACER3 "Spacer"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_VIEW_LARGEICONS "Display items by using large icons."
+ IDS_VIEW_SMALLICONS "Display items by using small icons."
+ IDS_VIEW_LIST "Displays items in a list."
+ IDS_VIEW_DETAILS "Displays detailed information about each item in the window."
+ IDS_VIEW_GROUPED "Displays items grouped by parent game"
+ IDS_VIEW_SPACER4 "Spacer"
+ IDS_VIEW_ARRANGE "Contains commands for sorting by various columns"
+ IDS_VIEW_LINEUPICONS "Arranges icons in a grid"
+ IDS_VIEW_SPACER5 "Spacer"
+ IDS_VIEW_REFRESH "Refresh game list"
+ IDS_VIEW_CONTEXTFILTERS "Allows filtering out games from a folder"
+ IDS_VIEW_CUSTOMIZEFIELDS
+ "Customize which columns are used in the game list"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_FILE_EXIT "Exit the application"
+ ID_FILE_PLAY "Play currently selected game"
+ ID_HELP_ABOUT "Displays program and copyright information"
+ ID_VIEW_LARGE_ICON "Display items by using large icons."
+ ID_VIEW_SMALL_ICON "Display items by using small icons."
+ ID_VIEW_LIST_MENU "Displays items in a list."
+ ID_VIEW_DETAIL "Displays detailed information about each item in the window."
+ ID_VIEW_GROUPED "Show items grouped by parent game"
+ ID_OPTIONS_FONT "Set game list and folder list font"
+ ID_OPTIONS_CLONE_COLOR "Set the clone font color"
+ ID_OPTIONS_DIR "Set directory configuration"
+ ID_OPTIONS_DEFAULTS "Set default game options"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_OPTIONS_RESET_DEFAULTS "Allow restoring options to 'sane' values."
+ ID_OPTIONS_INTERFACE "Customize interface options."
+ ID_FILE_AUDIT "Audit ROM and samples sets"
+ ID_FILE_PLAY_RECORD "Record a game for later playback"
+ ID_FILE_PLAY_BACK "Playback a recorded game"
+ ID_FILE_PLAY_RECORD_WAVE "Record the audio output of a game"
+ ID_FILE_PLAY_RECORD_MNG "Record the video output of a game"
+ ID_FILE_PLAY_RECORD_AVI "Record the complete output of a game"
+ ID_VIEW_PICTURE_AREA "Show or hide the picture area"
+ ID_HELP_CONTENTS "Display help contents"
+ ID_HELP_WHATS_NEWUI "New game changes"
+ ID_HELP_TROUBLE "Troubleshooting Documentation"
+ ID_HELP_RELEASE "MAME release notes"
+ ID_HELP_WHATS_NEW "What's new in MAME"
+ ID_HELP_CHEATS "How cheats work"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_CONTEXT_RESET_PLAYSTATS "Reset play stats for selected item"
+ ID_FOLDER_PROPERTIES "Display folder properties"
+ ID_FOLDER_AUDIT "Audit items in this folder"
+ ID_FILE_LOADSTATE "Play a game starting with the given savestate"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_VIEW_TAB_CABINET "Select Cabinet tab"
+ ID_VIEW_TAB_MARQUEE "Select Marquee tab"
+ ID_VIEW_TAB_TITLE "Select Title tab"
+ ID_VIEW_TAB_CONTROL_PANEL "Select Control panel tab"
+ ID_VIEW_TAB_PCB "Select PCB tab"
+ ID_VIEW_TAB_HISTORY "Select History tab"
+ ID_OPTIONS_BG "Set the background image"
+ ID_TOGGLE_TAB_SCREENSHOT "Enable the screenshot tab"
+ ID_TOGGLE_TAB_FLYER "Enable the flyer tab"
+ ID_TOGGLE_TAB_CABINET "Enable the cabinet tab"
+ ID_TOGGLE_TAB_MARQUEE "Enable the marquee tab"
+ ID_TOGGLE_TAB_TITLE "Enable the title tab"
+ ID_TOGGLE_TAB_CONTROL_PANEL "Enable the control panel tab"
+ ID_TOGGLE_TAB_PCB "Enable the PCB tab"
+ ID_TOGGLE_TAB_HISTORY "Enable the history tab"
+ ID_VIEW_FULLSCREEN "Toggle Fullscreen mode"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_CUSTOMIZE_FIELDS "Customize which columns are used in the game list"
+ ID_GAME_PROPERTIES "Display the properties of the selected item"
+ ID_VIEW_PAGETAB "Show or hide the tabs in the picture area"
+ ID_VIEW_FOLDERS "Show or hide the folder list"
+ ID_VIEW_TOOLBARS "Show or hide the toolbar"
+ ID_VIEW_STATUS "Show or hide the status bar"
+ ID_CONTEXT_FILTERS "Allows filtering out games from a folder"
+ ID_CONTEXT_RENAME_CUSTOM "Rename this folder"
+ ID_CONTEXT_ADD_CUSTOM "Add selected item to custom folder"
+ ID_CONTEXT_REMOVE_CUSTOM "Remove selected item from this folder"
+ ID_GAME_AUDIT "Audit the selected item"
+ ID_CONTEXT_SELECT_RANDOM "Randomly select a game."
+ ID_VIEW_TAB_SCREENSHOT "Select Snapshot tab"
+ ID_VIEW_TAB_FLYER "Select Flyer tab"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_VIEW_BYGAME "Sort items by game description"
+ ID_VIEW_BYDIRECTORY "Sort items by name"
+ ID_VIEW_BYMANUFACTURER "Sort items by manufacturer"
+ ID_VIEW_BYYEAR "Sort items by year"
+ ID_VIEW_BYTYPE "Sort items by type"
+ ID_VIEW_BYTIMESPLAYED "Sort by number of plays"
+ ID_VIEW_LINEUPICONS "Arranges icons in a grid"
+ ID_UPDATE_GAMELIST "Refresh game list"
+ ID_SORT_ASCENDING "Sort column in ascending (A-Z) order"
+ ID_SORT_DESCENDING "Sort column in descending (Z-A) order"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_FOLDER_SOURCEPROPERTIES
+ "Display properties for all games in this source file"
+ ID_FOLDER_VECTORPROPERTIES "Display properties for all vector based games"
+ ID_OPTIONS_HISTORY "Set the History file to use"
+ ID_OPTIONS_MAMEINFO "Set the Mameinfo file to use"
+END
+
+#endif // English (USA) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#include "hbmamevers.rc" // Version block
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/docs/release/src/osd/winui/help.cpp b/docs/release/src/osd/winui/help.cpp
new file mode 100644
index 00000000000..971c369bd86
--- /dev/null
+++ b/docs/release/src/osd/winui/help.cpp
@@ -0,0 +1,107 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+/***************************************************************************
+
+ help.c
+
+ Help wrapper code.
+
+***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+
+// MAME/MAMEUI headers
+#include "help.h"
+
+typedef HWND (WINAPI *HtmlHelpProc)(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData);
+
+/***************************************************************************
+ Internal structures
+***************************************************************************/
+
+/***************************************************************************
+ function prototypes
+***************************************************************************/
+
+static void Help_Load(void);
+
+/***************************************************************************
+ External function prototypes
+***************************************************************************/
+
+/***************************************************************************
+ External variables
+***************************************************************************/
+
+/***************************************************************************
+ Internal variables
+***************************************************************************/
+
+static HtmlHelpProc g_pHtmlHelp;
+static HMODULE g_hHelpLib;
+static DWORD g_dwCookie = 0;
+
+/**************************************************************************
+ External functions
+***************************************************************************/
+
+int HelpInit(void)
+{
+ g_pHtmlHelp = NULL;
+ g_hHelpLib = NULL;
+
+ g_dwCookie = 0;
+ HelpFunction(NULL, NULL, HH_INITIALIZE, (DWORD_PTR)&g_dwCookie);
+ return 0;
+}
+
+void HelpExit(void)
+{
+ HelpFunction(NULL, NULL, HH_CLOSE_ALL, 0);
+ HelpFunction(NULL, NULL, HH_UNINITIALIZE, (DWORD_PTR)&g_dwCookie);
+
+ g_dwCookie = 0;
+ g_pHtmlHelp = NULL;
+
+ if (g_hHelpLib)
+ {
+ FreeLibrary(g_hHelpLib);
+ g_hHelpLib = NULL;
+ }
+}
+
+HWND HelpFunction(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData)
+{
+ if (g_pHtmlHelp == NULL)
+ Help_Load();
+
+ if (g_pHtmlHelp)
+ return g_pHtmlHelp(hwndCaller, pszFile, uCommand, dwData);
+ else
+ return NULL;
+}
+
+/***************************************************************************
+ Internal functions
+***************************************************************************/
+
+static void Help_Load(void)
+{
+ g_hHelpLib = LoadLibrary(TEXT("hhctrl.ocx"));
+ if (g_hHelpLib)
+ {
+ FARPROC pProc = NULL;
+ pProc = GetProcAddress(g_hHelpLib, "HtmlHelpA");
+ if (pProc)
+ {
+ g_pHtmlHelp = (HtmlHelpProc)pProc;
+ }
+ else
+ {
+ FreeLibrary(g_hHelpLib);
+ g_hHelpLib = NULL;
+ }
+ }
+}
diff --git a/docs/release/src/osd/winui/help.h b/docs/release/src/osd/winui/help.h
new file mode 100644
index 00000000000..356e62994b7
--- /dev/null
+++ b/docs/release/src/osd/winui/help.h
@@ -0,0 +1,47 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef HELP_H
+#define HELP_H
+
+#if defined(__GNUC__)
+#define HH_DISPLAY_TOPIC 0
+#define HH_TP_HELP_CONTEXTMENU 16
+#define HH_TP_HELP_WM_HELP 17
+#define HH_CLOSE_ALL 18
+#define HH_INITIALIZE 28
+#define HH_UNINITIALIZE 29
+#else
+#include <htmlhelp.h>
+#endif
+
+typedef struct
+{
+ int nMenuItem;
+ BOOL bIsHtmlHelp;
+ LPCTSTR lpFile;
+} MAMEHELPINFO;
+
+extern const MAMEHELPINFO g_helpInfo[];
+
+#if !defined(MAMEUIHELP)
+#ifdef MESS
+#define MAMEUIHELP "messui.chm"
+#else
+#define MAMEUIHELP "mameui.chm"
+#endif
+#endif
+
+#if !defined(MAMEUICONTEXTHELP)
+#ifdef MESS
+#define MAMEUICONTEXTHELP "messui.chm::/cntx_help.txt"
+#else
+#define MAMEUICONTEXTHELP "mameui.chm::/cntx_help.txt"
+#endif
+#endif
+
+extern int HelpInit(void);
+extern void HelpExit(void);
+extern HWND HelpFunction(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData);
+
+#endif
diff --git a/docs/release/src/osd/winui/help/cntx_help.txt b/docs/release/src/osd/winui/help/cntx_help.txt
new file mode 100644
index 00000000000..61e8b1db51f
--- /dev/null
+++ b/docs/release/src/osd/winui/help/cntx_help.txt
@@ -0,0 +1,220 @@
+.topic HIDC_ADSTICK
+Selects appropriate host controller for emulated controls.
+.topic HIDC_ANTIALIAS
+Enables anti-aliasing of vector lines providing a smoother look.
+.topic HIDC_ARTWORK_CROP
+Enables cropping external artwork down to selected window or resolution
+.topic HIDC_ASPECT
+Enables manual override of MameUI's 4:3 or 3:4 aspect ratio calculation. Rarely used.
+.topic HIDC_ASPECTRATIOD
+Enables manual override of MameUI's 4:3 or 3:4 aspect ratio calculation. Rarely used.
+.topic HIDC_ASPECTRATION
+Enables manual override of MameUI's 4:3 or 3:4 aspect ratio calculation. Rarely used.
+.topic HIDC_AUDIO_LATENCY
+Selects the level of audio latency, adjusting this can often eliminate desync of the sound and associated scratchiness.
+.topic HIDC_AUTOFRAMESKIP
+Enables automatic frame skipping during emulation attempting to keep at 100%.
+.topic HIDC_BACKDROPS
+Enables the backdrops of artwork in supported games.
+.topic HIDC_BEAM
+Selects the width of the vector lines in vector games.
+.topic HIDC_BEZELS
+Enables the bezel artwork in supported games.
+.topic HIDC_BIOS
+Selects a particular BIOS in a driver family or individual games e.g. NeoGeo.
+.topic HIDC_BRIGHTCORRECT
+Selects the brightness level of the screen [but not artwork or UI].
+.topic HIDC_BROADCAST
+Enables programmatically broadcasting the game being played to attached devices.
+.topic HIDC_CHEAT
+Enables cheat capability using the in-game [tab] menu.
+.topic HIDC_COINLOCKOUT
+Enables arcade operator coin lockout behaviour.
+.topic HIDC_CONTRAST
+Selects the contrast level of the screen [but not artwork or UI].
+.topic HIDC_CYCLETIMESEC
+.topic HIDC_D3D_FILTER
+Enables bilinear filtering during image stretch.
+.topic HIDC_D3D_VERSION
+Selects the version of Direct3D to use, 9 by default.
+.topic HIDC_DEBUG
+.topic HIDC_DEFAULT_INPUT
+Selects .\ctrlr\*.cfg files to use for custom controller mappings.
+.topic HIDC_DIAL
+Selects appropriate host controller for emulated controls.
+.topic HIDC_DUAL_LIGHTGUN
+Enables support for dual light guns.
+.topic HIDC_ENABLE_AUTOSAVE
+Enables MameUI to use the contents of the \sav directory to restart a game at last quit.
+.topic HIDC_FILTER_CLONES
+Enables filtering out clones, leaving only parent games showing.
+.topic HIDC_FILTER_EDIT
+Allows typing in text to filter, including: gamename, description, driver, and manufacturer.
+.topic HIDC_FILTER_HORIZONTAL
+Enables filtering out horizontal games, leaving only vertical games showing.
+.topic HIDC_FILTER_NONWORKING
+Enables filtering out non-working games, leaving only working games showing.
+.topic HIDC_FILTER_ORIGINALS
+Enables filtering out parent games, leaving only clones showing.
+.topic HIDC_FILTER_RASTER
+Enables filtering out raster games, leaving only vector games showing.
+.topic HIDC_FILTER_UNAVAILABLE
+Enables filtering out unavailable games, leaving only available games showing.
+.topic HIDC_FILTER_VECTOR
+Enables filtering out vector games, leaving only raster games showing.
+.topic HIDC_FILTER_VERTICAL
+Enables filtering out vertical games, leaving only horizontal games showing.
+.topic HIDC_FILTER_WORKING
+Enables filtering out working games, leaving only non-working games showing.
+.topic HIDC_FLICKER
+Selects the flicker level for vector lines.
+.topic HIDC_FLIPX
+Enables flipping the screen horizontally.
+.topic HIDC_FLIPY
+Enables flipping the screen vertically.
+.topic HIDC_FRAMESKIP
+Selects the number of frames skipped during emulation.
+.topic HIDC_FSBRIGHTNESS
+Selects the level of the full-screen brightness including artwork and UI.
+.topic HIDC_FSCONTRAST
+Selects the level of the full-screen contrast including artwork and UI.
+.topic HIDC_FSGAMMA
+Selects the level of the full-screen gamma including artwork and UI.
+.topic HIDC_GAME_CAPTION
+Attempts to remove the titlebar from a windowed game.
+.topic HIDC_GAMMA
+Selects the gamma level of the screen [but not artwork or UI].
+.topic HIDC_HIDE_MOUSE
+Enables hiding the mouse cursor on launch, useful for fullscreen UI w/ keyboard controlled cabinets, etc.
+.topic HIDC_HIGH_PRIORITY
+Selects MameUI's thread priority, default is 0. Running at real-time 1 is not recommended for potential control lag and sound desync.
+.topic HIDC_HISTORY
+Enables display of the history.dat file if present in the root directory.
+.topic HIDC_HWSTRETCH
+Enables hardware stretch for DirectDraw.
+.topic HIDC_JDZ
+Selects the level for an analogue joystick's deadzone.
+.topic HIDC_JOY_GUI
+Enables controlling the MameUI GUI with a gamepad.
+.topic HIDC_JOYSTICK
+Enables gamepad control within games.
+.topic HIDC_JSAT
+Selects the level for an analogue joystick's saturation.
+.topic HIDC_KEEPASPECT
+Enables creating windows for games that are way out of proportion e.g. thick, or tall.
+.topic HIDC_LANGUAGECHECK
+.topic HIDC_LANGUAGEEDIT
+.topic HIDC_LIGHTGUN
+Enables lightgun devices.
+.topic HIDC_LIGHTGUNDEVICE
+Selects appropriate host controller for emulated controls.
+.topic HIDC_LOG
+Enables programmatic logging as a game is played, saved out to file.
+.topic HIDC_MAXIMIZE
+Enables maximizing the game window or creating a very small window.
+.topic HIDC_MOUSE
+Enables mouse support within games.
+.topic HIDC_MULTITHREAD_RENDERING
+Enables handing off the final video blit to a second thread. Still experimental [.118] and may cause issues.
+.topic HIDC_NUMSCREENS
+Selects number of screens for MameUI to produce, windowed or multi-head physical monitors.
+.topic HIDC_OVERLAYS
+Enables art overlays in supported games.
+.topic HIDC_PADDLE
+Selects appropriate host controller for emulated controls.
+.topic HIDC_PAUSEBRIGHT
+Selects level of brightness for screen when paused.
+.topic HIDC_PEDAL
+Selects appropriate host controller for emulated controls.
+.topic HIDC_POSITIONAL
+Selects appropriate host controller for emulated controls.
+.topic HIDC_PRESCALE
+Selects level of prescaling, the higher the number, the sharper the stretched filtered image.
+.topic HIDC_PROP_RESET
+Enables resetting recent changes to the open tab.
+.topic HIDC_RANDOM_BG
+Enables random GUI background selection on restart, *.png files in \bkground directory.
+.topic HIDC_REFRESH
+Selects host monitor refresh rate.
+.topic HIDC_REFRESHSPEED
+Enables altering the speed of gameplay to keep the refresh rate lower than the screen.
+.topic HIDC_RELOAD
+Enables reload functionality for second button on lightguns.
+.topic HIDC_RESET_DEFAULT
+Enables resetting of games to default settings.
+.topic HIDC_RESET_EFFECT
+Enables resetting and clearing out the *.png effect chosen.
+.topic HIDC_RESET_FILTERS
+Enables resetting and clearing filters applied to folders.
+.topic HIDC_RESET_GAMES
+Enables resetting games to use default options.
+.topic HIDC_RESET_UI
+Enables resetting the options to fresh MameUI install settings.
+.topic HIDC_ROTATE
+Selects rotation setting for game display. Use the Auto options for pivot LCDs.
+.topic HIDC_SAMPLERATE
+Selects the output samplerate for games.
+.topic HIDC_SAMPLES
+Enables the use of external samples.
+.topic HIDC_SCREEN
+Selects screenX depends on the number of screens setting. Allows different settings for each screen.
+.topic HIDC_SCREENSELECT
+Selects the physical monitor to display window or full-screen multi-head output.
+.topic HIDC_SELECT_EFFECT
+Selects a *.png file in the \artwork directory for creating monitor-like effects.
+.topic HIDC_SIZES
+Selects from DirectX interrogated resolutions.
+.topic HIDC_SKIP_GAME_INFO
+Enables skipping game info screen when games started.
+.topic HIDC_SPEED
+Selects the speed of gameplay, relative to realtime; smaller numbers are slower.
+.topic HIDC_SLEEP
+Enables giving more timeslices back to the system, allowing MameUI to 'play nicer' with other apps.
+.topic HIDC_START_GAME_CHECK
+Enables running a mini-audit on application launch.
+.topic HIDC_STEADYKEY
+Enables the steadykey hack.
+.topic HIDC_STRETCH_SCREENSHOT_LARGER
+Enables increasing the size of the art pane items if the window is expanded.
+.topic HIDC_SWITCHRES
+Enables the switching of resolutions in fullscreen gaming.
+.topic HIDC_SYNCREFRESH
+Enables syncing the game internal speed to the host monitor.
+.topic HIDC_THROTTLE
+Enables throttling games to run at 100%.
+.topic HIDC_TRACKBALL
+Selects appropriate host controller for emulated controls.
+.topic HIDC_TRIPLE_BUFFER
+Enables the use of triple buffering during fullscreen gaming.
+.topic HIDC_USE_DEFAULT
+Enables reseting to default.
+.topic HIDC_USE_MOUSE
+Selects appropriate host controller for emulated controls.
+.topic HIDC_USE_SOUND
+Enables sound within games.
+.topic HIDC_VIDEO_MODE
+Selects the default rendering method.
+.topic HIDC_VIEW
+Selects the view in use in games.
+.topic HIDC_VOLUME
+Selects the volume level in games.
+.topic HIDC_WAITVSYNC
+Enables waiting for vertical sync.
+.topic HIDC_WINDOWED
+Enables running games in a window.
+.topic HIDC_HLSL_ALPHA
+Adjusts the alpha.
+.topic HIDC_HLSL_CURV
+Adjusts the curvature.
+.topic HIDC_HLSL_SAT
+Adjusts the saturation.
+.topic HIDC_HLSL_SHADOW
+Adjusts the effect of the shadowmask on the picture.
+.topic HIDC_HLSL_PIN
+Adjusts the pincushion distortion.
+.topic HIDC_HLSL_FLOOR
+.topic HIDC_HLSL_SCALE
+.topic HIDC_HLSL_POWER
+.topic HIDC_HLSL_PLIFE
+.topic HIDC_HLSL_ON
+Enables HLSL video enhancements.
diff --git a/docs/release/src/osd/winui/help/docs/Command Line Settings.htm b/docs/release/src/osd/winui/help/docs/Command Line Settings.htm
new file mode 100644
index 00000000000..8752595f429
--- /dev/null
+++ b/docs/release/src/osd/winui/help/docs/Command Line Settings.htm
@@ -0,0 +1,1377 @@
+
+<head>
+<style type="text/css">
+.style1 {
+ font-family: Arial, Helvetica, sans-serif;
+}
+.style2 {
+ font-size: x-small;
+}
+</style>
+</head>
+
+<body style="background-image: url('../images/bkground.gif')">
+
+<span class="style1"><span class="style2"><strong>This file describes general usage
+information about MAME. It is intended<br>
+to cover aspects of using and configuring the program that are common<br>
+across operating systems. For additional OS-specific options, please see<br>
+the separate documentation for your particular version of MAME.</strong></strong><br>
+<br>
+<br>
+Using the program<br>
+-----------------<br>
+<br>
+The usual way to run MAME is by telling it to run a particular game:<br>
+<br>
+mame &lt;gamename&gt; [options]<br>
+<br>
+For example:<br>
+<br>
+mame robby -nosound<br>
+<br>
+...will run Robby Roto without sound. There are many, many options<br>
+available. All commonly supported options are listed below. Options that<br>
+are specific to one operating system or version of MAME will be listed<br>
+in a separate document.<br>
+<br>
+An alternative way to run MAME is to give it a command:<br>
+<br>
+mame &lt;command&gt; [parameters]<br>
+<br>
+For example:<br>
+<br>
+mame -listsource gridlee<br>
+<br>
+...will print the name of the source file where the gridlee driver lives<br>
+to the screen. There are just a handful of these commands in MAME. They<br>
+are all listed below, just before the options list.<br>
+<br>
+<br>
+<br>
+Default Keys<br>
+------------<br>
+<br>
+All the keys below are fully configurable in the user interface. This list<br>
+shows the standard keyboard configuration.<br>
+<br>
+Tab Toggles the configuration menu.<br>
+<br>
+~ Toggles the On Screen Display. When the on-screen display is<br>
+visible, you can use the following keys to control it:<br>
+<br>
+Up - select previous parameter to modify<br>
+Down - select next parameter to modify<br>
+Enter - reset parameter value to its default<br>
+<br>
+Left - decrease the value of the selected parameter<br>
+Control+Left - decrease the value by 10x<br>
+Shift+Left - decrease the value by 0.1x<br>
+Alt+Left - decrease the value by the smallest amount<br>
+<br>
+Right - increase the value of the selected parameter<br>
+Control+Right - increase the value by 10x<br>
+Shift+Right - increase the value by 0.1x<br>
+Alt+Right - increase the value by the smallest amount<br>
+<br>
+P Pauses the game.<br>
+<br>
+Shift+P While paused, advances to next frame.<br>
+<br>
+F2 Service Mode for games that support it.<br>
+<br>
+F3 Resets the game.<br>
+<br>
+Shift+F3 Performs a &quot;hard reset&quot;, which tears everything down and re-<br>
+creates it from scratch. This is a more thorough and complete<br>
+reset than an F3.<br>
+<br>
+F4 Shows the game palette, decoded GFX, and any tilemaps. Use the<br>
+Enter key to switch between the three modes (palette, graphics,<br>
+and tilemaps). Press F4 again to turn off the display. The key<br>
+controls in each mode vary slightly:<br>
+<br>
+* Palette/colortable mode:<br>
+[ ] - switch between palette and colortable modes<br>
+Up/Down - scroll up/down one line at a time<br>
+Page Up/Page Down - scroll up/down one page at a time<br>
+Home/End - move to top/bottom of list<br>
+-/+ - increase/decrease the number of colors per row<br>
+Enter - switch to graphics viewer<br>
+<br>
+* Graphics mode:<br>
+[ ] - switch between different graphics sets<br>
+Up/Down - scroll up/down one line at a time<br>
+Page Up/Page Down - scroll up/down one page at a time<br>
+Home/End - move to top/bottom of list<br>
+Left/Right - change color displayed<br>
+R - rotate tiles 90 degrees clockwise<br>
+-/+ - increase/decrease the number of tiles per row<br>
+Enter - switch to tilemap viewer<br>
+<br>
+* Tilemap mode:<br>
+[ ] - switch between different tilemaps<br>
+Up/Down/Left/Right - scroll 8 pixels at a time<br>
+Shift+Up/Down/Left/Right - scroll 1 pixel at a time<br>
+Control+Up/Down/Left/Right - scroll 64 pixels at a time<br>
+R - rotate tilemap view 90 degrees clockwise<br>
+-/+ - increase/decrease the zoom factor<br>
+Enter - switch to palette/colortable mode<br>
+<br>
+Note: Not all games have decoded graphics and/or tilemaps.<br>
+<br>
+F6 Toggle cheat mode (if started with &quot;-cheat&quot;).<br>
+<br>
+F7 Load a save state. You will be requested to press a key to<br>
+determine which save state you wish to load. Note that the save<br>
+state feature is not supported for a large number of drivers. If<br>
+support is not enabled for a given driver, you will receive a<br>
+warning when attempting to save or load.<br>
+<br>
+Shift+F7 Create a save state. Requires an additional keypress to identify<br>
+the state, similar to the load option above.<br>
+<br>
+F8 Decrease frame skip on the fly.<br>
+<br>
+F9 Increase frame skip on the fly.<br>
+<br>
+F10 Toggle speed throttling.<br>
+<br>
+F11 Toggles speed display.<br>
+<br>
+Shift+F11 Toggles internal profiler display (if compiled in).<br>
+<br>
+F12 Saves a screen snapshot.<br>
+<br>
+Insert Fast forward. While held, runs the game with throttling disabled<br>
+and with the maximum frameskip.<br>
+<br>
+Escape Exits emulator.<br>
+<br>
+<br>
+<br>
+<br>
+Core commands<br>
+-------------<br>
+<br>
+-help / -h / -?<br>
+<br>
+Displays current MAME version and copyright notice.<br>
+<br>
+-validate / -valid<br>
+<br>
+Performs internal validation on every driver in the system. Run this<br>
+before submitting changes to ensure that you haven't violated any of<br>
+the core system rules.<br>
+<br>
+<br>
+<br>
+Configuration commands<br>
+----------------------<br>
+<br>
+-createconfig / -cc<br>
+<br>
+Creates the default mame.ini file. All the configuration options<br>
+(not commands) described below can be permanently changed by editing<br>
+this configuration file.<br>
+<br>
+-showconfig / -sc<br>
+<br>
+Displays the current configuration settings. If you route this to a<br>
+file, you can use it as an INI file. For example, the command:<br>
+<br>
+mame -showconfig &gt;mame.ini<br>
+<br>
+is equivalent to -createconfig.<br>
+<br>
+-showusage / -su<br>
+<br>
+Displays a summary of all the command line options. For options that<br>
+are not mentioned here, the short summary given by &quot;mame -showusage&quot;<br>
+is usually sufficient.<br>
+<br>
+<br>
+<br>
+Frontend commands<br>
+-----------------<br>
+<br>
+Note: By default, all the '-list' commands below write info to the screen.<br>
+If you wish to write the info to a textfile instead, add this to the end<br>
+of your command:<br>
+<br>
+&gt; filename<br>
+<br>
+...where 'filename' is the textfile's path and name<br>
+(e.g., c:\mame\list.txt).<br>
+<br>
+-listxml / -lx [&lt;gamename|wildcard&gt;]<br>
+<br>
+List comprehensive details for all of the supported games. The output<br>
+is quite long, so it is usually better to redirect this into a file.<br>
+The output is in XML format. By default all games are listed; however,<br>
+you can limit this list by specifying a driver name or wildcard after<br>
+the -listxml command.<br>
+<br>
+-listfull / -ll [&lt;gamename|wildcard&gt;]<br>
+<br>
+Displays a list of game driver names and descriptions. By default all<br>
+games are listed; however, you can limit this list by specifying a<br>
+driver name or wildcard after the -listfull command.<br>
+<br>
+-listsource / -ls [&lt;gamename|wildcard&gt;]<br>
+<br>
+Displays a list of drivers and the names of the source files their<br>
+game drivers live in. Useful for finding which driver a game runs on<br>
+in order to fix bugs. By default all games are listed; however, you<br>
+can limit this list by specifying a driver name or wildcard after<br>
+the -listsource command.<br>
+<br>
+-listclones / -lc [&lt;gamename|wildcard&gt;]<br>
+<br>
+Displays a list of clones. By default all clones are listed; however,<br>
+you can limit this list by specifying a driver name or wildcard after<br>
+the -listsource command.<br>
+<br>
+-listcrc<br>
+<br>
+Displays a full list of CRCs of all ROM images referenced by all<br>
+drivers within MAME.<br>
+<br>
+-listroms &lt;gamename&gt;<br>
+<br>
+Displays a list of ROM images referenced by the specified game.<br>
+<br>
+-listsamples &lt;gamename&gt;<br>
+<br>
+Displays a list of samples referenced by the specified game.<br>
+<br>
+-verifyroms [&lt;gamename|wildcard&gt;]<br>
+<br>
+Checks for invalid or missing ROM images. By default all drivers that<br>
+have valid ZIP files or directories in the rompath are verified;<br>
+however, you can limit this list by specifying a driver name or<br>
+wildcard after the -verifyroms command.<br>
+<br>
+-verifysamples [&lt;gamename|wildcard&gt;]<br>
+<br>
+Checks for invalid or missing samples. By default all drivers that<br>
+have valid ZIP files or directories in the samplepath are verified;<br>
+however, you can limit this list by specifying a driver name or<br>
+wildcard after the -verifyroms command.<br>
+<br>
+-romident<br>
+<br>
+Attempts to identify ROM files, if they are known to MAME, in the<br>
+specified .zip file or directory. This command can be used to try and<br>
+identify ROM sets taken from unknown boards. On exit, the errorlevel<br>
+is returned as one of the following:<br>
+<br>
+0: means all files were identified<br>
+7: means all files were identified except for 1 or more &quot;non-ROM&quot;<br>
+files<br>
+8: means some files were identified<br>
+9: means no files were identified<br>
+<br>
+<br>
+<br>
+Configuration options<br>
+---------------------<br>
+<br>
+-[no]readconfig / -[no]rc<br>
+<br>
+Enables or disables the reading of the config files. When enabled<br>
+(which is the default), MAME reads the following config files in order:<br>
+<br>
+- mame.ini<br>
+- &lt;mymame&gt;.ini (i.e. if MAME was renamed mame060.exe, MAME<br>
+parses mame060.ini here)<br>
+- debug.ini (if the debugger is enabled)<br>
+- vector.ini (for vector games only)<br>
+- &lt;driver&gt;.ini (based on the source filename of the driver)<br>
+- &lt;parent&gt;.ini (for clones only, may be called recursively)<br>
+- &lt;gamename&gt;.ini<br>
+<br>
+The settings in the later ini's override those in the earlier ini's.<br>
+So, for example, if you wanted to disable overlay effects in the<br>
+vector games, you can create a vector.ini with the &quot;effect none&quot; line<br>
+in it, and it will override whatever effect value you have in your<br>
+mame.ini. The default is ON (-readconfig).<br>
+<br>
+<br>
+<br>
+Core search path options<br>
+------------------------<br>
+<br>
+-rompath / -rp &lt;path&gt;<br>
+<br>
+Specifies a list of paths within which to find ROM or hard disk images.<br>
+Multiple paths can be specified by separating them with semicolons.<br>
+The default is 'roms' (that is, a directory &quot;roms&quot; in the same directory<br>
+as the MAME executable).<br>
+<br>
+-samplepath / -sp &lt;path&gt;<br>
+<br>
+Specifies a list of paths within which to find sample files. Multiple<br>
+paths can be specified by separating them with semicolons. The default<br>
+is 'samples' (that is, a directory &quot;samples&quot; in the same directory as<br>
+the MAME executable).<br>
+<br>
+-artpath / -artwork_directory &lt;path&gt;<br>
+<br>
+Specifies a list of paths within which to find artwork files. Multiple<br>
+paths can be specified by separating them with semicolons. The default<br>
+is 'artwork' (that is, a directory &quot;artwork&quot; in the same directory as<br>
+the MAME executable).<br>
+<br>
+-ctrlrpath / -ctrlr_directory &lt;path&gt;<br>
+<br>
+Specifies a list of paths within which to find controller-specific<br>
+configuration files. Multiple paths can be specified by separating<br>
+them with semicolons. The default is 'ctrlr' (that is, a directory<br>
+&quot;ctrlr&quot; in the same directory as the MAME executable).<br>
+<br>
+-inipath &lt;path&gt;<br>
+<br>
+Specifies a list of paths within which to find .INI files. Multiple<br>
+paths can be specified by separating them with semicolons. The default<br>
+is '.;ini' (that is, search in the current directory first, and then<br>
+in the directory &quot;ini&quot; in the same directory as the MAME executable).<br>
+<br>
+-fontpath &lt;path&gt;<br>
+<br>
+Specifies a list of paths within which to find .BDF font files. Multiple<br>
+paths can be specified by separating them with semicolons. The default<br>
+is '.' (that is, search in the same directory as the MAME executable).<br>
+<br>
+-crosshairpath &lt;path&gt;<br>
+<br>
+Specifies a list of paths within which to find crosshair files. Multiple<br>
+paths can be specified by separating them with semicolons. The default<br>
+is 'crsshair' (that is, a directory &quot;crsshair&quot; in the same directory as<br>
+the MAME executable). If the Crosshair is set to default in the menu,<br>
+MAME will look for gamename\cross#.png and then cross#.png in the<br>
+specified crsshairpath, where # is the player number. Failing that,<br>
+MAME will use built-in default crosshairs.<br>
+<br>
+<br>
+Core Output Directory Options<br>
+-----------------------------<br>
+<br>
+-cfg_directory &lt;path&gt;<br>
+<br>
+Specifies a single directory where configuration files are stored.<br>
+Configuration files store user configurable settings that are read at<br>
+startup and written when MAME exits. The default is 'cfg' (that is,<br>
+a directory &quot;cfg&quot; in the same directory as the MAME executable). If<br>
+this directory does not exist, it will be automatically created.<br>
+<br>
+-nvram_directory &lt;path&gt;<br>
+<br>
+Specifies a single directory where NVRAM files are stored. NVRAM files<br>
+store the contents of EEPROM and non-volatile RAM (NVRAM) for games<br>
+which used this type of hardware. This data is read at startup and<br>
+written when MAME exits. The default is 'nvram' (that is, a directory<br>
+&quot;nvram&quot; in the same directory as the MAME executable). If this<br>
+directory does not exist, it will be automatically created.<br>
+<br>
+-memcard_directory &lt;path&gt;<br>
+<br>
+Specifies a single directory where memory card files are stored.<br>
+Memory card files store the contents of removable memory cards for<br>
+games which used this type of hardware. This data is read and written<br>
+under control of the user via the &quot;Memory Card&quot; menu in the user<br>
+interface. The default is 'memcard' (that is, a directory &quot;memcard&quot;<br>
+in the same directory as the MAME executable). If this directory does<br>
+not exist, it will be automatically created.<br>
+<br>
+-input_directory &lt;path&gt;<br>
+<br>
+Specifies a single directory where input recording files are stored.<br>
+Input recordings are created via the -record option and played back<br>
+via the -playback option. The default is 'inp' (that is, a directory<br>
+&quot;inp&quot; in the same directory as the MAME executable). If this directory<br>
+does not exist, it will be automatically created.<br>
+<br>
+-state_directory &lt;path&gt;<br>
+<br>
+Specifies a single directory where save state files are stored. Save<br>
+state files are read and written either upon user request, or when<br>
+using the -autosave option. The default is 'sta' (that is, a directory<br>
+&quot;sta&quot; in the same directory as the MAME executable). If this directory<br>
+does not exist, it will be automatically created.<br>
+<br>
+-snapshot_directory &lt;path&gt;<br>
+<br>
+Specifies a single directory where screen snapshots are stored, when<br>
+requested by the user. The default is 'snap' (that is, a directory<br>
+&quot;snap&quot; in the same directory as the MAME executable). If this<br>
+directory does not exist, it will be automatically created.<br>
+<br>
+-diff_directory &lt;path&gt;<br>
+<br>
+Specifies a single directory where hard drive differencing files are<br>
+stored. Hard drive differencing files store any data that is written<br>
+back to a hard disk image, in order to preserve the original image.<br>
+The differencing files are created at startup when a game with a hard<br>
+disk image. The default is 'diff' (that is, a directory &quot;diff&quot; in the<br>
+same directory as the MAME executable). If this directory does not<br>
+exist, it will be automatically created.<br>
+<br>
+-comment_directory &lt;path&gt;<br>
+<br>
+Specifies a single directory where debugger comment files are stored.<br>
+Debugger comment files are written by the debugger when comments are<br>
+added to the disassembly for a game. The default is 'comments' (that<br>
+is, a directory &quot;comments&quot; in the same directory as the MAME<br>
+executable). If this directory does not exist, it will be<br>
+automatically created.<br>
+<br>
+<br>
+<br>
+Core Filename Options<br>
+---------------------<br>
+<br>
+-cheat_file &lt;filename&gt;<br>
+<br>
+Specifies the name of the cheat database file. The default is<br>
+'cheat.dat'.<br>
+<br>
+<br>
+<br>
+Core state/playback options<br>
+---------------------------<br>
+<br>
+-state &lt;slot&gt;<br>
+<br>
+Immediately after starting the specified game, will cause the save<br>
+state in the specified &lt;slot&gt; to be loaded.<br>
+<br>
+-[no]autosave<br>
+<br>
+When enabled, automatically creates a save state file when exiting<br>
+MAME and automatically attempts to reload it when later starting MAME<br>
+with the same game. This only works for games that have explicitly<br>
+enabled save state support in their driver. The default is OFF<br>
+(-noautosave).<br>
+<br>
+-playback / -pb &lt;filename&gt;<br>
+<br>
+Specifies a file from which to play back a series of game inputs. This<br>
+feature does not work reliably for all games, but can be used to watch<br>
+a previously recorded game session from start to finish. In order to<br>
+make things consistent, you should only record and playback with all<br>
+configuration (.cfg), NVRAM (.nv), and memory card files deleted. The<br>
+default is NULL (no playback).<br>
+<br>
+-record / -rec &lt;filename&gt;<br>
+<br>
+Specifies a file to record all input from a game session. This can be<br>
+used to record a game session for later playback. This feature does<br>
+not work reliably for all games, but can be used to watch a previously<br>
+recorded game session from start to finish. In order to make things<br>
+consistent, you should only record and playback with all configuration<br>
+(.cfg), NVRAM (.nv), and memory card files deleted. The default is<br>
+NULL (no recording).<br>
+<br>
+-snapname &lt;name&gt;<br>
+<br>
+Describes how MAME should name files for snapshots. &lt;name&gt; is a string<br>
+that provides a template that is used to generate a filename. Three<br>
+simple substitutions are provided: the / character represents the<br>
+path separator on any target platform (even Windows); the string %g<br>
+represents the driver name of the current game; and the string %i<br>
+represents an incrementing index. If %i is omitted, then each<br>
+snapshot taken will overwrite the previous one; otherwise, MAME will<br>
+find the next empty value for %i and use that for a filename. The<br>
+default is %g/%i, which creates a separate folder for each game,<br>
+and names the snapshots under it starting with 0000 and increasing<br>
+from there.<br>
+<br>
+-snapsize &lt;width&gt;x&lt;height&gt;<br>
+<br>
+Hard-codes the size for snapshots and movie recording. By default,<br>
+MAME will create snapshots at the game's current resolution in raw<br>
+pixels, and will create movies at the game's starting resolution in<br>
+raw pixels. If you specify this option, then MAME will create both<br>
+snapshots and movies at the size specified, and will bilinear filter<br>
+the result. Note that this size does not automatically rotate if the<br>
+game is vertically oriented. The default is 'auto'.<br>
+<br>
+-snapview &lt;viewname&gt;<br>
+<br>
+Specifies the view to use when rendering snapshots and movies. By<br>
+default, both use a special 'internal' view, which renders a separate<br>
+snapshot per screen or renders movies only of the first screen. By<br>
+specifying this option, you can override this default behavior and<br>
+select a single view that will apply to all snapshots and movies.<br>
+Note that &lt;viewname&gt; does not need to be a perfect match; rather, it<br>
+will select the first view whose name matches all the characters<br>
+specified by &lt;viewname&gt;. For example, -snapview native will match the<br>
+&quot;Native (15:14)&quot; view even though it is not a perfect match.<br>
+&lt;viewname&gt; can also be 'auto', which selects the first view with all<br>
+screens present. The default value is 'internal'.<br>
+<br>
+-mngwrite &lt;filename&gt;<br>
+<br>
+Writes each video frame to the given &lt;filename&gt; in MNG format,<br>
+producing an animation of the game session. Note that -mngwrite only<br>
+writes video frames; it does not save any audio data. Use -wavwrite<br>
+for that, and reassemble the audio/video using offline tools. The<br>
+default is NULL (no recording).<br>
+<br>
+-aviwrite &lt;filename&gt;<br>
+<br>
+Stream video and sound data to the given &lt;filename&gt; in AVI format,<br>
+producing an animation of the game session complete with sound. The<br>
+default is NULL (no recording).<br>
+<br>
+-wavwrite &lt;filename&gt;<br>
+<br>
+Writes the final mixer output to the given &lt;filename&gt; in WAV format,<br>
+producing an audio recording of the game session. The default is<br>
+NULL (no recording).<br>
+<br>
+-[no]burnin<br>
+<br>
+Tracks brightness of the screen during play and at the end of <br>
+emulation generates a PNG that can be used to simulate burn-in<br>
+effects on other games. The resulting PNG is created such that the<br>
+least used-areas of the screen are fully white (since burned-in areas <br>
+are darker, all other areas of the screen must be lightened a touch).<br>
+The intention is that this PNG can be loaded via an artwork file with<br>
+a low alpha (e.g, 0.1-0.2 seems to work well) and blended over the<br>
+entire screen. The PNG files are saved in the snap directory under <br>
+the gamename/burnin-&lt;screen.name&gt;.png. The default is OFF (-noburnin).<br>
+<br>
+<br>
+<br>
+Core performance options<br>
+------------------------<br>
+<br>
+-[no]autoframeskip / -[no]afs<br>
+<br>
+Automatically determines the frameskip level while you're playing the<br>
+game, adjusting it constantly in a frantic attempt to keep the game<br>
+running at full speed. Turning this on overrides the value you have<br>
+set for -frameskip below. The default is OFF (-noautoframeskip).<br>
+<br>
+-frameskip / -fs &lt;level&gt;<br>
+<br>
+Specifies the frameskip value. This is the number of frames out of<br>
+every 12 to drop when running. For example, if you say -frameskip 2,<br>
+then MAME will display 10 out of every 12 frames. By skipping those<br>
+frames, you may be able to get full speed in a game that requires more<br>
+horsepower than your computer has. The default value is -frameskip 0,<br>
+which skips no frames.<br>
+<br>
+-seconds_to_run / -str &lt;seconds&gt;<br>
+<br>
+This option can be used for benchmarking and automated testing. It tells<br>
+MAME to stop execution after a fixed number of seconds. By combining<br>
+this with a fixed set of other command line options, you can set up a<br>
+consistent environment for benchmarking MAME performance. In addition,<br>
+upon exit, the -str option will write a screenshot called final.png<br>
+to the game's snapshot directory.<br>
+<br>
+-[no]throttle<br>
+<br>
+Configures the default thottling setting. When throttling is on, MAME<br>
+attempts to keep the game running at the game's intended speed. When<br>
+throttling is off, MAME runs the game as fast as it can. Note that the<br>
+fastest speed is more often than not limited by your graphics card,<br>
+especially for older games. The default is ON (-throttle).<br>
+<br>
+-[no]sleep<br>
+<br>
+Allows MAME to give time back to the system when running with -throttle.<br>
+This allows other programs to have some CPU time, assuming that the<br>
+game isn't taxing 100% of your CPU resources. This option can<br>
+potentially cause hiccups in performance if other demanding programs<br>
+are running. The default is ON (-sleep).<br>
+<br>
+-speed &lt;factor&gt;<br>
+<br>
+Changes the way MAME throttles gameplay such that the game runs at some<br>
+multiplier of the original speed. A &lt;factor&gt; of 1.0 means to run the<br>
+game at its normal speed. A &lt;factor&gt; of 0.5 means run at half speed,<br>
+and a &lt;factor&gt; of 2.0 means run at 2x speed. Note that changing this<br>
+value affects sound playback as well, which will scale in pitch<br>
+accordingly. The internal resolution of the fraction is two decimal<br>
+places, so a value of 1.002 is the same as 1.0. The default is 1.0.<br>
+<br>
+-[no]refreshspeed / -[no]rs<br>
+<br>
+Allows MAME to dynamically adjust the gameplay speed such that it does<br>
+not exceed the slowest refresh rate for any targeted monitors in your<br>
+system. Thus, if you have a 60Hz monitor and run a game that is<br>
+actually designed to run at 60.6Hz, MAME will dynamically change the<br>
+speed down to 99% in order to prevent sound hiccups or other<br>
+undesirable side effects of running at a slower refresh rate. The<br>
+default is OFF (-norefreshspeed).<br>
+<br>
+<br>
+<br>
+Core rotation options<br>
+---------------------<br>
+<br>
+-[no]rotate<br>
+<br>
+Rotate the game to match its normal state (horizontal/vertical). This<br>
+ensures that both vertically and horizontally oriented games show up<br>
+correctly without the need to rotate your monitor. If you want to keep<br>
+the game displaying 'raw' on the screen the way it would have in the<br>
+arcade, turn this option OFF. The default is ON (-rotate).<br>
+<br>
+-[no]ror<br>
+-[no]rol<br>
+<br>
+Rotate the game screen to the right (clockwise) or left (counter-<br>
+clockwise) relative to either its normal state (if -rotate is<br>
+specified) or its native state (if -norotate is specified). The<br>
+default for both of these options is OFF (-noror -norol).<br>
+<br>
+-[no]flipx<br>
+-[no]flipy<br>
+<br>
+Flip (mirror) the game screen either horizontally (-flipx) or<br>
+vertically (-flipy). The flips are applied after the -rotate and<br>
+-ror/-rol options are applied. The default for both of these options<br>
+is OFF (-noflipx -noflipy).<br>
+<br>
+-[no]autoror<br>
+-[no]autorol<br>
+<br>
+These options are designed for use with pivoting screens that only<br>
+pivot in a single direction. If your screen only pivots clockwise,<br>
+use -autorol to ensure that the game will fill the screen either<br>
+horizontally or vertically in one of the directions you can handle.<br>
+If your screen only pivots counter-clockwise, use -autoror.<br>
+<br>
+<br>
+<br>
+Core artwork options<br>
+--------------------<br>
+<br>
+-[no]artwork_crop / -[no]artcrop<br>
+<br>
+Enable cropping of artwork to the game screen area only. This works<br>
+best with -video gdi or -video d3d, and means that vertically oriented<br>
+games running full screen can display their artwork to the left and<br>
+right sides of the screen. This does not work with -video ddraw<br>
+because of the way the game screens are rendered and scaled after the<br>
+fact. This option can also be controlled via the Video Options menu in<br>
+the user interface. The default is OFF (-noartwork_crop).<br>
+<br>
+-[no]use_backdrops / -[no]backdrop<br>
+<br>
+Enables/disables the display of backdrops. The default is ON<br>
+(-use_backdrops).<br>
+<br>
+-[no]use_overlays / -[no]overlay<br>
+<br>
+Enables/disables the display of overlays. The default is ON<br>
+(-use_overlays).<br>
+<br>
+-[no]use_bezels / -[no]bezel<br>
+<br>
+Enables/disables the display of bezels. The default is ON<br>
+(-use_bezels).<br>
+<br>
+<br>
+<br>
+Core screen options<br>
+-------------------<br>
+<br>
+-brightness &lt;value&gt;<br>
+<br>
+Controls the default brightness, or black level, of the game screens.<br>
+This option does not affect the artwork or other parts of the display.<br>
+Using the MAME UI, you can individually set the brightness for each<br>
+game screen; this option controls the initial value for all visible<br>
+game screens. The standard value is 1.0. Selecting lower values (down<br>
+to 0.1) will produce a darkened display, while selecting higher values<br>
+(up to 2.0) will give a brighter display. The default is 1.0.<br>
+<br>
+-contrast &lt;value&gt;<br>
+<br>
+Controls the contrast, or white level, of the game screens. This<br>
+option does not affect the artwork or other parts of the display.<br>
+Using the MAME UI, you can individually set the contrast for each<br>
+game screen; this option controls the initial value for all visible<br>
+game screens. The standard value is 1.0. Selecting lower values (down<br>
+to 0.1) will produce a dimmer display, while selecting higher values<br>
+(up to 2.0) will give a more saturated display. The default is 1.0.<br>
+<br>
+-gamma &lt;value&gt;<br>
+<br>
+Controls the gamma, which produces a potentially nonlinear black to<br>
+white ramp, for the game screens. This option does not affect the<br>
+artwork or other parts of the display. Using the MAME UI, you can<br>
+individually set the gamma for each game screen; this option controls<br>
+the initial value for all visible game screens. The standard value is<br>
+1.0, which gives a linear ramp from black to white. Selecting lower<br>
+values (down to 0.1) will increase the nonlinearity toward black,<br>
+while selecting higher values (up to 3.0) will push the nonlinearity<br>
+toward white. The default is 1.0.<br>
+<br>
+-pause_brightness &lt;value&gt;<br>
+<br>
+This controls the brightness level when MAME is paused. The default<br>
+value is 0.65.<br>
+<br>
+<br>
+<br>
+Core vector options<br>
+-------------------<br>
+<br>
+-[no]antialias / -[no]aa<br>
+<br>
+Enables antialiased line rendering for vector games. The default is ON<br>
+(-antialias).<br>
+<br>
+-beam &lt;width&gt;<br>
+<br>
+Sets the width of the vectors. This is a scaling factor against the<br>
+standard vector width. A value of 1.0 will keep the default vector<br>
+line width. Smaller values will reduce the width, and larger values<br>
+will increase the width. The default is 1.0.<br>
+<br>
+-flicker &lt;value&gt;<br>
+<br>
+Simulates a vector &quot;flicker&quot; effect, similar to a vector monitor that<br>
+needs adjustment. This option requires a float argument in the range<br>
+of 0.00 - 100.00 (0=none, 100=maximum). The default is 0.<br>
+<br>
+<br>
+<br>
+Core sound options<br>
+------------------<br>
+<br>
+-[no]sound<br>
+<br>
+Enable or disable sound altogether. The default is ON (-sound).<br>
+<br>
+-samplerate &lt;value&gt; / -sr &lt;value&gt;<br>
+<br>
+Sets the audio sample rate. Smaller values (e.g. 11025) cause lower<br>
+audio quality but faster emulation speed. Higher values (e.g. 48000)<br>
+cause higher audio quality but slower emulation speed. The default is<br>
+48000.<br>
+<br>
+-[no]samples<br>
+<br>
+Use samples if available. The default is ON (-samples).<br>
+<br>
+-volume / -vol &lt;value&gt;<br>
+<br>
+Sets the startup volume. It can later be changed with the user<br>
+interface (see Keys section). The volume is an attenuation in dB:<br>
+e.g., &quot;-volume -12&quot; will start with -12dB attenuation. The default<br>
+is 0.<br>
+<br>
+<br>
+<br>
+Core input options<br>
+------------------<br>
+<br>
+-[no]coin_lockout / -[no]coinlock<br>
+<br>
+Enables simulation of the &quot;coin lockout&quot; feature that is implmeneted<br>
+on a number of game PCBs. It was up to the operator whether or not<br>
+the coin lockout outputs were actually connected to the coin<br>
+mechanisms. If this feature is enabled, then attempts to enter a coin<br>
+while the lockout is active will fail and will display a popup message<br>
+in the user interface. If this feature is disabled, the coin lockout<br>
+signal will be ignored. The default is ON (-coin_lockout).<br>
+<br>
+-ctrlr &lt;controller&gt;<br>
+<br>
+Enables support for special controllers. Configuration files are<br>
+loaded from the ctrlrpath. They are in the same format as the .cfg<br>
+files that are saved, but only control configuration data is read<br>
+from the file. The default is NULL (no controller file).<br>
+<br>
+-[no]mouse<br>
+<br>
+Controls whether or not MAME makes use of mouse controllers. When<br>
+this is enabled, you will likely be unable to use your mouse for other<br>
+purposes until you exit or pause the game. The default is OFF<br>
+(-nomouse).<br>
+<br>
+-[no]joystick / -[no]joy<br>
+<br>
+Controls whether or not MAME makes use of joystick/gamepad controllers.<br>
+When this is enabled, MAME will ask DirectInput about which<br>
+controllers are connected. The default is OFF (-nojoystick).<br>
+<br>
+-[no]lightgun / -[no]gun<br>
+<br>
+Controls whether or not MAME makes use of lightgun controllers.<br>
+Note that most lightguns map to the mouse, so using -lightgun and<br>
+-mouse together may produce strange results. The default is OFF<br>
+(-nolightgun).<br>
+<br>
+-[no]multikeyboard / -[no]multikey<br>
+<br>
+Determines whether MAME differentiates between multiple keyboards.<br>
+Some systems may report more than one keyboard; by default, the data<br>
+from all of these keyboards is combined so that it looks like a single<br>
+keyboard. Turning this option on will enable MAME to report keypresses<br>
+on different keyboards independently. The default is OFF<br>
+(-nomultikeyboard).<br>
+<br>
+-[no]multimouse<br>
+<br>
+Determines whether MAME differentiates between multiple mice. Some<br>
+systems may report more than one mouse device; by default, the data<br>
+from all of these mice is combined so that it looks like a single<br>
+mouse. Turning this option on will enable MAME to report mouse<br>
+movement and button presses on different mice independently. The<br>
+default is OFF (-nomultimouse).<br>
+<br>
+-[no]steadykey / -[no]steady<br>
+<br>
+Some games require two or more buttons to be pressed at exactly the<br>
+same time to make special moves. Due to limitations in the keyboard<br>
+hardware, it can be difficult or even impossible to accomplish that<br>
+using the standard keyboard handling. This option selects a different<br>
+handling that makes it easier to register simultaneous button presses,<br>
+but has the disadvantage of making controls less responsive. The<br>
+default is OFF (-nosteadykey)<br>
+<br>
+-[no]offscreen_reload / -[no]reload<br>
+<br>
+Controls whether or not MAME treats a second button input from a<br>
+lightgun as a reload signal. In this case, MAME will report the gun's<br>
+position as (0,MAX) with the trigger held, which is equivalent to an<br>
+offscreen reload. This is only needed for games that required you to<br>
+shoot offscreen to reload, and then only if your gun does not support<br>
+off screen reloads. The default is OFF (-nooffscreen_reload).<br>
+<br>
+-joystick_map &lt;map&gt; / -joymap &lt;map&gt;<br>
+<br>
+Controls how joystick values map to digital joystick controls. MAME<br>
+accepts all joystick input from the system as analog data. For true<br>
+analog joysticks, this needs to be mapped down to the usual 4-way or<br>
+8-way digital joystick values. To do this, MAME divides the analog<br>
+range into a 9x9 grid. It then takes the joystick axis position (for<br>
+X and Y axes only), maps it to this grid, and then looks up a<br>
+translation from a joystick map. This parameter allows you to specify<br>
+the map. The default is 'auto', which means that a standard 8-way,<br>
+4-way, or 4-way diagonal map is selected automatically based on the<br>
+input port configuration of the current game.<br>
+<br>
+Maps are defined as a string of numbers and characters. Since the grid<br>
+is 9x9, there are a total of 81 characters necessary to define a<br>
+complete map. Below is an example map for an 8-way joystick:<br>
+<br>
+777888999 Note that the numeric digits correspond to the keys<br>
+777888999 on a numeric keypad. So '7' maps to up+left, '4' maps<br>
+777888999 to left, '5' maps to neutral, etc. In addition to the<br>
+444555666 numeric values, you can specify the character 's',<br>
+444555666 which means &quot;sticky&quot;. In this case, the value of the<br>
+444555666 map is the same as it was the last time a non-sticky<br>
+111222333 value was read.<br>
+111222333<br>
+111222333<br>
+<br>
+To specify the map for this parameter, you can specify a string of<br>
+rows separated by a '.' (which indicates the end of a row), like so:<br>
+<br>
+777888999.777888999.777888999.444555666.444555666.444555666.<br>
+111222333.111222333.111222333<br>
+<br>
+However, this can be reduced using several shorthands supported by the<br>
+&lt;map&gt; parameter. If information about a row is missing, then it is<br>
+assumed that any missing data in columns 5-9 are left/right symmetric<br>
+with data in columns 0-4; and any missing data in colums 0-4 is<br>
+assumed to be copies of the previous data. The same logic applies to<br>
+missing rows, except that up/down symmetry is assumed.<br>
+<br>
+By using these shorthands, the 81 character map can be simply<br>
+specified by this 11 character string: 7778...4445<br>
+<br>
+Looking at the first row, 7778 is only 4 characters long. The 5th<br>
+entry can't use symmetry, so it is assumed to be equal to the previous<br>
+character '8'. The 6th character is left/right symmetric with the 4th<br>
+character, giving an '8'. The 7th character is left/right symmetric<br>
+with the 3rd character, giving a '9' (which is '7' with left/right<br>
+flipped). Eventually this gives the full 777888999 string of the row.<br>
+<br>
+The second and third rows are missing, so they are assumed to be<br>
+identical to the first row. The fourth row decodes similarly to the<br>
+first row, producing 444555666. The fifth row is missing so it is<br>
+assumed to be the same as the fourth.<br>
+<br>
+The remaining three rows are also missing, so they are assumed to be<br>
+the up/down mirrors of the first three rows, giving three final rows<br>
+of 111222333.<br>
+<br>
+-joystick_deadzone &lt;value&gt; / -joy_deadzone &lt;value&gt; / -jdz &lt;value&gt;<br>
+<br>
+If you play with an analog joystick, the center can drift a little.<br>
+joystick_deadzone tells how far along an axis you must move before the<br>
+axis starts to change. This option expects a float in the range of<br>
+0.0 to 1.0. Where 0 is the center of the joystick and 1 is the outer<br>
+limit. The default is 0.3.<br>
+<br>
+-joystick_saturation &lt;value&gt; / joy_saturation &lt;value&gt; / -jsat &lt;value&gt;<br>
+<br>
+If you play with an analog joystick, the ends can drift a little,<br>
+and may not match in the +/- directions. joystick_saturation tells how<br>
+far along an axis movement change will be accepted before it reaches<br>
+the maximum range. This option expects a float in the range of 0.0 to<br>
+1.0, where 0 is the center of the joystick and 1 is the outer limit.<br>
+The default is 0.85.<br>
+<br>
+<br>
+<br>
+Core input automatic enable options<br>
+-----------------------------------<br>
+<br>
+-paddle_device &lt;keyboard|mouse|joystick|lightgun|none&gt; / -paddle<br>
+-adstick_device &lt;keyboard|mouse|joystick|lightgun|none&gt; / -adstick<br>
+-pedal_device &lt;keyboard|mouse|joystick|lightgun|none&gt; / -pedal<br>
+-dial_device &lt;keyboard|mouse|joystick|lightgun|none&gt; / -dial<br>
+-trackball_device &lt;keyboard|mouse|joystick|lightgun|none&gt; / -trackball<br>
+-lightgun_device &lt;keyboard|mouse|joystick|lightgun|none&gt;<br>
+-positional_device &lt;keyboard|mouse|joystick|lightgun|none&gt;<br>
+<br>
+Each of these options controls autoenabling the mouse, joystick, or<br>
+lightgun depending on the presence of a particular class of analog<br>
+control for a particular game. For example, if you specify the option<br>
+-paddle mouse, then any game that has a paddle control will<br>
+automatically enable mouse controls just as if you had explicitly<br>
+specified -mouse. Note that these controls override the values of<br>
+-[no]mouse, -[no]joystick, etc.<br>
+<br>
+<br>
+<br>
+Debugging options<br>
+-----------------<br>
+<br>
+-[no]log<br>
+<br>
+Creates a file called error.log which contains all of the internal<br>
+log messages generated by the MAME core and game drivers. The default<br>
+is OFF (-nolog).<br>
+<br>
+-[no]verbose / -[no]v<br>
+<br>
+Displays internal diagnostic information. This information is very<br>
+useful for debugging problems with your configuration. IMPORTANT: when<br>
+reporting bugs, please run with mame -verbose and include the<br>
+resulting information. The default is OFF (-noverbose).<br>
+<br>
+-[no]update_in_pause<br>
+<br>
+Enables updating of the main screen bitmap while the game is paused.<br>
+This means that the VIDEO_UPDATE callback will be called repeatedly<br>
+during pause, which can be useful for debugging. The default is OFF<br>
+(-noupdate_in_pause).<br>
+<br>
+-[no]debug<br>
+<br>
+Activates the integrated debugger. By default, the debugger is entered<br>
+by pressing the tilde (~) key during emulation. It is also entered<br>
+immediately at startup. The default is OFF (-nodebug).<br>
+<br>
+-debugscript &lt;filename&gt;<br>
+<br>
+Specifies a file that contains a list of debugger commands to execute<br>
+immediately upon startup. The default is NULL (no commands).<br>
+<br>
+<br>
+<br>
+Core misc options<br>
+-----------------<br>
+<br>
+-bios &lt;biosname&gt;<br>
+<br>
+Specifies the specific BIOS to use with the current game, for game<br>
+systems that make use of a BIOS. The -listxml output will list all of<br>
+the possible BIOS names for a game. The default is 'default'.<br>
+<br>
+-[no]cheat / -[no]c<br>
+<br>
+Enables the reading of the cheat database, if present, and the Cheat<br>
+menu in the user interface. The default is OFF (-nocheat).<br>
+<br>
+-[no]skip_gameinfo<br>
+<br>
+Forces MAME to skip displaying the game info screen. The default is<br>
+OFF (-noskip_gameinfo).<br>
+<br>
+</span></span><span class="style2"><strong>This file describes Windows-specific
+usage information about MAME. It is<br>
+intended to cover aspects of using and configuring the program that are<br>
+specific to running MAME from the command line on a Windows-based system.<br>
+For common options that apply to all systems, please see config.txt.</strong><br>
+<br>
+<br>
+<br>
+Default Keys<br>
+------------<br>
+<br>
+In addition to the keys described in config.txt, the following additional<br>
+keys are defined for Windows versions of MAME:<br>
+<br>
+<br>
+Alt+Enter Toggles between full-screen and windowed mode.<br>
+<br>
+<br>
+<br>
+Windows debugging options<br>
+-------------------------<br>
+<br>
+-[no]oslog<br>
+<br>
+Outputs the error.log data to the Windows debugger. This can be used at<br>
+the same time as -log to output the log data to both targets as well.<br>
+Default is OFF (-nooslog).<br>
+<br>
+<br>
+<br>
+Windows performance options<br>
+---------------------------<br>
+<br>
+-priority &lt;priority&gt;<br>
+<br>
+Sets the thread priority for the MAME threads. By default the priority<br>
+is left alone to guarantee proper cooperation with other applications.<br>
+The valid range is -15 to 1, with 1 being the highest priority. The<br>
+default is 0 (NORMAL priority).<br>
+<br>
+-[no]multithreading / -[no]mt<br>
+<br>
+Enables multithreading within MAME. At the moment, this causes the<br>
+window and all DirectDraw/Direct3D code to execute on a second thread,<br>
+which can improve performance on hyperthreaded and multicore systems.<br>
+The default is OFF (-nomultithreading).<br>
+<br>
+-numprocessors &lt;auto|value&gt;<br>
+Specify the number of processors to use for work queues. Specifying<br>
+&quot;auto&quot; will use the value reported by the system or environment <br>
+variable OSDPROCESSORS. To avoid abuse, this value is internally limited<br>
+to 4 times the number of processors reported by the system. <br>
+The default is &quot;auto&quot;.<br>
+<br>
+<br>
+Windows video options<br>
+---------------------<br>
+<br>
+-video &lt;gdi|ddraw|d3d|none&gt;<br>
+<br>
+Specifies which video subsystem to use for drawing. By specifying 'gdi'<br>
+here, you tell MAME to render video using standard Windows graphics<br>
+drawing calls. This is the slowest but most compatible option.<br>
+Specifying 'ddraw' instructs MAME to use DirectDraw for rendering.<br>
+This causes MAME to render everything at a lower resolution and then<br>
+upscale the results at the end. This produces high performance,<br>
+especially on older or low-power video cards, but has a noticeably<br>
+lower output quality. Specifying 'd3d' tells MAME to use Direct3D for<br>
+rendering. This produces the highest quality output and enables all<br>
+rendering options. It is recommended if you have a recent (2002+)<br>
+video card. The final option 'none' displays no windows and does no<br>
+drawing. This is primarily present for doing CPU benchmarks without<br>
+the overhead of the video system. The default is d3d.<br>
+<br>
+-numscreens &lt;count&gt;<br>
+<br>
+Tells MAME how many output windows to create. For most games, a single<br>
+output window is all you need, but some games originally used multiple<br>
+screens. Each screen (up to 4) has its own independent settings for<br>
+physical monitor, aspect ratio, resolution, and view, which can be<br>
+set using the options below. The default is 1.<br>
+<br>
+-[no]window<br>
+<br>
+Run MAME in either a window or full screen. The default is OFF<br>
+(-nowindow).<br>
+<br>
+-[no]maximize / -[no]max<br>
+<br>
+Controls initial window size in windowed mode. If it is set on, the<br>
+window will initially be set to the maximum supported size when you<br>
+start MAME. If it is turned off, the window will start out at the<br>
+smallest supported size. This option only has an effect when the<br>
+-window option is used. The default is ON (-maximize).<br>
+<br>
+-[no]keepaspect / -[no]ka<br>
+<br>
+Enables aspect ratio enforcement. When this option is on, the game's<br>
+proper aspect ratio (generally 4:3 or 3:4) is enforced, so you get the<br>
+game looking like it should. When running in a window with this option<br>
+on, you can only resize the window to the proper aspect ratio, unless<br>
+you are holding down the CONTROL key. By turning the option off, the<br>
+aspect ratio is allowed to float. In full screen mode, this means that<br>
+all games will stretch to the full screen size (even vertical games).<br>
+In window mode, it means that you can freely resize the window without<br>
+any constraints. The default is ON (-keepaspect).<br>
+<br>
+-prescale &lt;amount&gt;<br>
+<br>
+Controls the size of the screen images when they are passed off to the<br>
+graphics system for scaling. At the minimum setting of 1, the screen<br>
+is rendered at its original resolution before being scaled. At higher<br>
+settings, the screen is expanded by a factor of &lt;amount&gt; before being<br>
+scaled. With -video ddraw or -video d3d, this produces a less blurry<br>
+image at the expense of some speed. In -video ddraw mode, this also<br>
+increases the effective resolution of non-screen elements such as<br>
+artwork and fonts. The default is 1.<br>
+<br>
+-effect &lt;filename&gt;<br>
+<br>
+Specifies a single PNG file that is used as an overlay over any game<br>
+screens in the video display. This PNG file is assumed to live in the<br>
+root of one of the artpath directories. The pattern in the PNG file is<br>
+repeated both horizontally and vertically to cover the entire game<br>
+screen areas (but not any external artwork), and is rendered at<br>
+the target resolution of the game image. For -video gdi and -video d3d<br>
+modes, this means that one pixel in the PNG will map to one pixel on<br>
+your output display. For -video ddraw, this means that one pixel in the<br>
+PNG will map to one pixel in the prescaled game screen. If you wish to<br>
+use an effect that requires mapping n PNG pixels to each game screen<br>
+pixel with -video ddraw, you need to specify a -prescale factor of n as<br>
+well. The RGB values of each pixel in the PNG are multiplied against the<br>
+RGB values of the target screen. The default is 'none', meaning no<br>
+effect.<br>
+<br>
+-[no]waitvsync<br>
+<br>
+Waits for the refresh period on your computer's monitor to finish<br>
+before starting to draw video to your screen. If this option is off,<br>
+MAME will just draw to the screen at any old time, even in the middle<br>
+of a refresh cycle. This can cause &quot;tearing&quot; artifacts, where the top<br>
+portion of the screen is out of sync with the bottom portion. Tearing<br>
+is not noticeable on all games, and some people hate it more than<br>
+others. However, if you turn this option on, you will waste more of<br>
+your CPU cycles waiting for the proper time to draw, so you will see a<br>
+performance hit. You should only need to turn this on in windowed mode.<br>
+In full screen mode, it is only needed if -triplebuffer does not<br>
+remove the tearing, in which case you should use -notriplebuffer<br>
+-waitvsync. Note that this option does not work with -video gdi mode.<br>
+The default is OFF (-nowaitvsync).<br>
+<br>
+-[no]syncrefresh<br>
+<br>
+Enables speed throttling only to the refresh of your monitor. This<br>
+means that the game's actual refresh rate is ignored; however, the<br>
+sound code still attempts to keep up with the game's original refresh<br>
+rate, so you may encounter sound problems. This option is intended<br>
+mainly for those who have tweaked their video card's settings to<br>
+provide carefully matched refresh rate options. Note that this option<br>
+does not work with -video gdi mode.The default is OFF (-nosyncrefresh).<br>
+<br>
+<br>
+<br>
+DirectDraw-specific options<br>
+---------------------------<br>
+<br>
+-[no]hwstretch / -[no]hws<br>
+<br>
+When enabled, MAME uses the hardware stretching abilities of your<br>
+video card to scale the game image and associated artwork to the<br>
+target resolution. Depending on the quality of your graphic card and<br>
+its drivers, this may be a fractional, antialiased scaling (nice) or<br>
+an integer, blocky scaling (not so nice), in which case you might want<br>
+to disable this option. In addition, if you have configured specific<br>
+arcade-like video modes for MAME and don't want MAME to perform any<br>
+non-integral scaling of the image, you should also disable this option.<br>
+The default is ON (-hwstretch).<br>
+<br>
+<br>
+<br>
+Direct3D-specific options<br>
+-------------------------<br>
+<br>
+-d3dversion &lt;version&gt;<br>
+<br>
+MAME supports both Direct3D 9 and Direct3D 8 for maximum compatibility.<br>
+By default, it will automatically detect which one it can use and use<br>
+that version exclusively. You can override MAME's selection with this<br>
+option. It is primarily intended as a means for the MAME developers to<br>
+test compatibility with older hardware; for the most part, there is no<br>
+reason to alter this setting. The default is 9.<br>
+<br>
+-[no]filter / -[no]d3dfilter / -[no]flt<br>
+<br>
+Enable bilinear filtering on the game screen graphics. When disabled,<br>
+point filtering is applied, which is crisper but leads to scaling<br>
+artifacts. If you don't like the filtered look, you are probably better<br>
+off increasing the -prescale value rather than turning off filtering<br>
+altogether. The default is ON (-filter).<br>
+<br>
+<br>
+<br>
+Per-window options<br>
+------------------<br>
+<br>
+-screen &lt;display&gt;<br>
+-screen0 &lt;display&gt;<br>
+-screen1 &lt;display&gt;<br>
+-screen2 &lt;display&gt;<br>
+-screen3 &lt;display&gt;<br>
+<br>
+Specifies which physical monitor on your system you wish to have each<br>
+window use by default. In order to use multiple windows, you must have<br>
+increased the value of the -numscreens option. The name of each<br>
+display in your system can be determined by running MAME with the<br>
+-verbose option. The display names are typically in the format of:<br>
+\\.\DISPLAYn, where 'n' is a number from 1 to the number of connected<br>
+monitors. The default value for these options is 'auto', which means<br>
+that the first window is placed on the first display, the second<br>
+window on the second display, etc.<br>
+<br>
+The -screen0, -screen1, -screen2, -screen3 parameters apply to the<br>
+specific window. The -screen parameter applies to all windows. The<br>
+window-specific options override values from the all window option.<br>
+<br>
+-aspect &lt;width:height&gt; / -screen_aspect &lt;num:den&gt;<br>
+-aspect0 &lt;width:height&gt;<br>
+-aspect1 &lt;width:height&gt;<br>
+-aspect2 &lt;width:height&gt;<br>
+-aspect3 &lt;width:height&gt;<br>
+<br>
+Specifies the physical aspect ratio of the physical monitor for each<br>
+window. In order to use multiple windows, you must have increased the<br>
+value of the -numscreens option. The physical aspect ratio can be<br>
+determined by measuring the width and height of the visible screen<br>
+image and specifying them separated by a colon. The default value for<br>
+these options is 'auto', which means that MAME assumes the aspect<br>
+ratio is proportional to the number of pixels in the desktop video<br>
+mode for each monitor.<br>
+<br>
+The -aspect0, -aspect1, -aspect2, -aspect3 parameters apply to the<br>
+specific window. The -aspect parameter applies to all windows. The<br>
+window-specific options override values from the all window option.<br>
+<br>
+-resolution &lt;widthxheight[@refresh]&gt; / -r &lt;widthxheight[@refresh]&gt;<br>
+-resolution0 &lt;widthxheight[@refresh]&gt; / -r0 &lt;widthxheight[@refresh]&gt;<br>
+-resolution1 &lt;widthxheight[@refresh]&gt; / -r1 &lt;widthxheight[@refresh]&gt;<br>
+-resolution2 &lt;widthxheight[@refresh]&gt; / -r2 &lt;widthxheight[@refresh]&gt;<br>
+-resolution3 &lt;widthxheight[@refresh]&gt; / -r3 &lt;widthxheight[@refresh]&gt;<br>
+<br>
+Specifies an exact resolution to run in. In full screen mode, MAME<br>
+will try to use the specific resolution you request. The width and<br>
+height are required; the refresh rate is optional. If omitted or<br>
+set to 0, MAME will determine the mode auomatically. For example,<br>
+-resolution 640x480 will force 640x480 resolution, but MAME is free to<br>
+choose the refresh rate. Similarly, -resolution 0x0@60 will force a<br>
+60Hz refresh rate, but allows MAME to choose the resolution. The<br>
+string &quot;auto&quot; is also supported, and is equivalent to 0x0@0. In window<br>
+mode, this resolution is used as a maximum size for the window. This<br>
+option requires the -switchres option as well in order to actually<br>
+enable resolution switching with -video ddraw or -video d3d. The<br>
+default value for these options is 'auto'.<br>
+<br>
+The -resolution0, -resolution1, -resolution2, -resolution3 parameters<br>
+apply to the specific window. The -resolution parameter applies to all<br>
+windows. The window-specific options override values from the all<br>
+window option.<br>
+<br>
+-view &lt;viewname&gt;<br>
+-view0 &lt;viewname&gt;<br>
+-view1 &lt;viewname&gt;<br>
+-view2 &lt;viewname&gt;<br>
+-view3 &lt;viewname&gt;<br>
+<br>
+Specifies the initial view setting for each window. The &lt;viewname&gt;<br>
+does not need to be a perfect match; rather, it will select the first<br>
+view whose name matches all the characters specified by &lt;viewname&gt;.<br>
+For example, -view native will match the &quot;Native (15:14)&quot; view even<br>
+though it is not a perfect match. The value 'auto' is also supported,<br>
+and requests that MAME perform a default selection. The default value<br>
+for these options is 'auto'.<br>
+<br>
+The -view0, -view1, -view2, -view3 parameters apply to the<br>
+specific window. The -view parameter applies to all windows. The<br>
+window-specific options override values from the all window option.<br>
+<br>
+<br>
+<br>
+Full screen options<br>
+-------------------<br>
+<br>
+-[no]triplebuffer / -[no]tb<br>
+<br>
+Enables or disables &quot;triple buffering&quot;. Normally, MAME just draws<br>
+directly to the screen, without any fancy buffering. But with this<br>
+option enabled, MAME creates three buffers to draw to, and cycles<br>
+between them in order. It attempts to keep things flowing such that one<br>
+buffer is currently displayed, the second buffer is waiting to be<br>
+displayed, and the third buffer is being drawn to. -triplebuffer will<br>
+override -waitvsync, if the buffer is sucessfully created. This option<br>
+does not work with -video gdi. The default is OFF (-notriplebuffer).<br>
+<br>
+-[no]switchres<br>
+<br>
+Enables resolution switching. This option is required for the<br>
+-resolution* options to switch resolutions in full screen mode. On<br>
+modern video cards, there is little reason to switch resolutions unless<br>
+you are trying to achieve the &quot;exact&quot; pixel resolutions of the original<br>
+games, which requires significant tweaking. This option is also useful<br>
+on LCD displays, since they run with a fixed resolution and switching<br>
+resolutions on them is just silly. This option does not work with<br>
+-video gdi. The default is OFF (-noswitchres).<br>
+<br>
+-full_screen_brightness / -fsb &lt;value&gt;<br>
+<br>
+Controls the brightness, or black level, of the entire display. The<br>
+standard value is 1.0. Selecting lower values (down to 0.1) will produce<br>
+a darkened display, while selecting higher values (up to 2.0) will<br>
+give a brighter display. Note that not all video cards have hardware to<br>
+support this option. This option does not work with -video gdi. The<br>
+default is 1.0.<br>
+<br>
+-full_screen_contrast / -fsc &lt;value&gt;<br>
+<br>
+Controls the contrast, or white level, of the entire display. The<br>
+standard value is 1.0. Selecting lower values (down to 0.1) will produce<br>
+a dimmer display, while selecting higher values (up to 2.0) will<br>
+give a more saturated display. Note that not all video cards have<br>
+hardware to support this option. This option does not work with<br>
+-video gdi. The default is 1.0.<br>
+<br>
+-full_screen_gamma / -fsg &lt;value&gt;<br>
+<br>
+Controls the gamma, which produces a potentially nonlinear black to<br>
+white ramp, for the entire display. The standard value is 1.0, which<br>
+gives a linear ramp from black to white. Selecting lower values (down<br>
+to 0.1) will increase the nonlinearity toward black, while selecting<br>
+higher values (up to 3.0) will push the nonlinearity toward white. Note<br>
+that not all video cards have hardware to support this option. This<br>
+option does not work with -video gdi. The default is 1.0.<br>
+<br>
+<br>
+<br>
+Windows sound options<br>
+---------------------<br>
+<br>
+-audio_latency &lt;value&gt;<br>
+<br>
+This controls the amount of latency built into the audio streaming. By<br>
+default MAME tries to keep the DirectSound audio buffer between 1/5 and<br>
+2/5 full. On some systems, this is pushing it too close to the edge,<br>
+and you get poor sound sometimes. The latency parameter controls the<br>
+lower threshold. The default is 1 (meaning lower=1/5 and upper=2/5).<br>
+Set it to 2 (-audio_latency 2) to keep the sound buffer between 2/5 and<br>
+3/5 full. If you crank it up to 4, you can definitely notice the lag.<br>
+<br>
+<br>
+<br>
+Input device options<br>
+--------------------<br>
+<br>
+-[no]dual_lightgun / -[no]dual<br>
+<br>
+Controls whether or not MAME attempts to track two lightguns connected<br>
+at the same time. This option requires -lightgun. This option is a hack<br>
+for supporting older dual lightgun setups. If you have multiple<br>
+lightguns connected, you will probably just need to enable -mouse and<br>
+configure each lightgun independently. The default is OFF<br>
+(-nodual_lightgun).<br>
+</span>
+
+
+</html>
diff --git a/docs/release/src/osd/winui/help/docs/Mame License.htm b/docs/release/src/osd/winui/help/docs/Mame License.htm
new file mode 100644
index 00000000000..23c0accfef4
--- /dev/null
+++ b/docs/release/src/osd/winui/help/docs/Mame License.htm
@@ -0,0 +1,57 @@
+
+<head>
+<style type="text/css">
+.style1 {
+ font-family: Arial;
+ font-size: x-small;
+}
+</style>
+</head>
+
+<body background="../images/bkground.gif">
+
+<div id="outer">
+ <div id="center">
+ <div class="content">
+ <font face="Arial"><b>Copyright © 1997-2010, Nicola Salmoria
+ and the MAME team<br>
+ All rights reserved.</b></font><font face="Arial" size="2"> </font>
+ <p><span class="style1">Unless otherwise explicitly stated, all code
+ in MAME is released under the<br>
+ following license:</span></p>
+ <p><font face="Arial" size="2">Redistribution and use of this code
+ or any derivative works are permitted provided that the following
+ conditions are met: </font></p>
+ <ul>
+ <li><font face="Arial" size="2">Redistributions may not be sold,
+ nor may they be used in a commercial product or activity. </font>
+ </li>
+ <li><font face="Arial" size="2">Redistributions that are
+ modified from the original source must include the complete
+ source code, including the source code for all components used
+ by a binary built from the modified sources. However, as a
+ special exception, the source code distributed need not include
+ anything that is normally distributed (in either source or
+ binary form) with the major components (compiler, kernel, and so
+ on) of the operating system on which the executable runs, unless
+ that component itself accompanies the executable. </font></li>
+ <li><font face="Arial" size="2">Redistributions must reproduce
+ the above copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other materials
+ provided with the distribution. </font></li>
+ </ul>
+ <p><font face="Arial" size="2">THIS SOFTWARE IS PROVIDED BY THE
+ COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE. </font></div>
+ </div>
+</div>
diff --git a/docs/release/src/osd/winui/help/docs/Mame Statement of Purpose.htm b/docs/release/src/osd/winui/help/docs/Mame Statement of Purpose.htm
new file mode 100644
index 00000000000..95312c7012b
--- /dev/null
+++ b/docs/release/src/osd/winui/help/docs/Mame Statement of Purpose.htm
@@ -0,0 +1,79 @@
+<body background="../images/bkground.gif">
+
+<div id="outer">
+ <div id="center">
+ <div class="content">
+ <b>
+ <font face="Arial">MAME, the Multiple Arcade Machine
+ Emulator<br>
+ Copyright © 1997-2010 by Nicola Salmoria and the MAME team </font>
+ </b>
+ <h2><font face="Arial" size="3">I. Purpose</font></h2>
+ <p><font face="Arial" size="2">MAME is strictly a non-profit
+ project. Its main purpose is to be a reference to the inner workings
+ of the emulated arcade machines. This is done both for educational
+ purposes and for preservation purposes, in order to prevent many
+ historical games from disappearing forever once the hardware they
+ run on stops working. Of course, in order to preserve the games and
+ demonstrate that the emulated behavior matches the original, you
+ must also be able to actually play the games. This is considered a
+ nice side effect, and is not MAME's primary focus. </font></p>
+ <p><font face="Arial" size="2">It is not our intention to infringe
+ on any copyrights or patents on the original games. All of MAME's
+ source code is either our own or freely available. To operate, the
+ emulator requires images of the original ROMs, CDs, or hard disks
+ from the arcade machines, which must be provided by the user. No
+ portions of the original game code are included in the executable.
+ </font></p>
+ <h2><font face="Arial" size="3">II. Cost</font></h2>
+ <p><font face="Arial" size="2">MAME is free. Its source code is
+ free. Selling either is not allowed. </font></p>
+ <h2><font face="Arial" size="3">III. Image Files</font></h2>
+ <p><font face="Arial" size="2">ROM, CD, and hard disk images are all
+ copyrighted material. They cannot be distributed without the
+ explicit permission of the copyright owner. They are not &quot;abandonware&quot;,
+ nor have any of the games supported by MAME passed out of copyright.
+ </font></p>
+ <p><font face="Arial" size="2">MAME is not intended to be used as a
+ tool for mass copyright infringement. Therefore, it is strongly
+ against the authors' wishes to sell, advertise, or link to resources
+ that provide illegal copies of ROM, CD, or hard disk images. </font>
+ </p>
+ <h2><font face="Arial" size="3">IV. Derivative Works</font></h2>
+ <p><font face="Arial" size="2">Derivative works are allowed under
+ the MAME license. However, you are discouraged from providing
+ specific functionality that goes against the philosophy of the MAME
+ team. Specifically: </font></p>
+ <ul>
+ <li><font face="Arial" size="2">Do not add games which are more
+ recent than 3 years old, or which are still being sold new by
+ the company that produced them. MAME is not intended to be a
+ platform that competes with arcade games that are still being
+ actively sold. </font></li>
+ <li><font face="Arial" size="2">Do not provide a means of
+ generating a list of games that specifically identifies those
+ games for which the user does not have image files. This only
+ encourages users to seek out sources for illegal ROM, CD, and
+ hard disk images in order to &quot;complete&quot; their collection. </font>
+ </li>
+ <li><font face="Arial" size="2">Do not remove the startup screen
+ that contains information about why certain non-working games
+ don't work. This only serves to generate a bunch of useless
+ email traffic to the developers asking why the games don't work.
+ </font></li>
+ </ul>
+ <p><font face="Arial" size="2">Because the name MAME is trademarked,
+ you must abide by the rules of the trademark usage if you wish to
+ use &quot;MAME&quot; as part of the name your derivative work. In general,
+ this means you must request permission, which requires that you
+ follow the guidelines above. </font></p>
+ <p><font face="Arial" size="2">The version number of any derivative
+ work should reflect the version number of the MAME release it was
+ derived from. </font></p>
+ <h2><font face="Arial" size="3">V. Official Contact Information</font></h2>
+ <p><font face="Arial" size="2">For questions regarding the MAME
+ license, trademark, or other usage, go to
+ <a href="http://www.mamedev.com/contact.html?legal">
+ http://www.mamedev.com/</a>.</font></div>
+ </div>
+</div>
diff --git a/docs/release/src/osd/winui/help/docs/whatsnew.txt b/docs/release/src/osd/winui/help/docs/whatsnew.txt
new file mode 100644
index 00000000000..9b7e00c31ef
--- /dev/null
+++ b/docs/release/src/osd/winui/help/docs/whatsnew.txt
@@ -0,0 +1,511 @@
+0.152
+-------
+
+
+MAMETesters Bugs Fixed
+----------------------
+- 04424: [Graphics] (seta.c) thunderlbl: [debug] Severe
+ graphic issues (Osso)
+- 05357: [Crash/Freeze] (taitogn.c) nightrai: fails to boot
+ into the game (smf)
+- 05236: [Graphics] multiple monitor support doesn't work with d3d
+- 05391: [Misc.] (cave.c) ppsatan: manufacturer info for ppsatan
+- 05383: [Graphics] (twin16.c) hpuncher: Screen is split and
+ graphics are offset (Alex Jackson)
+- 00785: [Sound] (omegrace.c) omegrace: Corrupted music after
+ completing first several levels. (hap)
+- 05214: [Color/Palette] vector games: Vector games with color overlay
+ show in b&w on Windows D3D render when HLSL is disabled. (hap)
+- 05384: [DIP/Input] (lethal.c) lethaleneab, lethaleneae: Language DIP
+ Switch not changing the language (Tafoid)
+- 05355: [DIP/Input] (cps1.c) sf2m3 ; sf2m8: Kick inputs are not working
+ LK MK HK (Osso)
+- 05375: [Documentation] (sderby.c) sderby, sderby2: 1 set name and 1
+ full name need changed
+- 05373: [Crash/Freeze] (capbowl.c) capbowl3, capbowl4: Black screen
+ after starting game (Phil Bennett)
+- 05366: [Core] (harddriv.c) harddriv and clones, racedriv and clones: RTC
+ Day and Month error and fails to start
+- 05365: [Documentation] (namcos21.c) driveyes: The correct description
+ is "Driver's Eyes (Japan)"
+- 05364: [Compiling] Error when compiling with NO_USE_QTDEBUG
+- 05356: [Color/Palette] (midvunit.c) offroadc: Off Road Challenge and
+ clones have wrong color in some textures (Phil Bennett)
+- 05207: [Graphics] All vector games: In the vector games, graphics
+ remains imprinted even when exit the game. (hap)
+- 04947: [Graphics] (midvunit.c) offroadc: Missing selection indicator
+ within service mode. (Phil Bennett)
+
+Source Changes
+--------------
+-vsnes.c: Verified second half roms for vs baseball usa e-1 set, fix
+ one mislabeled rom [Dead_Body]
+
+-midvunit.c - Fixed polygon pixel color selection [Phil Bennett]
+
+-peplus.c: Corrected a couple of color CAP sizes. Added the CG graphics
+ roms for Ace$ Bonus Poker. [BrianT]
+
+-scsi: Fixed hard disk images with 256-byte sectors. [Curt Coder]
+
+-Added a simple DC blocker filter to the speaker toggle device [R. Belmont]
+
+-konendev.c: Corrected CPU type (PPC403) and added some hardware notes [Phil Bennett]
+
+-sf.c: update prom names for Street Fighter (World, Analog buttons) set.[Porchy]
+
+-exidy440.c: Replaced prom dump for all games in driver located at 3K.
+ It is unique to all the other proms and different in size. [Joe Magiera, Tafoid]
+
+-nss.c: update bios rom locations and update inst rom label for smw;
+ marked nss v3 bios as possible hack [Kiddcade, Porchy]
+
+-CPS-1 update [Artemio Urbina]:
+ * Redumped CDU_22A.7F in dinou to match real pcb, verified on two
+ different sources
+
+-Tweaks to the idehd timing, which are still based on complete fiction. [smf]
+
+-Added a new macro MCFG_DEVICE_CARD_DEFAULT_BIOS, which can be used in
+ the machine config to set the default BIOS for a slot card device.
+ [Curt Coder]
+
+-SDL: fix non-Qt non-Windows build (MT #5364) [R. Belmont]
+
+-Added SCSI status code & set it in all command handlers. It is sent
+ over the bus when in status phase. In case of an error further
+ information should be set in m_sense_key/m_sense_asc/m_sense_ascq &
+ m_sense_information so that it can be returned by executing a request
+ sense command [smf]
+
+-Set the error bit in the IDE status register if the command causes a
+ check condition [smf]
+
+-vsnes.c: update labels of vs. Super Mario Bros roms to match physical
+ chips exactly. [Dead_Body]
+
+-z80dma: Implemented Auto Restart. [Curt Coder]
+
+-TMS57002 fixes and improvements: [Phil Bennett]
+ * Moved CA/ID post-increment outside of execution. Fixes case where
+ dual instructions post-increment, also reduces number of generated
+ instructions.
+ * Fixed data ordering of external memory accesses.
+ * Don't generate redundant instructions for undefined rounding modes;
+ remap them in decode.
+ * Set XOA to 0 on reset.
+ * Use [READ|WRITE]LINE_MEMBER for I/O lines.
+ * Added PC0 line.
+ * Added registers to debugger state.
+
+-wd_fdc: Fixed ready interrupt polarity. Added a soft_reset() function
+ which resets only the FDC and not the floppy image devices, thus
+ preserving the correct ready states. [Curt Coder]
+
+-Rewrote Konami 056800 (MIRAC): [Phil Bennett]
+ * Implemented as an 8-bit device
+ * Fixed address mapping
+ * Removed bogus timer interrupt
+ * Fixed interrupt handling
+
+-054539.c: Fixed input clock rate and implemented programmable timer
+ based on hardware measurements [Phil Bennett, Stefan Lindberg]
+
+-lethal.c, mystwarr,c, tmnt.c: Hooked up 054539 timer interrupt. Fixes
+ music tempo in some games [Phil Bennett]
+
+-qdrmfgp.c: Hooked up 054539 timer interrupt for qdrmfgp, fixed IRQ
+ acknowledge handling [Phil Bennett]
+
+-plygonet.c: Hooked up 054539 timer interrupt, removed non-existent
+ second 054539 and fixed EEPROM regression [Phil Bennett]
+
+-hornet.c, gticlub.c: Implemented sound interrupt timer [Phil Bennett]
+
+-konamigx.c improvements: [Phil Bennett]
+ * Hooked up 056800 device
+ * Hooked up 054539 timer interrupt
+ * Removed sound hacks
+ * All DSP RAM tests now pass, winspike sound now works
+
+-konamigq.c improvements: [Phil Bennett]
+ * Hooked up 056800 device
+ * Hooked up 054539 timer interrupt
+ * Added TMS57002 DASP
+
+-ultrsprt.c improvements: [Phil Bennett]
+ * Hooked up 054539 timer interrupt
+ * Implemented VRAM double buffering
+ * Improved trackball inputs
+ * Fixed sound
+
+-zr107.c improvements: [Phil Bennett]
+ * Hooked up 054539 timer interrupt
+ * Fixed sound in all games
+
+-rungun.c improvements: [Phil Bennett]
+ * Hooked up 054539 timer interrupt. Fixes music tempo
+ * Implemented sound CPU NMI control
+ * Fixed 054539 #2 regression
+
+-Saves the race driving DSK zram [smf]
+
+-Added all the available beatmania IIDX hard drives and Video CD's/DVD's,
+ updated the hard drive labels from pictures online. [smf]
+
+-mcs96: Misc. fixes [O. Galibert]
+
+-diserial: Remove defines, cleanup clocks/timers, add sync support [O. Galibert]
+
+-verified The Gladiator internal ROM on an Overseas cart [Artemio Urbina]
+
+-wd_fdc: Set CRC error bit if CRC error found during Read Address
+ command. Tiki 100 determines whether the disk is in FM or MFM format
+ by checking this. [Curt Coder]
+
+-CPS-1 update:
+ * Dumped and added IOB2.11D to sf2ee and sf2ue [Porchy], S9263B.1A to
+ sf2ce and sf2hf sets and clones [Porchy], CP1B9KA.9K to pang3
+ [Zabanitu]
+
+-snk6502.c: Adjusted Nibbler board clock rate to use actual known
+ master clock and a logical divisor. [Tafoid]
+
+-jedutil.c: [Kevin Eshbach]
+ * Corrected the output of the PAL20X4, PAL20X8, PAL20X10 to show the
+ XOR on the relevant sum of products.
+ * When viewing a device the size of the JED file is verified to match
+ the size of the device.
+ * Replaced hard-coded symbol strings with constants.
+ * Started experimental work for supporting RICOH PAL’s. (Currently
+ ifdef'ed out.)
+ * Added support for viewing the following devices and the
+ corresponding regression test data. (PALCE16V8, PAL10P8, PAL12P6,
+ PAL14P4, PAL16P2, PAL16P8, PAL16RP4, PAL16RP6, PAL16RP8, PAL6L16,
+ PAL8L14, PAL12H10, PAL12L10, PAL14H8, PAL14L8, PAL16H6, PAL16L6,
+ PAL18H4, PAL18L4, PAL20C1 and PAL20L2)
+
+-Added flip screen support to Royal Mahjong and brothers [Angelo Salese]
+
+ V9958: Added preliminary screen modes 10/11/12, used by Puzzle
+ Star/Sexy Boom [Angelo Salese, Wilbert Pol]
+
+-vsnes.c: Corrected rom labels and fixed set description for vspinbal
+ set [Dead_Body]
+
+-cinemat.c: Correct dipswitches for Vectorbeam's Warrior. [Timothy Shiels]
+
+-vsnes.c: More updated ROM labels, for vs top gun and vs gradius [Dead_Body]
+
+-i386: Fixed P6 CMOVcc instructions, and added CMOV feature flag to
+ Pentium Pro and Pentium II CPUs. Added MMX feature flag to Pentium
+ MMX. [Barry Rodewald]
+
+-Fixed a complement by two bug in V9958 YJK table, fixes for good
+ colors in Puzzle Star / Sexy Boom / some MSX2+ games. [Angelo Salese]
+
+-Kludged Puzzle Star (Sang Ho Soft) hang at title screen [Angelo Salese]
+
+-Added the SHA1 for System 573 700B01 now that we have a dump. It
+ currently expects a different response from the H8 at bootup than the
+ other BIOS versions, so the data is stored in a fake rom until it's
+ HLE'd better of we get a dump of the H8 internal rom
+ [smf, innocent2k, anthonyoftga]
+
+-document that ketsui roms exist with different fill in the unused
+ areas [Artemio Urbina]
+
+-upd765: Fixed sense drive status command, and allow floppy connectors
+ without drives. [Curt Coder]
+
+-fixed scudsp & ssp1601 entries [Vito]
+
+-Reduce smearing on hlsl prescale [MooglyGuy]
+
+-Corrected 7486 description in head file [MASH]
+
+-various PGM protection cleanups / fixes (orlegend, olds, svgpcb) [iq_132]
+
+-finished modernising i2cmem [smf]
+
+-remodernised x76f041/x76f100 & zs01 so that logging becomes easy again
+ & uses READ_LINE_MEMBER/WRITE_LINE_MEMBER so the pins can be bound to
+ directly. Hooked up x76f041 to the early beatmania IIDX games. They
+ all pass the security check eventually but it takes a long time as it
+ repeatedly reads the first byte, it's possible that the contents
+ aren't correct as the game says the security is OK even when the data
+ returned is not what it's checking for. [smf]
+
+-Added a work round so that CR589 firmware updating works again, either
+ from the separate CD's or as part of the game install (for example DDR
+ MAX). [smf]
+
+-playch10: update Playchoice-10 BIOS ROM names to match exact chip
+ labels and types [Dead_Body]
+
+-naomi/dc: Sanitize screen format, fixes MT5349 [O. Galibert]
+
+-redumped some System 573 CD's [Guru]
+
+-CPS-1 update: Added S222B.1A PAL to ffightj and clones.
+ [Charles MacDonald, Porchy, Smitdogg, The Dumping Union]
+
+-Created DS1204 device & switched megatouch to use it instead of it's
+ own local version (driver could do with some more tidying up as not
+ all games use a key but currently it is hooked up to all games).
+ Default data comes from a region instead of coded in driver, commands
+ & security match are now compared, data is clocked on the correct
+ edge, key can be written to and is saved to nvram. [smf]
+
+-redumped bad roms for First Funky Fighter [Yohji, Smitdogg, The Dumping Union]
+
+-Merged othldrby.c with toaplan2.c driver [Angelo Salese]
+
+-Converted Toaplan 2 to use SCREEN_RAW_PARAMS [Angelo Salese]
+
+-Added a core for uPD4992 RTC, used by Othello Derby and Power Kick [Angelo Salese]
+
+-Hooked up ds1204, but haven't found what it checks for yet. Change
+ PATCH_PROTECTION to 0 in tmaster.c and VERBOSE_LEVEL to 2 in ds1204.c
+ then look for "-> command" in error.log to find the subsequent read
+ from the dq pin for reading the identification and secure memory. For
+ tm4k the first two bytes of the nvram need to be  0x00, 0xa0. From
+ scratch you'll need to play a game before it will complain about the
+ protection, but after that it will complain on every boot. It tries
+ five different contents for the compare register at various points
+ during the bootup, this may be for obfuscation as the real chip will
+ return random results if the key is wrong. If the keys are available
+ it might be easier to dump them than figure out exactly what it wants.
+ [smf]
+
+-svgpcb: added igs027a rom, runs intro, dies trying to go in game, not
+ sure why yet [rtw, David Haywood]
+
+-Created a skeleton for the Konami 573 Multi Session Unit, renamed
+ digital io board source file to match and moved pcb layout from
+ driver. [smf]
+
+-Added skeleton for konami 573 memory card reader and network pcb unit
+ devices [smf]
+
+-redumped keyboard mania 3 [Guru]
+
+-Updated konam80s atapi dma kludge so that Guitar Freaks 7th Mix (and
+ alot of others) load again [smf]
+
+-Mambo A GO-GO CD redump in raw mode + raw subcode. [any]
+
+-Improved Sega Bloxeed dipswitches. [Zaphod]
+
+-Added basic 3d FIFO understanding and hooked up FIFO irq processed to
+ Hyper Neo Geo 64, meaning a far better 3d display in all games
+ [Angelo Salese]
+
+-mc2661: Added various transmission and reception logic to help make
+ the above possible [Barry Rodewald]
+
+-twin16.c: [Alex Jackson]
+ * Use the correct gfx ROMs for all the vulcan/gradius2 sets
+ * Load gfx ROMs using standard macros instead of custom postprocessing
+ * Replace custom read/write handlers with AM_REGION, AM_SHARE, or banks as appropriate
+ * Fix Extra Life dipswitches in vulcana and vulcanb
+ * Fix cuebrick NVRAM size
+ * Fix audio cpu RAM size
+ * Use XTALs for clocks
+
+-Windows: Fixed D3D multimonitor support. [GroovyMAME]
+
+-Slot options can now be configured inline without creating an array.
+ Legacy support for old configuration uses MCFG_FRAGMENT_ADD, which
+ required changing so the current device could be updated by the
+ fragment. [smf]
+
+-converted cassette, pccard1 & pccard2 slots to use new MCFG macros [smf]
+
+-Uses MCFG_SLOT_DEFAULT_OPTION instead of MCFG_DEVICE_SLOT_INTERFACE
+ where only the default option is changed. [smf]
+
+-m68k: add ability for externally-thrown bus errors to have proper
+ details [R. Belmont]
+
+-uses device_mconfig_additions() to add ata slots, which allows you to
+ just add the device and configure it rather than using the
+ MCFG_ATA_INTERFACE_ADD #define. [smf]
+
+-allow building with ICL on Windows if you have it installed into MSVC [Dean London]
+ The ICL compiler on Windows installs over MSVC and piggybacks onto the
+ build tools Microsoft provide. To enable compilation use USE_ICL=1
+ when compiling with MSVC_BUILD=1 (from the ICL enabled command prompt)
+ + gives a more stable build than the MSVC compiler + more informative
+ compile errors when using ICL compared to MSVC compiler + can still
+ use MSVC debugging tools (better than GCC) + can use additional intel
+ tools etc.
+ build is still slower than GCC one
+
+-aristmk4.c: [Lord-Data]
+ * Option to raise outputs for physical meters to be used
+ * Option to disable making sound effects for emulated meters
+ * Option to disable virtual emulation of hopper/coin release system
+
+-k005289.c: refactored, removed redundant state variables and
+ unneccessary floating point math, added savestate support
+ [Alex Jackson]
+
+-Removed support for static config from slots and converted the two
+ devices using it to machine config fragments [smf]
+
+-Pong update: [couriersud]
+ * based on feedback from IRC hopefully fixed issues like "jumping"
+ * adjusted VR1 and VR2 to 50%
+ * disabled all printf output.
+
+-converted serial & rs232 devices to devcb2 [smf]
+
+-diimage: Added load_software_region() function that loads a software
+ list region into a shared_ptr. [Curt Coder]
+
+-Added preliminary sound to ghosteo.c by borrowing code from vegaeo.c. [Osso]
+
+-z8.c: Modernized cpu core. [Wilbert Pol]
+
+-midyunit.c [Andy Welsh]
+ Fixed inputs and DIP Switches for hiimpact,
+ shimpact and clones which were all imported from TROG and mostly
+ incorrect.
+
+-Added Signetics 8X300 microcontroller core, updated Wicat driver to
+ use it. [Barry Rodewald]
+
+-replaced read rx/cts/dcd callbacks in ACIA6850 write write handlers,
+ which allows multiple chips to be connected together without using
+ glue methods. [smf]
+
+-Changed Guitar Freaks 7m onwards to use a 32mb PCMCIA card [smf]
+
+-Redumped some beatmania IIDX CD's [Guru]
+
+-Redumped several Konami GV CD's [Guru]
+
+-Redumped several Konami M2 CD's [Guru]
+
+-Redumped various System 573 CD's [Guru]
+
+-i8089: implement remaining instructions and support execution from
+ "io" space. [Carl]
+
+-replaced read callbacks in I8251/Z80DART (and clones)/MC2661/
+ MC68901/IM6402/MOS6551/Z80STI/MC6852/MC6854/ZX8302 with
+ write handlers, which allows multiple chips to be connected
+ together without using glue methods. [smf]
+
+-Removed a load of unused code from MC68901, probably left
+ over when it was converted to use diserial. [smf]
+
+-Removed dependency clutter in c64 expansion port, c128 driver,
+ ecbbus & econet [smf]
+
+-nemesis.c: added PORT_TOGGLE and PORT_NAMEs to Konami GT.
+ [baritonomarchetto]
+
+-Rom locations added for Battles (Xevious bootleg), G.I. Joe,
+ Ghosts'n Goblins (US), Victory Road and Guerilla War (Version
+ 1) as well as nvram location to The Simpsons. [Kevin Eshbach]
+
+-Added readmes for gijoe, moo, xexex, lethal, mystwarr also
+ updating simpsons. [Guru]
+
+
+New games added or promoted from NOT_WORKING status
+---------------------------------------------------
+Long Beach [any, hap]
+The Gladiator / Road of the Sword / Shen Jian [David Haywood, rtw]
+Blastaball (Arcadia, V 2.1) [Unigame]
+Pharaohs Match (Arcadia) [Unigame]
+Delta Command (Arcadia) [Unigame]
+Wave shark/Jet Wave [Phil Bennett]
+Puzzle Star (Sang Ho Soft) [Angelo Salese, Wilbert Pol]
+Dancing Stage - Internet Ranking Ver (GC845 VER. EBA) [smf, skype]
+Player's Edge Plus (XM00007P+XMP00006) Multi-Poker [BrianT, Ken]
+Player's Edge Plus (X000838S+XS000002) Five Times Pay Slots [BrianT, Kevin]
+Player's Edge Plus (X000841S+XS000002) Five Times Pay Slots [BrianT, Kevin]
+Player's Edge Plus (X001087S+XS000006) Double Double Diamond Slots [BrianT, Kevin]
+Player's Edge Plus (IP0079) Standard Draw Poker - French [BrianT, Ken]
+Player's Edge Plus (X002420P+XP000064) Deuces Wild Bonus Poker - French [BrianT, Ken]
+Power Kick [bodger319, Yohji, Smitdogg, The Dumping Union, Angelo Salese]
+S.V.G. - Spectral vs Generation (M68k label V100JP)
+ (ARM label V100JP ROM 05/12/05 S.V.G V100) (Japan, JAMMA PCB) [rtw, David Haywood]
+
+
+New clones added
+----------------
+Scramble (Recreativos Franco, Spanish bootleg) [Basilio Garcia]
+The Gladiator / Road of the Sword / Shen Jian (M68k label V100)
+ (ARM label V101, ROM 03/13/03 SHEN JIAN) [Artemio Urbina]
+Super Chase - Criminal Termination (1992/10/26 20:24:29 CHASE 3 VER 1.1, prototype) [Unigame]
+Brick Zone (v1.1) [Unigame]
+Cadash (World, prototype) [Unigame]
+1942 (prototype?) [Unigame]
+4 En Raya (set 2) [Unigame]
+Gallop Racer (English Ver 10.17.K) [Arzeno Fabrice, The Dumping Union]
+Chase Bombers (prototype) [Unigame]
+The First Funky Fighter (set 2) [Unigame]
+Cobra Command (Data East LD, set 2) [Unigame] (not working)
+Spy Hunter (prototype) [Unigame] (not working, needs more work)
+U.N. Defense Force: Earth Joker (Japan, prototype?) [Unigame]
+Syvalion (World, prototype) [Unigame]
+Donkey Kong Junior (P kit) [Chris Psaros]
+Who Dunit (version 9.0) [Joe Magiera]
+Commando (US set 2) [Kevin Eshbach]
+Bucky O'Hare (ver EA) [caius]
+Player's Edge Plus (PP0055) Deuces Wild Poker (set 2) [BrianT]
+Player's Edge Plus (PP0171) Joker Poker [BrianT]
+Player's Edge Plus (X000054P+XP000038) Deuces Wild Poker [BrianT]
+Player's Edge Plus (PP0002) Standard Draw Poker [BrianT, Ken]
+Player's Edge Plus (PP0045) 10's or Better [BrianT, Ken]
+Player's Edge Plus (PP0455) Joker Poker [BrianT, Ken]
+Player's Edge Plus (PP0458) Joker Poker [BrianT, Ken]
+Player's Edge Plus (PP0536) Joker Poker [BrianT, Ken]
+Player's Edge Plus (PP0726) Double Bonus Poker [BrianT, Ken]
+Player's Edge Plus (IP0074) Joker Poker - French [BrianT, Ken]
+Player's Edge Plus (X000045P+XP000038) 10's or Better [BrianT, Ken]
+Player's Edge Plus (XMP00017) 5-in-1 Wingboard (CG2426) [BrianT, Ken]
+Player's Edge Plus (PP0417) Deuces Wild Poker (set 2) [BrianT, Kevin]
+Player's Edge Plus (PP0002) Standard Draw Poker (set 2) [BrianT, Ken]
+Player's Edge Plus (XMP00017) 5-in-1 Wingboard (CG2352) [BrianT, Ken]
+Player's Edge Plus (PP0046) 10's or Better [BrianT, Ken]
+Player's Edge Plus (X000002P+XP000038) Standard Draw Poker [BrianT, Ken]
+Player's Edge Plus (X000060P+XP000038) Standard Draw Poker [BrianT, Ken]
+Player's Edge Plus (X000171P+XP000038) Joker Poker [BrianT, Ken]
+Player's Edge Plus (X000417P+XP000053) Deuces Wild Poker [BrianT, Ken]
+Player's Edge Plus (X000459P+XP000038) Joker Poker [BrianT, Ken]
+Player's Edge Plus (X002043P+XP000038) Triple Bonus Poker [BrianT, Ken]
+Player's Edge Plus (X002066P+XP000038) Double Double Bonus Poker [BrianT, Ken]
+Player's Edge Plus (X002121P+XP000037) Standard Draw Poker [BrianT, Ken]
+Player's Edge Plus (X002150P+XP000038) 4 of a Kind Bonus Poker [BrianT, Ken]
+Player's Edge Plus (X002180P+XP000038) Double Bonus Poker [BrianT, Ken]
+Touchmaster 4000 (v6.03 New Jersey) [Brian Troha, The Dumping Union]
+Touchmaster 4000 (v6.01 Minnesota) [Brian Troha, The Dumping Union]
+Touchmaster 5000 (v7.10 Minnesota) [Brian Troha, The Dumping Union]
+Touchmaster 7000 (v8.05 New Jersey) [Brian Troha, The Dumping Union]
+Touchmaster 7000 (v8.04 Minnesota) [Brian Troha, The Dumping Union]
+Touchmaster 7000 (v8.00 Minnesota) [Brian Troha, The Dumping Union]
+World Kicks (WK3 Ver. A) [Guru]
+Wivern Wings [Brian Troha, Tormod, Smitdogg, The Dumping Union]
+Invasion - The Abductors (version 3.0) [Brian Troha, Smitdogg, The Dumping Union]
+Street Fighter III: New Generation (Euro 970204) [Layne, Smitdogg, The Dumping Union]
+
+
+New games marked as GAME_NOT_WORKING
+------------------------------------
+beatmania IIDX Substream (983 JAA) [smf]
+beatmania IIDX 5th style (GCA17 JA) [smf]
+beatmania IIDX (863 JAB) [Guru]
+beatmania IIDX 3rd style (GC992 JAC) [smf]
+beatmania IIDX 6th style (GCB4U JAB) [smf]
+Tokimeki Memorial Oshiete Your Heart (GQ673 JAA) [Guru]
+Total Vice (ver AAB) [Guru]
+Super Six Plus II English Mark Darts [Jim Stolis]
+Tokimeki Memorial Oshiete Your Heart Seal Version Plus (GE756 JAA) [Guru]
+Submarine (Midway) [John Robertson, hap]
+Mambo A Go-Go e-Amusement (GQA40 VER. JRB) [smf]
+Touch de Uno! [R. Belmont, bodger319, gamerfan, f205v, Yohji, Smitdogg, rtw, The Dumping Union]
diff --git a/docs/release/src/osd/winui/help/html/mameui_art.htm b/docs/release/src/osd/winui/help/html/mameui_art.htm
new file mode 100644
index 00000000000..bb2dc16d8de
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_art.htm
@@ -0,0 +1,139 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI Art &amp; Support Files</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+div.Section1
+ {page:Section1;}
+.style1 {
+ font-weight: bold;
+}
+-->
+</style>
+<base target="_blank">
+</head>
+
+<body background="../images/bkground.gif">
+
+<h2>Art &amp; Support Files</h2>
+<p class="MsoNormal">MameUI's flexible GUI framework allows for some beautiful
+customization; including font color, icons, screenshot art, and background images.&nbsp;
+The official site for the snaps and icons is <b>
+<a target="_blank" href="http://mameui.info/">MameUI</a></b>.&nbsp; The following files are used for this customization.</p>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a style="color: blue; text-decoration: underline; text-underline: single" target="_blank" href="http://mameui.info/">Icons.zip</a></b>
+: This file contains icons for every game in MameUI and the folder view on the
+far left.&nbsp; Place it in the \MameUI\icons folder, it can remain zipped to
+save slack HD space but the zip file must be named icons.zip.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a style="color: blue; text-decoration: underline; text-underline: single" target="_blank" href="http://mameui.info/">Snap.zip</a></b> : These are a series of files that contain in-game screenshots
+of every parent game in MameUI.&nbsp; Download the packs and extract their
+contents into the \MameUI\snap directory or combine their *.png contents into
+one large snap.zip file.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+Titles.zip</b> : This file can provide support for screenshots showing the
+titles of the game in MameUI, place in \titles directory.&nbsp; </p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Marquees.zip</b> : This file can provide support for the
+marquee images that appear on the top of arcade machines, place in \marquees
+directory..</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>
+<span style="font-style:normal; font-variant:normal; font-weight:700">Cpanel</span><b>.zip</b> : This file can provide support for the
+images of arcade control panels, place in \cpanel directory..</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>
+<span style="font-style: normal; font-variant: normal; line-height: normal;" class="style1">
+PCB</span><b>.zip</b> : This file can provide support for the
+images of arcade printed circuit boards, place in \pcb directory..</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+Bkground.zip</b> : This file contains numerous images that are used as the
+background for the MameUI GUI [beneath the game list, behind the
+screenshot/folder areas]. Download this file and extract its contents into the
+\MameUI\bkground directory. Choose a background
+image in the Options menu.&nbsp; To have it rotated randomly on MameUI launch,
+toggle the checkbox in the Options • Interface Options menu.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a target="_blank" href="http://www.arcadeflyers.net">Flyers.zip</a></b> : This file can provide support for the original flyers sent to
+arcade operators, exhorting them to buy the games, place in \flyers directory.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+Cabinets.zip</b> : These are a series of files that contain images of the
+actual physical arcade machines themselves.&nbsp; Download the packs and extract their contents into the \MameUI\cabinets
+directory or combine their *.png contents into one large cabinets.zip.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a style="color: blue; text-decoration: underline; text-underline: single" target="_blank" href="http://www.arcade-history.com">History.dat</a></b> : This file contains the original game’s designer’s names,
+and assorted trivia.&nbsp; Place this file in the \MameUI folder alongside
+MameUI.exe. It will display if the history art tab is toggled, or if the history
+tab is not selected, it will display beneath snapshots.</p>
+
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-12 02:05 PM -0800<!--webbot bot="Timestamp" endspan i-checksum="37923" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_changes.txt b/docs/release/src/osd/winui/help/html/mameui_changes.txt
new file mode 100644
index 00000000000..c995ab92847
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_changes.txt
@@ -0,0 +1,2132 @@
+ -|ad5u1337 "unknown Scorpion '39211337' (Mazooma) (Scorpion 5, Adder 5)"
+ -|altbeastj2 "Juuouki (set 5, Japan, FD1094 317-0069)"
+ -|circusse "Circus (Sub-Electro bootleg)"
+ -|gt5 "Trivia (Version 5.06)"
+ -|sc4pacmnc "Pac Man (PR7072) (Mazooma) (Scorpion 4) (set 4)"
+ -|sc4pacmnd "Pac Man (PR7072) (Mazooma) (Scorpion 4) (set 5)"
+ -|sc4pacmne "Pac Man (PR7072) (Mazooma) (Scorpion 4) (set 6)"
+ -|sfiii3a "Street Fighter III 3rd Strike: Fight for the Future (Euro 990512)"
+ -|sfiii3an "Street Fighter III 3rd Strike: Fight for the Future (Japan 990512, NO CD)"
+ -|sfiii3au "Street Fighter III 3rd Strike: Fight for the Future (USA 990512)"
+ -|spacefbu "Space Firebird (Nintendo, set 2)"
+ -|suprpkr1 "Super Poker (Version 10.15S)"
+ +|1941r1 "1941: Counter Attack (World)"
+ +|a51site4a "Area 51: Site 4 (September 11, 1998)"
+ +|arknoid2b "Arkanoid - Revenge of DOH (Japan bootleg)"
+ +|batlgr2a "Battle Gear 2 (v2.01J)"
+ +|bgareggabl "1945 Part-2 (Chinese hack of Battle Garegga)"
+ +|bigstrkba "Big Striker (bootleg w/Italian teams)"
+ +|bikkuric "Bikkuri Card (Japan)"
+ +|boblbobl2 "Bobble Bobble (set 2)"
+ +|casbjack "Casino Black Jack (color, Standard 00-05)"
+ +|caspoker "Casino Poker (Ver PM86LO-35-5, German)"
+ +|chamburger "Hamburger (DECO Cassette, Japan)"
+ +|chance32 "Chance Thirty Two"
+ +|cninjaa "Caveman Ninja (alternate)"
+ +|cninjabl2 "Caveman Ninja (bootleg, alt)"
+ +|congoa "Congo Bongo (Rev C, 3 board stack)"
+ +|coozumou "Oozumou - The Grand Sumo (DECO Cassette, Japan)"
+ +|cskater "Skater (DECO Cassette, Japan)"
+ +|csplayh1 "Super CD Dai8dan Mahjong Hanafuda Cosplay Tengoku (Japan)"
+ +|drgninjab "Dragonninja (bootleg)"
+ +|driblingbr "Dribbling (bootleg, Brazil)"
+ +|drivfrct "Top Racer (bootleg of Driving Force)"
+ +|dtfamily "Diet Family"
+ +|dwpc "Dragon World Pretty Chance (V101, Japan)"
+ +|dynablstb2 "Dynablaster / Bomber Man (bootleg, alt)"
+ +|ertictaca "Erotictac/Tactic (ver 01)"
+ +|eyesb "Eyes (bootleg set 1)"
+ +|fantastc "Fantastic"
+ +|ffighta "Final Fight (World, set 2)"
+ +|fsoccerba "Fighting Soccer (Joystick hack bootleg, alt)"
+ +|funcube5 "Funcube 5 (v1.0)"
+ +|funriverd1 "Fun River (Version 1.3R CGA)"
+ +|galemp "Galaxy Empire (bootleg?)"
+ +|gldarrow "Golden Arrow (Standard G8-03)"
+ +|gtsers10a "Trivia (Questions Series 10 Alt Question Rom)"
+ +|gtsers11a "Trivia (Questions Series 11 Alt Question Rom)"
+ +|gtsers12 "Trivia (Questions Series 12)"
+ +|gtsers14 "Trivia (Questions Series 14)"
+ +|gtsers15 "Trivia (Questions Series 15)"
+ +|haunthig "Haunted House (IGS)"
+ +|hndlchmp "Handle Champ (GQ710 VER. JAB)"
+ +|hotmindff "Hot Mind (Fit of Fighting hardware)"
+ +|hypbbc2p "Hyper Bishi Bashi Champ - 2 Player (GX908 1999/08/24 VER. JAA)"
+ +|hypbbc2pk "Hyper Bishi Bashi Champ - 2 Player (GX908 1999/08/24 VER. KAA)"
+ +|initdv3e "Initial D Arcade Stage Ver. 3 (Export) (GDS-0033)"
+ +|intrepidb "Intrepid (bootleg)"
+ +|invadpt2br "Space Invaders Part II (Brazil)"
+ +|jankenmn "Janken Man Kattara Ageru"
+ +|jzth "Jue Zhan Tian Huang"
+ +|kong "Kong (Brazil)"
+ +|kovshxas "Knights of Valour: Aoshi Sanguo / Sangoku Senki: Aoshi Sanguo (ver. 202CN)"
+ +|luckboom "Lucky Boom"
+ +|manohman "Mann, oh-Mann"
+ +|mazan "Mazan: Flash of the Blade (MAZ1 Ver. A)"
+ +|megat2caa "Pit Boss Megatouch II (9255-10-06 ROE, California version)"
+ +|megat4c "Megatouch IV (9255-40-01 RO, Standard version)"
+ +|mooncrstuku "Moon Cresta (Nichibutsu UK, unencrypted)"
+ +|nflclsfb "NFL Classic Football (NCF3 Ver.A.)"
+ +|nibblerp "Nibbler (Pioneer Balloon conversion)"
+ +|ninjaslt "Ninja Assault (NJA3 Ver. A)"
+ +|orunnersj "OutRunners (Japan)"
+ +|pclb2elk "Print Club 2 Earth Limited Kobe (Print Club Custom) (J 970808 V1.000)"
+ +|polarisbr "Polaris (Brazil)"
+ +|potgoldu "Pot O' Gold (U.S. Games, v400x?)"
+ +|pr_qksht "Quickshot (Maygay) (PROCONN)"
+ +|pwrshovl "Power Shovel ni Norou!! - Power Shovel Simulator"
+ +|pyson "Konami Pyson BIOS"
+ +|quizshow "Quiz Show"
+ +|rfjett "Raiden Fighters Jet (Taiwan)"
+ +|sc2luvv1 "Luvvly Jubbly (set 2, UK, Arcade, 10GBP Jackpot) (Scorpion 2/3)"
+ +|sc2luvv1p "Luvvly Jubbly (set 2, UK, Arcade, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ +|sc2luvv2 "Luvvly Jubbly (set 3, UK, Multisite) (Scorpion 2/3)"
+ +|sc2luvv2p "Luvvly Jubbly (set 3, UK, Multisite, Protocol) (Scorpion 2/3)"
+ +|sc2luvv3 "Luvvly Jubbly (set 4, UK, Arcade) (Scorpion 2/3)"
+ +|sc2luvv4 "Luvvly Jubbly (set 5, UK, Arcade) (Scorpion 2/3)"
+ +|sc2luvv5p "Luvvly Jubbly (set 6, UK, Protocol) (Scorpion 2/3)"
+ +|sc2luvv6p "Luvvly Jubbly (set 7, UK, Protocol) (Scorpion 2/3)"
+ +|sc2luvv7p "Luvvly Jubbly (set 8, UK, Protocol) (Scorpion 2/3)"
+ +|sc4boomb "Monopoly Boom Or Bust (Bellfruit) (Scorpion 4) (set 1)"
+ +|sc4boomba "Monopoly Boom Or Bust (Bellfruit) (Scorpion 4) (set 2)"
+ +|sc4bwow "Wheel Of Wealth (Bellfruit) (PR1726) (Scorpion 4) (WHEL013, set 1)"
+ +|sc4bwowa "Wheel Of Wealth (Bellfruit) (PR1726) (Scorpion 4) (WHEL013, set 2)"
+ +|sc4cckeyl "Casino Crazy Fruits Gold (Bellfruit) (Scorpion 4) (set 13)"
+ +|sc4cckeym "Casino Crazy Fruits Gold (Bellfruit) (Scorpion 4) (set 14)"
+ +|sc4cckeyn "Casino Crazy Fruits Gold (Bellfruit) (Scorpion 4) (set 15)"
+ +|sc4cckeyo "Casino Crazy Fruits Gold (Bellfruit) (Scorpion 4) (set 16)"
+ +|sc4cclimq "Crazy Climber (Bellfruit) (Scorpion 4) (set 18)"
+ +|sc4cclimr "Crazy Climber (Bellfruit) (Scorpion 4) (set 19)"
+ +|sc4cclims "Crazy Climber (Bellfruit) (Scorpion 4) (set 20)"
+ +|sc4cclimt "Crazy Climber (Bellfruit) (Scorpion 4) (set 21)"
+ +|sc4cclimu "Crazy Climber (Bellfruit) (Scorpion 4) (set 22)"
+ +|sc4clbmn "Club Moneybags (Bellfruit) (Scorpion 4) (set 1)"
+ +|sc4clbmna "Club Moneybags (Bellfruit) (Scorpion 4) (set 2)"
+ +|sc4clbmnb "Club Moneybags (Bellfruit) (Scorpion 4) (set 3)"
+ +|sc4clbmnc "Club Moneybags (Bellfruit) (Scorpion 4) (set 4)"
+ +|sc4crcpi "Cops 'n' Robbers Club Platinum (Bellfruit) (Scorpion 4) (set 9)"
+ +|sc4crcpj "Cops 'n' Robbers Club Platinum (Bellfruit) (Scorpion 4) (set 10)"
+ +|sc4crzkyt "Crazy Keys Casino (Bellfruit) (Scorpion 4) (set 13)"
+ +|sc4crzkyu "Crazy Keys Casino (Bellfruit) (Scorpion 4) (set 14)"
+ +|sc4crzkyv "Crazy Keys Casino Arcade (Bellfruit) (Scorpion 4) (set 9)"
+ +|sc4crzkyw "Crazy Keys Casino Arcade (Bellfruit) (Scorpion 4) (set 10)"
+ +|sc4fguyd "Family Guy (Bellfruit) (Scorpion 4) (set 5)"
+ +|sc4fguye "Family Guy (Bellfruit) (Scorpion 4) (set 6)"
+ +|sc4ggtb "Golden Game (Mazooma) (PR2056, Top Box) (Scorpion 4) (set 1)"
+ +|sc4ggtba "Golden Game (Mazooma) (PR2056, Top Box) (Scorpion 4) (set 2)"
+ +|sc4ggtbb "Golden Game (Mazooma) (PR2056, Top Box) (Scorpion 4) (set 3)"
+ +|sc4hntcsp "Happy Notes Casino (Bellfruit) (Scorpion 4) (set 17)"
+ +|sc4hntcsq "Happy Notes Casino (Bellfruit) (Scorpion 4) (set 18)"
+ +|sc4hntcsr "Happy Notes Casino (Bellfruit) (Scorpion 4) (set 19)"
+ +|sc4hntcss "Happy Notes Casino (Bellfruit) (Scorpion 4) (set 20)"
+ +|sc4ijobl "Italian Job (Mazooma) (Scorpion 4) (set 13)"
+ +|sc4ijobm "Italian Job (Mazooma) (Scorpion 4) (set 14)"
+ +|sc4luckb1 "Lucky Balls Casino (Bellfruit) (Scorpion 4) (set 23)"
+ +|sc4luckb2 "Lucky Balls Casino (Bellfruit) (Scorpion 4) (set 24)"
+ +|sc4luckb3 "Lucky Balls Casino (Bellfruit) (Scorpion 4) (set 25)"
+ +|sc4luckb4 "Lucky Balls Casino (Bellfruit) (Scorpion 4) (set 26)"
+ +|sc4mgrj "Money Go Round Casino (Bellfruit) (Scorpion 4) (set 11)"
+ +|sc4mgrk "Money Go Round Casino (Bellfruit) (Scorpion 4) (set 12)"
+ +|sc4mgrl "Money Go Round Casino (Bellfruit) (Scorpion 4) (set 13)"
+ +|sc4mgrm "Money Go Round Casino (Bellfruit) (Scorpion 4) (set 14)"
+ +|sc4mhpl "Monopoly Hot Property (Bellfruit) (Scorpion 4) (set 13)"
+ +|sc4mhpm "Monopoly Hot Property (Bellfruit) (Scorpion 4) (set 14)"
+ +|sc4mhpn "Monopoly Hot Property (Bellfruit) (Scorpion 4) (set 15)"
+ +|sc4mwwtb "Monopoly Wheel Of Wealth (Mazooma) (PR2389, Top Box) (Scorpion 4) (set 1)"
+ +|sc4mwwtba "Monopoly Wheel Of Wealth (Mazooma) (PR2389, Top Box) (Scorpion 4) (set 2)"
+ +|sc4mwwtbb "Monopoly Wheel Of Wealth (Mazooma) (PR2389, Top Box) (Scorpion 4) (set 3)"
+ +|sc4mwwtbc "Monopoly Wheel Of Wealth (Mazooma) (PR2389, Top Box) (Scorpion 4) (set 4)"
+ +|sc4mwwtbd "Monopoly Wheel Of Wealth (Mazooma) (PR2389, Top Box) (Scorpion 4) (set 5)"
+ +|sc4pacqp "Pac Man (PR7072) (QPS) (Scorpion 4) (set 1)"
+ +|sc4pacqpa "Pac Man (PR7072) (QPS) (Scorpion 4) (set 2)"
+ +|sc4pacqpb "Pac Man (PR7072) (QPS) (Scorpion 4) (set 3)"
+ +|sc4pogbld "Pots Of Gold Club (Bellfruit) (Scorpion 4) (set 5)"
+ +|sc4pogble "Pots Of Gold Club (Bellfruit) (Scorpion 4) (set 6)"
+ +|sc4pogh "Pots Of Gold (Bellfruit) (Scorpion 4) (set 9)"
+ +|sc4pogi "Pots Of Gold (Bellfruit) (Scorpion 4) (set 10)"
+ +|sc4popeyd "Popeye (Mazooma) (Scorpion 4) (set 5)"
+ +|sc4popeye "Popeye (Mazooma) (Scorpion 4) (set 6)"
+ +|sc4showtf "Showtime (Bellfruit) (Scorpion 4) (set 7)"
+ +|sc4wldbnn "Wild Bunch (Bellfruit) (Scorpion 4) (set 11)"
+ +|sc4wldbno "Wild Bunch (Bellfruit) (Scorpion 4) (set 12)"
+ +|sc4wldbnp "Wild Bunch (Bellfruit) (Scorpion 4) (set 13)"
+ +|sc4wldbnq "Wild Bunch (Bellfruit) (Scorpion 4) (set 14)"
+ +|sfex2ph "Street Fighter EX2 Plus (Hispanic 990611)"
+ +|sfiii3nr1 "Street Fighter III 3rd Strike: Fight for the Future (Japan 990512, NO CD)"
+ +|sfiii3r1 "Street Fighter III 3rd Strike: Fight for the Future (Euro 990512)"
+ +|sfiii3ur1 "Street Fighter III 3rd Strike: Fight for the Future (USA 990512)"
+ +|silvmil "Silver Millennium"
+ +|soulclb3a "Soul Calibur III (SC31002-NA-A)"
+ +|soulsurf "Soul Surfer (Rev A)"
+ +|spikes91a "1991 Spikes (Italian bootleg, set 2)"
+ +|springbd "Springboard (bootleg of Circus)"
+ +|ssf2xjr "Super Street Fighter II X: Grand Master Challenge (Japan 940223 rent version)"
+ +|sshooter17 "Sharpshooter (Rev 1.7)"
+ +|superchsj "Super Chase - Criminal Termination (Japan)"
+ +|suprpokra "Super Poker (Version 10.15S)"
+ +|suprpokrb "Super Poker (Version 10.10)"
+ +|suprstar "Super Stars"
+ +|tbowlp "Tecmo Bowl (World, prototype?)"
+ +|tekken4c "Tekken 4 (TEF1 Ver. C)"
+ +|touryuu "Touryuumon (V1.1)?"
+ +|tvlegaxe "Makyo Densetsu - The Legenary Axe (Tourvision PCE bootleg)"
+ +|tvsvball "Super Volley ball (Tourvision PCE bootleg)"
+ +|vcopa "Virtua Cop (Revision A)"
+ +|vhuntjr1s "Vampire Hunter: Darkstalkers' Revenge (Japan 950307 stop version)"
+ +|voyager "Star Trek: Voyager"
+ +|wboy5 "Wonder Boy (set 5, bootleg)"
+ +|wboyub "Wonder Boy (US bootleg)"
+ +|winrungp "Winning Run Suzuka Grand Prix (Japan)"
+ +|wstrike "Witch Strike (Export, 6T/12T ver 1.01A)"
+ +|wstrikea "Witch Strike (Export, 6T/12T ver 1.01B)"
+ +|wswe "World Soccer Winning Eleven Arcade Game Style"
+ +|wswe2k3 "World Soccer Winning Eleven Arcade Game 2003"
+ +|wtchjack "Witch Jack (Export, 6T/12T ver 0.87-89)"
+ +|wtchjacka "Witch Jackpot (Export, 6T/12T ver 0.25)"
+ +|wtchjackb "Witch Jack (Export, 6T/12T ver 0.40)"
+ +|wtchjackc "Witch Jack (Export, 6T/12T ver 0.40T)"
+ +|wtchjackd "Witch Jack (Export, 6T/12T ver 0.62)"
+ +|wtchjacke "Witch Jack (Export, 6T/12T ver 0.64)"
+ +|wtchjackf "Witch Jack (Export, 6T/12T ver 0.65)"
+ +|wtchjackg "Witch Jack (Export, 6T/12T ver 0.70S)"
+ +|wtchjackh "Witch Jack (Export, 6T/12T ver 0.70P)"
+ +|wtchjacki "Witch Jack (Export, 6T/12T ver 0.87)"
+ +|wtchjackj "Witch Jack (Export, 6T/12T ver 0.87-88)"
+ +|wupndown "Witch Up & Down (Export, 6T/12T ver 1.02)"
+ +|wupndowna "Witch Up & Down (Export, 6T/12T ver 0.99, set 1)"
+ +|wupndownb "Witch Up & Down (Export, 6T/12T ver 0.99, set 2)"
+ +|wupndownc "Witch Up & Down (Export, 6T/12T ver 0.99, set 3)"
+ +|wupndownd "Witch Up & Down (Export, 6T/12T ver 0.99T)"
+ +|yosimotm "Mahjong Yoshimoto Gekijou [BET] (Japan)"
+ +|zekepeak "Zeke's Peak"
+ +|zerotm2k "Zero Team 2000"
+ +|zokumahj "Zoku Mahjong Housoukyoku (Japan)"
+ C|1941 "1941: Counter Attack (World 900227)"
+ c|1941 "1941: Counter Attack (World)"
+ C|99lstwar "'99: The Last War (set 1)"
+ c|99lstwar "'99: The Last War"
+ c|99lstwara "'99: The Last War (alternate)"
+ C|99lstwara "'99: The Last War (set 2)"
+ C|altbeast5 "Altered Beast (set 5, FD1094 317-0069)"
+ c|altbeast5 "Altered Beast (set 6, 8751 317-0076)"
+ C|altbeast6 "Altered Beast (set 6, 8751 317-0076)"
+ C|am_mg3a "Multi Game III (V.Ger 3.64)"
+ c|am_uslot "Amatic Unknown Slots Game"
+ C|andromep "Andromeda (set 1)"
+ c|andromep "Andromeda"
+ c|andromepa "Andromeda (alternate set)"
+ C|andromepa "Andromeda (set 2)"
+ C|antar "Antar (set 1)"
+ c|antar "Antar"
+ c|antar2 "Antar (alternate set)"
+ C|antar2 "Antar (set 2)"
+ C|babypac "Baby Pac-Man (set 1)"
+ c|babypac "Baby Pacman (Video/Pinball Combo)"
+ C|babypac2 "Baby Pac-Man (set 2)"
+ C|baluba "Baluba-louk no Densetsu (Japan)"
+ c|baluba "Baluba-louk no Densetsu"
+ C|bmcpokr "unknown BMC poker game"
+ c|bmcpokr "Unknown BMC Poker Game"
+ c|brooklyn "Brooklyn (Bingo)"
+ C|brooklyn "Brooklyn (set 1) (Bingo)"
+ c|brooklyna "Brooklyn (alternate set)(Bingo)"
+ C|brooklyna "Brooklyn (set 2) (Bingo)"
+ c|bucky "Bucky O'Hare (ver EA)"
+ C|bucky "Bucky O'Hare (ver EAB)"
+ c|buckyaa "Bucky O'Hare (ver AA)"
+ C|buckyaab "Bucky O'Hare (ver AAB)"
+ c|buckyua "Bucky O'Hare (ver UA)"
+ C|buckyuab "Bucky O'Hare (ver UAB)"
+ C|bushido "Bushido (set 1)"
+ c|bushido "Bushido"
+ c|bushidoa "Bushido (alternate set)"
+ C|bushidoa "Bushido (set 2)"
+ c|castfant "Astro Fantasia (Cassette)"
+ C|castfant "Astro Fantasia (DECO Cassette)"
+ c|caveman "Caveman (Pinball/Video Combo)"
+ C|caveman "Caveman (Pinball/Video Combo, set 1)"
+ c|cbdash "Boulder Dash (Cassette)"
+ C|cbdash "Boulder Dash (DECO Cassette)"
+ c|cbnj "Bump 'n' Jump (Cassette)"
+ C|cbnj "Bump 'n' Jump (DECO Cassette)"
+ c|cbtime "Burger Time (Cassette)"
+ C|cbtime "Burger Time (DECO Cassette)"
+ c|cburnrub "Burnin' Rubber (Cassette, set 1)"
+ C|cburnrub "Burnin' Rubber (DECO Cassette, set 1)"
+ c|cburnrub2 "Burnin' Rubber (Cassette, set 2)"
+ C|cburnrub2 "Burnin' Rubber (DECO Cassette, set 2)"
+ c|cdiscon1 "Disco No.1 (Cassette)"
+ C|cdiscon1 "Disco No.1 (DECO Cassette)"
+ C|cdsteljn "DS Telejan (DECO Cassette, Japan)"
+ c|cexplore "Explorer (Cassette)"
+ C|cexplore "Explorer (DECO Cassette)"
+ c|cfghtice "Fighting Ice Hockey (Cassette)"
+ C|cfghtice "Fighting Ice Hockey (DECO Cassette)"
+ c|cflyball "Flying Ball (Cassette)"
+ C|cflyball "Flying Ball (DECO Cassette)"
+ c|cgraplop "Cluster Buster / Graplop (Cassette, set 1)"
+ C|cgraplop "Cluster Buster / Graplop (DECO Cassette, set 1)"
+ c|cgraplop2 "Cluster Buster / Graplop (Cassette, set 2)"
+ C|cgraplop2 "Cluster Buster / Graplop (DECO Cassette, set 2)"
+ C|chkun "Chance Kun (Japan)"
+ c|chkun "Chance Kun"
+ c|chwy "Highway Chase (Cassette)"
+ C|chwy "Highway Chase (DECO Cassette)"
+ c|clapapa "Rootin' Tootin' / La-Pa-Pa (Cassette)"
+ C|clapapa "Rootin' Tootin' / La-Pa-Pa (DECO Cassette)"
+ c|clapapa2 "Rootin' Tootin' (Cassette)"
+ C|clapapa2 "Rootin' Tootin' (DECO Cassette)"
+ C|cliffhgr "Cliff Hanger (set 1)"
+ c|cliffhgr "Cliff Hanger"
+ c|cliffhgra "Cliff Hanger (Alt)"
+ C|cliffhgra "Cliff Hanger (set 2)"
+ c|clocknch "Lock'n'Chase (Cassette)"
+ C|clocknch "Lock'n'Chase (DECO Cassette)"
+ c|cluckypo "Lucky Poker (Cassette)"
+ C|cluckypo "Lucky Poker (DECO Cassette)"
+ c|cmissnx "Mission-X (Cassette)"
+ C|cmissnx "Mission-X (DECO Cassette)"
+ c|cnightst "Night Star (Cassette, set 1)"
+ C|cnightst "Night Star (DECO Cassette, set 1)"
+ c|cnightst2 "Night Star (Cassette, set 2)"
+ C|cnightst2 "Night Star (DECO Cassette, set 2)"
+ C|congo "Congo Bongo (Rev C, 2 board stack)"
+ c|congo "Congo Bongo"
+ c|cppicf "Peter Pepper's Ice Cream Factory (Cassette, set 1)"
+ C|cppicf "Peter Pepper's Ice Cream Factory (DECO Cassette, set 1)"
+ c|cppicf2 "Peter Pepper's Ice Cream Factory (Cassette, set 2)"
+ C|cppicf2 "Peter Pepper's Ice Cream Factory (DECO Cassette, set 2)"
+ c|cprobowl "Pro Bowling (Cassette)"
+ C|cprobowl "Pro Bowling (DECO Cassette)"
+ c|cprogolf "Tournament Pro Golf (Cassette)"
+ C|cprogolf "Tournament Pro Golf (DECO Cassette)"
+ C|cprogolfj "Tournament Pro Golf (DECO Cassette, Japan)"
+ c|cpsoccer "Pro Soccer (Cassette)"
+ C|cpsoccer "Pro Soccer (DECO Cassette)"
+ c|cpsoccerj "Pro Soccer (Cassette, Japan)"
+ C|cpsoccerj "Pro Soccer (DECO Cassette, Japan)"
+ c|cptennis "Pro Tennis (Cassette)"
+ C|cptennis "Pro Tennis (DECO Cassette)"
+ c|cscrtry "Scrum Try (Cassette, set 1)"
+ C|cscrtry "Scrum Try (DECO Cassette, set 1)"
+ c|cscrtry2 "Scrum Try (Cassette, set 2)"
+ C|cscrtry2 "Scrum Try (DECO Cassette, set 2)"
+ C|csdtenis "Super Doubles Tennis (DECO Cassette, Japan)"
+ c|csuperas "Super Astro Fighter (Cassette)"
+ C|csuperas "Super Astro Fighter (DECO Cassette)"
+ c|csweetht "Sweet Heart (Cassette)"
+ C|csweetht "Sweet Heart (DECO Cassette)"
+ c|cterrani "Terranean (Cassette)"
+ C|cterrani "Terranean (DECO Cassette)"
+ c|ctisland "Treasure Island (Cassette, set 1)"
+ C|ctisland "Treasure Island (DECO Cassette, set 1)"
+ c|ctisland2 "Treasure Island (Cassette, set 2)"
+ C|ctisland2 "Treasure Island (DECO Cassette, set 2)"
+ c|ctisland3 "Treasure Island (Cassette, set 3)"
+ C|ctisland3 "Treasure Island (DECO Cassette, set 3)"
+ c|ctornado "Tornado (Cassette)"
+ C|ctornado "Tornado (DECO Cassette)"
+ c|ctsttape "Test Tape (Cassette)"
+ C|ctsttape "Test Tape (DECO Cassette)"
+ c|czeroize "Zeroize (Cassette)"
+ C|czeroize "Zeroize (DECO Cassette)"
+ C|darksealj "Dark Seal (Japan revision 4)"
+ c|darksealj "Dark Seal (Japan)"
+ c|ddp2 "Bee Storm - DoDonPachi II (ver. 102)"
+ C|ddp2 "DoDonPachi II - Bee Storm (Japan, ver. 102)"
+ c|ddp2100 "Bee Storm - DoDonPachi II (ver. 100)"
+ C|ddp2100 "DoDonPachi II - Bee Storm (Japan, ver. 100)"
+ c|ddp2101 "Bee Storm - DoDonPachi II (ver. 101)"
+ C|ddp2101 "DoDonPachi II - Bee Storm (Japan, ver. 101)"
+ c|deerhuntc "Deer Hunting USA V2"
+ C|deerhuntc "Deer Hunting USA V3"
+ C|deerhuntd "Deer Hunting USA V2"
+ c|dirtdvls "Dirt Devils (Revision A)"
+ C|dirtdvls "Dirt Devils (set 1) (Revision A)"
+ c|dirtdvlsa "Dirt Devils (alt) (Revision A)"
+ C|dirtdvlsa "Dirt Devils (set 2) (Revision A)"
+ c|disco_l1 "Disco Fever (L-1"
+ C|disco_l1 "Disco Fever (L-1)"
+ C|dmnfrnt "Demon Front (68k label V105, ROM M105XX 08/05/02) (ARM label V105, ROM 08/05/02 S105XX)"
+ c|dmnfrnt "Demon Front (ver. 102)"
+ C|dmnfrnta "Demon Front (68k label V102, ROM M102XX 06/19/02) (ARM label V102, ROM 05/24/02 S101XX)"
+ c|dmnfrnta "Demon Front (ver. 105)"
+ C|dmnfrntpcb "Demon Front (68k label V107KR, ROM M107KR 11/03/03) (ARM label V106KR, ROM 10/16/03 S106KR) (JAMMA PCB)"
+ c|doncdoon "Donchan no Hanabi de Doon"
+ C|doncdoon "Hanabi de Doon! - Don-chan Puzzle"
+ c|dynabb "Dynamite Baseball '97 (Revision A)"
+ C|dynabb "Dynamite Baseball"
+ C|dynabb97 "Dynamite Baseball 97 (Revision A)"
+ c|ec_laby "Labyrinth (Electrocoin) (?)"
+ C|ec_laby "Labyrinth (v8) (Electrocoin)"
+ c|ec_penni "Pennies From Heaven (Electrocoin) (?)"
+ C|ec_penni "Pennies From Heaven (v1) (Electrocoin)"
+ c|ec_pyram "Pyramid (Electrocoin) (?)"
+ C|ec_pyram "Pyramid (v6) (Electrocoin)"
+ c|ec_secrt "Secret Castle (Electrocoin) (?)"
+ C|ec_secrt "Secret Castle (v1) (Electrocoin)"
+ c|ec_sphin "Sphinx (Electrocoin) (?)"
+ C|ec_sphin "Sphinx (v1) (Electrocoin)"
+ c|ec_unkt "Unknown 'T' (MAB PCB?) (Concept Games Ltd) (?)"
+ C|ec_unkt "unknown 'T' (MAB PCB?) (Concept Games Ltd) (?)"
+ c|ep_beavr "Beaver Las Vegas (Global) (EPOCH, set 1)"
+ C|ep_beavr "Casino Beaver Las Vegas (Global) (EPOCH, set 1)"
+ c|ep_beavra "Beaver Las Vegas (Global) (EPOCH, set 2)"
+ C|ep_beavra "Casino Beaver Las Vegas (Global) (EPOCH, set 2)"
+ c|ep_milhr "Who Wants To Be A Millionhare (Global) (EPOCH)"
+ C|ep_milhr "Who Wants To Be A Millionhare? (Global) (EPOCH)"
+ c|ep_pkni "Phoenix Knights (Global) (EPOCH)"
+ C|ep_pkni "The Phoenix Knights (Global) (EPOCH)"
+ C|exctsccrj "Exciting Soccer (Japan set 1)"
+ c|exctsccrj "Exciting Soccer (Japan)"
+ C|eyeszacb "Eyes (bootleg set 2, decrypted)"
+ c|eyeszacb "Eyes (bootleg)"
+ c|falcnwlda "Falcons Wild - World Wide Poker (Video Klein)"
+ C|falcnwlda "Falcons Wild - World Wide Poker (Video Klein, set 1)"
+ c|falcnwldb "Falcons Wild - World Wide Poker (Falcon original)"
+ C|falcnwldb "Falcons Wild - World Wide Poker (Video Klein, set 2)"
+ C|falcnwldc "Falcons Wild - World Wide Poker (Falcon original)"
+ C|fashiong "Fashion Gambler (set 1)"
+ c|fashiong "Fashion Gambler"
+ C|fashiong2 "Fashion Gambler (set 2)"
+ c|fashiong2 "Fashion Gambler (Set 2)"
+ c|ffight "Final Fight (World)"
+ C|ffight "Final Fight (World, set 1)"
+ c|forgottnu "Forgotten Worlds (USA, B-Board 88621B-2)"
+ C|forgottnu "Forgotten Worlds (USA, B-Board 88621B-2, Rev. C)"
+ C|forgottnu1 "Forgotten Worlds (USA, B-Board 88618B-2, Rev. C)"
+ c|forgottnua "Forgotten Worlds (USA, B-Board 88618B-2)"
+ C|forgottnua "Forgotten Worlds (USA, B-Board 88618B-2, Rev. A)"
+ C|garou "Garou - Mark of the Wolves (NGM-2530)"
+ c|garou "Garou - Mark of the Wolves (set 1)"
+ C|garouh "Garou - Mark of the Wolves (NGM-2530)(NGH-2530)"
+ c|garouo "Garou - Mark of the Wolves (set 2)"
+ c|ggate "Golden Gate (Bingo)"
+ C|ggate "Golden Gate (set 1) (Bingo)"
+ c|ggatea "Golden Gate (alternate set)(Bingo)"
+ C|ggatea "Golden Gate (set 2) (Bingo)"
+ c|gl_coc "Carry On Clubbin' (Global) (Stealth)"
+ C|gl_coc "Carry On Clubbin' (Global) (v3.0) (Stealth)"
+ C|gl_coc29 "Carry On Clubbin' (Global) (v2.9) (Stealth)"
+ C|gl_coc29p "Carry On Clubbin' (Global) (v2.9 Protocol) (Stealth)"
+ C|gl_cocp "Carry On Clubbin' (Global) (v3.0 Protocol) (Stealth)"
+ c|gl_dow "Deals On Wheels (Global) (Stealth)"
+ C|gl_dow "Deals On Wheels (Global) (v1.4) (Stealth)"
+ c|gl_dowcl "Deals On Wheels Club (Global) (Stealth)"
+ C|gl_dowcl "Deals On Wheels Club (Global) (v1.6) (Stealth)"
+ C|gl_dowclp "Deals On Wheels Club (Global) (v1.6 Protocol) (Stealth)"
+ C|gl_dowp "Deals On Wheels (Global) (v1.4 Protocol) (Stealth)"
+ c|gl_hbh "Heartbreak Hotel (Global) (Stealth)"
+ C|gl_hbh "Heartbreak Hotel (Global) (v1.0) (Stealth)"
+ c|gl_hbhcl "Heartbreak Hotel Club (Global) (Stealth)"
+ C|gl_hbhcl "Heartbreak Hotel Club (Global) (v1.9) (Stealth)"
+ C|gl_hbhcla "Heartbreak Hotel Club (Global) (Set 2) (Stealth)"
+ C|gl_hbhclp "Heartbreak Hotel Club (Global) (v1.9 Protocol) (Stealth)"
+ c|gl_uyr "Up Yer Riggin Club (Global) (Stealth)"
+ C|gl_uyr "Up Yer Riggin Club (Global) (v2.8) (Stealth)"
+ C|gl_uyrp "Up Yer Riggin Club (Global) (v2.8 Protocol) (Stealth)"
+ c|gl_wywh "Wish You Were Here Club (Global) (Stealth)"
+ C|gl_wywh "Wish You Were Here Club (Global) (v2.9) (Stealth)"
+ C|gl_wywh24 "Wish You Were Here Club (Global) (v2.4) (Stealth)"
+ C|gl_wywh24p "Wish You Were Here Club (Global) (v2.4 Protocol) (Stealth)"
+ C|gl_wywhp "Wish You Were Here Club (Global) (v2.9 Protocol) (Stealth)"
+ C|goldball "Gold Ball (set 1)"
+ c|goldball "Gold Ball"
+ c|goldballn "Gold Ball (alternate set)"
+ C|goldballn "Gold Ball (set 2)"
+ C|goldmedl "Gold Medalist (set 1)"
+ c|goldmedl "Gold Medalist"
+ c|goldmedla "Gold Medalist (alt)"
+ C|goldmedla "Gold Medalist (set 2)"
+ c|granny "Granny and the Gators (Video/Pinball Combo)"
+ C|granny "Granny and the Gators"
+ C|gt103a1 "Trivia (Unsorted question roms)"
+ c|gt103a1 "Trivia (Version 1.03a) (alt 1)"
+ c|gt103a2 "Trivia (Version 1.03a) (alt 2)"
+ c|gt103a3 "Trivia (Version 1.03a) (alt 3)"
+ C|gt103aa "Trivia (Version 1.03a Alt questions 1)"
+ c|gt103aa "Trivia (Version 1.03a Alt questions)"
+ C|gt103ab "Trivia (Version 1.03a Alt questions 2)"
+ C|gulfstrm "Gulf Storm (set 1)"
+ c|gulfstrm "Gulf Storm"
+ C|gulfstrma "Gulf Storm (set 2)"
+ C|gundealrt "Gun Dealer (Japan)"
+ c|gundealrt "Gun Dealer (Korea)"
+ C|gunsur2 "Gun Survivor 2 Biohazard Code: Veronica (BHF1 Ver. A)"
+ c|gunsur2 "Gun Survivor 2 Biohazard Code: Veronica"
+ c|hb_mrmon "Mr Money (Qps)"
+ C|hb_mrmon "Mr. Money (Qps)"
+ C|hb_ydd "Yabba-Dabba-Dough (Qps)"
+ c|hb_ydd "Yabba Dabba Dough (Qps)"
+ C|hyhoo "Hayaoshi Taisen Quiz Hyhoo (Japan)"
+ c|hyhoo "Taisen Quiz HYHOO (Japan)"
+ C|hyhoo2 "Hayaoshi Taisen Quiz Hyhoo 2 (Japan)"
+ c|hyhoo2 "Taisen Quiz HYHOO 2 (Japan)"
+ C|hyperbbc "Hyper Bishi Bashi Champ (GQ876 VER. EAA)"
+ c|hyperbbc "Hyper Bishi Bashi Champ (GX908 1999/08/24 VER. JAA)"
+ C|hyperbbca "Hyper Bishi Bashi Champ (GQ876 VER. AAA)"
+ c|hyperbbck "Hyper Bishi Bashi Champ (GX908 1999/08/24 VER. KAA)"
+ c|j6cpal "Caesar's Palace (Whitbread / Crystal) (IMPACT, set 1)"
+ C|j6cpal "Caesars Palace (Whitbread / Crystal) (IMPACT, set 1)"
+ c|j6cpala "Caesar's Palace (Whitbread / Crystal) (IMPACT, set 2)"
+ C|j6cpala "Caesars Palace (Whitbread / Crystal) (IMPACT, set 2)"
+ c|j6cpalb "Caesar's Palace (Whitbread / Ace) (IMPACT)"
+ C|j6cpalb "Caesars Palace (Whitbread / Ace) (IMPACT)"
+ c|j6kapang "Kapang (Crystal) (IMPACT)"
+ C|j6kapang "Kapang! (Crystal) (IMPACT)"
+ c|jojo "JoJo's Venture (USA 990108)"
+ C|jojo "JoJo's Venture (USA 990128)"
+ c|jojoa "JoJo's Venture (USA 981202)"
+ c|jojoaj "JoJo no Kimyouna Bouken (Japan 981202)"
+ c|jojoan "JoJo's Venture (Asia 981202, NO CD)"
+ c|jojoba "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990913)"
+ C|jojoba "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990927)"
+ c|jojoban "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990913, NO CD)"
+ C|jojoban "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990927, NO CD)"
+ c|jojobane "JoJo's Bizarre Adventure (Euro 990913, NO CD)"
+ C|jojobane "JoJo's Bizarre Adventure (Euro 990927, NO CD)"
+ C|jojobaner1 "JoJo's Bizarre Adventure (Euro 990913, NO CD)"
+ C|jojobanr1 "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990913, NO CD)"
+ C|jojobar1 "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990913)"
+ c|jojoj "JoJo no Kimyouna Bouken (Japan 990108)"
+ C|jojoj "JoJo no Kimyouna Bouken (Japan 990128)"
+ C|jojojr1 "JoJo no Kimyouna Bouken (Japan 990108)"
+ C|jojojr2 "JoJo no Kimyouna Bouken (Japan 981202)"
+ c|jojon "JoJo's Venture (Asia 990108, NO CD)"
+ C|jojon "JoJo's Venture (Asia 990128, NO CD)"
+ C|jojonr1 "JoJo's Venture (Asia 990108, NO CD)"
+ C|jojonr2 "JoJo's Venture (Asia 981202, NO CD)"
+ C|jojor1 "JoJo's Venture (USA 990108)"
+ C|jojor2 "JoJo's Venture (USA 981202)"
+ C|jokpokera "Joker Poker (Version 16.03BI 5-10-85, Joker Poker ICB 9-30-86)"
+ c|jokpokera "Joker Poker (Version 16.03BI)"
+ C|kof99 "The King of Fighters '99 - Millennium Battle (NGM-2510)"
+ c|kof99 "The King of Fighters '99 - Millennium Battle (set 1)"
+ C|kof99h "The King of Fighters '99 - Millennium Battle (NGH-2510)"
+ c|kof99h "The King of Fighters '99 - Millennium Battle (set 2)"
+ c|kovlsjb "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN)"
+ C|kovlsjb "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN, set 1)"
+ c|kovlsjba "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (alt ver. 200CN)"
+ C|kovlsjba "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN, set 2)"
+ c|kovplus "Knights of Valour Plus / Sangoku Senki Plus (ver. 119)"
+ C|kovplus "Knights of Valour Plus / Sangoku Senki Plus (ver. 119, set 1)"
+ c|kovplusa "Knights of Valour Plus / Sangoku Senki Plus (alt ver. 119)"
+ C|kovplusa "Knights of Valour Plus / Sangoku Senki Plus (ver. 119, set 2)"
+ C|kungfur "Kung-Fu Roushi"
+ c|kungfur "Kung Fu Roushi"
+ C|kungfut "Kung-Fu Taikun (set 1)"
+ c|kungfut "Kung-Fu Taikun"
+ c|kungfuta "Kung-Fu Taikun (alt)"
+ C|kungfuta "Kung-Fu Taikun (set 2)"
+ c|lhzb2a "Mahjong Long Hu Zheng Ba 2 (set 2)"
+ C|lhzb2a "Mahjong Long Hu Zheng Ba 2 (VS221M)"
+ c|m1corocb "Coronation Street Club (Maygay) (M1A/B)"
+ C|m1corocb "Coronation Street Club (Maygay) v2.1 (M1A/B)"
+ C|m1corocb1 "Coronation Street Club (Maygay) v1.1 (M1A/B)"
+ C|m1corocb1p "Coronation Street Club (Maygay) v1.1 (Protocol)(M1A/B)"
+ C|m1corocbp "Coronation Street Club (Maygay) v2.1 (Protocol) (M1A/B)"
+ c|m1cororr "Coronation Street - Rovers Return (Maygay) (M1A/B)"
+ C|m1cororr "Coronation Street - Rovers Return (Maygay) (set 1) (M1A/B)"
+ C|m1cororra "Coronation Street - Rovers Return (Maygay) (set 1) (Alternate) (M1A/B)"
+ C|m1cororrb "Coronation Street - Rovers Return (Maygay) (set 2) (M1A/B)"
+ C|m1cororrb1 "Coronation Street - Rovers Return (Maygay) (set 2) (Alternate) (M1A/B)"
+ C|m1cororrbh "Coronation Street - Rovers Return (Maygay) (set 2) (Hack) (M1A/B)"
+ C|m1cororrbp "Coronation Street - Rovers Return (Maygay) (set 2) (Protocol) (M1A/B)"
+ C|m1cororrc "Coronation Street - Rovers Return (Maygay) (set 3) (M1A/B)"
+ C|m1cororrc1 "Coronation Street - Rovers Return (Maygay) (set 3) (Alternate 1) (M1A/B)"
+ C|m1cororrc2 "Coronation Street - Rovers Return (Maygay) (set 3) (Alternate 2) (M1A/B)"
+ C|m1cororrd "Coronation Street - Rovers Return (Maygay) (set 4) (M1A/B)"
+ C|m1cororrdp "Coronation Street - Rovers Return (Maygay) (set 4) (Protocol) (M1A/B)"
+ C|m1cororre "Coronation Street - Rovers Return (Maygay) (set 5) (M1A/B)"
+ C|m1cororrf "Coronation Street - Rovers Return (Maygay) (set 6) (BW) (M1A/B)"
+ C|m1cororrfp "Coronation Street - Rovers Return (Maygay) (set 6) (BW) (Protocol) (M1A/B)"
+ C|m1cororrg "Coronation Street - Rovers Return (Maygay) (set 7) (M1A/B)"
+ C|m1cororrgp "Coronation Street - Rovers Return (Maygay) (set 7) (Protocol) (M1A/B)"
+ C|m1cororrh "Coronation Street - Rovers Return (Maygay) (set 8) (M1A/B)"
+ C|m1cororri "Coronation Street - Rovers Return (Maygay) (set 9) (M1A/B)"
+ C|m1cororrip "Coronation Street - Rovers Return (Maygay) (set 9) (Protocol) (M1A/B)"
+ C|m1cororrj "Coronation Street - Rovers Return (Maygay) (set 10) (M1A/B)"
+ C|m1cororrjp "Coronation Street - Rovers Return (Maygay) (set 10) (Protocol) (M1A/B)"
+ C|m1cororrk "Coronation Street - Rovers Return (Maygay) (set 11) (M1A/B)"
+ C|m1cororrl "Coronation Street - Rovers Return (Maygay) (set 12) (M1A/B)"
+ C|m1cororrlp "Coronation Street - Rovers Return (Maygay) (set 12) (Protocol) (M1A/B)"
+ C|m1cororrp "Coronation Street - Rovers Return (Maygay) (set 1) (Protocol) (M1A/B)"
+ c|m1corosh "Coronation Street Showcase (Maygay) (M1A/B)"
+ C|m1corosh "Coronation Street Showcase (Maygay) v1.1 (M1A/B)"
+ C|m1coroshp "Coronation Street Showcase (Maygay) v1.1 (Protocol)(M1A/B)"
+ C|m1criss "Criss Cross Club (Maygay) (Dutch) (M1A/B)"
+ c|m1criss "Criss Cross Club (Maygay) (M1A/B)"
+ c|m1dkong "Donkey Kong (Maygay) (M1A/B)"
+ C|m1dkong "Donkey Kong (Maygay) v9.2 (M1A/B)"
+ C|m1dkong11 "Donkey Kong (Maygay) v1.1 (M1A/B)"
+ C|m1dkong11p "Donkey Kong (Maygay) v1.1 (M1A/B) (Protocol?)"
+ C|m1dkong21 "Donkey Kong (Maygay) v2.1 (Older) (M1A/B)"
+ C|m1dkong21n "Donkey Kong (Maygay) v2.1 (M1A/B)"
+ C|m1dkong21p "Donkey Kong (Maygay) v2.1 (Older) (Protocol) (M1A/B)"
+ C|m1dkong31 "Donkey Kong (Maygay) v3.1 (M1A/B)"
+ C|m1dkong31p "Donkey Kong (Maygay) v3.1 (Protocol) (M1A/B)"
+ C|m1dkong41 "Donkey Kong (Maygay) v4.1 (M1A/B)"
+ C|m1dkong41p "Donkey Kong (Maygay) v4.1 (Protocol) (M1A/B)"
+ C|m1dkong51 "Donkey Kong (Maygay) v5.1 (M1A/B)"
+ C|m1dkong51p "Donkey Kong (Maygay) v5.1 (Protocol) (M1A/B)"
+ C|m1dkong81 "Donkey Kong (Maygay) v8.1 (Older) (M1A/B)"
+ C|m1dkong81n "Donkey Kong (Maygay) v8.1 (M1A/B)"
+ C|m1dkong81na "Donkey Kong (Maygay) v8.1 (Alternate) (M1A/B)"
+ C|m1dkong81np "Donkey Kong (Maygay) v8.1 (Protocol) (M1A/B)"
+ C|m1dkong81p "Donkey Kong (Maygay) v8.1 (Older) (Protocol) (M1A/B)"
+ C|m1dkong91 "Donkey Kong (Maygay) v9.1 (Older) (M1A/B)"
+ C|m1dkong91a "Donkey Kong (Maygay) v9.1 (Older) (Alternate) (M1A/B)"
+ C|m1dkong91h1 "Donkey Kong (Maygay) v9.1 (Older) (Hack 1) (M1A/B)"
+ C|m1dkong91h2 "Donkey Kong (Maygay) v9.1 (Older) (Hack 2) (M1A/B)"
+ C|m1dkong91n "Donkey Kong (Maygay) v9.1 (M1A/B)"
+ C|m1dkong91na "Donkey Kong (Maygay) v9.1 (Alternate) (M1A/B)"
+ C|m1dkong91np "Donkey Kong (Maygay) v9.1 (Protocol) (M1A/B)"
+ C|m1dkong91p "Donkey Kong (Maygay) v9.1 (Older) (Protocol) (M1A/B)"
+ C|m1dkonga "Donkey Kong (Maygay) v9.2 (Alternate) (M1A/B)"
+ C|m1dkongp "Donkey Kong (Maygay) v9.2 (Protocol) (M1A/B)"
+ c|m1dm4ev "Diamonds Are Forever Club (Maygay) (M1A/B)"
+ C|m1dm4ev "Diamonds Are Forever Club (Maygay) v5.1 (M1A/B)"
+ C|m1dm4ev11 "Diamonds Are Forever Club (Maygay) v1.1 (M1A/B)"
+ C|m1dm4evp "Diamonds Are Forever Club (Maygay) v5.1 (Protocol) n(M1A/B)"
+ c|m1dxmono "Deluxe Monopoly (Maygay) (M1A/B)"
+ C|m1dxmono "Deluxe Monopoly (Maygay) v5.1 (M1A/B)"
+ C|m1dxmono11 "Deluxe Monopoly (Maygay) v1.1 (M1A/B)"
+ C|m1dxmono11m "Deluxe Monopoly (Maygay) v1.1 (Code M) (M1A/B)"
+ C|m1dxmono11mb "Deluxe Monopoly (Maygay) v1.1 (Code M, Alternate) (M1A/B)"
+ C|m1dxmono11o "Deluxe Monopoly (Maygay) v1.1 (Older) (M1A/B)"
+ C|m1dxmono11p "Deluxe Monopoly (Maygay) v1.1 (Protocol) (M1A/B)"
+ C|m1dxmono12 "Deluxe Monopoly (Maygay) v1.2 (M1A/B)"
+ C|m1dxmono12a "Deluxe Monopoly (Maygay) v1.2 (Alternate) (M1A/B)"
+ C|m1dxmono12n "Deluxe Monopoly (Maygay) v1.2 (Newer) (M1A/B)"
+ C|m1dxmono12p "Deluxe Monopoly (Maygay) v1.2 (Protocol) (M1A/B)"
+ C|m1dxmono21p "Deluxe Monopoly (Maygay) v2.1 (Protocol) (M1A/B)"
+ C|m1dxmono30h "Deluxe Monopoly (Maygay) v3.0 (Hack) (M1A/B)"
+ C|m1dxmono31b "Deluxe Monopoly (Maygay) v3.1 (BwB set) (M1A/B)"
+ C|m1dxmono31h "Deluxe Monopoly (Maygay) v3.1 (Hack) (M1A/B)"
+ C|m1dxmono31h2 "Deluxe Monopoly (Maygay) v3.1 (Alternate Hack) (M1A/B)"
+ C|m1dxmono31p "Deluxe Monopoly (Maygay) v3.1 (Protocol) (M1A/B)"
+ C|m1dxmono51 "Deluxe Monopoly (Maygay) v5.1 (Older) (M1A/B)"
+ C|m1dxmono51o "Deluxe Monopoly (Maygay) v5.1 (Older) (M1A/B) (alt?)"
+ C|m1dxmono51p "Deluxe Monopoly (Maygay) v5.1 (Older) (Protocol) (M1A/B)"
+ C|m1dxmonop "Deluxe Monopoly (Maygay) v5.1 (Protocol) (M1A/B)"
+ C|m1liveam "Living In America (Maygay) (Alternate 1) (M1A/B)"
+ c|m1liveam "Living In America (Maygay) (M1A/B)"
+ C|m1liveama "Living In America (Maygay) (Alternate 2)(M1A/B)"
+ C|m1liveamp "Living In America (Maygay) (Protocol) (M1A/B)"
+ c|m1luxor "Luxor Casino (Gemini) (M1A/B)"
+ C|m1luxor "Luxor Casino (Gemini) v4.0 (M1A/B)"
+ C|m1luxor21 "Luxor Casino (Gemini) v2.1 (M1A/B)"
+ C|m1luxor32 "Luxor Casino (Gemini) v3.2 (M1A/B)"
+ C|m1luxor33 "Luxor Casino (Gemini) v3.3 (M1A/B)"
+ C|m5addams "Addams Family (Barcrest) (MPU5) (v0.5, set 1)"
+ c|m5addams "Addams Family (Barcrest) (MPU5)"
+ C|m5addamsa "Addams Family (Barcrest) (MPU5) (v0.5, set 2)"
+ C|m5addamsb "Addams Family (Barcrest) (MPU5) (v0.5, set 3)"
+ C|m5addamsc "Addams Family (Barcrest) (MPU5) (v0.5, set 4)"
+ C|m5addamsd "Addams Family (Barcrest) (MPU5) (v0.5, set 5)"
+ C|m5addamse "Addams Family (Barcrest) (MPU5) (v0.5, set 6)"
+ C|m5addamsf "Addams Family (Barcrest) (MPU5) (v0.5, set 7)"
+ C|m5addamsg "Addams Family (Barcrest) (MPU5) (v0.5, set 8)"
+ C|m5addamsh "Addams Family (Barcrest) (MPU5) (v0.2, set 1)"
+ C|m5addamsi "Addams Family (Barcrest) (MPU5) (v0.2, set 2)"
+ C|m5addamsj "Addams Family (Barcrest) (MPU5) (v0.2, set 3)"
+ C|m5addamsk "Addams Family (Barcrest) (MPU5) (v0.3, set 1)"
+ C|m5addamsl "Addams Family (Barcrest) (MPU5) (v0.3, set 2)"
+ C|m5addamsm "Addams Family (Barcrest) (MPU5) (v0.3, set 3)"
+ C|m5addamsn "Addams Family (Barcrest) (MPU5) (v0.3, set 4)"
+ C|m5addamso "Addams Family (Barcrest) (MPU5) (v0.3, set 5)"
+ C|m5addamsp "Addams Family (Barcrest) (MPU5) (v0.3, set 6)"
+ C|m5addamsq "Addams Family (Barcrest) (MPU5) (v0.3, set 7)"
+ C|m5addamsr "Addams Family (Barcrest) (MPU5) (v0.3, set 8)"
+ C|m5addamss "Addams Family (Barcrest) (MPU5) (v0.3, set 9)"
+ c|m5addlad "Adders & Ladders (Barcrest) (MPU5, set 1)"
+ C|m5addlad "Adders & Ladders (Barcrest) (MPU5, v0.6, set 1)"
+ c|m5addlada "Adders & Ladders (Barcrest) (MPU5, set 2)"
+ C|m5addlada "Adders & Ladders (Barcrest) (MPU5, v0.6, set 2)"
+ c|m5addladb "Adders & Ladders (Barcrest) (MPU5, set 3)"
+ C|m5addladb "Adders & Ladders (Barcrest) (MPU5, v0.6, set 3)"
+ C|m5addladc "Adders & Ladders (Barcrest) (MPU5, v0.6, set 4)"
+ C|m5addladd "Adders & Ladders (Barcrest) (MPU5, v0.6, set 5)"
+ C|m5addlade "Adders & Ladders (Barcrest) (MPU5, v0.6, set 6)"
+ C|m5addladf "Adders & Ladders (Barcrest) (MPU5, v0.6, set 7)"
+ C|m5addladg "Adders & Ladders (Barcrest) (MPU5, v0.6, set 8)"
+ C|m5addladh "Adders & Ladders (Barcrest) (MPU5, v0.6, set 9)"
+ C|m5addladi "Adders & Ladders (Barcrest) (MPU5, v0.6, set 10)"
+ C|m5addladj "Adders & Ladders (Barcrest) (MPU5, v0.1, set 1)"
+ C|m5addladk "Adders & Ladders (Barcrest) (MPU5, v0.1, set 2)"
+ C|m5addladl "Adders & Ladders (Barcrest) (MPU5, v0.1, set 3)"
+ C|m5addladm "Adders & Ladders (Barcrest) (MPU5, v0.1, set 4)"
+ C|m5addladn "Adders & Ladders (Barcrest) (MPU5, v0.1, set 5)"
+ C|m5addlado "Adders & Ladders (Barcrest) (MPU5, v0.1, set 6)"
+ C|m5addladp "Adders & Ladders (Barcrest) (MPU5, v0.1, set 7)"
+ C|m5addladq "Adders & Ladders (Barcrest) (MPU5, v0.4, set 1)"
+ C|m5addladr "Adders & Ladders (Barcrest) (MPU5, v0.4, set 2)"
+ C|m5addlads "Adders & Ladders (Barcrest) (MPU5, v?.?)"
+ C|m5all41a "All 4 One (Vivid) (MPU5, set 2)"
+ C|m5all41b "All 4 One (Vivid) (MPU5, set 3)"
+ C|m5all41c "All 4 One (Vivid) (MPU5, set 4)"
+ C|m5all41d "All 4 One (Vivid) (MPU5, set 5)"
+ C|m5all41e "All 4 One (Vivid) (MPU5, set 6)"
+ C|m5all41f "All 4 One (Vivid) (MPU5, set 7)"
+ C|m5all41g "All 4 One (Vivid) (MPU5, set 8)"
+ C|m5all41h "All 4 One (Vivid) (MPU5, set 9)"
+ C|m5all41i "All 4 One (Vivid) (MPU5, set 10)"
+ C|m5all41j "All 4 One (Vivid) (MPU5, set 11)"
+ C|m5all41k "All 4 One (Vivid) (MPU5, set 12)"
+ c|m5all41l "All 4 One (Lowen) (MPU5)"
+ C|m5all41l "All 4 One (Vivid) (MPU5, set 13)"
+ C|m5all41low "All 4 One (Lowen) (MPU5)"
+ C|m5all41m "All 4 One (Vivid) (MPU5, set 14)"
+ c|m5all41v "All 4 One (Vivid) (MPU5, set 2)"
+ c|m5ashock "Aftershock (Barcrest - Red Gaming) (MPU5)"
+ C|m5ashock "Aftershock (Barcrest - Red Gaming) (MPU5, v1.2)"
+ C|m5ashocka "Aftershock (Barcrest - Red Gaming) (MPU5, v1.3)"
+ c|m5atlan "Atlantic (Vivid) (MPU5)"
+ C|m5atlan "Atlantic (Vivid) (MPU5, v1.4)"
+ C|m5atlana "Atlantic (Vivid) (MPU5, v1.2)"
+ c|m5cockdd "Cock A Doodle Dough (Empire) (MPU5)"
+ C|m5cockdd "Cock A Doodle Dough! (Empire) (MPU5)"
+ C|m5doshpk "Do$h 'n' Pecks (Barcrest) (MPU5)"
+ c|m5doshpk "Do$h & Pecks (Barcrest) (MPU5)"
+ C|m5fewmor "A Few Dollars More (Empire) (MPU5) (v0.2, set 1)"
+ c|m5fewmor "A Few Dollars More (Empire) (MPU5)"
+ C|m5fewmora "A Few Dollars More (Empire) (MPU5) (v0.2, set 2)"
+ C|m5fewmorb "A Few Dollars More (Empire) (MPU5) (v0.3, set 1)"
+ C|m5fewmorc "A Few Dollars More (Empire) (MPU5) (v0.3, set 2)"
+ c|m5fmonty "Full Monty (Empire) (MPU5)"
+ C|m5fmonty "The Full Monty (Empire) (MPU5)"
+ c|m5sixsht "6 Shooter (Vivid) (MPU5)"
+ C|m5sixsht "Six Shooter (Vivid) (MPU5) (v1.1, set 1)"
+ C|m5sixshta "Six Shooter (Vivid) (MPU5) (v1.1, set 2)"
+ c|m5sixshta "Six Shooter (Vivid) (MPU5)"
+ C|m5sixshtb "Six Shooter (Vivid) (MPU5) (v2.0, set 1)"
+ C|m5sixshtc "Six Shooter (Vivid) (MPU5) (v2.0, set 2)"
+ C|m5sixshtd "Six Shooter (Vivid) (MPU5) (v2.0, set 3)"
+ C|m5sixshte "Six Shooter (Vivid) (MPU5) (v2.0, set 4)"
+ C|m5sixshtf "Six Shooter (Vivid) (MPU5) (v2.0, set 5)"
+ C|m5sixshtg "Six Shooter (Vivid) (MPU5) (v2.0, set 6)"
+ C|m5sixshth "Six Shooter (Vivid) (MPU5) (v2.0, set 7)"
+ C|m5sixshti "Six Shooter (Vivid) (MPU5) (v2.1, set 1)"
+ C|m5sixshtj "Six Shooter (Vivid) (MPU5) (v2.1, set 2)"
+ C|m5sixshtk "Six Shooter (Vivid) (MPU5) (v2.1, set 3)"
+ C|m5sixshtl "Six Shooter (Vivid) (MPU5) (v2.1, set 4)"
+ C|m5sixshtm "Six Shooter (Vivid) (MPU5) (v2.1, set 5)"
+ C|m5sixshtn "Six Shooter (Vivid) (MPU5) (v2.1, set 6)"
+ C|mdrawpkr "Draw Poker - Joker's Wild (Standard)"
+ c|mdrawpkr "Draw Poker Joker's Wild (Standard)"
+ C|mdrawpkra "Draw Poker - Joker's Wild (02-11)"
+ c|mdrawpkra "Draw Poker Joker's Wild (02-11)"
+ C|mirax "Mirax (set 1)"
+ c|mirax "Mirax"
+ c|mkyawdim "Mortal Kombat (Yawdim bootleg)"
+ C|mkyawdim "Mortal Kombat (Yawdim bootleg, set 1)"
+ C|mkyawdim2 "Mortal Kombat (Yawdim bootleg, set 2)"
+ C|mkyturboe "Mortal Kombat (Turbo 3.0 08/31/92, hack)"
+ c|mladyhtr "Mahjong THE LADY HUNTER (Japan 900509)"
+ C|mladyhtr "Mahjong The Lady Hunter (Japan 900509)"
+ c|mmatrixd "Mars Matrix: Hyper Solid Shooting (Japan 000412 Phoenix Edition) (bootleg)"
+ C|mmatrixd "Mars Matrix: Hyper Solid Shooting (USA 000412 Phoenix Edition) (bootleg)"
+ c|moomesa "Wild West C.O.W.-Boys of Moo Mesa (ver EA)"
+ C|moomesa "Wild West C.O.W.-Boys of Moo Mesa (ver EAB)"
+ c|moomesaa "Wild West C.O.W.-Boys of Moo Mesa (ver AA)"
+ C|moomesaaab "Wild West C.O.W.-Boys of Moo Mesa (ver AAB)"
+ c|moomesabl "Wild West C.O.W.-Boys of Moo Mesa (bootleg ver AA)"
+ C|moomesabl "Wild West C.O.W.-Boys of Moo Mesa (bootleg)"
+ c|moomesau "Wild West C.O.W.-Boys of Moo Mesa (ver UA, set 1)"
+ c|moomesaua "Wild West C.O.W.-Boys of Moo Mesa (ver UA, set 2)"
+ C|moomesauab "Wild West C.O.W.-Boys of Moo Mesa (ver UAB)"
+ C|moomesauac "Wild West C.O.W.-Boys of Moo Mesa (ver UAC)"
+ C|motrshow "Motor Show (set 1)"
+ c|motrshow "Motor Show"
+ c|motrshowa "Motor Show (alternate set)"
+ C|motrshowa "Motor Show (set 2)"
+ C|mshuttle "Moon Shuttle (US? set 1)"
+ c|mshuttle "Moon Shuttle (US?)"
+ C|mshuttlej "Moon Shuttle (Japan set 1)"
+ c|mshuttlej "Moon Shuttle (Japan)"
+ C|mslug2 "Metal Slug 2 - Super Vehicle-001/II (NGM-2410)(NGH-2410)"
+ c|mslug2 "Metal Slug 2 - Super Vehicle-001/II"
+ C|mslugx "Metal Slug X - Super Vehicle-001 (NGM-2500)(NGH-2500)"
+ c|mslugx "Metal Slug X - Super Vehicle-001"
+ C|mspacii "Ms. Pac-Man II (Orca bootleg set 1)"
+ C|mspacii2 "Ms. Pac-Man II (Orca bootleg set 2)"
+ c|nzerotea "New Zero Team"
+ C|nzeroteam "New Zero Team"
+ c|olds100 "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 100)"
+ C|olds100 "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 100, set 1)"
+ c|olds100a "Oriental Legend Special / Xi You Shi E Zhuan Super (alt ver. 100)"
+ C|olds100a "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 100, set 2)"
+ C|prosport "Pro Sports - Bowling, Tennis, and Golf (set 1)"
+ c|prosport "Pro Sports - Bowling, Tennis, and Golf"
+ c|prosporta "Pro Sports - Bowling, Tennis, and Golf (alternate)"
+ C|prosporta "Pro Sports - Bowling, Tennis, and Golf (set 2)"
+ c|pzloop2j "Puzz Loop 2 (Japan 010205)"
+ C|pzloop2j "Puzz Loop 2 (Japan 010226)"
+ C|pzloop2jr1 "Puzz Loop 2 (Japan 010205)"
+ C|quasar "Quasar (set 1)"
+ c|quasar "Quasar"
+ c|quasara "Quasar (Alternate)"
+ C|quasara "Quasar (set 2)"
+ C|rastan "Rastan (World Rev 1)"
+ c|rastan "Rastan (World)"
+ C|rastana "Rastan (World)"
+ C|rastanu "Rastan (US Rev 1)"
+ c|rastanu "Rastan (US, set 1)"
+ c|rastanu2 "Rastan (US, set 2)"
+ C|rastanua "Rastan (US)"
+ C|rastanub "Rastan (US, Earlier code base)"
+ C|rastsaga "Rastan Saga (Japan Rev 1)"
+ c|rastsaga "Rastan Saga (Japan)"
+ c|rastsaga1 "Rastan Saga (Japan Rev 1)"
+ C|rastsagaa "Rastan Saga (Japan)"
+ C|rdft2j "Raiden Fighters 2 (Japan set 1, SPI)"
+ c|rdft2j "Raiden Fighters 2 (Japan, SPI)"
+ c|redeartha "Red Earth (Euro 961023)"
+ C|redearthr1 "Red Earth (Euro 961023)"
+ C|redfoxwp2 "Red Fox War Planes II (China)"
+ c|samsh5sph "Samurai Shodown V Special / Samurai Spirits Zero Special (NGH-2720) (1st release, censored)"
+ C|samsh5sph "Samurai Shodown V Special / Samurai Spirits Zero Special (NGH-2720) (2nd release, less censored)"
+ C|samsh5spho "Samurai Shodown V Special / Samurai Spirits Zero Special (NGH-2720) (1st release, censored)"
+ c|samsh5spn "Samurai Shodown V Special / Samurai Spirits Zero Special (NGH-2720) (2nd release, less censored)"
+ c|sc1barcd "Barcode (Bellfruit) (Scorpion 1)"
+ C|sc1barcd "Barcode (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1barcda "Barcode (Bellfruit) (set 2) (Scorpion 1)"
+ c|sc1btclk "Beat The Clock (Mdm) (Scorpion 2/3)"
+ C|sc1btclk "Beat The Clock (Mdm) (set 1) (Scorpion 2/3?)"
+ C|sc1btclka "Beat The Clock (Mdm) (set 2) (Scorpion 2/3?)"
+ C|sc1btclkb "Beat The Clock (Mdm) (set 3) (Scorpion 2/3?)"
+ c|sc1ccroc "Crazy Crocs (Mdm) (Scorpion 2/3)"
+ C|sc1ccroc "Crazy Crocs (Mdm) (set 1) (Scorpion 2/3?)"
+ C|sc1ccroca "Crazy Crocs (Mdm) (set 2) (Scorpion 2/3?)"
+ C|sc1ccrocb "Crazy Crocs (Mdm) (set 3) (Scorpion 2/3?)"
+ C|sc1ccrocc "Crazy Crocs (Mdm) (set 4) (Scorpion 2/3?)"
+ c|sc1cdm "Club Diamond (Crystal) (Scorpion 1)"
+ C|sc1cdm "Club Diamond (Crystal) (set 1) (Scorpion 1)"
+ C|sc1cdmp "Club Diamond (Crystal) (set 1, Protocol) (Scorpion 1)"
+ C|sc1cexpd "Cash Explosion (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1cexpd "Cash Explosion (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1cexpl "Cash Explosion (Bellfruit) (Scorpion 1)"
+ C|sc1cexpl "Cash Explosion (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1cexpla "Cash Explosion (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1cexplb "Cash Explosion (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1cexplc "Cash Explosion (Bellfruit) (set 4) (Scorpion 1)"
+ C|sc1cexpld "Cash Explosion (Bellfruit) (set 5) (Scorpion 1)"
+ c|sc1chain "Chain Reaction (Bellfruit) (Scorpion 1)"
+ C|sc1chain "Chain Reaction (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1chaina "Chain Reaction (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1chainp "Chain Reaction (Bellfruit) (set 1, Protocol) (Scorpion 1)"
+ c|sc1china "China Town Club (Bellfruit) (Scorpion 1)"
+ C|sc1china "China Town Club (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1chinaa "China Town Club (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1chinaap "China Town Club (Bellfruit) (set 2, Protocol) (Scorpion 1)"
+ C|sc1chinab "China Town Club (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1chinabp "China Town Club (Bellfruit) (set 3, Protocol) (Scorpion 1)"
+ C|sc1chinap "China Town Club (Bellfruit) (set 1, Protocol) (Scorpion 1)"
+ C|sc1cl2k1 "Club 2001 (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1cl2k1 "Club 2001 (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1cl65 "Club 65 Special (Bellfruit) (Scorpion 1)"
+ C|sc1cl65 "Club 65 Special (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1cl65a "Club 65 Special (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1cl65ap "Club 65 Special (Bellfruit) (set 2, Protocol) (Scorpion 1)"
+ C|sc1cl65b "Club 65 Special (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1cl65bp "Club 65 Special (Bellfruit) (set 3, Protocol) (Scorpion 1)"
+ C|sc1cl65c "Club 65 Special (Bellfruit) (set 4) (Scorpion 1)"
+ C|sc1cl65d "Club 65 Special (Bellfruit) (set 5) (Scorpion 1)"
+ C|sc1cl65dp "Club 65 Special (Bellfruit) (set 5, Protocol) (Scorpion 1)"
+ C|sc1class "Classic (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1class "Classic (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1clbtm "Club Temptation (Bellfruit) (Scorpion 1)"
+ C|sc1clbtm "Club Temptation (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1clbtma "Club Temptation (Bellfruit) (set 2) (Scorpion 1)"
+ c|sc1clbw "Club Wise (Bellfruit) (Scorpion 1)"
+ C|sc1clbw "Club Wise (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1clbwa "Club Wise (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1clbwb "Club Wise (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1copdd "Cops 'n' Robbers Deluxe (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1copdd "Cops 'n' Robbers Deluxe (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1count "Count Cash Club (Bellfruit) (Scorpion 1)"
+ C|sc1count "Count Cash Club (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1counta "Count Cash Club (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1countap "Count Cash Club (Bellfruit) (set 2, Protocol) (Scorpion 1)"
+ C|sc1countb "Count Cash Club (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1countp "Count Cash Club (Bellfruit) (set 1, Protocol) (Scorpion 1)"
+ c|sc1crocr "Croc And Roll (Mdm) (Scorpion 2/3)"
+ C|sc1crocr "Croc And Roll (Mdm) (Scorpion 2/3?)"
+ C|sc1cscl "Cash Classic (Global) (set 1)"
+ c|sc1cscl "Cash Classic (Global)"
+ C|sc1cscla "Cash Classic (Global) (set 2)"
+ C|sc1csclb "Cash Classic (Maygay/Global?) (set 3)"
+ C|sc1csclc "Cash Classic (Maygay/Global?) (set 4)"
+ c|sc1cshat "Cash Attraction (Bellfruit) (Scorpion 1)"
+ C|sc1cshat "Cash Attraction (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1cshata "Cash Attraction (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1cshatb "Cash Attraction (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1cshatc "Cash Attraction (Bellfruit) (set 4) (Scorpion 1)"
+ c|sc1cshcda "Cash Card (Bellfruit) (Scorpion 1, set 1)"
+ C|sc1cshcda "Cash Card (Bellfruit) (set 1) (Scorpion 1)"
+ c|sc1cshcdb "Cash Card (Bellfruit) (Scorpion 1, set 2)"
+ C|sc1cshcdb "Cash Card (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1cshin "Cashino (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1cshin "Cashino (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1cshwz "Cash Wise (Bellfruit) (Scorpion 1)"
+ C|sc1cshwz "Cash Wise (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1cshwza "Cash Wise (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1cshwzb "Cash Wise (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1cshwzc "Cash Wise (Bellfruit) (set 4) (Scorpion 1)"
+ C|sc1dago "Dagobert's Vault (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1dago "Dagobert's Vault (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1days "All In A Days Work (Global) (set 1)"
+ c|sc1days "All In A Days Work (Global)"
+ C|sc1daysa "All In A Days Work (Global) (set 2)"
+ c|sc1dblch "Double Chance (Bellfruit) (Scorpion 1)"
+ C|sc1dblch "Double Chance (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1dblcha "Double Chance (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1disc "Discovey (Bellfruit) (Dutch) (set 1) (Scorpion 1)"
+ c|sc1disc "Discovey (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1disca "Discovey (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1driv "Driving School (Global) (set 1)"
+ c|sc1driv "Driving School (Global)"
+ C|sc1driva "Driving School (Global) (set 2)"
+ C|sc1drivb "Driving School (Global) (set 3)"
+ C|sc1drivc "Driving School (Global) (set 4)"
+ C|sc1flash "Flash (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1flash "Flash (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1frpus "Fruit Pursuit (Bellfruit) (Scorpion 1?)"
+ C|sc1frpus "Fruit Pursuit (Bellfruit) (set 1) (Scorpion 1?)"
+ C|sc1frpusa "Fruit Pursuit (Bellfruit) (set 2) (Scorpion 1?)"
+ c|sc1frtln "Fruit Lines (Bellfruit) (Scorpion 1, set 2)"
+ C|sc1frtln "Fruit Lines (Bellfruit) (set 2) (Scorpion 1)"
+ c|sc1fruit "Fruit Lines (Bellfruit) (Scorpion 1, set 1)"
+ C|sc1fruit "Fruit Lines (Bellfruit) (set 1) (Scorpion 1)"
+ c|sc1funh "Fun House Club (Bellfruit) (Scorpion 1)"
+ C|sc1funh "Fun House Club (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1funha "Fun House Club (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1funhb "Fun House Club (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1funhp "Fun House Club (Bellfruit) (set 1, Protocol) (Scorpion 1)"
+ C|sc1gprix "Grand Prix (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1gprix "Grand Prix (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1gslam "Grand Slam (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1gslam "Grand Slam (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1hfcc "Hi Flyer Club (Crystal) (Scorpion 1)"
+ C|sc1hfcc "Hi Flyer Club (Crystal) (set 1) (Scorpion 1)"
+ C|sc1hfccp "Hi Flyer Club (Crystal) (set 1, Protocol) (Scorpion 1)"
+ C|sc1impc "Impact (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1impc "Impact (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1kings "Kings Club (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1kings "Kings Club (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1linx "Linx (Bellfruit) (Scorpion 1)"
+ C|sc1linx "Linx (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1linxa "Linx (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1linxp "Linx (Bellfruit) (set 3, Protocol) (Scorpion 1)"
+ C|sc1lotus "Lotus SE (Dutch) (set 1)"
+ c|sc1lotus "Lotus SE (Dutch)"
+ C|sc1lotusa "Lotus SE (Dutch) (set 2)"
+ C|sc1magc "Magic Circle (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1magc "Magic Circle (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1manha "Manhattan (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1manha "Manhattan (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1mist "Mistral (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1mist "Mistral (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1olym "Olympia (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1olym "Olympia (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1orac "Oracle (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1orac "Oracle (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1pwrl "Power Lines (Bellfruit) (Scorpion 1)"
+ C|sc1pwrl "Power Lines (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1pwrla "Power Lines (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1quat "Quatro (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1quat "Quatro (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1rain "Rainbow (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1rain "Rainbow (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1re "Reel Cash (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1re "Reel Cash (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1rese "Reel Cash SE (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1rese "Reel Cash SE (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1revo "Revolution (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1revo "Revolution (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1rose "Rose 'n' Crown (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1rose "Rose 'n' Crown (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1sant "Santana (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1sant "Santana (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1sat "Satellite (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1sat "Satellite (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1shan "Shanghai (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1shan "Shanghai (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1sir "Strike It Rich (Bellfruit) (Scorpion 1)"
+ C|sc1sir "Strike It Rich (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1sira "Strike It Rich (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1sirb "Strike It Rich (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1sirc "Strike It Rich (Bellfruit) (set 4) (Scorpion 1)"
+ c|sc1smoke "Smokey Vs The Bandit (Mdm) (Scorpion 2/3)"
+ C|sc1smoke "Smokey Vs The Bandit (Mdm) (set 1) (Scorpion 2/3?)"
+ C|sc1smokea "Smokey Vs The Bandit (Mdm) (set 2) (Scorpion 2/3?)"
+ c|sc1spct "Spectre (Bellfruit) (Scorpion 1)"
+ C|sc1spct "Spectre (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1spcta "Spectre (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1ster "Sterling (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1ster "Sterling (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1str4 "Strike 4 (Bellfruit) (Scorpion 1, set 1)"
+ C|sc1str4 "Strike 4 (Bellfruit) (set 1) (Scorpion 1)"
+ c|sc1str4a "Strike 4 (Bellfruit) (Scorpion 1, set 2)"
+ C|sc1str4a "Strike 4 (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1sups "Superstar (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1sups "Superstar (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1torn "Tornado (Bellfruit) (Dutch) (set 1) (Scorpion 1)"
+ c|sc1torn "Tornado (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1torna "Tornado (Bellfruit) (Dutch) (set 2) (Scorpion 1)"
+ c|sc1tri "Tri Star (Bellfruit) (Scorpion 1)"
+ C|sc1tri "Tri Star (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1tria "Tri Star (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1triap "Tri Star (Bellfruit) (set 2, Protocol) (Scorpion 1)"
+ C|sc1trib "Tri Star (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1tribp "Tri Star (Bellfruit) (set 3, Protocol) (Scorpion 1)"
+ c|sc1typ "Typhoon Club (Bellfruit) (Scorpion 1)"
+ C|sc1typ "Typhoon Club (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1typp "Typhoon Club (Bellfruit) (set 1, Protocol) (Scorpion 1)"
+ C|sc1vent "Ventura (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1vent "Ventura (Bellfruit) [Dutch] (Scorpion 1)"
+ C|sc1vict "Victory (Bellfruit) (Dutch) (Scorpion 1)"
+ c|sc1vict "Victory (Bellfruit) [Dutch] (Scorpion 1)"
+ c|sc1voy "Voyager (Bellfruit) (Scorpion 1, set 1)"
+ C|sc1voy "Voyager (Bellfruit) (set 1) (Scorpion 1)"
+ c|sc1voya "Voyager (Bellfruit) (Scorpion 1, set 2)"
+ C|sc1voya "Voyager (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1winfl "Winfalls (Dutch) (Bellfruit) (Scorpion 1)"
+ c|sc1winfl "Winfalls [Dutch] (Bellfruit) (Scorpion 1)"
+ c|sc1winst "Winning Streak (Bellfruit) (Scorpion 1)"
+ C|sc1winst "Winning Streak (Bellfruit) (set 1) (Scorpion 1)"
+ C|sc1winsta "Winning Streak (Bellfruit) (set 2) (Scorpion 1)"
+ C|sc1winstb "Winning Streak (Bellfruit) (set 3) (Scorpion 1)"
+ C|sc1winstbp "Winning Streak (Bellfruit) (set 3, Protocol) (Scorpion 1)"
+ C|sc1winstc "Winning Streak (Bellfruit) (set 4) (Scorpion 1)"
+ C|sc1winstcp "Winning Streak (Bellfruit) (set 4, Protocol) (Scorpion 1)"
+ C|sc1winstd "Winning Streak (Bellfruit) (set 5) (Scorpion 1)"
+ C|sc1winstdp "Winning Streak (Bellfruit) (set 5, Protocol) (Scorpion 1)"
+ C|sc1winste "Winning Streak (Bellfruit) (set 6) (Scorpion 1)"
+ C|sc1winstep "Winning Streak (Bellfruit) (set 6, Protocol) (Scorpion 1)"
+ C|sc1winstf "Winning Streak (Bellfruit) (set 7) (Scorpion 1)"
+ C|sc1winstfp "Winning Streak (Bellfruit) (set 7, Protocol) (Scorpion 1)"
+ C|sc1winstg "Winning Streak (Bellfruit) (set 8) (Scorpion 1)"
+ C|sc1winstp "Winning Streak (Bellfruit) (set 1, Protocol) (Scorpion 1)"
+ C|sc2brkfs1 "The Big Breakfast (set 2 UK, Single Site) (Scorpion 2/3)"
+ c|sc2brkfs1 "The Big Breakfast (set 2) (Scorpion 2/3)"
+ C|sc2brkfs1p "The Big Breakfast (set 2 UK, Single Site, Protocol) (Scorpion 2/3)"
+ C|sc2brkfs2 "The Big Breakfast (set 3 UK, Arcade, 8GBP Jackpot) (Scorpion 2/3)"
+ c|sc2brkfs2 "The Big Breakfast (set 3) (Scorpion 2/3)"
+ C|sc2brkfs3 "The Big Breakfast (set 4 UK, Arcade, 8GBP Jackpot) (Scorpion 2/3)"
+ c|sc2brkfs3 "The Big Breakfast (set 4) (Scorpion 2/3)"
+ C|sc2brkfs3p "The Big Breakfast (set 4 UK, Arcade, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2brkfs4 "The Big Breakfast (set 5 UK, Arcade, 10GBP Jackpot) (Scorpion 2/3)"
+ c|sc2brkfs4 "The Big Breakfast (set 5) (Scorpion 2/3)"
+ C|sc2brkfs4p "The Big Breakfast (set 5 UK, Arcade, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2brkfs5 "The Big Breakfast (set 6 UK, Arcade, 10GBP Jackpot) (Scorpion 2/3)"
+ c|sc2brkfs5 "The Big Breakfast (set 6) (Scorpion 2/3)"
+ C|sc2brkfs5p "The Big Breakfast (set 6 UK, Arcade, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2brkfsm "The Big Breakfast Casino (Scorpion 2/3)"
+ C|sc2brkfsm "The Big Breakfast Casino (set 1) (Scorpion 2/3)"
+ C|sc2brkfsm1 "The Big Breakfast Casino (set 2) (Scorpion 2/3)"
+ C|sc2brkfsm2 "The Big Breakfast Casino (set 3) (Scorpion 2/3)"
+ C|sc2brkfsp "The Big Breakfast (set 1, Protocol) (Scorpion 2/3)"
+ c|sc2call "It's Your Call (Global) (Scorpion 2/3)"
+ C|sc2call "It's Your Call (Global) (v2.7) (Scorpion 2/3)"
+ C|sc2callc "It's Your Call (Club?) (Global) (v1.6) (Scorpion 2/3)"
+ C|sc2callcp "It's Your Call (Club?) (Global) (v1.6 Protocol) (Scorpion 2/3)"
+ C|sc2callp "It's Your Call (Global) (v2.7 Protocol) (Scorpion 2/3)"
+ c|sc2casr "Casino Royale (Bellfruit) (Scorpion 2/3)"
+ C|sc2casr "Casino Royale (Bellfruit) (set 1, UK, 10GBP Jackpot, 3rd Triennial) (Scorpion 2/3)"
+ C|sc2casr1 "Casino Royale (Bellfruit) (set 2, UK, 3rd Triennial) (Scorpion 2/3)"
+ C|sc2casr1p "Casino Royale (Bellfruit) (set 2, UK, 3rd Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2casr2 "Casino Royale (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2casr2p "Casino Royale (Bellfruit) (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2casr3 "Casino Royale (Bellfruit) (set 4, UK, 8GBP Jackpot) (Scorpion 2/3)"
+ C|sc2casr3p "Casino Royale (Bellfruit) (set 4, UK, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2casr4 "Casino Royale (Bellfruit) (set 5, UK) (Scorpion 2/3)"
+ C|sc2casr4p "Casino Royale (Bellfruit) (set 5, UK, Protocol) (Scorpion 2/3)"
+ C|sc2casrp "Casino Royale (Bellfruit) (set 1, UK, 10GBP Jackpot, 3rd Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2catms1 "Cat & Mouse (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2catms1p "Cat & Mouse (Bellfruit) (set 2, Protocol) (Scorpion 2/3)"
+ C|sc2catms2 "Cat & Mouse (Bellfruit) (set 3) (Scorpion 2/3)"
+ C|sc2catms2p "Cat & Mouse (Bellfruit) (set 3, Protocol) (Scorpion 2/3)"
+ C|sc2catms3 "Cat & Mouse (Bellfruit) (set 4) (Scorpion 2/3)"
+ C|sc2catms4 "Cat & Mouse (Bellfruit) (set 5) (Scorpion 2/3)"
+ c|sc2cb7 "Casino Bar 7 (Bellfruit) (Scorpion 2/3)"
+ C|sc2cb7 "Casino Bar 7 (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2cb71 "Casino Bar 7 (Bellfruit) (set 2, UK, All Cash) (Scorpion 2/3)"
+ C|sc2cb72 "Casino Bar 7 (Bellfruit) (set 3, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2cb72p "Casino Bar 7 (Bellfruit) (set 3, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2cb7p "Casino Bar 7 (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2cgcas "Club Grand Casino (Bellfruit) (Scorpion 2/3)"
+ C|sc2cgcas "Club Grand Casino (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2cgcas1 "Club Grand Casino (Bellfruit) (set 2, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2cgcas1p "Club Grand Casino (Bellfruit) (set 2, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2cgcasp "Club Grand Casino (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2cmbt "Cat & Mouse & Bonzo Too (Bellfruit) (Scorpion 2/3)"
+ C|sc2cmbt "Cat & Mouse & Bonzo Too (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2cmbtp "Cat & Mouse & Bonzo Too (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2cnile "Cash On The Nile Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2cnile "Cash On The Nile Club (Bellfruit) (set 1 UK, 150GBP Jackpot) (Scorpion 2/3)"
+ C|sc2cnile1 "Cash On The Nile Club (Bellfruit) (set 2 UK, 150GBP Jackpot) (Scorpion 2/3)"
+ C|sc2cnile2 "Cash On The Nile Club (Bellfruit) (set 2 UK, 200GBP Jackpot) (Scorpion 2/3)"
+ C|sc2cnile2p "Cash On The Nile Club (Bellfruit) (set 2 UK, 150GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2cnile3p "Cash On The Nile Club (Bellfruit) (set 3 UK, 150GBP Jackpot) (Scorpion 2/3)"
+ c|sc2copcl "Cops 'n' Robbers Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2copcl "Cops 'n' Robbers Club (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2copcl1 "Cops 'n' Robbers Club (Bellfruit) (set 2, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2copcl10 "Cops 'n' Robbers Club (Bellfruit) (set 11, UK) (Scorpion 2/3)"
+ C|sc2copcl11 "Cops 'n' Robbers Club (Bellfruit) (set 12, UK) (Scorpion 2/3)"
+ C|sc2copcl11p "Cops 'n' Robbers Club (Bellfruit) (set 12, UK, Protocol) (Scorpion 2/3)"
+ C|sc2copcl1p "Cops 'n' Robbers Club (Bellfruit) (set 2, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2copcl2 "Cops 'n' Robbers Club (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2copcl3 "Cops 'n' Robbers Club (Bellfruit) (set 4, UK) (Scorpion 2/3)"
+ C|sc2copcl3p "Cops 'n' Robbers Club (Bellfruit) (set 4, UK, Protocol) (Scorpion 2/3)"
+ C|sc2copcl4 "Cops 'n' Robbers Club (Bellfruit) (set 5, UK) (Scorpion 2/3)"
+ C|sc2copcl5 "Cops 'n' Robbers Club (Bellfruit) (set 6, UK) (Scorpion 2/3)"
+ C|sc2copcl6 "Cops 'n' Robbers Club (Bellfruit) (set 7, UK) (Scorpion 2/3)"
+ C|sc2copcl6p "Cops 'n' Robbers Club (Bellfruit) (set 7, UK, Protocol) (Scorpion 2/3)"
+ C|sc2copcl7 "Cops 'n' Robbers Club (Bellfruit) (set 8, UK) (Scorpion 2/3)"
+ C|sc2copcl8 "Cops 'n' Robbers Club (Bellfruit) (set 9, UK) (Scorpion 2/3)"
+ C|sc2copcl8p "Cops 'n' Robbers Club (Bellfruit) (set 9, UK, Protocol) (Scorpion 2/3)"
+ C|sc2copcl9 "Cops 'n' Robbers Club (Bellfruit) (set 10, UK) (Scorpion 2/3)"
+ C|sc2copcl9p "Cops 'n' Robbers Club (Bellfruit) (set 10, UK, Protocol) (Scorpion 2/3)"
+ C|sc2copclp "Cops 'n' Robbers Club (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2copdc "Cops 'n' Robbers Club Deluxe (Bellfruit) (Scorpion 2/3)"
+ C|sc2copdc "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2copdc1 "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 2, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2copdc1p "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 2, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2copdc2 "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 3, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2copdc2p "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 3, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2copdc3 "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 4, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2copdc3p "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 4, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2copdc4 "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 5, UK, 200GBP Jackpot?) (Scorpion 2/3)"
+ C|sc2copdc4p "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 5, UK, 200GBP Jackpot?, Protocol) (Scorpion 2/3)"
+ C|sc2copdc5 "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 6, UK, 200GBP Jackpot) (Scorpion 2/3)"
+ C|sc2copdc5p "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 6, UK, 200GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2copdc6 "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 7, UK) (Scorpion 2/3)"
+ C|sc2copdcp "Cops 'n' Robbers Club Deluxe (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2cops "Cops 'n' Robbers (Bellfruit) (Scorpion 2/3)"
+ C|sc2cops "Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)"
+ C|sc2cops1 "Cops 'n' Robbers (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2cops1p "Cops 'n' Robbers (Bellfruit) (set 2, Protocol) (Scorpion 2/3)"
+ C|sc2cops2 "Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)"
+ C|sc2cops3 "Cops 'n' Robbers (Bellfruit) (set 4) (Scorpion 2/3)"
+ C|sc2cops3p "Cops 'n' Robbers (Bellfruit) (set 4, Protocol) (Scorpion 2/3)"
+ C|sc2cops4 "Cops 'n' Robbers (Bellfruit) (set 5) (Scorpion 2/3)"
+ C|sc2cops5 "Cops 'n' Robbers (Bellfruit) (set 6) (Scorpion 2/3)"
+ C|sc2copsc "Casino Cops 'n' Robbers (Bellfruit) (set 1) (Scorpion 2/3)"
+ C|sc2copsc1 "Casino Cops 'n' Robbers (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2copsc1p "Casino Cops 'n' Robbers (Bellfruit) (set 2, Protocol) (Scorpion 2/3)"
+ C|sc2copsc2 "Casino Cops 'n' Robbers (Bellfruit) (set 3) (Scorpion 2/3)"
+ C|sc2copscp "Casino Cops 'n' Robbers (Bellfruit) (set 1, Protocol) (Scorpion 2/3)"
+ C|sc2copsp "Cops 'n' Robbers (Bellfruit) (set 1, Protocol) (Scorpion 2/3)"
+ C|sc2cpe1 "Club Public Enemy No.1 (set 3, UK) (Scorpion 2/3)"
+ C|sc2cpe1p "Club Public Enemy No.1 (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2cpe2 "Club Public Enemy No.1 (set 4, UK) (Scorpion 2/3)"
+ C|sc2cpe2p "Club Public Enemy No.1 (set 4, UK, Protocol) (Scorpion 2/3)"
+ C|sc2cpe3p "Club Public Enemy No.1 (set 5, UK, Protocol) (Scorpion 2/3)"
+ C|sc2cpe4 "Club Public Enemy No.1 (set 6, UK) (Scorpion 2/3)"
+ C|sc2cpe5p "Club Public Enemy No.1 (set 7, UK, Protocol) (Scorpion 2/3)"
+ C|sc2cpep "Club Public Enemy No.1 (set 2, UK, Protocol) (Scorpion 2/3)"
+ c|sc2cpg "Pharaoh's Gold Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2cpg "Pharaoh's Gold Club (Bellfruit) (set 1, UK, 250GBP Jackpot)(Scorpion 2/3)"
+ C|sc2cpg1 "Pharaoh's Gold Club (Bellfruit) (set 2, UK, p65)(Scorpion 2/3)"
+ C|sc2cpg1p "Pharaoh's Gold Club (Bellfruit) (set 2, UK, p65, Protocol)(Scorpion 2/3)"
+ C|sc2cpg2 "Pharaoh's Gold Club (Bellfruit) (set 3, UK)(Scorpion 2/3)"
+ C|sc2cpg2p "Pharaoh's Gold Club (Bellfruit) (set 3, UK, Protocol)(Scorpion 2/3)"
+ C|sc2cpgp "Pharaoh's Gold Club (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol)(Scorpion 2/3)"
+ c|sc2cshcl "Cashino Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2cshcl "Cashino Club (Bellfruit) (set 1) (Scorpion 2/3)"
+ C|sc2cshcl1 "Cashino Club (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2cshcl1p "Cashino Club (Bellfruit) (set 2, Protocol) (Scorpion 2/3)"
+ C|sc2cshclp "Cashino Club (Bellfruit) (set 1, Protocol) (Scorpion 2/3)"
+ C|sc2ctms2 "Cat & Mouse (Mark 2) (Bellfruit) (set 1) (Scorpion 2/3)"
+ C|sc2ctms21 "Cat & Mouse (Mark 2) (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2ctms21p "Cat & Mouse (Mark 2) (Bellfruit) (set 2, Protocol) (Scorpion 2/3)"
+ C|sc2ctms22 "Cat & Mouse (Mark 2) (Bellfruit) (set 3) (Scorpion 2/3)"
+ C|sc2ctms22p "Cat & Mouse (Mark 2) (Bellfruit) (set 3, Protocol) (Scorpion 2/3)"
+ C|sc2ctms23 "Cat & Mouse (Mark 2) (Bellfruit) (set 4) (Scorpion 2/3)"
+ C|sc2ctms23p "Cat & Mouse (Mark 2) (Bellfruit) (set 4, Protocol) (Scorpion 2/3)"
+ C|sc2ctms24p "Cat & Mouse (Mark 2) (Bellfruit) (set 5, Protocol) (Scorpion 2/3)"
+ C|sc2ctms25 "Cat & Mouse (Mark 2) (Bellfruit) (set 6) (Scorpion 2/3)"
+ c|sc2cvega "Cash Vegas (Bellfruit) (Scorpion 2/3)"
+ C|sc2cvega "Cash Vegas (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2cvega1 "Cash Vegas (Bellfruit) (set 2, UK, 10GBP Jackpot, 3rd Triennial) (Scorpion 2/3)"
+ C|sc2cvega1p "Cash Vegas (Bellfruit) (set 2, UK, 10GBP Jackpot, 3rd Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2cvega2 "Cash Vegas (Bellfruit) (set 3, UK, 8GBP Jackpot) (Scorpion 2/3)"
+ C|sc2cvega2p "Cash Vegas (Bellfruit) (set 3, UK, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2cvega3 "Cash Vegas (Bellfruit) (set 4, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2cvega3p "Cash Vegas (Bellfruit) (set 4, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2cvega4p "Cash Vegas (Bellfruit) (set 5, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2dbl "Double Diamond (Bellfruit) (Scorpion 2/3)"
+ C|sc2dbl "Double Diamond (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2dbl1 "Double Diamond (Bellfruit) (set 2, UK) (Scorpion 2/3)"
+ C|sc2dbl1p "Double Diamond (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)"
+ C|sc2dblp "Double Diamond (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2dels "Del's Millions (Bellfruit) (Scorpion 2/3)"
+ C|sc2dels "Del's Millions (Bellfruit) (set 1, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2dels1 "Del's Millions (Bellfruit) (set 2, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2dels1p "Del's Millions (Bellfruit) (set 2, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2dels2 "Del's Millions (Bellfruit) (set 3, UK, 8GBP Jackpot) (Scorpion 2/3)"
+ C|sc2dels2p "Del's Millions (Bellfruit) (set 3, UK, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2dels3 "Del's Millions (Bellfruit) (set 4, UK, 8GBP Jackpot) (Scorpion 2/3)"
+ C|sc2dels3p "Del's Millions (Bellfruit) (set 4, UK, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2dels4 "Del's Millions (Bellfruit) (set 5, UK) (Scorpion 2/3)"
+ C|sc2dels4p "Del's Millions (Bellfruit) (set 5, UK, Protocol) (Scorpion 2/3)"
+ C|sc2dels5 "Del's Millions (Bellfruit) (set 6, UK) (Scorpion 2/3)"
+ C|sc2dels6 "Del's Millions (Bellfruit) (set 7, UK) (Scorpion 2/3)"
+ C|sc2dels7 "Del's Millions (Bellfruit) (set 8, UK) (Scorpion 2/3)"
+ C|sc2dels8 "Del's Millions (Bellfruit) (set 9, UK) (Scorpion 2/3)"
+ C|sc2dels9 "Del's Millions (Bellfruit) (set 10, UK) (Scorpion 2/3)"
+ C|sc2delsd "Del's Millions (Bellfruit) ('Deluxe', UK) (Scorpion 2/3)"
+ C|sc2delsm "Del's Millions (Bellfruit/Mazooma) (set 1, UK) (Scorpion 2/3)"
+ C|sc2delsm1 "Del's Millions (Bellfruit/Mazooma) (set 2, UK) (Scorpion 2/3)"
+ C|sc2delsm1p "Del's Millions (Bellfruit/Mazooma) (set 2, UK, Protocol) (Scorpion 2/3)"
+ C|sc2delsm2 "Del's Millions (Bellfruit/Mazooma) (set 3, UK) (Scorpion 2/3)"
+ C|sc2delsm2p "Del's Millions (Bellfruit/Mazooma) (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2delsm3 "Del's Millions (Bellfruit/Mazooma) (set 4, UK) (Scorpion 2/3)"
+ C|sc2delsm3p "Del's Millions (Bellfruit/Mazooma) (set 4, UK, Protocol) (Scorpion 2/3)"
+ C|sc2delsmp "Del's Millions (Bellfruit/Mazooma) (set 1, UK, Protocol) (Scorpion 2/3)"
+ C|sc2delsp "Del's Millions (Bellfruit) (set 1, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2dick "Spotted Dick (Global) (Scorpion 2/3)"
+ C|sc2dick "Spotted Dick (Global) (v3.1) (Scorpion 2/3)"
+ C|sc2dick1 "Spotted Dick (Global) (v2.2) (Scorpion 2/3)"
+ C|sc2dick2 "Spotted Dick (Global) (v1.5) (Scorpion 2/3)"
+ C|sc2dick2e "Spotted Dick (Global) (v?.? Euro) (Scorpion 2/3)"
+ C|sc2dick2eu "Spotted Dick (Global) (v?.? Euro unencrypted) (Scorpion 2/3)"
+ C|sc2dick2p "Spotted Dick (Global) (v1.5 Protocol ) (Scorpion 2/3)"
+ C|sc2dickp "Spotted Dick (Global) (v3.1 Protocol) (Scorpion 2/3)"
+ c|sc2downt "Down Town (Bellfruit) (Scorpion 2/3)"
+ C|sc2downt "Down Town (Bellfruit) (set 1, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2downt1 "Down Town (Bellfruit) (set 2, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2downt1p "Down Town (Bellfruit) (set 2, UK, 15RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2downt2 "Down Town (Bellfruit) (set 3, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2downt2p "Down Town (Bellfruit) (set 3, UK, 15RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2downt3 "Down Town (Bellfruit) (set 4, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2downt3a "Down Town (Bellfruit) (set 4, UK, 16RM motor) (Scorpion 2/3)"
+ C|sc2downt3ap "Down Town (Bellfruit) (set 4, UK, 16RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2downt3p "Down Town (Bellfruit) (set 4, UK, 15RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2downt4 "Down Town (Bellfruit) (set 5, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2downt4a "Down Town (Bellfruit) (set 5, UK, 16RM motor) (Scorpion 2/3)"
+ C|sc2downt4ap "Down Town (Bellfruit) (set 5, UK, 16RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2downt4p "Down Town (Bellfruit) (set 5, UK, 15RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2downt5 "Down Town (Bellfruit) (set 6, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2downt6 "Down Town (Bellfruit) (set 7, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2downt7 "Down Town (Bellfruit) (set 8, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2downt8a "Down Town (Bellfruit) (set 9, UK, 16RM motor) (Scorpion 2/3)"
+ C|sc2downt8ap "Down Town (Bellfruit) (set 9, UK, 16RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2downtp "Down Town (Bellfruit) (set 1, UK, 15RM motor, Protocol) (Scorpion 2/3)"
+ c|sc2drwho "Dr.Who The Timelord (set 1, UK, Game Card 95-750-288) (Scorpion 2/3)"
+ C|sc2drwho "Dr.Who The Timelord (set 1, UK, Single Site, Game Card 95-750-288) (Scorpion 2/3)"
+ c|sc2drwho10 "Dr.Who The Timelord (set 11) (Scorpion 2/3)"
+ C|sc2drwho10 "Dr.Who The Timelord (set 11, UK, Arcade, Protocol) (Scorpion 2/3)"
+ c|sc2drwho11 "Dr.Who The Timelord (set 12) (Scorpion 2/3)"
+ C|sc2drwho11 "Dr.Who The Timelord (set 12, UK, no Jackpot spin, Protocol) (Scorpion 2/3)"
+ c|sc2drwho12 "Dr.Who The Timelord (set 13) (Scorpion 2/3)"
+ C|sc2drwho12 "Dr.Who The Timelord (set 13, UK) (Scorpion 2/3)"
+ c|sc2drwho13 "Dr.Who The Timelord (set 14) (Scorpion 2/3)"
+ C|sc2drwho13 "Dr.Who The Timelord (set 14, UK, Arcade, 8GBP Jackpot) (Scorpion 2/3)"
+ c|sc2drwho14 "Dr.Who The Timelord (set 15) (Scorpion 2/3)"
+ C|sc2drwho14 "Dr.Who The Timelord (set 15, UK, Arcade) (Scorpion 2/3)"
+ c|sc2drwho15 "Dr.Who The Timelord (set 16) (Scorpion 2/3)"
+ C|sc2drwho15 "Dr.Who The Timelord (set 16, UK, Arcade) (Scorpion 2/3)"
+ c|sc2drwho2 "Dr.Who The Timelord (set 3) (Scorpion 2/3)"
+ C|sc2drwho2 "Dr.Who The Timelord (set 3, UK, Arcade, Protocol) (Scorpion 2/3)"
+ c|sc2drwho3 "Dr.Who The Timelord (set 4) (Scorpion 2/3)"
+ C|sc2drwho3 "Dr.Who The Timelord (set 4, UK Single Site, Protocol) (Scorpion 2/3)"
+ c|sc2drwho4 "Dr.Who The Timelord (set 5) (Scorpion 2/3)"
+ C|sc2drwho4 "Dr.Who The Timelord (set 5, UK, Arcade) (Scorpion 2/3)"
+ c|sc2drwho5 "Dr.Who The Timelord (set 6) (Scorpion 2/3)"
+ C|sc2drwho5 "Dr.Who The Timelord (set 6, UK) (Scorpion 2/3)"
+ c|sc2drwho6 "Dr.Who The Timelord (set 7) (Scorpion 2/3)"
+ C|sc2drwho6 "Dr.Who The Timelord (set 7, UK, Protocol) (Scorpion 2/3)"
+ c|sc2drwho7 "Dr.Who The Timelord (set 8) (Scorpion 2/3)"
+ C|sc2drwho7 "Dr.Who The Timelord (set 8, UK, Arcade, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2drwho8 "Dr.Who The Timelord (set 9) (Scorpion 2/3)"
+ C|sc2drwho8 "Dr.Who The Timelord (set 9, UK, Arcade, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2drwho9 "Dr.Who The Timelord (set 10) (Scorpion 2/3)"
+ C|sc2drwho9 "Dr.Who The Timelord (set 10, UK, Arcade, Protocol) (Scorpion 2/3)"
+ c|sc2easy "Easy Money (Bellfruit) (Scorpion 2/3)"
+ C|sc2easy "Easy Money (Bellfruit) (set 1) (Scorpion 2/3)"
+ C|sc2easy1 "Easy Money (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2easy1p "Easy Money (Bellfruit) (set 2, Protocol) (Scorpion 2/3)"
+ C|sc2easy2 "Easy Money (Bellfruit) (set 3) (Scorpion 2/3)"
+ C|sc2easy2p "Easy Money (Bellfruit) (set 3, Protocol) (Scorpion 2/3)"
+ C|sc2easyp "Easy Money (Bellfruit) (set 1, Protocol) (Scorpion 2/3)"
+ c|sc2eggs "Eggs On Legs Tour (Bellfruit) (Scorpion 2/3)"
+ C|sc2eggs "Eggs On Legs Tour (Bellfruit) (set 1, UK, Arcade, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2eggs1 "Eggs On Legs Tour (Bellfruit) (set 2, UK, Arcade, 10GBP Jackpot?) (Scorpion 2/3)"
+ C|sc2eggs1p "Eggs On Legs Tour (Bellfruit) (set 2, UK, Arcade, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2eggsp "Eggs On Legs Tour (Bellfruit) (set 1, UK, Arcade, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2flaca "Flash Cash (Bellfruit) (Scorpion 2/3)"
+ C|sc2flaca "Flash Cash (Bellfruit) (set 1, UK, 10GBP Jackpot, 3rd Triennial) (Scorpion 2/3)"
+ C|sc2flaca1 "Flash Cash (Bellfruit) (set 2, UK, 10GBP Jackpot, 2nd Triennial) (Scorpion 2/3)"
+ C|sc2flaca1p "Flash Cash (Bellfruit) (set 2, UK, 10GBP Jackpot, 2nd Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2flaca2 "Flash Cash (Bellfruit) (set 3, UK, 10GBP Jackpot, 2nd Triennial) (Scorpion 2/3)"
+ C|sc2flaca2p "Flash Cash (Bellfruit) (set 3, UK, 10GBP Jackpot, 2nd Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2flacap "Flash Cash (Bellfruit) (set 1, UK, 10GBP Jackpot, 3rd Triennial, Protocol) (Scorpion 2/3)"
+ c|sc2foot "Football Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2foot "Football Club (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2foot1 "Football Club (Bellfruit) (set 2, UK, 100GBP Jackpot) (Scorpion 2/3)"
+ C|sc2foot1p "Football Club (Bellfruit) (set 2, UK, 100GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2foot2 "Football Club (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2foot2p "Football Club (Bellfruit) (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2footp "Football Club (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2gcclb "Golden Casino Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2gcclb "Golden Casino Club (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2gcclb1 "Golden Casino Club (Bellfruit) (set 2, UK, 100GBP Jackpot) (Scorpion 2/3)"
+ C|sc2gcclb1p "Golden Casino Club (Bellfruit) (set 2, UK, 100GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2gcclb2 "Golden Casino Club (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2gcclb2p "Golden Casino Club (Bellfruit) (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2gcclb3 "Golden Casino Club (Bellfruit) (set 4, UK) (Scorpion 2/3)"
+ C|sc2gcclbp "Golden Casino Club (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2goldr "Gold Reserve (Mdm) (Scorpion 2/3)"
+ C|sc2goldr "Gold Reserve (Mdm) (v1.3) (Scorpion 2/3)"
+ C|sc2goldr1 "Gold Reserve (Mdm) (set 2) (Scorpion 2/3)"
+ C|sc2goldrp "Gold Reserve (Mdm) (v1.3 Protocol) (Scorpion 2/3)"
+ c|sc2groul "Golden Roulette (Bellfruit) (Scorpion 2/3)"
+ C|sc2groul "Golden Roulette (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2groulp "Golden Roulette (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)"
+ c|sc2gsclb "The Game Show Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2gsclb "The Game Show Club (Bellfruit) (set 1, UK, Arcade, p65)(Scorpion 2/3)"
+ C|sc2gsclb1 "The Game Show Club (Bellfruit) (set 2, UK, Arcade, 250GBP Jackpot, p65)(Scorpion 2/3)"
+ C|sc2gsclb1p "The Game Show Club (Bellfruit) (set 2, UK, Arcade, 250GBP Jackpot, p65, Protocol)(Scorpion 2/3)"
+ C|sc2gsclb2 "The Game Show Club (Bellfruit) (set 3, UK, Arcade)(Scorpion 2/3)"
+ C|sc2gsclb2p "The Game Show Club (Bellfruit) (set 3, UK, Arcade, Protocol)(Scorpion 2/3)"
+ C|sc2gsclb3 "The Game Show Club (Bellfruit) (set 4, UK, Arcade)(Scorpion 2/3)"
+ C|sc2gsclb3p "The Game Show Club (Bellfruit) (set 4, UK, Arcade, Protocol)(Scorpion 2/3)"
+ C|sc2gsclb4 "The Game Show Club (Bellfruit) (set 5, UK, Arcade)(Scorpion 2/3)"
+ C|sc2gsclb4p "The Game Show Club (Bellfruit) (set 5, UK, Arcade, Protocol)(Scorpion 2/3)"
+ C|sc2gsclb5 "The Game Show Club (Bellfruit) (set 6, UK)(Scorpion 2/3)"
+ C|sc2gsclb6 "The Game Show Club (Bellfruit) (set 7, UK)(Scorpion 2/3)"
+ C|sc2gsclb7p "The Game Show Club (Bellfruit) (set 8, UK, Protocol)(Scorpion 2/3)"
+ C|sc2gsclbp "The Game Show Club (Bellfruit) (set 1, UK, Arcade, p65, Protocol)(Scorpion 2/3)"
+ c|sc2gslam "Grandslam Club (UK, Game Card 95-750-843) (Scorpion 2/3)"
+ C|sc2gslam "Grandslam Club (UK, set 1, Game Card 95-750-843) (Scorpion 2/3)"
+ C|sc2gslam1 "Grandslam Club (UK, set 2) (Scorpion 2/3)"
+ C|sc2gslam1p "Grandslam Club (UK, set 2, Arcade, Protocol) (Scorpion 2/3)"
+ C|sc2gslam2 "Grandslam Club (UK, set 3) (Scorpion 2/3)"
+ C|sc2gslamp "Grandslam Club (UK, set 1, Protocol) (Scorpion 2/3)"
+ c|sc2heypr "Hey Presto (Bellfruit) (Scorpion 2/3)"
+ C|sc2heypr "Hey Presto (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2heyprp "Hey Presto (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2hifly "High Flyer (Mdm) (Scorpion 2/3)"
+ C|sc2hifly "High Flyer (Mdm) (v4.1) (Scorpion 2/3)"
+ C|sc2hifly2 "High Flyer (Mdm) (v3.1) (Scorpion 2/3)"
+ C|sc2hifly3 "High Flyer (Mdm) (v2.1) (Scorpion 2/3)"
+ C|sc2hifly4 "High Flyer (Mdm) (v?.?) (Scorpion 2/3)"
+ c|sc2hypr "Hyperactive (Bellfruit) (Scorpion 2/3)"
+ C|sc2hypr "Hyperactive (Bellfruit) (set 1, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2hypr1 "Hyperactive (Bellfruit) (set 2, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2hypr1p "Hyperactive (Bellfruit) (set 2, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2hyprp "Hyperactive (Bellfruit) (set 1, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2inst "Instant Jackpot (Bellfruit) (Scorpion 2/3)"
+ C|sc2inst "Instant Jackpot (Bellfruit) (set 1, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2inst1 "Instant Jackpot (Bellfruit) (set 2, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2inst1p "Instant Jackpot (Bellfruit) (set 2, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2inst2 "Instant Jackpot (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2inst2p "Instant Jackpot (Bellfruit) (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2inst3 "Instant Jackpot (Bellfruit) (set 4, UK, 8GBP Jackpot) (Scorpion 2/3)"
+ C|sc2inst3p "Instant Jackpot (Bellfruit) (set 4, UK, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2inst4 "Instant Jackpot (Bellfruit) (set 5, UK) (Scorpion 2/3)"
+ C|sc2inst4p "Instant Jackpot (Bellfruit) (set 5, UK, Protocol) (Scorpion 2/3)"
+ C|sc2inst5 "Instant Jackpot (Bellfruit) (set 6, UK) (Scorpion 2/3)"
+ C|sc2inst6 "Instant Jackpot (Bellfruit) (set 7, UK) (Scorpion 2/3)"
+ C|sc2instp "Instant Jackpot (Bellfruit) (set 1, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2kcclb "King Cash Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2kcclb "King Cash Club (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2kcclb1 "King Cash Club (Bellfruit) (set 2, UK) (Scorpion 2/3)"
+ C|sc2kcclb1p "King Cash Club (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)"
+ C|sc2kcclbp "King Cash Club (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2mam "Make A Million (Bellfruit) (Scorpion 2/3)"
+ C|sc2mam "Make A Million (Bellfruit) (set 1, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2mam1 "Make A Million (Bellfruit) (set 2, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2mam1p "Make A Million (Bellfruit) (set 2, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2mam2 "Make A Million (Bellfruit) (set 3, UK, 8GBP Jackpot) (Scorpion 2/3)"
+ C|sc2mam2p "Make A Million (Bellfruit) (set 3, UK, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2mam3 "Make A Million (Bellfruit) (set 4, UK) (Scorpion 2/3)"
+ C|sc2mam3p "Make A Million (Bellfruit) (set 4, UK, Protocol) (Scorpion 2/3)"
+ C|sc2mam4 "Make A Million (Bellfruit) (set 5, UK) (Scorpion 2/3)"
+ C|sc2mam4p "Make A Million (Bellfruit) (set 5, UK, Protocol) (Scorpion 2/3)"
+ C|sc2mam5 "Make A Million (Bellfruit) (set 6, UK) (Scorpion 2/3)"
+ c|sc2mamcl "Make A Million Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2mamcl "Make A Million Club (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2mamcl1 "Make A Million Club (Bellfruit) (set 2, UK) (Scorpion 2/3)"
+ C|sc2mamcl1p "Make A Million Club (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)"
+ C|sc2mamcl2 "Make A Million Club (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2mamcl2p "Make A Million Club (Bellfruit) (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2mamcl3 "Make A Million Club (Bellfruit) (set 4, UK) (Scorpion 2/3)"
+ C|sc2mamclp "Make A Million Club (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2mamp "Make A Million (Bellfruit) (set 1, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2motd "Match Of The Day (Bellfruit) (Scorpion 2/3)"
+ C|sc2motd "Match Of The Day (Bellfruit) (set 1, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2motd1 "Match Of The Day (Bellfruit) (set 2, UK, 10GBP Jackpot, 1st Triennial) (Scorpion 2/3)"
+ C|sc2motd10p "Match Of The Day (Bellfruit) (set 11, UK, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2motd1p "Match Of The Day (Bellfruit) (set 2, UK, 10GBP Jackpot, 1st Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2motd2 "Match Of The Day (Bellfruit) (set 3, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2motd2p "Match Of The Day (Bellfruit) (set 3, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2motd3 "Match Of The Day (Bellfruit) (set 4, UK) (Scorpion 2/3)"
+ C|sc2motd3p "Match Of The Day (Bellfruit) (set 4, UK, Protocol) (Scorpion 2/3)"
+ C|sc2motd4 "Match Of The Day (Bellfruit) (set 5, UK, Arcade) (Scorpion 2/3)"
+ C|sc2motd4p "Match Of The Day (Bellfruit) (set 5, UK, Arcade, Protocol) (Scorpion 2/3)"
+ C|sc2motd5 "Match Of The Day (Bellfruit) (set 6, UK, Single Site) (Scorpion 2/3)"
+ C|sc2motd5p "Match Of The Day (Bellfruit) (set 6, UK, Single Site, Protocol) (Scorpion 2/3)"
+ C|sc2motd6 "Match Of The Day (Bellfruit) (set 7, UK, 8GBP Jackpot) (Scorpion 2/3)"
+ C|sc2motd6p "Match Of The Day (Bellfruit) (set 7, UK, 8GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2motd7 "Match Of The Day (Bellfruit) (set 8, UK) (Scorpion 2/3)"
+ C|sc2motd7p "Match Of The Day (Bellfruit) (set 8, UK, Protocol) (Scorpion 2/3)"
+ C|sc2motd8 "Match Of The Day (Bellfruit) (set 9, UK) (Scorpion 2/3)"
+ C|sc2motd8p "Match Of The Day (Bellfruit) (set 9, UK, Protocol) (Scorpion 2/3)"
+ C|sc2motd9 "Match Of The Day (Bellfruit) (set 10, UK, 6GBP Jackpot) (Scorpion 2/3)"
+ C|sc2motdp "Match Of The Day (Bellfruit) (set 1, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2ofool "Only Fools & Horses (Bellfruit) (Scorpion 2/3)"
+ C|sc2ofool "Only Fools & Horses (Bellfruit) (set 1) (Scorpion 2/3)"
+ C|sc2ofool1 "Only Fools & Horses (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2ofool2 "Only Fools & Horses (Bellfruit) (set 3) (Scorpion 2/3)"
+ C|sc2ofool3 "Only Fools & Horses (Bellfruit) (set 4) (Scorpion 2/3)"
+ C|sc2ofool4 "Only Fools & Horses (Bellfruit) (set 5) (Scorpion 2/3)"
+ c|sc2olgld "Olympic Gold (Bellfruit) (Scorpion 2/3)"
+ C|sc2olgld "Olympic Gold (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2olgld1 "Olympic Gold (Bellfruit) (set 2, UK, 10GBP Jackpot) (Scorpion 2/3)"
+ C|sc2olgld1p "Olympic Gold (Bellfruit) (set 2, UK, 10GBP Jackpot, Protocol) (Scorpion 2/3)"
+ C|sc2olgldp "Olympic Gold (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2pick "Pick Of The Bunch (Global) (Scorpion 2/3)"
+ C|sc2pick "Pick Of The Bunch (Global) (v2.3) (Scorpion 2/3)"
+ C|sc2pickc "Pick Of The Bunch (Club?) (Global) (v1.9) (Scorpion 2/3)"
+ C|sc2pickcp "Pick Of The Bunch (Club?) (Global) (v1.9 Protocol) (Scorpion 2/3)"
+ C|sc2pickp "Pick Of The Bunch (Global) (v2.3 Protocol) (Scorpion 2/3)"
+ c|sc2prem "Premier Club Manager (Bellfruit) (Scorpion 2/3)"
+ C|sc2prem "Premier Club Manager (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2prem1 "Premier Club Manager (Bellfruit) (set 2, UK) (Scorpion 2/3)"
+ C|sc2prem1p "Premier Club Manager (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)"
+ C|sc2prem2 "Premier Club Manager (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2premp "Premier Club Manager (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc2ptytm "Party Time (Bellfruit) (Scorpion 2/3)"
+ C|sc2ptytm "Party Time (Bellfruit) (set 1) (Scorpion 2/3)"
+ C|sc2ptytm1 "Party Time (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2ptytm1p "Party Time (Bellfruit) (set 2, Protocol) (Scorpion 2/3)"
+ c|sc2relgm "Reel Gems (Bellfruit) (Scorpion 2/3)"
+ C|sc2relgm "Reel Gems (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2relgm1p "Reel Gems (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)"
+ C|sc2relgmp "Reel Gems (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2rock "How Big's Your Rock (Global) (Scorpion 2/3)"
+ C|sc2rock "How Big's Your Rock? (Global) (v1.5) (Scorpion 2/3)"
+ C|sc2rock1 "How Big's Your Rock? (Global) (v1.4) (Scorpion 2/3)"
+ C|sc2rock1p "How Big's Your Rock? (Global) (v1.4 Protocol) (Scorpion 2/3)"
+ C|sc2rocke "How Big's Your Rock? (Global) (v?.? Euro) (Scorpion 2/3)"
+ C|sc2rockp "How Big's Your Rock? (Global) (v1.5 Protocol) (Scorpion 2/3)"
+ c|sc2scc "Safe Cracker Club (Mdm) (Scorpion 2/3)"
+ C|sc2scc "Safe Cracker Club (Mdm) (v4.4) (Scorpion 2/3)"
+ c|sc2showt "Showtime Spectacular (Bellfruit) (Scorpion 2/3)"
+ C|sc2showt "Showtime Spectacular (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2showt1 "Showtime Spectacular (Bellfruit) (set 2, UK) (Scorpion 2/3)"
+ C|sc2showt1p "Showtime Spectacular (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)"
+ C|sc2showt2 "Showtime Spectacular (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2showt2p "Showtime Spectacular (Bellfruit) (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2showt3 "Showtime Spectacular (Bellfruit) (set 4, UK) (Scorpion 2/3)"
+ C|sc2showt3p "Showtime Spectacular (Bellfruit) (set 4, UK, Protocol) (Scorpion 2/3)"
+ C|sc2showt4 "Showtime Spectacular (Bellfruit) (set 5, UK) (Scorpion 2/3)"
+ C|sc2showt4p "Showtime Spectacular (Bellfruit) (set 5, UK, Protocol) (Scorpion 2/3)"
+ C|sc2showtp "Showtime Spectacular (Bellfruit) (set 1, UK, Protocol) (Scorpion 2/3)"
+ c|sc2sstar "Superstar (Bellfruit) (Scorpion 2/3)"
+ C|sc2sstar "Superstar (Bellfruit) (set 1, UK, 3rd Triennial) (Scorpion 2/3)"
+ C|sc2sstar1 "Superstar (Bellfruit) (set 2, UK, 2nd Triennial) (Scorpion 2/3)"
+ C|sc2sstar1p "Superstar (Bellfruit) (set 2, UK, 2nd Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2sstar2 "Superstar (Bellfruit) (set 3, UK, 2nd Triennial) (Scorpion 2/3)"
+ C|sc2sstar2p "Superstar (Bellfruit) (set 3, UK, 2nd Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2sstar3 "Superstar (Bellfruit) (set 4, UK, 2nd Triennial) (Scorpion 2/3)"
+ C|sc2sstar3p "Superstar (Bellfruit) (set 4, UK, 2nd Triennial, Protocol) (Scorpion 2/3)"
+ C|sc2sstar4 "Superstar (Bellfruit) (set 5, UK) (Scorpion 2/3)"
+ C|sc2sstarp "Superstar (Bellfruit) (set 1, UK, 3rd Triennial, Protocol) (Scorpion 2/3)"
+ c|sc2suprz "Surprise Surprize (Bellfruit) (Scorpion 2/3)"
+ C|sc2suprz "Surprise Surprize (Bellfruit) (set 1, UK) (Scorpion 2/3)"
+ C|sc2suprz1 "Surprise Surprize (Bellfruit) (set 2, UK) (Scorpion 2/3)"
+ C|sc2suprz1p "Surprise Surprize (Bellfruit) (set 2, UK, Protocol)(Scorpion 2/3)"
+ C|sc2suprz2 "Surprise Surprize (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2suprz2p "Surprise Surprize (Bellfruit) (set 3, UK, Protocol)(Scorpion 2/3)"
+ C|sc2suprz3 "Surprise Surprize (Bellfruit) (set 4, UK) (Scorpion 2/3)"
+ C|sc2suprzp "Surprise Surprize (Bellfruit) (set 1, UK, Protocol)(Scorpion 2/3)"
+ c|sc2topwk "Top Wack (Bellfruit) (Scorpion 2/3)"
+ C|sc2topwk "Top Wack (Bellfruit) (set 1, UK, 10GBP Jackpot, 1st Triennial) (Scorpion 2/3)"
+ C|sc2topwkp "Top Wack (Bellfruit) (set 1, UK, 10GBP Jackpot, 1st Triennial, Protocol) (Scorpion 2/3)"
+ c|sc2town "Round The Town (Bellfruit) (Scorpion 2/3)"
+ C|sc2town "Round The Town (Bellfruit) (set 1) (Scorpion 2/3)"
+ C|sc2town1 "Round The Town (Bellfruit) (set 2) (Scorpion 2/3)"
+ C|sc2town1p "Round The Town (Bellfruit) (set 2, Protocol) (Scorpion 2/3)"
+ C|sc2town2 "Round The Town (Bellfruit) (set 3) (Scorpion 2/3)"
+ C|sc2town3 "Round The Town (Bellfruit) (set 4) (Scorpion 2/3)"
+ C|sc2town3p "Round The Town (Bellfruit) (set 4, Protocol) (Scorpion 2/3)"
+ C|sc2town4 "Round The Town (Bellfruit) (set 5) (Scorpion 2/3)"
+ C|sc2town5 "Round The Town (Bellfruit) (set 6) (Scorpion 2/3)"
+ C|sc2townp "Round The Town (Bellfruit) (set 1, Protocol) (Scorpion 2/3)"
+ c|sc2wembl "Road To Wembley (Bellfruit) (Scorpion 2/3)"
+ C|sc2wembl "Road To Wembley (Bellfruit) (set 1, UK, 10GBP Jackpot, 15RM motor) (Scorpion 2/3)"
+ C|sc2wembl1 "Road To Wembley (Bellfruit) (set 2, UK, 15RM motor) (Scorpion 2/3)"
+ C|sc2wembl10 "Road To Wembley (Bellfruit) (set 11, UK) (Scorpion 2/3)"
+ C|sc2wembl1p "Road To Wembley (Bellfruit) (set 2, UK, 15RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2wembl2 "Road To Wembley (Bellfruit) (set 3, UK) (Scorpion 2/3)"
+ C|sc2wembl2p "Road To Wembley (Bellfruit) (set 3, UK, Protocol) (Scorpion 2/3)"
+ C|sc2wembl3 "Road To Wembley (Bellfruit) (set 4, UK) (Scorpion 2/3)"
+ C|sc2wembl4p "Road To Wembley (Bellfruit) (set 5, UK, Protocol) (Scorpion 2/3)"
+ C|sc2wembl5a "Road To Wembley (Bellfruit) (set 6, UK, 16RM motor) (Scorpion 2/3)"
+ C|sc2wembl5ap "Road To Wembley (Bellfruit) (set 6, UK, 16RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2wembl6ap "Road To Wembley (Bellfruit) (set 7, UK, 16RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2wembl7a "Road To Wembley (Bellfruit) (set 8, UK, 8GBP Jackpot, 16RM motor) (Scorpion 2/3)"
+ C|sc2wembl7ap "Road To Wembley (Bellfruit) (set 8, UK, 8GBP Jackpot, 16RM motor, Protocol) (Scorpion 2/3)"
+ C|sc2wembl8 "Road To Wembley (Bellfruit) (set 9, UK) (Scorpion 2/3)"
+ C|sc2wembl9 "Road To Wembley (Bellfruit) (set 10, UK) (Scorpion 2/3)"
+ C|sc2wemblp "Road To Wembley (Bellfruit) (set 1, UK, 10GBP Jackpot, 15RM motor, Protocol) (Scorpion 2/3)"
+ c|sc2wwcl "Wild West Club (Bellfruit) (Scorpion 2/3)"
+ C|sc2wwcl "Wild West Club (Bellfruit) (set 1, UK, 250GBP Jackpot) (Scorpion 2/3)"
+ C|sc2wwcl1 "Wild West Club (Bellfruit) (set 2, UK) (Scorpion 2/3)"
+ C|sc2wwcl1p "Wild West Club (Bellfruit) (set 2, UK, Protocol) (Scorpion 2/3)"
+ C|sc2wwclp "Wild West Club (Bellfruit) (set 1, UK, 250GBP Jackpot, Protocol) (Scorpion 2/3)"
+ c|sc4cblas "Cash Blast (Bellfruit) (Scorpion 4)"
+ C|sc4cblas "Cash Blast (Voodoo Games) (Scorpion 4) (set 1)"
+ C|sc4cblasa "Cash Blast (Voodoo Games) (Scorpion 4) (set 2)"
+ C|sc4cfcas "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 1)"
+ c|sc4cfcas "Crazy Fruits Casino (Bellfruit) (Scorpion 4)"
+ C|sc4cfcasa "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4cfcasb "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4cfcasc "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4cfcasd "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4cfcase "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4cfcasf "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4cfcasg "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4cfcash "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 9)"
+ C|sc4cfcasi "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 10)"
+ C|sc4cfcasj "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 11)"
+ C|sc4cfcask "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 12)"
+ C|sc4cfcasl "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 13)"
+ C|sc4cfcasm "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 14)"
+ C|sc4cfcasn "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 15)"
+ C|sc4cfcaso "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 16)"
+ C|sc4cfcasp "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 17)"
+ C|sc4cfcasq "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 18)"
+ C|sc4cfcasr "Crazy Fruits Casino (Bellfruit) (Scorpion 4) (set 19)"
+ c|sc4crzgn "Crazy Gang (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4crzgn "Crazy Gang (Bellfruit) (Scorpion 4) (set 1, Top Box)"
+ c|sc4crzgnb "Crazy Gang (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4crzgnb "Crazy Gang (Bellfruit) (Scorpion 4) (set 3, Top Box)"
+ c|sc4crzgng "Crazy Gang (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4crzgng "Crazy Gang (Bellfruit) (Scorpion 4) (set 8, Top Box)"
+ c|sc4crzgnj "Crazy Gang (Bellfruit) (Scorpion 4) (set 11)"
+ C|sc4crzgnj "Crazy Gang (Bellfruit) (Scorpion 4) (set 11, Top Box)"
+ C|sc4dhh "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 1)"
+ c|sc4dhh "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dhha "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 2)"
+ c|sc4dhha "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dhhb "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 3)"
+ c|sc4dhhb "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dhhc "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 4)"
+ c|sc4dhhc "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dhhd "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 5)"
+ c|sc4dhhd "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dhhe "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 6)"
+ c|sc4dhhe "Dough Ho Ho (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dnd "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL016, set 1)"
+ c|sc4dnd "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dnda "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL422, set 2)"
+ c|sc4dnda "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndb "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL016, set 2)"
+ c|sc4dndb "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndbb "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE471, set 1)"
+ c|sc4dndbb "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndbba "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE472, set 1)"
+ c|sc4dndbba "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndbbb "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE471, set 2)"
+ c|sc4dndbbb "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndbbc "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE472, set 2)"
+ c|sc4dndbbc "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndbbd "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE473, set 1)"
+ c|sc4dndbbd "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndbbe "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE571, set 1)"
+ c|sc4dndbbe "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndbbf "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE572, set 1)"
+ c|sc4dndbbf "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndbbg "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE473, set 2)"
+ c|sc4dndbbg "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dndbbh "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE571, set 2)"
+ c|sc4dndbbh "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 9)"
+ C|sc4dndbbi "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (CRBE572, set 2)"
+ c|sc4dndbbi "Deal Or No Deal Break The Bank (Bellfruit) (Scorpion 4) (set 10)"
+ C|sc4dndbc "Deal Or No Deal Box Clever (Bellfruit) (Scorpion 4) (BOXR571, set 1)"
+ c|sc4dndbc "Deal Or No Deal Box Clever (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndbca "Deal Or No Deal Box Clever (Bellfruit) (Scorpion 4) (BOXR571, set 2)"
+ c|sc4dndbca "Deal Or No Deal Box Clever (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndbd "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (BGDA471, set 1)"
+ c|sc4dndbd "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndbda "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (BGDA471, set 2)"
+ c|sc4dndbda "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndbdb "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (BGDA472, set 1)"
+ c|sc4dndbdb "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndbdc "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (BGDA571, set 1)"
+ c|sc4dndbdc "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndbdd "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (BGDA472, set 2)"
+ c|sc4dndbdd "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndbde "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (BGDA571, set 2)"
+ c|sc4dndbde "Deal Or No Deal The Big Deal (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndbe "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK012, set 1)"
+ c|sc4dndbe "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndbeb "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK422, set 1)"
+ c|sc4dndbeb "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndbec "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK012, set 2)"
+ c|sc4dndbec "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndbed "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK422, set 2)"
+ c|sc4dndbed "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndbee "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK423, set 1)"
+ c|sc4dndbee "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndbef "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK425, set 1)"
+ c|sc4dndbef "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndbeg "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK013, set 1)"
+ c|sc4dndbeg "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndbeh "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK014, set 1)"
+ c|sc4dndbeh "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dndbei "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK423, set 2)"
+ c|sc4dndbei "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 9)"
+ C|sc4dndbej "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK425, set 2)"
+ c|sc4dndbej "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 10)"
+ C|sc4dndbek "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK013, set 2)"
+ c|sc4dndbek "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 11)"
+ C|sc4dndbel "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK014, set 2)"
+ c|sc4dndbel "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 12)"
+ C|sc4dndbem "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK426, set 1)"
+ c|sc4dndbem "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 13)"
+ C|sc4dndben "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (DBTK426, set 2)"
+ c|sc4dndben "Deal Or No Deal Beat The Banker (Bellfruit) (Scorpion 4) (set 14)"
+ C|sc4dndbr "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (BIGD471, set 1)"
+ c|sc4dndbr "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndbra "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (BIGD472, set 1)"
+ c|sc4dndbra "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndbrb "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (BIGD471, set 2)"
+ c|sc4dndbrb "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndbrc "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (BIGD472, set 2)"
+ c|sc4dndbrc "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndbrd "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (BIGD475, set 1)"
+ c|sc4dndbrd "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndbre "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (BIGD571, set 1)"
+ c|sc4dndbre "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndbrf "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (BIGD475, set 2)"
+ c|sc4dndbrf "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndbrg "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (BIGD571, set 2)"
+ c|sc4dndbrg "Deal Or No Deal The Big Reds (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dndc "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL422, set 1)"
+ c|sc4dndc "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndcc "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (CRZR471, set 1)"
+ c|sc4dndcc "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndcca "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (CRZR474)"
+ c|sc4dndcca "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndccb "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (CRZR471, set 2)"
+ c|sc4dndccb "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndccc "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (CRZR475, set 1)"
+ c|sc4dndccc "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndccd "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (CRZR571, set 1)"
+ c|sc4dndccd "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndcce "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (CRZR475, set 2)"
+ c|sc4dndcce "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndccf "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (CRZR571, set 2)"
+ c|sc4dndccf "Deal Or No Deal The Crazy Chair (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndcl "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (DNDL313, set 1)"
+ c|sc4dndcl "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndcla "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (DNDL212, set 1)"
+ c|sc4dndcla "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndclb "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (DNDL391, set 1)"
+ c|sc4dndclb "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndclc "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (DNDL181, set 1)"
+ c|sc4dndclc "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndcld "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (DNDL313, set 2)"
+ c|sc4dndcld "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndcle "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (DNDL212, set 2)"
+ c|sc4dndcle "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndclf "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (DNDL391, set 2)"
+ c|sc4dndclf "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndclg "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (DNDL181, set 2)"
+ c|sc4dndclg "Deal Or No Deal Club (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dndcs "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (CLDD211, set 1)"
+ c|sc4dndcs "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndcsa "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (CLDD212, set 1)"
+ c|sc4dndcsa "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndcsb "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (CLDD211, set 2)"
+ c|sc4dndcsb "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndcsc "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (CLDD212, set 2)"
+ c|sc4dndcsc "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndcsd "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (CLDD215, set 1)"
+ C|sc4dndcse "Deal Or No Deal Classic (Bellfruit) (Scorpion 4) (CLDD215, set 2)"
+ C|sc4dndcw "Deal Or No Deal The Walk Of Wealth Classic (Bellfruit) (Scorpion 4) (CWOH271, set 1)"
+ c|sc4dndcw "Deal Or No Deal The Walk Of Wealth Classic (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndcwa "Deal Or No Deal The Walk Of Wealth Classic (Bellfruit) (Scorpion 4) (CWOH272, set 1)"
+ c|sc4dndcwa "Deal Or No Deal The Walk Of Wealth Classic (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndcwb "Deal Or No Deal The Walk Of Wealth Classic (Bellfruit) (Scorpion 4) (CWOH271, set 2)"
+ c|sc4dndcwb "Deal Or No Deal The Walk Of Wealth Classic (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndcwc "Deal Or No Deal The Walk Of Wealth Classic (Bellfruit) (Scorpion 4) (CWOH272, set 2)"
+ c|sc4dndcwc "Deal Or No Deal The Walk Of Wealth Classic (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndd "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL402, set 1)"
+ c|sc4dndd "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dnddd "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (DDNO471, set 1)"
+ c|sc4dnddd "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dnddda "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (DDNO571, set 1)"
+ c|sc4dnddda "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndddb "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (DDNO572, set 1)"
+ c|sc4dndddb "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndddc "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (DDNO573, set 1)"
+ c|sc4dndddc "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndddd "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (DDNO471, set 2)"
+ c|sc4dndddd "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dnddde "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (DDNO571, set 2)"
+ c|sc4dnddde "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndddf "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (DDNO572, set 2)"
+ c|sc4dndddf "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndddg "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (DDNO573, set 2)"
+ c|sc4dndddg "Deal Or No Deal Double Deal Or No Deal (Bellfruit) (Scorpion 4) (set 8)"
+ c|sc4dnddf "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dnddf "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (TDFC471, set 1)"
+ c|sc4dnddfa "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dnddfa "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (TDFC471, set 2)"
+ c|sc4dnddfb "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dnddfb "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (TDFC475, set 1)"
+ c|sc4dnddfc "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dnddfc "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (TDFC571, set 1)"
+ c|sc4dnddfd "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dnddfd "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (TDFC475, set 2)"
+ c|sc4dnddfe "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dnddfe "Deal Or No Deal The Dream Factory (Bellfruit) (Scorpion 4) (TDFC571, set 2)"
+ C|sc4dnddw "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (DOFN471, set 1)"
+ c|sc4dnddw "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dnddwa "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (DOFN473, set 1)"
+ c|sc4dnddwa "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dnddwb "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (DOFN471, set 2)"
+ c|sc4dnddwb "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dnddwc "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (DOFN473, set 2)"
+ c|sc4dnddwc "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dnddwd "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (DOFN475, set 1)"
+ c|sc4dnddwd "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dnddwe "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (DOFN572, set 1)"
+ c|sc4dnddwe "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dnddwf "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (DOFN475, set 2)"
+ c|sc4dnddwf "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dnddwg "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (DOFN572, set 2)"
+ c|sc4dnddwg "Deal Or No Deal The Deal Wheel (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dnde "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL017, set 1)"
+ c|sc4dnde "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndf "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL018, set 1)"
+ c|sc4dndf "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndg "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL402, set 2)"
+ c|sc4dndg "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dndh "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL017, set 2)"
+ c|sc4dndh "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 9)"
+ C|sc4dndhf "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA473, set 1)"
+ c|sc4dndhf "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndhfa "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA473, set 2)"
+ c|sc4dndhfa "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndhfb "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA477, set 1)"
+ c|sc4dndhfb "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndhfc "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA571, set 1)"
+ c|sc4dndhfc "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndhfd "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA477, set 2)"
+ c|sc4dndhfd "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndhfe "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA571, set 2)"
+ c|sc4dndhfe "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndhff "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA471, set 1)"
+ c|sc4dndhff "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndhfg "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA472, set 1)"
+ c|sc4dndhfg "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dndhfh "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA471, set 2)"
+ c|sc4dndhfh "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 9)"
+ C|sc4dndhfi "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA472, set 2)"
+ c|sc4dndhfi "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (set 10)"
+ C|sc4dndhfj "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA476)"
+ C|sc4dndhfk "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA572, set 1, bad?)"
+ C|sc4dndhfl "Deal Or No Deal Hall Of Fame (Bellfruit) (Scorpion 4) (DNHA572, set 2, bad?)"
+ C|sc4dndi "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL018, set 2)"
+ c|sc4dndi "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 10)"
+ C|sc4dndj "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL406, set 1)"
+ c|sc4dndj "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 11)"
+ C|sc4dndk "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL428, set 1)"
+ c|sc4dndk "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 12)"
+ C|sc4dndl "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL406, set 2)"
+ c|sc4dndl "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 13)"
+ C|sc4dndlp "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (LPDN571, set 1)"
+ c|sc4dndlp "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndlpa "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (LPDN572, set 1)"
+ c|sc4dndlpa "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndlpb "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (LPDN573, set 1)"
+ c|sc4dndlpb "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndlpc "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (LPDN571, set 2)"
+ c|sc4dndlpc "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndlpd "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (LPDN572, set 2)"
+ c|sc4dndlpd "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndlpe "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (LPDN573, set 2)"
+ c|sc4dndlpe "Deal Or No Deal Let's Play Deal Or No Deal (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndm "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL428, set 2)"
+ c|sc4dndm "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 14)"
+ C|sc4dndn "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL424, set 1)"
+ c|sc4dndn "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 15)"
+ C|sc4dndo "Deal Or No Deal (Bellfruit) (Scorpion 4) (DONL424, set 2)"
+ c|sc4dndo "Deal Or No Deal (Bellfruit) (Scorpion 4) (set 16)"
+ c|sc4dndpg "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndpg "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (TPBG471, set 1)"
+ c|sc4dndpga "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndpga "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (TPBG571, set 1)"
+ c|sc4dndpgb "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndpgb "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (TPBG572, set 1)"
+ c|sc4dndpgc "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndpgc "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (TPBG471, set 2)"
+ c|sc4dndpgd "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndpgd "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (TPGB571, set 2)"
+ c|sc4dndpge "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndpge "Deal Or No Deal The Perfect Game (Bellfruit) (Scorpion 4) (TPGB572, set 2)"
+ C|sc4dndra "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (REDT471, set 1)"
+ c|sc4dndra "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndraa "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (REDT471, set 2)"
+ c|sc4dndraa "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndrab "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (REDT474, set 1)"
+ c|sc4dndrab "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndrac "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (REDT572, set 1)"
+ c|sc4dndrac "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndrad "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (REDT474, set 2)"
+ c|sc4dndrad "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndrae "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (REDT572, set 2)"
+ c|sc4dndrae "Deal Or No Deal Red Alert (Bellfruit) (Scorpion 4) (set 6)"
+ c|sc4dndtp "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndtp "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV411, set 1)"
+ c|sc4dndtpa "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndtpa "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV412, set 1)"
+ c|sc4dndtpb "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndtpb "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV413, set 1)"
+ c|sc4dndtpc "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndtpc "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV414, set 1, bad)"
+ c|sc4dndtpd "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndtpd "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV415, set 1)"
+ c|sc4dndtpe "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndtpe "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV411, set 2)"
+ c|sc4dndtpf "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndtpf "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV412, set 2)"
+ c|sc4dndtpg "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dndtpg "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV413, set 2)"
+ c|sc4dndtph "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 9)"
+ C|sc4dndtph "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV414, set 2, bad)"
+ c|sc4dndtpi "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 10)"
+ C|sc4dndtpi "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV415, set 2)"
+ c|sc4dndtpj "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 11)"
+ C|sc4dndtpj "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV41A, set 1)"
+ c|sc4dndtpk "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 12)"
+ C|sc4dndtpk "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV41A, set 2)"
+ c|sc4dndtpl "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 13)"
+ C|sc4dndtpl "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV416, set 1)"
+ c|sc4dndtpm "Deal Or No Deal The Power (Bellfruit) (Scorpion 4) (set 14)"
+ C|sc4dndtpm "Deal Or No Deal The Power 5 (Bellfruit) (Scorpion 4) (TPRV416, set 2)"
+ c|sc4dndtr "Deal Or No Deal Think Red (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndtr "Deal Or No Deal Think Red (Bellfruit) (Scorpion 4) (THRE571, set 1)"
+ c|sc4dndtra "Deal Or No Deal Think Red (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndtra "Deal Or No Deal Think Red (Bellfruit) (Scorpion 4) (THRE571, set 2)"
+ c|sc4dndwb "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndwb "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (WIYX412, set 1)"
+ c|sc4dndwba "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndwba "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (WIYX414, set 1)"
+ c|sc4dndwbb "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndwbb "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (WIYX412, set 2)"
+ c|sc4dndwbc "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndwbc "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (WIYX414, set 2)"
+ c|sc4dndwbd "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndwbd "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (WIYX415, set 1)"
+ c|sc4dndwbe "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndwbe "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (WIYX415, set 2)"
+ c|sc4dndwbf "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (set 7)"
+ C|sc4dndwbf "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (WIYX419, set 1)"
+ c|sc4dndwbg "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (set 8)"
+ C|sc4dndwbg "Deal Or No Deal What's In Your Box (Bellfruit) (Scorpion 4) (WIYX419, set 2)"
+ c|sc4dndww "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndww "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (TWOH411, set 1)"
+ c|sc4dndwwa "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndwwa "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (TWOH412, set 1)"
+ c|sc4dndwwb "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndwwb "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (TWOH411, set 2)"
+ c|sc4dndwwc "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (set 4)"
+ C|sc4dndwwc "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (TWOH415, set 1)"
+ c|sc4dndwwd "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (set 5)"
+ C|sc4dndwwd "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (TWOH415, set 2)"
+ c|sc4dndwwe "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (set 6)"
+ C|sc4dndwwe "Deal Or No Deal The Walk Of Wealth (Bellfruit) (Scorpion 4) (TWOH412, set 2)"
+ C|sc4dndys "Deal Or No Deal It's Your Show (Bellfruit) (Scorpion 4) (DOBO571, set 1)"
+ c|sc4dndys "Deal Or No Deal It's Your Show (Bellfruit) (Scorpion 4) (set 1)"
+ C|sc4dndysa "Deal Or No Deal It's Your Show (Bellfruit) (Scorpion 4) (DOBO474, set 1)"
+ c|sc4dndysa "Deal Or No Deal It's Your Show (Bellfruit) (Scorpion 4) (set 2)"
+ C|sc4dndysb "Deal Or No Deal It's Your Show (Bellfruit) (Scorpion 4) (DOBO571, set 2)"
+ c|sc4dndysb "Deal Or No Deal It's Your Show (Bellfruit) (Scorpion 4) (set 3)"
+ C|sc4dndysc "Deal Or No Deal It's Your Show (Bellfruit) (Scorpion 4) (DOBO474, set 2)"
+ C|sc4ggame "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 25GBP, set 1)"
+ c|sc4ggame "Golden Game (Mazooma) (Scorpion 4) (set 1)"
+ C|sc4ggame0 "Golden Game (Mazooma) (PR2056) (Scorpion 4) (set 2)"
+ c|sc4ggame0 "Golden Game (Mazooma) (Scorpion 4) (set 28)"
+ C|sc4ggame1 "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (set 7)"
+ c|sc4ggame1 "Golden Game (Mazooma) (Scorpion 4) (set 29)"
+ C|sc4ggame2 "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (set 8)"
+ c|sc4ggame2 "Golden Game (Mazooma) (Scorpion 4) (set 30)"
+ C|sc4ggame3 "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 6)"
+ c|sc4ggame3 "Golden Game (Mazooma) (Scorpion 4) (set 31)"
+ C|sc4ggame4 "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 7)"
+ c|sc4ggame4 "Golden Game (Mazooma) (Scorpion 4) (set 32)"
+ C|sc4ggame5 "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 8)"
+ c|sc4ggame5 "Golden Game (Mazooma) (Scorpion 4) (set 33)"
+ C|sc4ggame6 "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 9)"
+ c|sc4ggame6 "Golden Game (Mazooma) (Scorpion 4) (set 34)"
+ C|sc4ggame7 "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 35GBP, set 1)"
+ c|sc4ggame7 "Golden Game (Mazooma) (Scorpion 4) (set 35)"
+ C|sc4ggame8 "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 35GBP, set 2)"
+ c|sc4ggame8 "Golden Game (Mazooma) (Scorpion 4) (set 36)"
+ C|sc4ggame9 "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 35GBP, set 3)"
+ c|sc4ggame9 "Golden Game (Mazooma) (Scorpion 4) (set 37)"
+ C|sc4ggamea "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 25GBP, set 1)"
+ c|sc4ggamea "Golden Game (Mazooma) (Scorpion 4) (set 2)"
+ C|sc4ggameaa "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 35GBP, set 4)"
+ c|sc4ggameaa "Golden Game (Mazooma) (Scorpion 4) (set 38)"
+ C|sc4ggameab "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 35GBP, set 5)"
+ c|sc4ggameab "Golden Game (Mazooma) (Scorpion 4) (set 39)"
+ C|sc4ggameac "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 35GBP, set 6)"
+ c|sc4ggameac "Golden Game (Mazooma) (Scorpion 4) (set 40)"
+ C|sc4ggamead "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 35GBP, set 7)"
+ c|sc4ggamead "Golden Game (Mazooma) (Scorpion 4) (set 41)"
+ C|sc4ggameae "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 35GBP, set 8)"
+ c|sc4ggameae "Golden Game (Mazooma) (Scorpion 4) (set 42)"
+ C|sc4ggameb "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 25GBP, set 2)"
+ c|sc4ggameb "Golden Game (Mazooma) (Scorpion 4) (set 3)"
+ C|sc4ggamec "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 25GBP, set 3)"
+ c|sc4ggamec "Golden Game (Mazooma) (Scorpion 4) (set 4)"
+ C|sc4ggamed "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 25GBP, set 4)"
+ c|sc4ggamed "Golden Game (Mazooma) (Scorpion 4) (set 5)"
+ c|sc4ggamee "Golden Game (Mazooma) (Scorpion 4) (set 6)"
+ C|sc4ggamef "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 1)"
+ c|sc4ggamef "Golden Game (Mazooma) (Scorpion 4) (set 7)"
+ C|sc4ggameg "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 2)"
+ c|sc4ggameg "Golden Game (Mazooma) (Scorpion 4) (set 8)"
+ c|sc4ggameh "Golden Game (Mazooma) (Scorpion 4) (set 9)"
+ C|sc4ggamei "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 25GBP, set 2)"
+ c|sc4ggamei "Golden Game (Mazooma) (Scorpion 4) (set 10)"
+ C|sc4ggamej "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 3)"
+ c|sc4ggamej "Golden Game (Mazooma) (Scorpion 4) (set 11)"
+ C|sc4ggamek "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 4)"
+ c|sc4ggamek "Golden Game (Mazooma) (Scorpion 4) (set 12)"
+ C|sc4ggamel "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (set 1)"
+ c|sc4ggamel "Golden Game (Mazooma) (Scorpion 4) (set 13)"
+ C|sc4ggamem "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (set 2)"
+ c|sc4ggamem "Golden Game (Mazooma) (Scorpion 4) (set 14)"
+ C|sc4ggamen "Golden Game (Mazooma) (PR2056) (Scorpion 4) (set 1)"
+ c|sc4ggamen "Golden Game (Mazooma) (Scorpion 4) (set 15)"
+ c|sc4ggameo "Golden Game (Mazooma) (Scorpion 4) (set 16)"
+ C|sc4ggamep "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 25GBP, set 3)"
+ c|sc4ggamep "Golden Game (Mazooma) (Scorpion 4) (set 17)"
+ C|sc4ggameq "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 25GBP, set 4)"
+ c|sc4ggameq "Golden Game (Mazooma) (Scorpion 4) (set 18)"
+ C|sc4ggamer "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (GLDX, 25GBP, set 5)"
+ c|sc4ggamer "Golden Game (Mazooma) (Scorpion 4) (set 19)"
+ C|sc4ggames "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 25GBP, set 5)"
+ c|sc4ggames "Golden Game (Mazooma) (Scorpion 4) (set 20)"
+ C|sc4ggamet "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 25GBP, set 6)"
+ c|sc4ggamet "Golden Game (Mazooma) (Scorpion 4) (set 21)"
+ C|sc4ggameu "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 25GBP, set 7)"
+ c|sc4ggameu "Golden Game (Mazooma) (Scorpion 4) (set 22)"
+ C|sc4ggamev "Golden Game (Mazooma) (PR2056) (Scorpion 4) (GLDX, 30GBP, set 5)"
+ c|sc4ggamev "Golden Game (Mazooma) (Scorpion 4) (set 23)"
+ C|sc4ggamew "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (set 3)"
+ c|sc4ggamew "Golden Game (Mazooma) (Scorpion 4) (set 24)"
+ C|sc4ggamex "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (set 4)"
+ c|sc4ggamex "Golden Game (Mazooma) (Scorpion 4) (set 25)"
+ C|sc4ggamey "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (set 5)"
+ c|sc4ggamey "Golden Game (Mazooma) (Scorpion 4) (set 26)"
+ C|sc4ggamez "Golden Game (Mazooma) (PR2056, newer?) (Scorpion 4) (set 6)"
+ c|sc4ggamez "Golden Game (Mazooma) (Scorpion 4) (set 27)"
+ C|sc4ggdlx "Golden Game Deluxe (Mazooma) (PR2201) (Scorpion 4) (set 1)"
+ c|sc4ggdlx "Golden Game Deluxe (Mazooma) (Scorpion 4) (set 1)"
+ C|sc4ggdlxa "Golden Game Deluxe (Mazooma) (PR2201) (Scorpion 4) (set 2)"
+ c|sc4ggdlxa "Golden Game Deluxe (Mazooma) (Scorpion 4) (set 2)"
+ C|sc4ggdlxb "Golden Game Deluxe (Mazooma) (PR2201) (Scorpion 4) (set 3)"
+ c|sc4ggdlxb "Golden Game Deluxe (Mazooma) (Scorpion 4) (set 3)"
+ C|sc4ggdlxc "Golden Game Deluxe (Mazooma) (PR2201) (Scorpion 4) (set 4)"
+ c|sc4ggdlxc "Golden Game Deluxe (Mazooma) (Scorpion 4) (set 4)"
+ C|sc4ggdlxd "Golden Game Deluxe (Mazooma) (PR2201) (Scorpion 4) (set 5)"
+ c|sc4ggdlxd "Golden Game Deluxe (Mazooma) (Scorpion 4) (set 5)"
+ C|sc4ggdlxe "Golden Game Deluxe (Mazooma) (PR2201) (Scorpion 4) (set 6)"
+ c|sc4ggdlxe "Golden Game Deluxe (Mazooma) (Scorpion 4) (set 6)"
+ C|sc4ggdlxf "Golden Game Deluxe (Mazooma) (PR2201) (Scorpion 4) (set 7)"
+ c|sc4ggdlxf "Golden Game Deluxe (Mazooma) (Scorpion 4) (set 7)"
+ C|sc4ggdlxg "Golden Game Deluxe (Mazooma) (PR2201) (Scorpion 4) (set 8)"
+ c|sc4ggdlxg "Golden Game Deluxe (Mazooma) (Scorpion 4) (set 8)"
+ C|sc4ggg "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 1)"
+ c|sc4ggg "Grand Golden Game (Mazooma) (Scorpion 4) (set 1)"
+ c|sc4ggga "Grand Golden Game (Mazooma) (Scorpion 4) (set 2)"
+ C|sc4gggb "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 2)"
+ c|sc4gggb "Grand Golden Game (Mazooma) (Scorpion 4) (set 3)"
+ C|sc4gggc "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 3)"
+ c|sc4gggc "Grand Golden Game (Mazooma) (Scorpion 4) (set 4)"
+ C|sc4gggd "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 4)"
+ c|sc4gggd "Grand Golden Game (Mazooma) (Scorpion 4) (set 5)"
+ C|sc4ggge "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 5)"
+ c|sc4ggge "Grand Golden Game (Mazooma) (Scorpion 4) (set 6)"
+ C|sc4gggf "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 6)"
+ c|sc4gggf "Grand Golden Game (Mazooma) (Scorpion 4) (set 7)"
+ C|sc4gggg "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 13)"
+ c|sc4gggg "Grand Golden Game (Mazooma) (Scorpion 4) (set 8)"
+ C|sc4gggh "Grand Golden Game (Mazooma) (PR2353) (Scorpion 4) (GGGB, 35GBP, set 1)"
+ c|sc4gggh "Grand Golden Game (Mazooma) (Scorpion 4) (set 9)"
+ C|sc4gggi "Grand Golden Game (Mazooma) (PR2353) (Scorpion 4) (GGGB, 35GBP, set 2)"
+ c|sc4gggi "Grand Golden Game (Mazooma) (Scorpion 4) (set 10)"
+ c|sc4gggj "Grand Golden Game (Mazooma) (Scorpion 4) (set 11)"
+ C|sc4gggk "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 7)"
+ c|sc4gggk "Grand Golden Game (Mazooma) (Scorpion 4) (set 12)"
+ C|sc4gggl "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 8)"
+ c|sc4gggl "Grand Golden Game (Mazooma) (Scorpion 4) (set 13)"
+ C|sc4gggm "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 9)"
+ c|sc4gggm "Grand Golden Game (Mazooma) (Scorpion 4) (set 14)"
+ C|sc4gggn "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 10)"
+ c|sc4gggn "Grand Golden Game (Mazooma) (Scorpion 4) (set 15)"
+ C|sc4gggo "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 11)"
+ c|sc4gggo "Grand Golden Game (Mazooma) (Scorpion 4) (set 16)"
+ C|sc4gggp "Grand Golden Game (Mazooma) (PR2056) (Scorpion 4) (GGGB, 35GBP, set 12)"
+ c|sc4gggp "Grand Golden Game (Mazooma) (Scorpion 4) (set 17)"
+ C|sc4gggq "Grand Golden Game (Mazooma) (PR2353) (Scorpion 4) (GGGB, 35GBP, set 3)"
+ c|sc4gggq "Grand Golden Game (Mazooma) (Scorpion 4) (set 18)"
+ C|sc4gggr "Grand Golden Game (Mazooma) (PR2353) (Scorpion 4) (GGGB, 35GBP, set 4)"
+ c|sc4gggr "Grand Golden Game (Mazooma) (Scorpion 4) (set 19)"
+ C|sc4gggs "Grand Golden Game (Mazooma) (PR2353) (Scorpion 4) (GGGB, 35GBP, set 5)"
+ c|sc4gggs "Grand Golden Game (Mazooma) (Scorpion 4) (set 20)"
+ C|sc4gggtb "Grand Golden Game (Mazooma) (PR2056, Top Box) (Scorpion 4) (GGGT, set 1)"
+ C|sc4gggtba "Grand Golden Game (Mazooma) (PR2056, Top Box) (Scorpion 4) (GGGT, set 2)"
+ C|sc4mowow "Monopoly Wheel Of Wealth (Mazooma) (PR2118) (Scorpion 4) (set 1)"
+ c|sc4mowow "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 1)"
+ C|sc4mowowa "Monopoly Wheel Of Wealth (Mazooma) (PR2118) (Scorpion 4) (set 2)"
+ c|sc4mowowa "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 2)"
+ C|sc4mowowb "Monopoly Wheel Of Wealth (Mazooma) (PR2118) (Scorpion 4) (set 3)"
+ c|sc4mowowb "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 3)"
+ C|sc4mowowc "Monopoly Wheel Of Wealth (Mazooma) (PR2118) (Scorpion 4) (set 4)"
+ c|sc4mowowc "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 4)"
+ c|sc4mowowd "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 5)"
+ c|sc4mowowe "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 6)"
+ c|sc4mowowf "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 7)"
+ c|sc4mowowg "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 8)"
+ c|sc4mowowh "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 9)"
+ c|sc4mowowi "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 10)"
+ c|sc4mowowj "Monopoly Wheel Of Wealth (Mazooma) (Scorpion 4) (set 11)"
+ C|sc4qmodo "Quazzi Mo' Dough (Qps) (Scorpion 4) (set 1)"
+ c|sc4qmodo "Quazzi Mo Dough (Qps) (Scorpion 4) (set 1)"
+ C|sc4qmodoa "Quazzi Mo' Dough (Qps) (Scorpion 4) (set 2)"
+ c|sc4qmodoa "Quazzi Mo Dough (Qps) (Scorpion 4) (set 2)"
+ C|sc4qmodob "Quazzi Mo' Dough (Qps) (Scorpion 4) (set 3)"
+ c|sc4qmodob "Quazzi Mo Dough (Qps) (Scorpion 4) (set 3)"
+ C|sc4qmodoc "Quazzi Mo' Dough (Qps) (Scorpion 4) (set 4)"
+ c|sc4qmodoc "Quazzi Mo Dough (Qps) (Scorpion 4) (set 4)"
+ C|sc4qmodod "Quazzi Mo' Dough (Qps) (Scorpion 4) (set 5)"
+ c|sc4qmodod "Quazzi Mo Dough (Qps) (Scorpion 4) (set 5)"
+ c|sc4srrmz "Shake Rattle Roll (Mazooma) (Scorpion 4) (set 1)"
+ C|sc4srrmz "Shake Rattle Roll (Mazooma) (Scorpion 4) (set 1, Top Box)"
+ C|sc4tbox "Gold X Triple Top Box (Mazooma) (Scorpion 4)"
+ c|sc4tbox "Top Box (Mazooma) (Scorpion 4)"
+ c|sc5potog "Pot Of Gold (Bellfruit) (Scorpion 5) (set 1)"
+ C|sc5potog "Pot Of Gold (QPS) (Scorpion 5) (set 1)"
+ c|sc5potoga "Pot Of Gold (Bellfruit) (Scorpion 5) (set 2)"
+ C|sc5potoga "Pot Of Gold (QPS) (Scorpion 5) (set 2)"
+ c|sc5potogb "Pot Of Gold (Bellfruit) (Scorpion 5) (set 3)"
+ C|sc5potogb "Pot Of Gold (QPS) (Scorpion 5) (set 3)"
+ c|sc5potogc "Pot Of Gold (Bellfruit) (Scorpion 5) (set 4)"
+ C|sc5potogc "Pot Of Gold (QPS) (Scorpion 5) (set 4)"
+ c|sc5potogd "Pot Of Gold (Bellfruit) (Scorpion 5) (set 5)"
+ C|sc5potogd "Pot Of Gold (QPS) (Scorpion 5) (set 5)"
+ c|sc5potoge "Pot Of Gold (Bellfruit) (Scorpion 5) (set 6)"
+ C|sc5potoge "Pot Of Gold (QPS) (Scorpion 5) (set 6)"
+ c|sc5potogf "Pot Of Gold (Bellfruit) (Scorpion 5) (set 7)"
+ C|sc5potogf "Pot Of Gold (QPS) (Scorpion 5) (set 7)"
+ c|sc5potogg "Pot Of Gold (Bellfruit) (Scorpion 5) (set 8)"
+ C|sc5potogg "Pot Of Gold (QPS) (Scorpion 5) (set 8)"
+ C|schamp "Sonic Championship (USA)"
+ c|schamp "Sonic Championship"
+ c|sf2cej "Street Fighter II': Champion Edition (Japan 920513)"
+ C|sf2ceja "Street Fighter II': Champion Edition (Japan 920322)"
+ C|sf2cejb "Street Fighter II': Champion Edition (Japan 920513)"
+ C|sf2cejc "Street Fighter II': Champion Edition (Japan 920803)"
+ C|sf2ug "Street Fighter II: The World Warrior (USA 910522, Rev. G)"
+ c|sf2ui "Street Fighter II: The World Warrior (USA 910522)"
+ C|sf2ui "Street Fighter II: The World Warrior (USA 910522, Rev. I)"
+ C|sfight "Sonic the Fighters (Japan)"
+ c|sfight "Sonic The Fighters"
+ c|sfight2 "Street Fighter 2"
+ C|sfight2 "Street Fighter II"
+ c|sfight2a "Street Fighter 2 (rev.1)"
+ C|sfight2a "Street Fighter II (rev.1)"
+ c|sfight2b "Street Fighter 2 (rev.2)"
+ C|sfight2b "Street Fighter II (rev.2)"
+ C|slqz2 "Mahjong Shuang Long Qiang Zhu 2 (VS203J)"
+ c|slqz2 "Mahjong Shuang Long Qiang Zhu 2"
+ c|spacefb "Space Firebird (Nintendo, set 1)"
+ C|spacefb "Space Firebird (rev. 04-u)"
+ C|spacefba "Space Firebird (rev. 02-a)"
+ c|spacefbe "Space Firebird (Nintendo, set 3)"
+ C|spacefbe "Space Firebird (rev. 03-e set 1)"
+ C|spacefbe2 "Space Firebird (rev. 03-e set 2)"
+ c|sshooter "Sharpshooter (Rev 1.7)"
+ C|sshooter "Sharpshooter (Rev 1.9)"
+ c|starforce "Star Force (encrypted)"
+ C|starforce "Star Force (encrypted, set 1)"
+ C|svg "S.V.G. - Spectral vs Generation (M68k label V200) (ARM label V200, ROM 10/11/05 S.V.G V201)"
+ c|svg "S.V.G. - Spectral vs Generation (ver. 200)"
+ C|svgpcb "S.V.G. - Spectral vs Generation (M68k label V100JP) (ARM label V100JP ROM 05/12/05 S.V.G V100) (JAMMA PCB)"
+ C|theglad "The Gladiator - Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 01/16/03 SHEN JIAN)"
+ c|theglad "The Gladiator (ver. 100)"
+ C|theglada "The Gladiator - Road of the Sword / Shen Jian (M68k label V101) (ARM label V107, ROM 06/06/03 SHEN JIAN V107)"
+ c|theglada "The Gladiator (ver. 101)"
+ C|thegladpcb "The Gladiator - Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 02/25/03 SHEN JIAN) (JAMMA PCB)"
+ C|tiptop "Tip Top (3 board stack)"
+ c|tiptop "Tip Top"
+ C|toukon4 "Shin Nihon Pro Wrestling Toukon Retsuden 4 Arcade Edition (TRF1 Ver. A)"
+ c|toukon4 "Shin Nihon Pro Wrestling Toukon Retsuden 4 Arcade Edition"
+ C|tsamurai "Samurai Nihon-Ichi (set 1)"
+ c|tsamurai "Samurai Nihon-ichi (set 1)"
+ C|tsamurai2 "Samurai Nihon-Ichi (set 2)"
+ c|tsamurai2 "Samurai Nihon-ichi (set 2)"
+ C|tsamuraih "Samurai Nihon-Ichi (bootleg, harder)"
+ c|tsamuraih "Samurai Nihon-ichi (bootleg, harder)"
+ C|unkhorse "unknown Japanese horse gambling game"
+ c|unkmeyco "unknown Meyco game"
+ C|vhunt2d "Vampire Hunter 2: Darkstalkers Revenge (Japan 970913 Phoenix Edition) (bootleg)"
+ c|vhunt2d "Vampire Hunter 2: Darkstalkers Revenge (Japan 970929 Phoenix Edition) (bootleg)"
+ C|von "Cyber Troopers Virtual-On (USA, Revision B)"
+ c|von "Virtual On Cyber Troopers (US, Revision B)"
+ C|vonj "Cyber Troopers Virtual-On (Japan, Revision B)"
+ c|vonj "Virtual On Cyber Troopers (Japan, Revision B)"
+ c|warzarda "Warzard (Japan 961023)"
+ C|warzardr1 "Warzard (Japan 961023)"
+ C|wfortune "Wheel Of Fortune (set 1)"
+ c|wfortune "Wheel Of Fortune"
+ c|wfortunea "Wheel Of Fortune (alternate)"
+ C|wfortunea "Wheel Of Fortune (set 2)"
+ c|winrun "Winning Run Suzuka Grand Prix (Japan)"
+ C|winrun "Winning Run"
+ C|wldarrow "Wild Arrow (color, Standard V4.8)"
+ c|wldarrow "Wild Arrow (Standard V4.8)"
+ C|wldkicks "World Kicks (WK1 Ver. A)"
+ c|wldkicks "World Kicks"
+ c|wldwitch "Wild Witch (Export, 6T/12T ver 1.74A)"
+ C|wldwitch "Wild Witch (Export, 6T/12T ver 1.84A)"
+ C|wldwitcha "Wild Witch (Export, 6T/12T ver 1.57-SP)"
+ C|wldwitchb "Wild Witch (Export, 6T/12T ver 1.57-TE)"
+ C|wldwitchc "Wild Witch (Export, 6T/12T ver 1.62A)"
+ C|wldwitchd "Wild Witch (Export, 6T/12T ver 1.62B)"
+ C|wldwitche "Wild Witch (Export, 6T/12T ver 1.62A-F)"
+ C|wldwitchf "Wild Witch (Export, 6T/12T ver 1.62A alt)"
+ C|wldwitchg "Wild Witch (Export, 6T/12T ver 1.62B alt)"
+ C|wldwitchh "Wild Witch (Export, 6T/12T ver 1.65A)"
+ C|wldwitchi "Wild Witch (Export, 6T/12T ver 1.65A-S)"
+ C|wldwitchj "Wild Witch (Export, 6T/12T ver 1.65A-S alt)"
+ C|wldwitchk "Wild Witch (Export, 6T/12T ver 1.65A-N)"
+ C|wldwitchl "Wild Witch (Export, 6T/12T ver 1.70A beta)"
+ C|wldwitchm "Wild Witch (Export, 6T/12T ver 1.70A)"
+ C|wldwitchn "Wild Witch (Export, 6T/12T ver 1.70A alt)"
+ C|wldwitcho "Wild Witch (Export, 6T/12T ver 1.74A-SP-BELG)"
+ C|wldwitchp "Wild Witch (Export, 6T/12T ver 1.74A)"
+ C|wldwitchq "Wild Witch (Export, 6T/12T ver 1.74A alt)"
+ C|wldwitchr "Wild Witch (Export, 6B/12B ver 1.75A-E English)"
+ C|wldwitchs "Wild Witch (Export, 6T/12T ver 1.76A)"
+ C|wldwitcht "Wild Witch (Export, 6T/12T ver 1.77A)"
+ C|wldwitchu "Wild Witch (Export, 6T/12T ver 1.79A)"
+ C|wldwitchv "Wild Witch (Export, 6T/12T ver 1.83A)"
+ C|wyvernwg "Wyvern Wings (set 1)"
+ c|wyvernwg "Wyvern Wings"
+ C|wyvernwga "Wyvern Wings (set 2)"
+ c|yumefuda "(Medal) Yumefuda [BET]"
+ C|yumefuda "Yumefuda [BET]"
diff --git a/docs/release/src/osd/winui/help/html/mameui_credits.htm b/docs/release/src/osd/winui/help/html/mameui_credits.htm
new file mode 100644
index 00000000000..3dbe2393f22
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_credits.htm
@@ -0,0 +1,141 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI Credits</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+ div.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+<base target="_blank">
+</head>
+
+<body background="../images/bkground.gif">
+
+<h1>MameUI Credits &amp; Resources</h1>
+<h2><b>Credits</b></h2>
+<p class="MsoNormal">The current MameUI DEV team:</p>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Chris Kirmse</b></p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Mike Haaland</b></p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>René Single</b></p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a href="http://mameui.info/">John L. Hardy IV</a></b></p>
+<p class="MsoNormal" style="margin-left:.75in">&nbsp;</p>
+<p class="MsoNormal">Special thanks to Michael Soderstrom for project
+co-ordination and source maintenance from 1997-2001.</p>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal">Additional appreciated code contributions by : Jeff
+Miller, Dan Miller, Andrew Kirmse, Mohammad Rezaei, <font face="Arial" size="2">
+René Single, </font>John Zissopoulos, Nathan
+Woods, Robert Schlabbach, Sword, Emuman, BUT, <font face="Arial" size="2">'Mamesick', </font>
+Sauro Puccini,<b> </b><font face="Arial" size="2">Tor
+Arne Vestbø, </font>R. J. Sheppard, Visk, K&amp;K,
+Patrick Jones, and ‘Ren Höek’.</p>
+<p class="MsoNormal">&nbsp;</p>
+<h2><b>Resources</b></h2>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a target="_blank" href="http://mameui.info/">The
+MameUI Homepage</a> </b>:<b> </b>Home to the MameUI binary/source,
+icons, screenshots, testing, work in progress updates, bug
+reporting/tracking, message board, and benchmarking.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a target="_blank" href="http://www.mameworld.info/ubbthreads/postlist.php?Cat=&amp;Board=mameui">The
+MameUI
+Message Board</a> </b>:<b> </b>Forum for discussion of MameUI related issues.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a target="_blank" href="http://mameui.info//MameUI_Bugs.xls">MameUI
+Defect Tracking and Bug Reports</a> </b>: Excel spreadsheet which displays
+information about current MameUI feature requests and issues.&nbsp; Check before
+reporting potential bugs.</p>
+<p class="MsoNormal"><b>&nbsp;</b></p>
+<div class="MsoNormal" align="center" style="text-align:center">
+ <span style="font-family: Courier New">
+ <hr size="2" width="100%" align="center"></span>
+</div>
+<p class="MsoNormal"><b>&nbsp;</b></p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b><a href="http://www.mamedev.org">MameDEV.org</a> </b>:<b> </b>Home of
+baseline MAME.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>
+<a target="_blank" href="http://www.mametesters.org">MameTesters.org</a> </b>:<b> </b>
+Reporting and tracking baseline Mamebugs.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">&nbsp;</p>
+<p class="MsoNormal" style="margin-left: 0" align="left">MameUI ©
+2007 C. Kirmse, M. Haaland, &amp; the MameUI team</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">&nbsp;</p>
+<p class="MsoNormal" style="margin-left: 0" align="left">this help
+file authored by john iv</p>
+
+<p class="MsoNormal" style="margin-left: 0" align="left">
+<font size="1">
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y-%m-%d %I:%M %p %Z" startspan -->2008-10-28 06:48 PM -0700<!--webbot bot="Timestamp" endspan i-checksum="38520" --></font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_download.htm b/docs/release/src/osd/winui/help/html/mameui_download.htm
new file mode 100644
index 00000000000..0063701ef36
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_download.htm
@@ -0,0 +1,62 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI Download Locations</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+<base target="_blank">
+</head>
+
+<body background="../images/bkground.gif">
+
+<h2>Download Locations</h2>
+<p class="MsoNormal">The official site for MameUI downloads:</p>
+<p class="MsoNormal">
+<a target="_blank" href="http://mameui.info/">
+<span style="font-weight: 700; color: #0000FF; text-decoration: underline">The
+MameUI Homepage</span></a></p>
+
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal"><font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-12 02:03 PM -0800<!--webbot bot="Timestamp" endspan i-checksum="37667" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_filemenu.htm b/docs/release/src/osd/winui/help/html/mameui_filemenu.htm
new file mode 100644
index 00000000000..12f2915538c
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_filemenu.htm
@@ -0,0 +1,625 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml"
+xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 12">
+<meta name=Originator content="Microsoft Word 12">
+<link rel=File-List href="mameui_filemenu_files/filelist.xml">
+<link rel=Edit-Time-Data href="mameui_filemenu_files/editdata.mso">
+<!--[if !mso]>
+<style>
+v\:* {behavior:url(#default#VML);}
+o\:* {behavior:url(#default#VML);}
+w\:* {behavior:url(#default#VML);}
+.shape {behavior:url(#default#VML);}
+</style>
+<![endif]-->
+<title>MameUI File Menu</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Author>john4</o:Author>
+ <o:LastAuthor>john4</o:LastAuthor>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>2</o:TotalTime>
+ <o:Created>2008-04-11T22:37:00Z</o:Created>
+ <o:LastSaved>2008-04-11T22:39:00Z</o:LastSaved>
+ <o:Pages>1</o:Pages>
+ <o:Words>438</o:Words>
+ <o:Characters>2503</o:Characters>
+ <o:Lines>20</o:Lines>
+ <o:Paragraphs>5</o:Paragraphs>
+ <o:CharactersWithSpaces>2936</o:CharactersWithSpaces>
+ <o:Version>12.00</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]-->
+<link rel=themeData href="mameui_filemenu_files/themedata.thmx">
+<link rel=colorSchemeMapping href="mameui_filemenu_files/colorschememapping.xml">
+<!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackMoves>false</w:TrackMoves>
+ <w:TrackFormatting/>
+ <w:ValidateAgainstSchemas/>
+ <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+ <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+ <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+ <w:DoNotPromoteQF/>
+ <w:LidThemeOther>EN-US</w:LidThemeOther>
+ <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
+ <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
+ <w:Compatibility>
+ <w:BreakWrappedTables/>
+ <w:SnapToGridInCell/>
+ <w:WrapTextWithPunct/>
+ <w:UseAsianBreakRules/>
+ <w:DontGrowAutofit/>
+ <w:SplitPgBreakAndParaMark/>
+ <w:DontVertAlignCellWithSp/>
+ <w:DontBreakConstrainedForcedTables/>
+ <w:DontVertAlignInTxbx/>
+ <w:Word11KerningPairs/>
+ <w:CachedColBalance/>
+ </w:Compatibility>
+ <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+ <m:mathPr>
+ <m:mathFont m:val="Cambria Math"/>
+ <m:brkBin m:val="before"/>
+ <m:brkBinSub m:val="&#45;-"/>
+ <m:smallFrac m:val="off"/>
+ <m:dispDef/>
+ <m:lMargin m:val="0"/>
+ <m:rMargin m:val="0"/>
+ <m:defJc m:val="centerGroup"/>
+ <m:wrapIndent m:val="1440"/>
+ <m:intLim m:val="subSup"/>
+ <m:naryLim m:val="undOvr"/>
+ </m:mathPr></w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
+ DefSemiHidden="true" DefQFormat="false" DefPriority="99"
+ LatentStyleCount="267">
+ <w:LsdException Locked="false" Priority="0" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
+ <w:LsdException Locked="false" Priority="9" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
+ <w:LsdException Locked="false" Priority="9" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="heading 2"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
+ <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
+ <w:LsdException Locked="false" Priority="10" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Title"/>
+ <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
+ <w:LsdException Locked="false" Priority="11" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
+ <w:LsdException Locked="false" Priority="22" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
+ <w:LsdException Locked="false" Priority="20" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
+ <w:LsdException Locked="false" Priority="59" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Table Grid"/>
+ <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
+ <w:LsdException Locked="false" Priority="1" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 1"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
+ <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
+ <w:LsdException Locked="false" Priority="34" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
+ <w:LsdException Locked="false" Priority="29" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
+ <w:LsdException Locked="false" Priority="30" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 1"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 2"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 2"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 3"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 3"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 4"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 4"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 5"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 5"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 6"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 6"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
+ <w:LsdException Locked="false" Priority="19" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
+ <w:LsdException Locked="false" Priority="21" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
+ <w:LsdException Locked="false" Priority="31" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
+ <w:LsdException Locked="false" Priority="32" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
+ <w:LsdException Locked="false" Priority="33" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
+ <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
+ <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
+ </w:LatentStyles>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;
+ mso-font-charset:1;
+ mso-generic-font-family:roman;
+ mso-font-format:other;
+ mso-font-pitch:variable;
+ mso-font-signature:0 0 0 0 0 0;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:-520082689 -1073717157 41 0 66047 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;}
+h1
+ {mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-link:"Heading 1 Char";
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:1;
+ font-size:16.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;
+ font-weight:bold;}
+h2
+ {mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-link:"Heading 2 Char";
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:2;
+ font-size:14.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;
+ font-weight:bold;
+ font-style:italic;}
+p
+ {mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-margin-top-alt:auto;
+ margin-right:0in;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:black;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-link:"Balloon Text Char";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Heading 1";
+ mso-ansi-font-size:14.0pt;
+ mso-bidi-font-size:14.0pt;
+ font-family:"Cambria","serif";
+ mso-ascii-font-family:Cambria;
+ mso-ascii-theme-font:major-latin;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:major-fareast;
+ mso-hansi-font-family:Cambria;
+ mso-hansi-theme-font:major-latin;
+ mso-bidi-font-family:"Times New Roman";
+ mso-bidi-theme-font:major-bidi;
+ color:#365F91;
+ mso-themecolor:accent1;
+ mso-themeshade:191;
+ font-weight:bold;}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-noshow:yes;
+ mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Heading 2";
+ mso-ansi-font-size:13.0pt;
+ mso-bidi-font-size:13.0pt;
+ font-family:"Cambria","serif";
+ mso-ascii-font-family:Cambria;
+ mso-ascii-theme-font:major-latin;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:major-fareast;
+ mso-hansi-font-family:Cambria;
+ mso-hansi-theme-font:major-latin;
+ mso-bidi-font-family:"Times New Roman";
+ mso-bidi-theme-font:major-bidi;
+ color:#4F81BD;
+ mso-themecolor:accent1;
+ font-weight:bold;}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Balloon Text";
+ mso-ansi-font-size:8.0pt;
+ mso-bidi-font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";
+ mso-ascii-font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ mso-hansi-font-family:Tahoma;
+ mso-bidi-font-family:Tahoma;}
+.MsoChpDefault
+ {mso-style-type:export-only;
+ mso-default-props:yes;
+ font-size:10.0pt;
+ mso-ansi-font-size:10.0pt;
+ mso-bidi-font-size:10.0pt;}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.0in 1.0in 1.0in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+ {mso-style-name:"Table Normal";
+ mso-tstyle-rowband-size:0;
+ mso-tstyle-colband-size:0;
+ mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-qformat:yes;
+ mso-style-parent:"";
+ mso-padding-alt:0in 5.4pt 0in 5.4pt;
+ mso-para-margin:0in;
+ mso-para-margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="2050"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+ <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+</head>
+
+<body bgcolor=white background="../images/bkground.gif" lang=EN-US link=blue
+vlink=purple style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<h2><span style='mso-fareast-font-family:"Times New Roman"'>File Menu<o:p></o:p></span></h2>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1035" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Play Game</b> : Selecting this option from the file menu will launch
+the highlighted game.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1034" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Play and Record Input</b> : Selecting this option from the file menu
+will allow for the creation of an *.inp file which will allow MameUI to record
+keystrokes in the game being played for playback later.&nbsp; Similar to a VCR.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1033" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Playback Input</b> : Selecting this option from the file menu will
+allow the loading and playing of a previously recorded *.inp file.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1032" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Play and Record Wave Output</b> : Selecting this option from the file
+menu will allow the recording of a sound file while playing a game.&nbsp; The
+*.wav file is placed in the \inp directory by default.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1031" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Play and Record MNG Output</b> : Selecting this option from the file
+menu will allow the recording of a MNG video file while playing a game.&nbsp;
+The *.mng file is placed in the \inp directory by default.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1030" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Load Savestate</b> : Selecting this option from the file menu will
+allow the loading and playing of a previously saved machine state, the state
+being loaded must match the highlighted game.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1029" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Select Random Game</b> : Selecting this option from the file menu
+will cause MameUI to randomly highlight a game in the game list shortcut key is
+<b>Ctrl-R</b>.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1028" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><a href="mameui_properties.htm">Properties</a></b> : Selecting this
+option from the file menu will display the highlighted game’s individual
+settings, these settings over-ride those made to all games in the Options •
+Default Options menu item.&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img border=0 width=11 height=11
+id="_x0000_i1027" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Audit All Games</b> : Selecting this option from the file menu will
+initiate an exhaustive check on the available games, verifying them to MameUI’s
+expected results.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img border=0 width=11 height=11
+id="_x0000_i1026" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Exit</b> : Selecting this option from the file menu will exit the
+program.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-10 01:41 AM -0800<!--webbot bot="Timestamp" endspan i-checksum="37617" --><span
+style='font-size:7.5pt'>/ john iv</span></p>
+
+</div>
+
+</body>
+
+</html>
diff --git a/docs/release/src/osd/winui/help/html/mameui_help.htm b/docs/release/src/osd/winui/help/html/mameui_help.htm
new file mode 100644
index 00000000000..303f409014e
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_help.htm
@@ -0,0 +1,86 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI Help Menu</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+</head>
+
+<body background="../images/bkground.gif">
+
+<h2>Help Menu</h2>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Help Topics</b> :&nbsp; Selecting this option from the help menu
+will launch the MameUI help file.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Troubleshooting</b> :&nbsp; Selecting this option from the help menu
+will display the troubleshooting topic in the help file.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>New Game Changes</b> :&nbsp; Selecting this option from the help menu
+will display added, removed, changed games.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>
+<span style="font-style:normal; font-variant:normal; font-weight:700">Mame </span>
+<span style="font-weight: 700">Whatsnew.txt</span> :&nbsp; Selecting this option from the help menu
+will display the baseline Mame whatsnew.txt file which contains information
+about source changes, games added, driver improvements, etc.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>About </b>: Selecting this option from the help menu will
+display information about the version of
+MameUI and its contributors.</p>
+
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">&nbsp;</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-10 01:41 AM -0800<!--webbot bot="Timestamp" endspan i-checksum="37617" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_installprocedures.htm b/docs/release/src/osd/winui/help/html/mameui_installprocedures.htm
new file mode 100644
index 00000000000..9fd78ce0494
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_installprocedures.htm
@@ -0,0 +1,176 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI Installation Procedures</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+<base target="_blank">
+</head>
+
+<body background="../images/bkground.gif">
+
+<h2>Install Procedures</h2>
+
+<h3><font face="Arial">To Install MameUI Manually</font></h3>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>
+<span style="font-style: normal; font-variant: normal; font-weight: normal; color:windowtext">
+Download the latest MameUI binary distribution [not the source] self-extracting archive
+available at
+</span>
+<span style="font-style: normal; font-variant: normal; font-weight: 700; color:windowtext">
+<a target="_blank" href="http://mameui.info/">MameUI</a></span><span style="font-style: normal; font-variant: normal; font-weight: normal; color:windowtext">.</span></p>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>Double-click the self-extracting archive .exe, and point the
+directory install location to the root of the c:\ drive, or just type in the box
+&quot;c:\&quot; [no quotes].&nbsp; This will create
+a c:\MameUI directory with the program and all its support files within it.</p>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>MameUI requires ROMs to play games; if attempting to play a game
+the ROMs of which are not present it will fail and list the files missing.&nbsp; Download the freely available public domain ROMs
+[Robby Roto, Gridlee, Alien Arena, and others] from <b>
+<a style="color: blue; text-decoration: underline; text-underline: single" target="_blank" href="http://www.mamedev.org/roms/">Mamedev.org</a></b>.&nbsp; Place these files
+<i><b>still zipped</b></i>, into the
+\MameUI\ROMs folder.&nbsp; <b>Again, do not unzip them</b>.</p>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>Double-click the MameUI icon to launch the program.&nbsp; MameUI
+will go through its initial diagnostics and search for available games in the
+c:\MameUI\ROMs directory, and then display the GUI.&nbsp; If the games do not
+appear on the available game list, hit F5 to force a game search or do a File
+menu / Audit.</p>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>To activate mouse control or attached gamepads to use within
+games, it is necessary to toggle those options on in the Options • Default
+Options • Controllers tab.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>Once a game has been selected and double-clicked, MameUI will
+produce two information screens and then it will run the game.&nbsp; Since
+MameUI is
+emulating the original hardware, the software thinks it’s still in an arcade and
+is starting up for the first time in the morning.&nbsp; Initial diagnostic screens
+are run through, as well as possibly some accounting information presented to
+the arcade owner.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>The game should now be running its demo/attract mode.&nbsp; Insert a
+coin with the [<b>5</b>] key on the keyboard, the mappings for coin inserts are:
+player 1 [<b>5</b>], player 2 [<b>6</b>], player 3 [<b>7</b>], player 4 [<b>8</b>].&nbsp;
+Now that a coin has been inserted, start the game with the [<b>1</b>] key on the
+keyboard.&nbsp; Game start mappings are player 1 [<b>1</b>], player 2 [<b>2</b>],
+player 3 [<b>3</b>], player 4 [<b>4</b>].</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>MameUI’s default control scheme is to use the inverted T arrow
+keys on the keyboard for directional controls, and the left [<b>CTRL</b>] key as the
+primary action button.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>While in a game within MameUI, the internal configuration menu
+system can be activated by pressing the [<b>TAB</b>] key.&nbsp; This will bring up
+the control options.&nbsp; These options allow remapping MameUI controls to whatever
+keyboard keys or gamepad buttons are desired.&nbsp; The Input (general) area controls the global settings, and
+the Input (this game) are the controls for the game selected.&nbsp; To change the
+mapping, select the control to change by arrowing down to it, hit the [<b>ENTER</b>]
+key and then the new desired control.&nbsp; Hit the [<b>ESC</b>] key to exit the [<b>TAB</b>]
+menu back to the game. Note: If there are multiple mouse devices attached to the
+system they can be individually configured by selecting their control in the [<strong>TAB</strong>]
+menu and moving the mouse or trackball left or right, up or down to map it.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>Other keys of interest while playing a game are : </p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>TAB</b>] key to bring up the
+internal menu system.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>~ TILDE</b>] the onscreen
+display.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>Shift-p</b>] advance paused
+screen one frame at a time<br>
+[<b>p</b>] for the pause button.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F3</b>] resets the game.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F4</b>] displays the tile
+manager and the game’s
+color palette.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>Shift-F7</b>] save current
+game state [a-z, 1-0] (See save state folder view for supported games)</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F7</b>] load game state [a-z,
+1-0] (See save state folder view on left for supported games)</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F9</b>] changes the frameskip
+on the fly.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F10</b>] toggles throttling.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F11</b>] toggles the speed
+display
+display.<br>
+[<b>Shift-F12</b>] toggles MNG recording, once starts, second finishes.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F12</b>] takes a *.png
+snapshot of the game and places it in the \MameUI\snap directory.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>ESC</b>] exits from the game
+back to the MameUI GUI.</p>
+
+<p class="MsoNormal" style="margin-left:.75in">[<b>Left-Alt + Enter</b>] toggle
+from fullscreen mode to windowed mode.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<strong>Insert</strong>] fast
+forwards with full unthrottle and highest frameskip, convenient for speeding
+through slow start-up of certain games.</p>
+
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+&nbsp;</p>
+
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-12 02:02 PM -0800<!--webbot bot="Timestamp" endspan i-checksum="37539" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_optionsmenu.htm b/docs/release/src/osd/winui/help/html/mameui_optionsmenu.htm
new file mode 100644
index 00000000000..7763fd64d71
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_optionsmenu.htm
@@ -0,0 +1,639 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml"
+xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 12">
+<meta name=Originator content="Microsoft Word 12">
+<link rel=File-List href="mameui_optionsmenu_files/filelist.xml">
+<link rel=Edit-Time-Data href="mameui_optionsmenu_files/editdata.mso">
+<!--[if !mso]>
+<style>
+v\:* {behavior:url(#default#VML);}
+o\:* {behavior:url(#default#VML);}
+w\:* {behavior:url(#default#VML);}
+.shape {behavior:url(#default#VML);}
+</style>
+<![endif]-->
+<title>MameUI Options Menu</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Author>john4</o:Author>
+ <o:LastAuthor>john4</o:LastAuthor>
+ <o:Revision>3</o:Revision>
+ <o:TotalTime>1</o:TotalTime>
+ <o:Created>2008-04-11T22:39:00Z</o:Created>
+ <o:LastSaved>2008-04-11T22:40:00Z</o:LastSaved>
+ <o:Pages>1</o:Pages>
+ <o:Words>592</o:Words>
+ <o:Characters>3375</o:Characters>
+ <o:Lines>28</o:Lines>
+ <o:Paragraphs>7</o:Paragraphs>
+ <o:CharactersWithSpaces>3960</o:CharactersWithSpaces>
+ <o:Version>12.00</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]-->
+<link rel=themeData href="mameui_optionsmenu_files/themedata.thmx">
+<link rel=colorSchemeMapping
+href="mameui_optionsmenu_files/colorschememapping.xml">
+<!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackMoves>false</w:TrackMoves>
+ <w:TrackFormatting/>
+ <w:ValidateAgainstSchemas/>
+ <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+ <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+ <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+ <w:DoNotPromoteQF/>
+ <w:LidThemeOther>EN-US</w:LidThemeOther>
+ <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
+ <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
+ <w:Compatibility>
+ <w:BreakWrappedTables/>
+ <w:SnapToGridInCell/>
+ <w:WrapTextWithPunct/>
+ <w:UseAsianBreakRules/>
+ <w:DontGrowAutofit/>
+ <w:SplitPgBreakAndParaMark/>
+ <w:DontVertAlignCellWithSp/>
+ <w:DontBreakConstrainedForcedTables/>
+ <w:DontVertAlignInTxbx/>
+ <w:Word11KerningPairs/>
+ <w:CachedColBalance/>
+ </w:Compatibility>
+ <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+ <m:mathPr>
+ <m:mathFont m:val="Cambria Math"/>
+ <m:brkBin m:val="before"/>
+ <m:brkBinSub m:val="&#45;-"/>
+ <m:smallFrac m:val="off"/>
+ <m:dispDef/>
+ <m:lMargin m:val="0"/>
+ <m:rMargin m:val="0"/>
+ <m:defJc m:val="centerGroup"/>
+ <m:wrapIndent m:val="1440"/>
+ <m:intLim m:val="subSup"/>
+ <m:naryLim m:val="undOvr"/>
+ </m:mathPr></w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
+ DefSemiHidden="true" DefQFormat="false" DefPriority="99"
+ LatentStyleCount="267">
+ <w:LsdException Locked="false" Priority="0" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
+ <w:LsdException Locked="false" Priority="9" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
+ <w:LsdException Locked="false" Priority="9" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="heading 2"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
+ <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
+ <w:LsdException Locked="false" Priority="10" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Title"/>
+ <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
+ <w:LsdException Locked="false" Priority="11" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
+ <w:LsdException Locked="false" Priority="22" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
+ <w:LsdException Locked="false" Priority="20" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
+ <w:LsdException Locked="false" Priority="59" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Table Grid"/>
+ <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
+ <w:LsdException Locked="false" Priority="1" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 1"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
+ <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
+ <w:LsdException Locked="false" Priority="34" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
+ <w:LsdException Locked="false" Priority="29" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
+ <w:LsdException Locked="false" Priority="30" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 1"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 2"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 2"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 3"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 3"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 4"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 4"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 5"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 5"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 6"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 6"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
+ <w:LsdException Locked="false" Priority="19" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
+ <w:LsdException Locked="false" Priority="21" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
+ <w:LsdException Locked="false" Priority="31" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
+ <w:LsdException Locked="false" Priority="32" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
+ <w:LsdException Locked="false" Priority="33" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
+ <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
+ <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
+ </w:LatentStyles>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;
+ mso-font-charset:1;
+ mso-generic-font-family:roman;
+ mso-font-format:other;
+ mso-font-pitch:variable;
+ mso-font-signature:0 0 0 0 0 0;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:-520082689 -1073717157 41 0 66047 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;}
+h1
+ {mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-link:"Heading 1 Char";
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:1;
+ font-size:16.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;
+ font-weight:bold;}
+h2
+ {mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-link:"Heading 2 Char";
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:2;
+ font-size:14.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;
+ font-weight:bold;
+ font-style:italic;}
+p
+ {mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-margin-top-alt:auto;
+ margin-right:0in;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:black;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-link:"Balloon Text Char";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Heading 1";
+ mso-ansi-font-size:14.0pt;
+ mso-bidi-font-size:14.0pt;
+ font-family:"Cambria","serif";
+ mso-ascii-font-family:Cambria;
+ mso-ascii-theme-font:major-latin;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:major-fareast;
+ mso-hansi-font-family:Cambria;
+ mso-hansi-theme-font:major-latin;
+ mso-bidi-font-family:"Times New Roman";
+ mso-bidi-theme-font:major-bidi;
+ color:#365F91;
+ mso-themecolor:accent1;
+ mso-themeshade:191;
+ font-weight:bold;}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-noshow:yes;
+ mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Heading 2";
+ mso-ansi-font-size:13.0pt;
+ mso-bidi-font-size:13.0pt;
+ font-family:"Cambria","serif";
+ mso-ascii-font-family:Cambria;
+ mso-ascii-theme-font:major-latin;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:major-fareast;
+ mso-hansi-font-family:Cambria;
+ mso-hansi-theme-font:major-latin;
+ mso-bidi-font-family:"Times New Roman";
+ mso-bidi-theme-font:major-bidi;
+ color:#4F81BD;
+ mso-themecolor:accent1;
+ font-weight:bold;}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Balloon Text";
+ mso-ansi-font-size:8.0pt;
+ mso-bidi-font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";
+ mso-ascii-font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ mso-hansi-font-family:Tahoma;
+ mso-bidi-font-family:Tahoma;}
+.MsoChpDefault
+ {mso-style-type:export-only;
+ mso-default-props:yes;
+ font-size:10.0pt;
+ mso-ansi-font-size:10.0pt;
+ mso-bidi-font-size:10.0pt;}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.0in 1.0in 1.0in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+ {mso-style-name:"Table Normal";
+ mso-tstyle-rowband-size:0;
+ mso-tstyle-colband-size:0;
+ mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-qformat:yes;
+ mso-style-parent:"";
+ mso-padding-alt:0in 5.4pt 0in 5.4pt;
+ mso-para-margin:0in;
+ mso-para-margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="2050"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+ <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+</head>
+
+<body bgcolor=white background="../images/bkground.gif" lang=EN-US link=blue
+vlink=purple style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<h2><span style='mso-fareast-font-family:"Times New Roman"'>Options Menu<o:p></o:p></span></h2>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1033" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Game List Font</b> :&nbsp; Selecting this option from the options
+menu will change the font used for the GUI display.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1032" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Game List Clone Color</b> :&nbsp; Selecting this option from the options
+menu will change the font color used for the GUI display of clones in the
+'Grouped' game list view.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1031" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Directories </b>: Selecting this option from the options menu will
+allow for choosing a different directory for a number of MameUI support files
+including: ROMs, samples, config, high scores, snapshots, input files, state,
+artwork, memory card, flyers, cabinets, marquees, and nvram.&nbsp; Normally these
+directories are created under the MameUI executable’s directory.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1030" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><a href="mameui_properties.htm">Default Options</a> </b>: Selecting
+this option from the options menu will allow for the global customization of
+all games in the game list.&nbsp; These settings are overridden by altering the
+individual game settings using the File • Properties menu item.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img border=0 width=11 height=11
+id="_x0000_i1029" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Reset to Default </b>: Selecting this option from the options menu
+will allow for resetting various parts of MameUI to their defaults.&nbsp;
+MameUI will prompt before resetting, giving the option to cancel. </p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img border=0 width=11 height=11
+id="_x0000_i1028" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Interface Options </b>: Selecting this option from the options menu
+will allow: <br>
+Toggling on or off the search for new games on start.<br>
+Toggling on or off the ability to use a game pad to navigate the GUI (see mameui32.ini
+for examples).<br>
+Toggling on or off the ability to use a keyboard encoder solution to navigate
+the GUI and launch games [helpful in Mame cabs] (see mameui32.ini for
+examples).<br>
+Selecting a random image from the \bkground directory on startup.<br>
+Toggling on or off MameUI broadcasting the selected game programmatically to
+other listening applications like message clients, or an LED message bar, <br>
+The cursor to be hidden [helpful in Mame cabs].<br>
+Selecting inheritable filters, this allows parent folders to set the filters
+for their children sub-folders.<br>
+No offset for clones missing parent in view toggle will cause clones not be
+indented if the parent game is not present due to current folder view, missing
+ROMs, or filtering.<br>
+Allow history.dat file to be displayed under any, all, or none of the art
+views.<br>
+Choosing the screenshot [<strong>F12</strong>] naming convention.<br>
+Globally clear the play time and number of times played counters.<br>
+Stretch screenshot to larger size, this will enlarge the items in the art pane
+scaling them upwards depending on the size of the GUI.<br>
+Screenshot border size and color creates a user defined border around the art
+work in the art pane on the right, set to zero to remove borders completely.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'>
+
+<p class=MsoNormal><span style='mso-no-proof:yes'><img border=0 width=500
+height=347 id="_x0000_i1027" src="../images/int.jpg"></span></p>
+
+</blockquote>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img border=0 width=11 height=11
+id="_x0000_i1026" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b>Background Image </b>: Selecting this option from the options menu
+allows the choosing of a background image from the \bkground directory.&nbsp;
+This image will be displayed beneath the three window panes in the GUI. </p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2008-07-16 12:04 AM -0700<!--webbot bot="Timestamp" endspan i-checksum="38077" --><span
+style='font-size:7.5pt'>/ john iv</span></p>
+
+</div>
+
+</body>
+
+</html>
diff --git a/docs/release/src/osd/winui/help/html/mameui_overview.htm b/docs/release/src/osd/winui/help/html/mameui_overview.htm
new file mode 100644
index 00000000000..15ff74c884c
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_overview.htm
@@ -0,0 +1,529 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml"
+xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 12">
+<meta name=Originator content="Microsoft Word 12">
+<link rel=File-List href="mameui_overview_files/filelist.xml">
+<link rel=Edit-Time-Data href="mameui_overview_files/editdata.mso">
+<!--[if !mso]>
+<style>
+v\:* {behavior:url(#default#VML);}
+o\:* {behavior:url(#default#VML);}
+w\:* {behavior:url(#default#VML);}
+.shape {behavior:url(#default#VML);}
+</style>
+<![endif]-->
+<title>MameUI Overview &amp; History</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Author>john4</o:Author>
+ <o:LastAuthor>john4</o:LastAuthor>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>1</o:TotalTime>
+ <o:Created>2008-04-11T22:44:00Z</o:Created>
+ <o:LastSaved>2008-04-11T22:45:00Z</o:LastSaved>
+ <o:Pages>1</o:Pages>
+ <o:Words>413</o:Words>
+ <o:Characters>2358</o:Characters>
+ <o:Lines>19</o:Lines>
+ <o:Paragraphs>5</o:Paragraphs>
+ <o:CharactersWithSpaces>2766</o:CharactersWithSpaces>
+ <o:Version>12.00</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]-->
+<link rel=themeData href="mameui_overview_files/themedata.thmx">
+<link rel=colorSchemeMapping href="mameui_overview_files/colorschememapping.xml">
+<!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:SpellingState>Clean</w:SpellingState>
+ <w:TrackMoves>false</w:TrackMoves>
+ <w:TrackFormatting/>
+ <w:ValidateAgainstSchemas/>
+ <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+ <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+ <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+ <w:DoNotPromoteQF/>
+ <w:LidThemeOther>EN-US</w:LidThemeOther>
+ <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
+ <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
+ <w:Compatibility>
+ <w:BreakWrappedTables/>
+ <w:SnapToGridInCell/>
+ <w:WrapTextWithPunct/>
+ <w:UseAsianBreakRules/>
+ <w:DontGrowAutofit/>
+ <w:SplitPgBreakAndParaMark/>
+ <w:DontVertAlignCellWithSp/>
+ <w:DontBreakConstrainedForcedTables/>
+ <w:DontVertAlignInTxbx/>
+ <w:Word11KerningPairs/>
+ <w:CachedColBalance/>
+ </w:Compatibility>
+ <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+ <m:mathPr>
+ <m:mathFont m:val="Cambria Math"/>
+ <m:brkBin m:val="before"/>
+ <m:brkBinSub m:val="&#45;-"/>
+ <m:smallFrac m:val="off"/>
+ <m:dispDef/>
+ <m:lMargin m:val="0"/>
+ <m:rMargin m:val="0"/>
+ <m:defJc m:val="centerGroup"/>
+ <m:wrapIndent m:val="1440"/>
+ <m:intLim m:val="subSup"/>
+ <m:naryLim m:val="undOvr"/>
+ </m:mathPr></w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
+ DefSemiHidden="true" DefQFormat="false" DefPriority="99"
+ LatentStyleCount="267">
+ <w:LsdException Locked="false" Priority="0" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
+ <w:LsdException Locked="false" Priority="9" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
+ <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
+ <w:LsdException Locked="false" Priority="10" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Title"/>
+ <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
+ <w:LsdException Locked="false" Priority="11" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
+ <w:LsdException Locked="false" Priority="22" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
+ <w:LsdException Locked="false" Priority="20" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
+ <w:LsdException Locked="false" Priority="59" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Table Grid"/>
+ <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
+ <w:LsdException Locked="false" Priority="1" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 1"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
+ <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
+ <w:LsdException Locked="false" Priority="34" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
+ <w:LsdException Locked="false" Priority="29" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
+ <w:LsdException Locked="false" Priority="30" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 1"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 2"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 2"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 3"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 3"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 4"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 4"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 5"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 5"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 6"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 6"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
+ <w:LsdException Locked="false" Priority="19" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
+ <w:LsdException Locked="false" Priority="21" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
+ <w:LsdException Locked="false" Priority="31" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
+ <w:LsdException Locked="false" Priority="32" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
+ <w:LsdException Locked="false" Priority="33" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
+ <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
+ <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
+ </w:LatentStyles>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;
+ mso-font-charset:1;
+ mso-generic-font-family:roman;
+ mso-font-format:other;
+ mso-font-pitch:variable;
+ mso-font-signature:0 0 0 0 0 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman","serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;}
+h1
+ {mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-link:"Heading 1 Char";
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:1;
+ font-size:16.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;
+ font-weight:bold;}
+p
+ {mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-margin-top-alt:auto;
+ margin-right:0in;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:black;}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Heading 1";
+ mso-ansi-font-size:14.0pt;
+ mso-bidi-font-size:14.0pt;
+ font-family:"Cambria","serif";
+ mso-ascii-font-family:Cambria;
+ mso-ascii-theme-font:major-latin;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:major-fareast;
+ mso-hansi-font-family:Cambria;
+ mso-hansi-theme-font:major-latin;
+ mso-bidi-font-family:"Times New Roman";
+ mso-bidi-theme-font:major-bidi;
+ color:#365F91;
+ mso-themecolor:accent1;
+ mso-themeshade:191;
+ font-weight:bold;}
+.MsoChpDefault
+ {mso-style-type:export-only;
+ mso-default-props:yes;
+ font-size:10.0pt;
+ mso-ansi-font-size:10.0pt;
+ mso-bidi-font-size:10.0pt;}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.0in 1.0in 1.0in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+ {mso-style-name:"Table Normal";
+ mso-tstyle-rowband-size:0;
+ mso-tstyle-colband-size:0;
+ mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-qformat:yes;
+ mso-style-parent:"";
+ mso-padding-alt:0in 5.4pt 0in 5.4pt;
+ mso-para-margin:0in;
+ mso-para-margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="2050"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+ <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+</head>
+
+<body bgcolor=white background="../images/bkground.gif" lang=EN-US link=blue
+vlink=purple style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<h1><span style='mso-fareast-font-family:"Times New Roman"'>MameUI Overview
+&amp; History<o:p></o:p></span></h1>
+
+<p style='margin-top:0in;margin-right:0in;margin-bottom:3.75pt;margin-left:
+0in'>MameUI [previously Mame32] is an emulator.&nbsp; Simply put, it allows a
+PC to mimic the internal hardware of a large number of stand-alone arcade
+machines from 1975 to 2003+.&nbsp; Combined with the original ROMs from these
+arcade machines, MameUI will display and play the games on a PC.&nbsp; The
+software thinks it’s still running on its original box.&nbsp; MameUI is the GUI
+version of Mame™, the M.ultiple A.rcade M.achine E.mulator.&nbsp; It has an
+attractive, elegant, graphical interface which allows the user to forego having
+to type command line parameters, although it can still be passed these
+arguments.&nbsp; For many, it’s easier to click the icon of the game.</p>
+
+<p style='margin-top:0in;margin-right:0in;margin-bottom:3.75pt;margin-left:
+0in'><b>1997.02.05</b> - In the beginning, Italian programmer and arcade
+preservationist, Nicola Salmoria, combined his individual game emulators into
+the DOS based multi-game emulator, Mame.&nbsp; It was released Feb. 05,
+1997.&nbsp; Since the source was also released, numerous people contributed new
+drivers to add support for more and more games.&nbsp; The number of contributors
+grew into the hundreds and has continued to increase over the years.</p>
+
+<p style='margin-top:0in;margin-right:0in;margin-bottom:3.75pt;margin-left:
+0in'><b>1997.08</b> - Mame32 was the first port of Mame to the Microsoft
+Windows platform.&nbsp; It originally came out in August of 1997, adding the
+GUI and a considerable amount of new code to transition to Win32.&nbsp; The
+original Mame32 was authored by Chris Kirmse and later integrated Michael
+Soderstrom's Win32 command-line port of Mame.&nbsp; Michael then coordinated,
+maintained the source, and produced the releases.&nbsp; Mike Haaland and John
+Hardy IV joined the project in late 1997.&nbsp; Mike would wholly revamp the
+user interface to its current state and continue collaborating on core
+development. John provided testing, WIP updates, artwork, and served as the
+external point of contact for the team.&nbsp; Mame32 releases followed the Mame
+DOS releases by a few days to a few weeks over the next four years.</p>
+
+<p style='margin-top:0in;margin-right:0in;margin-bottom:3.75pt;margin-left:
+0in'><b>2001.05.24</b> - With the inexorable phasing out of DOS, the authors of
+the DOS based Mame ported it to the Microsoft Windows platform as a command
+line application.&nbsp; Evolutionally similar to MameDOS, it is run by typing
+in arguments from a command prompt, and has no GUI. [many people try to double
+click it, which opens up the command line window briefly, displays a message,
+then closes].&nbsp;</p>
+
+<p style='margin-top:0in;margin-right:0in;margin-bottom:3.75pt;margin-left:
+0in'><b>2001.07.24</b> - Mame32 was re-positioned, with the familiar GUI
+grafted onto the new Mame Windows engine.&nbsp; Mame32 is currently maintained
+by Kirmse, Haaland, and Hardy and is now released by John IV shortly after Mame
+on the <b><a href="http://mameui.info/" target="_blank">MameUI</a></b>
+site.</p>
+
+<p style='margin-top:0in;margin-right:0in;margin-bottom:3.75pt;margin-left:
+0in'><strong><span style='font-family:"Arial","sans-serif"'>2007.11.11</span></strong>
+- Mame32 was rebranded as MameUI to avoid confusion of the 64bit build of the
+core version.&nbsp; It is compiled as MameUI32 and MameUI64 for the different
+target platforms.</p>
+
+<p style='margin-top:0in;margin-right:0in;margin-bottom:3.75pt;margin-left:
+0in'>&nbsp;</p>
+
+<p style='margin-top:0in;margin-right:0in;margin-bottom:3.75pt;margin-left:
+0in'><!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-12 01:57 PM -0800<!--webbot bot="Timestamp" endspan i-checksum="38483" --><span
+style='font-size:7.5pt'>/ john iv</span></p>
+
+</div>
+
+</body>
+
+</html>
diff --git a/docs/release/src/osd/winui/help/html/mameui_playing.htm b/docs/release/src/osd/winui/help/html/mameui_playing.htm
new file mode 100644
index 00000000000..8444676b99b
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_playing.htm
@@ -0,0 +1,136 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI Playing a Game &amp; Internal Controls</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+</head>
+
+<body background="../images/bkground.gif">
+
+<h2>Playing a Game &amp; Internal Controls</h2>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>To activate mouse control or attached gamepads to use within
+games, it is necessary to toggle those options on in the Options • Default
+Options • Controllers tab.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>Once a game has been selected and double-clicked, MameUI will
+produce two information screens and then it will run the game.&nbsp; Since
+MameUI is
+emulating the original hardware, the software thinks it’s still in an arcade and
+is starting up for the first time in the morning.&nbsp; Initial diagnostic screens
+are run through, as well as possibly some accounting information presented to
+the arcade owner.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>The game should now be running its demo/attract mode.&nbsp; Insert a
+coin with the [<b>5</b>] key on the keyboard, the mappings for coin inserts are:
+player 1 [<b>5</b>], player 2 [<b>6</b>], player 3 [<b>7</b>], player 4 [<b>8</b>].&nbsp;
+Now that a coin has been inserted, start the game with the [<b>1</b>] key on the
+keyboard.&nbsp; Game start mappings are player 1 [<b>1</b>], player 2 [<b>2</b>],
+player 3 [<b>3</b>], player 4 [<b>4</b>].</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>MameUI’s default control scheme is to use the inverted T arrow
+keys on the keyboard for directional controls, and the left [<b>CTRL</b>] key as the
+primary action button.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>While in a game within MameUI, the internal configuration menu
+system can be activated by pressing the [<b>TAB</b>] key.&nbsp; This will bring up
+the control options.&nbsp; These options allow remapping MameUI controls to whatever
+keyboard keys or gamepad buttons are desired.&nbsp; The Input (general) area controls the global settings, and
+the Input (this game) are the controls for the game selected.&nbsp; To change the
+mapping, select the control to change by arrowing down to it, hit the [<b>ENTER</b>]
+key and then the new desired control.&nbsp; Hit the [<b>ESC</b>] key to exit the [<b>TAB</b>]
+menu back to the game. Note: If there are multiple mouse devices attached to the
+system they can be individually configured by selecting their control in the [<strong>TAB</strong>]
+menu and moving the mouse or trackball left or right, up or down to map it.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>Other keys of interest while playing a game are : </p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>TAB</b>] key to bring up the
+internal menu system.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>~ TILDE</b>] the onscreen
+display.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>Shift-p</b>] advance paused
+screen one frame at a time<br>
+[<b>p</b>] for the pause button.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F3</b>] resets the game.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F4</b>] displays the tile
+manager and the game’s
+color palette.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>Shift-F7</b>] save current
+game state [a-z, 1-0] (See save state folder view for supported games)</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F7</b>] load game state [a-z,
+1-0] (See save state folder view on left for supported games)</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F9</b>] changes the frameskip
+on the fly.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F10</b>] toggles throttling.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F11</b>] toggles the speed
+display
+display.<br>
+[<b>Shift-F12</b>] toggles MNG recording, once starts, second finishes.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>F12</b>] takes a *.png
+snapshot of the game and places it in the \MameUI\snap directory.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<b>ESC</b>] exits from the game
+back to the MameUI GUI.</p>
+
+<p class="MsoNormal" style="margin-left:.75in">[<b>Left-Alt + Enter</b>] toggle
+from fullscreen mode to windowed mode.</p>
+<p class="MsoNormal" style="margin-left:.75in">[<strong>Insert</strong>] fast
+forwards with full unthrottle and highest frameskip, convenient for speeding
+through slow start-up of certain games.</p>
+
+<p class="MsoNormal" style="margin-left: .75in">&nbsp;</p>
+<p class="MsoNormal" style="margin-left: .75in"><font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-10 01:41 AM -0800<!--webbot bot="Timestamp" endspan i-checksum="37617" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_properties.htm b/docs/release/src/osd/winui/help/html/mameui_properties.htm
new file mode 100644
index 00000000000..7601b7e5b05
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_properties.htm
@@ -0,0 +1,1034 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml"
+xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 12">
+<meta name=Originator content="Microsoft Word 12">
+<link rel=File-List href="mameui_properties_files/filelist.xml">
+<link rel=Edit-Time-Data href="mameui_properties_files/editdata.mso">
+<!--[if !mso]>
+<style>
+v\:* {behavior:url(#default#VML);}
+o\:* {behavior:url(#default#VML);}
+w\:* {behavior:url(#default#VML);}
+.shape {behavior:url(#default#VML);}
+</style>
+<![endif]-->
+<title>MameUI Properties</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Author>john4</o:Author>
+ <o:LastAuthor>john4</o:LastAuthor>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2008-04-11T22:41:00Z</o:Created>
+ <o:LastSaved>2008-04-11T22:44:00Z</o:LastSaved>
+ <o:Pages>2</o:Pages>
+ <o:Words>3044</o:Words>
+ <o:Characters>17351</o:Characters>
+ <o:Lines>144</o:Lines>
+ <o:Paragraphs>40</o:Paragraphs>
+ <o:CharactersWithSpaces>20355</o:CharactersWithSpaces>
+ <o:Version>12.00</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]-->
+<link rel=themeData href="mameui_properties_files/themedata.thmx">
+<link rel=colorSchemeMapping
+href="mameui_properties_files/colorschememapping.xml">
+<!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackMoves>false</w:TrackMoves>
+ <w:TrackFormatting/>
+ <w:ValidateAgainstSchemas/>
+ <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+ <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+ <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+ <w:DoNotPromoteQF/>
+ <w:LidThemeOther>EN-US</w:LidThemeOther>
+ <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
+ <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
+ <w:Compatibility>
+ <w:BreakWrappedTables/>
+ <w:SnapToGridInCell/>
+ <w:WrapTextWithPunct/>
+ <w:UseAsianBreakRules/>
+ <w:DontGrowAutofit/>
+ <w:SplitPgBreakAndParaMark/>
+ <w:DontVertAlignCellWithSp/>
+ <w:DontBreakConstrainedForcedTables/>
+ <w:DontVertAlignInTxbx/>
+ <w:Word11KerningPairs/>
+ <w:CachedColBalance/>
+ </w:Compatibility>
+ <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+ <m:mathPr>
+ <m:mathFont m:val="Cambria Math"/>
+ <m:brkBin m:val="before"/>
+ <m:brkBinSub m:val="&#45;-"/>
+ <m:smallFrac m:val="off"/>
+ <m:dispDef/>
+ <m:lMargin m:val="0"/>
+ <m:rMargin m:val="0"/>
+ <m:defJc m:val="centerGroup"/>
+ <m:wrapIndent m:val="1440"/>
+ <m:intLim m:val="subSup"/>
+ <m:naryLim m:val="undOvr"/>
+ </m:mathPr></w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
+ DefSemiHidden="true" DefQFormat="false" DefPriority="99"
+ LatentStyleCount="267">
+ <w:LsdException Locked="false" Priority="0" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
+ <w:LsdException Locked="false" Priority="9" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
+ <w:LsdException Locked="false" Priority="9" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="heading 2"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
+ <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
+ <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
+ <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
+ <w:LsdException Locked="false" Priority="10" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Title"/>
+ <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
+ <w:LsdException Locked="false" Priority="11" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
+ <w:LsdException Locked="false" Priority="22" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
+ <w:LsdException Locked="false" Priority="20" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
+ <w:LsdException Locked="false" Priority="59" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Table Grid"/>
+ <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
+ <w:LsdException Locked="false" Priority="1" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 1"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
+ <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
+ <w:LsdException Locked="false" Priority="34" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
+ <w:LsdException Locked="false" Priority="29" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
+ <w:LsdException Locked="false" Priority="30" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 1"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 2"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 2"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 3"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 3"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 4"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 4"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 5"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 5"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
+ <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
+ <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light List Accent 6"/>
+ <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
+ <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
+ <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
+ <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
+ <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Dark List Accent 6"/>
+ <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
+ <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
+ <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+ UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
+ <w:LsdException Locked="false" Priority="19" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
+ <w:LsdException Locked="false" Priority="21" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
+ <w:LsdException Locked="false" Priority="31" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
+ <w:LsdException Locked="false" Priority="32" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
+ <w:LsdException Locked="false" Priority="33" SemiHidden="false"
+ UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
+ <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
+ <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
+ </w:LatentStyles>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:"Cambria Math";
+ panose-1:2 4 5 3 5 4 6 3 2 4;
+ mso-font-charset:1;
+ mso-generic-font-family:roman;
+ mso-font-format:other;
+ mso-font-pitch:variable;
+ mso-font-signature:0 0 0 0 0 0;}
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:-520082689 -1073717157 41 0 66047 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;}
+h1
+ {mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-link:"Heading 1 Char";
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:1;
+ font-size:16.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;
+ font-weight:bold;}
+h2
+ {mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-qformat:yes;
+ mso-style-link:"Heading 2 Char";
+ margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:2;
+ font-size:14.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;
+ font-weight:bold;
+ font-style:italic;}
+a:link, span.MsoHyperlink
+ {mso-style-priority:99;
+ color:blue;
+ text-decoration:underline;
+ text-underline:single;}
+p
+ {mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-margin-top-alt:auto;
+ margin-right:0in;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Arial","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:black;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-link:"Balloon Text Char";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ color:windowtext;}
+span.Heading1Char
+ {mso-style-name:"Heading 1 Char";
+ mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Heading 1";
+ mso-ansi-font-size:14.0pt;
+ mso-bidi-font-size:14.0pt;
+ font-family:"Cambria","serif";
+ mso-ascii-font-family:Cambria;
+ mso-ascii-theme-font:major-latin;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:major-fareast;
+ mso-hansi-font-family:Cambria;
+ mso-hansi-theme-font:major-latin;
+ mso-bidi-font-family:"Times New Roman";
+ mso-bidi-theme-font:major-bidi;
+ color:#365F91;
+ mso-themecolor:accent1;
+ mso-themeshade:191;
+ font-weight:bold;}
+span.Heading2Char
+ {mso-style-name:"Heading 2 Char";
+ mso-style-noshow:yes;
+ mso-style-priority:9;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Heading 2";
+ mso-ansi-font-size:13.0pt;
+ mso-bidi-font-size:13.0pt;
+ font-family:"Cambria","serif";
+ mso-ascii-font-family:Cambria;
+ mso-ascii-theme-font:major-latin;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:major-fareast;
+ mso-hansi-font-family:Cambria;
+ mso-hansi-theme-font:major-latin;
+ mso-bidi-font-family:"Times New Roman";
+ mso-bidi-theme-font:major-bidi;
+ color:#4F81BD;
+ mso-themecolor:accent1;
+ font-weight:bold;}
+span.BalloonTextChar
+ {mso-style-name:"Balloon Text Char";
+ mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-unhide:no;
+ mso-style-locked:yes;
+ mso-style-link:"Balloon Text";
+ mso-ansi-font-size:8.0pt;
+ mso-bidi-font-size:8.0pt;
+ font-family:"Tahoma","sans-serif";
+ mso-ascii-font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";
+ mso-fareast-theme-font:minor-fareast;
+ mso-hansi-font-family:Tahoma;
+ mso-bidi-font-family:Tahoma;}
+.MsoChpDefault
+ {mso-style-type:export-only;
+ mso-default-props:yes;
+ font-size:10.0pt;
+ mso-ansi-font-size:10.0pt;
+ mso-bidi-font-size:10.0pt;}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.0in 1.0in 1.0in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+ {mso-style-name:"Table Normal";
+ mso-tstyle-rowband-size:0;
+ mso-tstyle-colband-size:0;
+ mso-style-noshow:yes;
+ mso-style-priority:99;
+ mso-style-qformat:yes;
+ mso-style-parent:"";
+ mso-padding-alt:0in 5.4pt 0in 5.4pt;
+ mso-para-margin:0in;
+ mso-para-margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Times New Roman","serif";}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="2050"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+ <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+</head>
+
+<body bgcolor=white background="../images/bkground.gif" lang=EN-US link=blue
+vlink=purple style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<h2><span style='mso-fareast-font-family:"Times New Roman"'>Default Options
+&amp; Game Properties<o:p></o:p></span></h2>
+
+<p class=MsoNormal>The default options and game properties tabs of MameUI are
+used to set the vast majority of game play parameters.&nbsp; The Game
+Properties dialogue box, accessible from the File • Properties menu item,
+shares all the tabs of the Default Options dialogue box, accessible from the
+Options • Default Options menu item.&nbsp; The Game Properties dialogue
+contains two additional tabs which give information on the game selected, and
+its current audited state.</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1043" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>General Tab</span></b> : [only available
+in Game Properties dialogue] This tab provides information on the game
+selected, this information includes manufacturer name and date, driver status,
+original CPU, original sound hardware, original screen resolution and
+orientation, and number of colors.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1042" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Audit Tab</span></b> : [only available in
+the Game Properties dialogue] This tab performs a ‘mini-audit’ on the game
+selected, determining its status compared to what MameUI expects.&nbsp; Status
+will be reported and missing files with CRC information will appear in the
+details view.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1041" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Display Tab</span></b> : This tab allows
+the setting of numerous video options.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Run in a window</b> : MameUI
+will launch the game selected in a window on the desktop, the window can be
+resized by pausing the emulation and dragging the borders.&nbsp; The resolution
+of the window can also be set in the Screen tab.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Start out maximized </b>:
+Toggling this option on ensures that when windowed mode is used, the maximum
+amount of space is used.&nbsp; Toggle this option off to play the smallest
+version of the windowed game.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Enforce aspect ratio </b>: This
+option is used in conjunction with windowed mode, it forces the aspect ratio to
+be maintained when the game is paused and the window is dragged and
+resized.&nbsp; Turn this off to create long, thin game windows, or short fat,
+etc.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Throttle </b>: This option
+prevents MameUI from running games as fast as the host CPU can go.&nbsp; Unless
+this is toggled on, a modern x86 processor will run Donkey Kong at a thousand
+times its original speed.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Rotation </b>: This drop down
+box allows MameUI to rotate the video output by 90 degrees in either
+direction.&nbsp; This setting is useful if used in conjunction with a pivoting
+monitor [the auto options], or playing games with a monitor on its side.&nbsp;
+Doing so allows vertical orientated games to be played full screen.&nbsp; The
+additional 'auto clockwise' and 'auto anti-clockwise' settings are particularly
+useful for rotating LCD monitors, these settings will force vertical games to
+one 90 degree angle or the other depending on which way the LCD pivots.<br>
+<b>Flip screen upside down </b>: This option mirrors the image vertically.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Flip screen left right </b>:
+This option mirrors the image horizontally.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Direct3D</b> : <b>Use Bilinear
+Filtering</b> : This option enables bilinear filtering on game screen
+graphics.&nbsp; 'Fuzziness' of image can be controlled by the bitmap prescaling
+option, increasing it sharpens the image.&nbsp; Leaving this unchecked produces
+the crispest output but does point filtering leading to scaling artifacts.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Direct3D</b> : <b>Version</b> :
+This option allows toggling between version 9 and version 8 of D3D.&nbsp; It's
+almost always preferable to stay with 9.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>DirectDraw</b> : <b>Stretch
+using hardware</b> : Used in conjunction with DDraw as the video mode, this
+toggle if turned off scales upwards the size of the games original native
+resolution at the same aspect ratio.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Bitmap prescaling</b> : This
+option works in conjunction with bilinear filtering.&nbsp; The higher up the
+slider, the sharper the screen output.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Gamma correction </b>:
+&nbsp;This option controls the gamma, which produces a potentially nonlinear
+black to white ramp, for the game screens. This option does not affect the artwork
+or other parts of the display. Using MameUI's in-game tilde menu [~], one can
+individually set the gamma for each game screen; this option controls the
+initial value for all visible game screens. The standard value is 1.0, which
+gives a linear ramp from black to white. Selecting lower values (down to 0.1)
+will increase the nonlinearity toward black,&nbsp; while selecting higher
+values (up to 3.0) will push the nonlinearity&nbsp; toward white. The default
+is 1.0.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Brightness correction </b>:
+This option controls the default brightness, or black level, of the game
+screens. This option does not affect the artwork or other parts of the
+display.&nbsp; Using MameUI's in-game tilde menu [~], one can individually set
+the brightness for each game screen; this option controls the initial value for
+all visible game screens. The standard value is 1.0. Selecting lower values
+(down to 0.1) will produce a darkened display, while selecting higher values
+(up to 2.0) will give a brighter display. The default is 1.0.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Contrast correction </b>:&nbsp;
+Controls the contrast, or white level, of the game screens. This option does
+not affect the artwork or other parts of the display. Using MameUI's in-game
+tilde menu [~], one can individually set the contrast for each game screen;
+this option controls the initial value for all visible game screens. The
+standard value is 1.0. Selecting lower values (down to 0.1) will produce a
+dimmer display, while selecting higher values (up to 2.0) will give a more
+saturated display. The default is 1.0.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Pause Brightness </b>: This
+option controls the screen brightness when a game is paused.</p>
+
+<p class=MsoNormal style='margin-left:.75in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1040" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Advanced Tab</span></b> : This tab allows
+the setting of additional numerous video options.</p>
+
+<p class=MsoNormal style='margin-left:.75in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Triple buffering </b>: This
+option controls how MameUI draws to the screen, if toggled on, it will draw to
+three buffers and cycle between them.&nbsp; This setting when toggled on can
+also help alleviate tearing that sometimes occurs in some scrolling games.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Sync to monitor refresh </b>:
+This option tells MameUI to ignore the original game’s refresh rate and sync it
+to the output monitor’s current rate.&nbsp; This can cause the game to run too
+fast if the output monitor is using 85Hz for example.&nbsp; This option is
+preferable if MameUI is used with authentic arcade monitor hardware and video
+card modes that are tweaked appropriately.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Wait for vertical sync </b>:
+This option tells MameUI to wait for the refresh period on the output monitor
+to finish before starting to draw video to the screen, this works functionally
+similarly to triple buffer but is better suited for running games in a window
+to alleviate tearing. </p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Refresh speed </b>: This option
+tells MameUI to alter the speed of the emulation for games that run at a higher
+speed than the host monitor.&nbsp; For example this should be checked if
+running Pac-Man on a fixed 60Hz LCD since Pac-Man runs at 60.60Hz.&nbsp; This
+alleviates sound hiccups as well in the previous situation.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Emulation speed </b>: This slider
+allows for the altering of the emulation speed, it can be dropped down or
+increased by three [or to 100 in the \ini.] </p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Frame skipping </b>: These
+settings allow MameUI to skip frames of animation when playing games, if the
+host CPU is not fast enough to run the game.&nbsp; Optimally this should be
+toggled off and 'draw every frame' selected.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Full screen gamma</b> : This
+option is similar to the gamma correction in the display tab but works on all
+graphic elements of the screen including the UI.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Full screen brightness </b>:
+This option is similar to the brightness correction in the display tab but
+works on all graphic elements of the screen including the UI.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Full screen contrast</b> : This
+option is similar to the contrast correction in the display tab but works on
+all graphic elements of the screen including the UI.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Effect</b> : Starting with
+version .107 simulated arcade monitor effects are handled by the overlay of
+*.png masks on the game.&nbsp; The *.png files reside in the \artwork directory
+and are simple patterns creatable and editable in applications like
+Photoshop.&nbsp; If scan lines are desired and a very high resolution is being
+used [1280x1024 or above] the Scanlines75x4 item is suggested.&nbsp; For games
+with artwork whose playfields are smaller on screen as the results of bezels, it's
+recommended to use Scanlines75x3 or Scanlines75x2.</p>
+
+<p class=MsoNormal style='margin-left:.75in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1039" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Screen Tab</span></b> : This tab allows
+the alteration of the various screen output settings.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Number of screens </b>:<b> </b>This
+slider controls the number of screens MameUI will draw.&nbsp; In windowed mode up
+to four different output windows can be created of varying sizes, shapes,
+etc.&nbsp; In full screen mode the number of screens can match the physical
+number of monitors connected to the host system.&nbsp; This allows playing
+multi-monitor arcade games like Punch-Out or similar on 2 physical computer
+monitors in dual head mode.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Screen </b>: This option allows
+the choice of the physical monitor to use in conjunction with number of screens
+and screennumber.&nbsp; The drop down is populated by the \\.\DISPLAY1 and/or \\.\DISPLAY2
+and so forth.&nbsp; Leaving this toggle to Auto will have MameUI attempt to
+order the game screens as it sees fit, for Punch-Out for example it will place
+the main fighting screen on \\.\DISPLAY1 and the status/display screen on
+secondary monitor \\.\DISPLAY2. </p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Aspect Ratio </b>: Allows
+control over the physical aspect ratio of the physical monitor for each
+screen.&nbsp; If running full screen and auto aspect ratio is <b>off</b>, then
+switch resolutions to fit must be toggled on to work.&nbsp; Typically this
+should be set to autoselect unless weird shaped windows for game play are
+desired.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>View</b> : This drop down
+allows the selection of the default view of the in-game display.&nbsp; This can
+be auto which is effectively 4:3 for horizontal games or 3:4 for vertical
+games, native, which is the game's original native resolution, or cocktail
+which is duplicated view for 2 people playing the game on opposite sides of a
+cocktail cabinet.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Screennumber</b> : This drop
+down is populated based on the slider setting of number of screens to its
+left.&nbsp; Each item in the screennumber drop down can be individually
+tailored with screen, resolution, aspect ratio, and view. Thus it is possible
+to have elaborate combinations for game play, for example.&nbsp; Number of
+screens 3, run in windowed mode, have screen0 go to the secondary \\.\DISPLAY2,
+running in 320x240 resolution at a color depth of 16bpp with a refresh of 75Hz,
+screen1 go to primary display \\.\DISPLAY1, run at 640x480x32@60 and use the
+cocktail view, etc.&nbsp; Each item in the Screennumber drop down will populate
+its own settings and maintain those settings until returned to a default.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Resolution</b> : These options
+control the size and refresh rate of the screennumbers.&nbsp; In windowed mode
+only the resolution is selectable.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Switch resolutions to fit</b> :
+This toggle must be <b>on</b> if any of the resolution choices are altered away
+from auto in full screen mode.&nbsp; It does not impact windowed mode.</p>
+
+<p class=MsoNormal style='margin-left:.75in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1038" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Sound Tab</span> </b>: This tab allows for
+setting the sound options.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Enable sound and sound CPUs </b>:
+This setting toggles sound on or off in games.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Use samples </b>: This setting
+allows MameUI to utilize samples for games which do not have their sound
+hardware emulated, or were using analogue circuitry.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Sample Rate </b>: This setting
+tells MameUI at what rate to output sound, the higher, the better.&nbsp;
+Lowering this setting can also result in faster performance on lower end
+machines.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Volume attenuation </b>: This
+setting allows MameUI to set the initial volume level, the default is 0dB.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Audio latency </b>: This slider
+allows the adjustment of the amount of latency built into the audio
+streaming.&nbsp; Increasing the slider to the right on faster machines can help
+alleviate some desync and scratchiness in the sound on some configurations.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1037" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Controllers Tab</span> </b>: This tab
+allows for setting the game controller options.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Enable joystick input </b>:
+This setting tells MameUI to utilize any currently connected joysticks.&nbsp;
+MameUI will interrogate the game controllers control panel and use ID#1 and up.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Analog joystick deadzone</b> :
+This setting controls how MameUI translates analog input to games that require
+digital input.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Enable lightgun input</b> :
+This setting tells MameUI to utilize a lightgun for target/shooting games that
+require analogue control, like Crossbow, Police Trainer, Rev X, etc. and will
+only be available on non-XP based systems.&nbsp; If using XP then mouse input
+should be toggled on to allow mapping of the lightgun functions in the in-game
+[<b>TAB</b>] menu.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Offscreen shots reload</b> :
+This option if checked will internally remap the second mouse button and allow
+it to be used for simulated 'reloading' in gun games that require it.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Dual lightguns</b> : This is a
+legacy switch for non-XP systems which activates code to handle internal
+mapping of the second light gun connected to the system.&nbsp; If WinXP is used
+this is not required and is grayed out, the second gun is mapped like a
+joystick or mouse in the in-game [<b>TAB</b>] menu.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Enable mouse input </b>: This
+setting tells MameUI to utilize the mouse in games that require analogue
+control methods.&nbsp; On XP systems the mouse toggle should be on if a
+lightgun is to be utilised.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Enable steadykey support </b>:
+This option tells MameUI to use a different keyboard handling routine that
+makes it easier to register simultaneous key presses for games that require it
+for special moves [Street Fighter II, etc.].&nbsp; However it can produce more
+sluggish results in other games.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Default input layout </b>: This
+drop down menu allows MameUI to choose between multiple key mappings, including
+keyboard mapping for various third-party control panels.&nbsp; It will also
+display user defined controller mappings, if created in the \ctrlr
+directory.&nbsp; Various arcade game controller companies produce custom made
+configuration files for their setups; these *.cfg files need to go in the
+\MameUI\ctrlr folder to be recognized in the MameUI controllers tab.&nbsp;
+These files are the responsibility of the controller companies themselves and
+are not included or endorsed by MameUI, they can typically be found at the
+companies’ web sites.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><strong><span style='font-family:
+"Arial","sans-serif"'>Multiple keyboards</span></strong> : Enabling this
+checkbox tells MameUI to allow mapping to different physical keyboards that may
+be attached to the host system, this allows rather esoteric options like
+multiple keyboards for games like 2 player Keyboard Mania or Typing of the Dead
+etc.&nbsp; If left off MameUI maps all keyboard controls to all keyboard
+devices.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><strong><span style='font-family:
+"Arial","sans-serif"'>Multiple mice</span></strong> : Enabling this checkbox
+tells MameUI to allow mapping to different physical mice devices.&nbsp; Useful
+for systems that have spinners, trackballs, main system mice etc.&nbsp; If left
+off MameUI maps all mice controls to all mouse devices.</p>
+
+<p class=MsoNormal style='margin-left:.75in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1036" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Controller Mapping Tab</span> </b>: This
+tab allows choosing which analogue device connected to the system for MameUI to
+map a game's internal analogue controls to.&nbsp; These options should be used
+in lieu of the global 'mouse' setting which can conflict with attached
+joysticks/gamepads.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img width=11 height=11
+id="_x0000_i1035" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Miscellaneous Tab</span> </b>: This tab
+allows for setting additional options.</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Enable game cheats </b>: This
+setting if toggled on allows MameUI to use external cheat.dat files.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Error log (for developers) </b>:
+This setting if toggled on produces an error log of illegal memory accesses.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Sleep when possible </b>: This
+setting if toggled on allows MameUI to be more multitasking friendly in that it
+does not use as much processor time.&nbsp; If this setting is toggled off
+MameUI will utilize 100% of the CPU for playing games.&nbsp; Some machines slow
+down dramatically if this setting is toggled on, particularly laptops.&nbsp;
+This maps to the -sleep option in Mame.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Skip game info</b> : If this
+options is on, MameUI will immediately launch a game without information
+screens.&nbsp; However screens regarding problems in the drivers will still be
+shown [missing sound, unemulated protection, problems with video etc.].</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Save game state on exit</b> : This
+toggle will allow MameUI to automatically save the current machine state when
+the game is exited with the ESC key.&nbsp; As a result when the game is
+re-launched it's like the machine was never turned off.&nbsp; This feature
+allows older games to maintain their hi-scores indefinitely where it wasn't
+originally supported.&nbsp; The files are stored in the MameUI\sta
+directory.&nbsp; The list of games that support save states is present in the
+left hand folder view pane of the UI as 'Save State'.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Thread Priority slider</b> :
+Increasing the Windows thread priority for MameUI giving it more CPU and
+resources slices, can negatively impact other running processes.&nbsp; Using
+setting 1 sets it to real-time which interferes with keyboard and joystick
+controls as well as other running apps.&nbsp; Setting 1 is not recommended as a
+result.&nbsp; Some Dells and other laptop computers may require setting slider
+to -15 to get keyboard control working properly.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Multi-threaded rendering </b>:
+This toggle allows multi-core or multi-chip or HyperThreaded machines to pass
+the final video blit off to a second thread.&nbsp; This can lead up to a 40%
+increase in unthrottled FPS using D3D in GPU limited games.&nbsp; However it
+does not have a real world effect on games that are CPU bound, like the heavy
+seattle.c, or vegas.c games.&nbsp; Unless in possession of one of these types
+of machines, this should be toggled off to avoid potential slowdowns.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Use additional game artwork </b>:
+This setting if toggled on allows MameUI to utilize the external artwork
+packages available at <a href="http://www.mameworld.net/mrdo" target="_blank">Mr.
+Do’s site</a> for display in games like Armor Attack, Discs of Tron, Lunar
+Lander, Warrior, etc.&nbsp;The artwork packages are placed in the \artwork
+directory.&nbsp; Each element of the artwork package can be toggled: bezel,
+overlay, and background.&nbsp; </p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Crop Artwork</b> : Selecting
+the crop artwork toggle will shrink the scene down to the games original
+dimensions, cropping any available art pieces.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>BIOS</b> : This drop down
+allows the use of a variety of different supported NeoGeo or Sega BIOS
+files.&nbsp; The option will only be available when altering the driver family
+via the source folder view on the left pane, or individual games in the driver
+family.</p>
+
+<p class=MsoNormal style='margin-left:.75in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
+style='font-family:Symbol;mso-no-proof:yes'><img border=0 width=11 height=11
+id="_x0000_i1034" src="../images/mame321.gif" alt="*"></span><span
+style='font-size:7.0pt;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span><b><span style='color:maroon'>Vector Tab</span> </b>: This tab allows
+for setting additional options for games that originally utilized a vector
+monitor instead of a raster monitor. [Asteroids, Battlezone, Armor Attack,
+etc.]</p>
+
+<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Draw antialiased vectors </b>:
+This setting if toggled on tells MameUI to draw vector lines with an additional
+pleasing antialiased look.</p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Beam width</b> : This slider
+allows MameUI to set the beam width on the vector lines drawn, increasing it
+creates wider vectors. </p>
+
+<p class=MsoNormal style='margin-left:.75in'><b>Flicker</b> : This slider tells
+MameUI to artificially create a flicker effect on the vector lines.</p>
+
+<p class=MsoNormal style='margin-left:.75in'>&nbsp;</p>
+
+<p class=MsoNormal><span style='mso-no-proof:yes'><img border=0 width=250
+height=344 id="_x0000_i1033" src="../images/1.jpg"></span><span
+style='mso-no-proof:yes'><img border=0 width=250 height=344 id="_x0000_i1032"
+src="../images/2.jpg"></span><span style='mso-no-proof:yes'><img border=0
+width=250 height=344 id="_x0000_i1031" src="../images/3.jpg"></span><span
+style='mso-no-proof:yes'><img border=0 width=250 height=344 id="_x0000_i1030"
+src="../images/4.jpg"></span><span style='mso-no-proof:yes'><img border=0
+width=250 height=344 id="_x0000_i1029" src="../images/5.jpg"></span><span
+style='mso-no-proof:yes'><img border=0 width=250 height=344 id="_x0000_i1028"
+src="../images/6.jpg"></span><span style='mso-no-proof:yes'><img border=0
+width=250 height=344 id="_x0000_i1027" src="../images/7.jpg"></span><span
+style='mso-no-proof:yes'><img border=0 width=250 height=344 id="_x0000_i1026"
+src="../images/8.jpg"></span></p>
+
+<p class=MsoNormal style='margin-left:.75in'>&nbsp;</p>
+
+<p class=MsoNormal><!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-10 01:41 AM -0800<!--webbot bot="Timestamp" endspan i-checksum="37617" --><span
+style='font-size:7.5pt'>/ john iv</span></p>
+
+</div>
+
+</body>
+
+</html>
diff --git a/docs/release/src/osd/winui/help/html/mameui_settings.htm b/docs/release/src/osd/winui/help/html/mameui_settings.htm
new file mode 100644
index 00000000000..0224c694af2
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_settings.htm
@@ -0,0 +1,96 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI Settings</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+<base target="_blank">
+</head>
+
+<body background="../images/bkground.gif">
+
+<h2>MameUI Settings</h2>
+
+<h3><font face="Arial">Suggested MameUI Default Settings</font></h3>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>
+<span style="font-style: normal; font-variant: normal; font-weight: normal; color:windowtext">
+Advanced / Triple Buffering ensures there should be no 'tearing' of screen
+images if the frame rate doesn't exactly match the monitor screen refresh in
+full-screen mode.&nbsp;
+</span>Particularly evident in vertical scrolling games.&nbsp; This however can
+lead to sound stuttering on games that are above 60Hz [early Namco games like
+Pac-Man, etc.] if the user's monitor is
+not capable of being driven at a higher refresh rate, like modern LCDs.&nbsp; If
+a modern LCD fixed at 60Hz is in use, toggle on the Advanced • Refresh game
+speed. </p>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>
+<span style="font-style: normal; font-variant: normal; font-weight: normal; color:windowtext">
+Simulated monitor effects are now handled via *.png files in the \artwork
+directory.&nbsp; They are accessed in Advanced / Select Effect.&nbsp;
+Scanlines75x4 provides a 75% black line every four pixel rows.</span></p>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<span style="font-family: Symbol; color: windowtext">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span>Bitmap prescaling in Display is the new control for determining
+how fuzzy or sharp the bilinear filtering of D3D is.&nbsp; Increasing this
+number sharpens the game pixels.</p>
+<h3>
+<img border="0" src="../images/1.jpg"><img border="0" src="../images/2.jpg"><img border="0" src="../images/3.jpg"><img border="0" src="../images/4.jpg"><img border="0" src="../images/5.jpg"><img border="0" src="../images/6.jpg"><img border="0" src="../images/7.jpg"><img border="0" src="../images/8.jpg"></h3>
+<h3>
+<img border="0" src="../images/int.jpg" width="500" height="347"></h3>
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+</p>
+
+<p style="text-indent: -.25in; margin-left: .75in; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+&nbsp;</p>
+
+<p style="margin-left: 0; margin-right: 0in; margin-top: 0in; margin-bottom: 3.75pt">
+<font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-10 01:41 AM -0800<!--webbot bot="Timestamp" endspan i-checksum="37617" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_support.htm b/docs/release/src/osd/winui/help/html/mameui_support.htm
new file mode 100644
index 00000000000..0049b964cb2
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_support.htm
@@ -0,0 +1,739 @@
+<html xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
+
+<head>
+<style type="text/css">
+div.Section1
+ {page:Section1;}
+ h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:"Arial","sans-serif";
+ color:windowtext;
+ font-weight:bold;
+}
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:"Arial","sans-serif";
+ color:black;
+}
+a:link
+ {color:blue;
+ text-decoration:underline;
+ text-underline:single;
+}
+</style>
+</head>
+
+<body style="background-image: url('../images/bkground.gif')">
+
+<div class="Section1">
+ <h1 style="mso-margin-bottom-alt: auto"><span style="COLOR: black">MameUI
+ Troubleshooting [&amp; Tips]<o:p></o:p></span></h1>
+ <p style="MARGIN-TOP: 0in">MameUI [previously Mame32] has been in development since 1997.<span style="mso-spacerun: yes">&nbsp;
+ </span>It is mature, complex, and robust.&nbsp; However, since the Mame
+ project itself is a documentation effort, and development is continuous,
+ there will be times when changes to the core program effect MameUI.&nbsp;
+ When problems do occur with a specific game in a specific version of MameUI,
+ a previous version of MameUI may be used.&nbsp; </p>
+ <p style="MARGIN-TOP: 0in">MameUI is now an integrated GUI front end which
+ passes user input from the GUI to the
+ <b style="mso-bidi-font-weight: normal"><a href="http://www.mamedev.org/">
+ <span style="COLOR: black">Mame</span></a></b> engine/core.<span style="mso-spacerun: yes">&nbsp;
+ </span>Thus, any problems that occur in the
+ <b style="mso-bidi-font-weight: normal"><a href="http://www.mamedev.org">
+ <span style="COLOR: black">Mame</span></a></b> engine will be inherited by
+ MameUI.&nbsp; Prior to <b>
+ <a href="http://www.mameworld.info/ubbthreads/postlist.php?Cat=&amp;Board=mameui">
+ <span style="COLOR: black">reporting problems</span></a> </b>
+ <span style="mso-bidi-font-weight: bold">against MameUI</span>, verify that
+ the issue is not a known, core defect in
+ <b style="mso-bidi-font-weight: normal"><a href="http://www.mamedev.org/">
+ <span style="COLOR: black">Mame</span></a></b>.&nbsp; The <b>
+ <a target="_blank" href="http://mametesters.org/mantis/my_view_page.php">
+ <span style="COLOR: black">Mametesters.org</span></a></b> site is designed
+ to track and report bugs in the baseline
+ <b style="mso-bidi-font-weight: normal"><a href="http://www.mamedev.org/">
+ <span style="COLOR: black">Mame</span></a></b> version.&nbsp; To find if a
+ problem plagues the game in question, do an
+ <b style="mso-bidi-font-weight: normal">alt-enter</b> on the game and note
+ its driver/source name at the bottom of the general properties tab; then
+ search the Mametesters’ bug database.<span style="mso-spacerun: yes">&nbsp;
+ </span>The current list of known MameUI specific issues and defect tracking
+ is available at <b>
+ <a target="_blank" href="http://mameui.info//MameUI_Bugs.xls">
+ <span style="COLOR: black">MameUI</span></a></b>.&nbsp; &nbsp;</p>
+ <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
+ <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">ROMs and
+ CHDs Related Topics</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Utilization of an external ROMs management utility like
+ <b style="mso-bidi-font-weight: normal"><a href="http://www.clrmame.com/">
+ <span style="COLOR: black">Clrmame</span></a></b> is recommended for repair
+ and identification of damaged or incomplete sets.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If receiving missing ROMs error messages when
+ attempting to run a game, secondary click on the game in the list and choose
+ properties, do an audit on that game [or use <b>Alt-A</b>].<span style="mso-spacerun: yes">&nbsp;
+ </span>The audit will determine which files are missing from the ROMset
+ currently being played.<span style="mso-spacerun: yes">&nbsp; </span>MameUI
+ will not run a game which fails its internal audit.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Mame is an ongoing documentation project. Sometimes old
+ ROM sets are found to have miss-dumped, missing, or damaged ROMs, which need
+ to be replaced.&nbsp; As new versions of Mame are released, the Mame
+ developers add support for these new iterations of ROMs, supplanting or
+ renaming the old supported versions.<span style="mso-spacerun: yes">&nbsp;
+ </span>Thus, often, older versions of ROMs which did work in older versions
+ of MameUI, will <u>not</u> work with newer versions of MameUI because they
+ are now read as incomplete or wrong.<span style="mso-spacerun: yes">&nbsp;
+ </span>MameUI will not play the game in question until the updated ROMs are
+ utilized.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI utilizes the idea of a parent / clone
+ relationship for its games.&nbsp; If trying to play a clone or a bootleg of
+ a game, MameUI will need the ROMs for the clone game, <b>and</b> the parent
+ set.&nbsp; MameUI indicates the parent set of a clone at the bottom of the
+ game’s properties tab, or more easily in grouped view, View \ Grouped.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI utilizes the idea of having single zip files to
+ house the BIOS files for a large number of similar games.<span style="mso-spacerun: yes">&nbsp;
+ </span>The NeoGeo games for example, share upwards of ten BIOS files in
+ every game.&nbsp; Mame will look to neogeo.zip as the BIOS zip, if this file
+ is freestanding along with the other NeoGeo games, it will use it.
+ Otherwise, MameUI expects all the BIOS files in every NeoGeo game’s zip
+ file. DECO cassette, PGM, and Playchoice are some examples of other BIOS
+ games.&nbsp; An error message will occur if the BIOS files are not present
+ and those games are run.<span style="mso-spacerun: yes">&nbsp; </span>
+ Occasionally, new ROMs will need to be added to the BIOS packages
+ themselves, this occurred recently with the ‘ng-lo.rom’ and then 6 new
+ regional BIOSes in the neogeo.zip. MameUI will not audit a game as correct
+ without all the BIOS files with the correct CRC, while it may however be
+ possible to play the game after an error message.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Games that support .CHD [compressed hunks of data]
+ images [Max Force, Killer Instinct I &amp; II, Area 51, Vicious Circle, War
+ Gods, beatmania games, and items in the CHD folder view on the left pane]
+ have to have their ROMs and .CHD files in a very specific directory
+ structure. The <b style="mso-bidi-font-weight: normal">single</b> large .CHD
+ file needs to go in the \ROMs\gamename\ directory, and have the *.CHD
+ extension, e.g. \ROMs\area51\area51.chd.<span style="mso-spacerun: yes">&nbsp;
+ </span>These games also have ROMs, these go one level up in the \ROMs folder
+ proper like any other game.<span style="mso-spacerun: yes">&nbsp; </span>So
+ in the end two files should exist for these games one *.zip in the \ROMs
+ folder and the *.chd in a sub-directory named for the game.<span style="mso-spacerun: yes">&nbsp;
+ </span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span><b>F5 </b>/ View • Refresh in the GUI. (Do this anytime
+ ROMs are altered, renaming, etc.)</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If games are not displaying in the game list, ensure
+ the appropriate folder view on the far left is toggled, i.e. 'all games' and
+ it doesn't have filtering on it to stop the display of the game being
+ searched for.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Use the Options • Reset to default menu choice and
+ check all of the items, restart MameUI.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Final option, manually delete the MameUI32/64.ini and the
+ Mame.ini file in the \ini directory.</p>
+ <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
+ <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Crash
+ Related Topics</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Delete the \cfg\*.CFG, \diff\*.DIF, \ini\*.INI, or
+ \nv\*.NV files for the game that's crashing.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Check to see that the zip file is valid and that it's
+ not corrupt or read-only.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Verify the presence of the \ini directory under
+ MameUI.exe’s location.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If versions of MameUI prior to .66 had been installed
+ on the system, verify that the old registry key has been deleted with
+ regedit.exe. HKEY_CURRENT_USER/Software/Freeware/Mame32</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If crashing during an audit or an [<b>F5</b>] refresh,
+ it could be a corrupt .zip file. &nbsp;Extract it and re-zip. Pkunzip -t *.zip.
+ Note the file that dies during the audit and concentrate on that one. Also
+ verify that if zip files are not used, that the folder is not empty, or
+ contains partial or damaged ROMs.<span style="mso-spacerun: yes">&nbsp;
+ </span>Utilization of an external ROMs management utility like
+ <b style="mso-bidi-font-weight: normal"><a href="http://www.clrmame.com/">
+ <span style="COLOR: black">Clrmame</span></a></b> is recommended for repair
+ and identification of damaged sets.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If seeing crashes or weird screen coloration, try
+ disabling running background apps [in Win98, use msconfig.exe], Norton
+ Crashguard, PnP programs like Kaaza, eDonkey, LimeWire, popup killers,
+ viruscans, MS Office Fast Find, the Microsoft Office Bar, Intellimouse, even
+ IE subscription updates, etc. Try moving MameUI away from compressed
+ [DriveSpace, DoubleSpace, stacker] drives.&nbsp; IntelliMouse and Office
+ Toolbars have been known to cause conflicts.<span style="mso-spacerun: yes">&nbsp;
+ </span>Also disable items in the system tray, like the CD player, etc.&nbsp;
+ It may also be necessary to download and install the latest version of
+ DirectX from Microsoft to prevent some errors.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If MameUI crashes with an access violation it may be
+ the DEP (Data Execution Prevention) setting on that machine.<span style="mso-spacerun: yes">&nbsp;
+ </span>Add MameUI to the exception list in Control Panel / System / Advanced
+ / DEP.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>In some instances games may fail to start if the
+ installed directory path contains a large number of characters and spaces,
+ to alleviate this, install MameUI and its support directory structure into a
+ shorter path name, i.e. c:\MameUI\.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI may fail to launch its games in situations where
+ an errant, non-DX compliant, or badly written gamepad USB adapter
+ driver/software is used.<span style="mso-spacerun: yes">&nbsp; </span>This
+ includes some cheap Playstation, SNES, U64 converters.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Games may fail to start if a video cards DirectX driver
+ is flakey, utilise an earlier one to test or re-install DirectX.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Some recent viruses which attach to .exes will cause
+ page faults and access violations in MameUI when it's run.&nbsp; Use an
+ anti-virus check and verify MameUI is not infected.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Odd behaviour may be exhibited in NT based systems if
+ attempting to run games while security/permissions settings do not allow it
+ or the user is not an administrator or member of the administrator’s group.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Some anti-virus packages may slow down navigation
+ within the MameUI directory.<span style="mso-spacerun: yes">&nbsp; </span>
+ These are false positives and the anti-virus vendors should update their
+ virus dat signatures.<span style="mso-spacerun: yes">&nbsp; </span>It may
+ also be possible to exclude the MameUI.exe from real-time scanning as a
+ workaround.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>In the event of MameUI not launching a game and just
+ sitting there, try placing the entire MameUI directory and its
+ sub-directories including \ROMs into a more simple path, like c:\MameUI
+ instead of &quot;c:\Games for Fun\MameUI Goes Here\&quot;.<span style="mso-spacerun: yes">&nbsp;
+ </span>Simplify the path.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>On rare occasions malformed or damaged *.dat files
+ [history.dat, mameinfo.dat, cheat.dat] can cause MameUI to error on startup
+ when it tries to read them.<span style="mso-spacerun: yes">&nbsp; </span>
+ Remove those files individually to check for the one causing the crash.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>With the move to XML based Controller *.cfg files in
+ the .8x era it is necessary to remove the old \Ctrlr\*.ini files and use
+ their new *.cfg counterparts, otherwise MameUI may launch games then
+ immediately return to the GUI.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Use the Options • Reset to default menu choice and
+ check all of the items, restart MameUI.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Final option, manually delete the MameUI32/64.ini and the
+ Mame.ini file in the \ini directory.</p>
+ <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
+ <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Performance
+ Related Topics [incl. sound scratchiness and stuttering]</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI will start to crackle, scratch, or echo if the
+ game running is too taxing for the processor in use. This can be visually
+ confirmed by turning on FPS display with [<b>F11</b>], and frame skip to
+ auto with [<b>F8</b>].&nbsp; If the FPS dips anywhere or frame skipping
+ rises anywhere during the game play, the game is maxing out the CPU and
+ sound breakup could occur.<span style="mso-spacerun: yes">&nbsp; It is also
+ possible to determine if the host CPU can run the game at 100% by
+ unthrottling the emulation with the [F10] key, if the CPU can do it, it will
+ run the game faster than 100%.&nbsp; </span>If
+ upgrading machine components, provide MameUI with as much hardware as
+ possible; a faster CPU makes the most difference, followed by video card,
+ and RAM.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI will start to 'skip' sound on games that run
+ slightly over the host monitor refresh rate in full-screen mode with
+ triplebuffer.&nbsp; For example, Pac-Man and other early Namco games run at
+ 60.60Hz and if they are run on a fixed 60Hz LCD monitor using triplebuffer
+ they will skip since the emulation is outpacing the monitor. In this
+ instance it is necessary to toggle on the 'Refresh Speed' switch in the
+ Options • Default Options • Advanced tab.&nbsp; This issue can also be
+ overcome by running the game in windowed mode.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>As Mame has continued development, infrastructure and
+ accuracy has improved.<span style="mso-spacerun: yes">&nbsp; </span>As such,
+ the optimization point of the games has shifted so that older games may be
+ slower unthrottled overall than when run on earlier versions.<span style="mso-spacerun: yes">&nbsp;
+ </span>For example, in version .36 Donkey Kong may have run unthrottled at
+ 1900 FPS, but in .77 it runs 1500 FPS.<span style="mso-spacerun: yes">&nbsp;
+ Thus older machines [P3 and prior] will continue to have trouble playing the
+ same games as earlier versions of Mame.&nbsp; M</span>odern machines should have no problem running these
+ early 80's games at their intended ~60 FPS rate.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Periodically, speed-up hacks in the core code will be
+ removed to provide more accurate emulation of the games.<span style="mso-spacerun: yes">&nbsp;
+ </span>This can result in a drop in FPS for that particular family of games,
+ but can be offset by upgrading the machine MameUI is used on.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>On certain system setups (older), DirectDraw may be a
+ faster option than the D3D settings.<span style="mso-spacerun: yes">&nbsp;
+ </span>Choose Ddraw as the video mode in Default Options • Display. </p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>With the advent of MameUI .120 some historically
+ host CPU punishing games become playable on high end overclocked [3.6Ghz+]
+ Intel Core2Duo and Quad Cores.&nbsp; These processors combined with 64bit
+ operating systems and native 64bit MameUI provide almost 100% playability in
+ namcos21.c / namcos22.c / seattle.c and midvunit.c games.&nbsp; MameUI64 +
+ Vista64 + C2D chips is the best current combination for MameUI gaming on the
+ Windows platform.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Some of the largest games supported by MameUI [NeoGeo
+ mainly] can run into the hundreds of megabyte range when they are
+ uncompressed into memory, this combined with MameUI in memory, plus OS
+ overhead can lead to very slow performance as Windows swaps the information
+ out to disk if there is not enough physical memory.&nbsp; 512M to 1G of
+ memory is recommended for all current games [.118].</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>AMD’s Cool ‘n Quiet technology on certain setups has
+ been known to cause slowdowns and lags while working in the MameUI GUI as
+ well as causing some in-game sound and graphic stuttering.<span style="mso-spacerun: yes">&nbsp;
+ </span>Disable the feature in the BIOS to verify.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If seeing a severe slowdown in games that previously
+ didn't, toggle the 'Sleep when possible' menu item in Options •
+ Default Options • Miscellaneous.&nbsp; This happens to laptop users
+ particularly.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Certain games in MameUI perform better on machines that
+ cannot handle them 100% if auto-frame skipping is turned <b>off</b>.&nbsp;
+ </p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Certain games if run with D3D settings will perform
+ better if Triplebuffering is set to <b style="mso-bidi-font-weight: normal">
+ off</b>.<span style="mso-spacerun: yes">&nbsp; </span>D3D will double buffer
+ if triple is turned off.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>There may be certain sound anomalies in games if the
+ *.cfg files have become damaged, delete all the files in \cfg to remedy.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If games are running too <b>fast</b>, verify in the
+ Options • Default Game Options menu that the throttle option is turned <b>on</b>,
+ that sync to monitor refresh is turned <b>off </b>and Wait for Vertical Sync
+ is turned <b>off</b> in the Options • Default Game Options • Advanced menu.<span style="mso-spacerun: yes">&nbsp;
+ </span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI video performance can be greatly enhanced if
+ running in 32bpp mode by ensuring AGP Fast Writes are toggled on in the
+ motherboard BIOS.<span style="mso-spacerun: yes">&nbsp; </span>The videocard
+ drivers also need to support this setting, the switch for this may be in the
+ advanced tab of the Windows display control panel applet.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>There are some soundcards like early PCI
+ <span class="SpellE">SoundBlaster</span> 128 that will cause scratchiness
+ if their hardware acceleration is turned up too high.&nbsp; Move the slider
+ down various steps to troubleshoot in Control Panel • Sound • Advanced
+ Audio.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>There are some older video card/video driver
+ combinations that <b>can</b> do hardware stretching, but are slower than
+ running with hardware stretch <b>off</b>. If games are too sluggish with the
+ hw stretch on, toggle it off if possible.&nbsp; Some old PCI graphic cards have
+ been seen to have this problem.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If a large number of icons are being used in the GUI,
+ it is typically quicker to unzip them into the \icons folder instead of
+ leaving them zipped as icons.zip.</p>
+ <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
+ <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Joysticks /
+ Mice / Gamepad / Lightgun Related Topics</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Gamepads and mouse are disabled by default on first
+ MameUI launch, enable them by toggling their check boxes on in Options •
+ Default Options • Controllers.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI relies on DirectX’s DirectInput for joystick
+ support, ensure the game pad is seen as present and active in the game
+ controller control panel: start menu • settings • control panel • game
+ controllers.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If seeing keys ‘stick’ while playing, verify that the
+ operating systems’ accessibility options and their shortcut keys are turned
+ off, things like ‘sticky keys’, and verify that Popup killers or other
+ resident programs are not mapped to the sticking key.<span style="mso-spacerun: yes">&nbsp;
+ </span>Also keys can stick on some KVM switch boxes if their hotkey switches
+ are set to [<b style="mso-bidi-font-weight: normal">Ctrl</b>] etc.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Daisy chained gameport Microsoft Sidewinders [original]
+ in Win2k or XP do not work very well.&nbsp; Use USB gamepads instead. Single
+ Sidewinders may also cause odd behavior like ghost button presses.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Lightguns and mice are treated like mappable joysticks
+ in current versions of MameUI.<span style="mso-spacerun: yes">&nbsp; </span>If
+ multiple mice are in use it is necessary to enter the in-game [<b style="mso-bidi-font-weight: normal">TAB</b>]
+ menu and map their axes in the ‘Input General’ section.</p>
+ <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
+ <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Settings
+ Topics</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>With the advent of version 0.66 MameUI no longer stores
+ its configuration information in the Windows registry, it stores it in
+ \MameUI32/64.ini and \ini\Mame.ini.<span style="mso-spacerun: yes">&nbsp;
+ </span>To remove vestiges of the old versions, run regedit.exe and delete
+ the following key: HKEY_CURRENT_USER\Software\Freeware\MameUI.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If having trouble saving keyboard mappings and
+ configuration, verify that the *.cfg files are not read-only and that a
+ \MameUI\cfg directory is present.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If GUI settings and/or audit results aren’t being
+ maintained, verify the existence of a writeable MameUI32/64.ini and that the
+ \ini directory is present and writeable [not read only] under the MameUI.exe
+ location.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If baseline Mame settings like directories and game
+ options are not being maintained, verify the existence of a writeable
+ Mame.ini [not read-only] in the \ini directory and that the \ini directory
+ itself is writeable.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If experiencing odd behavior with MameUI saving files
+ or not appearing to clear its settings, verify that there are not multiple
+ shortcuts pointing to different versions, that an .exe is not being used by
+ itself instead of a shortcut to the .exe, or a shortcut pointing to an old
+ version of the .exe.<span style="mso-spacerun: yes">&nbsp; </span>Also
+ verify that there are not multiple versions of MameUI running in memory as
+ the last one out will save the settings.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If seeing MameUI folders being created on the desktop,
+ verify that the .exe itself is not sitting on the desktop and being launched
+ which is not correct. Verify that a short-cut to the original is being
+ properly utilised.<span style="mso-spacerun: yes">&nbsp; </span>This means
+ setting the properties on the shortcut to ‘start in’ the appropriate
+ directory that the original .exe resides in.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If the in-game [<b>TAB</b>] menu is no longer working
+ or can’t be accessed, it has been mapped to another key; delete the
+ default.cfg file in the \MameUI\cfg directory.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If in-game [<b style="mso-bidi-font-weight: normal">TAB</b>]
+ settings need to be completely reset due to bad mappings, delete the
+ default.cfg file in the \MameUI\cfg directory.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>To remove the mappings on an individual game from the [<b style="mso-bidi-font-weight: normal">TAB</b>]
+ menu, delete its *.cfg file in the \MameUI\cfg directory, i.e. dkong.cfg,
+ asteroid.cfg.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If having trouble mapping keys with the [<b style="mso-bidi-font-weight: normal">TAB</b>]
+ menu, verify the game is not paused while mapping.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI inherits a limit from baseline Mame on the
+ amount of characters that can be used for the ROM paths.<span style="mso-spacerun: yes">&nbsp;
+ </span>If directory settings are not being maintained, pare down the number
+ and names of the directories being added or simply use a single \ROMs
+ directory which MameUI expects.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If having trouble getting games to display in the
+ proper orientation [they will not rotate] verify that rotation is set to
+ default, and that there are no video-card specific hot-keys set in Windows’
+ advanced display settings tab that could impact rotation, ATI and NVIDIA
+ both now include the ability to rotate the Windows screen to portrait
+ orientation.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If games are appearing sideways regardless of rotation
+ settings, an onboard Intel graphic chipset or similar may be in use.<span style="mso-spacerun: yes">&nbsp;
+ </span>Disable the auto rotation capabilities of the Intel graphic chip.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI now supports the core’s –<span class="SpellE">mt</span>
+ switch.<span style="mso-spacerun: yes">&nbsp; </span>This allows
+ multi-threading of the final video blit during games. Dual core chips [X2,
+ C2D, etc.] can take advantage of this feature to offload the work to the
+ second thread and make MameUI more efficient.<span style="mso-spacerun: yes">&nbsp;
+ </span>Speed gains are seen on the unthrottled GPU bound games like dkong,
+ invaders, etc.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI now stores its settings in external *.ini files
+ instead of the registry.<span style="mso-spacerun: yes">&nbsp; </span>If it
+ is necessary to return MameUI to baseline, simply delete the MameUI32/64.ini
+ file and the Mame.ini file in the \ini directory.<span style="mso-spacerun: yes">&nbsp;
+ </span>The next time MameUI runs it will recreate those files with the
+ default settings.</p>
+ <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
+ <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">GUI Related
+ Topics &amp; Miscellaneous Tips</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI will read freestanding icons in the \icons
+ directory first, then icons in the icons.zip file.&nbsp; </p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>If seeing icon palette corruption in the GUI when
+ returning from a full screen game, try increasing the desktop color depth to
+ 24bpp or 32bpp.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Sometimes icons in large icon view may appear to be
+ missing their white color or have portions transparent, this is the result
+ of having white chosen as the windows desktop window setting in Control
+ Panel / Display.&nbsp; Change the window setting to slightly off-white or
+ another color to return the icons to their appropriate look.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>To toggle the MameUI UI fullscreen [no Windows titlebar
+ and potentially no toolbar or status bar] and back use the [<b style="mso-bidi-font-weight: normal">F11</b>]
+ key.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>The GUI text may disappear from the folder view if the
+ GUI font color chosen is very close to the Windows system background color
+ scheme or if it is a large enough font [or bold] to anti-alias. </p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>MameUI no longer supports *.bmp format and may show a
+ blank or empty background if a *.bmp is erroneously renamed and used for
+ bkground.png, or if the bkground directory is marked as read only and MameUI
+ cannot create the bkground.png file when run.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>To return to a blank gray background in the GUI, delete
+ the bkground.png file in the \MameUI\bkground directory.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Quickly navigate through games in the details view by
+ simply typing the first few letters in the name of the game, the highlight
+ will jump to that game and become more granular as the name is typed out.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Select a random game with [<b>Ctrl-R</b>].</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Audit an individual game with [<b>Alt-A</b>].</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Various arcade game controller companies produce custom
+ made configuration files for their setups; these *.cfg files need to go in
+ the \MameUI\ctrlr folder to be recognized in the MameUI controllers tab.<span style="mso-spacerun: yes">&nbsp;
+ </span>These files are the responsibility of the controller companies
+ themselves and are not included or endorsed by MameUI, they can typically be
+ found at the companies’ web sites.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>In grouped view, clones are indented regardless of
+ whether their parents are visible; in a non-All Games folder this means that
+ there is not a direct relationship of a clone to the game item above it if
+ that games’ parent is not shown.&nbsp; This behaviour can be changed by the
+ setting Interface Options • No offset for clones missing parent in view.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>Certain items in the GUI may be missing if MameUI is
+ run on a Win2K/XP box and the user is not an admin or member of the admin
+ group.</p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span>The unavailable folder and the available filter are
+ disabled in MameUI due to a direct request from Nicola.</p>
+ <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
+ <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Keyboard
+ Shortcuts</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo14; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span><b style="mso-bidi-font-weight: normal">Type letters of
+ game name</b> to jump directly to its first instance.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">Alt-1 through Alt-7</b>:
+ Toggle art views.<span style="mso-spacerun: yes">&nbsp; </span>
+ <b style="mso-bidi-font-weight: normal">Alt-A</b>: Audit selected game.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">Alt-B</b>: Toggle art tabs.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">Alt-D</b>: Toggle folder
+ pane.<span style="mso-spacerun: yes">&nbsp; </span>
+ <b style="mso-bidi-font-weight: normal">Alt-P</b>: Toggle screenshot area.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">Alt-S</b>: Toggle status bar.
+ <b style="mso-bidi-font-weight: normal">Alt-T</b>: Toggle toolbar.
+ <b style="mso-bidi-font-weight: normal">Alt-U</b>: Audit selected folder.
+ <b style="mso-bidi-font-weight: normal">Alt-Enter</b>: Show games’
+ properties.<span style="mso-spacerun: yes">&nbsp; </span>
+ <b style="mso-bidi-font-weight: normal">Ctrl-F</b>: Text filter.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">Ctrl-R</b>: Choose random
+ game from GUI. <b style="mso-bidi-font-weight: normal">Ctrl-Page Up</b>:
+ Scroll up in history.dat text window.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">Ctrl-Page Down</b>: Scroll
+ down in history.dat text window. <b style="mso-bidi-font-weight: normal">F11</b>:
+ Fullscreen mode toggle.</p>
+ <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
+ <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Refresh
+ Restart Instructions<o:p></o:p></span></strong></p>
+ <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo14; tab-stops: list .5in">
+ <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
+ <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span></span></span><b style="mso-bidi-font-weight: normal">a.</b>
+ Re-download the binary dist package from
+ <a href="http://mameui.info/">
+ <span style="COLOR: black">MameUI</span></a>.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">b.</b> Disable running
+ anti-virus packages before extracting the files.
+ <b style="mso-bidi-font-weight: normal">c.</b> Double-click the
+ self-extracting archive. <span style="mso-spacerun: yes">&nbsp;</span><b style="mso-bidi-font-weight: normal">d.</b>
+ When prompted, enter “c:\” [no quotes] as the destination folder.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">e.</b> Launch MameUI by
+ double-clicking its .exe, allow the audit/refresh to finish, it should go
+ quick as there are no ROMs.<span style="mso-spacerun: yes">&nbsp; </span>
+ <b style="mso-bidi-font-weight: normal">f.</b> Put a couple of zipped ROMs
+ from <a href="http://www.mamedev.org/roms"><span style="COLOR: black">
+ mamedev.org</span></a> in the c:\MameUI\ROMs directory.<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">g.</b> Launch MameUI, audit
+ the two games individually with [<b style="mso-bidi-font-weight: normal">Alt-A</b>].<span style="mso-spacerun: yes">&nbsp;
+ </span><b style="mso-bidi-font-weight: normal">h.</b> Launch Robby or
+ Gridlee.<span style="mso-spacerun: yes">&nbsp; </span>
+ <b style="mso-bidi-font-weight: normal">i.</b> Quit the game, then quit
+ MameUI.<span style="mso-spacerun: yes">&nbsp; </span>
+ <b style="mso-bidi-font-weight: normal">j.</b> Add more ROMs and try again.<br style="mso-special-character: line-break">
+ <br style="mso-special-character: line-break">
+ </p>
+ <p style="MARGIN: 0in 0in 5pt 0.25in"><span style="FONT-SIZE: 8pt">
+ <span style="mso-no-proof: yes">8/17/2007 1:17:01 AM</span> / john iv<o:p></o:p></span></p>
+</div>
+
+
+</html>
diff --git a/docs/release/src/osd/winui/help/html/mameui_systemreq.htm b/docs/release/src/osd/winui/help/html/mameui_systemreq.htm
new file mode 100644
index 00000000000..65871f6a806
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_systemreq.htm
@@ -0,0 +1,82 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI System Requirements</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+<base target="_blank">
+</head>
+
+<body background="../images/bkground.gif">
+
+<p class="MsoNormal" style="page-break-after: avoid; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt; margin-bottom: 3.0pt">
+<b><i><span style="font-size: 14.0pt">System Requirements</span></i></b></p>
+<p class="MsoNormal">MameUI runs on Microsoft Windows 98SE, Windows
+ME, Windows 2000, Windows XP, Windows 2003 Server, Windows Vista, and Windows 7.</p>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal">Because of the wide range of arcade hardware supported by
+MameUI, system requirements vary considerably.&nbsp; The
+more complex the original arcade hardware, the more CPU power is needed to
+emulate it.&nbsp; Mame strives for accuracy in its emulation; as such, over
+time, the performance point shifts as the underlying engine has been reworked
+and refined.&nbsp; Early games now require a bit more PC processing power to run
+than they did in earlier versions of Mame.&nbsp; This is typically not a great
+concern as modern PCs can run these early games easily at thousands of times
+their original speed.&nbsp; More recent games can often take upwards of 512M of memory, and
+Phenom / Core2 chips to emulate at 100% speed with effects.&nbsp; For those
+wishing to upgrade their systems; <b>MameUI benefits most from adding more CPU
+power, using a 64bit build on a 64bit OS</b>, and then memory and upgraded video card.</p>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal">Currently there are some games supported in MameUI which are not
+playable at full frame rate on today's PC hardware.&nbsp; Many of these are
+mid to late 90's and beyond advanced 3D games which MameUI renders in software for accuracy sake.&nbsp;
+Recent developments in Mame [.120] have allowed some of these games to get close
+to 100% playable on high-end overclocked [3.6Ghz+] Intel Core2Duo and Quad Core
+cpus.&nbsp; Additionally the fastest combination for MameUI is one of the
+previously mentioned CPUs plus the 64bit version of MameUI combined with a 64bit
+Operating System like Windows 7 x64.</p>
+
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal"><font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2009-12-24 12:33 AM -0800<!--webbot bot="Timestamp" endspan i-checksum="37922" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_viewmenu.htm b/docs/release/src/osd/winui/help/html/mameui_viewmenu.htm
new file mode 100644
index 00000000000..6e897d4a85d
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_viewmenu.htm
@@ -0,0 +1,160 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI View Menu</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+</head>
+
+<body background="../images/bkground.gif">
+
+<h2>View Menu</h2>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Toolbar</b> : Selecting this option from the view menu will
+toggle the toolbar on or off.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Status Bar</b> : Selecting this option from the view menu will
+toggle the status bar on or off.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Folder List</b> : Selecting this option from the view menu will
+toggle the folder list view on or off.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Screenshot</b> : Selecting this option from the view menu will
+toggle the screenshot area on or off.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Screenshot Tab</b> : Selecting this option from the view menu will
+toggle the screenshot area tabs, allowing to choose between the multiple
+different art types.&nbsp; Note that history.dat information is only displayed
+in the snapshot view.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Fullscreen</b> : Selecting this option from the view menu will
+
+switch the GUI into full screen mode.&nbsp; This will expand to fill the current
+desktop resolution, it will hide the menu bar, and it will hide the windows
+taskbar.&nbsp; Toggle in and out of it with F11, other alt shortcut keys are
+still active.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Show Pictures</b> : Selecting this option from the view menu will
+allow toggling the display of the individual art tabs in the screenshot area.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Large Icons</b> : Selecting this option from the view menu will
+display large icons in the gamelist area.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Small Icons</b> : Selecting this option from the view menu will
+display small icons in a different grid pattern in the gamelist area.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>List</b> : Selecting this option from the view menu will
+display small icons in the gamelist area.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Details</b> : Selecting this option from the view menu will
+display small icons along with full game name and any other fields chosen with
+the View • Customize Fields option.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Grouped</b> : Selecting this option from the view menu will
+display small icons along with full game name and any other fields chosen with
+the View • Customize Fields option, however the clone games will be displayed
+indented and alphabetized under their parents..</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Arrange Icons </b>: Selecting this option from the view menu
+will order the gamelist area by the choice made; game, directory, manufacturer,
+times played, type, or year.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Line Up Icons </b>: Selecting this option from the view menu
+will re-align the icons in views where it does not automatically happen.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Refresh </b>: Selecting this option from the view menu will
+initiate an update of the gamelist while MameUI searches for the existence of
+zip files that match game directory names.&nbsp; This is not as exhaustive as the
+audit function on the File menu.</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Custom Filters </b>: Selecting this option from the view menu
+will allow for the selective hiding of certain types of games.&nbsp; Manually typing
+in a phrase in the filter text box will only display games that have that text
+in their names [note valid input for the description filter are, game name,
+driver name e.g. 'cps2.c', and manufacturer].</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<span style="font-family: Symbol">
+<img width="11" height="11" src="../images/mame321.gif" alt="*"><span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><b>Customize Fields </b>: Selecting this option from the view menu
+will allow choosing which fields are displayed in columnar mode in the game list
+details view, selectable from the View • Details.&nbsp; The columns can also be
+ordered by moving them up and down the right hand side of the well.&nbsp; The game
+name field is always the first item and cannot be changed. </p>
+
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">&nbsp;</p>
+<p class="MsoNormal" style="text-indent: -.25in; margin-left: .75in">
+<font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-11 01:11 AM -0800<!--webbot bot="Timestamp" endspan i-checksum="37427" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_visual_elements.htm b/docs/release/src/osd/winui/help/html/mameui_visual_elements.htm
new file mode 100644
index 00000000000..c25e916cf8d
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_visual_elements.htm
@@ -0,0 +1,155 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>MameUI Toolbar / Status Bar / Windows</title>
+<style>
+<!--
+p
+ {margin-right:0in;
+ margin-left:0in;
+ font-size:10.0pt;
+ font-family:Arial;
+ color:black}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:16.0pt;
+ font-family:Arial;
+ color:windowtext;
+ font-weight:bold}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ page-break-after:avoid;
+ font-size:14.0pt;
+ font-family:Arial;
+ font-style:italic}
+ p.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ font-size:10.0pt;
+ font-family:Arial;
+ margin-left:0in; margin-right:0in; margin-top:0in}
+-->
+</style>
+</head>
+
+<body background="../images/bkground.gif">
+
+<h2>MameUI Toolbar / Status Bar / Windows</h2>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal">The MameUI <b>toolbar</b> extends the width of the application
+at the top and
+can be toggled on by using the View • Toolbar menu item, or the <b>Alt-T </b>keyboard
+shortcut.&nbsp; The buttons on the toolbar from left to right are : toggle folder
+list, toggle screenshot, large icons view, small icons view, list view, details
+view, help about, and help file.&nbsp; Click the items to toggle them on or off.&nbsp;
+The toolbar also contains the game search box, typing into this text box will
+filter out games.&nbsp; It is similar in function to the <strong>Ctrl-F</strong> filter but only
+filters on game descriptive name, it is also accessible with the <strong>Ctrl-E</strong>
+shortcut.</p>
+<p class="MsoNormal">
+<img border="0" src="../images/toolbar.gif" width="632" height="28"></p>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal">The MameUI <b>status bar</b> extends the width of the application
+at the bottom and can be toggled on by using the View • Status Bar menu item, or
+the <b>Alt-S</b> keyboard shortcut.&nbsp; The status bar indicates the full name of the game
+highlighted, and gives its internal status flag as to whether it’s working or if
+there are some issues with the emulation.&nbsp; The status bar also indicates the
+game count for the particular view used.</p>
+<p class="MsoNormal">
+<img border="0" src="../images/statusbar.gif" width="632" height="20"></p>
+<p class="MsoNormal">
+&nbsp;</p>
+<p class="MsoNormal"><b>MameUI can be divided into three windowed sections:</b></p>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal">The first section on the far left is the <b>folder view</b>,
+toggled on by using the View • Folder List menu item, or the Alt-D keyboard
+shortcut.&nbsp; This contains a tree style list that expands for certain items like
+year, manufacturer, and custom.&nbsp; By selecting one of these items, MameUI will
+display the games that meet that criterion.&nbsp; For example: selecting year / 1978,
+MameUI will
+display all the supported games manufactured in 1978.&nbsp; </p>
+<ul>
+ <li>
+<p class="MsoNormal">MameUI will display user
+created folders based on *.ini files located in the \MameUI\folders directory.&nbsp;
+See files in that location for examples.&nbsp; This location also houses the
+favorites.ini, where favorite games can be added to the text file and easily
+moved to other computers.<br>
+&nbsp; </p>
+ </li>
+ <li>
+<p class="MsoNormal">MameUI supports dragging and dropping games from the middle
+section game list into a custom folder in the left pane.&nbsp; MameUI supports
+the same procedure by secondary clicking on the game in the game list and
+choosing the 'add to custom folder' option.<br>
+&nbsp;</p>
+ </li>
+ <li>
+<p class="MsoNormal">MameUI also supports secondary clicking on a custom folder
+and renaming it, editing the custom folder name can also be accomplished by
+clicking the name of the folder three times quickly.<br>
+&nbsp;</p>
+ </li>
+ <li>
+<p class="MsoNormal">Secondary clicking on any of the folders also allows
+selectively displaying or hiding them in the tree.<br>
+&nbsp;</p>
+ </li>
+ <li>
+<p class="MsoNormal">Secondary clicking the vector folders and the \source\gamedriver
+folder allows for customizing
+away from default the games in that folder.<font face="Arial" size="2">&nbsp;
+Secondary click on the vector folder • properties in the folder pane to set
+options for that group of games.&nbsp; To alter global settings for game
+families select the properties for it, e.g. dkong.c for the Donkey Kong family
+of games&nbsp; This will change options for
+all games based on that driver.&nbsp; Thus there is the possibility to have
+four levels of alterations when a game's individual properties are viewed
+in All Games or any folder.&nbsp; The changes can be backed out of
+hierarchically with reset to default on each respective properties, or by
+deleting the .ini files in the \ini directory.</font></p>
+ </li>
+</ul>
+<p class="MsoNormal">The second, middle section of MameUI is the <b>game list</b>,
+always toggled on. &nbsp;This is where MameUI lists all of the games chosen
+in the left folder view.&nbsp; MameUI has the option to display the games as large
+icons, small icons, a list icons view, or details.&nbsp; Choosing details allows
+MameUI to display, in columnar mode, the game name as well as additional
+informational fields, chosen in the View • Customize Fields menu item.</p>
+<p class="MsoNormal">&nbsp;</p>
+<p class="MsoNormal">The third section, on the far right, is the <b>screenshot/art
+area</b>, toggled on by using the View • Screenshot menu item, or the <b>Alt-P</b> keyboard
+shortcut.&nbsp; This area of the GUI will display the optional artwork for each game
+selected, the artwork modes are toggled through by clicking on the picture area.&nbsp; The
+modes are: screenshot, flyer, cabinet, marquees, title shots, control panels,
+and history.&nbsp; <b>Alt-B</b>
+will toggle the screenshot tabs which give a visual selection method besides
+clicking the artwork area.&nbsp; Secondary clicking on the screenshot area will
+also bring up a shortcut dialogue with the file types available and allow
+toggling on or off individual tabs.&nbsp; The area under the screenshot mode
+will also display the history.dat information if that file is present [it will
+not display in the screenshot area if the history tab is enabled].&nbsp; Each of
+the tabs can be navigated to by their accelerator keys, <b>Alt-1</b>, <b>Alt-2</b>,
+<b>Alt-3</b>, etc. Further
+information about these files is in
+<a style="color: blue; text-decoration: underline; text-underline: single" href="mameui_art.htm">Art and Support Files</a>.</p>
+
+<p class="MsoNormal">&nbsp;</p>
+
+<p class="MsoNormal"><font size="1">
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%Y-%m-%d %I:%M %p %Z" startspan -->2008-07-16 12:03 AM -0700<!--webbot bot="Timestamp" endspan i-checksum="37949" -->
+/ john iv</font></p>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/html/mameui_whatsnew32.htm b/docs/release/src/osd/winui/help/html/mameui_whatsnew32.htm
new file mode 100644
index 00000000000..f686d1c627c
--- /dev/null
+++ b/docs/release/src/osd/winui/help/html/mameui_whatsnew32.htm
@@ -0,0 +1,2058 @@
+</style>
+
+<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
+
+<title>MameUI Whatsnew</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Author>john4</o:Author>
+ <o:Template>Normal</o:Template>
+ <o:LastAuthor>john4</o:LastAuthor>
+ <o:Revision>100</o:Revision>
+ <o:TotalTime>113</o:TotalTime>
+ <o:Created>2003-11-03T04:49:00Z</o:Created>
+ <o:LastSaved>2004-08-30T18:21:00Z</o:LastSaved>
+ <o:Pages>6</o:Pages>
+ <o:Words>3470</o:Words>
+ <o:Characters>19785</o:Characters>
+ <o:Lines>164</o:Lines>
+ <o:Paragraphs>46</o:Paragraphs>
+ <o:CharactersWithSpaces>23209</o:CharactersWithSpaces>
+ <o:Version>11.6360</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:DisplayBackgroundShape/>
+ <w:ActiveWritingStyle Lang="EN-US" VendorID="64" DLLVersion="131078"
+ NLCheck="1">1</w:ActiveWritingStyle>
+ <w:SpellingState>Clean</w:SpellingState>
+ <w:GrammarState>Clean</w:GrammarState>
+ <w:ValidateAgainstSchemas/>
+ <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+ <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+ <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+ <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+ </w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
+ </w:LatentStyles>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+ {font-family:Wingdings;
+ panose-1:5 0 0 0 0 0 0 0 0 0;
+ mso-font-charset:2;
+ mso-generic-font-family:auto;
+ mso-font-pitch:variable;
+ mso-font-signature:0 268435456 0 0 -2147483648 0;}
+@font-face
+ {font-family:SimSun;
+ panose-1:2 1 6 0 3 1 1 1 1 1;
+ mso-font-alt:\5B8B\4F53;
+ mso-font-charset:134;
+ mso-generic-font-family:auto;
+ mso-font-format:other;
+ mso-font-pitch:variable;
+ mso-font-signature:1 135135232 16 0 262144 0;}
+@font-face
+ {font-family:"\@SimSun";
+ mso-font-charset:134;
+ mso-generic-font-family:auto;
+ mso-font-pitch:variable;
+ mso-font-signature:3 135135232 16 0 262145 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:Arial;
+ mso-fareast-font-family:"Times New Roman";
+ color:windowtext; margin-left:0in; margin-right:0in; margin-top:0in}
+h1
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:1;
+ font-size:16.0pt;
+ font-family:Arial;
+ mso-fareast-font-family:SimSun;
+ color:windowtext;
+ font-weight:bold;}
+h2
+ {margin-top:12.0pt;
+ margin-right:0in;
+ margin-bottom:3.0pt;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ page-break-after:avoid;
+ mso-outline-level:2;
+ font-size:14.0pt;
+ font-family:Arial;
+ mso-fareast-font-family:SimSun;
+ color:windowtext;
+ font-weight:bold;
+ font-style:italic;}
+p
+ {mso-margin-top-alt:auto;
+ margin-right:0in;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:Arial;
+ mso-fareast-font-family:"Times New Roman";
+ color:black;}
+span.GramE
+ {mso-style-name:"";
+ mso-gram-e:yes}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ @list l0
+ {mso-list-id:8872955;
+ mso-list-template-ids:-1360482768;}
+@list l0:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l0:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l0:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l0:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l0:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l0:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l0:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l0:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l0:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l1
+ {mso-list-id:45884847;
+ mso-list-template-ids:-1235059890;}
+@list l1:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l1:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l1:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l1:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l1:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l1:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l1:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l1:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l1:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l2
+ {mso-list-id:439879227;
+ mso-list-template-ids:1518119328;}
+@list l2:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l2:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l2:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l2:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l2:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l2:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l2:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l2:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l2:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l3
+ {mso-list-id:489293858;
+ mso-list-template-ids:1845671390;}
+@list l3:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l3:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l3:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l3:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l3:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l3:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l3:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l3:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l3:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l4
+ {mso-list-id:619726884;
+ mso-list-template-ids:-1537423390;}
+@list l4:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l4:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l4:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l4:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l4:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l4:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l4:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l4:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l4:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l5
+ {mso-list-id:621153244;
+ mso-list-template-ids:995154020;}
+@list l5:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l5:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l5:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l5:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l5:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l5:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l5:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l5:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l5:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l6
+ {mso-list-id:730887387;
+ mso-list-template-ids:-2040104406;}
+@list l6:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l6:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l6:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l6:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l6:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l6:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l6:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l6:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l6:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l7
+ {mso-list-id:1220288851;
+ mso-list-template-ids:880986230;}
+@list l7:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l7:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l7:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l7:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l7:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l7:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l7:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l7:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l7:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l8
+ {mso-list-id:1275020199;
+ mso-list-template-ids:551206706;}
+@list l8:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l8:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l8:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l8:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l8:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l8:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l8:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l8:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l8:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l9
+ {mso-list-id:1357196694;
+ mso-list-template-ids:795358278;}
+@list l9:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l9:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l9:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l9:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l9:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l9:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l9:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l9:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l9:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l10
+ {mso-list-id:1503541588;
+ mso-list-template-ids:823551726;}
+@list l10:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l10:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l10:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l10:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l10:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l10:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l10:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l10:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l10:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l11
+ {mso-list-id:1535195385;
+ mso-list-template-ids:-778014484;}
+@list l11:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l11:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l11:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l11:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l11:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l11:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l11:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l11:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l11:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l12
+ {mso-list-id:1924140378;
+ mso-list-template-ids:-893489372;}
+@list l12:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l12:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l12:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l12:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l12:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l12:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l12:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l12:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l12:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l13
+ {mso-list-id:1983192207;
+ mso-list-template-ids:-1719795094;}
+@list l13:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l13:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l13:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l13:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l13:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l13:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l13:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l13:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l13:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l14
+ {mso-list-id:1997802346;
+ mso-list-template-ids:325871162;}
+@list l14:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l14:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l14:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l14:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l14:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l14:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l14:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l14:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l14:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l15
+ {mso-list-id:2000308197;
+ mso-list-template-ids:-1152595466;}
+@list l15:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l15:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l15:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l15:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l15:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l15:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l15:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l15:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l15:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l16
+ {mso-list-id:2035185965;
+ mso-list-template-ids:57055450;}
+@list l16:level1
+ {mso-level-number-format:bullet;
+ mso-level-text:\F0A7;
+ mso-level-tab-stop:.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;
+ mso-ansi-font-size:10.0pt;
+ font-family:Wingdings;}
+@list l16:level2
+ {mso-level-tab-stop:1.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l16:level3
+ {mso-level-tab-stop:1.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l16:level4
+ {mso-level-tab-stop:2.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l16:level5
+ {mso-level-tab-stop:2.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l16:level6
+ {mso-level-tab-stop:3.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l16:level7
+ {mso-level-tab-stop:3.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l16:level8
+ {mso-level-tab-stop:4.0in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+@list l16:level9
+ {mso-level-tab-stop:4.5in;
+ mso-level-number-position:left;
+ text-indent:-.25in;}
+ol
+ {margin-bottom:0in;}
+ul
+ {margin-bottom:0in;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+ {mso-style-name:"Table Normal";
+ mso-tstyle-rowband-size:0;
+ mso-tstyle-colband-size:0;
+ mso-style-noshow:yes;
+ mso-style-parent:"";
+ mso-padding-alt:0in 5.4pt 0in 5.4pt;
+ mso-para-margin:0in;
+ mso-para-margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:10.0pt;
+ font-family:"Times New Roman";
+ mso-ansi-language:#0400;
+ mso-fareast-language:#0400;
+ mso-bidi-language:#0400}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="1026"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+ <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+</head>
+
+<body bgcolor=white background="../images/bkground.gif" lang=EN-US
+style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<h1>Changes to MameUI</h1>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">127.5</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fixed issue w/ BIOS games not
+ being passed properly to core or stored in *.ini files. [<strong>Curt Coder</strong>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fixed sorting on source column
+ in gamelist. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">126.1</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Moved search bar over to the
+ flush right on the toolbar, made it take the UI font, and also made it
+ accessible with Ctrl-E like any search in Vista, Firefox, or IE.&nbsp;Added
+ a new debug tab to the options and loaded it w/ the missing items from the core. [<b style='mso-bidi-font-weight:
+ normal'>René Single / John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">122.1</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fixed long standing issue
+ where icons would corrupt and return to their defaults if scrolled through
+ entire game list&nbsp; [<b style='mso-bidi-font-weight:
+ normal'>René Single / John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">120.2</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Rebranded Mame32 to MameUI32
+ and MameUI64 to avoid confusion with the baseline builds that are now being
+ released as 64bit native apps.&nbsp; [<b style='mso-bidi-font-weight:
+ normal'>Mike Haaland / John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">120.2</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added support for a
+ 'nonworking.png' which will appear for non-working games in the art panes if
+ the specific game *.png doesn't exist <strong>and</strong> the game is
+ flagged as non-working in the core.<font face="Arial" size="2"> </font>[<b style='mso-bidi-font-weight:
+ normal'>Mike Haaland / John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">118.6</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added game search/filter to
+ the toolbar.&nbsp; Works similarly to the Ctrl-F filter but doesn't search
+ on manufacturer, driver name, or shortname.<font face="Arial" size="2">&nbsp;
+ Added PCB art pane view. </font>[<b style='mso-bidi-font-weight:
+ normal'>René Single / John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">118.5</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Per MameDEV request; removed
+ the ROMs view customization item, and reworked auditing to not show an icon
+ change state for unavailable sets in all games folder view.&nbsp; This was
+ to bring MameUI into compliance w/ the section of the Mame terms of usage
+ which states '<font face="Arial" size="2">Do not provide a means of
+ generating a list of games that specifically identifies those games for
+ which the user does not have image files'.&nbsp; Audit functionality and
+ game search on start is still present to populate the 'Available' folder
+ view. </font>[<b style='mso-bidi-font-weight:
+ normal'>Mike Haaland</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Promoted screen orientation
+ folder view to 'horizontal' and 'vertical' top level views and added them to
+ the Ctrl-F filter dialogue. [<b style='mso-bidi-font-weight:
+ normal'>Mike Haaland</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">118.2</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fixed all recent options
+ related bugs as well as expanding the functionality of the audit control so
+ it doesn't cut off anymore. [<b style='mso-bidi-font-weight:
+ normal'>Mike Haaland</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">110.2</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Re-arranged UI elements in
+ Options menus. [<b style='mso-bidi-font-weight:
+ normal'>Radius</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">107.1</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Updated the help file to
+ include the new UI support for the core's latest video changes.&nbsp;[<b style='mso-bidi-font-weight:
+ normal'>John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">107</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added UI support for the large
+ amount of core changes made by Aaron Giles for the new video renderer.&nbsp;[<b style='mso-bidi-font-weight:
+ normal'>René Single / John IV</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Created the new scanline *.png
+ files in \artwork for use with the new -effect switch. [<b>John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">105.2</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added BIOS folder view on the
+ left pane.&nbsp; This folder lists all the BIOSes supported by MameUI and
+ allows launching them as if turning on a machine without a cartridge etc. in
+ it, like the Neo-Geo.&nbsp; [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">104.7</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added properties for driver.c
+ and vector on secondary click shortcut menu.&nbsp; This is the same as
+ altering the properties on the vector folder and the \source\driver folder
+ on the left pane.&nbsp; [<b style='mso-bidi-font-weight:
+ normal'>René Single / John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">104.4</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added support for priority
+ switch, now a slider.&nbsp; Note: there may be system related issues going
+ to setting 1 (lagging keyboard, joystick controls), default is 0. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Removed multi-screen folder
+ view on left pane as that flag has been removed in the core. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added mngwrite option to
+ launch a game and immediately begin recording a MNG movie file. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">101.1</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added support for savestate
+ game folder view on left.&nbsp; Added switch for autosave.
+ [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.</span><font size="3">100</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>New Galaxian homage about.bmp.
+ [<b style='mso-bidi-font-weight:
+ normal'>John IV</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.99.</span><font size="3">3</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Re-implemented history.dat for
+ MameUI which had its support removed from core. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.98.</span><font size="3">3</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>UI dialogues realignment. [<b>Radius</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added ability to type in Mame
+ shortname in the Ctrl-F text filter, i.e. 'ddonpach'. [<b>John IV / Mash</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.96.4</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>First pass at adding support
+ for the analogue and digital controller section of the core. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.95.</span><font size="3">5</font></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added core's -screen switch to
+ UI to allow playing games on secondary/tertiary monitors in multi-head
+ setups. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.90.3</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>More UI dialogues realignment. [<b style='mso-bidi-font-weight:
+ normal'>Radius</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.89.3</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Re-aligned UI elements in
+ Options menus and added some XP-style icons. [<b style='mso-bidi-font-weight:
+ normal'>Radius</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.88.1<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added switch to toggle
+ validity checking in the binary. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.87.1<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Increased start up speed via
+ driver info caching. [<b>Sauro Puccini / Chris Kirmse</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.86.1<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Reworked MameUI folder
+ properties and their initial memory allocation.<span
+ style='mso-spacerun:yes'>  </span>Results in halving MameUI’s memory
+ footprint on most systems. [<b style='mso-bidi-font-weight:normal'>René
+ Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.86<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Reworked MameUI multisession
+ behaviour.<span style='mso-spacerun:yes'>  </span>When launching a game,
+ MameUI
+ will now dynamically resize itself in memory rather than spawning a
+ separate core process, saving some memory (this new feature impacts the
+ icons on windowed mode playing and the show caption option). [<b
+ style='mso-bidi-font-weight:normal'>Chris Kirmse</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Re-added support for custom
+ controller selection again in the controller tab. [<b style='mso-bidi-font-weight:
+ normal'>Chris Kirmse</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.84.5<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Cleaned up the Options •
+ Interface Options menu, adding sliders. [<b style='mso-bidi-font-weight:
+ normal'>René Single</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Internal clean-ups to provide
+ support for the new core changes. [<b style='mso-bidi-font-weight:normal'>Chris
+ Kirmse</b> / <b style='mso-bidi-font-weight:normal'>Nathan Woods</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.84.2<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added feature request to
+ place a border around the artwork in the art pane, user selectable size
+ and color (0=no border). [<b>René Single</b><b style='mso-bidi-font-weight:
+ normal'> / John IV</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added dump status folder
+ view, an easy reference for un-dumped and badly dumped ROMs for folks who
+ may be in a position to update them. [<b>René Single</b><span
+ style='mso-bidi-font-weight:bold'>]</span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'><span style='mso-bidi-font-weight:
+ bold'>Expanded game list font control to go beyond the original 16 color
+ choices allowing access to a greater UI customization (see last color on
+ drop down list ‘custom’). [<b>René Single</b>]</span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'><span style='mso-bidi-font-weight:
+ bold'>Added wave output option to match the core.<span
+ style='mso-spacerun:yes'>  </span>File menu / Play and Record Wave output.
+ [<b>Chris Kirmse</b>]</span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.84<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Various internal treeview
+ fixes [year / manufacturer] and cleanups. [<b style='mso-bidi-font-weight:
+ normal'>Nathan Woods / <span style='mso-bidi-font-weight:bold'>René Single</span>
+ / Mamesick / Chris Kirmse</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Factored out list view
+ handling into its own module, picker.c.<span style='mso-spacerun:yes'> 
+ </span>Auto_malloc() now used and appears to result in a speed up of the
+ GUI game list scrolling, however at the moment it does cause slight pauses
+ moving from one ‘view’ to another. [<b style='mso-bidi-font-weight:normal'>Nathan
+ Woods</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added ability to display
+ games in windowed mode without their titlebar caption. Not fully
+ functioning w/ GCC compile. [<b>René Single / John IV</b><span
+ style='mso-bidi-font-weight:bold'>]</span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.82<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Brought game ‘not working’
+ status messages in-line with core [status bar, general properties, etc.]
+ and rearranged status area on properties tab.<span
+ style='mso-spacerun:yes'>  </span>[<b style='mso-bidi-font-weight:normal'>Mamesick</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added sample folder view. [<b
+ style='mso-bidi-font-weight:normal'>Mamesick</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Renamed Hard Disk folder view
+ to CHD due to newly supported CD CHDs. [<b style='mso-bidi-font-weight:
+ normal'>John IV / Nathan Woods</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.81<o:p></o:p></span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Moved placement of
+ bkground.png to \bkground folder instead of \snap folder. [<b>René Single</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fixed erroneous behaviour for
+ Imperfect folder view. [<b>René Single</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Corrected audio latency
+ slider movement and setting past notch 4. [<b>René Single</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added customizable quit key
+ [default Alt-Q] for the mappable keyboard solution option. [<b>René Single</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added new History.dat option
+ to allow display under any or all of the art views in Options • Interface
+ Options. [<b>René Single</b>]</li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.79</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added an ‘Imperfect’ folder
+ view on the left pane, this categorizes the various problems flagged in
+ games. [<b>René Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Reworked handling of the BIOS
+ option, now that there are multiple drivers that support different BIOSes
+ [neogeo.c, stv.c] the global setting is not appropriate.<span
+ style='mso-spacerun:yes'>  </span>Select the driver from the source folder
+ view on the left pane and change its BIOS settings, this will alter it for
+ all games in that driver.<span style='mso-spacerun:yes'>  </span>The
+ functionality remains the same for altering individual games settings in
+ all games view or anywhere else. [<b>René Single</b>]</li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added the ability to control
+ the MameUI GUI via mappable keyboard solutions.<span
+ style='mso-spacerun:yes'>  </span>This feature is intended to compliment
+ the GUI control via joystick option first offered in version .70
+ below.<span style='mso-spacerun:yes'>  </span>It is designed to allow
+ users of Mame cabinets with keyboard encoders the same functionality and
+ is controlled in the mameUI32/64.ini file [mapping the enter key to button 1
+ to launch a game for example], using the same syntax as the \ctrlr files.
+ [<b style='mso-bidi-font-weight:normal'>Jarek Burczynski / Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added support for the new
+ core switches for lightgun modifications; reload to allow mapping reload
+ to keys, and dual gun setups. [<b style='mso-bidi-font-weight:normal'>Chris
+ Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added accelerator key for
+ folder level ‘mini-audits’, Alt-U [<b>René Single</b><b style='mso-bidi-font-weight:
+ normal'> / John IV</b>].<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added accelerator key support
+ for scrolling up and down through history.dat text window. CTRL-Page Up /
+ CTRL-Page Down.<b style='mso-bidi-font-weight:normal'> </b>[<b>René Single</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added toggle in Grouped view
+ to allow clones missing a parent to display non-indented. [<b>René Single</b><span
+ style='mso-bidi-font-weight:bold'>]</span><span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'><span style='mso-bidi-font-weight:
+ bold'>Added support for the core’s new save state loading on game
+ start.<span style='mso-spacerun:yes'>  </span>[<b>René Single</b>]</span><span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'><span style='mso-bidi-font-weight:
+ bold'>Added support for the core’s new keyboard LED choices, USB or PS/2.
+ [<b>René Single</b>]</span><span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.78</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added the ability to do ‘mini-audits’
+ on each of the folders on the left pane.<span style='mso-spacerun:yes'> 
+ </span>Secondary click on the folders to see audit as a choice. [<b>René
+ Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Changed behaviour of MameUI
+ when displaying games that have the protection not emulated flag,
+ previously it would flag these games as non-working and display the
+ warning.ico.<span style='mso-spacerun:yes'>  </span>Now warning.ico and
+ non-working status will only occur if the game has the non-working flag
+ attached in the driver. [<b>René Single / </b><b style='mso-bidi-font-weight:
+ normal'>Mamesick / John IV / Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Increased CPU and sound area
+ on games’ properties page to accommodate 5 lines now that tceptor and tmnt
+ utilise it. [<b>René Single / Chris Kirmse</b>]<span style='font-size:
+ 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Altered behaviour of
+ properties titlebar on driver.ini to show the driver name instead of
+ ‘folder’ properties. [<b>René Single / Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>No longer UPX compressing the
+ MameUI .exe.<span style='mso-spacerun:yes'>  </span>This saves 20 Megs
+ when MameUI is loaded into memory, will allow for better dynamic loading,
+ and won’t trip off virus detectors that have trouble w/ UPX compression.<span
+ style='mso-spacerun:yes'>  </span>As a result, MameUI.exe is now 20 Megs
+ in size on the hard drive.<span style='mso-spacerun:yes'>  </span>The
+ distribution package is also being changed and compressed with 7-Zip as a
+ self-extracting archive, this actually makes the distribution package
+ about 1 Meg smaller than previous releases. [<b style='mso-bidi-font-weight:
+ normal'>John IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Switched default settings in
+ MameUI to disable auto frameskipping and to use draw every frame per
+ discussion on MameDEV list. [<b style='mso-bidi-font-weight:normal'>John
+ IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added 48000 as a sample rate
+ option, works well with modern soundcards and chips. [<b style='mso-bidi-font-weight:
+ normal'>John IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.77</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fulfilling the longstanding
+ feature req. added the ability to globally alter vector.ini and driver.ini
+ to match the core.&nbsp; Secondary click on the vector folder • properties
+ in the folder pane to set options for that group of games.&nbsp; To alter
+ global settings for game families, drill down into the source folder in
+ the folder pane, and secondary click on a driver's properties i.e.
+ 1942.c.&nbsp; This will change options for all games based on that
+ driver.&nbsp; The different levels of alteration are color coded,
+ vector.ini changes are red, driver.ini changes are green, and individual
+ game settings are blue.&nbsp; Thus there is the possibility to have four
+ color/levels of alterations when a game's individual properties are viewed
+ in All Games or any folder.&nbsp; The changes can be backed out of
+ hierarchically with reset to default on each respective properties, the
+ reset to default global option, or by deleting the .ini files in the \ini
+ directory.<span style='mso-spacerun:yes'>  </span><b style='mso-bidi-font-weight:
+ normal'>Note</b>: Currently the color alterations do not display properly
+ with XP in themed mode, but the functionality works [bug 462].<span
+ style='mso-spacerun:yes'>  </span>Coded solutions to this issue via DIFF
+ are welcomed. [<b>René Single / Chris Kirmse / John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.76</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l7 level1 lfo2;tab-stops:list .5in'>Added programmatically
+ populated lightgun and multi-monitor folders. [<b>René Single</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l7 level1 lfo2;tab-stops:list .5in'>Added reset play count and
+ play time for individual games, and globally. [Secondary click on game,
+ &amp; Options • Interface Options. [<b>René Single</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l7 level1 lfo2;tab-stops:list .5in'>Allowed filter propagation
+ downward from parent folders, toggle this feature in Options • Interface
+ Options. [<b>René Single</b>]<span style='font-size:12.0pt;font-family:
+ "Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l7 level1 lfo2;tab-stops:list .5in'>Changed behavior of vertical
+ scrollbar in history pane, will not show if there is less text than
+ available room. [<b>René Single</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l7 level1 lfo2;tab-stops:list .5in'>Extended game not working
+ status support to show more flags in status bar and game properties. [<b>René
+ Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l7 level1 lfo2;tab-stops:list .5in'>Added tool tip text to status
+ bar if longer than displayable name is selected. [<b>René Single</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l7 level1 lfo2;tab-stops:list .5in'>Increased history.dat buffer
+ to prevent cut-off and overflow. [<b>René Single</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l7 level1 lfo2;tab-stops:list .5in'>Re-implemented ability to
+ show game's icon on title bar in windowed mode. [<b>René Single</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.72</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l0 level1 lfo3;tab-stops:list .5in'>Added the ability to scale
+ the right side art pane contents upwards as the window size increases,
+ toggle on Options • Interface Options. [<b>René Single / Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l0 level1 lfo3;tab-stops:list .5in'>Expanded the reach of the
+ CTRL-F text filter, it can now act on name, driver name e.g. 'cps2.c', and
+ manufacturer.&nbsp; This is a quick method for immediately seeing a driver
+ family instead of drilling down through the source folder on the left. [<b>René
+ Single / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.71</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added the ability to
+ selectively disable built in folder views on the left pane, secondary
+ click in the window area for the dialogue box. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added control panel art tab.
+ [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l1 level1 lfo4;tab-stops:list .5in'>Fixed audit control overflow
+ issue. [<b>René Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l1 level1 lfo4;tab-stops:list .5in'>Designed art tab state
+ toggles to be more readable in MameUI32/64.ini. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added the ability to have
+ MameUI automatically cycle the selected art views at an interval, in
+ seconds.&nbsp; Accessible in Options • Interface Options. [<b>René Single
+ / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added the ability to track
+ the amount of time spent playing each game in minutes and seconds.&nbsp;
+ Displays in details or grouped view.&nbsp; Add the column in View • Customize
+ fields. [<b>René Single / Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added the ability to view
+ game's icon on title bar in windowed mode. [<b>René Single / Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.70.1</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l12 level1 lfo5;tab-stops:list .5in'>Removed saturate slider from
+ D3D tab. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:
+ "Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l12 level1 lfo5;tab-stops:list .5in'>Fixed cleanstretch and
+ prescale settings not holding. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l12 level1 lfo5;tab-stops:list .5in'>Implemented BIOS selection
+ on per game basis [only Neo Geo games currently] and allowed temporary
+ global settings for BIOS via number. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.70</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added art tab with only
+ history.dat.&nbsp; If this tab is enabled and history.dat is present
+ history text will no longer appear beneath the screenshot. [<b>Tor Arne
+ Vestbø / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added option to hide the
+ mouse cursor on launch in full screen on Options • Interface Options. [<b>Tor
+ Arne Vestbø</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Addressed some long standing
+ bugs dealing with icon decimation and windows title bar size, and
+ details/grouped view not holding the column size on return from large icon
+ view post-session restart. [<b>René Single</b>]<span style='font-size:
+ 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added option to expand MameUI
+ to full screen kiosk mode without any windows controls [F11]. [<b>Tor Arne
+ Vestbø / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Created new Berzerk homage about.bmp. [<b>John IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Reworked drop down for D3D
+ prescale effect, now allowing various levels of sharpness to be used. [<b>Chris
+ Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Updated win32ui.c to pull
+ certain information more appropriately out of layout.c. [<b>Nathan
+ Woods/MESS32</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Removed obsoleted version
+ mismatch toggle. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added a built in orientation
+ folder view for displaying vertical and horizontal games. [<b>René Single</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added support for the new
+ cleanstretch options. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added ability to map joystick
+ actions in MameUI32/64.ini to control GUI navigation instead of being hard
+ coded:<br>
+ <b>Format</b>: joystick_number, stick_type, axis_or_button, direction<br>
+ <br>
+ #define JOYCODE_STICK_BTN 0<br>
+ #define JOYCODE_STICK_AXIS 1<br>
+ #define JOYCODE_STICK_POV 2<br>
+ #define JOYCODE_DIR_BTN 0<br>
+ #define JOYCODE_DIR_NEG 1<br>
+ #define JOYCODE_DIR_POS 2<span style='font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<p style='margin-left:.5in'>So, pressing button 3 on joystick one would be:
+1,0,3,0<br>
+<br>
+ui_joy_up 1,1,2,1<br>
+ui_joy_down 1,1,2,2<br>
+ui_joy_left 1,1,1,1<br>
+ui_joy_right 1,1,1,2<br>
+ui_joy_start 1,0,1,0<br>
+ui_joy_pgup 2,1,2,1<br>
+ui_joy_pgdwn 2,1,2,2<br>
+ui_joy_home 0,0,0,0<br>
+ui_joy_end 0,0,0,0<br>
+ui_joy_ss_change 2,0,3,0<br>
+ui_joy_history_up 2,0,4,0<br>
+ui_joy_history_down 2,0,1,0<br>
+ui_joy_exec 0,0,0,0</p>
+
+<p style='margin-left:.5in'>For stick type POV there are no directions, only
+four axes (0-3) [<b>Tor Arne Vestbø</b>]</p>
+
+<h2><span style='font-size:12.0pt'>v.69</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l11 level1 lfo7;tab-stops:list .5in'>Added support for the new
+ D3D filter and effects options in Options • Default Game Options •
+ Direct3D, see help menu contents for further descriptions of the new
+ features. [<b>John IV / Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l11 level1 lfo7;tab-stops:list .5in'>Added support for the new
+ core toggle -bios to allow selection of the various supported Neo Geo
+ BIOSes. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:
+ "Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.68</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l9 level1 lfo8;tab-stops:list .5in'>Added code to allow clicking
+ anywhere in the screenshot window to toggle the art views.&nbsp; No longer
+ necessary to click directly on the default image. [<b>K&amp;K</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l9 level1 lfo8;tab-stops:list .5in'>Added code to allow disabling
+ / toggling individual art views on the view menu and the context menu of
+ the art window. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l9 level1 lfo8;tab-stops:list .5in'>Added support for the new
+ core D3D items, accessible on the Options • Default Game Options • Direct3D.
+ [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l9 level1 lfo8;tab-stops:list .5in'>Added support for the new
+ core audio latency settings. [<b>Chris Kirmse</b>]<span style='font-size:
+ 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.67</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l14 level1 lfo9;tab-stops:list .5in'>Re-worked the rotation
+ options to a drop down, and included the new switches for auto-clockwise /
+ auto-anti-clockwise for pivot monitors. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.66</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l4 level1 lfo10;tab-stops:list .5in'>Moved towards an *.ini based
+ settings storage scheme to more closely match the Mame.exe core,
+ individual game *.inis whose settings are altered are stored in the \ini
+ directory. The MameUI GUI settings are stored in MameUI32/64.ini in the root
+ w/ MameUI.exe, and MameUI.ini is stored in the \ini directory and should
+ be interchangeable with a regular Mame.ini.&nbsp; Purge these two items to
+ return to baseline, the registry is no longer used for MameUI. [<b>Chris
+ Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l4 level1 lfo10;tab-stops:list .5in'>Provided an additional 'migration'
+ version of MameUI which will copy the contents of the registry key and
+ write it out to the new *.ini scheme when exiting.&nbsp; Useful for people
+ who have a large number of individual game customizations. [<b>John IV /
+ Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l4 level1 lfo10;tab-stops:list .5in'>Added toggle for high thread
+ priority in Options • Interface Options to match the core's new
+ -high_priority switch.&nbsp; This will devote more system resources and
+ time to MameUI at the expense of other already running programs. [<b>Chris
+ Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.65</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l10 level1 lfo11;tab-stops:list .5in'>Updated columnedit.c to
+ allow for MESS32 usage in software view. [<b>Nathan Woods/MESS32</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l10 level1 lfo11;tab-stops:list .5in'>Reworked F5/refresh
+ routines to utilise more audit code and logic. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l10 level1 lfo11;tab-stops:list .5in'>Reworked -lightgun
+ handling, enabling independently selectable mouse control for those games.
+ [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l10 level1 lfo11;tab-stops:list .5in'>Custom icons are included
+ in the distribution \icons directory to show what the control/tree icons
+ are without having to go through the source. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.63.1</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l5 level1 lfo12;tab-stops:list .5in'>Fixed analogue dead-zone not
+ being maintained, and pre-0.63 timing not being maintained. [<b>Chris
+ Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l5 level1 lfo12;tab-stops:list .5in'>Added folder view for hard
+ drive based games. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l5 level1 lfo12;tab-stops:list .5in'>Addressed missing/blank
+ custom icon display indexing issue on F5/refresh. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l5 level1 lfo12;tab-stops:list .5in'>Sped up MameUI launch /
+ folder reading routine. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l5 level1 lfo12;tab-stops:list .5in'>Fixed screenshot area
+ decimation when resizing images larger than the viewable area. [<b>John IV
+ / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l5 level1 lfo12;tab-stops:list .5in'>Added additional help topic
+ IDs and tool tips. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.63</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added code to ROM loading
+ dialogue to visually indicate user intervention when the game being
+ launched may not work due to 'no good dump' this will match the baseline
+ Mame [press ok to continue].&nbsp; Examples include the game Astyanax,
+ 64th Street etc. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Return to baseline non-I686
+ compile as it prevented MameUI working on a variety of machines. [<b>John
+ IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Made numerous code changes
+ to allow MameUI to be compiled with the new MinGW 2.0 package. [<b>Chris
+ Kirmse / Mike Haaland</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Distribution compiles are
+ now done using above mentioned MinGW 2.0 package. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added code to allow for a
+ tool tip to appear showing the full name of a game whose description is
+ cut-off by column width in details/grouped view.&nbsp; Hover cursor over
+ game to activate. [<b>Andrew Kirmse / Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>The default
+ \folders\Favorites.ini has been cleaned out.&nbsp; Now that it is easy to
+ drag and drop or secondary click to add games from the main list to the
+ custom folders, it no longer needs to serve as an example using personal
+ favorites. Be sure to backup existing \folders\Favorites.ini if using the
+ built in installer version of the MameUI distribution. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Tweaked code for drag &amp;
+ drop of games into custom folders.&nbsp; In a custom folder to drag an
+ item out for deletion, it must go out of the game list pane either left,
+ right, up, or down beneath the last item in the pane or further out of the
+ GUI. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Reworked internal file
+ handling code to interface with Aaron's substantial core updates. [<b>Chris
+ Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Submitted code suggestion
+ to allow for more granular sorting and display of items in the Manufacturers
+ view, so companies will no longer be grouped with others incorrectly. [<b>René
+ Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Created new main icon and
+ about.bmp 'Ladybug Homage'. [<b>John IV</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Fixed ascending/descending
+ toggle via View • Arrange Icons for columns other than Game.&nbsp; Added
+ some logic to the -listsourcefile column display. Prevented color depth
+ and refresh rate settings from being displayed if games are played in
+ windowed mode. [<b>René Single / Chris Kirmse</b>]<span style='font-size:
+ 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Made Misc. art option gray
+ properly when its parent control was deselected. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Submitted code to clean up
+ some issues with the list and small icons view and icons squishing in
+ details view upon return from another view like large icons. [<b>René
+ Single / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Upgraded MameUI to utilize
+ the new common controls from Windows XP, allowing the proper look of an XP
+ application without the need for an external manifest file. [<b>Chris
+ Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added ability to rename
+ custom folders from the tree view, secondary click on them and choose
+ rename folder from the context menu, or click the name of the folder three
+ times quickly. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added the 'Source' folder
+ view, this will display all the driver.c files and all the games within
+ each family. [<b>Mike Haaland</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Removed the
+ \folders\BIOS.ini as it is now obviated by the built-in Source folder
+ view. [<b>John IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added -sourcefileinfo
+ information to the general tab for each <span class=GramE>games'</span>
+ properties, to easily and quickly see what driver family a game belongs
+ to. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added the long requested
+ clone offset aka 'Grouped' view.&nbsp; This will display the parent games
+ flush left, with all their clones alphabetized beneath them indented
+ inward. Excellent for grouping the clones whose names may be considerably
+ different than their <span class=GramE>parents,</span> and allowing typing
+ the name of the game to go to the parent set immediately.&nbsp; [<b>John
+ IV / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Reworked the Startup
+ Options to now be Interface Options, and added checkboxes to support
+ Aaron's new disclaimer / info screen toggle. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added new switches -rdtsc /
+ -pause_brightness to match the core. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.62</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Internalized the code for
+ rotate.exe, MameUI can now choose its background images from Options •
+ Background Image, and choose a random one on startup.&nbsp; Options •
+ Startup Options • Select Random Background Image. [<b>K&amp;K</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added tabs for the
+ screenshot art <span class=GramE>area,</span> toggle with Alt-b. [<b>K&amp;K</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added code to increase speed
+ of audit. [<b>K&amp;K</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added secondary click menu
+ pop-up for screenshot area. [<b>Sword</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Allowed bkground.png to be displayed
+ in history.dat area under screenshot, font color changed to match GUI font
+ color. [<b>K&amp;K</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Created new icons for the
+ various tabs in Default Options / Game Properties dialogue boxes. [<b>John
+ IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Updated the ColumnEdit and
+ Properties code to make them both more extensible. [<b>Nathan Woods/MESS32</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Included index fixes to
+ speed load time in treeview.c, particularly with extra \folders *.inis. [<b>Jeff
+ Miller</b>] <span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Fixed an issue where the
+ startup focus in the details list would jump to the top of the list before
+ returning to the prior selection. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Main distribution now
+ compiled with I686=1 for Pentium Pro optimization.&nbsp; Doesn't impact
+ high end AMD chips at all but provides speed increases to lower range PII,
+ P3 machines. [<b>John IV</b>]<span style='font-size:12.0pt;font-family:
+ "Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Created new *.ini files for
+ the \folders directory.&nbsp; Replace the old ones with these (<span
+ class=GramE>except</span> any user-modified of course). [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Created a new MameUI MSI
+ installer package.&nbsp; This should be easier for beginners. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added the ability to drag and
+ drop games into the custom *.ini folders. [<b>Chris Kirmse</b>] <span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added the ability to
+ secondary click on a game to add or remove it from an *.ini file in the
+ \folders directory. [<b>Patrick Jones / Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.61</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Fixed a nasty crasher where
+ MameUI would hang if loading a game that required user intervention in
+ Mame[w] <span class=GramE>like</span> 'The Astyanax', and there was no
+ joystick connected to the system. [<b>Sword</b>]<span style='font-size:
+ 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Fixed a couple of fringe
+ case crashers when Windows is shut down beneath MameUI, i.e. a cabinet
+ setting. [<b>Robert John Sheppard</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Removed -dirty / -nodirty
+ options to match Aaron's core changes. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added dialogue box support
+ for new artwork switches, added -ini support to Options • Directories. [<b>Mike
+ Haaland</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added dialogue box support
+ for LED disablement, artwork resolution. [<b>Mike Haaland</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added brightness slider,
+ removed -bpp per Aaron's changes. [<b>Mike Haaland</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added sound chip and CPU
+ information to the folder views.&nbsp; Added the long requested feature to
+ create user defined folder views, see \folders files for examples. [<b>Sword,
+ BUT, Emuman / Mike Haaland</b>] <span style='font-size:12.0pt;font-family:
+ "Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Created Artwork, BIOS, and
+ Custom folder views. [<b>John IV</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added support for displaying
+ -listsourcefile [source] field to the View • Customize Fields.&nbsp; Handy
+ for sorting to test global driver changes across all its <span
+ class=GramE>games.,</span> or using to report game problems to
+ MameTesters.com. [<b>Mike Haaland</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Created new Version and
+ Classification folder views. [<b>John IV</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added support for the new
+ -lightgun switch. [<b>John IV</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Removed 'add to favorites'
+ from context menus and file menu since it is now possible/preferable to
+ have favorites stored in the portable, user-defined, external text file
+ [\folders]. <span class=GramE>Which also of course would survive a
+ registry key purge.</span> <span class=GramE>Times played is</span> still
+ accessible as a column in details view. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Updated help file with new
+ settings, added baseline Mame[w] documents to help file. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added \titles directory
+ support to allow for title screenshots viewing. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l2 level1 lfo15;tab-stops:list .5in'>Created new MameUI icon and <span
+ class=GramE>About</span> graphic. [<b>John IV</b>]<span style='font-size:
+ 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.60</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l13 level1 lfo16;tab-stops:list .5in'>Created and added the new
+ MameUI HTML Help File. [<b>John IV</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l13 level1 lfo16;tab-stops:list .5in'>Updated context sensitive
+ help support to MameUI, all controls should be mapped to pop-up help. [<b>Mike
+ Haaland</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l13 level1 lfo16;tab-stops:list .5in'>Added 'Use less CPU if
+ possible' check box in Options • Default Options • Miscellaneous.&nbsp;
+ This toggles the new baseline Mame[w] sleep / -nosleep switch.&nbsp; If
+ toggled on, it will return more time slices to the processor and be more
+ amenable to multi-tasking with other applications.&nbsp; If toggled off,
+ MameUI will continue to take 100% of the CPU time as it has historically.&nbsp;
+ It should be toggled 'off' for people experiencing severe slowdowns,
+ particularly laptop users. [<b>John IV / Mike Haaland</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l13 level1 lfo16;tab-stops:list .5in'>Added option to set the
+ directory for hard drive image diff files to match Mame[w] in Options •
+ Directories. Fixed screenshot area decimation when image sized too large
+ for area.&nbsp; Scales properly now and looks great.&nbsp; Fixed flip
+ options. [<b>Sword</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l13 level1 lfo16;tab-stops:list .5in'>Added option to set the
+ directory for icons in Options • Directories. [<b>John IV</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l13 level1 lfo16;tab-stops:list .5in'>Added support for new
+ external controller mapping. This adds support for common arcade
+ controllers and provides the ability to create user defined mappings for
+ home built solutions.&nbsp; See Options • Default Options • Controllers.
+ Also see the controller mapping document in the Mame Documents help
+ section. [<b>Ron Fries</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<h2><span style='font-size:12.0pt'>v.59</span></h2>
+
+<ul type=square>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l15 level1 lfo17;tab-stops:list .5in'>Added 'Allow game selection
+ by joystick' check box to Startup Options.&nbsp; Allows navigation and
+ game launch via controller<span class=GramE>:</span><br>
+ joystick 1 up = up arrow<br>
+ joystick 1 down = down arrow<br>
+ joystick 1 left = left arrow<br>
+ joystick 1 right = right arrow<br>
+ joystick 1 button 1 = play game<br>
+ joystick 1 button 2 = page up<br>
+ joystick 1 button 5 = page down<br>
+ joystick 1 button 3 = end<br>
+ joystick 1 button 6 = home. [<b>Chris Kirmse</b>]<span style='font-size:
+ 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l15 level1 lfo17;tab-stops:list .5in'>Fixed a few files to allow
+ a MinGW compile without errors. [<b>Sword</b>]<span style='font-size:12.0pt;
+ font-family:"Times New Roman"'><o:p></o:p></span></li>
+ <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
+ mso-list:l15 level1 lfo17;tab-stops:list .5in'>Added 'Broadcast selected game
+ to all windows' check box in Startup Options, this allows third party
+ applications to be programmatically told what game is being played in
+ MameUI.&nbsp; It can be used to hook into applications like LED reader
+ boards, or instant message clients, etc. [<b>Chris Kirmse</b>]<span
+ style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
+</ul>
+
+<p><font size="1">
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y-%m-%d %I:%M %p %Z" startspan -->2008-09-23 09:01 PM -0700<!--webbot bot="Timestamp" endspan i-checksum="37950" -->/ <span class=GramE>john</span> iv</font></p>
+
+</div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/docs/release/src/osd/winui/help/images/1.jpg b/docs/release/src/osd/winui/help/images/1.jpg
new file mode 100644
index 00000000000..0ea95f36b2c
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/1.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/2.jpg b/docs/release/src/osd/winui/help/images/2.jpg
new file mode 100644
index 00000000000..645f70feab9
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/2.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/3.jpg b/docs/release/src/osd/winui/help/images/3.jpg
new file mode 100644
index 00000000000..4eb620fd2fe
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/3.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/4.jpg b/docs/release/src/osd/winui/help/images/4.jpg
new file mode 100644
index 00000000000..76b3c7c1176
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/4.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/5.jpg b/docs/release/src/osd/winui/help/images/5.jpg
new file mode 100644
index 00000000000..ee797a92b1b
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/5.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/6.jpg b/docs/release/src/osd/winui/help/images/6.jpg
new file mode 100644
index 00000000000..c2d6e48d904
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/6.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/7.jpg b/docs/release/src/osd/winui/help/images/7.jpg
new file mode 100644
index 00000000000..1635cfe0ccd
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/7.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/8.jpg b/docs/release/src/osd/winui/help/images/8.jpg
new file mode 100644
index 00000000000..8c18f298077
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/8.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/bkground.gif b/docs/release/src/osd/winui/help/images/bkground.gif
new file mode 100644
index 00000000000..3fc4ac0a81a
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/bkground.gif
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/folder.gif b/docs/release/src/osd/winui/help/images/folder.gif
new file mode 100644
index 00000000000..e28e6f4033c
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/folder.gif
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/int.jpg b/docs/release/src/osd/winui/help/images/int.jpg
new file mode 100644
index 00000000000..cab16e39c26
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/int.jpg
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/mame321.gif b/docs/release/src/osd/winui/help/images/mame321.gif
new file mode 100644
index 00000000000..4260dc3848a
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/mame321.gif
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/statusbar.gif b/docs/release/src/osd/winui/help/images/statusbar.gif
new file mode 100644
index 00000000000..8619a6f618d
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/statusbar.gif
Binary files differ
diff --git a/docs/release/src/osd/winui/help/images/toolbar.gif b/docs/release/src/osd/winui/help/images/toolbar.gif
new file mode 100644
index 00000000000..3a1d1ad5ed3
--- /dev/null
+++ b/docs/release/src/osd/winui/help/images/toolbar.gif
Binary files differ
diff --git a/docs/release/src/osd/winui/help/mameui.hhc b/docs/release/src/osd/winui/help/mameui.hhc
new file mode 100644
index 00000000000..e989d217a60
--- /dev/null
+++ b/docs/release/src/osd/winui/help/mameui.hhc
@@ -0,0 +1,122 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<HTML>
+<HEAD>
+<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
+<!-- Sitemap 1.0 -->
+</HEAD><BODY>
+<OBJECT type="text/site properties">
+ <param name="Window Styles" value="0x800625">
+ <param name="ImageType" value="Folder">
+<param name="Font" value="Tahoma,8,0">
+</OBJECT>
+<UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="MameUI Overview &amp; History">
+ <param name="Local" value="html\mameui_overview.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="MameUI Changes">
+ <param name="Local" value="html\mameui_whatsnew32.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="MameUI Installation">
+ </OBJECT>
+ <UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="System Requirements">
+ <param name="Local" value="html\mameui_systemreq.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Download Locations">
+ <param name="Local" value="html\mameUI_download.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Installation Procedures">
+ <param name="Local" value="html\mameUI_installprocedures.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Art and Support Files">
+ <param name="Local" value="html\mameUI_art.htm">
+ </OBJECT>
+ </UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="MameUI Usage">
+ </OBJECT>
+ <UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="MameUI Suggested Settings">
+ <param name="Local" value="html\mameui_settings.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Playing a Game &amp; Internal Controls">
+ <param name="Local" value="html\mameui_playing.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Toolbar, Status Bar, &amp; Windows">
+ <param name="Local" value="html\mameui_visual_elements.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="File Menu">
+ <param name="Local" value="html\mameui_filemenu.htm">
+ </OBJECT>
+ <UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Game Properties">
+ <param name="Local" value="html\mameui_properties.htm">
+ </OBJECT>
+ </UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="View Menu">
+ <param name="Local" value="html\mameui_viewmenu.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Options Menu">
+ <param name="Local" value="html\mameui_optionsmenu.htm">
+ </OBJECT>
+ <UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Game Properties">
+ <param name="Local" value="html\mameui_properties.htm">
+ </OBJECT>
+ </UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Help Menu">
+ <param name="Local" value="html\mameui_help.htm">
+ </OBJECT>
+ </UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="MameUI Troubleshooting">
+ <param name="Local" value="html\mameui_support.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="MameUI Credits &amp; Resources">
+ <param name="Local" value="html\mameui_credits.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Game Changes">
+ <param name="Local" value="html\mameui_changes.txt">
+ <param name="New" value="1">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Mame Documents">
+ </OBJECT>
+ <UL>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Mame License">
+ <param name="Local" value="docs\Mame License.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Mame Terms of Use">
+ <param name="Local" value="docs\Mame Statement of Purpose.htm">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Mame Release Notes">
+ <param name="Local" value="docs\whatsnew.txt">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Mame Configuration &amp; Usage">
+ <param name="Local" value="docs\Command Line Settings.htm">
+ </OBJECT>
+ </UL>
+</UL>
+</BODY></HTML>
diff --git a/docs/release/src/osd/winui/help/mameui.hhk b/docs/release/src/osd/winui/help/mameui.hhk
new file mode 100644
index 00000000000..c0ba08a9ac4
--- /dev/null
+++ b/docs/release/src/osd/winui/help/mameui.hhk
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<HTML>
+<HEAD>
+<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
+<!-- Sitemap 1.0 -->
+</HEAD><BODY>
+<UL>
+</UL>
+</BODY></HTML>
diff --git a/docs/release/src/osd/winui/help/mameui.hhp b/docs/release/src/osd/winui/help/mameui.hhp
new file mode 100644
index 00000000000..c0e4e40c160
--- /dev/null
+++ b/docs/release/src/osd/winui/help/mameui.hhp
@@ -0,0 +1,24 @@
+[OPTIONS]
+Binary Index=No
+Compatibility=1.1 or later
+Compiled file=MameUI.chm
+Contents file=mameui.hhc
+Default Window=Baseline
+Default topic=.\html\mameUI_changes.txt
+Display compile progress=No
+Full text search stop list file=stoplist.stp
+Full-text search=Yes
+Index file=mameui.hhk
+Language=0x409 English (United States)
+Title=MameUI Help
+
+[WINDOWS]
+Baseline="MameUI Help","mameUI.hhc",,"html\mameUI_changes.txt",,,,,,0x22520,260,0x300c,[100,100,974,615],,,,,,,0
+
+
+[TEXT POPUPS]
+cntx_help.txt
+reshelp.h
+
+[INFOTYPES]
+
diff --git a/docs/release/src/osd/winui/help/mameui.hm b/docs/release/src/osd/winui/help/mameui.hm
new file mode 100644
index 00000000000..a1f1e82f2ea
--- /dev/null
+++ b/docs/release/src/osd/winui/help/mameui.hm
@@ -0,0 +1,135 @@
+// MAKEHELP.BAT generated Help Map file. Used by MAME32.HHP.
+
+// Commands (ID_* and IDM_*)
+HID_TOOLBAR_EDIT 0x1005C
+HID_CONTEXT_SHOW_FOLDER_START 0x19858
+HID_CONTEXT_SHOW_FOLDER_END 0x19920
+HID_FILE_EXIT 0x19C41
+HID_ABOUT 0x19C43
+HID_FILE_PLAY 0x19C44
+HID_HELP_ABOUT 0x19C46
+HID_VIEW_LARGE_ICON 0x19C47
+HID_VIEW_SMALL_ICON 0x19C48
+HID_VIEW_LIST_MENU 0x19C49
+HID_VIEW_DETAIL 0x19C4A
+HID_VIEW_GROUPED 0x19C4B
+HID_OPTIONS_FONT 0x19C4C
+HID_OPTIONS_CLONE_COLOR 0x19C4D
+HID_OPTIONS_DIR 0x19C4E
+HID_OPTIONS_DEFAULTS 0x19C4F
+HID_OPTIONS_RESET_DEFAULTS 0x19C50
+HID_OPTIONS_INTERFACE 0x19C51
+HID_FILE_AUDIT 0x19C52
+HID_FILE_PLAY_RECORD 0x19C53
+HID_FILE_PLAY_BACK 0x19C54
+HID_FILE_PLAY_RECORD_WAVE 0x19C55
+HID_FILE_PLAY_RECORD_MNG 0x19C56
+HID_VIEW_PICTURE_AREA 0x19C57
+HID_FILE_PLAY_RECORD_AVI 0x19C58
+HID_HELP_CONTENTS 0x19C59
+HID_HELP_WHATS_NEW32 0x19C5A
+HID_HELP_TROUBLE 0x19C5B
+HID_HELP_RELEASE 0x19C5C
+HID_HELP_WHATS_NEW 0x19C5D
+HID_HELP_CHEATS 0x19C5E
+HID_VIEW_BYGAME 0x19C62
+HID_VIEW_BYDIRECTORY 0x19C63
+HID_VIEW_BYMANUFACTURER 0x19C64
+HID_VIEW_BYYEAR 0x19C65
+HID_VIEW_BYTYPE 0x19C66
+HID_VIEW_BYTIMESPLAYED 0x19C67
+HID_VIEW_LINEUPICONS 0x19C68
+HID_UPDATE_GAMELIST 0x19C6A
+HID_SORT_ASCENDING 0x19C6D
+HID_SORT_DESCENDING 0x19C6E
+HID_CUSTOMIZE_FIELDS 0x19C70
+HID_GAME_PROPERTIES 0x19C71
+HID_VIEW_PAGETAB 0x19C72
+HID_VIEW_FOLDERS 0x19C73
+HID_VIEW_TOOLBARS 0x19C74
+HID_VIEW_STATUS 0x19C75
+HID_CONTEXT_FILTERS 0x19C76
+HID_CONTEXT_RENAME_CUSTOM 0x19C77
+HID_CONTEXT_ADD_CUSTOM 0x19C79
+HID_CONTEXT_REMOVE_CUSTOM 0x19C7A
+HID_GAME_AUDIT 0x19C7B
+HID_CONTEXT_SELECT_RANDOM 0x19C7C
+HID_OPTIONS_LANGUAGE 0x19C7D
+HID_VIEW_TAB_SCREENSHOT 0x19C7E
+HID_VIEW_TAB_FLYER 0x19C7F
+HID_VIEW_TAB_CABINET 0x19C80
+HID_VIEW_TAB_MARQUEE 0x19C81
+HID_VIEW_TAB_TITLE 0x19C82
+HID_VIEW_TAB_CONTROL_PANEL 0x19C83
+HID_VIEW_TAB_PCB 0x19C84
+HID_VIEW_TAB_HISTORY 0x19C85
+HID_OPTIONS_BG 0x19C86
+HID_TOGGLE_TAB_SCREENSHOT 0x19C87
+HID_TOGGLE_TAB_FLYER 0x19C88
+HID_TOGGLE_TAB_CABINET 0x19C89
+HID_TOGGLE_TAB_MARQUEE 0x19C8A
+HID_TOGGLE_TAB_TITLE 0x19C8B
+HID_TOGGLE_TAB_CONTROL_PANEL 0x19C8C
+HID_TOGGLE_TAB_PCB 0x19C8D
+HID_TOGGLE_TAB_HISTORY 0x19C8E
+HID_VIEW_FULLSCREEN 0x19C8F
+HID_CONTEXT_RESET_PLAYTIME 0x19C90
+HID_CONTEXT_RESET_PLAYCOUNT 0x19C91
+HID_FOLDER_PROPERTIES 0x19C92
+HID_FOLDER_AUDIT 0x19C93
+HID_UI_UP 0x19C94
+HID_UI_DOWN 0x19C95
+HID_UI_LEFT 0x19C96
+HID_UI_RIGHT 0x19C97
+HID_UI_START 0x19C98
+HID_UI_PGUP 0x19C99
+HID_UI_PGDOWN 0x19C9A
+HID_UI_HOME 0x19C9B
+HID_UI_END 0x19C9C
+HID_UI_HISTORY_UP 0x19C9D
+HID_UI_HISTORY_DOWN 0x19C9E
+HID_FILE_LOADSTATE 0x19C9F
+HID_FOLDER_SOURCEPROPERTIES 0x19CA0
+HID_FOLDER_VECTORPROPERTIES 0x19CA1
+HID_ARRANGE_ICONS 0x19CA2
+
+// Prompts (IDP_*)
+
+// Resources (IDR_*)
+HIDR_MAIN_MENU 0x2006D
+HIDR_UI_MENU 0x2006E
+HIDR_CONTEXT_MENU 0x20076
+HIDR_CONTEXT_HEADER 0x20097
+HIDR_CONTEXT_TREE 0x200A8
+HIDR_CONTEXT_SCREENSHOT 0x200B5
+
+// Dialogs (IDD_*)
+HIDD_MAIN 0x20065
+HIDD_ABOUT 0x2006C
+HIDD_DIRECTX 0x20072
+HIDD_AUDIT 0x20073
+HIDD_DIRECTORIES 0x20074
+HIDD_CUSTOM_FILE 0x20075
+HIDD_PROP_GAME 0x20098
+HIDD_PROP_AUDIT 0x20099
+HIDD_PROP_DISPLAY 0x2009A
+HIDD_PROP_SOUND 0x2009B
+HIDD_PROP_ADVANCED 0x2009C
+HIDD_PROP_INPUT 0x2009D
+HIDD_PROP_MISC 0x2009E
+HIDD_PROP_VECTOR 0x2009F
+HIDD_COLUMNS 0x200A0
+HIDD_FILTERS 0x200A9
+HIDD_RESET 0x200AA
+HIDD_LOAD_PROGRESS 0x200AB
+HIDD_INTERFACE_OPTIONS 0x200AD
+HIDD_PROP_HISTORY 0x200B0
+HIDD_ROM_ERROR 0x200B1
+HIDD_LANGUAGE 0x200B2
+HIDD_ERROR 0x200B3
+HIDD_PROP_DIRECT3D 0x200B8
+HIDD_PROP_CONTROLLER 0x200B9
+HIDD_PROP_SCREEN 0x200BB
+
+// Frame Controls (IDW_*)
+HIDW_STATUS 0x50070
diff --git a/docs/release/src/osd/winui/help/reshelp.h b/docs/release/src/osd/winui/help/reshelp.h
new file mode 100644
index 00000000000..709a8058cb1
--- /dev/null
+++ b/docs/release/src/osd/winui/help/reshelp.h
@@ -0,0 +1,4 @@
+// Include the Microsoft Developer Studio generated Help ID include file.
+//
+#include "..\resource.hm"
+#include "mame32.hm"
diff --git a/docs/release/src/osd/winui/help/stoplist.stp b/docs/release/src/osd/winui/help/stoplist.stp
new file mode 100644
index 00000000000..11255546e24
--- /dev/null
+++ b/docs/release/src/osd/winui/help/stoplist.stp
@@ -0,0 +1,88 @@
+a
+about
+after
+against
+all
+also
+among
+an
+and
+are
+as
+at
+be
+became
+because
+been
+between
+but
+by
+can
+come
+do
+during
+each
+early
+for
+form
+found
+from
+had
+has
+have
+he
+mame32
+his
+however
+in
+include
+into
+is
+it
+its
+late
+later
+me
+med
+made
+many
+may
+more
+most
+near
+no
+non
+not
+of
+on
+only
+or
+other
+over
+several
+she
+some
+such
+than
+that
+the
+their
+then
+there
+these
+they
+this
+through
+to
+under
+until
+use
+was
+we
+were
+when
+where
+which
+who
+with
+you \ No newline at end of file
diff --git a/docs/release/src/osd/winui/helpids.cpp b/docs/release/src/osd/winui/helpids.cpp
new file mode 100644
index 00000000000..31e5e15ffc4
--- /dev/null
+++ b/docs/release/src/osd/winui/helpids.cpp
@@ -0,0 +1,125 @@
+/*
+ * Help ID array - Generated by mkhelp
+ */
+
+#include <windows.h>
+#include "resource.h"
+#include "resource.hm"
+
+extern const DWORD dwHelpIDs[] =
+{
+ IDC_ADSTICK ,HIDC_ADSTICK,
+ IDC_ARTWORK_CROP ,HIDC_ARTWORK_CROP,
+ IDC_ASPECT ,HIDC_ASPECT,
+ IDC_ASPECTRATIOD ,HIDC_ASPECTRATIOD,
+ IDC_ASPECTRATION ,HIDC_ASPECTRATION,
+ IDC_AUDIO_LATENCY ,HIDC_AUDIO_LATENCY,
+ IDC_AUTOFRAMESKIP ,HIDC_AUTOFRAMESKIP,
+ IDC_BACKDROPS ,HIDC_BACKDROPS,
+ IDC_BEAM ,HIDC_BEAM,
+ IDC_BEZELS ,HIDC_BEZELS,
+ IDC_BIOS ,HIDC_BIOS,
+ IDC_BRIGHTCORRECT ,HIDC_BRIGHTCORRECT,
+ IDC_CHEAT ,HIDC_CHEAT,
+ IDC_COINLOCKOUT ,HIDC_COINLOCKOUT,
+ IDC_CONTRAST ,HIDC_CONTRAST,
+ IDC_CYCLETIMESEC ,HIDC_CYCLETIMESEC,
+ IDC_D3D_FILTER ,HIDC_D3D_FILTER,
+ IDC_DEBUG ,HIDC_DEBUG,
+ IDC_DEFAULT_INPUT ,HIDC_DEFAULT_INPUT,
+ IDC_DIAL ,HIDC_DIAL,
+ IDC_DUAL_LIGHTGUN ,HIDC_DUAL_LIGHTGUN,
+ IDC_ENABLE_AUTOSAVE ,HIDC_ENABLE_AUTOSAVE,
+ IDC_FILTER_CLONES ,HIDC_FILTER_CLONES,
+ IDC_FILTER_EDIT ,HIDC_FILTER_EDIT,
+ IDC_FILTER_HORIZONTAL ,HIDC_FILTER_HORIZONTAL,
+ IDC_FILTER_MECHANICAL ,HIDC_FILTER_MECHANICAL,
+ IDC_FILTER_NONWORKING ,HIDC_FILTER_NONWORKING,
+ IDC_FILTER_ORIGINALS ,HIDC_FILTER_ORIGINALS,
+ IDC_FILTER_RASTER ,HIDC_FILTER_RASTER,
+ IDC_FILTER_UNAVAILABLE ,HIDC_FILTER_UNAVAILABLE,
+ IDC_FILTER_VECTOR ,HIDC_FILTER_VECTOR,
+ IDC_FILTER_VERTICAL ,HIDC_FILTER_VERTICAL,
+ IDC_FILTER_WORKING ,HIDC_FILTER_WORKING,
+ IDC_FLICKER ,HIDC_FLICKER,
+ IDC_FLIPX ,HIDC_FLIPX,
+ IDC_FLIPY ,HIDC_FLIPY,
+ IDC_FRAMESKIP ,HIDC_FRAMESKIP,
+ IDC_FSBRIGHTNESS ,HIDC_FSBRIGHTNESS,
+ IDC_FSCONTRAST ,HIDC_FSCONTRAST,
+ IDC_FSGAMMA ,HIDC_FSGAMMA,
+ IDC_GAMMA ,HIDC_GAMMA,
+ IDC_HIDE_MOUSE ,HIDC_HIDE_MOUSE,
+ IDC_HIGH_PRIORITY ,HIDC_HIGH_PRIORITY,
+ IDC_HISTORY ,HIDC_HISTORY,
+ IDC_HWSTRETCH ,HIDC_HWSTRETCH,
+ IDC_JDZ ,HIDC_JDZ,
+ IDC_JOY_GUI ,HIDC_JOY_GUI,
+ IDC_JOYSTICK ,HIDC_JOYSTICK,
+ IDC_JSAT ,HIDC_JSAT,
+ IDC_KEEPASPECT ,HIDC_KEEPASPECT,
+ IDC_LIGHTGUN ,HIDC_LIGHTGUN,
+ IDC_LIGHTGUNDEVICE ,HIDC_LIGHTGUNDEVICE,
+ IDC_LOG ,HIDC_LOG,
+ IDC_MAXIMIZE ,HIDC_MAXIMIZE,
+ IDC_MOUSE ,HIDC_MOUSE,
+ IDC_MULTIKEYBOARD ,HIDC_MULTIKEYBOARD,
+ IDC_MULTIMOUSE ,HIDC_MULTIMOUSE,
+ IDC_MULTITHREAD_RENDERING ,HIDC_MULTITHREAD_RENDERING,
+ IDC_NUMSCREENS ,HIDC_NUMSCREENS,
+ IDC_OSLOG ,HIDC_OSLOG,
+ IDC_OVERLAYS ,HIDC_OVERLAYS,
+ IDC_PADDLE ,HIDC_PADDLE,
+ IDC_PAUSEBRIGHT ,HIDC_PAUSEBRIGHT,
+ IDC_PEDAL ,HIDC_PEDAL,
+ IDC_POSITIONAL ,HIDC_POSITIONAL,
+ IDC_PRESCALE ,HIDC_PRESCALE,
+ IDC_PROP_RESET ,HIDC_PROP_RESET,
+ IDC_REFRESH ,HIDC_REFRESH,
+ IDC_REFRESHSPEED ,HIDC_REFRESHSPEED,
+ IDC_RELOAD ,HIDC_RELOAD,
+ IDC_RESET_DEBUGSCRIPT ,HIDC_RESET_DEBUGSCRIPT,
+ IDC_RESET_DEFAULT ,HIDC_RESET_DEFAULT,
+ IDC_RESET_EFFECT ,HIDC_RESET_EFFECT,
+ IDC_RESET_FILTERS ,HIDC_RESET_FILTERS,
+ IDC_RESET_GAMES ,HIDC_RESET_GAMES,
+ IDC_RESET_JOYSTICKMAP ,HIDC_RESET_JOYSTICKMAP,
+ IDC_RESET_UI ,HIDC_RESET_UI,
+ IDC_ROTATE ,HIDC_ROTATE,
+ IDC_SAMPLERATE ,HIDC_SAMPLERATE,
+ IDC_SAMPLES ,HIDC_SAMPLES,
+ IDC_SCREEN ,HIDC_SCREEN,
+ IDC_SCREENSELECT ,HIDC_SCREENSELECT,
+ IDC_SECONDSTORUN ,HIDC_SECONDSTORUN,
+ IDC_SELECT_DEBUGSCRIPT ,HIDC_SELECT_DEBUGSCRIPT,
+ IDC_SELECT_EFFECT ,HIDC_SELECT_EFFECT,
+ IDC_SELECT_JOYSTICKMAP ,HIDC_SELECT_JOYSTICKMAP,
+ IDC_SIZES ,HIDC_SIZES,
+ IDC_SKIP_GAME_INFO ,HIDC_SKIP_GAME_INFO,
+ IDC_SLEEP ,HIDC_SLEEP,
+ IDC_SNAPNAME ,HIDC_SNAPNAME,
+ IDC_SNAPSIZE ,HIDC_SNAPSIZE,
+ IDC_SNAPSIZEHEIGHT ,HIDC_SNAPSIZEHEIGHT,
+ IDC_SNAPSIZEWIDTH ,HIDC_SNAPSIZEWIDTH,
+ IDC_SNAPVIEW ,HIDC_SNAPVIEW,
+ IDC_SPEED ,HIDC_SPEED,
+ IDC_START_GAME_CHECK ,HIDC_START_GAME_CHECK,
+ IDC_STEADYKEY ,HIDC_STEADYKEY,
+ IDC_STRETCH_SCREENSHOT_LARGER ,HIDC_STRETCH_SCREENSHOT_LARGER,
+ IDC_SWITCHRES ,HIDC_SWITCHRES,
+ IDC_SYNCREFRESH ,HIDC_SYNCREFRESH,
+ IDC_THROTTLE ,HIDC_THROTTLE,
+ IDC_TRACKBALL ,HIDC_TRACKBALL,
+ IDC_TRIPLE_BUFFER ,HIDC_TRIPLE_BUFFER,
+ IDC_UPDATEINPAUSE ,HIDC_UPDATEINPAUSE,
+ IDC_USE_DEFAULT ,HIDC_USE_DEFAULT,
+ IDC_USE_MOUSE ,HIDC_USE_MOUSE,
+ IDC_VERBOSE ,HIDC_VERBOSE,
+ IDC_VIDEO_MODE ,HIDC_VIDEO_MODE,
+ IDC_VIEW ,HIDC_VIEW,
+ IDC_VOLUME ,HIDC_VOLUME,
+ IDC_WAITVSYNC ,HIDC_WAITVSYNC,
+ IDC_WINDOWED ,HIDC_WINDOWED,
+ 0 ,0
+
+};
diff --git a/docs/release/src/osd/winui/history.cpp b/docs/release/src/osd/winui/history.cpp
new file mode 100644
index 00000000000..6d7dbe7970e
--- /dev/null
+++ b/docs/release/src/osd/winui/history.cpp
@@ -0,0 +1,665 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+/***************************************************************************
+
+ history.cpp
+
+ * history functions.
+ * History database engine
+ * Collect all information on the selected driver, and return it as
+ * a string. Called by winui.cpp
+
+ * Token parsing by Neil Bradley
+ * Modifications and higher-level functions by John Butler
+
+ * Further work by Mamesick and Robbbert
+
+ * Completely rewritten by Robbbert in July 2017
+ * Notes:
+ * - The order listed in m_gameInfo is the order the data is displayed.
+ * - The other tables must have the files in the same places so that
+ * the index numbers line up. Anything with NULL indicates an
+ * unsupported option (the file doesn't contain the info).
+ * - Each table must contain at least MAX_HFILES members (extra lines
+ * are ignored)
+ * - Software comes first, followed by Game then Source.
+***************************************************************************/
+// license:BSD-3-Clause
+// copyright-holders:Chris Kirmse, Mike Haaland, René Single, Mamesick, Robbbert
+
+#include <windows.h>
+#include <fstream>
+
+// MAME/MAMEUI headers
+#include "emu.h"
+#include "screen.h"
+#include "speaker.h"
+#include "drivenum.h"
+#include "mui_util.h"
+#include "mui_opts.h"
+#include "sound/samples.h"
+
+#define WINUI_ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
+
+
+/****************************************************************************
+ * struct definitions
+ ****************************************************************************/
+typedef struct
+{
+ LPCSTR filename;
+ LPCSTR header;
+ LPCSTR descriptor;
+ bool bClone; // if nothing found for a clone, try the parent
+}
+HGAMEINFO;
+
+typedef struct
+{
+ LPCSTR filename;
+ LPCSTR header;
+ LPCSTR descriptor;
+}
+HSOURCEINFO;
+
+/*************************** START CONFIGURABLE AREA *******************************/
+// number of dats we support
+#define MAX_HFILES 8
+// The order of these is the order they are displayed
+const HGAMEINFO m_gameInfo[MAX_HFILES] =
+{
+ { "history.dat", "\n**** :HISTORY: ****\n\n", "$bio", 1 },
+ { "sysinfo.dat", "\n**** :SYSINFO: ****\n\n", "$bio", 1 },
+ { "messinfo.dat", "\n**** :MESSINFO: ****\n\n", "$mame", 1 },
+ { "mameinfo.dat", "\n**** :MAMEINFO: ****\n\n", "$mame", 1 },
+ { "gameinit.dat", "\n**** :GAMEINIT: ****\n\n", "$mame", 1 },
+ { "command.dat", "\n**** :COMMANDS: ****\n\n", "$cmd", 1 },
+ { "story.dat", "\n**** :HIGH SCORES: ****\n\n", "$story", 0 },
+ { "marp.dat", "\n**** :MARP HIGH SCORES: ****\n\n", "$marp", 0 },
+};
+
+const HSOURCEINFO m_sourceInfo[MAX_HFILES] =
+{
+ { NULL },
+ { NULL },
+ { "messinfo.dat", "\n***:MESSINFO DRIVER: ", "$drv" },
+ { "mameinfo.dat", "\n***:MAMEINFO DRIVER: ", "$drv" },
+ { NULL },
+ { NULL },
+ { NULL },
+ { NULL },
+};
+
+const HSOURCEINFO m_swInfo[MAX_HFILES] =
+{
+ { "history.dat", "\n**** :HISTORY item: ", "$bio" },
+ { NULL },
+ { NULL },
+ { NULL },
+ { NULL },
+ { NULL },
+ { NULL },
+ { NULL },
+};
+
+/*************************** END CONFIGURABLE AREA *******************************/
+
+int file_sizes[MAX_HFILES] = { 0, };
+std::map<std::string, std::streampos> mymap[MAX_HFILES];
+
+static bool create_index(std::ifstream &fp, int filenum)
+{
+ if (!fp.good())
+ return false;
+ // get file size
+ fp.seekg(0, std::ios::end);
+ size_t file_size = fp.tellg();
+ // same file as before?
+ if (file_size == file_sizes[filenum])
+ return true;
+ // new file, it needs to be indexed
+ mymap[filenum].clear();
+ file_sizes[filenum] = file_size;
+ fp.seekg(0);
+ std::string file_line, first, second;
+ std::getline(fp, file_line);
+ int position = file_line.size() + 2; // tellg is buggy, this works and is faster
+ while (fp.good())
+ {
+ char t1 = file_line[0];
+ if ((std::count(file_line.begin(),file_line.end(),'=') == 1) && (t1 == '$')) // line must start with $ and contain one =
+ {
+ // now start by removing all spaces
+ file_line.erase(remove_if(file_line.begin(), file_line.end(), ::isspace), file_line.end());
+ char s[file_line.length()+1];
+ strcpy(s, file_line.c_str());
+
+ const char* first = strtok(s, "="); // get first part of key
+ char* second = strtok(NULL, ","); // get second part
+ while (second)
+ {
+ // store into index
+ mymap[filenum][std::string(first) + std::string("=") + std::string(second)] = position;
+ second = strtok(NULL, ",");
+ }
+ }
+ std::getline(fp, file_line);
+ position += (file_line.size() + 2);
+ }
+ // check contents
+// if (filenum == 0)
+// for (auto const &it : mymap[filenum])
+// printf("%s = %X\n", it.first.c_str(), int(it.second));
+ return true;
+}
+
+static std::string load_datafile_text(std::ifstream &fp, std::string keycode, int filenum, const char *tag)
+{
+ std::string readbuf;
+
+ auto search = mymap[filenum].find(keycode);
+ if (search != mymap[filenum].end())
+ {
+ std::streampos offset = mymap[filenum].find(keycode)->second;
+ fp.seekg(offset);
+ std::string file_line;
+
+ /* read text until buffer is full or end of entry is encountered */
+ while (std::getline(fp, file_line))
+ {
+ //printf("%s\n",file_line.c_str());
+ if (file_line.find("$end")==0)
+ break;
+
+ if (file_line.find(tag)==0)
+ continue;
+
+ readbuf.append(file_line).append("\n");
+ }
+ }
+
+ return readbuf;
+}
+
+std::string load_swinfo(const game_driver *drv, const char* datsdir, std::string software, int filenum)
+{
+ std::string buffer;
+ // if it's a NULL record exit now
+ if (!m_swInfo[filenum].filename)
+ return buffer;
+
+ // datafile name
+ std::string buf, filename = datsdir + std::string("\\") + m_swInfo[filenum].filename;
+ std::ifstream fp (filename);
+
+ /* try to open datafile */
+ if (create_index(fp, filenum))
+ {
+ size_t i = software.find(":");
+ std::string ssys = software.substr(0, i);
+ std::string ssoft = software.substr(i+1);
+ std::string first = std::string("$") + ssys + std::string("=") + ssoft;
+ // get info on software
+ buf = load_datafile_text(fp, first, filenum, m_swInfo[filenum].descriptor);
+
+ if (!buf.empty())
+ buffer.append(m_swInfo[filenum].header).append(ssoft).append("\n").append(buf).append("\n\n\n");
+
+ fp.close();
+ }
+
+ return buffer;
+}
+
+std::string load_gameinfo(const game_driver *drv, const char* datsdir, int filenum)
+{
+ std::string buffer;
+ // if it's a NULL record exit now
+ if (!m_gameInfo[filenum].filename)
+ return buffer;
+
+ // datafile name
+ std::string buf, filename = datsdir + std::string("\\") + m_gameInfo[filenum].filename;
+ std::ifstream fp (filename);
+
+ /* try to open datafile */
+ if (create_index(fp, filenum))
+ {
+ std::string first = std::string("$info=")+drv->name;
+ // get info on game
+ buf = load_datafile_text(fp, first, filenum, m_gameInfo[filenum].descriptor);
+
+ // if nothing, and it's a clone, and it's allowed, try the parent
+ if (buf.empty() && m_gameInfo[filenum].bClone)
+ {
+ int g = driver_list::clone(*drv);
+ if (g != -1)
+ {
+ drv = &driver_list::driver(g);
+ first = std::string("$info=")+drv->name;
+ buf = load_datafile_text(fp, first, filenum, m_gameInfo[filenum].descriptor);
+ }
+ }
+
+ if (!buf.empty())
+ buffer.append(m_gameInfo[filenum].header).append(buf).append("\n\n\n");
+
+ fp.close();
+ }
+
+ return buffer;
+}
+
+std::string load_sourceinfo(const game_driver *drv, const char* datsdir, int filenum)
+{
+ std::string buffer;
+ // if it's a NULL record exit now
+ if (!m_sourceInfo[filenum].filename)
+ return buffer;
+
+ // datafile name
+ std::string buf, filename = datsdir + std::string("\\") + m_sourceInfo[filenum].filename;
+ std::ifstream fp (filename);
+
+ std::string source = drv->type.source();
+ size_t i = source.find_last_of("/");
+ source.erase(0,i+1);
+
+ if (create_index(fp, filenum))
+ {
+ std::string first = std::string("$info=")+source;
+ // get info on game driver source
+ buf = load_datafile_text(fp, first, filenum, m_sourceInfo[filenum].descriptor);
+
+ if (!buf.empty())
+ buffer.append(m_sourceInfo[filenum].header).append(source).append("\n").append(buf).append("\n\n\n");
+
+ fp.close();
+ }
+
+ return buffer;
+}
+
+
+// General hardware information
+std::string load_driver_geninfo(const game_driver *drv, int drvindex)
+{
+ machine_config config(*drv, MameUIGlobal());
+ const game_driver *parent = NULL;
+ char name[512];
+ bool is_bios = false;
+ std::string buffer = "\n**** :GENERAL MACHINE INFO: ****\n\n";
+
+ /* List the game info 'flags' */
+ uint32_t cache = GetDriverCacheLower(drvindex);
+ if (BIT(cache, 6))
+ buffer.append("This game doesn't work properly\n");
+
+ if (BIT(cache, 22))
+ buffer.append("This game has protection which isn't fully emulated.\n");
+
+ if (BIT(cache, 18))
+ buffer.append("The video emulation isn't 100% accurate.\n");
+
+ if (BIT(cache, 21))
+ buffer.append("The colors are completely wrong.\n");
+
+ if (BIT(cache, 20))
+ buffer.append("The colors aren't 100% accurate.\n");
+
+ if (BIT(cache, 17))
+ buffer.append("This game lacks sound.\n");
+
+ if (BIT(cache, 16))
+ buffer.append("The sound emulation isn't 100% accurate.\n");
+
+ if (BIT(cache, 7))
+ buffer.append("Save state not supported.\n");
+
+ if (BIT(cache, 14))
+ buffer.append("This game contains mechanical parts.\n");
+
+ if (BIT(cache, 15))
+ buffer.append("This game was never completed.\n");
+
+ if (BIT(cache, 13))
+ buffer.append("This game has no sound hardware.\n");
+
+ buffer.append("\n");
+
+ if (drv->flags & MACHINE_IS_BIOS_ROOT)
+ is_bios = true;
+
+ /* GAME INFORMATIONS */
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "\nGAME: %s\n", drv->name);
+ buffer.append(name);
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%s", drv->type.fullname());
+ buffer.append(name);
+ snprintf(name, WINUI_ARRAY_LENGTH(name), " (%s %s)\n\nCPU:\n", drv->manufacturer, drv->year);
+ buffer.append(name);
+ /* iterate over CPUs */
+ execute_interface_iterator cpuiter(config.root_device());
+ std::unordered_set<std::string> exectags;
+
+ for (device_execute_interface &exec : cpuiter)
+ {
+ if (!exectags.insert(exec.device().tag()).second)
+ continue;
+
+ int count = 1;
+ int clock = exec.device().clock();
+ const char *cpu_name = exec.device().name();
+
+ for (device_execute_interface &scan : cpuiter)
+ if (exec.device().type() == scan.device().type() && strcmp(cpu_name, scan.device().name()) == 0 && clock == scan.device().clock())
+ if (exectags.insert(scan.device().tag()).second)
+ count++;
+
+ if (count > 1)
+ {
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%d x ", count);
+ buffer.append(name);
+ }
+
+ if (clock >= 1000000)
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%s %d.%06d MHz\n", cpu_name, clock / 1000000, clock % 1000000);
+ else
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%s %d.%03d kHz\n", cpu_name, clock / 1000, clock % 1000);
+
+ buffer.append(name);
+ }
+
+ buffer.append("\nSOUND:\n");
+ int has_sound = 0;
+ /* iterate over sound chips */
+ sound_interface_iterator sounditer(config.root_device());
+ std::unordered_set<std::string> soundtags;
+
+ for (device_sound_interface &sound : sounditer)
+ {
+ if (!soundtags.insert(sound.device().tag()).second)
+ continue;
+
+ has_sound = 1;
+ int count = 1;
+ int clock = sound.device().clock();
+ const char *sound_name = sound.device().name();
+
+ for (device_sound_interface &scan : sounditer)
+ if (sound.device().type() == scan.device().type() && strcmp(sound_name, scan.device().name()) == 0 && clock == scan.device().clock())
+ if (soundtags.insert(scan.device().tag()).second)
+ count++;
+
+ if (count > 1)
+ {
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%d x ", count);
+ buffer.append(name);
+ }
+
+ buffer.append(sound_name);
+
+ if (clock)
+ {
+ if (clock >= 1000000)
+ snprintf(name, WINUI_ARRAY_LENGTH(name), " %d.%06d MHz", clock / 1000000, clock % 1000000);
+ else
+ snprintf(name, WINUI_ARRAY_LENGTH(name), " %d.%03d kHz", clock / 1000, clock % 1000);
+
+ buffer.append(name);
+ }
+
+ buffer.append("\n");
+ }
+
+ if (has_sound)
+ {
+ speaker_device_iterator audioiter(config.root_device());
+ int channels = audioiter.count();
+
+ if(channels == 1)
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%d Channel\n", channels);
+ else
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%d Channels\n", channels);
+
+ buffer.append(name);
+ }
+
+ buffer.append("\nVIDEO:\n");
+ screen_device_iterator screeniter(config.root_device());
+ int scrcount = screeniter.count();
+
+ if (scrcount == 0)
+ buffer.append("Screenless");
+ else
+ {
+ for (screen_device &screen : screeniter)
+ {
+ if (screen.screen_type() == SCREEN_TYPE_VECTOR)
+ buffer.append("Vector");
+ else
+ {
+ const rectangle &visarea = screen.visible_area();
+
+ if (drv->flags & ORIENTATION_SWAP_XY)
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%d x %d (V) %f Hz", visarea.width(), visarea.height(), ATTOSECONDS_TO_HZ(screen.refresh_attoseconds()));
+ else
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%d x %d (H) %f Hz", visarea.width(), visarea.height(), ATTOSECONDS_TO_HZ(screen.refresh_attoseconds()));
+
+ buffer.append(name);
+ }
+
+ buffer.append("\n");
+ }
+ }
+
+ buffer.append("\nROM REGION:\n");
+ int g = driver_list::clone(*drv);
+
+ if (g != -1)
+ parent = &driver_list::driver(g);
+
+ for (device_t &device : device_iterator(config.root_device()))
+ {
+ for (const rom_entry *region = rom_first_region(device); region; region = rom_next_region(region))
+ {
+ for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ {
+ util::hash_collection hashes(ROM_GETHASHDATA(rom));
+
+ if (g != -1)
+ {
+ machine_config pconfig(*parent, MameUIGlobal());
+
+ for (device_t &device : device_iterator(pconfig.root_device()))
+ {
+ for (const rom_entry *pregion = rom_first_region(device); pregion; pregion = rom_next_region(pregion))
+ {
+ for (const rom_entry *prom = rom_first_file(pregion); prom; prom = rom_next_file(prom))
+ {
+ util::hash_collection phashes(ROM_GETHASHDATA(prom));
+
+ if (hashes == phashes)
+ break;
+ }
+ }
+ }
+ }
+
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%-16s \t", ROM_GETNAME(rom));
+ buffer.append(name);
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%09d \t", rom_file_size(rom));
+ buffer.append(name);
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%-10s", ROMREGION_GETTAG(region));
+ buffer.append(name).append("\n");
+ }
+ }
+ }
+
+ for (samples_device &device : samples_device_iterator(config.root_device()))
+ {
+ samples_iterator sampiter(device);
+
+ if (sampiter.altbasename())
+ {
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "\nSAMPLES (%s):\n", sampiter.altbasename());
+ buffer.append(name);
+ }
+
+ std::unordered_set<std::string> already_printed;
+
+ for (const char *samplename = sampiter.first(); samplename; samplename = sampiter.next())
+ {
+ // filter out duplicates
+ if (!already_printed.insert(samplename).second)
+ continue;
+
+ // output the sample name
+ snprintf(name, WINUI_ARRAY_LENGTH(name), "%s.wav\n", samplename);
+ buffer.append(name);
+ }
+ }
+
+ if (!is_bios)
+ {
+ int g = driver_list::clone(*drv);
+
+ if (g != -1)
+ drv = &driver_list::driver(g);
+
+ buffer.append("\nORIGINAL:\n");
+ buffer.append(drv->type.fullname());
+ buffer.append("\n\nCLONES:\n");
+
+ for (int i = 0; i < driver_list::total(); i++)
+ {
+ if (!strcmp (drv->name, driver_list::driver(i).parent))
+ {
+ buffer.append(driver_list::driver(i).type.fullname());
+ buffer.append("\n");
+ }
+ }
+ }
+
+ std::string temp = core_filename_extract_base(drv->type.source(), false);
+ char source_file[temp.size()+1], tmp[2048];
+ strcpy(source_file, temp.c_str());
+ snprintf(tmp, WINUI_ARRAY_LENGTH(tmp), "\nGENERAL SOURCE INFO: %s\n", temp.c_str());
+ buffer.append(tmp);
+ buffer.append("\nGAMES SUPPORTED:\n");
+
+ for (int i = 0; i < driver_list::total(); i++)
+ {
+ std::string t1 = driver_list::driver(i).type.source();
+ size_t j = t1.find_last_of("/");
+ t1.erase(0, j+1);
+ if ((strcmp(source_file, t1.c_str())==0) && !(DriverIsBios(i)))
+ buffer.append(driver_list::driver(i).type.fullname()).append("\n");
+ }
+
+ return buffer;
+}
+
+// This is check that the tables are at least as big as they should be
+bool validate_datfiles(void)
+{
+ bool result = true;
+ if (WINUI_ARRAY_LENGTH(m_gameInfo) < MAX_HFILES)
+ {
+ printf("m_gameInfo needs to have at least MAX_HFILES members\n");
+ result = false;
+ }
+
+ if (WINUI_ARRAY_LENGTH(m_sourceInfo) < MAX_HFILES)
+ {
+ printf("m_sourceInfo needs to have at least MAX_HFILES members\n");
+ result = false;
+ }
+
+ if (WINUI_ARRAY_LENGTH(m_swInfo) < MAX_HFILES)
+ {
+ printf("m_swInfo needs to have at least MAX_HFILES members\n");
+ result = false;
+ }
+
+ return result;
+}
+
+
+// For all of MAME builds - called by winui.cpp
+char * GetGameHistory(int driver_index, std::string software)
+{
+ std::string fullbuf;
+ if (driver_index < 0)
+ return ConvertToWindowsNewlines(fullbuf.c_str());
+
+ if (validate_datfiles())
+ {
+ // Get the path to dat files
+ std::string t = GetDatsDir();
+ char buf[t.size()+1];
+ strcpy(buf, t.c_str());
+ // only want first path
+ const char* datsdir = strtok(buf, ";");
+ // validate software
+ BOOL sw_valid = false;
+ if (!software.empty())
+ {
+ size_t i = software.find(':');
+ sw_valid = (i != std::string::npos) ? true : false;
+ }
+
+ if (datsdir && osd::directory::open(datsdir))
+ {
+ for (int filenum = 0; filenum < MAX_HFILES; filenum++)
+ {
+ if (sw_valid)
+ fullbuf.append(load_swinfo(&driver_list::driver(driver_index), datsdir, software, filenum));
+ fullbuf.append(load_gameinfo(&driver_list::driver(driver_index), datsdir, filenum));
+ fullbuf.append(load_sourceinfo(&driver_list::driver(driver_index), datsdir, filenum));
+ }
+ }
+ else
+ fullbuf = "\nThe path to your dat files is invalid.\n\n\n";
+ }
+ else
+ fullbuf = "\nUnable to display info due to an internal error.\n\n\n";
+
+ fullbuf.append(load_driver_geninfo(&driver_list::driver(driver_index), driver_index));
+
+ return ConvertToWindowsNewlines(fullbuf.c_str());
+}
+
+// For Arcade-only builds
+char * GetGameHistory(int driver_index)
+{
+ std::string fullbuf;
+ if (driver_index < 0)
+ return ConvertToWindowsNewlines(fullbuf.c_str());
+
+ if (validate_datfiles())
+ {
+ std::string t = GetDatsDir();
+ char buf[t.size()+1];
+ strcpy(buf, t.c_str());
+ // only want first path
+ const char* datsdir = strtok(buf, ";");
+
+ if (datsdir && osd::directory::open(datsdir))
+ {
+ for (int filenum = 0; filenum < MAX_HFILES; filenum++)
+ {
+ fullbuf.append(load_gameinfo(&driver_list::driver(driver_index), datsdir, filenum));
+ fullbuf.append(load_sourceinfo(&driver_list::driver(driver_index), datsdir, filenum));
+ }
+ }
+ else
+ fullbuf = "\nThe path to your dat files is invalid.\n\n\n";
+ }
+ else
+ fullbuf = "\nUnable to display info due to an internal error.\n\n\n";
+
+ fullbuf.append(load_driver_geninfo(&driver_list::driver(driver_index), driver_index));
+
+ return ConvertToWindowsNewlines(fullbuf.c_str());
+}
+
diff --git a/docs/release/src/osd/winui/history.h b/docs/release/src/osd/winui/history.h
new file mode 100644
index 00000000000..9a6803bad61
--- /dev/null
+++ b/docs/release/src/osd/winui/history.h
@@ -0,0 +1,13 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+#pragma once
+
+#ifndef HISTORY_H
+#define HISTORY_H
+
+char * GetGameHistory(int driver_index); // Arcade-only builds (HBMAME, ARCADE)
+char * GetGameHistory(int driver_index, std::string software); // Builds with software support (MESSUI, MAMEUI)
+
+#endif
diff --git a/docs/release/src/osd/winui/ini_opts.h b/docs/release/src/osd/winui/ini_opts.h
new file mode 100644
index 00000000000..ea7357a8a1d
--- /dev/null
+++ b/docs/release/src/osd/winui/ini_opts.h
@@ -0,0 +1,441 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+#ifndef WINUI_INIOPTS_H
+#define WINUI_INIOPTS_H
+
+typedef struct
+{
+ std::string name;
+ std::string value;
+ const core_options::option_type unused1;
+ char* unused2;
+}
+INIOPTS;
+// INI options
+const INIOPTS option_entries[] =
+{
+ { OPTION_READCONFIG ";rc", "1", OPTION_BOOLEAN, "enable loading of configuration files" },
+ { OPTION_WRITECONFIG ";wc", "1", OPTION_BOOLEAN, "writes configuration to (driver).ini on exit" },
+ { OPTION_MEDIAPATH ";rp;biospath;bp", "roms", OPTION_STRING, "path to ROMsets and hard disk images" },
+ { OPTION_HASHPATH ";hash_directory;hash", "hash", OPTION_STRING, "path to hash files" },
+ { OPTION_SAMPLEPATH ";sp", "samples", OPTION_STRING, "path to samplesets" },
+ { OPTION_ARTPATH, "artwork", OPTION_STRING, "path to artwork files" },
+ { OPTION_CTRLRPATH, "ctrlr", OPTION_STRING, "path to controller definitions" },
+ { OPTION_INIPATH, ".", OPTION_STRING, "path to ini files" },
+ { OPTION_FONTPATH, ".", OPTION_STRING, "path to font files" },
+ { OPTION_CHEATPATH, "cheat", OPTION_STRING, "path to cheat files" },
+ { OPTION_CROSSHAIRPATH, "crosshair", OPTION_STRING, "path to crosshair files" },
+ { OPTION_PLUGINSPATH, "plugins", OPTION_STRING, "path to plugin files" },
+ { OPTION_LANGUAGEPATH, "language", OPTION_STRING, "path to language files" },
+ { OPTION_SWPATH, "software", OPTION_STRING, "path to loose software" },
+ { OPTION_CFG_DIRECTORY, "cfg", OPTION_STRING, "directory to save configurations" },
+ { OPTION_NVRAM_DIRECTORY, "nvram", OPTION_STRING, "directory to save nvram contents" },
+ { OPTION_INPUT_DIRECTORY, "inp", OPTION_STRING, "directory to save input device logs" },
+ { OPTION_STATE_DIRECTORY, "sta", OPTION_STRING, "directory to save states" },
+ { OPTION_SNAPSHOT_DIRECTORY, "snap", OPTION_STRING, "directory to save/load screenshots" },
+ { OPTION_DIFF_DIRECTORY, "diff", OPTION_STRING, "directory to save hard drive image difference files" },
+ { OPTION_COMMENT_DIRECTORY, "comments", OPTION_STRING, "directory to save debugger comments" },
+ { OPTION_STATE, "", OPTION_STRING, "saved state to load" },
+ { OPTION_AUTOSAVE, "0", OPTION_BOOLEAN, "enable automatic restore at startup, and automatic save at exit time" },
+ { OPTION_PLAYBACK ";pb", "", OPTION_STRING, "playback an input file" },
+ { OPTION_RECORD ";rec", "", OPTION_STRING, "record an input file" },
+ { OPTION_RECORD_TIMECODE, "0", OPTION_BOOLEAN, "record an input timecode file (requires -record option)" },
+ { OPTION_EXIT_AFTER_PLAYBACK, "0", OPTION_BOOLEAN, "close the program at the end of playback" },
+ { OPTION_MNGWRITE, "", OPTION_STRING, "optional filename to write a MNG movie of the current session" },
+ { OPTION_AVIWRITE, "", OPTION_STRING, "optional filename to write an AVI movie of the current session" },
+ { OPTION_WAVWRITE, "", OPTION_STRING, "optional filename to write a WAV file of the current session" },
+ { OPTION_SNAPNAME, "%g/%i", OPTION_STRING, "override of the default snapshot/movie naming; %g == gamename, %i == index" },
+ { OPTION_SNAPSIZE, "auto", OPTION_STRING, "specify snapshot/movie resolution (<width>x<height>) or 'auto' to use minimal size " },
+ { OPTION_SNAPVIEW, "internal", OPTION_STRING, "specify snapshot/movie view or 'internal' to use internal pixel-aspect views" },
+ { OPTION_SNAPBILINEAR, "1", OPTION_BOOLEAN, "specify if the snapshot/movie should have bilinear filtering applied" },
+ { OPTION_STATENAME, "%g", OPTION_STRING, "override of the default state subfolder naming; %g == gamename" },
+ { OPTION_BURNIN, "0", OPTION_BOOLEAN, "create burn-in snapshots for each screen" },
+ { OPTION_AUTOFRAMESKIP ";afs", "0", OPTION_BOOLEAN, "enable automatic frameskip selection" },
+ { OPTION_FRAMESKIP ";fs(0-10)", "0", OPTION_INTEGER, "set frameskip to fixed value, 0-10 (autoframeskip must be disabled)" },
+ { OPTION_SECONDS_TO_RUN ";str", "0", OPTION_INTEGER, "number of emulated seconds to run before automatically exiting" },
+ { OPTION_THROTTLE, "1", OPTION_BOOLEAN, "enable throttling to keep game running in sync with real time" },
+ { OPTION_SLEEP, "1", OPTION_BOOLEAN, "enable sleeping, which gives time back to other applications when idle" },
+ { OPTION_SPEED "(0.01-100)", "1.0", OPTION_FLOAT, "controls the speed of gameplay, relative to realtime; smaller numbers are slower" },
+ { OPTION_REFRESHSPEED ";rs", "0", OPTION_BOOLEAN, "automatically adjusts the speed of gameplay to keep the refresh rate lower than the screen" },
+ { OPTION_KEEPASPECT ";ka", "1", OPTION_BOOLEAN, "constrain to the proper aspect ratio" },
+ { OPTION_UNEVENSTRETCH ";ues", "1", OPTION_BOOLEAN, "allow non-integer stretch factors" },
+ { OPTION_UNEVENSTRETCHX ";uesx", "0", OPTION_BOOLEAN, "allow non-integer stretch factors only on horizontal axis"},
+ { OPTION_UNEVENSTRETCHY ";uesy", "0", OPTION_BOOLEAN, "allow non-integer stretch factors only on vertical axis"},
+ { OPTION_AUTOSTRETCHXY ";asxy", "0", OPTION_BOOLEAN, "automatically apply -unevenstretchx/y based on source native orientation"},
+ { OPTION_INTOVERSCAN ";ios", "0", OPTION_BOOLEAN, "allow overscan on integer scaled targets"},
+ { OPTION_INTSCALEX ";sx", "0", OPTION_INTEGER, "set horizontal integer scale factor."},
+ { OPTION_INTSCALEY ";sy", "0", OPTION_INTEGER, "set vertical integer scale."},
+ { OPTION_ROTATE, "1", OPTION_BOOLEAN, "rotate the game screen according to the game's orientation needs it" },
+ { OPTION_ROR, "0", OPTION_BOOLEAN, "rotate screen clockwise 90 degrees" },
+ { OPTION_ROL, "0", OPTION_BOOLEAN, "rotate screen counterclockwise 90 degrees" },
+ { OPTION_AUTOROR, "0", OPTION_BOOLEAN, "automatically rotate screen clockwise 90 degrees if vertical" },
+ { OPTION_AUTOROL, "0", OPTION_BOOLEAN, "automatically rotate screen counterclockwise 90 degrees if vertical" },
+ { OPTION_FLIPX, "0", OPTION_BOOLEAN, "flip screen left-right" },
+ { OPTION_FLIPY, "0", OPTION_BOOLEAN, "flip screen upside-down" },
+ { OPTION_ARTWORK_CROP ";artcrop", "0", OPTION_BOOLEAN, "crop artwork to game screen size" },
+ { OPTION_USE_BACKDROPS ";backdrop", "1", OPTION_BOOLEAN, "enable backdrops if artwork is enabled and available" },
+ { OPTION_USE_OVERLAYS ";overlay", "1", OPTION_BOOLEAN, "enable overlays if artwork is enabled and available" },
+ { OPTION_USE_BEZELS ";bezel", "1", OPTION_BOOLEAN, "enable bezels if artwork is enabled and available" },
+ { OPTION_USE_CPANELS ";cpanel", "1", OPTION_BOOLEAN, "enable cpanels if artwork is enabled and available" },
+ { OPTION_USE_MARQUEES ";marquee", "1", OPTION_BOOLEAN, "enable marquees if artwork is enabled and available" },
+ { OPTION_BRIGHTNESS "(0.1-2.0)", "1.0", OPTION_FLOAT, "default game screen brightness correction" },
+ { OPTION_CONTRAST "(0.1-2.0)", "1.0", OPTION_FLOAT, "default game screen contrast correction" },
+ { OPTION_GAMMA "(0.1-3.0)", "1.0", OPTION_FLOAT, "default game screen gamma correction" },
+ { OPTION_PAUSE_BRIGHTNESS "(0.0-1.0)", "0.65", OPTION_FLOAT, "amount to scale the screen brightness when paused" },
+ { OPTION_EFFECT, "none", OPTION_STRING, "name of a PNG file to use for visual effects, or 'none'" },
+ { OPTION_BEAM_WIDTH_MIN, "1.0", OPTION_FLOAT, "set vector beam width minimum" },
+ { OPTION_BEAM_WIDTH_MAX, "1.0", OPTION_FLOAT, "set vector beam width maximum" },
+ { OPTION_BEAM_INTENSITY_WEIGHT, "0", OPTION_FLOAT, "set vector beam intensity weight " },
+ { OPTION_FLICKER, "0", OPTION_FLOAT, "set vector flicker effect" },
+ { OPTION_SAMPLERATE ";sr(1000-1000000)", "48000", OPTION_INTEGER, "set sound output sample rate" },
+ { OPTION_SAMPLES, "1", OPTION_BOOLEAN, "enable the use of external samples if available" },
+ { OPTION_VOLUME ";vol", "0", OPTION_INTEGER, "sound volume in decibels (-32 min, 0 max)" },
+ { OPTION_COIN_LOCKOUT ";coinlock", "1", OPTION_BOOLEAN, "enable coin lockouts to actually lock out coins" },
+ { OPTION_CTRLR, "", OPTION_STRING, "preconfigure for specified controller" },
+ { OPTION_MOUSE, "0", OPTION_BOOLEAN, "enable mouse input" },
+ { OPTION_JOYSTICK ";joy", "1", OPTION_BOOLEAN, "enable joystick input" },
+ { OPTION_LIGHTGUN ";gun", "0", OPTION_BOOLEAN, "enable lightgun input" },
+ { OPTION_MULTIKEYBOARD ";multikey", "0", OPTION_BOOLEAN, "enable separate input from each keyboard device (if present)" },
+ { OPTION_MULTIMOUSE, "0", OPTION_BOOLEAN, "enable separate input from each mouse device (if present)" },
+ { OPTION_STEADYKEY ";steady", "0", OPTION_BOOLEAN, "enable steadykey support" },
+ { OPTION_UI_ACTIVE, "0", OPTION_BOOLEAN, "enable user interface on top of emulated keyboard (if present)" },
+ { OPTION_OFFSCREEN_RELOAD ";reload", "0", OPTION_BOOLEAN, "convert lightgun button 2 into offscreen reload" },
+ { OPTION_JOYSTICK_MAP ";joymap", "auto", OPTION_STRING, "explicit joystick map, or auto to auto-select" },
+ { OPTION_JOYSTICK_DEADZONE ";joy_deadzone;jdz(0.00-1)", "0.3", OPTION_FLOAT, "center deadzone range for joystick where change is ignored (0.0 center, 1.0 end)" },
+ { OPTION_JOYSTICK_SATURATION ";joy_saturation;jsat(0.00-1)", "0.85", OPTION_FLOAT, "end of axis saturation range for joystick where change is ignored (0.0 center, 1.0 end)" },
+ { OPTION_NATURAL_KEYBOARD ";nat", "0", OPTION_BOOLEAN, "specifies whether to use a natural keyboard or not" },
+ { OPTION_JOYSTICK_CONTRADICTORY ";joy_contradictory","0", OPTION_BOOLEAN, "enable contradictory direction digital joystick input at the same time" },
+ { OPTION_COIN_IMPULSE, "0", OPTION_INTEGER, "set coin impulse time (n<0 disable impulse, n==0 obey driver, 0<n set time n)" },
+ { OPTION_PADDLE_DEVICE ";paddle", "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a paddle control is present" },
+ { OPTION_ADSTICK_DEVICE ";adstick", "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if an analog joystick control is present" },
+ { OPTION_PEDAL_DEVICE ";pedal", "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a pedal control is present" },
+ { OPTION_DIAL_DEVICE ";dial", "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a dial control is present" },
+ { OPTION_TRACKBALL_DEVICE ";trackball", "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a trackball control is present" },
+ { OPTION_LIGHTGUN_DEVICE, "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a lightgun control is present" },
+ { OPTION_POSITIONAL_DEVICE, "keyboard", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a positional control is present" },
+ { OPTION_MOUSE_DEVICE, "mouse", OPTION_STRING, "enable (none|keyboard|mouse|lightgun|joystick) if a mouse control is present" },
+ { OPTION_VERBOSE ";v", "0", OPTION_BOOLEAN, "display additional diagnostic information" },
+ { OPTION_LOG, "0", OPTION_BOOLEAN, "generate an error.log file" },
+ { OPTION_OSLOG, "0", OPTION_BOOLEAN, "output error.log data to the system debugger" },
+ { OPTION_DEBUG ";d", "0", OPTION_BOOLEAN, "enable/disable debugger" },
+ { OPTION_UPDATEINPAUSE, "0", OPTION_BOOLEAN, "keep calling video updates while in pause" },
+ { OPTION_DEBUGSCRIPT, "", OPTION_STRING, "script for debugger" },
+ { OPTION_COMM_LOCAL_HOST, "0.0.0.0", OPTION_STRING, "local address to bind to" },
+ { OPTION_COMM_LOCAL_PORT, "15112", OPTION_STRING, "local port to bind to" },
+ { OPTION_COMM_REMOTE_HOST, "127.0.0.1", OPTION_STRING, "remote address to connect to" },
+ { OPTION_COMM_REMOTE_PORT, "15112", OPTION_STRING, "remote port to connect to" },
+ { OPTION_DRC, "1", OPTION_BOOLEAN, "enable DRC cpu core if available" },
+ { OPTION_DRC_USE_C, "0", OPTION_BOOLEAN, "force DRC use C backend" },
+ { OPTION_DRC_LOG_UML, "0", OPTION_BOOLEAN, "write DRC UML disassembly log" },
+ { OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" },
+ { OPTION_BIOS, "", OPTION_STRING, "select the system BIOS to use" },
+ { OPTION_CHEAT ";c", "0", OPTION_BOOLEAN, "enable cheat subsystem" },
+ { OPTION_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" },
+ { OPTION_UI_FONT, "default", OPTION_STRING, "specify a font to use" },
+ { OPTION_UI, "cabinet", OPTION_STRING, "type of UI (simple|cabinet)" },
+ { OPTION_RAMSIZE ";ram", "", OPTION_STRING, "size of RAM (if supported by driver)" },
+ { OPTION_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" },
+ { OPTION_UI_MOUSE, "1", OPTION_BOOLEAN, "display ui mouse cursor" },
+ { OPTION_AUTOBOOT_COMMAND ";ab", "", OPTION_STRING, "command to execute after machine boot" },
+ { OPTION_AUTOBOOT_DELAY, "0", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" },
+ { OPTION_AUTOBOOT_SCRIPT ";script", "", OPTION_STRING, "lua script to execute after machine boot" },
+ { OPTION_CONSOLE, "0", OPTION_BOOLEAN, "enable emulator LUA console" },
+ { OPTION_PLUGINS, "1", OPTION_BOOLEAN, "enable LUA plugin support" },
+ { OPTION_PLUGIN, "", OPTION_STRING, "list of plugins to enable" },
+ { OPTION_NO_PLUGIN, "", OPTION_STRING, "list of plugins to disable" },
+ { OPTION_LANGUAGE ";lang", "English", OPTION_STRING, "display language" },
+ { OPTION_HTTP, "0", OPTION_BOOLEAN, "HTTP server enable" },
+ { OPTION_HTTP_PORT, "8080", OPTION_INTEGER, "HTTP server port" },
+ { OPTION_HTTP_ROOT, "web", OPTION_STRING, "HTTP server document root" },
+ { OSDOPTION_UIMODEKEY, "SCRLOCK", OPTION_STRING, "Key to toggle keyboard mode" },
+ { OSD_FONT_PROVIDER, "auto", OPTION_STRING, "provider for ui font: " },
+ { OSD_OUTPUT_PROVIDER, "auto", OPTION_STRING, "provider for output: " },
+ { OSD_KEYBOARDINPUT_PROVIDER, "auto", OPTION_STRING, "provider for keyboard input: " },
+ { OSD_MOUSEINPUT_PROVIDER, "auto", OPTION_STRING, "provider for mouse input: " },
+ { OSD_LIGHTGUNINPUT_PROVIDER, "auto", OPTION_STRING, "provider for lightgun input: " },
+ { OSD_JOYSTICKINPUT_PROVIDER, "auto", OPTION_STRING, "provider for joystick input: " },
+ { OSDCOMMAND_LIST_MIDI_DEVICES ";mlist", "0", OPTION_COMMAND, "list available MIDI I/O devices" },
+ { OSDCOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0", OPTION_COMMAND, "list available network adapters" },
+ { OSDOPTION_DEBUGGER, "auto", OPTION_STRING, "debugger used: " },
+ { OSDOPTION_DEBUGGER_FONT ";dfont", "auto", OPTION_STRING, "specifies the font to use for debugging" },
+ { OSDOPTION_DEBUGGER_FONT_SIZE ";dfontsize", "0", OPTION_FLOAT, "specifies the font size to use for debugging" },
+ { OSDOPTION_WATCHDOG ";wdog", "0", OPTION_INTEGER, "force the program to terminate if no updates within specified number of seconds" },
+ { OSDOPTION_NUMPROCESSORS ";np", "auto", OPTION_STRING, "number of processors; this overrides the number the system reports" },
+ { OSDOPTION_BENCH, "0", OPTION_INTEGER, "benchmark for the given number of emulated seconds; implies -video none -sound none -nothrottle" },
+ { OSDOPTION_VIDEO, "auto", OPTION_STRING, "video output method: " },
+ { OSDOPTION_NUMSCREENS "(1-4)", "1", OPTION_INTEGER, "number of screens to create; usually, you want just one" },
+ { OSDOPTION_WINDOW ";w", "0", OPTION_BOOLEAN, "enable window mode; otherwise, full screen mode is assumed" },
+ { OSDOPTION_MAXIMIZE ";max", "1", OPTION_BOOLEAN, "default to maximized windows; otherwise, windows will be minimized" },
+ { OSDOPTION_WAITVSYNC ";vs", "0", OPTION_BOOLEAN, "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" },
+ { OSDOPTION_SYNCREFRESH ";srf", "0", OPTION_BOOLEAN, "enable using the start of VBLANK for throttling instead of the game time" },
+ { OSD_MONITOR_PROVIDER, "auto", OPTION_STRING, "monitor discovery method" },
+ { OSDOPTION_SCREEN, "auto", OPTION_STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT ";screen_aspect", "auto", OPTION_STRING, "aspect ratio for all screens; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION ";r", "auto", OPTION_STRING, "preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW, "auto", OPTION_STRING, "preferred view for all screens" },
+ { OSDOPTION_SCREEN "0", "auto", OPTION_STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT "0", "auto", OPTION_STRING, "aspect ratio of the first screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION "0;r0", "auto", OPTION_STRING, "preferred resolution of the first screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW "0", "auto", OPTION_STRING, "preferred view for the first screen" },
+ { OSDOPTION_SCREEN "1", "auto", OPTION_STRING, "explicit name of the second screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT "1", "auto", OPTION_STRING, "aspect ratio of the second screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION "1;r1", "auto", OPTION_STRING, "preferred resolution of the second screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW "1", "auto", OPTION_STRING, "preferred view for the second screen" },
+ { OSDOPTION_SCREEN "2", "auto", OPTION_STRING, "explicit name of the third screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT "2", "auto", OPTION_STRING, "aspect ratio of the third screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION "2;r2", "auto", OPTION_STRING, "preferred resolution of the third screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW "2", "auto", OPTION_STRING, "preferred view for the third screen" },
+ { OSDOPTION_SCREEN "3", "auto", OPTION_STRING, "explicit name of the fourth screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT "3", "auto", OPTION_STRING, "aspect ratio of the fourth screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION "3;r3", "auto", OPTION_STRING, "preferred resolution of the fourth screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW "3", "auto", OPTION_STRING, "preferred view for the fourth screen" },
+ { OSDOPTION_SWITCHRES, "0", OPTION_BOOLEAN, "enable resolution switching" },
+ { OSDOPTION_FILTER ";glfilter;flt", "1", OPTION_BOOLEAN, "enable bilinear filtering on screen output" },
+ { OSDOPTION_PRESCALE, "1", OPTION_INTEGER, "scale screen rendering by this amount in software" },
+ { OSDOPTION_GL_FORCEPOW2TEXTURE, "0", OPTION_BOOLEAN, "force power of two textures (default no)" },
+ { OSDOPTION_GL_NOTEXTURERECT, "0", OPTION_BOOLEAN, "don't use OpenGL GL_ARB_texture_rectangle (default on)" },
+ { OSDOPTION_GL_VBO, "1", OPTION_BOOLEAN, "enable OpenGL VBO, if available (default on)" },
+ { OSDOPTION_GL_PBO, "1", OPTION_BOOLEAN, "enable OpenGL PBO, if available (default on)" },
+ { OSDOPTION_GL_GLSL, "0", OPTION_BOOLEAN, "enable OpenGL GLSL, if available (default off)" },
+ { OSDOPTION_GLSL_FILTER, "1", OPTION_STRING, "enable OpenGL GLSL filtering instead of FF filtering 0-plain, 1-bilinear (default)" },
+ { OSDOPTION_SHADER_MAME "0", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 0" },
+ { OSDOPTION_SHADER_MAME "1", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 1" },
+ { OSDOPTION_SHADER_MAME "2", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 2" },
+ { OSDOPTION_SHADER_MAME "3", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 3" },
+ { OSDOPTION_SHADER_MAME "4", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 4" },
+ { OSDOPTION_SHADER_MAME "5", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 5" },
+ { OSDOPTION_SHADER_MAME "6", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 6" },
+ { OSDOPTION_SHADER_MAME "7", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 7" },
+ { OSDOPTION_SHADER_MAME "8", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 8" },
+ { OSDOPTION_SHADER_MAME "9", "none", OPTION_STRING, "custom OpenGL GLSL shader set mame bitmap 9" },
+ { OSDOPTION_SHADER_SCREEN "0", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 0" },
+ { OSDOPTION_SHADER_SCREEN "1", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 1" },
+ { OSDOPTION_SHADER_SCREEN "2", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 2" },
+ { OSDOPTION_SHADER_SCREEN "3", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 3" },
+ { OSDOPTION_SHADER_SCREEN "4", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 4" },
+ { OSDOPTION_SHADER_SCREEN "5", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 5" },
+ { OSDOPTION_SHADER_SCREEN "6", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 6" },
+ { OSDOPTION_SHADER_SCREEN "7", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 7" },
+ { OSDOPTION_SHADER_SCREEN "8", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 8" },
+ { OSDOPTION_SHADER_SCREEN "9", "none", OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 9" },
+ { OSDOPTION_SOUND, "auto", OPTION_STRING, "sound output method: " },
+ { OSDOPTION_AUDIO_LATENCY "(1-5)", "2", OPTION_INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" },
+ { OSDOPTION_PA_API, "none", OPTION_STRING, "PortAudio API" },
+ { OSDOPTION_PA_DEVICE, "none", OPTION_STRING, "PortAudio device" },
+ { OSDOPTION_PA_LATENCY "(0-0.25)", "0", OPTION_FLOAT, "suggested latency in seconds, 0 for default" },
+ { OSDOPTION_BGFX_PATH, "bgfx", OPTION_STRING, "path to BGFX-related files" },
+ { OSDOPTION_BGFX_BACKEND, "auto", OPTION_STRING, "BGFX backend to use (d3d9, d3d11, metal, opengl, gles)" },
+ { 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, "auto", OPTION_STRING, "filename for BGFX output logging" },
+ { WINOPTION_PRIORITY "(-15-1)", "0", OPTION_INTEGER, "thread priority for the main game thread; range from -15 to 1" },
+ { WINOPTION_PROFILE, "0", OPTION_INTEGER, "enables profiling, specifying the stack depth to track" },
+ { WINOPTION_MENU, "0", OPTION_BOOLEAN, "enables menu bar if available by UI implementation" },
+ { WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to hlsl files" },
+ { WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enables HLSL post-processing (PS3.0 required)" },
+ { WINOPTION_HLSL_OVERSAMPLING, "0", OPTION_BOOLEAN, "enables HLSL oversampling" },
+ { WINOPTION_HLSL_WRITE, "auto", OPTION_STRING, "enables HLSL AVI writing (huge disk bandwidth suggested)" },
+ { WINOPTION_HLSL_SNAP_WIDTH, "2048", OPTION_STRING, "HLSL upscaled-snapshot width" },
+ { WINOPTION_HLSL_SNAP_HEIGHT, "1536", OPTION_STRING, "HLSL upscaled-snapshot height" },
+ { WINOPTION_SHADOW_MASK_TILE_MODE, "0", OPTION_INTEGER, "shadow mask tile mode (0 for screen based, 1 for source based)" },
+ { WINOPTION_SHADOW_MASK_ALPHA";fs_shadwa(0.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask alpha-blend value (1.0 is fully blended, 0.0 is no mask)" },
+ { WINOPTION_SHADOW_MASK_TEXTURE";fs_shadwt(0.0-1.0)", "shadow-mask.png", OPTION_STRING, "shadow mask texture name" },
+ { WINOPTION_SHADOW_MASK_COUNT_X";fs_shadww", "6", OPTION_INTEGER, "shadow mask tile width, in screen dimensions" },
+ { WINOPTION_SHADOW_MASK_COUNT_Y";fs_shadwh", "4", OPTION_INTEGER, "shadow mask tile height, in screen dimensions" },
+ { WINOPTION_SHADOW_MASK_USIZE";fs_shadwu(0.0-1.0)", "0.1875", OPTION_FLOAT, "shadow mask texture width, in U/V dimensions" },
+ { WINOPTION_SHADOW_MASK_VSIZE";fs_shadwv(0.0-1.0)", "0.25", OPTION_FLOAT, "shadow mask texture height, in U/V dimensions" },
+ { WINOPTION_SHADOW_MASK_UOFFSET";fs_shadwou(-1.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask texture offset, in U direction" },
+ { WINOPTION_SHADOW_MASK_VOFFSET";fs_shadwov(-1.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask texture offset, in V direction" },
+ { WINOPTION_DISTORTION";fs_dist(-1.0-1.0)", "0.0", OPTION_FLOAT, "screen distortion amount" },
+ { WINOPTION_CUBIC_DISTORTION";fs_cubedist(-1.0-1.0)", "0.0", OPTION_FLOAT, "screen cubic distortion amount" },
+ { WINOPTION_DISTORT_CORNER";fs_distc(0.0-1.0)", "0.0", OPTION_FLOAT, "screen distort corner amount" },
+ { WINOPTION_ROUND_CORNER";fs_rndc(0.0-1.0)", "0.0", OPTION_FLOAT, "screen round corner amount" },
+ { WINOPTION_SMOOTH_BORDER";fs_smob(0.0-1.0)", "0.0", OPTION_FLOAT, "screen smooth border amount" },
+ { WINOPTION_REFLECTION";fs_ref(0.0-1.0)", "0.0", OPTION_FLOAT, "screen reflection amount" },
+ { WINOPTION_VIGNETTING";fs_vig(0.0-1.0)", "0.0", OPTION_FLOAT, "image vignetting amount" },
+ { WINOPTION_SCANLINE_AMOUNT";fs_scanam(0.0-4.0)", "0.0", OPTION_FLOAT, "overall alpha scaling value for scanlines" },
+ { WINOPTION_SCANLINE_SCALE";fs_scansc(0.0-4.0)", "1.0", OPTION_FLOAT, "overall height scaling value for scanlines" },
+ { WINOPTION_SCANLINE_HEIGHT";fs_scanh(0.0-4.0)", "1.0", OPTION_FLOAT, "individual height scaling value for scanlines" },
+ { WINOPTION_SCANLINE_VARIATION";fs_scanv(0.0-4.0)", "1.0", OPTION_FLOAT, "individual height varying value for scanlines" },
+ { WINOPTION_SCANLINE_BRIGHT_SCALE";fs_scanbs(0.0-2.0)", "1.0", OPTION_FLOAT, "overall brightness scaling value for scanlines (multiplicative)" },
+ { WINOPTION_SCANLINE_BRIGHT_OFFSET";fs_scanbo(0.0-1.0)", "0.0", OPTION_FLOAT, "overall brightness offset value for scanlines (additive)" },
+ { WINOPTION_SCANLINE_JITTER";fs_scanjt(0.0-4.0)", "0.0", OPTION_FLOAT, "overall interlace jitter scaling value for scanlines" },
+ { WINOPTION_HUM_BAR_ALPHA";fs_humba(0.0-1.0)", "0.0", OPTION_FLOAT, "overall alpha scaling value for hum bar" },
+ { WINOPTION_DEFOCUS";fs_focus", "0.0,0.0", OPTION_STRING, "overall defocus value in screen-relative coords" },
+ { WINOPTION_CONVERGE_X";fs_convx", "0.0,0.0,0.0", OPTION_STRING, "convergence in screen-relative X direction" },
+ { WINOPTION_CONVERGE_Y";fs_convy", "0.0,0.0,0.0", OPTION_STRING, "convergence in screen-relative Y direction" },
+ { WINOPTION_RADIAL_CONVERGE_X";fs_rconvx", "0.0,0.0,0.0", OPTION_STRING, "radial convergence in screen-relative X direction" },
+ { WINOPTION_RADIAL_CONVERGE_Y";fs_rconvy", "0.0,0.0,0.0", OPTION_STRING, "radial convergence in screen-relative Y direction" },
+ { WINOPTION_RED_RATIO";fs_redratio", "1.0,0.0,0.0", OPTION_STRING, "red output signal generated by input signal" },
+ { WINOPTION_GRN_RATIO";fs_grnratio", "0.0,1.0,0.0", OPTION_STRING, "green output signal generated by input signal" },
+ { WINOPTION_BLU_RATIO";fs_bluratio", "0.0,0.0,1.0", OPTION_STRING, "blue output signal generated by input signal" },
+ { WINOPTION_SATURATION";fs_sat(0.0-4.0)", "1.0", OPTION_FLOAT, "saturation scaling value" },
+ { WINOPTION_OFFSET";fs_offset", "0.0,0.0,0.0", OPTION_STRING, "signal offset value (additive)" },
+ { WINOPTION_SCALE";fs_scale", "1.0,1.0,1.0", OPTION_STRING, "signal scaling value (multiplicative)" },
+ { WINOPTION_POWER";fs_power", "1.0,1.0,1.0", OPTION_STRING, "signal power value (exponential)" },
+ { WINOPTION_FLOOR";fs_floor", "0.0,0.0,0.0", OPTION_STRING, "signal floor level" },
+ { WINOPTION_PHOSPHOR";fs_phosphor", "0.0,0.0,0.0", OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" },
+ { WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enables YIQ-space HLSL post-processing" },
+ { WINOPTION_YIQ_JITTER";yiqj", "0.0", OPTION_FLOAT, "Jitter for the NTSC signal processing" },
+ { WINOPTION_YIQ_CCVALUE";yiqcc", "3.57954545", OPTION_FLOAT, "Color Carrier frequency for NTSC signal processing" },
+ { WINOPTION_YIQ_AVALUE";yiqa", "0.5", OPTION_FLOAT, "A value for NTSC signal processing" },
+ { WINOPTION_YIQ_BVALUE";yiqb", "0.5", OPTION_FLOAT, "B value for NTSC signal processing" },
+ { WINOPTION_YIQ_OVALUE";yiqo", "0.0", OPTION_FLOAT, "Outgoing Color Carrier phase offset for NTSC signal processing" },
+ { WINOPTION_YIQ_PVALUE";yiqp", "1.0", OPTION_FLOAT, "Incoming Pixel Clock scaling value for NTSC signal processing" },
+ { WINOPTION_YIQ_NVALUE";yiqn", "1.0", OPTION_FLOAT, "Y filter notch width for NTSC signal processing" },
+ { WINOPTION_YIQ_YVALUE";yiqy", "6.0", OPTION_FLOAT, "Y filter cutoff frequency for NTSC signal processing" },
+ { WINOPTION_YIQ_IVALUE";yiqi", "1.2", OPTION_FLOAT, "I filter cutoff frequency for NTSC signal processing" },
+ { WINOPTION_YIQ_QVALUE";yiqq", "0.6", OPTION_FLOAT, "Q filter cutoff frequency for NTSC signal processing" },
+ { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
+ { WINOPTION_YIQ_PHASE_COUNT";yiqpc", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
+ { WINOPTION_VECTOR_BEAM_SMOOTH";vecsmooth", "0.0", OPTION_FLOAT, "The vector beam smoothness" },
+ { WINOPTION_VECTOR_LENGTH_SCALE";vecscale", "0.5", OPTION_FLOAT, "The maximum vector attenuation" },
+ { WINOPTION_VECTOR_LENGTH_RATIO";vecratio", "0.5", OPTION_FLOAT, "The minimum vector length (vector length to screen size ratio) that is affected by the attenuation" },
+ { WINOPTION_BLOOM_BLEND_MODE, "0", OPTION_INTEGER, "bloom blend mode (0 for brighten, 1 for darken)" },
+ { WINOPTION_BLOOM_SCALE, "0.0", OPTION_FLOAT, "Intensity factor for bloom" },
+ { WINOPTION_BLOOM_OVERDRIVE, "1.0,1.0,1.0", OPTION_STRING, "Overdrive factor for bloom" },
+ { WINOPTION_BLOOM_LEVEL0_WEIGHT, "1.0", OPTION_FLOAT, "Bloom level 0 weight (full-size target)" },
+ { WINOPTION_BLOOM_LEVEL1_WEIGHT, "0.64", OPTION_FLOAT, "Bloom level 1 weight (1/4 smaller that level 0 target)" },
+ { WINOPTION_BLOOM_LEVEL2_WEIGHT, "0.32", OPTION_FLOAT, "Bloom level 2 weight (1/4 smaller that level 1 target)" },
+ { WINOPTION_BLOOM_LEVEL3_WEIGHT, "0.16", OPTION_FLOAT, "Bloom level 3 weight (1/4 smaller that level 2 target)" },
+ { WINOPTION_BLOOM_LEVEL4_WEIGHT, "0.08", OPTION_FLOAT, "Bloom level 4 weight (1/4 smaller that level 3 target)" },
+ { WINOPTION_BLOOM_LEVEL5_WEIGHT, "0.06", OPTION_FLOAT, "Bloom level 5 weight (1/4 smaller that level 4 target)" },
+ { WINOPTION_BLOOM_LEVEL6_WEIGHT, "0.04", OPTION_FLOAT, "Bloom level 6 weight (1/4 smaller that level 5 target)" },
+ { WINOPTION_BLOOM_LEVEL7_WEIGHT, "0.02", OPTION_FLOAT, "Bloom level 7 weight (1/4 smaller that level 6 target)" },
+ { WINOPTION_BLOOM_LEVEL8_WEIGHT, "0.01", OPTION_FLOAT, "Bloom level 8 weight (1/4 smaller that level 7 target)" },
+ { WINOPTION_TRIPLEBUFFER ";tb", "0", OPTION_BOOLEAN, "enables triple buffering" },
+ { WINOPTION_FULLSCREENBRIGHTNESS ";fsb(0.1-2.0)", "1.0", OPTION_FLOAT, "brightness value in full screen mode" },
+ { WINOPTION_FULLSCREENCONTRAST ";fsc(0.1-2.0)", "1.0", OPTION_FLOAT, "contrast value in full screen mode" },
+ { WINOPTION_FULLSCREENGAMMA ";fsg(0.1-3.0)", "1.0", OPTION_FLOAT, "gamma value in full screen mode" },
+ { WINOPTION_GLOBAL_INPUTS, "0", OPTION_BOOLEAN, "enables global inputs" },
+ { WINOPTION_DUAL_LIGHTGUN ";dual", "0", OPTION_BOOLEAN, "enables dual lightgun input" },
+ { "$end" }
+};
+
+class winui_ini_options
+{
+ std::map<std::string, std::string> m_list;
+ const char *m_filename;
+
+ void create_index(std::ifstream &fp)
+ {
+ if (!fp.good())
+ return;
+ bool is_ready = false;
+ std::string file_line;
+ std::getline(fp, file_line);
+ while (fp.good())
+ {
+ if (is_ready)
+ {
+ char s[file_line.length()+1];
+ strcpy(s, file_line.c_str());
+
+ const char* name = strtok(s, "\t"); // get adjustment name
+ char* data = strtok(NULL, "\t"); // get next part (there's no next tab, so just return whatever is left)
+ if (name)
+ m_list[name] = data ? data : "";
+ }
+ else
+ {
+ if (file_line == "$start")
+ is_ready = true;
+ }
+
+ std::getline(fp, file_line);
+ }
+
+ fp.close();
+ return;
+ }
+
+public:
+ // construction/destruction
+ winui_ini_options()
+ {
+ // set up default values
+ for (int i = 0; option_entries[i].name != "$end"; i++)
+ m_list[option_entries[i].name] = option_entries[i].value;
+ //printf("*** START DUMP OF DEFAULT ***\n");
+ //for (auto const &it : m_list)
+ // printf("%s = %s\n", it.first.c_str(), it.second.c_str());
+ //printf("*** END DUMP OF DEFAULT ***\n");
+ }
+
+ void load_file(const char *filename)
+ {
+ if (!m_filename)
+ m_filename = filename;
+ std::ifstream infile (filename);
+ create_index(infile);
+ }
+
+ void save_file(const char *filename)
+ {
+ if (!filename)
+ return;
+ std::string inistring = std::string("\n -- message for the user --.\n\n$start\n");
+ for (auto const &it : m_list)
+ inistring.append(it.first).append("\t").append(it.second).append("\n");
+
+ std::ofstream outfile (filename, std::ios::out | std::ios::trunc);
+ size_t size = inistring.size();
+ char t1[size+1];
+ strcpy(t1, inistring.c_str());
+ outfile.write(t1, size);
+ outfile.close();
+ return;
+ }
+
+ void reset_and_save(const char *filename)
+ {
+ // set up default values
+ for (int i = 0; option_entries[i].name != "$end"; i++)
+ m_list[option_entries[i].name] = option_entries[i].value;
+
+ save_file(filename);
+ }
+
+ void setter(const char* name, std::string value)
+ {
+ m_list[name] = value;
+ save_file(m_filename);
+ }
+
+ // cannot be "setter" otherwise most strings use it, causing "1" to be saved.
+ //void bool_setter(const char* name, bool value)
+ //{
+ // m_list[name] = value ? "1" : "0";
+ // save_file(m_filename);
+ //}
+
+ void setter(const char* name, int value)
+ {
+ m_list[name] = std::to_string(value);
+ save_file(m_filename);
+ }
+
+ std::string getter(const char* name)
+ {
+ if (m_list.count(name))
+ return m_list.find(name)->second;
+ else
+ return "";
+ }
+
+ int int_value(const char* name)
+ {
+ return std::stoi(getter(name));
+ }
+
+ bool bool_value(const char* name)
+ {
+ return int_value(name) ? 1 : 0;
+ }
+};
+
+#endif // INI_OPTS_H
+
diff --git a/docs/release/src/osd/winui/layout.cpp b/docs/release/src/osd/winui/layout.cpp
new file mode 100644
index 00000000000..c27a361d6ef
--- /dev/null
+++ b/docs/release/src/osd/winui/layout.cpp
@@ -0,0 +1,249 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ layout.cpp
+
+ MAME specific TreeView definitions (and maybe more in the future)
+
+***************************************************************************/
+// standard windows headers
+#include <windows.h>
+#include <commctrl.h>
+
+// MAME/MAMEUI headers
+#include "bitmask.h"
+#include "treeview.h"
+#include "emu.h"
+#include "mui_util.h"
+#include "resource.h"
+#include "mui_opts.h"
+#include "splitters.h"
+#include "help.h"
+#include "mui_audit.h"
+#include "properties.h"
+
+
+static BOOL FilterAvailable(uint32_t driver_index)
+{
+ return !DriverUsesRoms(driver_index) || IsAuditResultYes(GetRomAuditResults(driver_index));
+}
+
+#ifdef MESS
+extern const FOLDERDATA g_folderData[] =
+{
+ {"All Systems", "allgames", FOLDER_ALLGAMES, IDI_FOLDER, 0, 0, 0, NULL, NULL, TRUE },
+ {"Available", "available", FOLDER_AVAILABLE, IDI_FOLDER_AVAILABLE, F_AVAILABLE, 0, 0, NULL, FilterAvailable, TRUE },
+ {"BIOS", "bios", FOLDER_BIOS, IDI_FOLDER, 0, 0, 1, CreateBIOSFolders, DriverIsBios, TRUE },
+ {"CHD", "harddisk", FOLDER_HARDDISK, IDI_HARDDISK, 0, 0, 0, NULL, DriverIsHarddisk, TRUE },
+ {"Clones", "clones", FOLDER_CLONES, IDI_FOLDER, F_CLONES, F_ORIGINALS, 0, NULL, DriverIsClone, TRUE },
+ {"Computer", "computer", FOLDER_COMPUTER, IDI_FOLDER, F_COMPUTER, F_CONSOLE, 0, NULL, DriverIsComputer, TRUE },
+ {"Console", "console", FOLDER_CONSOLE, IDI_FOLDER, F_CONSOLE, F_COMPUTER, 0, NULL, DriverIsConsole, TRUE },
+ {"CPU", "cpu", FOLDER_CPU, IDI_FOLDER, 0, 0, 1, CreateCPUFolders },
+ {"Dumping Status", "dumping", FOLDER_DUMPING, IDI_FOLDER, 0, 0, 1, CreateDumpingFolders },
+ {"FPS", "fps", FOLDER_FPS, IDI_FOLDER, 0, 0, 1, CreateFPSFolders },
+ {"Horizontal", "horizontal", FOLDER_HORIZONTAL, IDI_FOLDER_HORIZONTAL, F_HORIZONTAL, F_VERTICAL, 0, NULL, DriverIsVertical, FALSE },
+ {"Imperfect", "imperfect", FOLDER_DEFICIENCY, IDI_FOLDER, 0, 0, 0, CreateDeficiencyFolders },
+ {"Lightgun", "Lightgun", FOLDER_LIGHTGUN, IDI_FOLDER, 0, 0, 0, NULL, DriverUsesLightGun, TRUE },
+ {"Manufacturer", "manufacturer", FOLDER_MANUFACTURER, IDI_FOLDER_MANUFACTURER, 0, 0, 1, CreateManufacturerFolders },
+ {"Mechanical", "mechanical", FOLDER_MECHANICAL, IDI_FOLDER, 0, 0, 0, NULL, DriverIsMechanical, TRUE },
+ {"Modified/Hacked", "modified", FOLDER_MODIFIED, IDI_FOLDER, 0, 0, 0, NULL, DriverIsModified, TRUE },
+ {"Mouse", "mouse", FOLDER_MOUSE, IDI_FOLDER, 0, 0, 0, NULL, DriverUsesMouse, TRUE },
+ {"Non Mechanical", "nonmechanical", FOLDER_NONMECHANICAL,IDI_FOLDER, 0, 0, 0, NULL, DriverIsMechanical, FALSE },
+ {"Not Working", "nonworking", FOLDER_NONWORKING, IDI_NONWORKING, F_NONWORKING, F_WORKING, 0, NULL, DriverIsBroken, TRUE },
+ {"Originals", "originals", FOLDER_ORIGINAL, IDI_FOLDER, F_ORIGINALS, F_CLONES, 0, NULL, DriverIsClone, FALSE },
+ {"Raster", "raster", FOLDER_RASTER, IDI_FOLDER, F_RASTER, F_VECTOR, 0, NULL, DriverIsVector, FALSE },
+ {"Resolution", "resolution", FOLDER_RESOLUTION, IDI_FOLDER, 0, 0, 1, CreateResolutionFolders },
+ {"Samples", "samples", FOLDER_SAMPLES, IDI_FOLDER, 0, 0, 0, NULL, DriverUsesSamples, TRUE },
+ {"Save State", "savestate", FOLDER_SAVESTATE, IDI_FOLDER, 0, 0, 0, NULL, DriverSupportsSaveState, TRUE },
+ {"Screens", "screens", FOLDER_SCREENS, IDI_FOLDER, 0, 0, 1, CreateScreenFolders },
+ {"Sound", "sound", FOLDER_SND, IDI_FOLDER, 0, 0, 1, CreateSoundFolders },
+ {"Source", "source", FOLDER_SOURCE, IDI_FOLDER_SOURCE, 0, 0, 1, CreateSourceFolders },
+ {"Stereo", "stereo", FOLDER_STEREO, IDI_SOUND, 0, 0, 0, NULL, DriverIsStereo, TRUE },
+ {"Trackball", "trackball", FOLDER_TRACKBALL, IDI_FOLDER, 0, 0, 0, NULL, DriverUsesTrackball, TRUE },
+ {"Unavailable", "unavailable", FOLDER_UNAVAILABLE, IDI_FOLDER_UNAVAILABLE, 0, F_AVAILABLE, 0, NULL, FilterAvailable, FALSE },
+ {"Vector", "vector", FOLDER_VECTOR, IDI_FOLDER, F_VECTOR, F_RASTER, 0, NULL, DriverIsVector, TRUE },
+ {"Vertical", "vertical", FOLDER_VERTICAL, IDI_FOLDER_VERTICAL, F_VERTICAL, F_HORIZONTAL, 0, NULL, DriverIsVertical, TRUE },
+ {"Working", "working", FOLDER_WORKING, IDI_WORKING, F_WORKING, F_NONWORKING, 0, NULL, DriverIsBroken, FALSE },
+ {"Year", "year", FOLDER_YEAR, IDI_FOLDER_YEAR, 0, 0, 1, CreateYearFolders },
+ { NULL }
+};
+#else
+extern const FOLDERDATA g_folderData[] =
+{
+ {"All Games", "allgames", FOLDER_ALLGAMES, IDI_FOLDER, 0, 0, 0, NULL, NULL, TRUE },
+ {"Available", "available", FOLDER_AVAILABLE, IDI_FOLDER_AVAILABLE, F_AVAILABLE, 0, 0, NULL, FilterAvailable, TRUE },
+ {"BIOS", "bios", FOLDER_BIOS, IDI_FOLDER, 0, 0, 1, CreateBIOSFolders, DriverIsBios, TRUE },
+ {"CHD", "harddisk", FOLDER_HARDDISK, IDI_HARDDISK, 0, 0, 0, NULL, DriverIsHarddisk, TRUE },
+ {"Clones", "clones", FOLDER_CLONES, IDI_FOLDER, F_CLONES, F_ORIGINALS, 0, NULL, DriverIsClone, TRUE },
+ {"CPU", "cpu", FOLDER_CPU, IDI_CPU, 0, 0, 1, CreateCPUFolders },
+ {"Dumping Status", "dumping", FOLDER_DUMPING, IDI_FOLDER, 0, 0, 1, CreateDumpingFolders },
+ {"FPS", "fps", FOLDER_FPS, IDI_FOLDER, 0, 0, 1, CreateFPSFolders },
+ {"Horizontal", "horizontal", FOLDER_HORIZONTAL, IDI_FOLDER_HORIZONTAL, F_HORIZONTAL, F_VERTICAL, 0, NULL, DriverIsVertical, FALSE },
+ {"Imperfect", "imperfect", FOLDER_DEFICIENCY, IDI_FOLDER, 0, 0, 0, CreateDeficiencyFolders },
+ {"Lightgun", "Lightgun", FOLDER_LIGHTGUN, IDI_FOLDER, 0, 0, 0, NULL, DriverUsesLightGun, TRUE },
+ {"Manufacturer", "manufacturer", FOLDER_MANUFACTURER, IDI_FOLDER_MANUFACTURER, 0, 0, 1, CreateManufacturerFolders },
+ {"Mechanical", "mechanical", FOLDER_MECHANICAL, IDI_FOLDER, 0, 0, 0, NULL, DriverIsMechanical, TRUE },
+ {"Non Mechanical", "nonmechanical", FOLDER_NONMECHANICAL,IDI_FOLDER, 0, 0, 0, NULL, DriverIsMechanical, FALSE },
+ {"Not Working", "nonworking", FOLDER_NONWORKING, IDI_NONWORKING, F_NONWORKING, F_WORKING, 0, NULL, DriverIsBroken, TRUE },
+ {"Originals", "originals", FOLDER_ORIGINAL, IDI_FOLDER, F_ORIGINALS, F_CLONES, 0, NULL, DriverIsClone, FALSE },
+ {"Raster", "raster", FOLDER_RASTER, IDI_FOLDER, F_RASTER, F_VECTOR, 0, NULL, DriverIsVector, FALSE },
+ {"Resolution", "resolution", FOLDER_RESOLUTION, IDI_FOLDER, 0, 0, 1, CreateResolutionFolders },
+ {"Samples", "samples", FOLDER_SAMPLES, IDI_FOLDER, 0, 0, 0, NULL, DriverUsesSamples, TRUE },
+ {"Save State", "savestate", FOLDER_SAVESTATE, IDI_FOLDER, 0, 0, 0, NULL, DriverSupportsSaveState, TRUE },
+ {"Screens", "screens", FOLDER_SCREENS, IDI_FOLDER, 0, 0, 1, CreateScreenFolders },
+ {"Sound", "sound", FOLDER_SND, IDI_SOUND, 0, 0, 1, CreateSoundFolders },
+ {"Source", "source", FOLDER_SOURCE, IDI_FOLDER_SOURCE, 0, 0, 1, CreateSourceFolders },
+ {"Stereo", "stereo", FOLDER_STEREO, IDI_FOLDER, 0, 0, 0, NULL, DriverIsStereo, TRUE },
+ {"Trackball", "trackball", FOLDER_TRACKBALL, IDI_FOLDER, 0, 0, 0, NULL, DriverUsesTrackball, TRUE },
+ {"Unavailable", "unavailable", FOLDER_UNAVAILABLE, IDI_FOLDER_UNAVAILABLE, 0, F_AVAILABLE, 0, NULL, FilterAvailable, FALSE },
+ {"Vector", "vector", FOLDER_VECTOR, IDI_FOLDER, F_VECTOR, F_RASTER, 0, NULL, DriverIsVector, TRUE },
+ {"Vertical", "vertical", FOLDER_VERTICAL, IDI_FOLDER_VERTICAL, F_VERTICAL, F_HORIZONTAL, 0, NULL, DriverIsVertical, TRUE },
+ {"Working", "working", FOLDER_WORKING, IDI_WORKING, F_WORKING, F_NONWORKING, 0, NULL, DriverIsBroken, FALSE },
+ {"Year", "year", FOLDER_YEAR, IDI_FOLDER_YEAR, 0, 0, 1, CreateYearFolders },
+ { NULL }
+};
+#endif
+
+/* list of filter/control Id pairs */
+#ifdef MESS
+extern const FILTER_ITEM g_filterList[] =
+{
+ { F_VECTOR, IDC_FILTER_VECTOR, DriverIsVector, TRUE },
+ { F_RASTER, IDC_FILTER_RASTER, DriverIsVector, FALSE },
+ { F_CLONES, IDC_FILTER_CLONES, DriverIsClone, TRUE },
+ { F_ORIGINALS, IDC_FILTER_ORIGINALS, DriverIsClone, FALSE },
+ { F_NONWORKING, IDC_FILTER_NONWORKING, DriverIsBroken, TRUE },
+ { F_WORKING, IDC_FILTER_WORKING, DriverIsBroken, FALSE },
+ { F_HORIZONTAL, IDC_FILTER_HORIZONTAL, DriverIsVertical, FALSE },
+ { F_VERTICAL, IDC_FILTER_VERTICAL, DriverIsVertical, TRUE },
+ { F_COMPUTER, IDC_FILTER_COMPUTER, DriverIsComputer, TRUE },
+ { F_CONSOLE, IDC_FILTER_CONSOLE, DriverIsConsole, TRUE },
+ { F_UNAVAILABLE, IDC_FILTER_UNAVAILABLE, FilterAvailable, FALSE },
+ { F_MECHANICAL, IDC_FILTER_MECHANICAL, DriverIsMechanical, TRUE },
+ { F_ARCADE, IDC_FILTER_ARCADE, DriverIsArcade, TRUE },
+ { F_MESS, IDC_FILTER_MESS, DriverIsArcade, FALSE },
+// { F_MODIFIED, IDC_FILTER_MODIFIED, DriverIsModified, TRUE },
+// { F_AVAILABLE, IDC_FILTER_AVAILABLE, FilterAvailable, TRUE },
+ { 0 }
+};
+#else
+extern const FILTER_ITEM g_filterList[] =
+{
+ { F_CLONES, IDC_FILTER_CLONES, DriverIsClone, TRUE },
+ { F_NONWORKING, IDC_FILTER_NONWORKING, DriverIsBroken, TRUE },
+ { F_UNAVAILABLE, IDC_FILTER_UNAVAILABLE, FilterAvailable, FALSE },
+ { F_RASTER, IDC_FILTER_RASTER, DriverIsVector, FALSE },
+ { F_VECTOR, IDC_FILTER_VECTOR, DriverIsVector, TRUE },
+ { F_ORIGINALS, IDC_FILTER_ORIGINALS, DriverIsClone, FALSE },
+ { F_WORKING, IDC_FILTER_WORKING, DriverIsBroken, FALSE },
+ { F_AVAILABLE, IDC_FILTER_AVAILABLE, FilterAvailable, TRUE },
+ { F_HORIZONTAL, IDC_FILTER_HORIZONTAL, DriverIsVertical, FALSE },
+ { F_VERTICAL, IDC_FILTER_VERTICAL, DriverIsVertical, TRUE },
+ { F_MECHANICAL, IDC_FILTER_MECHANICAL, DriverIsMechanical, TRUE },
+ { F_ARCADE, IDC_FILTER_ARCADE, DriverIsArcade, TRUE },
+ { F_MESS, IDC_FILTER_MESS, DriverIsArcade, FALSE },
+ { 0 }
+};
+#endif
+
+#ifdef MESS
+extern const MAMEHELPINFO g_helpInfo[] =
+{
+ //{ ID_HELP_CONTENTS, TRUE, TEXT(MAMEUIHELP"::/windows/main.htm") },
+ { ID_HELP_CONTENTS, TRUE, TEXT(MAMEUIHELP) }, // 0 - call up CHM file
+ //{ ID_HELP_RELEASE, TRUE, TEXT(MAMEUIHELP) },
+ //{ ID_HELP_WHATS_NEW, TRUE, TEXT(MAMEUIHELP"::/messnew.txt") },
+ { ID_HELP_WHATS_NEW, TRUE, TEXT("") }, // 1 - call up whatsnew at mamedev.org
+ { -1 }
+};
+#else
+extern const MAMEHELPINFO g_helpInfo[] =
+{
+ { ID_HELP_CONTENTS, TRUE, TEXT(MAMEUIHELP) },
+ //{ ID_HELP_WHATS_NEWUI, TRUE, TEXT(MAMEUIHELP"::/html/mameui_changes.txt") },
+ //{ ID_HELP_TROUBLE, TRUE, TEXT(MAMEUIHELP"::/html/mameui_support.htm") },
+ //{ ID_HELP_RELEASE, FALSE, TEXT("windows.txt") },
+ { ID_HELP_WHATS_NEW, TRUE, TEXT(MAMEUIHELP"::/docs/whatsnew.txt") },
+ { -1 }
+};
+#endif
+
+#ifdef MESS
+extern const PROPERTYSHEETINFO g_propSheets[] =
+{
+ { FALSE, NULL, IDD_PROP_GAME, GamePropertiesDialogProc },
+ { FALSE, NULL, IDD_PROP_AUDIT, GameAuditDialogProc },
+ { TRUE, NULL, IDD_PROP_DISPLAY, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_ADVANCED, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_SCREEN, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_SOUND, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_INPUT, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_CONTROLLER, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_DEBUG, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_MISC, GameOptionsProc },
+ { FALSE, NULL, IDD_PROP_SOFTWARE, GameMessOptionsProc },
+ { FALSE, DriverHasRam, IDD_PROP_CONFIGURATION, GameMessOptionsProc }, // PropSheetFilter_Config not needed
+ { TRUE, DriverIsVector, IDD_PROP_VECTOR, GameOptionsProc }, // PropSheetFilter_Vector not needed
+ { FALSE }
+};
+#else
+extern const PROPERTYSHEETINFO g_propSheets[] =
+{
+ { FALSE, NULL, IDD_PROP_GAME, GamePropertiesDialogProc },
+ { FALSE, NULL, IDD_PROP_AUDIT, GameAuditDialogProc },
+ { TRUE, NULL, IDD_PROP_DISPLAY, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_ADVANCED, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_SCREEN, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_SOUND, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_INPUT, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_CONTROLLER, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_MISC, GameOptionsProc },
+ { TRUE, NULL, IDD_PROP_DEBUG, GameOptionsProc },
+ { TRUE, DriverIsVector, IDD_PROP_VECTOR, GameOptionsProc },
+ { FALSE }
+};
+#endif
+
+#ifdef MESS
+extern const ICONDATA g_iconData[] =
+{
+ { IDI_WIN_NOROMS, "noroms" },
+ { IDI_WIN_ROMS, "roms" },
+ { IDI_WIN_UNKNOWN, "unknown" },
+ { IDI_WIN_CLONE, "clone" },
+ { IDI_WIN_REDX, "warning" },
+ { IDI_WIN_IMPERFECT, "imperfect" },
+ { IDI_WIN_NOROMSNEEDED, "noromsneeded" },
+ { IDI_WIN_MISSINGOPTROM, "missingoptrom" },
+ { IDI_WIN_FLOP, "floppy" },
+ { IDI_WIN_CASS, "cassette" },
+ { IDI_WIN_SERL, "serial" },
+ { IDI_WIN_SNAP, "snapshot" },
+ { IDI_WIN_PRIN, "printer" },
+ { IDI_WIN_HARD, "hard" },
+ { IDI_WIN_MIDI, "midi" },
+ { 0 }
+};
+#else
+extern const ICONDATA g_iconData[] =
+{
+ { IDI_WIN_NOROMS, "noroms" },
+ { IDI_WIN_ROMS, "roms" },
+ { IDI_WIN_UNKNOWN, "unknown" },
+ { IDI_WIN_CLONE, "clone" },
+ { IDI_WIN_REDX, "warning" },
+ { IDI_WIN_IMPERFECT, "imperfect" },
+ { 0 }
+};
+#endif
+
+#ifdef MESS
+extern const TCHAR g_szPlayGameString[] = TEXT("&Run %s");
+extern const char g_szGameCountString[] = "%d machines";
+#else
+extern const TCHAR g_szPlayGameString[] = TEXT("&Play %s");
+extern const char g_szGameCountString[] = "%d games";
+#endif
diff --git a/docs/release/src/osd/winui/mameui.rc b/docs/release/src/osd/winui/mameui.rc
new file mode 100644
index 00000000000..0dc6f910374
--- /dev/null
+++ b/docs/release/src/osd/winui/mameui.rc
@@ -0,0 +1,1467 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "newuires.h"
+#include "resource.h"
+
+// Generated Help ID header file
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "resource.hm"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "windows.h"
+#include "commctrl.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (USA) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MAIN_MENU MENU DISCARDABLE
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Exit", ID_FILE_EXIT
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "&About MAMEUI", ID_ABOUT
+ END
+END
+
+IDR_UI_MENU MENU DISCARDABLE
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Play", ID_FILE_PLAY
+ MENUITEM SEPARATOR
+ MENUITEM "Play and &Record Input...", ID_FILE_PLAY_RECORD
+ MENUITEM "P&layback Input...", ID_FILE_PLAY_BACK
+ MENUITEM SEPARATOR
+ MENUITEM "Play and Record &Wave Output...", ID_FILE_PLAY_RECORD_WAVE
+ MENUITEM SEPARATOR
+ MENUITEM "Play and Record &MNG Output...", ID_FILE_PLAY_RECORD_MNG
+ MENUITEM SEPARATOR
+ MENUITEM "Play and Record &uncompressed AVI Output...",
+ ID_FILE_PLAY_RECORD_AVI
+ MENUITEM SEPARATOR
+ MENUITEM "Loa&d Savestate...", ID_FILE_LOADSTATE
+ MENUITEM SEPARATOR
+
+ MENUITEM "Pr&operties", ID_GAME_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "Audi&t existing sets", ID_FILE_AUDIT_X
+ MENUITEM "&Audit all sets", ID_FILE_AUDIT
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_FILE_EXIT
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "&Toolbar\tAlt+T", ID_VIEW_TOOLBARS
+ MENUITEM "&Status bar\tAlt+S", ID_VIEW_STATUS
+ MENUITEM "Fold&er List\tAlt+D", ID_VIEW_FOLDERS
+ MENUITEM "&Picture Area\tAlt+P", ID_VIEW_PICTURE_AREA
+ MENUITEM "Screenshot Ta&b\tAlt+B", ID_VIEW_PAGETAB
+ MENUITEM SEPARATOR
+ MENUITEM "&Fullscreen\tF11", ID_VIEW_FULLSCREEN
+ MENUITEM SEPARATOR
+ POPUP "S&how Pictures"
+ BEGIN
+ MENUITEM "&Snapshot", ID_TOGGLE_TAB_SCREENSHOT
+ MENUITEM "&Flyer", ID_TOGGLE_TAB_FLYER
+ MENUITEM "&Cabinet", ID_TOGGLE_TAB_CABINET
+ MENUITEM "&Marquee", ID_TOGGLE_TAB_MARQUEE
+ MENUITEM "&Title", ID_TOGGLE_TAB_TITLE
+ MENUITEM "Control &Panel", ID_TOGGLE_TAB_CONTROL_PANEL
+
+ MENUITEM "PC&B", ID_TOGGLE_TAB_PCB
+ MENUITEM "&History", ID_TOGGLE_TAB_HISTORY
+ END
+ MENUITEM SEPARATOR
+ MENUITEM "L&arge Icons", ID_VIEW_LARGE_ICON
+ MENUITEM "S&mall Icons", ID_VIEW_SMALL_ICON
+ MENUITEM "&List", ID_VIEW_LIST_MENU
+ MENUITEM "&Details", ID_VIEW_DETAIL
+ MENUITEM "&Grouped", ID_VIEW_GROUPED
+ MENUITEM SEPARATOR
+ POPUP "Arrange &Icons"
+ BEGIN
+ MENUITEM "by &Name", ID_VIEW_BYGAME
+ MENUITEM "by D&irectory", ID_VIEW_BYDIRECTORY
+ MENUITEM "by &Manufacturer", ID_VIEW_BYMANUFACTURER
+ MENUITEM "by Times &Played", ID_VIEW_BYTIMESPLAYED
+ MENUITEM "by &Type", ID_VIEW_BYTYPE
+ MENUITEM "by &Date", ID_VIEW_BYYEAR
+ END
+ MENUITEM "Line &Up Icons", ID_VIEW_LINEUPICONS
+ MENUITEM SEPARATOR
+ MENUITEM "&Refresh\tF5", ID_UPDATE_GAMELIST
+ MENUITEM "&Custom Filters...\tCtrl+F", ID_CONTEXT_FILTERS
+ MENUITEM "Customi&ze Fields...", ID_CUSTOMIZE_FIELDS
+ END
+ POPUP "&Options"
+ BEGIN
+ MENUITEM "&Interface Options", ID_OPTIONS_INTERFACE
+ MENUITEM "Default Game &Options", ID_OPTIONS_DEFAULTS
+ MENUITEM "&Directories", ID_OPTIONS_DIR
+ MENUITEM SEPARATOR
+ MENUITEM "Game List &Font", ID_OPTIONS_FONT
+ MENUITEM "Game List &Clone Color", ID_OPTIONS_CLONE_COLOR
+ MENUITEM SEPARATOR
+
+ MENUITEM "&Background Image", ID_OPTIONS_BG
+ MENUITEM SEPARATOR
+ MENUITEM "&Reset to Default", ID_OPTIONS_RESET_DEFAULTS
+
+ END
+ POPUP "&Help"
+ BEGIN
+// MENUITEM "&Contents\tF1", ID_HELP_CONTENTS
+// MENUITEM "&Troubleshooting", ID_HELP_TROUBLE
+// MENUITEM SEPARATOR
+// MENUITEM "&New Game Changes", ID_HELP_WHATS_NEWUI
+// MENUITEM "&Mame Release Notes", ID_HELP_WHATS_NEW
+// MENUITEM SEPARATOR
+// MENUITEM "&About", ID_HELP_ABOUT
+// MENUITEM "&Mess Release Notes", ID_HELP_RELEASE
+ MENUITEM "What's New in MAME", ID_HELP_WHATS_NEW
+ MENUITEM "&Contents\tF1", ID_HELP_CONTENTS
+// MENUITEM "&Troubleshooting", ID_HELP_TROUBLE
+ MENUITEM "&About", ID_HELP_ABOUT
+ END
+END
+
+IDR_CONTEXT_MENU MENU
+BEGIN
+ POPUP "Context Menu"
+ BEGIN
+ MENUITEM "&Play", ID_FILE_PLAY
+ MENUITEM SEPARATOR
+ MENUITEM "Play and &Record Input...", ID_FILE_PLAY_RECORD
+ MENUITEM SEPARATOR
+ MENUITEM "&Add to Custom Folder...", ID_CONTEXT_ADD_CUSTOM
+ MENUITEM "R&emove From This Folder", ID_CONTEXT_REMOVE_CUSTOM
+ MENUITEM "&Custom Filters...", ID_CONTEXT_FILTERS
+ MENUITEM SEPARATOR
+ MENUITEM "&Select Random Game", ID_CONTEXT_SELECT_RANDOM
+ MENUITEM SEPARATOR
+ MENUITEM "Rese&t Playcount", ID_CONTEXT_RESET_PLAYCOUNT
+ MENUITEM "Reset Pla&y Time", ID_CONTEXT_RESET_PLAYTIME
+ MENUITEM SEPARATOR
+ MENUITEM "A&udit", ID_GAME_AUDIT
+ MENUITEM SEPARATOR
+ MENUITEM "Pr&operties", ID_GAME_PROPERTIES
+ MENUITEM "Source propert&ies", ID_FOLDER_SOURCEPROPERTIES
+ MENUITEM "&Vector properties", ID_FOLDER_VECTORPROPERTIES
+ END
+END
+
+IDR_CONTEXT_HEADER MENU
+BEGIN
+ POPUP "Header Context Menu"
+ BEGIN
+ MENUITEM "Sort &Ascending", ID_SORT_ASCENDING
+ MENUITEM "Sort &Descending", ID_SORT_DESCENDING
+ MENUITEM SEPARATOR
+ MENUITEM "Customi&ze Fields...", ID_CUSTOMIZE_FIELDS
+ END
+END
+
+IDR_CONTEXT_TREE MENU
+BEGIN
+ POPUP "Context Menu Tree"
+ BEGIN
+ MENUITEM "&Rename", ID_CONTEXT_RENAME_CUSTOM
+ MENUITEM "&Custom Filters...", ID_CONTEXT_FILTERS
+ MENUITEM SEPARATOR
+ POPUP "&Show Folders"
+ BEGIN
+ MENUITEM "overridden by code", ID_CONTEXT_SHOW_FOLDER_START
+
+ END
+ MENUITEM SEPARATOR
+ MENUITEM "&Audit", ID_FOLDER_AUDIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Properties", ID_FOLDER_PROPERTIES
+ END
+END
+
+IDR_CONTEXT_SCREENSHOT MENU
+BEGIN
+ POPUP "Context Screen Shot"
+ BEGIN
+ MENUITEM "Show Tab &Control", ID_VIEW_PAGETAB
+ MENUITEM SEPARATOR
+ POPUP "S&how Pictures"
+ BEGIN
+ MENUITEM "&Snapshot", ID_TOGGLE_TAB_SCREENSHOT
+ MENUITEM "&Flyer", ID_TOGGLE_TAB_FLYER
+ MENUITEM "&Cabinet", ID_TOGGLE_TAB_CABINET
+ MENUITEM "&Marquee", ID_TOGGLE_TAB_MARQUEE
+ MENUITEM "&Title", ID_TOGGLE_TAB_TITLE
+ MENUITEM "Control &Panel", ID_TOGGLE_TAB_CONTROL_PANEL
+
+ MENUITEM "PC&B", ID_TOGGLE_TAB_PCB
+ MENUITEM "&History", ID_TOGGLE_TAB_HISTORY
+ END
+ MENUITEM SEPARATOR
+ MENUITEM "&Snapshot", ID_VIEW_TAB_SCREENSHOT
+ MENUITEM "&Flyer", ID_VIEW_TAB_FLYER
+ MENUITEM "&Cabinet", ID_VIEW_TAB_CABINET
+ MENUITEM "&Marquee", ID_VIEW_TAB_MARQUEE
+ MENUITEM "&Title", ID_VIEW_TAB_TITLE
+ MENUITEM "Control &Panel", ID_VIEW_TAB_CONTROL_PANEL
+ MENUITEM "PC&B", ID_VIEW_TAB_PCB
+ MENUITEM "&History", ID_VIEW_TAB_HISTORY
+ END
+END
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_RUNTIME_MENU MENU
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Load State...", ID_FILE_LOADSTATE_NEWUI, GRAYED
+ MENUITEM "&Save State", ID_FILE_SAVESTATE, GRAYED
+ MENUITEM "S&ave State As...", ID_FILE_SAVESTATE_AS, GRAYED
+ MENUITEM SEPARATOR
+ MENUITEM "Save Sc&reenshot", ID_FILE_SAVESCREENSHOT
+ MENUITEM SEPARATOR
+ MENUITEM "&Hide Menubar", ID_FILE_TOGGLEMENUBAR
+ MENUITEM "&Full Screen\tAlt+Enter", ID_FILE_FULLSCREEN
+ MENUITEM "Partial Keyboard Emulation", ID_FILE_UIACTIVE
+ MENUITEM "Show Tab Menu", ID_FILE_OLDUI
+ MENUITEM SEPARATOR
+ MENUITEM "&Exit", ID_FILE_EXIT_NEWUI
+ END
+ POPUP "&Edit"
+ BEGIN
+ MENUITEM "Paste", ID_EDIT_PASTE
+ END
+ POPUP "&Options"
+ BEGIN
+ MENUITEM "&Pause", ID_OPTIONS_PAUSE, GRAYED
+ MENUITEM "Soft &Reset", ID_OPTIONS_SOFTRESET
+ MENUITEM "Ha&rd Reset", ID_OPTIONS_HARDRESET
+ MENUITEM SEPARATOR
+ POPUP "&Keyboard"
+ BEGIN
+ MENUITEM "Emulated", ID_KEYBOARD_EMULATED
+ MENUITEM "Natural", ID_KEYBOARD_NATURAL
+ MENUITEM SEPARATOR
+ MENUITEM "Customise Emulated Keyboard...", ID_KEYBOARD_CUSTOMIZE
+ END
+ MENUITEM "&Joysticks", ID_OPTIONS_JOYSTICKS, GRAYED
+ POPUP "&Video"
+ BEGIN
+ MENUITEM SEPARATOR
+ MENUITEM "Rotate 0 degrees", ID_VIDEO_ROTATE_0
+ MENUITEM "Rotate 90 degrees", ID_VIDEO_ROTATE_90
+ MENUITEM "Rotate 180 degrees", ID_VIDEO_ROTATE_180
+ MENUITEM "Rotate 270 degrees", ID_VIDEO_ROTATE_270
+ END
+ MENUITEM "&Configuration...", ID_OPTIONS_CONFIGURATION
+ MENUITEM "&DIP Switches...", ID_OPTIONS_DIPSWITCHES
+ MENUITEM "&Miscellaneous Inputs...", ID_OPTIONS_MISCINPUT
+ MENUITEM "&Analog Controls...", ID_OPTIONS_ANALOGCONTROLS
+ MENUITEM SEPARATOR
+ POPUP "&Frameskip"
+ BEGIN
+ MENUITEM "Auto", ID_FRAMESKIP_AUTO
+ END
+ POPUP "Maximum &Speed"
+ BEGIN
+ MENUITEM "50%", ID_THROTTLE_50
+ MENUITEM "100%", ID_THROTTLE_100
+ MENUITEM "200%", ID_THROTTLE_200
+ MENUITEM "500%", ID_THROTTLE_500
+ MENUITEM "1000%", ID_THROTTLE_1000
+ MENUITEM "Unlimited", ID_THROTTLE_UNTHROTTLED
+ END
+ MENUITEM "Show &FPS", ID_OPTIONS_TOGGLEFPS
+ END
+ POPUP "&Media"
+ BEGIN
+ MENUITEM SEPARATOR
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "About This System...", ID_HELP_ABOUTSYSTEM
+ MENUITEM "&About MAME...", ID_HELP_ABOUT_NEWUI
+ END
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "resource.h\\r\n"
+ "newuires.h\0"
+END
+
+2 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "#define NOWINRES\r\n"
+ "#include ""windows.h""\r\n"
+ "#include ""commctrl.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "#include ""mamevers.rc"" // Version block\r\n"
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAMEUI_ICON ICON "res\\mameui.ico"
+IDI_WIN_ROMS ICON "res\\win_roms.ico"
+IDI_WIN_NOROMS ICON "res\\win_noro.ico"
+IDI_WIN_UNKNOWN ICON "res\\win_unkn.ico"
+IDI_WIN_CLONE ICON "res\\win_clone.ico"
+IDI_WIN_REDX ICON "res\\win_redx.ico"
+IDI_FOLDER_AVAILABLE ICON "res\\foldavail.ico"
+IDI_FOLDER ICON "res\\folder.ico"
+IDI_FOLDER_MANUFACTURER ICON "res\\foldmanu.ico"
+IDI_FOLDER_OPEN ICON "res\\foldopen.ico"
+IDI_FOLDER_UNAVAILABLE ICON "res\\foldunav.ico"
+IDI_FOLDER_HORIZONTAL ICON "res\\horz.ico"
+IDI_FOLDER_VERTICAL ICON "res\\vert.ico"
+IDI_MANUFACTURER ICON "res\\manufact.ico"
+IDI_FOLDER_YEAR ICON "res\\foldyear.ico"
+IDI_FOLDER_SOURCE ICON "res\\foldsrc.ico"
+IDI_WORKING ICON "res\\working.ico"
+IDI_NONWORKING ICON "res\\nonwork.ico"
+IDI_YEAR ICON "res\\year.ico"
+IDI_KEYBOARD ICON "res\\keyboard.ico"
+IDI_JOYSTICK ICON "res\\joystick.ico"
+IDI_CPU ICON "res\\cpu.ico"
+IDI_SOUND ICON "res\\samples.ico"
+IDI_SOUNDTAB ICON "res\\sound.ico"
+IDI_SOURCE ICON "res\\source.ico"
+IDI_HARDDISK ICON "res\\harddisk.ico"
+IDI_DISPLAY ICON "res\\display.ico"
+IDI_CHECKMARK ICON "res\\checkmark.ico"
+IDI_HEADER_UP ICON "res\\header_up.ico"
+IDI_HEADER_DOWN ICON "res\\header_down.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUT DIALOG DISCARDABLE 0, 0, 296, 129
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About MAMEUI"
+FONT 8, "Tahoma"
+BEGIN
+ DEFPUSHBUTTON "&OK",IDOK,200,109,50,14,WS_GROUP
+ CTEXT "HomeBrew MAME",IDC_STATIC,147,7,142,
+ 11,NOT WS_GROUP
+ CTEXT "Version 0",IDC_VERSION,147,18,142,11,NOT WS_GROUP
+ CTEXT "Copyright (C) 1997-2018 The HBMAME Team",IDC_STATIC,147,
+ 29,142,10,NOT WS_GROUP
+ CTEXT "MAMEUI version by",IDC_STATIC,147,51,142,10,NOT
+ WS_GROUP
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,147,44,142,1
+ CTEXT "Christopher Kirmse and the MAMEUI team",IDC_STATIC,147,
+ 62,142,9,NOT WS_GROUP
+ CTEXT "Additional MAMEUI code by",IDC_STATIC,147,74,142,9
+ CTEXT "Mike Haaland, Andrew Kirmse, Jeff Miller",IDC_STATIC,
+ 147,85,142,9
+ CTEXT "John Hardy IV and Michael Soderstrom",IDC_STATIC,147,96,
+ 142,9
+ CONTROL "",IDC_ABOUT,"Static",SS_BITMAP | SS_SUNKEN,7,7,16,14
+END
+
+IDD_DIRECTX DIALOG DISCARDABLE 0, 0, 236, 69
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "MAMEUI"
+FONT 8, "Tahoma"
+BEGIN
+ DEFPUSHBUTTON "Go to Microsoft's DirectX Web Page",IDB_WEB_PAGE,48,52,
+ 140,14
+ EDITTEXT IDC_DIRECTX_HELP,7,0,222,48,ES_MULTILINE |
+ ES_AUTOHSCROLL | ES_READONLY
+END
+
+IDD_AUDIT DIALOG DISCARDABLE 0, 0, 283, 188
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "File Audit"
+FONT 8, "Tahoma"
+BEGIN
+ PUSHBUTTON "&Pause",IDPAUSE,98,168,40,14
+ PUSHBUTTON "&Cancel",IDCANCEL,144,168,40,14
+ GROUPBOX "ROMs",IDC_STATIC,6,4,132,65
+ LTEXT "Correct:",IDC_STATIC,51,28,32,8
+ CONTROL "Progress1",IDC_ROMS_PROGRESS,"msctls_progress32",
+ PBS_SMOOTH | WS_BORDER,14,16,116,8
+ LTEXT "Incorrect:",IDC_STATIC,51,42,32,8
+ LTEXT "Total:",IDC_STATIC,51,56,32,8
+ LTEXT "0",IDC_ROMS_CORRECT,87,28,20,8
+ LTEXT "0",IDC_ROMS_INCORRECT,87,42,20,8
+ LTEXT "0",IDC_ROMS_TOTAL,87,56,20,8
+ GROUPBOX "Samples",IDC_STATIC,145,4,132,65
+ CONTROL "Progress1",IDC_SAMPLES_PROGRESS,"msctls_progress32",
+ PBS_SMOOTH | WS_BORDER,153,16,116,8
+ LTEXT "Correct:",IDC_STATIC,191,28,33,8
+ LTEXT "Incorrect:",IDC_STATIC,191,42,33,8
+ LTEXT "Total:",IDC_STATIC,191,56,33,8
+ LTEXT "0",IDC_SAMPLES_CORRECT,227,28,20,8
+ LTEXT "0",IDC_SAMPLES_INCORRECT,227,42,20,8
+ LTEXT "0",IDC_SAMPLES_TOTAL,227,56,20,8
+ GROUPBOX "Details",IDC_STATIC,6,72,271,90
+ EDITTEXT IDC_AUDIT_DETAILS,12,82,259,74,ES_MULTILINE |
+ ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL |
+ NOT WS_TABSTOP
+END
+
+IDD_DIRECTORIES DIALOG DISCARDABLE 0, 0, 230, 107
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Directories"
+FONT 8, "Tahoma"
+BEGIN
+ LTEXT "Show directories for:",IDC_STATIC,6,6,67,10
+ COMBOBOX IDC_DIR_COMBO,6,18,160,79,CBS_DROPDOWNLIST | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "Directories:",IDC_STATIC,6,38,38,10
+ CONTROL "List1",IDC_DIR_LIST,"SysListView32",LVS_REPORT |
+ LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_EDITLABELS |
+ LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER |
+ WS_TABSTOP,6,50,160,51
+ DEFPUSHBUTTON "OK",IDOK,173,8,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,173,26,50,14
+ PUSHBUTTON "Browse...",IDC_DIR_BROWSE,173,50,50,14
+ PUSHBUTTON "Insert",IDC_DIR_INSERT,173,68,50,14
+ PUSHBUTTON "Delete",IDC_DIR_DELETE,173,87,50,14
+END
+
+IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 302, 145
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Customize Fields"
+FONT 8, "Tahoma"
+BEGIN
+ LTEXT "Available fields:",IDC_STATIC,6,6,80,10,SS_CENTERIMAGE
+ CONTROL "List1",IDC_LISTAVAILABLECOLUMNS,"SysListView32",
+ LVS_LIST | LVS_SINGLESEL | LVS_NOCOLUMNHEADER |
+ LVS_NOSORTHEADER | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6,
+ 18,90,100
+ PUSHBUTTON "Add ->",IDC_BUTTONADD,102,18,46,14,WS_DISABLED
+ PUSHBUTTON "<- Remove",IDC_BUTTONREMOVE,102,36,46,14,WS_DISABLED
+ LTEXT "Show these fields in this order:",IDC_STATIC,154,6,96,
+ 10,SS_CENTERIMAGE
+ CONTROL "List1",IDC_LISTSHOWCOLUMNS,"SysListView32",LVS_LIST |
+ LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER |
+ WS_BORDER | WS_HSCROLL | WS_TABSTOP,154,18,90,100
+ PUSHBUTTON "Move Up",IDC_BUTTONMOVEUP,250,18,46,14,WS_DISABLED
+ PUSHBUTTON "Move Down",IDC_BUTTONMOVEDOWN,250,36,46,14,WS_DISABLED
+ DEFPUSHBUTTON "OK",IDOK,105,124,44,14
+ PUSHBUTTON "Cancel",IDCANCEL,155,124,44,14
+END
+
+IDD_PROP_CONTROLLER DIALOGEX 0, 0, 220, 240
+STYLE DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Controller Mapping"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_JOYSTICK,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ GROUPBOX "Paddle device",IDC_STATIC,4,40,102,28
+ COMBOBOX IDC_PADDLE,10,50,91,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_PADDLE
+ GROUPBOX "ADStick device",IDC_STATIC,4,71,102,28
+ COMBOBOX IDC_ADSTICK,10,80,91,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_ADSTICK
+ GROUPBOX "Pedal device",IDC_STATIC,4,102,102,28
+ COMBOBOX IDC_PEDAL,10,112,91,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_PEDAL
+ GROUPBOX "Mouse device",IDC_STATIC,4,133,102,28
+ COMBOBOX IDC_MOUSE,10,142,90,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_MOUSE
+ GROUPBOX "Dial device",IDC_STATIC,113,40,102,28
+ COMBOBOX IDC_DIAL,119,50,90,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_DIAL
+ GROUPBOX "Trackball device",IDC_STATIC,113,71,102,28
+ COMBOBOX IDC_TRACKBALL,119,80,90,62,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_TRACKBALL
+ GROUPBOX "Lightgun device",IDC_STATIC,113,102,102,28
+ COMBOBOX IDC_LIGHTGUNDEVICE,119,112,90,62,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP,0,HIDC_LIGHTGUNDEVICE
+ GROUPBOX "Positional device",IDC_STATIC,113,133,102,28
+ COMBOBOX IDC_POSITIONAL,119,142,90,62,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP,0,HIDC_POSITIONAL
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
+ 0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_SCREEN DIALOGEX 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Screen"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_DISPLAY,IDC_STATIC,20,10,21,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
+
+ GROUPBOX "Number of screens",IDC_STATIC,4,40,103,24
+ CONTROL "GammaSlider",IDC_NUMSCREENS,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,50,75,10,0,HIDC_NUMSCREENS
+ RTEXT "1",IDC_NUMSCREENSDISP,84,49,14,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Screen",IDC_STATIC,4,66,103,29
+ COMBOBOX IDC_SCREEN,10,76,91,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SCREEN
+
+ GROUPBOX "",IDC_STATIC,4,97,103,28
+ CONTROL "Autoselect aspect",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,97,73,10,0,HIDC_ASPECT
+ LTEXT "Aspect ratio",IDC_ASPECTRATIOTEXT,17,108,40,11,SS_CENTERIMAGE | NOT WS_GROUP
+ EDITTEXT IDC_ASPECTRATION,60,108,14,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,0,HIDC_ASPECTRATION
+ LTEXT ":",IDC_STATIC,76,108,8,10,SS_CENTERIMAGE | NOT WS_GROUP
+ EDITTEXT IDC_ASPECTRATIOD,80,108,14,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,0,HIDC_ASPECTRATIOD
+
+ GROUPBOX "View",IDC_STATIC,4,128,103,28
+ COMBOBOX IDC_VIEW,10,137,91,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_VIEW
+
+ GROUPBOX "Screennumber",IDC_SCREENSELECTTEXT,113,40,102,28
+ COMBOBOX IDC_SCREENSELECT,119,50,90,64,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SCREENSELECT
+
+ GROUPBOX "Resolution",IDC_STATIC,113,71,102,76,WS_GROUP
+ GROUPBOX "Size",IDC_STATIC,119,81,90,28,WS_GROUP
+ COMBOBOX IDC_SIZES,126,91,77,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SIZES
+
+ GROUPBOX "Refresh",IDC_REFRESHTEXT,119,112,90,28,WS_GROUP
+ COMBOBOX IDC_REFRESH,126,121,77,76,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_REFRESH
+ CONTROL "Switch resolutions to fit",IDC_SWITCHRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,151,93,10,0,HIDC_SWITCHRES
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_GAME DIALOG DISCARDABLE 0, 0, 220, 276
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "General"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_MAMEUI_ICON,IDC_GAME_ICON,20,10,21,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,38,178,1
+ LTEXT "Manufactured:",IDC_STATIC,18,43,47,8
+ LTEXT "Static",IDC_PROP_MANUFACTURED,65,43,155,9,SS_NOPREFIX
+ LTEXT "Status:",IDC_STATIC,18,52,47,8
+ LTEXT "Static",IDC_PROP_STATUS,65,52,155,32
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,85,178,1
+ LTEXT "CPU:",IDC_STATIC,18,90,47,8
+ LTEXT "Static\nStatic\nStatic\nStatic\nStatic",IDC_PROP_CPU,65,90,155,40
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,130,178,1
+ LTEXT "Sound:",IDC_STATIC,18,135,47,8
+ LTEXT "Static\nStatic\nStatic\nStatic\nStatic",IDC_PROP_SOUND,65,135,155,45
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,181,178,1
+ LTEXT "Screen:",IDC_STATIC,18,186,47,8
+ LTEXT "Static\nStatic\nStatic",IDC_PROP_SCREEN,65,186,155,27
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,218,178,1
+ LTEXT "Source:",IDC_STATIC,16,223,47,8
+ LTEXT "Static",IDC_PROP_SOURCE,65,223,139,8
+ LTEXT "Clone of:",IDC_PROP_CLONEOF_TEXT,16,232,50,8
+ LTEXT "Static",IDC_PROP_CLONEOF,65,232,130,33
+END
+
+IDD_PROP_AUDIT DIALOG DISCARDABLE 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Audit"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_CHECKMARK,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ LTEXT "ROM check:",IDC_STATIC,10,40,50,8
+ LTEXT "Checking...",IDC_PROP_ROMS,66,40,139,8
+ LTEXT "Sample check:",IDC_STATIC,10,52,50,8
+ LTEXT "Checking...",IDC_PROP_SAMPLES,66,52,139,8
+ GROUPBOX "Details",IDC_STATIC,4,64,211,171
+ EDITTEXT IDC_AUDIT_DETAILS_PROP,10,74,199,155,ES_MULTILINE |
+ ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL |
+ NOT WS_TABSTOP
+END
+
+IDD_PROP_DISPLAY DIALOGEX 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Display"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_DISPLAY,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,169,25,SS_NOPREFIX
+
+ CONTROL "Run in a window",IDC_WINDOWED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,69,10,0,HIDC_WINDOWED
+ CONTROL "Start out maximized",IDC_MAXIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,52,74,10,0,HIDC_MAXIMIZE
+ CONTROL "Enforce aspect ratio",IDC_KEEPASPECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,64,77,10,0,HIDC_KEEPASPECT
+ CONTROL "Throttle",IDC_THROTTLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,39,10,0,HIDC_THROTTLE
+
+ GROUPBOX "Bitmap prescaling",IDC_PRESCALETEXT,4,89,103,24
+ CONTROL "GammaSlider",IDC_PRESCALE,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,99,71,10,0,HIDC_PRESCALE
+ RTEXT "1.00",IDC_PRESCALEDISP,84,98,14,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Gamma Correction",IDC_STATIC,4,115,103,24
+ CONTROL "GammaSlider",IDC_GAMMA,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,125,71,10,0,HIDC_GAMMA
+ RTEXT "2.00",IDC_GAMMADISP,84,124,14,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Brightness Correction",IDC_STATIC,4,141,103,24
+ CONTROL "GammaSlider",IDC_BRIGHTCORRECT,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,151,71,10,0,HIDC_BRIGHTCORRECT
+ RTEXT "1.00",IDC_BRIGHTCORRECTDISP,84,150,14,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Contrast Correction",IDC_STATIC,4,167,103,24
+ CONTROL "GammaSlider",IDC_CONTRAST,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,176,71,10,0,HIDC_CONTRAST
+ RTEXT "1.00",IDC_CONTRASTDISP,84,175,14,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Pause Brightness",IDC_STATIC,4,193,103,24
+ CONTROL "Slider1",IDC_PAUSEBRIGHT,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,203,71,10,0,HIDC_PAUSEBRIGHT
+ RTEXT "0.65",IDC_PAUSEBRIGHTDISP,84,202,14,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Video mode",IDC_STATIC,113,40,102,28
+ COMBOBOX IDC_VIDEO_MODE,119,50,90,50,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP,0,HIDC_VIDEO_MODE
+
+ GROUPBOX "Rotation",IDC_STATIC,113,71,102,55
+ COMBOBOX IDC_ROTATE,119,81,90,57,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_ROTATE
+ CONTROL "Flip screen upside-down",IDC_FLIPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,98,91,10,0,HIDC_FLIPY
+ CONTROL "Flip screen left-right",IDC_FLIPX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,110,77,10,0,HIDC_FLIPX
+
+ GROUPBOX "Direct3D",IDC_STATIC,113,128,102,57
+ CONTROL "Use Bilinear filtering",IDC_D3D_FILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,138,85,10,0,HIDC_D3D_FILTER
+
+// GROUPBOX "Version",IDC_STATIC,119,150,90,28
+// COMBOBOX IDC_D3D_VERSION,125,160,78,95,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_D3D_VERSION
+
+// GROUPBOX "DirectDraw",IDC_STATIC,113,187,102,26
+// CONTROL "Stretch using hardware",IDC_HWSTRETCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,197,85,10,0,HIDC_HWSTRETCH
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_SOUND DIALOGEX 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Sound"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_SOUNDTAB,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
+
+ GROUPBOX "",IDC_STATIC,4,40,211,155
+
+ GROUPBOX "Soundmode",IDC_STATIC,60,50,100,28
+ COMBOBOX IDC_SOUND_MODE,66,60,88,50,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP,0,HIDC_VIDEO_MODE
+
+ CONTROL "Use samples",IDC_SAMPLES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,60,84,55,10,0,HIDC_SAMPLES
+
+ GROUPBOX "Sample rate",IDC_RATETEXT,60,96,100,28
+ COMBOBOX IDC_SAMPLERATE,66,106,88,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_SAMPLERATE
+
+ GROUPBOX "Volume attenuation",IDC_VOLUMETEXT,60,127,100,28
+ CONTROL "Slider1",IDC_VOLUME,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,66,139,68,10,0,HIDC_VOLUME
+ RTEXT "0dB",IDC_VOLUMEDISP,132,138,20,11,SS_CENTERIMAGE
+
+ GROUPBOX "Audio latency",IDC_AUDIO_LATENCY_TEXT,60,158,100,28
+ CONTROL "Slider1",IDC_AUDIO_LATENCY,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,66,170,68,10,0,HIDC_AUDIO_LATENCY
+ RTEXT "1/5",IDC_AUDIO_LATENCY_DISP,132,169,20,11,SS_CENTERIMAGE
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_ADVANCED DIALOGEX 0, 0, 220, 255
+STYLE DS_FIXEDSYS | WS_CHILD | WS_CAPTION
+CAPTION "Advanced"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_DISPLAY,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
+
+ CONTROL "Triple buffering",IDC_TRIPLE_BUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,93,10,0,HIDC_TRIPLE_BUFFER
+ CONTROL "Sync to monitor refresh",IDC_SYNCREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,52,93,10,0,HIDC_SYNCREFRESH
+ CONTROL "Wait for vertical sync",IDC_WAITVSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,64,93,10,0,HIDC_WAITVSYNC
+ CONTROL "Refresh speed",IDC_REFRESHSPEED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,93,10,0,HIDC_REFRESHSPEED
+
+ GROUPBOX "Frame skipping",IDC_STATIC,4,104,103,42
+ CONTROL "Automatic",IDC_AUTOFRAMESKIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,114,77,10,0,HIDC_AUTOFRAMESKIP
+ COMBOBOX IDC_FRAMESKIP,10,127,91,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_FRAMESKIP
+
+ GROUPBOX "Full screen gamma",IDC_FSGAMMATEXT,113,40,102,24
+ CONTROL "Slider1",IDC_FSGAMMA,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,119,50,71,10,0,HIDC_FSGAMMA
+ RTEXT "2.00",IDC_FSGAMMADISP,193,49,16,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Full screen brightness",IDC_FSBRIGHTNESSTEXT,113,67,102,24
+ CONTROL "Slider1",IDC_FSBRIGHTNESS,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,119,77,71,10,0,HIDC_FSBRIGHTNESS
+ RTEXT "2.00",IDC_FSBRIGHTNESSDISP,193,76,16,10,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Full screen contrast",IDC_FSCONTRASTTEXT,113,94,102,24
+ CONTROL "Slider1",IDC_FSCONTRAST,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,119,104,71,10,0,HIDC_FSCONTRAST
+ RTEXT "2.00",IDC_FSCONTRASTDISP,193,103,16,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Seconds to run",IDC_SECONDSTORUNTEXT,113,122,102,24
+ CONTROL "",IDC_SECONDSTORUN,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,119,132,71,10,0,HIDC_SECONDSTORUN
+ RTEXT "60",IDC_SECONDSTORUNDISP,193,130,16,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Emulation speed",IDC_SPEEDTEXT,4,155,211,24
+ CONTROL "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,12,165,180,10,0,HIDC_SPEED
+ RTEXT "1.00",IDC_SPEEDDISP,191,164,20,11,SS_CENTERIMAGE | NOT WS_GROUP
+
+ GROUPBOX "Effect",IDC_STATIC,4,182,211,50
+ EDITTEXT IDC_EFFECT,12,192,200,14,ES_AUTOHSCROLL | WS_DISABLED
+ PUSHBUTTON "Select Effect",IDC_SELECT_EFFECT,12,211,60,14,0,0,HIDC_SELECT_EFFECT
+ PUSHBUTTON "Reset Effect",IDC_RESET_EFFECT,152,211,60,14,0,0,HIDC_RESET_EFFECT
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,238,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,120,238,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_DEBUG DIALOGEX 0, 0, 220, 255
+STYLE DS_FIXEDSYS | WS_CHILD | WS_CAPTION
+CAPTION "Debug"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_MANUFACTURER,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,SS_NOPREFIX
+
+ CONTROL "Output log to Windows Debugger",IDC_OSLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,124,10,0,HIDC_OSLOG
+ CONTROL "Output log to Logfile",IDC_LOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,52,93,10,0,HIDC_LOG
+ CONTROL "Output diagnostic information",IDC_VERBOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,64,111,10,0,HIDC_VERBOSE
+ CONTROL "Update Main window during paused emulation",IDC_UPDATEINPAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,171,10,0,HIDC_UPDATEINPAUSE
+ CONTROL "Activate Integrated Debugger",IDC_DEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,88,118,10,0,HIDC_DEBUG
+
+ GROUPBOX "Debugscript",IDC_STATIC,6,104,211,50
+ EDITTEXT IDC_DEBUGSCRIPT,14,114,200,14,ES_AUTOHSCROLL | WS_DISABLED
+ PUSHBUTTON "Select Debugscript",IDC_SELECT_DEBUGSCRIPT,14,133,67,14,0,0,HIDC_SELECT_DEBUGSCRIPT
+ PUSHBUTTON "Reset Debugscript",IDC_RESET_DEBUGSCRIPT,149,133,65,14,0,0,HIDC_RESET_DEBUGSCRIPT
+
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,238,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,120,238,97,14,0,0,HIDC_USE_DEFAULT
+END
+
+IDD_PROP_INPUT DIALOGEX 0, 0, 220, 240
+STYLE DS_FIXEDSYS | WS_CHILD | WS_CAPTION
+CAPTION "Controllers"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_JOYSTICK,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ CONTROL "Enable mouse input",IDC_USE_MOUSE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,40,86,10,0,
+ HIDC_USE_MOUSE
+ CONTROL "Enable steadykey support",IDC_STEADYKEY,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,52,95,10,0,
+ HIDC_STEADYKEY
+ GROUPBOX "",IDC_STATIC,4,64,103,74
+ CONTROL "Enable joystick input",IDC_JOYSTICK,"Button",
+ BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,10,64,78,10,0,
+ HIDC_JOYSTICK
+ GROUPBOX "Joystick deadzone",IDC_JDZTEXT,10,76,91,28
+ CONTROL "IntensitySlider",IDC_JDZ,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,15,88,60,10,0,HIDC_JDZ
+ RTEXT "0.3",IDC_JDZDISP,76,87,16,11,SS_CENTERIMAGE | NOT
+ WS_GROUP
+ GROUPBOX "Default input layout",IDC_STATIC,113,40,102,28
+ COMBOBOX IDC_DEFAULT_INPUT,119,50,90,53,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP,0,HIDC_DEFAULT_INPUT
+ GROUPBOX "",IDC_STATIC,113,71,102,66
+ CONTROL "Enable lightgun input",IDC_LIGHTGUN,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,71,80,10,0,
+ HIDC_LIGHTGUN
+ CONTROL "Offscreen shots reload",IDC_RELOAD,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,83,86,10,0,HIDC_RELOAD
+ CONTROL "Dual lightguns",IDC_DUAL_LIGHTGUN,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,96,86,10,0,
+ HIDC_DUAL_LIGHTGUN
+ CONTROL "Multiple keyboards",IDC_MULTIKEYBOARD,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,109,75,10,0,
+ HIDC_MULTIKEYBOARD
+ CONTROL "Multiple mice",IDC_MULTIMOUSE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,122,56,10,0,HIDC_MULTIMOUSE
+ GROUPBOX "Joystick saturation",IDC_JSATTEXT,10,106,91,28
+ CONTROL "IntensitySlider",IDC_JSAT,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,16,118,60,10,0,HIDC_JSAT
+ RTEXT "0.85",IDC_JSATDISP,76,116,16,11,SS_CENTERIMAGE | NOT
+ WS_GROUP
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
+ 0,0,HIDC_USE_DEFAULT
+ GROUPBOX "Joystickmap",IDC_STATIC,4,143,211,50
+ EDITTEXT IDC_JOYSTICKMAP,12,153,200,14,ES_AUTOHSCROLL |
+ WS_DISABLED
+ PUSHBUTTON "Select Joystickmap",IDC_SELECT_JOYSTICKMAP,12,172,67,14,
+ 0,0,HIDC_SELECT_JOYSTICKMAP
+ PUSHBUTTON "Reset Joystickmap",IDC_RESET_JOYSTICKMAP,147,172,65,14,
+ 0,0,HIDC_RESET_JOYSTICKMAP
+END
+
+IDD_PROP_MISC DIALOGEX 0, 0, 220, 240
+STYLE DS_FIXEDSYS | WS_CHILD | WS_CAPTION
+CAPTION "Miscellaneous"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_MAMEUI_ICON,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+ CONTROL "Enable cheats",IDC_CHEAT,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,10,40,86,10,0,HIDC_CHEAT
+ CONTROL "Sleep when possible",IDC_SLEEP,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,10,52,86,10,0,HIDC_SLEEP
+ CONTROL "Skip game info",IDC_SKIP_GAME_INFO,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,64,96,10,0,
+ HIDC_SKIP_GAME_INFO
+ CONTROL "Save game state on exit",IDC_ENABLE_AUTOSAVE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,76,96,10,0,
+ HIDC_ENABLE_AUTOSAVE
+ CONTROL "Coin lockout",IDC_COINLOCKOUT,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,10,100,96,10,0,HIDC_COINLOCKOUT
+ GROUPBOX "Thread Priority",IDC_HIGH_PRIORITY_TEXT,7,112,103,34
+ CONTROL "Slider1",IDC_HIGH_PRIORITY,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,13,122,75,10,0,
+ HIDC_HIGH_PRIORITY
+ LTEXT "idle",IDC_STATIC,17,132,12,8
+ RTEXT "-15",IDC_HIGH_PRIORITYTXT,87,122,14,10,SS_CENTERIMAGE
+ RTEXT "real-time",IDC_STATIC,57,134,28,8
+ GROUPBOX "Snapshot view",IDC_STATIC,7,148,103,28
+ COMBOBOX IDC_SNAPVIEW,13,158,90,60,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_SNAPVIEW
+ GROUPBOX "Artwork options",IDC_STATIC,113,40,102,85
+ CONTROL "Backdrops",IDC_BACKDROPS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,50,86,10,0,HIDC_BACKDROPS
+ CONTROL "Bezels",IDC_BEZELS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,62,86,10,0,HIDC_BEZELS
+ CONTROL "Overlays",IDC_OVERLAYS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,74,84,10,0,HIDC_OVERLAYS
+ CONTROL "CPanels",IDC_CPANELS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,86,84,10,0
+ CONTROL "Marquees",IDC_MARQUEES,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,98,84,10,0
+ CONTROL "Crop artwork",IDC_ARTWORK_CROP,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,119,110,53,10,0,HIDC_ARTWORK_CROP
+ GROUPBOX "BIOS",IDC_STATIC,113,128,102,28
+ COMBOBOX IDC_BIOS,119,138,90,60,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_BIOS
+ GROUPBOX "",IDC_STATIC,7,178,208,28
+ CONTROL "Autoselect snapshot size",IDC_SNAPSIZE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,178,95,10,0,
+ HIDC_SNAPSIZE
+ LTEXT "Snapshotsize",IDC_SNAPSIZETEXT,11,189,44,11,
+ SS_CENTERIMAGE | NOT WS_GROUP
+ EDITTEXT IDC_SNAPSIZEWIDTH,122,187,32,12,ES_RIGHT |
+ ES_AUTOHSCROLL | ES_NUMBER,0,HIDC_SNAPSIZEWIDTH
+ EDITTEXT IDC_SNAPSIZEHEIGHT,172,187,32,12,ES_RIGHT |
+ ES_AUTOHSCROLL | ES_NUMBER,0,HIDC_SNAPSIZEHEIGHT
+ LTEXT "x",IDC_SNAPSIZEX,162,189,8,8
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
+ 0,0,HIDC_USE_DEFAULT
+ CONTROL "Show Menu",IDC_SHOW_MENU,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,160,86,10,0
+END
+
+IDD_PROP_VECTOR DIALOGEX 0, 0, 220, 240
+STYLE WS_CHILD | WS_CAPTION
+CAPTION "Vector"
+FONT 8, "Tahoma"
+BEGIN
+ ICON IDI_MAMEUI_ICON,IDC_STATIC,20,10,20,20
+ LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25,
+ SS_NOPREFIX
+// CONTROL "Draw antialiased vectors",IDC_ANTIALIAS,"Button",
+// BS_AUTOCHECKBOX | WS_TABSTOP,10,40,92,10,0,
+// HIDC_ANTIALIAS
+ GROUPBOX "Beam width",IDC_BEAMTEXT,60,53,100,28
+ CONTROL "BeamSlider",IDC_BEAM,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,66,65,64,10,0,HIDC_BEAM
+ RTEXT "16.00",IDC_BEAMDISP,132,64,20,11,SS_CENTERIMAGE
+ GROUPBOX "Flicker",IDC_FLICKERTEXT,60,84,100,28
+ CONTROL "FlickerSlider",IDC_FLICKER,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,66,96,64,10,0,HIDC_FLICKER
+ RTEXT "100.00",IDC_FLICKERDISP,128,95,24,11,SS_CENTERIMAGE |
+ NOT WS_GROUP
+ PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET
+ PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14,
+ 0,0,HIDC_USE_DEFAULT
+END
+
+IDD_MAIN DIALOGEX 0, 0, 364, 206
+STYLE DS_3DLOOK | DS_NOFAILCREATE | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | DS_SETFONT
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "MAMEUI - overwritten at runtime"
+CLASS "MainClass"
+FONT 8, "Verdana"
+BEGIN
+ CONTROL "",IDC_DIVIDER,"Static",SS_ETCHEDHORZ,0,5,304,1
+ CONTROL "Tree1",IDC_TREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS |
+ TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,5,28,48,172
+ CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE |
+ LVS_SHAREIMAGELISTS | LVS_OWNERDRAWFIXED | WS_BORDER | WS_TABSTOP,65,28,42,172
+ GROUPBOX "",IDC_SPLITTER,55,28,8,172,BS_NOTIFY | NOT WS_VISIBLE
+ GROUPBOX "",IDC_SPLITTER2,109,28,8,172,BS_NOTIFY | NOT WS_VISIBLE
+ CONTROL "",IDC_SSFRAME,"Static",SS_ETCHEDFRAME | SS_NOTIFY,121,11,181,194
+ CONTROL "",IDC_SSTAB,"SysTabControl32",TCS_HOTTRACK,121,0,181,18
+ CONTROL "",IDC_SSPICTURE,"Static",SS_BITMAP | NOT WS_VISIBLE,141,18,141,127
+ EDITTEXT IDC_HISTORY,129,150,167,49,ES_MULTILINE | ES_READONLY | NOT WS_BORDER | WS_VSCROLL | NOT WS_TABSTOP,0,HIDC_HISTORY
+END
+
+IDD_FILTERS DIALOGEX 0, 0, 190, 196
+STYLE DS_MODALFRAME | DS_CENTER | DS_3DLOOK | WS_POPUP | WS_CAPTION |
+ WS_SYSMENU
+EXSTYLE WS_EX_CONTEXTHELP
+CAPTION "Game Filters"
+FONT 8, "Tahoma"
+BEGIN
+ GROUPBOX "Game filters",IDC_STATIC,6,4,178,99
+ CONTROL "&Vector Graphics",IDC_FILTER_VECTOR,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,16,70,10,0,
+ HIDC_FILTER_VECTOR
+ CONTROL "C&lones",IDC_FILTER_CLONES,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,14,30,41,10,0,HIDC_FILTER_CLONES
+ CONTROL "Non-Wor&king",IDC_FILTER_NONWORKING,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,44,61,10,0,
+ HIDC_FILTER_NONWORKING
+ CONTROL "&Horizontal",IDC_FILTER_HORIZONTAL,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,58,57,10,0,
+ HIDC_FILTER_HORIZONTAL
+ CONTROL "&Unavailable",IDC_FILTER_UNAVAILABLE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,72,57,10,0,
+ HIDC_FILTER_UNAVAILABLE
+ CONTROL "Arcade",IDC_FILTER_ARCADE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,86,57,10,0
+ CONTROL "&Raster Graphics",IDC_FILTER_RASTER,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,100,16,70,10,0,
+ HIDC_FILTER_RASTER
+ CONTROL "Ori&ginals",IDC_FILTER_ORIGINALS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,100,30,47,10,0,
+ HIDC_FILTER_ORIGINALS
+ CONTROL "&Working",IDC_FILTER_WORKING,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,100,44,47,10,0,HIDC_FILTER_WORKING
+ CONTROL "&Vertical",IDC_FILTER_VERTICAL,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,100,58,47,10,0,HIDC_FILTER_VERTICAL
+ CONTROL "&Mechanical",IDC_FILTER_MECHANICAL,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,100,72,58,10,0,HIDC_FILTER_MECHANICAL
+ CONTROL "MESS",IDC_FILTER_MESS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,100,86,58,10,0,HIDC_FILTER_MECHANICAL
+ LTEXT "(*) = inherited from parent folder",IDC_INHERITED,14,72,
+ 99,10
+ CTEXT "Game filters allow customizing the games that are displayed in each folder by hiding games that match the filters applied.",
+ IDC_STATIC,6,108,178,27
+ GROUPBOX "&Description filter",IDC_STATIC,6,136,178,33
+ EDITTEXT IDC_FILTER_EDIT,14,148,162,13,ES_AUTOHSCROLL,0,
+ HIDC_FILTER_EDIT
+ DEFPUSHBUTTON "&OK",IDOK,42,175,50,14
+ PUSHBUTTON "&Cancel",IDCANCEL,98,175,50,14
+END
+
+IDD_RESET DIALOGEX 0, 0, 190, 122
+STYLE DS_MODALFRAME | DS_CENTER | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTEXTHELP
+CAPTION "Reset Options"
+FONT 8, "Tahoma"
+BEGIN
+ GROUPBOX "Categories",IDC_STATIC,6,4,178,70
+ CONTROL "&User Interface (Fonts, Colors, Sizes)",IDC_RESET_UI,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,146,10,0,
+ HIDC_RESET_UI
+ CONTROL "&Default game options",IDC_RESET_DEFAULT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,30,146,10,0,
+ HIDC_RESET_DEFAULT
+ CONTROL "&All games to use default options",IDC_RESET_GAMES,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,146,10,0,
+ HIDC_RESET_GAMES
+ CONTROL "&Folder 'filters'",IDC_RESET_FILTERS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,58,146,10,0,
+ HIDC_RESET_FILTERS
+ CTEXT "Select the options to be restored to the default settings.",
+ IDC_STATIC,6,79,178,20
+ DEFPUSHBUTTON "&OK",IDOK,42,101,50,14
+ PUSHBUTTON "&Cancel",IDCANCEL,98,101,50,14
+END
+
+
+IDD_INTERFACE_OPTIONS DIALOGEX 0, 0, 378, 225
+STYLE DS_MODALFRAME | DS_CENTER | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTEXTHELP
+CAPTION "Interface Options"
+FONT 8, "Tahoma"
+BEGIN
+ GROUPBOX "Game Selection",IDC_STATIC,6,4,189,194
+ CONTROL "&Search for new games on start",IDC_START_GAME_CHECK,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,111,10,0,
+ HIDC_START_GAME_CHECK
+ CONTROL "Allow game selection by a &joystick (requires restart)",
+ IDC_JOY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30,
+ 174,10,0,HIDC_JOY_GUI
+ CONTROL "Allow game selection by custom &key sequences",
+ IDC_KEY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,
+ 166,10
+ CONTROL "Hide &mouse cursor (requires restart)",IDC_HIDE_MOUSE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,86,126,10,0,
+ HIDC_HIDE_MOUSE
+ CONTROL "Inheritable Filters",IDC_FILTER_INHERIT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,14,100,68,10
+ CONTROL "No offset for clones missing parent in view",
+ IDC_NOOFFSET_CLONES,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,14,114,148,10
+ GROUPBOX "Show History on Tab",IDC_STATIC,14,128,173,28
+ COMBOBOX IDC_HISTORY_TAB,57,138,88,50,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Snapshot Pattern",IDC_STATIC,202,4,170,28
+ GROUPBOX "Bookkeeping",IDC_STATIC,202,36,170,43
+ CONTROL "Reset all Playcounts",IDC_RESET_PLAYCOUNT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,210,48,80,10
+ CONTROL "Reset all Play Times",IDC_RESET_PLAYTIME,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,210,62,79,10
+ GROUPBOX "Screenshot Area",IDC_STATIC,202,83,170,115
+ CONTROL "S&tretch screenshot larger than natural size",
+ IDC_STRETCH_SCREENSHOT_LARGER,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,210,95,148,10,0,
+ HIDC_STRETCH_SCREENSHOT_LARGER
+ GROUPBOX "Screenshot Cycletime in Seconds",IDC_STATIC,210,109,154,
+ 28
+ CONTROL "Slider1",IDC_CYCLETIMESEC,"msctls_trackbar32",TBS_BOTH |
+ TBS_NOTICKS | WS_TABSTOP,218,121,120,10,0,
+ HIDC_CYCLETIMESEC
+ RTEXT "60",IDC_CYCLETIMESECTXT,340,120,13,10,SS_CENTERIMAGE
+ GROUPBOX "Screenshot Bordersize",IDC_STATIC,210,141,154,28
+ CONTROL "Slider1",IDC_SCREENSHOT_BORDERSIZE,"msctls_trackbar32",
+ TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,218,153,120,10
+ RTEXT "100",IDC_SCREENSHOT_BORDERSIZETXT,340,152,13,10,
+ SS_CENTERIMAGE
+ PUSHBUTTON "Set Screenshot Border Color",IDC_SCREENSHOT_BORDERCOLOR,
+ 210,176,154,14
+ DEFPUSHBUTTON "&OK",IDOK,136,204,50,14
+ PUSHBUTTON "&Cancel",IDCANCEL,192,204,50,14
+ COMBOBOX IDC_SNAPNAME,209,14,155,60,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP,0,HIDC_SNAPNAME
+END
+
+IDD_CUSTOM_FILE DIALOG DISCARDABLE 0, 0, 190, 135
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Add Game To Custom Folder"
+FONT 8, "Tahoma"
+BEGIN
+ LTEXT "",IDC_CUSTOMFILE_GAME,6,6,175,10,SS_NOPREFIX |
+ SS_CENTERIMAGE
+ CONTROL "CustomTree",IDC_CUSTOM_TREE,"SysTreeView32",
+ TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT |
+ TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS |
+ TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,6,18,178,90
+ DEFPUSHBUTTON "OK",IDOK,42,114,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,98,114,50,14
+END
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDA_TAB_KEYS ACCELERATORS MOVEABLE PURE
+BEGIN
+ "1", ID_VIEW_TAB_SCREENSHOT, VIRTKEY, ALT, NOINVERT
+ "2", ID_VIEW_TAB_FLYER, VIRTKEY, ALT, NOINVERT
+ "3", ID_VIEW_TAB_CABINET, VIRTKEY, ALT, NOINVERT
+ "4", ID_VIEW_TAB_MARQUEE, VIRTKEY, ALT, NOINVERT
+ "5", ID_VIEW_TAB_TITLE, VIRTKEY, ALT, NOINVERT
+ "6", ID_VIEW_TAB_CONTROL_PANEL, VIRTKEY, ALT, NOINVERT
+ "7", ID_VIEW_TAB_PCB, VIRTKEY, ALT, NOINVERT
+ "8", ID_VIEW_TAB_HISTORY, VIRTKEY, ALT, NOINVERT
+ "A", ID_GAME_AUDIT, VIRTKEY, ALT, NOINVERT
+ "B", ID_VIEW_PAGETAB, VIRTKEY, ALT, NOINVERT
+ "D", ID_VIEW_FOLDERS, VIRTKEY, ALT, NOINVERT
+ "E", ID_TOOLBAR_EDIT, VIRTKEY, CONTROL, NOINVERT
+ "F", ID_CONTEXT_FILTERS, VIRTKEY, CONTROL, NOINVERT
+ "U", ID_FOLDER_AUDIT, VIRTKEY, ALT, NOINVERT
+ "P", ID_VIEW_PICTURE_AREA, VIRTKEY, ALT, NOINVERT
+ "R", ID_CONTEXT_SELECT_RANDOM, VIRTKEY, CONTROL, NOINVERT
+ "S", ID_VIEW_STATUS, VIRTKEY, ALT, NOINVERT
+ "T", ID_VIEW_TOOLBARS, VIRTKEY, ALT, NOINVERT
+ VK_F1, ID_HELP_CONTENTS, VIRTKEY, NOINVERT
+ VK_F11, ID_VIEW_FULLSCREEN, VIRTKEY, NOINVERT
+ VK_F5, ID_UPDATE_GAMELIST, VIRTKEY, NOINVERT
+ VK_NEXT, ID_UI_HISTORY_DOWN, VIRTKEY, CONTROL, NOINVERT
+ VK_PRIOR, ID_UI_HISTORY_UP, VIRTKEY, CONTROL, NOINVERT
+ VK_RETURN, ID_GAME_PROPERTIES, VIRTKEY, ALT, NOINVERT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO MOVEABLE PURE
+BEGIN
+ IDD_ABOUT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 289
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 123
+ END
+
+ IDD_DIRECTX, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 229
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 62
+ END
+
+ IDD_AUDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 280
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 187
+ HORZGUIDE, 19
+ END
+
+ IDD_DIRECTORIES, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 224
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 98
+ END
+
+ IDD_COLUMNS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 301
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 143
+ END
+
+ IDD_PROP_CONTROLLER, DIALOG
+ BEGIN
+ RIGHTMARGIN, 210
+ BOTTOMMARGIN, 154
+ END
+
+ IDD_PROP_SCREEN, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ VERTGUIDE, 7
+ VERTGUIDE, 123
+ BOTTOMMARGIN, 199
+ HORZGUIDE, 179
+ END
+
+ IDD_PROP_GAME, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 19
+ VERTGUIDE, 66
+ VERTGUIDE, 74
+ VERTGUIDE, 201
+ BOTTOMMARGIN, 268
+ END
+
+ IDD_PROP_AUDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 12
+ VERTGUIDE, 208
+ BOTTOMMARGIN, 198
+ HORZGUIDE, 38
+ END
+
+ IDD_PROP_DISPLAY, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ VERTGUIDE, 7
+ VERTGUIDE, 123
+ HORZGUIDE, 179
+ END
+
+ IDD_PROP_SOUND, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 50
+ BOTTOMMARGIN, 198
+ END
+
+ IDD_PROP_ADVANCED, DIALOG
+ BEGIN
+ LEFTMARGIN, 10
+ BOTTOMMARGIN, 240
+ END
+
+ IDD_PROP_INPUT, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 215
+ VERTGUIDE, 50
+ VERTGUIDE, 170
+ END
+
+ IDD_PROP_MISC, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 25
+ VERTGUIDE, 40
+ VERTGUIDE, 104
+ VERTGUIDE, 114
+ VERTGUIDE, 204
+ BOTTOMMARGIN, 236
+ END
+
+ IDD_PROP_VECTOR, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ VERTGUIDE, 50
+ BOTTOMMARGIN, 198
+ END
+
+ IDD_FILTERS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 178
+ END
+
+ IDD_RESET, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 175
+ VERTGUIDE, 18
+ VERTGUIDE, 164
+ TOPMARGIN, 7
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+
+
+
+IDB_ABOUT BITMAP "res\\about.bmp"
+IDB_TOOLBAR BITMAP "res\\toolbar.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Cursor
+//
+
+IDC_CURSOR_HSPLIT CURSOR "res\\splith.cur"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// RT_MANIFEST
+//
+
+1 RT_MANIFEST "res\\mameui.manifest"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_UI_FILE "Contains commands for working with the selected items"
+ IDS_UI_VIEW "Contains commands for manipulating the view"
+ IDS_UI_OPTIONS "Contains commands for user interface options"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_UI_HELP "Contains commands for displaying help"
+ IDS_VIEW_TOOLBAR "Show or hide the toolbar"
+ IDS_VIEW_STATUSBAR "Show or hide the status bar"
+ IDS_VIEW_FOLDERLIST "Show or hide the folder list"
+ IDS_VIEW_SCREENSHOT "Show or hide the screen shot"
+ IDS_VIEW_PICTURETABS "Show or hide tabs in the picture area"
+ IDS_VIEW_SPACER1 "Spacer"
+ IDS_VIEW_FULLSCREEN "Toggle full screen mode"
+ IDS_VIEW_SPACER2 "Spacer"
+ IDS_VIEW_SHOWPICTURES "Contains commands to select tabs shown in the picture area"
+ IDS_VIEW_SPACER3 "Spacer"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_VIEW_LARGEICONS "Display items by using large icons."
+ IDS_VIEW_SMALLICONS "Display items by using small icons."
+ IDS_VIEW_LIST "Displays items in a list."
+ IDS_VIEW_DETAILS "Displays detailed information about each item in the window."
+ IDS_VIEW_GROUPED "Displays items grouped by parent game"
+ IDS_VIEW_SPACER4 "Spacer"
+ IDS_VIEW_ARRANGE "Contains commands for sorting by various columns"
+ IDS_VIEW_LINEUPICONS "Arranges icons in a grid"
+ IDS_VIEW_SPACER5 "Spacer"
+ IDS_VIEW_REFRESH "Refresh game list"
+ IDS_VIEW_CONTEXTFILTERS "Allows filtering out games from a folder"
+ IDS_VIEW_CUSTOMIZEFIELDS
+ "Customize which columns are used in the game list"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_FILE_EXIT "Exit the application"
+ ID_FILE_PLAY "Play currently selected game"
+ ID_HELP_ABOUT "Displays program and copyright information"
+ ID_VIEW_LARGE_ICON "Display items by using large icons."
+ ID_VIEW_SMALL_ICON "Display items by using small icons."
+ ID_VIEW_LIST_MENU "Displays items in a list."
+ ID_VIEW_DETAIL "Displays detailed information about each item in the window."
+ ID_VIEW_GROUPED "Show items grouped by parent game"
+ ID_OPTIONS_FONT "Set game list and folder list font"
+ ID_OPTIONS_CLONE_COLOR "Set the clone font color"
+ ID_OPTIONS_DIR "Set directory configuration"
+ ID_OPTIONS_DEFAULTS "Set default game options"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_OPTIONS_RESET_DEFAULTS "Allow restoring options to 'sane' values."
+ ID_OPTIONS_INTERFACE "Customize interface options."
+ ID_FILE_AUDIT "Audit ROM and samples sets"
+ ID_FILE_PLAY_RECORD "Record a game for later playback"
+ ID_FILE_PLAY_BACK "Playback a recorded game"
+ ID_FILE_PLAY_RECORD_WAVE "Record the audio output of a game"
+ ID_FILE_PLAY_RECORD_MNG "Record the video output of a game"
+ ID_FILE_PLAY_RECORD_AVI "Record the complete output of a game"
+ ID_VIEW_PICTURE_AREA "Show or hide the picture area"
+ ID_HELP_CONTENTS "Display help contents"
+ ID_HELP_WHATS_NEWUI "New game changes"
+ ID_HELP_TROUBLE "Troubleshooting Documentation"
+ ID_HELP_RELEASE "MAME release notes"
+ ID_HELP_WHATS_NEW "What's new in MAME"
+ ID_HELP_CHEATS "How cheats work"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_CONTEXT_RESET_PLAYTIME "Reset time played for selected item"
+ ID_CONTEXT_RESET_PLAYCOUNT "Reset number of plays for selected item"
+ ID_FOLDER_PROPERTIES "Display folder properties"
+ ID_FOLDER_AUDIT "Audit items in this folder"
+ ID_FILE_LOADSTATE "Play a game starting with the given savestate"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_VIEW_TAB_CABINET "Select Cabinet tab"
+ ID_VIEW_TAB_MARQUEE "Select Marquee tab"
+ ID_VIEW_TAB_TITLE "Select Title tab"
+ ID_VIEW_TAB_CONTROL_PANEL "Select Control panel tab"
+ ID_VIEW_TAB_PCB "Select PCB tab"
+ ID_VIEW_TAB_HISTORY "Select History tab"
+ ID_OPTIONS_BG "Set the background image"
+ ID_TOGGLE_TAB_SCREENSHOT "Enable the screenshot tab"
+ ID_TOGGLE_TAB_FLYER "Enable the flyer tab"
+ ID_TOGGLE_TAB_CABINET "Enable the cabinet tab"
+ ID_TOGGLE_TAB_MARQUEE "Enable the marquee tab"
+ ID_TOGGLE_TAB_TITLE "Enable the title tab"
+ ID_TOGGLE_TAB_CONTROL_PANEL "Enable the control panel tab"
+ ID_TOGGLE_TAB_PCB "Enable the PCB tab"
+ ID_TOGGLE_TAB_HISTORY "Enable the history tab"
+ ID_VIEW_FULLSCREEN "Toggle Fullscreen mode"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_CUSTOMIZE_FIELDS "Customize which columns are used in the game list"
+ ID_GAME_PROPERTIES "Display the properties of the selected item"
+ ID_VIEW_PAGETAB "Show or hide the tabs in the picture area"
+ ID_VIEW_FOLDERS "Show or hide the folder list"
+ ID_VIEW_TOOLBARS "Show or hide the toolbar"
+ ID_VIEW_STATUS "Show or hide the status bar"
+ ID_CONTEXT_FILTERS "Allows filtering out games from a folder"
+ ID_CONTEXT_RENAME_CUSTOM "Rename this folder"
+ ID_CONTEXT_ADD_CUSTOM "Add selected item to custom folder"
+ ID_CONTEXT_REMOVE_CUSTOM "Remove selected item from this folder"
+ ID_GAME_AUDIT "Audit the selected item"
+ ID_CONTEXT_SELECT_RANDOM "Randomly select a game."
+ ID_VIEW_TAB_SCREENSHOT "Select Snapshot tab"
+ ID_VIEW_TAB_FLYER "Select Flyer tab"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_VIEW_BYGAME "Sort items by game description"
+ ID_VIEW_BYDIRECTORY "Sort items by name"
+ ID_VIEW_BYMANUFACTURER "Sort items by manufacturer"
+ ID_VIEW_BYYEAR "Sort items by year"
+ ID_VIEW_BYTYPE "Sort items by type"
+ ID_VIEW_BYTIMESPLAYED "Sort by number of plays"
+ ID_VIEW_LINEUPICONS "Arranges icons in a grid"
+ ID_UPDATE_GAMELIST "Refresh game list"
+ ID_SORT_ASCENDING "Sort column in ascending (A-Z) order"
+ ID_SORT_DESCENDING "Sort column in descending (Z-A) order"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_FOLDER_SOURCEPROPERTIES
+ "Display properties for all games in this source file"
+ ID_FOLDER_VECTORPROPERTIES "Display properties for all vector based games"
+ ID_OPTIONS_HISTORY "Set the History file to use"
+ ID_OPTIONS_MAMEINFO "Set the Mameinfo file to use"
+END
+
+#endif // English (USA) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#include "mamevers.rc" // Version block
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/docs/release/src/osd/winui/mkhelp.cpp b/docs/release/src/osd/winui/mkhelp.cpp
new file mode 100644
index 00000000000..115ded9ef8d
--- /dev/null
+++ b/docs/release/src/osd/winui/mkhelp.cpp
@@ -0,0 +1,152 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+/***************************************************************************
+
+ mkhelp.c
+
+ Simple resource HIDC to Help entry tool.
+
+ MSH - 20070815
+
+***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "osdcore.h"
+
+
+static int compare( const void *arg1, const void *arg2 );
+static void extract_help_ids(const char *buffer, FILE *fp);
+
+/*-------------------------------------------------
+ main - primary entry point
+-------------------------------------------------*/
+
+int main(int argc, char *argv[])
+{
+ const char *resourcefile, *varname, *type;
+ FILE *src, *dst;
+ char *buffer;
+ int bytes = 0;
+
+ varname = "dwHelpIDs";
+ type = "DWORD";
+
+ /* needs at least three arguments */
+ if (argc < 1)
+ {
+ fprintf(stderr,
+ "Usage:\n"
+ " mkhelp <resource.rc>\n"
+ "\n"
+ "The default <type> is DWORD, with an assumed NULL terminator pair\n"
+ );
+ return 0;
+ }
+
+ /* extract arguments */
+ resourcefile = argv[1];
+
+ /* open source file */
+ src = fopen(resourcefile, "rb");
+ if (src == NULL)
+ {
+ fprintf(stderr, "Unable to open resource file '%s'\n", resourcefile);
+ return 1;
+ }
+
+ /* determine file size */
+ fseek(src, 0, SEEK_END);
+ bytes = ftell(src);
+ fseek(src, 0, SEEK_SET);
+
+ /* allocate memory */
+ buffer = (char*)malloc(bytes + 1);
+ if (buffer == NULL)
+ {
+ fclose(src);
+ fprintf(stderr, "Out of memory allocating %d byte buffer\n", bytes);
+ return 1;
+ }
+
+ /* read the source file */
+ fread(buffer, 1, bytes, src);
+ buffer[bytes] = 0;
+ fclose(src);
+
+ /* open dest file */
+ dst = stdout;
+
+ fprintf(dst,"/*\n * Help ID array - Generated by mkhelp\n */\n\n");
+ fprintf(dst, "#include <windows.h>\n#include \"resource.h\"\n#include \"resource.hm\"\n\n");
+ /* write the initial header */
+ fprintf(dst, "extern const %s %s[] =\n{\n", type, varname);
+
+ extract_help_ids(buffer, dst);
+
+ fprintf(dst, "\n};\n");
+
+ /* close the files */
+ free(buffer);
+ return 0;
+}
+
+static int compare( const void *arg1, const void *arg2 )
+{
+ /* Compare all of both strings: */
+ return _stricmp( * ( char** ) arg1, * ( char** ) arg2 );
+}
+
+static void extract_help_ids(const char *buffer, FILE *fp)
+{
+ const char *ptr = buffer;
+ char **help_ids = (char **)malloc(500 * sizeof(char *));
+ int num_help_id = 0;
+ int i;
+
+ //memset(help_ids, '\0', sizeof(*help_ids));
+ memset(help_ids, 0, 500);
+
+ while(*ptr) {
+ if (strncmp("HIDC_", ptr, 5) == 0) {
+ char id_name[128];
+ char *end = id_name;
+ char *id;
+ memset(id_name, '\0', sizeof(id_name));
+ while (*ptr && *ptr != '\x0d' && *ptr != '\x0a' ) {
+ *end++ = *ptr++;
+ }
+ id = (char *)malloc(strlen(id_name));
+ memset(id, '\0', strlen(id_name));
+ memcpy(id, &id_name[1], strlen(&id_name[1]));
+ help_ids[num_help_id] = id;
+ num_help_id++;
+ } else {
+ ptr++;
+ }
+ }
+
+ /* Sort using Quicksort algorithm: */
+ qsort( (void *)help_ids, (size_t)num_help_id, sizeof( char * ), compare );
+
+ // Now print them out.
+ ptr = help_ids[0];
+ for (i = 0; i < num_help_id; i++) {
+ if (i > 0) {
+ if (strcmp(ptr, help_ids[i]) == 0) {
+ continue;
+ }
+ }
+ fprintf(fp, "\t%-30s,H%s,\n", help_ids[i], help_ids[i]);
+ ptr = help_ids[i];
+ }
+ fprintf(fp, "\t%-30i,%i\n", 0, 0);
+
+ // free our allocations.
+ for (i = 0; i < num_help_id; i++) {
+ free(help_ids[i]);
+ }
+ free (help_ids);
+}
+
diff --git a/docs/release/src/osd/winui/mui_audit.cpp b/docs/release/src/osd/winui/mui_audit.cpp
new file mode 100644
index 00000000000..c29368c0f64
--- /dev/null
+++ b/docs/release/src/osd/winui/mui_audit.cpp
@@ -0,0 +1,482 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+ /***************************************************************************
+
+ mui_audit.c
+
+ Audit dialog
+
+***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+
+// standard C headers
+#include <tchar.h>
+
+// MAME/MAMEUI headers
+#include "winui.h"
+#include "winutf8.h"
+#include "audit.h"
+#include "resource.h"
+#include "mui_opts.h"
+#include "mui_util.h"
+#include "properties.h"
+#include <richedit.h>
+
+
+#ifdef _MSC_VER
+#define vsnprintf _vsnprintf
+#endif
+
+/***************************************************************************
+ function prototypes
+ ***************************************************************************/
+
+static DWORD WINAPI AuditThreadProc(LPVOID hDlg);
+static INT_PTR CALLBACK AuditWindowProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+static void ProcessNextRom(void);
+static void ProcessNextSample(void);
+static void CLIB_DECL DetailsPrintf(const char *fmt, ...) ATTR_PRINTF(1,2);
+static const char * StatusString(int iStatus);
+
+/***************************************************************************
+ Internal variables
+ ***************************************************************************/
+
+#define MAX_AUDITBOX_TEXT 0x7FFFFFFE
+
+static volatile HWND hAudit;
+static volatile int rom_index = 0;
+static volatile int roms_correct = 0;
+static volatile int roms_incorrect = 0;
+static volatile int sample_index = 0;
+static volatile int samples_correct = 0;
+static volatile int samples_incorrect = 0;
+static volatile BOOL bPaused = FALSE;
+static volatile BOOL bCancel = FALSE;
+static int m_choice = 0;
+
+/***************************************************************************
+ External functions
+ ***************************************************************************/
+
+static int strcatprintf(std::string &str, const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ int retVal = strcatvprintf(str, format, ap);
+ va_end(ap);
+ return retVal;
+}
+
+void AuditDialog(HWND hParent, int choice)
+{
+ rom_index = 0;
+ roms_correct = -1; // ___empty must not be counted
+ roms_incorrect = 0;
+ sample_index = 0;
+ samples_correct = -1; // ___empty must not be counted
+ samples_incorrect = 0;
+ m_choice = choice;
+
+ //RS use Riched32.dll
+ HMODULE hModule = LoadLibrary(TEXT("Riched32.dll"));
+ if( hModule )
+ {
+ DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_AUDIT),hParent,AuditWindowProc);
+ FreeLibrary( hModule );
+ hModule = NULL;
+ }
+ else
+ MessageBox(GetMainWindow(),TEXT("Unable to Load Riched32.dll"),TEXT("Error"), MB_OK | MB_ICONERROR);
+}
+
+void InitGameAudit(int gameIndex)
+{
+ rom_index = gameIndex;
+}
+
+const char * GetAuditString(int audit_result)
+{
+ switch (audit_result)
+ {
+ case media_auditor::CORRECT :
+ case media_auditor::BEST_AVAILABLE :
+ case media_auditor::NONE_NEEDED :
+ return "Yes";
+
+ case media_auditor::NOTFOUND :
+ case media_auditor::INCORRECT :
+ return "No";
+
+ default:
+ printf("unknown audit value %i\n",audit_result);
+ }
+
+ return "?";
+}
+
+BOOL IsAuditResultKnown(int audit_result)
+{
+ return TRUE;
+}
+
+BOOL IsAuditResultYes(int audit_result)
+{
+ return audit_result == media_auditor::CORRECT
+ || audit_result == media_auditor::BEST_AVAILABLE
+ || audit_result == media_auditor::NONE_NEEDED;
+}
+
+BOOL IsAuditResultNo(int audit_result)
+{
+ return audit_result == media_auditor::NOTFOUND
+ || audit_result == media_auditor::INCORRECT;
+}
+
+
+/***************************************************************************
+ Internal functions
+ ***************************************************************************/
+// Verifies the ROM set while calling SetRomAuditResults
+int MameUIVerifyRomSet(int game, bool choice)
+{
+ driver_enumerator enumerator(MameUIGlobal(), driver_list::driver(game));
+ enumerator.next();
+ media_auditor auditor(enumerator);
+ media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);
+
+ std::string summary_string;
+
+ if (summary == media_auditor::NOTFOUND)
+ {
+ if (m_choice < 2)
+ strcatprintf(summary_string, "%s: Romset NOT FOUND\n", driver_list::driver(game).name);
+ }
+ else
+ if (choice)
+ {
+ auditor.winui_summarize(driver_list::driver(game).name, &summary_string); // audit all games
+ }
+ else
+ {
+ std::ostringstream whatever;
+ auditor.summarize(driver_list::driver(game).name, &whatever); // audit one game
+ summary_string = whatever.str();
+ }
+
+ // output the summary of the audit
+ DetailsPrintf("%s", summary_string.c_str());
+
+ SetRomAuditResults(game, summary);
+ return summary;
+}
+
+// Verifies the Sample set while calling SetSampleAuditResults
+int MameUIVerifySampleSet(int game)
+{
+ driver_enumerator enumerator(MameUIGlobal(), driver_list::driver(game));
+ enumerator.next();
+ media_auditor auditor(enumerator);
+ media_auditor::summary summary = auditor.audit_samples();
+
+ std::string summary_string;
+
+ if (summary == media_auditor::NOTFOUND)
+ strcatprintf(summary_string, "%s: Sampleset NOT FOUND\n", driver_list::driver(game).name);
+ else
+ {
+ std::ostringstream whatever;
+ auditor.summarize(driver_list::driver(game).name, &whatever);
+ summary_string = whatever.str();
+ }
+
+ // output the summary of the audit
+ DetailsPrintf("%s", summary_string.c_str());
+
+ SetSampleAuditResults(game, summary);
+ return summary;
+}
+
+static DWORD WINAPI AuditThreadProc(LPVOID hDlg)
+{
+ char buffer[200];
+
+ while (!bCancel)
+ {
+ if (!bPaused)
+ {
+ if (rom_index != -1)
+ {
+ sprintf(buffer, "Checking Set %s - %s", driver_list::driver(rom_index).name, driver_list::driver(rom_index).type.fullname());
+ win_set_window_text_utf8((HWND)hDlg, buffer);
+ ProcessNextRom();
+ }
+ else
+ if (sample_index != -1)
+ {
+ sprintf(buffer, "Checking Set %s - %s", driver_list::driver(sample_index).name, driver_list::driver(sample_index).type.fullname());
+ win_set_window_text_utf8((HWND)hDlg, buffer);
+ ProcessNextSample();
+ }
+ else
+ {
+ win_set_window_text_utf8((HWND)hDlg, "File Audit");
+ EnableWindow(GetDlgItem((HWND)hDlg, IDPAUSE), FALSE);
+ ExitThread(1);
+ }
+ }
+ }
+ return 0;
+}
+
+static INT_PTR CALLBACK AuditWindowProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ static HANDLE hThread;
+ static DWORD dwThreadID = 0;
+ HWND hEdit;
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ hAudit = hDlg;
+ //RS 20030613 Set Bkg of RichEdit Ctrl
+ hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS);
+ if (hEdit)
+ {
+ SendMessage( hEdit, EM_SETBKGNDCOLOR, FALSE, GetSysColor(COLOR_BTNFACE) );
+ // MSH - Set to max
+ SendMessage( hEdit, EM_SETLIMITTEXT, MAX_AUDITBOX_TEXT, 0 );
+ }
+
+ SendDlgItemMessage(hDlg, IDC_ROMS_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0, driver_list::total()));
+ SendDlgItemMessage(hDlg, IDC_SAMPLES_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0, driver_list::total()));
+ bPaused = false;
+ bCancel = false;
+ rom_index = 0;
+ hThread = CreateThread(NULL, 0, AuditThreadProc, hDlg, 0, &dwThreadID);
+ return 1;
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDCANCEL:
+ bPaused = false;
+ if (hThread)
+ {
+ bCancel = true;
+ DWORD dwExitCode = 0;
+ if (GetExitCodeThread(hThread, &dwExitCode) && (dwExitCode == STILL_ACTIVE))
+ {
+ PostMessage(hDlg, WM_COMMAND, wParam, lParam);
+ return 1;
+ }
+ CloseHandle(hThread);
+ }
+ EndDialog(hDlg,0);
+ m_choice = 0;
+ break;
+
+ case IDPAUSE:
+ if (bPaused)
+ {
+ SendDlgItemMessage(hAudit, IDPAUSE, WM_SETTEXT, 0, (LPARAM)TEXT("Pause"));
+ bPaused = false;
+ }
+ else
+ {
+ SendDlgItemMessage(hAudit, IDPAUSE, WM_SETTEXT, 0, (LPARAM)TEXT("Continue"));
+ bPaused = true;
+ }
+ break;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+/* Callback for the Audit property sheet */
+INT_PTR CALLBACK GameAuditDialogProc(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lParam)
+{
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ FlushFileCaches();
+ hAudit = hDlg;
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_TITLE), GameInfoTitle(OPTIONS_GAME, rom_index));
+ SetTimer(hDlg, 0, 1, NULL);
+ return 1;
+
+ case WM_TIMER:
+ KillTimer(hDlg, 0);
+ {
+ int iStatus;
+ LPCSTR lpStatus;
+
+ iStatus = MameUIVerifyRomSet(rom_index, 0);
+ lpStatus = DriverUsesRoms(rom_index) ? StatusString(iStatus) : "None required";
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_ROMS), lpStatus);
+
+ if (DriverUsesSamples(rom_index))
+ {
+ iStatus = MameUIVerifySampleSet(rom_index);
+ lpStatus = StatusString(iStatus);
+ }
+ else
+ {
+ lpStatus = "None Required";
+ }
+
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_SAMPLES), lpStatus);
+ }
+ ShowWindow(hDlg, SW_SHOW);
+ break;
+ }
+ return 0;
+}
+
+static void ProcessNextRom()
+{
+ int retval = 0;
+ TCHAR buffer[200];
+
+ retval = MameUIVerifyRomSet(rom_index, 1);
+ switch (retval)
+ {
+ case media_auditor::BEST_AVAILABLE: /* correct, incorrect or separate count? */
+ case media_auditor::CORRECT:
+ case media_auditor::NONE_NEEDED:
+ roms_correct++;
+ _stprintf(buffer, TEXT("%i"), roms_correct);
+ SendDlgItemMessage(hAudit, IDC_ROMS_CORRECT, WM_SETTEXT, 0, (LPARAM)buffer);
+ _stprintf(buffer, TEXT("%i"), roms_correct + roms_incorrect);
+ SendDlgItemMessage(hAudit, IDC_ROMS_TOTAL, WM_SETTEXT, 0, (LPARAM)buffer);
+ break;
+
+ case media_auditor::NOTFOUND:
+ case media_auditor::INCORRECT:
+ roms_incorrect++;
+ _stprintf(buffer, TEXT("%i"), roms_incorrect);
+ SendDlgItemMessage(hAudit, IDC_ROMS_INCORRECT, WM_SETTEXT, 0, (LPARAM)buffer);
+ _stprintf(buffer, TEXT("%i"), roms_correct + roms_incorrect);
+ SendDlgItemMessage(hAudit, IDC_ROMS_TOTAL, WM_SETTEXT, 0, (LPARAM)buffer);
+ break;
+ }
+
+ rom_index++;
+ SendDlgItemMessage(hAudit, IDC_ROMS_PROGRESS, PBM_SETPOS, rom_index, 0);
+
+ if (rom_index == driver_list::total())
+ {
+ sample_index = 0;
+ rom_index = -1;
+ }
+}
+
+static void ProcessNextSample()
+{
+ int retval = 0;
+ TCHAR buffer[200];
+
+ retval = MameUIVerifySampleSet(sample_index);
+
+ switch (retval)
+ {
+ case media_auditor::NOTFOUND:
+ case media_auditor::INCORRECT:
+ if (DriverUsesSamples(sample_index))
+ {
+ samples_incorrect++;
+ _stprintf(buffer, TEXT("%i"), samples_incorrect);
+ SendDlgItemMessage(hAudit, IDC_SAMPLES_INCORRECT, WM_SETTEXT, 0, (LPARAM)buffer);
+ _stprintf(buffer, TEXT("%i"), samples_correct + samples_incorrect);
+ SendDlgItemMessage(hAudit, IDC_SAMPLES_TOTAL, WM_SETTEXT, 0, (LPARAM)buffer);
+ break;
+ }
+ default:
+ if ((DriverUsesSamples(sample_index)) || (m_choice == 1))
+ {
+ samples_correct++;
+ _stprintf(buffer, TEXT("%i"), samples_correct);
+ SendDlgItemMessage(hAudit, IDC_SAMPLES_CORRECT, WM_SETTEXT, 0, (LPARAM)buffer);
+ _stprintf(buffer, TEXT("%i"), samples_correct + samples_incorrect);
+ SendDlgItemMessage(hAudit, IDC_SAMPLES_TOTAL, WM_SETTEXT, 0, (LPARAM)buffer);
+ break;
+ }
+ }
+
+ sample_index++;
+ SendDlgItemMessage(hAudit, IDC_SAMPLES_PROGRESS, PBM_SETPOS, sample_index, 0);
+
+ if (sample_index == driver_list::total())
+ {
+ DetailsPrintf("Audit complete.\n");
+ SendDlgItemMessage(hAudit, IDCANCEL, WM_SETTEXT, 0, (LPARAM)TEXT("Close"));
+ sample_index = -1;
+ }
+}
+
+static void CLIB_DECL DetailsPrintf(const char *fmt, ...)
+{
+ //RS 20030613 Different Ids for Property Page and Dialog
+ // so see which one's currently instantiated
+ HWND hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS);
+ if (hEdit == NULL)
+ hEdit = GetDlgItem(hAudit, IDC_AUDIT_DETAILS_PROP);
+
+ if (hEdit == NULL)
+ {
+ // Auditing via F5 - no window to display the results
+ //printf("audit detailsprintf() can't find any audit control\n");
+ return;
+ }
+
+ va_list marker;
+ va_start(marker, fmt);
+ char buffer[8000];
+ vsprintf(buffer, fmt, marker);
+ va_end(marker);
+
+ TCHAR* t_s = ui_wstring_from_utf8(ConvertToWindowsNewlines(buffer));
+ if( !t_s || _tcscmp(TEXT(""), t_s) == 0)
+ return;
+
+ int textLength = Edit_GetTextLength(hEdit);
+ Edit_SetSel(hEdit, textLength, textLength);
+ SendMessage( hEdit, EM_REPLACESEL, false, (WPARAM)(LPCTSTR)win_tstring_strdup(t_s) );
+
+ free(t_s);
+}
+
+static const char * StatusString(int iStatus)
+{
+ static const char *ptr = "Unknown";
+
+ switch (iStatus)
+ {
+ case media_auditor::CORRECT:
+ ptr = "Passed";
+ break;
+
+ case media_auditor::BEST_AVAILABLE:
+ ptr = "Best available";
+ break;
+
+ case media_auditor::NONE_NEEDED:
+ ptr = "None Required";
+ break;
+
+ case media_auditor::NOTFOUND:
+ ptr = "Not found";
+ break;
+
+ case media_auditor::INCORRECT:
+ ptr = "Failed";
+ break;
+ }
+
+ return ptr;
+}
diff --git a/docs/release/src/osd/winui/mui_audit.h b/docs/release/src/osd/winui/mui_audit.h
new file mode 100644
index 00000000000..b95e1684ce1
--- /dev/null
+++ b/docs/release/src/osd/winui/mui_audit.h
@@ -0,0 +1,21 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef MUI_AUDIT_H
+#define MUI_AUDIT_H
+
+void AuditDialog(HWND hParent, int choice);
+
+// For property sheet Game Audit tab
+void InitGameAudit(int gameIndex);
+INT_PTR CALLBACK GameAuditDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+
+int MameUIVerifyRomSet(int game, bool choice);
+int MameUIVerifySampleSet(int game);
+
+const char * GetAuditString(int audit_result);
+BOOL IsAuditResultKnown(int audit_result);
+BOOL IsAuditResultYes(int audit_result);
+BOOL IsAuditResultNo(int audit_result);
+
+#endif
diff --git a/docs/release/src/osd/winui/mui_main.cpp b/docs/release/src/osd/winui/mui_main.cpp
new file mode 100644
index 00000000000..31ba3db2e38
--- /dev/null
+++ b/docs/release/src/osd/winui/mui_main.cpp
@@ -0,0 +1,22 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+#ifndef WINUI
+#define WINUI
+#endif
+
+// import the main() from MAME, but rename it so we can call it indirectly
+#undef main
+#undef wmain
+#define main mame_main
+#define wmain mame_main
+#include "windows/main.cpp"
+#undef main
+#undef wmain
+
+#include "winui.h"
+
+
+int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
+{
+ return MameUIMain(hInstance, lpCmdLine, nCmdShow);
+}
diff --git a/docs/release/src/osd/winui/mui_opts.cpp b/docs/release/src/osd/winui/mui_opts.cpp
new file mode 100644
index 00000000000..de18b2d8630
--- /dev/null
+++ b/docs/release/src/osd/winui/mui_opts.cpp
@@ -0,0 +1,2599 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+ /***************************************************************************
+
+ mui_opts.cpp
+
+ Stores global options and per-game options;
+
+***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+
+// standard C headers
+#include <tchar.h>
+
+// MAME/MAMEUI headers
+#include "emu.h"
+#include "ui/moptions.h"
+#include "ui/info.h"
+#include "drivenum.h"
+#include "winui.h"
+#include "mui_opts.h"
+#include <fstream> // for *_opts.h (below)
+#include "game_opts.h"
+#include "ui_opts.h"
+//#include "ini_opts.h" // not ready yet
+#include "mui_util.h"
+#include "treeview.h"
+#include "splitters.h"
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+/***************************************************************************
+ Internal function prototypes
+ ***************************************************************************/
+
+// static void LoadFolderFilter(int folder_index,int filters);
+
+static void LoadSettingsFile(windows_options &opts, const char *filename);
+static void SaveSettingsFile(windows_options &opts, const char *filename);
+static void LoadSettingsFile(ui_options &opts, const char *filename); // mewui
+
+static string CusColorEncodeString(const COLORREF *value);
+static void CusColorDecodeString(string ss, COLORREF *value);
+
+static string SplitterEncodeString(const int *value);
+static void SplitterDecodeString(string ss, int *value);
+
+static string FontEncodeString(const LOGFONT *f);
+static void FontDecodeString(string ss, LOGFONT *f);
+
+static string TabFlagsEncodeString(int data);
+static void TabFlagsDecodeString(string ss, int *data);
+
+static string ColumnEncodeStringWithCount(const int *value, int count);
+static void ColumnDecodeStringWithCount(string ss, int *value, int count);
+
+static void ResetToDefaults(windows_options &opts, int priority);
+
+
+
+/***************************************************************************
+ Internal defines
+ ***************************************************************************/
+
+#define GAMEINFO_INI_FILENAME MAMENAME "_g.ini"
+#define MEWUI_FILENAME "ini\\ui.ini"
+
+
+
+/***************************************************************************
+ Internal structures
+ ***************************************************************************/
+
+ /***************************************************************************
+ Internal variables
+ ***************************************************************************/
+
+static emu_options mameopts; // core options
+static ui_options mewui; // ui.ini
+static winui_ui_options settings; // mameui.ini
+static windows_options global; // Global 'default' options
+static winui_game_options game_opts; // game stats
+
+
+// Screen shot Page tab control text
+// these must match the order of the options flags in options.h
+// (TAB_...)
+static const char *const image_tabs_long_name[MAX_TAB_TYPES] =
+{
+ "Artwork",
+ "Boss",
+ "Cabinet",
+ "Control Panel",
+ "Cover",
+ "End",
+ "Flyer",
+ "Game Over",
+ "How To",
+ "Logo",
+ "Marquee",
+ "PCB",
+ "Scores",
+ "Select",
+ "Snapshot",
+ "Title",
+ "Versus",
+ "History"
+};
+
+static const char *const image_tabs_short_name[MAX_TAB_TYPES] =
+{
+ "artpreview",
+ "boss",
+ "cabinet",
+ "cpanel",
+ "cover",
+ "end",
+ "flyer",
+ "gameover",
+ "howto",
+ "logo",
+ "marquee",
+ "pcb",
+ "scores",
+ "select",
+ "snap",
+ "title",
+ "versus",
+ "history"
+};
+
+
+/***************************************************************************
+ External functions
+ ***************************************************************************/
+void SetSystemName(windows_options &opts, OPTIONS_TYPE opt_type, int driver_index)
+{
+ if (driver_index >= 0)
+ mameopts.set_system_name(driver_list::driver(driver_index).name);
+}
+
+string GetGameName(uint32_t driver_index)
+{
+ if (driver_index < driver_list::total())
+ return driver_list::driver(driver_index).name;
+ else
+ return "0";
+}
+
+BOOL OptionsInit()
+{
+ // set up global options
+ printf("OptionsInit: About to load %s\n",UI_INI_FILENAME);fflush(stdout);
+ settings.load_file(UI_INI_FILENAME); // parse MAMEUI.ini
+ printf("OptionsInit: About to load %s\n",MEWUI_FILENAME);fflush(stdout);
+ LoadSettingsFile(mewui, MEWUI_FILENAME); // parse UI.INI
+ printf("OptionsInit: About to load %s\n",GAMEINFO_INI_FILENAME);fflush(stdout);
+ game_opts.load_file(GAMEINFO_INI_FILENAME); // parse MAME_g.ini
+ printf("OptionsInit: About to load Global Options\n");fflush(stdout);
+ load_options(global, OPTIONS_GLOBAL, GLOBAL_OPTIONS, 0); // parse MAME.INI
+ printf("OptionsInit: Finished\n");fflush(stdout);
+ return TRUE;
+}
+
+windows_options & MameUIGlobal(void)
+{
+ return global;
+}
+
+// Restore ui settings to factory
+void ResetGUI(void)
+{
+ settings.reset_and_save(UI_INI_FILENAME);
+}
+
+const char * GetImageTabLongName(int tab_index)
+{
+ return image_tabs_long_name[tab_index];
+}
+
+const char * GetImageTabShortName(int tab_index)
+{
+ return image_tabs_short_name[tab_index];
+}
+
+//============================================================
+// OPTIONS WRAPPERS
+//============================================================
+
+static COLORREF options_get_color(const char *name)
+{
+ unsigned int r = 0, g = 0, b = 0;
+ COLORREF value;
+ const string val = settings.getter(name);
+
+ if (sscanf(val.c_str(), "%u,%u,%u", &r, &g, &b) == 3)
+ value = RGB(r,g,b);
+ else
+ value = (COLORREF) - 1;
+ return value;
+}
+
+static void options_set_color(const char *name, COLORREF value)
+{
+ char value_str[32];
+
+ if (value == (COLORREF) -1)
+ snprintf(value_str, ARRAY_LENGTH(value_str), "%d", (int) value);
+ else
+ snprintf(value_str, ARRAY_LENGTH(value_str), "%d,%d,%d", (((int) value) >> 0) & 0xFF, (((int) value) >> 8) & 0xFF, (((int) value) >> 16) & 0xFF);
+
+ settings.setter(name, string(value_str));
+}
+
+static COLORREF options_get_color_default(const char *name, int default_color)
+{
+ COLORREF value = options_get_color(name);
+ if (value == (COLORREF) -1)
+ value = GetSysColor(default_color);
+
+ return value;
+}
+
+static void options_set_color_default(const char *name, COLORREF value, int default_color)
+{
+ if (value == GetSysColor(default_color))
+ options_set_color(name, (COLORREF) -1);
+ else
+ options_set_color(name, value);
+}
+
+static input_seq *options_get_input_seq(const char *name)
+{
+/*
+ static input_seq seq;
+ string val = settings.getter(name);
+ input_seq_from_tokens(NULL, seq_string.c_str(), &seq); // HACK
+ return &seq;*/
+ return NULL;
+}
+
+
+
+//============================================================
+// OPTIONS CALLS
+//============================================================
+
+// ***************************************************************** MAMEUI.INI settings **************************************************************************
+void SetViewMode(int val)
+{
+ settings.setter(MUIOPTION_LIST_MODE, val);
+}
+
+int GetViewMode(void)
+{
+ return settings.int_value(MUIOPTION_LIST_MODE);
+}
+
+void SetGameCheck(BOOL game_check)
+{
+ settings.setter(MUIOPTION_CHECK_GAME, game_check);
+}
+
+BOOL GetGameCheck(void)
+{
+ return settings.bool_value(MUIOPTION_CHECK_GAME);
+}
+
+void SetJoyGUI(BOOL use_joygui)
+{
+ settings.setter(MUIOPTION_JOYSTICK_IN_INTERFACE, use_joygui);
+}
+
+BOOL GetJoyGUI(void)
+{
+ return settings.bool_value( MUIOPTION_JOYSTICK_IN_INTERFACE);
+}
+
+void SetKeyGUI(BOOL use_keygui)
+{
+ settings.setter(MUIOPTION_KEYBOARD_IN_INTERFACE, use_keygui);
+}
+
+BOOL GetKeyGUI(void)
+{
+ return settings.bool_value(MUIOPTION_KEYBOARD_IN_INTERFACE);
+}
+
+void SetCycleScreenshot(int cycle_screenshot)
+{
+ settings.setter(MUIOPTION_CYCLE_SCREENSHOT, cycle_screenshot);
+}
+
+int GetCycleScreenshot(void)
+{
+ return settings.int_value(MUIOPTION_CYCLE_SCREENSHOT);
+}
+
+void SetStretchScreenShotLarger(BOOL stretch)
+{
+ settings.setter(MUIOPTION_STRETCH_SCREENSHOT_LARGER, stretch);
+}
+
+BOOL GetStretchScreenShotLarger(void)
+{
+ return settings.bool_value(MUIOPTION_STRETCH_SCREENSHOT_LARGER);
+}
+
+void SetScreenshotBorderSize(int size)
+{
+ settings.setter(MUIOPTION_SCREENSHOT_BORDER_SIZE, size);
+}
+
+int GetScreenshotBorderSize(void)
+{
+ return settings.int_value(MUIOPTION_SCREENSHOT_BORDER_SIZE);
+}
+
+void SetScreenshotBorderColor(COLORREF uColor)
+{
+ options_set_color_default(MUIOPTION_SCREENSHOT_BORDER_COLOR, uColor, COLOR_3DFACE);
+}
+
+COLORREF GetScreenshotBorderColor(void)
+{
+ return options_get_color_default(MUIOPTION_SCREENSHOT_BORDER_COLOR, COLOR_3DFACE);
+}
+
+void SetFilterInherit(BOOL inherit)
+{
+ settings.setter(MUIOPTION_INHERIT_FILTER, inherit);
+}
+
+BOOL GetFilterInherit(void)
+{
+ return settings.bool_value( MUIOPTION_INHERIT_FILTER);
+}
+
+void SetOffsetClones(BOOL offset)
+{
+ settings.setter(MUIOPTION_OFFSET_CLONES, offset);
+}
+
+BOOL GetOffsetClones(void)
+{
+ return settings.bool_value( MUIOPTION_OFFSET_CLONES);
+}
+
+void SetSavedFolderID(UINT val)
+{
+ settings.setter(MUIOPTION_DEFAULT_FOLDER_ID, (int) val);
+}
+
+UINT GetSavedFolderID(void)
+{
+ return (UINT) settings.int_value(MUIOPTION_DEFAULT_FOLDER_ID);
+}
+
+void SetOverrideRedX(BOOL val)
+{
+ settings.setter(MUIOPTION_OVERRIDE_REDX, val);
+}
+
+BOOL GetOverrideRedX(void)
+{
+ return settings.bool_value(MUIOPTION_OVERRIDE_REDX);
+}
+
+static LPBITS GetShowFolderFlags(LPBITS bits)
+{
+ SetAllBits(bits, TRUE);
+
+ string val = settings.getter(MUIOPTION_HIDE_FOLDERS);
+ if (val.empty())
+ return bits;
+
+ extern const FOLDERDATA g_folderData[];
+ char s[val.size()+1];
+ snprintf(s, val.size()+1, "%s", val.c_str());
+ char *token = strtok(s, ",");
+ int j;
+ while (token)
+ {
+ for (j=0; g_folderData[j].m_lpTitle; j++)
+ {
+ if (strcmp(g_folderData[j].short_name,token) == 0)
+ {
+ ClearBit(bits, g_folderData[j].m_nFolderId);
+ break;
+ }
+ }
+ token = strtok(NULL,",");
+ }
+ return bits;
+}
+
+BOOL GetShowFolder(int folder)
+{
+ LPBITS show_folder_flags = NewBits(MAX_FOLDERS);
+ show_folder_flags = GetShowFolderFlags(show_folder_flags);
+ BOOL result = TestBit(show_folder_flags, folder);
+ DeleteBits(show_folder_flags);
+ return result;
+}
+
+void SetShowFolder(int folder, BOOL show)
+{
+ LPBITS show_folder_flags = NewBits(MAX_FOLDERS);
+ int i = 0, j = 0;
+ int num_saved = 0;
+ string str;
+ extern const FOLDERDATA g_folderData[];
+
+ show_folder_flags = GetShowFolderFlags(show_folder_flags);
+
+ if (show)
+ SetBit(show_folder_flags, folder);
+ else
+ ClearBit(show_folder_flags, folder);
+
+ // we save the ones that are NOT displayed, so we can add new ones
+ // and upgraders will see them
+ for (i=0; i<MAX_FOLDERS; i++)
+ {
+ if (TestBit(show_folder_flags, i) == FALSE)
+ {
+ if (num_saved != 0)
+ str.append(",");
+
+ for (j=0; g_folderData[j].m_lpTitle; j++)
+ {
+ if (g_folderData[j].m_nFolderId == i)
+ {
+ str.append(g_folderData[j].short_name);
+ num_saved++;
+ break;
+ }
+ }
+ }
+ }
+ settings.setter(MUIOPTION_HIDE_FOLDERS, str);
+ DeleteBits(show_folder_flags);
+}
+
+void SetShowStatusBar(BOOL val)
+{
+ settings.setter(MUIOPTION_SHOW_STATUS_BAR, val);
+}
+
+BOOL GetShowStatusBar(void)
+{
+ return settings.bool_value( MUIOPTION_SHOW_STATUS_BAR);
+}
+
+void SetShowTabCtrl (BOOL val)
+{
+ settings.setter(MUIOPTION_SHOW_TABS, val);
+}
+
+BOOL GetShowTabCtrl (void)
+{
+ return settings.bool_value( MUIOPTION_SHOW_TABS);
+}
+
+void SetShowToolBar(BOOL val)
+{
+ settings.setter(MUIOPTION_SHOW_TOOLBAR, val);
+}
+
+BOOL GetShowToolBar(void)
+{
+ return settings.bool_value( MUIOPTION_SHOW_TOOLBAR);
+}
+
+void SetCurrentTab(int val)
+{
+ settings.setter(MUIOPTION_CURRENT_TAB, val);
+}
+
+int GetCurrentTab(void)
+{
+ return settings.int_value(MUIOPTION_CURRENT_TAB);
+}
+
+// Need int here in case no games were in the list at exit
+void SetDefaultGame(uint32_t val)
+{
+ settings.setter(MUIOPTION_DEFAULT_GAME, driver_list::driver(val).name);
+}
+
+uint32_t GetDefaultGame(void)
+{
+ string t = settings.getter(MUIOPTION_DEFAULT_GAME);
+ if (t.empty())
+ return 0;
+ int val = driver_list::find(t.c_str());
+ if (val < 0)
+ val = 0;
+ return val;
+}
+
+void SetWindowArea(const AREA *area)
+{
+ settings.setter(MUIOPTION_WINDOW_X, area->x);
+ settings.setter(MUIOPTION_WINDOW_Y, area->y);
+ settings.setter(MUIOPTION_WINDOW_WIDTH, area->width);
+ settings.setter(MUIOPTION_WINDOW_HEIGHT, area->height);
+}
+
+void GetWindowArea(AREA *area)
+{
+ area->x = settings.int_value(MUIOPTION_WINDOW_X);
+ area->y = settings.int_value(MUIOPTION_WINDOW_Y);
+ area->width = settings.int_value(MUIOPTION_WINDOW_WIDTH);
+ area->height = settings.int_value(MUIOPTION_WINDOW_HEIGHT);
+}
+
+void SetWindowState(UINT state)
+{
+ settings.setter(MUIOPTION_WINDOW_STATE, (int)state);
+}
+
+UINT GetWindowState(void)
+{
+ return settings.int_value(MUIOPTION_WINDOW_STATE);
+}
+
+void SetWindowPanes(int val)
+{
+ settings.setter(MUIOPTION_WINDOW_PANES, val & 15);
+}
+
+UINT GetWindowPanes(void)
+{
+ return settings.int_value(MUIOPTION_WINDOW_PANES) & 15;
+}
+
+void SetCustomColor(int iIndex, COLORREF uColor)
+{
+ if ((iIndex < 0) || (iIndex > 15))
+ return;
+
+ COLORREF custom_color[16];
+ CusColorDecodeString(settings.getter(MUIOPTION_CUSTOM_COLOR), custom_color);
+ custom_color[iIndex] = uColor;
+ settings.setter(MUIOPTION_CUSTOM_COLOR, CusColorEncodeString(custom_color));
+}
+
+COLORREF GetCustomColor(int iIndex)
+{
+ if ((iIndex < 0) || (iIndex > 15))
+ return (COLORREF)RGB(0,0,0);
+
+ COLORREF custom_color[16];
+
+ CusColorDecodeString(settings.getter(MUIOPTION_CUSTOM_COLOR), custom_color);
+
+ if (custom_color[iIndex] == (COLORREF)-1)
+ return (COLORREF)RGB(0,0,0);
+
+ return custom_color[iIndex];
+}
+
+void SetListFont(const LOGFONT *font)
+{
+ settings.setter(MUIOPTION_LIST_FONT, FontEncodeString(font));
+}
+
+void GetListFont(LOGFONT *font)
+{
+ FontDecodeString(settings.getter(MUIOPTION_LIST_FONT), font);
+}
+
+void SetListFontColor(COLORREF uColor)
+{
+ options_set_color_default(MUIOPTION_TEXT_COLOR, uColor, COLOR_WINDOWTEXT);
+}
+
+COLORREF GetListFontColor(void)
+{
+ return options_get_color_default(MUIOPTION_TEXT_COLOR, COLOR_WINDOWTEXT);
+}
+
+void SetListCloneColor(COLORREF uColor)
+{
+ options_set_color_default(MUIOPTION_CLONE_COLOR, uColor, COLOR_WINDOWTEXT);
+}
+
+COLORREF GetListCloneColor(void)
+{
+ return options_get_color_default(MUIOPTION_CLONE_COLOR, COLOR_WINDOWTEXT);
+}
+
+int GetShowTab(int tab)
+{
+ int show_tab_flags = 0;
+ TabFlagsDecodeString(settings.getter(MUIOPTION_HIDE_TABS), &show_tab_flags);
+ return (show_tab_flags & (1 << tab)) != 0;
+}
+
+void SetShowTab(int tab,BOOL show)
+{
+ int show_tab_flags = 0;
+ TabFlagsDecodeString(settings.getter(MUIOPTION_HIDE_TABS), &show_tab_flags);
+
+ if (show)
+ show_tab_flags |= 1 << tab;
+ else
+ show_tab_flags &= ~(1 << tab);
+
+ settings.setter(MUIOPTION_HIDE_TABS, TabFlagsEncodeString(show_tab_flags));
+}
+
+// don't delete the last one
+BOOL AllowedToSetShowTab(int tab,BOOL show)
+{
+ int show_tab_flags = 0;
+
+ if (show == TRUE)
+ return TRUE;
+
+ TabFlagsDecodeString(settings.getter(MUIOPTION_HIDE_TABS), &show_tab_flags);
+
+ show_tab_flags &= ~(1 << tab);
+ return show_tab_flags != 0;
+}
+
+int GetHistoryTab(void)
+{
+ return settings.int_value(MUIOPTION_HISTORY_TAB);
+}
+
+void SetHistoryTab(int tab, BOOL show)
+{
+ if (show)
+ settings.setter(MUIOPTION_HISTORY_TAB, tab);
+ else
+ settings.setter(MUIOPTION_HISTORY_TAB, TAB_NONE);
+}
+
+void SetColumnWidths(int width[])
+{
+ settings.setter(MUIOPTION_COLUMN_WIDTHS, ColumnEncodeStringWithCount(width, COLUMN_MAX));
+}
+
+void GetColumnWidths(int width[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MUIOPTION_COLUMN_WIDTHS), width, COLUMN_MAX);
+}
+
+void SetSplitterPos(int splitterId, int pos)
+{
+ int *splitter;
+
+ if (splitterId < GetSplitterCount())
+ {
+ splitter = (int *) alloca(GetSplitterCount() * sizeof(*splitter));
+ SplitterDecodeString(settings.getter(MUIOPTION_SPLITTERS), splitter);
+ splitter[splitterId] = pos;
+ settings.setter(MUIOPTION_SPLITTERS, SplitterEncodeString(splitter));
+ }
+}
+
+int GetSplitterPos(int splitterId)
+{
+ int *splitter;
+ splitter = (int *) alloca(GetSplitterCount() * sizeof(*splitter));
+ SplitterDecodeString(settings.getter(MUIOPTION_SPLITTERS), splitter);
+
+ if (splitterId < GetSplitterCount())
+ return splitter[splitterId];
+
+ return -1; /* Error */
+}
+
+void SetColumnOrder(int order[])
+{
+ settings.setter(MUIOPTION_COLUMN_ORDER, ColumnEncodeStringWithCount(order, COLUMN_MAX));
+}
+
+void GetColumnOrder(int order[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MUIOPTION_COLUMN_ORDER), order, COLUMN_MAX);
+}
+
+void SetColumnShown(int shown[])
+{
+ settings.setter(MUIOPTION_COLUMN_SHOWN, ColumnEncodeStringWithCount(shown, COLUMN_MAX));
+}
+
+void GetColumnShown(int shown[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MUIOPTION_COLUMN_SHOWN), shown, COLUMN_MAX);
+}
+
+void SetSortColumn(int column)
+{
+ settings.setter(MUIOPTION_SORT_COLUMN, column);
+}
+
+int GetSortColumn(void)
+{
+ return settings.int_value(MUIOPTION_SORT_COLUMN);
+}
+
+void SetSortReverse(BOOL reverse)
+{
+ settings.setter(MUIOPTION_SORT_REVERSED, reverse);
+}
+
+BOOL GetSortReverse(void)
+{
+ return settings.bool_value( MUIOPTION_SORT_REVERSED);
+}
+
+const string GetIconsDir(void)
+{
+ string t = settings.getter(MUIOPTION_ICONS_DIRECTORY);
+ if (t.empty())
+ return "icons";
+ else
+ return settings.getter(MUIOPTION_ICONS_DIRECTORY);
+}
+
+void SetIconsDir(const char* path)
+{
+ settings.setter(MUIOPTION_ICONS_DIRECTORY, path);
+}
+
+const string GetBgDir (void)
+{
+ string t = settings.getter(MUIOPTION_BACKGROUND_DIRECTORY);
+ if (t.empty())
+ return "bkground\\bkground.png";
+ else
+ return settings.getter(MUIOPTION_BACKGROUND_DIRECTORY);
+}
+
+void SetBgDir (const char* path)
+{
+ settings.setter(MUIOPTION_BACKGROUND_DIRECTORY, path);
+}
+
+const string GetDatsDir(void)
+{
+ string t = settings.getter(MUIOPTION_DATS_DIRECTORY);
+ if (t.empty())
+ return "dats";
+ else
+ return settings.getter(MUIOPTION_DATS_DIRECTORY);
+ //return mewui.value(OPTION_HISTORY_PATH);
+}
+
+void SetDatsDir(const char *path)
+{
+ char t1[strlen(path)+1];
+ strcpy(t1, path);
+ settings.setter(MUIOPTION_DATS_DIRECTORY, path);
+ mewui.set_value(OPTION_HISTORY_PATH, t1, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetVideoDir(void)
+{
+ string t = settings.getter(MUIOPTION_VIDEO_DIRECTORY);
+ if (t.empty())
+ return "video";
+ else
+ return settings.getter(MUIOPTION_VIDEO_DIRECTORY);
+}
+
+void SetVideoDir(const char *path)
+{
+ settings.setter(MUIOPTION_VIDEO_DIRECTORY, path);
+}
+
+const string GetManualsDir(void)
+{
+ string t = settings.getter(MUIOPTION_MANUALS_DIRECTORY);
+ if (t.empty())
+ return "manuals";
+ else
+ return settings.getter(MUIOPTION_MANUALS_DIRECTORY);
+}
+
+void SetManualsDir(const char *path)
+{
+ settings.setter(MUIOPTION_MANUALS_DIRECTORY, path);
+}
+
+// ***************************************************************** MAME.INI settings **************************************************************************
+const char* GetLanguageUI(void)
+{
+ return global.value(OPTION_LANGUAGE);
+}
+
+bool GetEnablePlugins(void)
+{
+ return global.bool_value(OPTION_PLUGINS);
+}
+
+const char* GetPlugins(void)
+{
+ return global.value(OPTION_PLUGIN);
+}
+
+const string GetRomDirs(void)
+{
+ const char* t = global.value(OPTION_MEDIAPATH);
+ if (t)
+ return string(global.value(OPTION_MEDIAPATH));
+ else
+ return "roms";
+}
+
+void SetRomDirs(const char* paths)
+{
+ global.set_value(OPTION_MEDIAPATH, paths, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetHashDirs(void)
+{
+ const char* t = global.value(OPTION_HASHPATH);
+ if (t)
+ return string(global.value(OPTION_HASHPATH));
+ else
+ return "hash";
+}
+
+void SetHashDirs(const char* paths)
+{
+ global.set_value(OPTION_HASHPATH, paths, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetSampleDirs(void)
+{
+ const char* t = global.value(OPTION_SAMPLEPATH);
+ if (t)
+ return string(global.value(OPTION_SAMPLEPATH));
+ else
+ return "samples";
+}
+
+void SetSampleDirs(const char* paths)
+{
+ global.set_value(OPTION_SAMPLEPATH, paths, OPTION_PRIORITY_CMDLINE);
+}
+
+const char * GetIniDir(void)
+{
+ const char *ini_dir;
+// const char *s;
+
+// ini_dir = global.value(OPTION_INIPATH);
+// while((s = strchr(ini_dir, ';')) != NULL)
+// {
+// ini_dir = s + 1;
+// }
+ ini_dir = "ini\0";
+ return ini_dir;
+
+}
+
+void SetIniDir(const char *path)
+{
+ global.set_value(OPTION_INIPATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetCtrlrDir(void)
+{
+ const char* t = global.value(OPTION_CTRLRPATH);
+ if (t)
+ return string(global.value(OPTION_CTRLRPATH));
+ else
+ return "ctrlr";
+}
+
+void SetCtrlrDir(const char* path)
+{
+ global.set_value(OPTION_CTRLRPATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetSWDir(void)
+{
+ const char* t = global.value(OPTION_SWPATH);
+ if (t)
+ return string(global.value(OPTION_SWPATH));
+ else
+ return "";
+}
+
+void SetSWDir(const char* path)
+{
+ global.set_value(OPTION_SWPATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetCfgDir(void)
+{
+ const char* t = global.value(OPTION_CFG_DIRECTORY);
+ if (t)
+ return string(global.value(OPTION_CFG_DIRECTORY));
+ else
+ return "cfg";
+}
+
+void SetCfgDir(const char* path)
+{
+ global.set_value(OPTION_CFG_DIRECTORY, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetNvramDir(void)
+{
+ const char* t = global.value(OPTION_NVRAM_DIRECTORY);
+ if (t)
+ return string(global.value(OPTION_NVRAM_DIRECTORY));
+ else
+ return "nvram";
+}
+
+void SetNvramDir(const char* path)
+{
+ global.set_value(OPTION_NVRAM_DIRECTORY, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetInpDir(void)
+{
+ const char* t = global.value(OPTION_INPUT_DIRECTORY);
+ if (t)
+ return string(global.value(OPTION_INPUT_DIRECTORY));
+ else
+ return "inp";
+}
+
+void SetInpDir(const char* path)
+{
+ global.set_value(OPTION_INPUT_DIRECTORY, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetImgDir(void)
+{
+ const char* t = global.value(OPTION_SNAPSHOT_DIRECTORY);
+ if (t)
+ return string(global.value(OPTION_SNAPSHOT_DIRECTORY));
+ else
+ return "snap";
+}
+
+void SetImgDir(const char* path)
+{
+ global.set_value(OPTION_SNAPSHOT_DIRECTORY, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetStateDir(void)
+{
+ const char* t = global.value(OPTION_STATE_DIRECTORY);
+ if (t)
+ return string(global.value(OPTION_STATE_DIRECTORY));
+ else
+ return "sta";
+}
+
+void SetStateDir(const char* path)
+{
+ global.set_value(OPTION_STATE_DIRECTORY, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetArtDir(void)
+{
+ const char* t = global.value(OPTION_ARTPATH);
+ if (t)
+ return string(global.value(OPTION_ARTPATH));
+ else
+ return "artwork";
+}
+
+void SetArtDir(const char* path)
+{
+ global.set_value(OPTION_ARTPATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetFontDir(void)
+{
+ const char* t = global.value(OPTION_FONTPATH);
+ if (t)
+ return string(global.value(OPTION_FONTPATH));
+ else
+ return ".";
+}
+
+void SetFontDir(const char* paths)
+{
+ global.set_value(OPTION_FONTPATH, paths, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetCrosshairDir(void)
+{
+ const char* t = global.value(OPTION_CROSSHAIRPATH);
+ if (t)
+ return string(global.value(OPTION_CROSSHAIRPATH));
+ else
+ return "crosshair";
+}
+
+void SetCrosshairDir(const char* paths)
+{
+ global.set_value(OPTION_CROSSHAIRPATH, paths, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetPluginsDir(void)
+{
+ const char* t = global.value(OPTION_PLUGINSPATH);
+ if (t)
+ return string(global.value(OPTION_PLUGINSPATH));
+ else
+ return "plugins";
+}
+
+void SetPluginsDir(const char* path)
+{
+ global.set_value(OPTION_PLUGINSPATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetLangDir(void)
+{
+ const char* t = global.value(OPTION_LANGUAGEPATH);
+ if (t)
+ return string(global.value(OPTION_LANGUAGEPATH));
+ else
+ return "language";
+}
+
+void SetLangDir(const char* path)
+{
+ global.set_value(OPTION_LANGUAGEPATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetDiffDir(void)
+{
+ const char* t = global.value(OPTION_DIFF_DIRECTORY);
+ if (t)
+ return string(global.value(OPTION_DIFF_DIRECTORY));
+ else
+ return "diff";
+}
+
+void SetDiffDir(const char* path)
+{
+ global.set_value(OPTION_DIFF_DIRECTORY, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetCheatDir(void)
+{
+ const char* t = global.value(OPTION_CHEATPATH);
+ if (t)
+ return string(global.value(OPTION_CHEATPATH));
+ else
+ return "cheat";
+}
+
+void SetCheatDir(const char* path)
+{
+ global.set_value(OPTION_CHEATPATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetHLSLDir(void)
+{
+ const char* t = global.value(WINOPTION_HLSLPATH);
+ if (t)
+ return string(global.value(WINOPTION_HLSLPATH));
+ else
+ return "hlsl";
+}
+
+void SetHLSLDir(const char* path)
+{
+ global.set_value(WINOPTION_HLSLPATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const char* GetSnapName(void)
+{
+ return global.value(OPTION_SNAPNAME);
+}
+
+void SetSnapName(const char* pattern)
+{
+ global.set_value(OPTION_SNAPNAME, pattern, OPTION_PRIORITY_CMDLINE);
+}
+
+// ***************************************************************** UI.INI settings **************************************************************************
+const string GetScoresDir(void)
+{
+ const char* t = mewui.value(OPTION_SCORES_PATH);
+ if (t)
+ return string(mewui.value(OPTION_SCORES_PATH));
+ else
+ return "scores";
+}
+
+void SetScoresDir(const char *path)
+{
+ mewui.set_value(OPTION_SCORES_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetBossesDir(void)
+{
+ const char* t = mewui.value(OPTION_BOSSES_PATH);
+ if (t)
+ return string(mewui.value(OPTION_BOSSES_PATH));
+ else
+ return "bosses";
+}
+
+void SetBossesDir(const char *path)
+{
+ mewui.set_value(OPTION_BOSSES_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetCoversDir(void)
+{
+ const char* t = mewui.value(OPTION_COVER_PATH);
+ if (t)
+ return string(mewui.value(OPTION_COVER_PATH));
+ else
+ return "covers";
+}
+
+void SetCoversDir(const char *path)
+{
+ mewui.set_value(OPTION_COVER_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetVersusDir(void)
+{
+ const char* t = mewui.value(OPTION_VERSUS_PATH);
+ if (t)
+ return string(mewui.value(OPTION_VERSUS_PATH));
+ else
+ return "versus";
+}
+
+void SetVersusDir(const char *path)
+{
+ mewui.set_value(OPTION_VERSUS_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetEndsDir(void)
+{
+ const char* t = mewui.value(OPTION_ENDS_PATH);
+ if (t)
+ return string(mewui.value(OPTION_ENDS_PATH));
+ else
+ return "ends";
+}
+
+void SetEndsDir(const char *path)
+{
+ mewui.set_value(OPTION_ENDS_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetGameOverDir(void)
+{
+ const char* t = mewui.value(OPTION_GAMEOVER_PATH);
+ if (t)
+ return string(mewui.value(OPTION_GAMEOVER_PATH));
+ else
+ return "gameover";
+}
+
+void SetGameOverDir(const char *path)
+{
+ mewui.set_value(OPTION_GAMEOVER_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetHowToDir(void)
+{
+ const char* t = mewui.value(OPTION_HOWTO_PATH);
+ if (t)
+ return string(mewui.value(OPTION_HOWTO_PATH));
+ else
+ return "howto";
+}
+
+void SetHowToDir(const char *path)
+{
+ mewui.set_value(OPTION_HOWTO_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetSelectDir(void)
+{
+ const char* t = mewui.value(OPTION_SELECT_PATH);
+ if (t)
+ return string(mewui.value(OPTION_SELECT_PATH));
+ else
+ return "select";
+}
+
+void SetSelectDir(const char *path)
+{
+ mewui.set_value(OPTION_SELECT_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetLogoDir(void)
+{
+ const char* t = mewui.value(OPTION_LOGOS_PATH);
+ if (t)
+ return string(mewui.value(OPTION_LOGOS_PATH));
+ else
+ return "logo";
+}
+
+void SetLogoDir(const char *path)
+{
+ mewui.set_value(OPTION_LOGOS_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetArtworkDir(void)
+{
+ const char* t = mewui.value(OPTION_ARTPREV_PATH);
+ if (t)
+ return string(mewui.value(OPTION_ARTPREV_PATH));
+ else
+ return "artpreview";
+}
+
+void SetArtworkDir(const char *path)
+{
+ mewui.set_value(OPTION_ARTPREV_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetFlyerDir(void)
+{
+ const char* t = mewui.value(OPTION_FLYERS_PATH);
+ if (t)
+ return string(mewui.value(OPTION_FLYERS_PATH));
+ else
+ return "flyers";
+}
+
+void SetFlyerDir(const char* path)
+{
+ mewui.set_value(OPTION_FLYERS_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetCabinetDir(void)
+{
+ const char* t = mewui.value(OPTION_CABINETS_PATH);
+ if (t)
+ return string(mewui.value(OPTION_CABINETS_PATH));
+ else
+ return "cabinets";
+}
+
+void SetCabinetDir(const char* path)
+{
+ mewui.set_value(OPTION_CABINETS_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetMarqueeDir(void)
+{
+ const char* t = mewui.value(OPTION_MARQUEES_PATH);
+ if (t)
+ return string(mewui.value(OPTION_MARQUEES_PATH));
+ else
+ return "marquees";
+}
+
+void SetMarqueeDir(const char* path)
+{
+ mewui.set_value(OPTION_MARQUEES_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetTitlesDir(void)
+{
+ const char* t = mewui.value(OPTION_TITLES_PATH);
+ if (t)
+ return string(mewui.value(OPTION_TITLES_PATH));
+ else
+ return "titles";
+}
+
+void SetTitlesDir(const char* path)
+{
+ mewui.set_value(OPTION_TITLES_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetControlPanelDir(void)
+{
+ const char* t = mewui.value(OPTION_CPANELS_PATH);
+ if (t)
+ return string(mewui.value(OPTION_CPANELS_PATH));
+ else
+ return "cpanel";
+}
+
+void SetControlPanelDir(const char *path)
+{
+ mewui.set_value(OPTION_CPANELS_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetPcbDir(void)
+{
+ const char* t = mewui.value(OPTION_PCBS_PATH);
+ if (t)
+ return string(mewui.value(OPTION_PCBS_PATH));
+ else
+ return "pcb";
+}
+
+void SetPcbDir(const char *path)
+{
+ mewui.set_value(OPTION_PCBS_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+const string GetFolderDir(void)
+{
+ const char* t = mewui.value(OPTION_CATEGORYINI_PATH);
+ if (t)
+ return string(mewui.value(OPTION_CATEGORYINI_PATH));
+ else
+ return "folders";
+}
+
+void SetFolderDir(const char* path)
+{
+ mewui.set_value(OPTION_CATEGORYINI_PATH, path, OPTION_PRIORITY_CMDLINE);
+}
+
+// ***************************************************************** MAME_g.INI settings **************************************************************************
+int GetRomAuditResults(uint32_t driver_index)
+{
+ return game_opts.rom(driver_index);
+}
+
+void SetRomAuditResults(uint32_t driver_index, int audit_results)
+{
+ game_opts.rom(driver_index, audit_results);
+}
+
+int GetSampleAuditResults(uint32_t driver_index)
+{
+ return game_opts.sample(driver_index);
+}
+
+void SetSampleAuditResults(uint32_t driver_index, int audit_results)
+{
+ game_opts.sample(driver_index, audit_results);
+}
+
+static void IncrementPlayVariable(uint32_t driver_index, const char *play_variable, uint32_t increment)
+{
+ if (strcmp(play_variable, "count") == 0)
+ game_opts.play_count(driver_index, game_opts.play_count(driver_index) + increment);
+ else
+ if (strcmp(play_variable, "time") == 0)
+ game_opts.play_time(driver_index, game_opts.play_time(driver_index) + increment);
+}
+
+void IncrementPlayCount(uint32_t driver_index)
+{
+ IncrementPlayVariable(driver_index, "count", 1);
+}
+
+uint32_t GetPlayCount(uint32_t driver_index)
+{
+ return game_opts.play_count(driver_index);
+}
+
+// int needed here so we can reset all games
+static void ResetPlayVariable(int driver_index, const char *play_variable)
+{
+ if (driver_index < 0)
+ /* all games */
+ for (uint32_t i = 0; i < driver_list::total(); i++)
+ ResetPlayVariable(i, play_variable);
+ else
+ {
+ if (strcmp(play_variable, "count") == 0)
+ game_opts.play_count(driver_index, 0);
+ else
+ if (strcmp(play_variable, "time") == 0)
+ game_opts.play_time(driver_index, 0);
+ }
+}
+
+// int needed here so we can reset all games
+void ResetPlayCount(int driver_index)
+{
+ ResetPlayVariable(driver_index, "count");
+}
+
+// int needed here so we can reset all games
+void ResetPlayTime(int driver_index)
+{
+ ResetPlayVariable(driver_index, "time");
+}
+
+uint32_t GetPlayTime(uint32_t driver_index)
+{
+ return game_opts.play_time(driver_index);
+}
+
+void IncrementPlayTime(uint32_t driver_index, uint32_t playtime)
+{
+ IncrementPlayVariable(driver_index, "time", playtime);
+}
+
+void GetTextPlayTime(uint32_t driver_index, char *buf)
+{
+
+ if (driver_index < driver_list::total())
+ {
+ uint32_t second = GetPlayTime(driver_index);
+ uint32_t hour = second / 3600;
+ second -= 3600*hour;
+ uint8_t minute = second / 60; //Calc Minutes
+ second -= 60*minute;
+
+ if (hour == 0)
+ sprintf(buf, "%d:%02d", minute, second );
+ else
+ sprintf(buf, "%d:%02d:%02d", hour, minute, second );
+ }
+}
+
+input_seq* Get_ui_key_up(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_UP);
+}
+
+input_seq* Get_ui_key_down(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_DOWN);
+}
+
+input_seq* Get_ui_key_left(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_LEFT);
+}
+
+input_seq* Get_ui_key_right(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_RIGHT);
+}
+
+input_seq* Get_ui_key_start(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_START);
+}
+
+input_seq* Get_ui_key_pgup(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_PGUP);
+}
+
+input_seq* Get_ui_key_pgdwn(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_PGDWN);
+}
+
+input_seq* Get_ui_key_home(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_HOME);
+}
+
+input_seq* Get_ui_key_end(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_END);
+}
+
+input_seq* Get_ui_key_ss_change(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_SS_CHANGE);
+}
+
+input_seq* Get_ui_key_history_up(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_HISTORY_UP);
+}
+
+input_seq* Get_ui_key_history_down(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_HISTORY_DOWN);
+}
+
+input_seq* Get_ui_key_context_filters(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_CONTEXT_FILTERS);
+}
+
+input_seq* Get_ui_key_select_random(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_SELECT_RANDOM);
+}
+
+input_seq* Get_ui_key_game_audit(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_GAME_AUDIT);
+}
+
+input_seq* Get_ui_key_game_properties(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_GAME_PROPERTIES);
+}
+
+input_seq* Get_ui_key_help_contents(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_HELP_CONTENTS);
+}
+
+input_seq* Get_ui_key_update_gamelist(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_UPDATE_GAMELIST);
+}
+
+input_seq* Get_ui_key_view_folders(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_FOLDERS);
+}
+
+input_seq* Get_ui_key_view_fullscreen(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_FULLSCREEN);
+}
+
+input_seq* Get_ui_key_view_pagetab(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_PAGETAB);
+}
+
+input_seq* Get_ui_key_view_picture_area(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_PICTURE_AREA);
+}
+
+input_seq* Get_ui_key_view_software_area(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_SOFTWARE_AREA);
+}
+
+input_seq* Get_ui_key_view_status(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_STATUS);
+}
+
+input_seq* Get_ui_key_view_toolbars(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TOOLBARS);
+}
+
+input_seq* Get_ui_key_view_tab_cabinet(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TAB_CABINET);
+}
+
+input_seq* Get_ui_key_view_tab_cpanel(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TAB_CPANEL);
+}
+
+input_seq* Get_ui_key_view_tab_flyer(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TAB_FLYER);
+}
+
+input_seq* Get_ui_key_view_tab_history(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TAB_HISTORY);
+}
+
+input_seq* Get_ui_key_view_tab_marquee(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TAB_MARQUEE);
+}
+
+input_seq* Get_ui_key_view_tab_screenshot(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TAB_SCREENSHOT);
+}
+
+input_seq* Get_ui_key_view_tab_title(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TAB_TITLE);
+}
+
+input_seq* Get_ui_key_view_tab_pcb(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_VIEW_TAB_PCB);
+}
+
+input_seq* Get_ui_key_quit(void)
+{
+ return options_get_input_seq(MUIOPTION_UI_KEY_QUIT);
+}
+
+static int GetUIJoy(const char *option_name, int joycodeIndex)
+{
+ int joycodes[4];
+
+ if ((joycodeIndex < 0) || (joycodeIndex > 3))
+ joycodeIndex = 0;
+ ColumnDecodeStringWithCount(settings.getter(option_name), joycodes, ARRAY_LENGTH(joycodes));
+ return joycodes[joycodeIndex];
+}
+
+static void SetUIJoy(const char *option_name, int joycodeIndex, int val)
+{
+ int joycodes[4];
+
+ if ((joycodeIndex < 0) || (joycodeIndex > 3))
+ joycodeIndex = 0;
+ ColumnDecodeStringWithCount(settings.getter(option_name), joycodes, ARRAY_LENGTH(joycodes));
+ joycodes[joycodeIndex] = val;
+ settings.setter(option_name, ColumnEncodeStringWithCount(joycodes, ARRAY_LENGTH(joycodes)));
+}
+
+int GetUIJoyUp(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_UP, joycodeIndex);
+}
+
+void SetUIJoyUp(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_UP, joycodeIndex, val);
+}
+
+int GetUIJoyDown(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_DOWN, joycodeIndex);
+}
+
+void SetUIJoyDown(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_DOWN, joycodeIndex, val);
+}
+
+int GetUIJoyLeft(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_LEFT, joycodeIndex);
+}
+
+void SetUIJoyLeft(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_LEFT, joycodeIndex, val);
+}
+
+int GetUIJoyRight(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_RIGHT, joycodeIndex);
+}
+
+void SetUIJoyRight(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_RIGHT, joycodeIndex, val);
+}
+
+int GetUIJoyStart(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_START, joycodeIndex);
+}
+
+void SetUIJoyStart(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_START, joycodeIndex, val);
+}
+
+int GetUIJoyPageUp(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_PGUP, joycodeIndex);
+}
+
+void SetUIJoyPageUp(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_PGUP, joycodeIndex, val);
+}
+
+int GetUIJoyPageDown(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_PGDWN, joycodeIndex);
+}
+
+void SetUIJoyPageDown(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_PGDWN, joycodeIndex, val);
+}
+
+int GetUIJoyHome(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_HOME, joycodeIndex);
+}
+
+void SetUIJoyHome(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_HOME, joycodeIndex, val);
+}
+
+int GetUIJoyEnd(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_END, joycodeIndex);
+}
+
+void SetUIJoyEnd(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_END, joycodeIndex, val);
+}
+
+int GetUIJoySSChange(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_SS_CHANGE, joycodeIndex);
+}
+
+void SetUIJoySSChange(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_SS_CHANGE, joycodeIndex, val);
+}
+
+int GetUIJoyHistoryUp(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_HISTORY_UP, joycodeIndex);
+}
+
+void SetUIJoyHistoryUp(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_HISTORY_UP, joycodeIndex, val);
+}
+
+int GetUIJoyHistoryDown(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_HISTORY_DOWN, joycodeIndex);
+}
+
+void SetUIJoyHistoryDown(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_HISTORY_DOWN, joycodeIndex, val);
+}
+
+// exec functions start: these are unsupported
+void SetUIJoyExec(int joycodeIndex, int val)
+{
+ SetUIJoy(MUIOPTION_UI_JOY_EXEC, joycodeIndex, val);
+}
+
+int GetUIJoyExec(int joycodeIndex)
+{
+ return GetUIJoy(MUIOPTION_UI_JOY_EXEC, joycodeIndex);
+}
+
+const string GetExecCommand(void)
+{
+ return settings.getter(MUIOPTION_EXEC_COMMAND);
+}
+
+// not used
+void SetExecCommand(char *cmd)
+{
+ settings.setter(MUIOPTION_EXEC_COMMAND, cmd);
+}
+
+int GetExecWait(void)
+{
+ return settings.int_value(MUIOPTION_EXEC_WAIT);
+}
+
+void SetExecWait(int wait)
+{
+ settings.setter(MUIOPTION_EXEC_WAIT, wait);
+}
+// exec functions end
+
+BOOL GetHideMouseOnStartup(void)
+{
+ return settings.bool_value(MUIOPTION_HIDE_MOUSE);
+}
+
+void SetHideMouseOnStartup(BOOL hide)
+{
+ settings.setter(MUIOPTION_HIDE_MOUSE, hide);
+}
+
+BOOL GetRunFullScreen(void)
+{
+ return settings.bool_value( MUIOPTION_FULL_SCREEN);
+}
+
+void SetRunFullScreen(BOOL fullScreen)
+{
+ settings.setter(MUIOPTION_FULL_SCREEN, fullScreen);
+}
+
+/***************************************************************************
+ Internal functions
+ ***************************************************************************/
+
+static string CusColorEncodeString(const COLORREF *value)
+{
+ string str = std::to_string(value[0]);
+
+ for (int i = 1; i < 16; i++)
+ str.append(",").append(std::to_string(value[i]));
+
+ return str;
+}
+
+static void CusColorDecodeString(string ss, COLORREF *value)
+{
+ const char *str = ss.c_str();
+ char *s, *p;
+ char tmpStr[256];
+
+ strcpy(tmpStr, str);
+ p = tmpStr;
+
+ for (int i = 0; p && i < 16; i++)
+ {
+ s = p;
+
+ if ((p = strchr(s,',')) != NULL && *p == ',')
+ {
+ *p = '\0';
+ p++;
+ }
+ value[i] = atoi(s);
+ }
+}
+
+
+static string ColumnEncodeStringWithCount(const int *value, int count)
+{
+ string str = std::to_string(value[0]);
+
+ for (int i = 1; i < count; i++)
+ str.append(",").append(std::to_string(value[i]));
+
+ return str;
+}
+
+static void ColumnDecodeStringWithCount(string ss, int *value, int count)
+{
+ const char *str = ss.c_str();
+ char *s, *p;
+ char tmpStr[256];
+
+ if (str == NULL)
+ return;
+
+ strcpy(tmpStr, str);
+ p = tmpStr;
+
+ for (int i = 0; p && i < count; i++)
+ {
+ s = p;
+
+ if ((p = strchr(s,',')) != NULL && *p == ',')
+ {
+ *p = '\0';
+ p++;
+ }
+ value[i] = atoi(s);
+ }
+}
+
+static string SplitterEncodeString(const int *value)
+{
+ string str = std::to_string(value[0]);
+
+ for (int i = 1; i < GetSplitterCount(); i++)
+ str.append(",").append(std::to_string(value[i]));
+
+ return str;
+}
+
+static void SplitterDecodeString(string ss, int *value)
+{
+ const char *str = ss.c_str();
+ char *s, *p;
+ char tmpStr[256];
+
+ strcpy(tmpStr, str);
+ p = tmpStr;
+
+ for (int i = 0; p && i < GetSplitterCount(); i++)
+ {
+ s = p;
+
+ if ((p = strchr(s,',')) != NULL && *p == ',')
+ {
+ *p = '\0';
+ p++;
+ }
+ value[i] = atoi(s);
+ }
+}
+
+/* Parse the given comma-delimited string into a LOGFONT structure */
+static void FontDecodeString(string ss, LOGFONT *f)
+{
+ const char* str = ss.c_str();
+ sscanf(str, "%li,%li,%li,%li,%li,%i,%i,%i,%i,%i,%i,%i,%i",
+ &f->lfHeight,
+ &f->lfWidth,
+ &f->lfEscapement,
+ &f->lfOrientation,
+ &f->lfWeight,
+ (int*)&f->lfItalic,
+ (int*)&f->lfUnderline,
+ (int*)&f->lfStrikeOut,
+ (int*)&f->lfCharSet,
+ (int*)&f->lfOutPrecision,
+ (int*)&f->lfClipPrecision,
+ (int*)&f->lfQuality,
+ (int*)&f->lfPitchAndFamily);
+ const char *ptr = strrchr(str, ',');
+ if (ptr)
+ {
+ TCHAR *t_s = ui_wstring_from_utf8(ptr + 1);
+ if( !t_s )
+ return;
+ _tcscpy(f->lfFaceName, t_s);
+ free(t_s);
+ }
+}
+
+/* Encode the given LOGFONT structure into a comma-delimited string */
+static string FontEncodeString(const LOGFONT *f)
+{
+ char* utf8_FaceName = ui_utf8_from_wstring(f->lfFaceName);
+ if( !utf8_FaceName )
+ return "";
+
+ char s[200];
+ sprintf(s, "%li,%li,%li,%li,%li,%i,%i,%i,%i,%i,%i,%i,%i,%s",
+ f->lfHeight,
+ f->lfWidth,
+ f->lfEscapement,
+ f->lfOrientation,
+ f->lfWeight,
+ f->lfItalic,
+ f->lfUnderline,
+ f->lfStrikeOut,
+ f->lfCharSet,
+ f->lfOutPrecision,
+ f->lfClipPrecision,
+ f->lfQuality,
+ f->lfPitchAndFamily,
+ utf8_FaceName);
+
+ free(utf8_FaceName);
+ return string(s);
+}
+
+static string TabFlagsEncodeString(int data)
+{
+ int num_saved = 0;
+ string str;
+
+ // we save the ones that are NOT displayed, so we can add new ones
+ // and upgraders will see them
+ for ( int i=0; i<MAX_TAB_TYPES; i++)
+ {
+ if (((data & (1 << i)) == 0) && GetImageTabShortName(i))
+ {
+ if (num_saved > 0)
+ str.append(",");
+
+ str.append(GetImageTabShortName(i));
+ num_saved++;
+ }
+ }
+ return str;
+}
+
+static void TabFlagsDecodeString(string ss, int *data)
+{
+ const char *str = ss.c_str();
+ int j = 0;
+ char s[2000];
+ char *token;
+
+ snprintf(s, ARRAY_LENGTH(s), "%s", str);
+
+ // simple way to set all tab bits "on"
+ *data = (1 << MAX_TAB_TYPES) - 1;
+
+ token = strtok(s,", \t");
+ while (token)
+ {
+ for (j=0; j<MAX_TAB_TYPES; j++)
+ {
+ if (!GetImageTabShortName(j) || (strcmp(GetImageTabShortName(j), token) == 0))
+ {
+ // turn off this bit
+ *data &= ~(1 << j);
+ break;
+ }
+ }
+ token = strtok(NULL,", \t");
+ }
+
+ if (*data == 0)
+ {
+ // not allowed to hide all tabs, because then why even show the area?
+ *data = (1 << TAB_SCREENSHOT);
+ }
+}
+
+// load mewui settings
+static void LoadSettingsFile(ui_options &opts, const char *filename)
+{
+ osd_file::error filerr;
+ util::core_file::ptr file;
+
+ filerr = util::core_file::open(filename, OPEN_FLAG_READ, file);
+ if (filerr == osd_file::error::NONE)
+ {
+ opts.parse_ini_file(*file, OPTION_PRIORITY_CMDLINE, true, true);
+ file.reset();
+ }
+}
+
+// load a game ini
+static void LoadSettingsFile(windows_options &opts, const char *filename)
+{
+ osd_file::error filerr;
+ util::core_file::ptr file;
+
+ filerr = util::core_file::open(filename, OPEN_FLAG_READ, file);
+ if (filerr == osd_file::error::NONE)
+ {
+ opts.parse_ini_file(*file, OPTION_PRIORITY_CMDLINE, true, true);
+ file.reset();
+ }
+}
+
+// This saves changes to UI.INI only
+static void SaveSettingsFile(ui_options &opts, const char *filename)
+{
+ osd_file::error filerr = osd_file::error::NONE;
+ util::core_file::ptr file;
+
+ filerr = util::core_file::open(filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, file);
+
+ if (filerr == osd_file::error::NONE)
+ {
+ string inistring = opts.output_ini();
+ file->puts(inistring.c_str());
+ file.reset();
+ }
+}
+
+
+
+// This saves changes to <game>.INI or MAME.INI only
+static void SaveSettingsFile(windows_options &opts, const char *filename)
+{
+ osd_file::error filerr = osd_file::error::NONE;
+ util::core_file::ptr file;
+
+ filerr = util::core_file::open(filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, file);
+
+ if (filerr == osd_file::error::NONE)
+ {
+ string inistring = opts.output_ini();
+ // printf("=====%s=====\n%s\n",filename,inistring.c_str()); // for debugging
+ file->puts(inistring.c_str());
+ file.reset();
+ }
+}
+
+
+
+void ResetGameOptions(int driver_index)
+{
+ //save_options(NULL, OPTIONS_GAME, driver_index);
+}
+
+void ResetGameDefaults(void)
+{
+ // Walk the global settings and reset everything to defaults;
+ ResetToDefaults(global, OPTION_PRIORITY_CMDLINE);
+ save_options(global, OPTIONS_GLOBAL, GLOBAL_OPTIONS);
+}
+
+/*
+ * Reset all game, vector and source options to defaults.
+ * No reason to reboot if this is done.
+ */
+void ResetAllGameOptions(void)
+{
+ for (int i = 0; i < driver_list::total(); i++)
+ ResetGameOptions(i);
+}
+
+void SetDirectories(windows_options &opts)
+{
+ opts.set_value(OPTION_MEDIAPATH, GetRomDirs(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_SAMPLEPATH, GetSampleDirs(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_INIPATH, GetIniDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_CFG_DIRECTORY, GetCfgDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_SNAPSHOT_DIRECTORY, GetImgDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_INPUT_DIRECTORY, GetInpDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_STATE_DIRECTORY, GetStateDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_ARTPATH, GetArtDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_NVRAM_DIRECTORY, GetNvramDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_CTRLRPATH, GetCtrlrDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_CHEATPATH, GetCheatDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_CROSSHAIRPATH, GetCrosshairDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_FONTPATH, GetFontDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_DIFF_DIRECTORY, GetDiffDir(), OPTION_PRIORITY_CMDLINE);
+ opts.set_value(OPTION_SNAPNAME, GetSnapName(), OPTION_PRIORITY_CMDLINE);
+}
+
+// not used
+#if 0
+const char * GetFolderNameByID(UINT nID)
+{
+ UINT i;
+ extern const FOLDERDATA g_folderData[];
+ extern LPEXFOLDERDATA ExtraFolderData[];
+
+ for (i = 0; i < MAX_EXTRA_FOLDERS * MAX_EXTRA_SUBFOLDERS; i++)
+ if( ExtraFolderData[i] )
+ if (ExtraFolderData[i]->m_nFolderId == nID)
+ return ExtraFolderData[i]->m_szTitle;
+
+ for( i = 0; i < MAX_FOLDERS; i++)
+ if (g_folderData[i].m_nFolderId == nID)
+ return g_folderData[i].m_lpTitle;
+
+ return NULL;
+}
+#endif
+
+DWORD GetFolderFlags(int folder_index)
+{
+ LPTREEFOLDER lpFolder = GetFolder(folder_index);
+
+ if (lpFolder)
+ return lpFolder->m_dwFlags & F_MASK;
+
+ return 0;
+}
+
+/* MSH 20080813
+ * Read the folder filters from MAMEui.ini. This must only
+ * be called AFTER the folders have all been created.
+ */
+void LoadFolderFlags(void)
+{
+ LPTREEFOLDER lpFolder;
+ int i, numFolders = GetNumFolders();
+
+ for (i = 0; i < numFolders; i++)
+ {
+ lpFolder = GetFolder(i);
+
+ if (lpFolder)
+ {
+ char folder_name[400];
+ char *ptr;
+
+ // Convert spaces to underscores
+ strcpy(folder_name, lpFolder->m_lpTitle);
+ ptr = folder_name;
+ while (*ptr && *ptr != '\0')
+ {
+ if ((*ptr == ' ') || (*ptr == '-'))
+ *ptr = '_';
+
+ ptr++;
+ }
+
+ string option_name = string(folder_name) + "_filters";
+ }
+ }
+
+ // These are added to our UI ini
+ // The normal read will skip them.
+
+ // retrieve the stored values
+ for (i = 0; i < numFolders; i++)
+ {
+ lpFolder = GetFolder(i);
+
+ if (lpFolder)
+ {
+ char folder_name[400];
+
+ // Convert spaces to underscores
+ strcpy(folder_name, lpFolder->m_lpTitle);
+ char *ptr = folder_name;
+ while (*ptr && *ptr != '\0')
+ {
+ if ((*ptr == ' ') || (*ptr == '-'))
+ *ptr = '_';
+
+ ptr++;
+ }
+ string option_name = string(folder_name) + "_filters";
+
+ // get entry and decode it
+ lpFolder->m_dwFlags |= (settings.int_value(option_name.c_str()) & F_MASK);
+ }
+ }
+}
+
+
+
+// Adds our folder flags to winui_options, for saving.
+static void AddFolderFlags()
+{
+ LPTREEFOLDER lpFolder;
+ int num_entries = 0, numFolders = GetNumFolders();
+
+ for (int i = 0; i < numFolders; i++)
+ {
+ lpFolder = GetFolder(i);
+ if (lpFolder)
+ {
+ char folder_name[400];
+
+ // Convert spaces to underscores
+ strcpy(folder_name, lpFolder->m_lpTitle);
+ char *ptr = folder_name;
+ while (*ptr && *ptr != '\0')
+ {
+ if ((*ptr == ' ') || (*ptr == '-'))
+ *ptr = '_';
+
+ ptr++;
+ }
+
+ string option_name = string(folder_name) + "_filters";
+
+ // store entry
+ settings.setter(option_name.c_str(), lpFolder->m_dwFlags & F_MASK);
+
+ // increment counter
+ num_entries++;
+ }
+ }
+}
+
+// Save MAMEUI.ini
+void SaveOptions(void)
+{
+ // Add the folder flag to settings.
+ AddFolderFlags();
+ settings.save_file(UI_INI_FILENAME);
+ SaveSettingsFile(mewui, MEWUI_FILENAME);
+}
+
+void SaveGameListOptions(void)
+{
+ // Save GameInfo.ini - game options.
+ game_opts.save_file(GAMEINFO_INI_FILENAME);
+}
+
+void SaveDefaultOptions(void)
+{
+ string fname = string(GetIniDir()) + PATH_SEPARATOR + string(emulator_info::get_configname()).append(".ini");
+ SaveSettingsFile(global, fname.c_str());
+}
+
+const char * GetVersionString(void)
+{
+ return emulator_info::get_build_version();
+}
+
+
+/* get options, based on passed in game number. */
+void load_options(windows_options &opts, OPTIONS_TYPE opt_type, int game_num, bool set_system_name)
+{
+ const game_driver *driver = NULL;
+ if (game_num > -1)
+ driver = &driver_list::driver(game_num);
+
+ // Try base ini first
+ string fname = string(emulator_info::get_configname()).append(".ini");
+ LoadSettingsFile(opts, fname.c_str());
+
+ if (opt_type == OPTIONS_SOURCE)
+ {
+ fname = string(GetIniDir()) + PATH_SEPARATOR + "source" + PATH_SEPARATOR + core_filename_extract_base(driver->type.source(), true) + ".ini";
+ LoadSettingsFile(opts, fname.c_str());
+ return;
+ }
+
+ if (game_num > -2)
+ {
+ // Now try global ini
+ fname = string(GetIniDir()) + PATH_SEPARATOR + string(emulator_info::get_configname()).append(".ini");
+ LoadSettingsFile(opts, fname.c_str());
+
+ if (game_num > -1)
+ {
+ // Lastly, gamename.ini
+ if (driver)
+ {
+ fname = string(GetIniDir()) + PATH_SEPARATOR + string(driver->name).append(".ini");
+ if (set_system_name)
+ opts.set_value(OPTION_SYSTEMNAME, driver->name, OPTION_PRIORITY_CMDLINE);
+ LoadSettingsFile(opts, fname.c_str());
+ }
+ }
+ }
+ SetDirectories(opts);
+}
+
+/* Save ini file based on game_number. */
+void save_options(windows_options &opts, OPTIONS_TYPE opt_type, int game_num)
+{
+ const game_driver *driver = NULL;
+ string filename, filepath;
+
+ if (game_num >= 0)
+ {
+ driver = &driver_list::driver(game_num);
+ if (driver)
+ {
+ filename.assign(driver->name);
+ if (opt_type == OPTIONS_SOURCE)
+ filepath = string(GetIniDir()) + PATH_SEPARATOR + "source" + PATH_SEPARATOR + core_filename_extract_base(driver->type.source(), true) + ".ini";
+ }
+ }
+ else
+ if (game_num == -1)
+ filename = string(emulator_info::get_configname());
+
+ if (!filename.empty() && filepath.empty())
+ filepath = string(GetIniDir()).append(PATH_SEPARATOR).append(filename.c_str()).append(".ini");
+
+ if (game_num == -2)
+ filepath = string(emulator_info::get_configname()).append(".ini");
+
+ if (!filepath.empty())
+ {
+ SetDirectories(opts);
+ SaveSettingsFile(opts, filepath.c_str());
+// printf("Settings saved to %s\n",filepath.c_str());
+ }
+// else
+// printf("Unable to save settings\n");
+}
+
+
+// See if this driver has software support
+bool DriverHasSoftware(uint32_t drvindex)
+{
+ if (drvindex < driver_list::total())
+ {
+ windows_options o;
+ load_options(o, OPTIONS_GAME, drvindex, 1);
+ machine_config config(driver_list::driver(drvindex), o);
+
+ for (device_image_interface &img : image_interface_iterator(config.root_device()))
+ if (img.user_loadable())
+ return 1;
+ }
+
+ return 0;
+}
+
+
+// Reset the given windows_options to their default settings.
+static void ResetToDefaults(windows_options &opts, int priority)
+{
+ // iterate through the options setting each one back to the default value.
+ windows_options dummy;
+ OptionsCopy(dummy, opts);
+}
+
+uint32_t GetDriverCacheLower(uint32_t driver_index)
+{
+ return game_opts.cache_lower(driver_index);
+}
+
+uint32_t GetDriverCacheUpper(uint32_t driver_index)
+{
+ return game_opts.cache_upper(driver_index);
+}
+
+void SetDriverCache(uint32_t driver_index, uint32_t val)
+{
+ game_opts.cache_upper(driver_index, val);
+}
+
+BOOL RequiredDriverCache(void)
+{
+ return game_opts.rebuild();
+}
+
+void ForceRebuild(void)
+{
+ game_opts.force_rebuild();
+}
+
+BOOL DriverIsComputer(uint32_t driver_index)
+{
+ uint32_t cache = game_opts.cache_lower(driver_index) & 3;
+ return (cache == 2) ? true : false;
+}
+
+BOOL DriverIsConsole(uint32_t driver_index)
+{
+ uint32_t cache = game_opts.cache_lower(driver_index) & 3;
+ return (cache == 1) ? true : false;
+}
+
+BOOL DriverIsModified(uint32_t driver_index)
+{
+ return BIT(game_opts.cache_lower(driver_index), 12);
+}
+
+BOOL DriverIsImperfect(uint32_t driver_index)
+{
+ return (game_opts.cache_lower(driver_index) & 0xff0000) ? true : false; // (NO|IMPERFECT) (CONTROLS|PALETTE|SOUND|GRAPHICS)
+}
+
+// from optionsms.cpp (MESSUI)
+
+
+#define LOG_SOFTWARE 1
+
+void SetSLColumnOrder(int order[])
+{
+ settings.setter(MESSUI_SL_COLUMN_ORDER, ColumnEncodeStringWithCount(order, SL_COLUMN_MAX));
+}
+
+void GetSLColumnOrder(int order[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MESSUI_SL_COLUMN_ORDER), order, SL_COLUMN_MAX);
+}
+
+void SetSLColumnShown(int shown[])
+{
+ settings.setter(MESSUI_SL_COLUMN_SHOWN, ColumnEncodeStringWithCount(shown, SL_COLUMN_MAX));
+}
+
+void GetSLColumnShown(int shown[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MESSUI_SL_COLUMN_SHOWN), shown, SL_COLUMN_MAX);
+}
+
+void SetSLColumnWidths(int width[])
+{
+ settings.setter(MESSUI_SL_COLUMN_WIDTHS, ColumnEncodeStringWithCount(width, SL_COLUMN_MAX));
+}
+
+void GetSLColumnWidths(int width[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MESSUI_SL_COLUMN_WIDTHS), width, SL_COLUMN_MAX);
+}
+
+void SetSLSortColumn(int column)
+{
+ settings.setter(MESSUI_SL_SORT_COLUMN, column);
+}
+
+int GetSLSortColumn(void)
+{
+ return settings.int_value(MESSUI_SL_SORT_COLUMN);
+}
+
+void SetSLSortReverse(BOOL reverse)
+{
+ settings.setter(MESSUI_SL_SORT_REVERSED, reverse);
+}
+
+BOOL GetSLSortReverse(void)
+{
+ return settings.bool_value(MESSUI_SL_SORT_REVERSED);
+}
+
+void SetSWColumnOrder(int order[])
+{
+ settings.setter(MESSUI_SW_COLUMN_ORDER, ColumnEncodeStringWithCount(order, SW_COLUMN_MAX));
+}
+
+void GetSWColumnOrder(int order[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MESSUI_SW_COLUMN_ORDER), order, SW_COLUMN_MAX);
+}
+
+void SetSWColumnShown(int shown[])
+{
+ settings.setter(MESSUI_SW_COLUMN_SHOWN, ColumnEncodeStringWithCount(shown, SW_COLUMN_MAX));
+}
+
+void GetSWColumnShown(int shown[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MESSUI_SW_COLUMN_SHOWN), shown, SW_COLUMN_MAX);
+}
+
+void SetSWColumnWidths(int width[])
+{
+ settings.setter(MESSUI_SW_COLUMN_WIDTHS, ColumnEncodeStringWithCount(width, SW_COLUMN_MAX));
+}
+
+void GetSWColumnWidths(int width[])
+{
+ ColumnDecodeStringWithCount(settings.getter(MESSUI_SW_COLUMN_WIDTHS), width, SW_COLUMN_MAX);
+}
+
+void SetSWSortColumn(int column)
+{
+ settings.setter(MESSUI_SW_SORT_COLUMN, column);
+}
+
+int GetSWSortColumn(void)
+{
+ return settings.int_value(MESSUI_SW_SORT_COLUMN);
+}
+
+void SetSWSortReverse(BOOL reverse)
+{
+ settings.setter( MESSUI_SW_SORT_REVERSED, reverse);
+}
+
+BOOL GetSWSortReverse(void)
+{
+ return settings.bool_value(MESSUI_SW_SORT_REVERSED);
+}
+
+
+void SetSelectedSoftware(int driver_index, string opt_name, const char *software)
+{
+ const char *s = opt_name.c_str();
+
+ if (LOG_SOFTWARE)
+ {
+ printf("SetSelectedSoftware(): slot=%s driver=%s software='%s'\n", s, driver_list::driver(driver_index).name, software);
+ }
+
+ if (s)
+ {
+ printf("About to load %s into slot %s\n",software,s);
+ windows_options o;
+ //o.set_value(OPTION_SYSTEMNAME, driver_list::driver(driver_index).name, OPTION_PRIORITY_CMDLINE);
+ load_options(o, OPTIONS_GAME, driver_index, 1);
+ o.set_value(s, software, OPTION_PRIORITY_CMDLINE);
+ //o.image_option(opt_name).specify(software);
+ printf("Done\n");
+ save_options(o, OPTIONS_GAME, driver_index);
+ }
+}
+
+void SetCurrentSoftwareTab(int val)
+{
+ settings.setter(MESSUI_SOFTWARE_TAB, val);
+}
+
+int GetCurrentSoftwareTab(void)
+{
+ return settings.int_value(MESSUI_SOFTWARE_TAB);
+}
+
+bool AreOptionsEqual(windows_options &opts1, windows_options &opts2)
+{
+ for (auto &curentry : opts1.entries())
+ {
+ if (curentry->type() != OPTION_HEADER)
+ {
+ const char *value = curentry->value();
+ const char *comp = opts2.value(curentry->name().c_str());
+ if (!value && !comp) // both empty, they are the same
+ {}
+ else
+ if (!value || !comp) // only one empty, they are different
+ return false;
+ else
+ if (strcmp(value, comp) != 0) // both not empty, do proper compare
+ return false;
+ }
+ }
+ return true;
+}
+
+void OptionsCopy(windows_options &source, windows_options &dest)
+{
+ for (auto &dest_entry : source.entries())
+ {
+ if (dest_entry->names().size() > 0)
+ {
+ // identify the source entry
+ const core_options::entry::shared_ptr source_entry = source.get_entry(dest_entry->name());
+ if (source_entry)
+ {
+ const char *value = source_entry->value();
+ if (value)
+ dest_entry->set_value(value, source_entry->priority(), true);
+ }
+ }
+ }
+}
diff --git a/docs/release/src/osd/winui/mui_opts.h b/docs/release/src/osd/winui/mui_opts.h
new file mode 100644
index 00000000000..e9beeb5c1d9
--- /dev/null
+++ b/docs/release/src/osd/winui/mui_opts.h
@@ -0,0 +1,543 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+#ifndef MUI_OPTS_H
+#define MUI_OPTS_H
+
+#include "winmain.h"
+#include "winui.h"
+
+// These help categorise the folders on the left side
+// This list is mainly for documentation, although a few are used in code
+typedef enum {
+ // Global types
+ OPTIONS_GLOBAL = 0,
+ OPTIONS_HORIZONTAL,
+ OPTIONS_VERTICAL,
+ OPTIONS_RASTER,
+ OPTIONS_VECTOR,
+ OPTIONS_LCD,
+ OPTIONS_ARCADE,
+ OPTIONS_CONSOLE,
+ OPTIONS_COMPUTER,
+ OPTIONS_OTHERSYS,
+ // Local types
+ OPTIONS_SOURCE,
+ OPTIONS_GPARENT,
+ OPTIONS_PARENT,
+ OPTIONS_GAME,
+ // EOF marker
+ OPTIONS_MAX
+} OPTIONS_TYPE;
+
+// List of columns in the main game list
+enum
+{
+ COLUMN_GAMES = 0,
+ COLUMN_SRCDRIVERS,
+ COLUMN_DIRECTORY,
+ COLUMN_TYPE,
+ COLUMN_ORIENTATION,
+ COLUMN_MANUFACTURER,
+ COLUMN_YEAR,
+ COLUMN_PLAYED,
+ COLUMN_PLAYTIME,
+ COLUMN_CLONE,
+ COLUMN_TRACKBALL,
+ COLUMN_SAMPLES,
+ COLUMN_ROMS,
+ COLUMN_MAX
+};
+
+#define LOCAL_OPTIONS -10
+#define GLOBAL_OPTIONS -1
+
+typedef struct
+{
+ int x, y, width, height;
+} AREA;
+
+typedef struct
+{
+ char *screen;
+ char *aspect;
+ char *resolution;
+ char *view;
+} ScreenParams;
+
+// List of artwork types to display in the screen shot area
+enum
+{
+ // these must match array of strings image_tabs_long_name in mui_opts.cpp
+ // if you add new Tabs, be sure to also add them to the ComboBox init in dialogs.cpp
+ TAB_ARTWORK = 0,
+ TAB_BOSSES,
+ TAB_CABINET,
+ TAB_CONTROL_PANEL,
+ TAB_COVER,
+ TAB_ENDS,
+ TAB_FLYER,
+ TAB_GAMEOVER,
+ TAB_HOWTO,
+ TAB_LOGO,
+ TAB_MARQUEE,
+ TAB_PCB,
+ TAB_SCORES,
+ TAB_SELECT,
+ TAB_SCREENSHOT,
+ TAB_TITLE,
+ TAB_VERSUS,
+ TAB_HISTORY,
+ MAX_TAB_TYPES,
+ BACKGROUND,
+ TAB_ALL,
+ TAB_NONE
+};
+// Because we have added the Options after MAX_TAB_TYPES, we have to subtract 3 here
+// (that's how many options we have after MAX_TAB_TYPES)
+#define TAB_SUBTRACT 3
+
+BOOL OptionsInit(void);
+
+#define OPTIONS_TYPE_GLOBAL -1
+#define OPTIONS_TYPE_FOLDER -2
+
+bool AreOptionsEqual(windows_options &opts1, windows_options &opts2);
+void OptionsCopy(windows_options &source, windows_options &dest);
+void SetDirectories(windows_options &opts);
+
+void load_options(windows_options &opts, OPTIONS_TYPE opt_type, int game_num, bool set_system_name);
+void save_options(windows_options &opts, OPTIONS_TYPE opt_type, int game_num);
+
+void SetSystemName(windows_options &opts, OPTIONS_TYPE opt_type, int driver_index);
+
+windows_options &MameUIGlobal(void);
+
+void LoadFolderFlags(void);
+
+// Start interface to directories.h
+const string GetRomDirs(void);
+void SetRomDirs(const char *paths);
+
+const string GetSampleDirs(void);
+void SetSampleDirs(const char *paths);
+
+const string GetArtDir(void);
+void SetArtDir(const char *path);
+
+const string GetArtworkDir(void);
+void SetArtworkDir(const char *path);
+
+const string GetBossesDir(void);
+void SetBossesDir(const char *path);
+
+const string GetCabinetDir(void);
+void SetCabinetDir(const char *path);
+
+const string GetCheatDir(void);
+void SetCheatDir(const char *path);
+
+const string GetCfgDir(void);
+void SetCfgDir(const char *path);
+
+const string GetControlPanelDir(void);
+void SetControlPanelDir(const char *path);
+
+const string GetCoversDir(void);
+void SetCoversDir(const char *path);
+
+const string GetCtrlrDir(void);
+void SetCtrlrDir(const char *path);
+
+const string GetCrosshairDir(void);
+void SetCrosshairDir(const char *paths);
+
+const string GetDatsDir(void);
+void SetDatsDir(const char *path);
+
+const string GetDiffDir(void);
+void SetDiffDir(const char *path);
+
+const string GetEndsDir(void);
+void SetEndsDir(const char *path);
+
+const string GetFlyerDir(void);
+void SetFlyerDir(const char *path);
+
+const string GetFolderDir(void);
+void SetFolderDir(const char *path);
+
+const string GetFontDir(void);
+void SetFontDir(const char *paths);
+
+const string GetGameOverDir(void);
+void SetGameOverDir(const char *path);
+
+const string GetHashDirs(void);
+void SetHashDirs(const char *paths);
+
+const string GetHLSLDir(void);
+void SetHLSLDir(const char *path);
+
+const string GetHowToDir(void);
+void SetHowToDir(const char *path);
+
+const string GetIconsDir(void);
+void SetIconsDir(const char *path);
+
+const string GetImgDir(void);
+void SetImgDir(const char *path);
+
+const char *GetIniDir(void);
+void SetIniDir(const char *path);
+
+const string GetInpDir(void);
+void SetInpDir(const char *path);
+
+const string GetLangDir(void);
+void SetLangDir(const char *path);
+
+const string GetLogoDir(void);
+void SetLogoDir(const char *path);
+
+const string GetManualsDir(void);
+void SetManualsDir(const char* path);
+
+const string GetMarqueeDir(void);
+void SetMarqueeDir(const char *path);
+
+const string GetNvramDir(void);
+void SetNvramDir(const char *path);
+
+const string GetPcbDir(void);
+void SetPcbDir(const char *path);
+
+const string GetPluginsDir(void);
+void SetPluginsDir(const char *path);
+
+const string GetScoresDir(void);
+void SetScoresDir(const char *path);
+
+const string GetStateDir(void);
+void SetStateDir(const char *path);
+
+const string GetTitlesDir(void);
+void SetTitlesDir(const char *path);
+
+const string GetSelectDir(void);
+void SetSelectDir(const char *path);
+
+const string GetSWDir(void);
+void SetSWDir(const char *path);
+
+const string GetVersusDir(void);
+void SetVersusDir(const char *path);
+
+const string GetVideoDir(void);
+void SetVideoDir(const char *path);
+
+// End interface to directories.h
+
+void SaveOptions(void);
+void SaveDefaultOptions(void);
+void SaveGameListOptions(void);
+
+void ResetGUI(void);
+void ResetGameDefaults(void);
+void ResetAllGameOptions(void);
+
+const char * GetImageTabLongName(int tab_index);
+const char * GetImageTabShortName(int tab_index);
+
+void SetViewMode(int val);
+int GetViewMode(void);
+
+void SetGameCheck(BOOL game_check);
+BOOL GetGameCheck(void);
+
+void SetJoyGUI(BOOL use_joygui);
+BOOL GetJoyGUI(void);
+
+void SetKeyGUI(BOOL use_keygui);
+BOOL GetKeyGUI(void);
+
+void SetCycleScreenshot(int cycle_screenshot);
+int GetCycleScreenshot(void);
+
+void SetStretchScreenShotLarger(BOOL stretch);
+BOOL GetStretchScreenShotLarger(void);
+
+void SetScreenshotBorderSize(int size);
+int GetScreenshotBorderSize(void);
+
+void SetScreenshotBorderColor(COLORREF uColor);
+COLORREF GetScreenshotBorderColor(void);
+
+void SetFilterInherit(BOOL inherit);
+BOOL GetFilterInherit(void);
+
+void SetOffsetClones(BOOL offset);
+BOOL GetOffsetClones(void);
+
+void SetSavedFolderID(UINT val);
+UINT GetSavedFolderID(void);
+
+void SetOverrideRedX(BOOL val);
+BOOL GetOverrideRedX(void);
+
+BOOL GetShowFolder(int folder);
+void SetShowFolder(int folder,BOOL show);
+
+void SetShowStatusBar(BOOL val);
+BOOL GetShowStatusBar(void);
+
+void SetShowToolBar(BOOL val);
+BOOL GetShowToolBar(void);
+
+void SetShowTabCtrl(BOOL val);
+BOOL GetShowTabCtrl(void);
+
+void SetCurrentTab(int val);
+int GetCurrentTab(void);
+
+void SetDefaultGame(uint32_t val);
+uint32_t GetDefaultGame(void);
+
+void SetWindowArea(const AREA *area);
+void GetWindowArea(AREA *area);
+
+void SetWindowState(UINT state);
+UINT GetWindowState(void);
+
+void SetWindowPanes(int val);
+UINT GetWindowPanes(void);
+
+void SetColumnWidths(int widths[]);
+void GetColumnWidths(int widths[]);
+
+void SetColumnOrder(int order[]);
+void GetColumnOrder(int order[]);
+
+void SetColumnShown(int shown[]);
+void GetColumnShown(int shown[]);
+
+void SetSplitterPos(int splitterId, int pos);
+int GetSplitterPos(int splitterId);
+
+void SetCustomColor(int iIndex, COLORREF uColor);
+COLORREF GetCustomColor(int iIndex);
+
+void SetListFont(const LOGFONT *font);
+void GetListFont(LOGFONT *font);
+
+DWORD GetFolderFlags(int folder_index);
+
+void SetListFontColor(COLORREF uColor);
+COLORREF GetListFontColor(void);
+
+void SetListCloneColor(COLORREF uColor);
+COLORREF GetListCloneColor(void);
+
+int GetHistoryTab(void);
+void SetHistoryTab(int tab,BOOL show);
+
+int GetShowTab(int tab);
+void SetShowTab(int tab,BOOL show);
+BOOL AllowedToSetShowTab(int tab,BOOL show);
+
+void SetSortColumn(int column);
+int GetSortColumn(void);
+
+void SetSortReverse(BOOL reverse);
+BOOL GetSortReverse(void);
+
+const char *GetLanguageUI(void);
+
+bool GetEnablePlugins(void);
+
+const char *GetPlugins(void);
+
+const char *GetSnapName(void);
+void SetSnapName(const char *pattern);
+
+const string GetBgDir(void);
+void SetBgDir(const char *path);
+
+void ResetGameOptions(int driver_index);
+
+int GetRomAuditResults(uint32_t driver_index);
+void SetRomAuditResults(uint32_t driver_index, int audit_results);
+
+int GetSampleAuditResults(uint32_t driver_index);
+void SetSampleAuditResults(uint32_t driver_index, int audit_results);
+
+void IncrementPlayCount(uint32_t driver_index);
+uint32_t GetPlayCount(uint32_t driver_index);
+void ResetPlayCount(int driver_index);
+
+void IncrementPlayTime(uint32_t driver_index, uint32_t playtime);
+uint32_t GetPlayTime(uint32_t driver_index);
+void GetTextPlayTime(uint32_t driver_index, char *buf);
+void ResetPlayTime(int driver_index);
+
+const char * GetVersionString(void);
+
+bool DriverHasSoftware(uint32_t drvindex);
+
+void SaveDefaultOptions(void);
+
+BOOL IsGlobalOption(const char *option_name);
+
+
+
+// Keyboard control of ui
+input_seq* Get_ui_key_up(void);
+input_seq* Get_ui_key_down(void);
+input_seq* Get_ui_key_left(void);
+input_seq* Get_ui_key_right(void);
+input_seq* Get_ui_key_start(void);
+input_seq* Get_ui_key_pgup(void);
+input_seq* Get_ui_key_pgdwn(void);
+input_seq* Get_ui_key_home(void);
+input_seq* Get_ui_key_end(void);
+input_seq* Get_ui_key_ss_change(void);
+input_seq* Get_ui_key_history_up(void);
+input_seq* Get_ui_key_history_down(void);
+
+input_seq* Get_ui_key_context_filters(void);
+input_seq* Get_ui_key_select_random(void);
+input_seq* Get_ui_key_game_audit(void);
+input_seq* Get_ui_key_game_properties(void);
+input_seq* Get_ui_key_help_contents(void);
+input_seq* Get_ui_key_update_gamelist(void);
+input_seq* Get_ui_key_view_folders(void);
+input_seq* Get_ui_key_view_fullscreen(void);
+input_seq* Get_ui_key_view_pagetab(void);
+input_seq* Get_ui_key_view_picture_area(void);
+input_seq* Get_ui_key_view_software_area(void);
+input_seq* Get_ui_key_view_status(void);
+input_seq* Get_ui_key_view_toolbars(void);
+
+input_seq* Get_ui_key_view_tab_cabinet(void);
+input_seq* Get_ui_key_view_tab_cpanel(void);
+input_seq* Get_ui_key_view_tab_flyer(void);
+input_seq* Get_ui_key_view_tab_history(void);
+input_seq* Get_ui_key_view_tab_marquee(void);
+input_seq* Get_ui_key_view_tab_screenshot(void);
+input_seq* Get_ui_key_view_tab_title(void);
+input_seq* Get_ui_key_view_tab_pcb(void);
+input_seq* Get_ui_key_quit(void);
+
+
+int GetUIJoyUp(int joycodeIndex);
+void SetUIJoyUp(int joycodeIndex, int val);
+
+int GetUIJoyDown(int joycodeIndex);
+void SetUIJoyDown(int joycodeIndex, int val);
+
+int GetUIJoyLeft(int joycodeIndex);
+void SetUIJoyLeft(int joycodeIndex, int val);
+
+int GetUIJoyRight(int joycodeIndex);
+void SetUIJoyRight(int joycodeIndex, int val);
+
+int GetUIJoyStart(int joycodeIndex);
+void SetUIJoyStart(int joycodeIndex, int val);
+
+int GetUIJoyPageUp(int joycodeIndex);
+void SetUIJoyPageUp(int joycodeIndex, int val);
+
+int GetUIJoyPageDown(int joycodeIndex);
+void SetUIJoyPageDown(int joycodeIndex, int val);
+
+int GetUIJoyHome(int joycodeIndex);
+void SetUIJoyHome(int joycodeIndex, int val);
+
+int GetUIJoyEnd(int joycodeIndex);
+void SetUIJoyEnd(int joycodeIndex, int val);
+
+int GetUIJoySSChange(int joycodeIndex);
+void SetUIJoySSChange(int joycodeIndex, int val);
+
+int GetUIJoyHistoryUp(int joycodeIndex);
+void SetUIJoyHistoryUp(int joycodeIndex, int val);
+
+int GetUIJoyHistoryDown(int joycodeIndex);
+void SetUIJoyHistoryDown(int joycodeIndex, int val);
+
+int GetUIJoyExec(int joycodeIndex);
+void SetUIJoyExec(int joycodeIndex, int val);
+
+const string GetExecCommand(void);
+void SetExecCommand(char *cmd);
+
+int GetExecWait(void);
+void SetExecWait(int wait);
+
+BOOL GetHideMouseOnStartup(void);
+void SetHideMouseOnStartup(BOOL hide);
+
+BOOL GetRunFullScreen(void);
+void SetRunFullScreen(BOOL fullScreen);
+
+uint32_t GetDriverCacheLower(uint32_t driver_index);
+uint32_t GetDriverCacheUpper(uint32_t driver_index);
+void SetDriverCache(uint32_t driver_index, uint32_t val);
+BOOL RequiredDriverCache(void);
+void ForceRebuild(void);
+BOOL DriverIsComputer(uint32_t driver_index);
+BOOL DriverIsConsole(uint32_t driver_index);
+BOOL DriverIsModified(uint32_t driver_index);
+BOOL DriverIsImperfect(uint32_t driver_index);
+string GetGameName(uint32_t driver_index);
+
+// from optionsms.h (MESSUI)
+
+enum
+{
+ SW_COLUMN_IMAGES,
+ SW_COLUMN_MAX
+};
+
+enum
+{
+ SL_COLUMN_IMAGES,
+ SL_COLUMN_GOODNAME,
+ SL_COLUMN_MANUFACTURER,
+ SL_COLUMN_YEAR,
+ SL_COLUMN_PLAYABLE,
+ SL_COLUMN_USAGE,
+ SL_COLUMN_MAX
+};
+
+void SetSWColumnWidths(int widths[]);
+void GetSWColumnWidths(int widths[]);
+void SetSWColumnOrder(int order[]);
+void GetSWColumnOrder(int order[]);
+void SetSWColumnShown(int shown[]);
+void GetSWColumnShown(int shown[]);
+void SetSWSortColumn(int column);
+int GetSWSortColumn(void);
+void SetSWSortReverse(BOOL reverse);
+BOOL GetSWSortReverse(void);
+
+void SetSLColumnWidths(int widths[]);
+void GetSLColumnWidths(int widths[]);
+void SetSLColumnOrder(int order[]);
+void GetSLColumnOrder(int order[]);
+void SetSLColumnShown(int shown[]);
+void GetSLColumnShown(int shown[]);
+void SetSLSortColumn(int column);
+int GetSLSortColumn(void);
+void SetSLSortReverse(BOOL reverse);
+BOOL GetSLSortReverse(void);
+
+void SetSelectedSoftware(int driver_index, string opt_name, const char *software);
+
+void SetCurrentSoftwareTab(int val);
+int GetCurrentSoftwareTab(void);
+
+
+#endif
+
diff --git a/docs/release/src/osd/winui/mui_util.cpp b/docs/release/src/osd/winui/mui_util.cpp
new file mode 100644
index 00000000000..cfe6f8d8f86
--- /dev/null
+++ b/docs/release/src/osd/winui/mui_util.cpp
@@ -0,0 +1,859 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ mui_util.cpp
+
+ ***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+#include <shellapi.h>
+
+// standard C headers
+#include <tchar.h>
+
+// MAME/MAMEUI headers
+#include "emu.h"
+#include "screen.h"
+#include "speaker.h"
+#include "unzip.h"
+#include "sound/samples.h"
+#include "winutf8.h"
+#include "winui.h"
+#include "mui_util.h"
+#include "mui_opts.h"
+#include "drivenum.h"
+#include "machine/ram.h"
+
+#include <shlwapi.h>
+
+/***************************************************************************
+ function prototypes
+ ***************************************************************************/
+
+/***************************************************************************
+ External variables
+ ***************************************************************************/
+
+/***************************************************************************
+ Internal structures
+ ***************************************************************************/
+struct DriversInfo
+{
+ int screenCount;
+ bool isClone;
+ bool isBroken;
+ bool isHarddisk;
+ bool hasOptionalBIOS;
+ bool isStereo;
+ bool isVector;
+ bool usesRoms;
+ bool usesSamples;
+ bool usesTrackball;
+ bool usesLightGun;
+ bool usesMouse;
+ bool supportsSaveState;
+ bool isVertical;
+ bool hasRam;
+};
+
+static std::vector<DriversInfo> drivers_info;
+static bool bFirst = true;
+
+
+enum
+{
+ DRIVER_CACHE_SCREEN = 0x000F,
+ DRIVER_CACHE_ROMS = 0x0010,
+ DRIVER_CACHE_CLONE = 0x0020,
+ DRIVER_CACHE_STEREO = 0x0040,
+ DRIVER_CACHE_BIOS = 0x0080,
+ DRIVER_CACHE_TRACKBALL = 0x0100,
+ DRIVER_CACHE_HARDDISK = 0x0200,
+ DRIVER_CACHE_SAMPLES = 0x0400,
+ DRIVER_CACHE_LIGHTGUN = 0x0800,
+ DRIVER_CACHE_VECTOR = 0x1000,
+ DRIVER_CACHE_MOUSE = 0x2000,
+ DRIVER_CACHE_RAM = 0x4000,
+};
+
+/***************************************************************************
+ External functions
+ ***************************************************************************/
+
+/*
+ ErrorMsg
+*/
+void __cdecl ErrorMsg(const char* fmt, ...)
+{
+ static FILE* pFile = NULL;
+ DWORD dwWritten;
+ char buf[5000];
+ char buf2[5000];
+ va_list va;
+
+ va_start(va, fmt);
+
+ vsprintf(buf, fmt, va);
+
+ win_message_box_utf8(GetActiveWindow(), buf, MAMEUINAME, MB_OK | MB_ICONERROR);
+
+ strcpy(buf2, MAMEUINAME ": ");
+ strcat(buf2,buf);
+ strcat(buf2, "\n");
+
+ WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buf2, strlen(buf2), &dwWritten, NULL);
+
+ if (pFile == NULL)
+ pFile = fopen("debug.txt", "wt");
+
+ if (pFile != NULL)
+ {
+ fprintf(pFile, "%s", buf2);
+ fflush(pFile);
+ }
+
+ va_end(va);
+}
+
+void __cdecl dprintf(const char* fmt, ...)
+{
+ char buf[5000];
+ va_list va;
+
+ va_start(va, fmt);
+
+ _vsnprintf(buf,sizeof(buf),fmt,va);
+
+ win_output_debug_string_utf8(buf);
+
+ va_end(va);
+}
+
+//============================================================
+// winui_message_box_utf8
+//============================================================
+
+int winui_message_box_utf8(HWND hWnd, const char *text, const char *caption, UINT type)
+{
+ int result = IDCANCEL;
+ wchar_t *t_text = ui_wstring_from_utf8(text);
+ wchar_t *t_caption = ui_wstring_from_utf8(caption);
+
+ if (!t_text)
+ return result;
+
+ if (!t_caption)
+ {
+ free(t_text);
+ return result;
+ }
+
+ result = MessageBox(hWnd, t_text, t_caption, type);
+ free(t_text);
+ free(t_caption);
+ return result;
+}
+
+void ErrorMessageBox(const char *fmt, ...)
+{
+ char buf[1024];
+ va_list ptr;
+
+ va_start(ptr, fmt);
+ vsnprintf(buf, ARRAY_LENGTH(buf), fmt, ptr);
+ winui_message_box_utf8(GetMainWindow(), buf, MAMEUINAME, MB_ICONERROR | MB_OK);
+ va_end(ptr);
+}
+
+void ShellExecuteCommon(HWND hWnd, const char *cName)
+{
+ wchar_t *tName = ui_wstring_from_utf8(cName);
+
+ if(!tName)
+ return;
+
+ HINSTANCE hErr = ShellExecute(hWnd, NULL, tName, NULL, NULL, SW_SHOWNORMAL);
+
+ if ((uintptr_t)hErr > 32)
+ {
+ free(tName);
+ return;
+ }
+
+ const char *msg = NULL;
+ switch((uintptr_t)hErr)
+ {
+ case 0:
+ msg = "The Operating System is out of memory or resources.";
+ break;
+
+ case ERROR_FILE_NOT_FOUND:
+ msg = "The specified file was not found.";
+ break;
+
+ case SE_ERR_NOASSOC :
+ msg = "There is no application associated with the given filename extension.";
+ break;
+
+ case SE_ERR_OOM :
+ msg = "There was not enough memory to complete the operation.";
+ break;
+
+ case SE_ERR_PNF :
+ msg = "The specified path was not found.";
+ break;
+
+ case SE_ERR_SHARE :
+ msg = "A sharing violation occurred.";
+ break;
+
+ default:
+ msg = "Unknown error.";
+ }
+
+ ErrorMessageBox("%s\r\nPath: '%s'", msg, cName);
+ free(tName);
+}
+
+UINT GetDepth(HWND hWnd)
+{
+ UINT nBPP;
+ HDC hDC;
+
+ hDC = GetDC(hWnd);
+
+ nBPP = GetDeviceCaps(hDC, BITSPIXEL) * GetDeviceCaps(hDC, PLANES);
+
+ ReleaseDC(hWnd, hDC);
+
+ return nBPP;
+}
+
+/*
+ * Return true if comctl32.dll is version 4.71 or greater
+ * otherwise return false.
+ */
+LONG GetCommonControlVersion()
+{
+ HMODULE hModule = GetModuleHandle(TEXT("comctl32"));
+
+ if (hModule)
+ {
+ FARPROC lpfnICCE = GetProcAddress(hModule, "InitCommonControlsEx");
+
+ if (NULL != lpfnICCE)
+ {
+ FARPROC lpfnDLLI = GetProcAddress(hModule, "DllInstall");
+
+ if (NULL != lpfnDLLI)
+ {
+ /* comctl 4.71 or greater */
+
+ // see if we can find out exactly
+
+ DLLGETVERSIONPROC pDllGetVersion;
+ pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hModule, "DllGetVersion");
+
+ /* Because some DLLs might not implement this function, you
+ must test for it explicitly. Depending on the particular
+ DLL, the lack of a DllGetVersion function can be a useful
+ indicator of the version. */
+
+ if(pDllGetVersion)
+ {
+ DLLVERSIONINFO dvi;
+ HRESULT hr;
+
+ ZeroMemory(&dvi, sizeof(dvi));
+ dvi.cbSize = sizeof(dvi);
+
+ hr = (*pDllGetVersion)(&dvi);
+
+ if (SUCCEEDED(hr))
+ {
+ return PACKVERSION(dvi.dwMajorVersion, dvi.dwMinorVersion);
+ }
+ }
+ return PACKVERSION(4,71);
+ }
+ return PACKVERSION(4,7);
+ }
+ return PACKVERSION(4,0);
+ }
+ /* DLL not found */
+ return PACKVERSION(0,0);
+}
+
+void DisplayTextFile(HWND hWnd, const char *cName)
+{
+ LPTSTR tName = ui_wstring_from_utf8(cName);
+ if( !tName )
+ return;
+
+ HINSTANCE hErr = ShellExecute(hWnd, NULL, tName, NULL, NULL, SW_SHOWNORMAL);
+ if ((uintptr_t)hErr > 32)
+ {
+ free(tName);
+ return;
+ }
+
+ LPCTSTR msg = 0;
+ switch((uintptr_t)hErr)
+ {
+ case 0:
+ msg = TEXT("The operating system is out of memory or resources.");
+ break;
+
+ case ERROR_FILE_NOT_FOUND:
+ msg = TEXT("The specified file was not found.");
+ break;
+
+ case SE_ERR_NOASSOC :
+ msg = TEXT("There is no application associated with the given filename extension.");
+ break;
+
+ case SE_ERR_OOM :
+ msg = TEXT("There was not enough memory to complete the operation.");
+ break;
+
+ case SE_ERR_PNF :
+ msg = TEXT("The specified path was not found.");
+ break;
+
+ case SE_ERR_SHARE :
+ msg = TEXT("A sharing violation occurred.");
+ break;
+
+ default:
+ msg = TEXT("Unknown error.");
+ }
+
+ MessageBox(NULL, msg, tName, MB_OK);
+
+ free(tName);
+}
+
+char* MyStrStrI(const char* pFirst, const char* pSrch)
+{
+ char* cp = (char*)pFirst;
+ char* s1;
+ char* s2;
+
+ while (*cp)
+ {
+ s1 = cp;
+ s2 = (char*)pSrch;
+
+ while (*s1 && *s2 && !core_strnicmp(s1, s2, 1))
+ s1++, s2++;
+
+ if (!*s2)
+ return cp;
+
+ cp++;
+ }
+ return NULL;
+}
+
+char * ConvertToWindowsNewlines(const char *source)
+{
+ static char buf[2048 * 2048];
+ char *dest;
+
+ dest = buf;
+ while (*source != 0)
+ {
+ if (*source == '\n')
+ {
+ *dest++ = '\r';
+ *dest++ = '\n';
+ }
+ else
+ *dest++ = *source;
+ source++;
+ }
+ *dest = 0;
+ return buf;
+}
+
+/* Lop off path and extention from a source file name
+ * This assumes their is a pathname passed to the function
+ * like src\drivers\blah.c
+ */
+const char * GetDriverFilename(uint32_t nIndex)
+{
+ static char tmp[2048];
+ std::string driver = core_filename_extract_base(driver_list::driver(nIndex).type.source());
+ strcpy(tmp, driver.c_str());
+ return tmp;
+}
+
+BOOL isDriverVector(const machine_config *config)
+{
+ const screen_device *screen = screen_device_iterator(config->root_device()).first();
+
+ if (screen)
+ if (SCREEN_TYPE_VECTOR == screen->screen_type())
+ return true;
+
+ return false;
+}
+
+int numberOfScreens(const machine_config *config)
+{
+ screen_device_iterator scriter(config->root_device());
+ return scriter.count();
+}
+
+int numberOfSpeakers(const machine_config *config)
+{
+ speaker_device_iterator iter(config->root_device());
+ return iter.count();
+}
+
+static void SetDriversInfo(void)
+{
+ uint32_t cache;
+ uint32_t total = driver_list::total();
+ struct DriversInfo *gameinfo = NULL;
+
+ for (uint32_t ndriver = 0; ndriver < total; ndriver++)
+ {
+ gameinfo = &drivers_info[ndriver];
+ cache = gameinfo->screenCount & DRIVER_CACHE_SCREEN;
+
+ if (gameinfo->isClone)
+ cache += DRIVER_CACHE_CLONE;
+
+ if (gameinfo->isHarddisk)
+ cache += DRIVER_CACHE_HARDDISK;
+
+ if (gameinfo->hasOptionalBIOS)
+ cache += DRIVER_CACHE_BIOS;
+
+ if (gameinfo->isStereo)
+ cache += DRIVER_CACHE_STEREO;
+
+ if (gameinfo->isVector)
+ cache += DRIVER_CACHE_VECTOR;
+
+ if (gameinfo->usesRoms)
+ cache += DRIVER_CACHE_ROMS;
+
+ if (gameinfo->usesSamples)
+ cache += DRIVER_CACHE_SAMPLES;
+
+ if (gameinfo->usesTrackball)
+ cache += DRIVER_CACHE_TRACKBALL;
+
+ if (gameinfo->usesLightGun)
+ cache += DRIVER_CACHE_LIGHTGUN;
+
+ if (gameinfo->usesMouse)
+ cache += DRIVER_CACHE_MOUSE;
+
+ if (gameinfo->hasRam)
+ cache += DRIVER_CACHE_RAM;
+
+ SetDriverCache(ndriver, cache);
+ }
+}
+
+static void InitDriversInfo(void)
+{
+ printf("InitDriversInfo: A\n");fflush(stdout);
+ int num_speakers;
+ uint32_t total = driver_list::total();
+ const game_driver *gamedrv = NULL;
+ struct DriversInfo *gameinfo = NULL;
+ const rom_entry *region, *rom;
+
+ for (uint32_t ndriver = 0; ndriver < total; ndriver++)
+ {
+ uint32_t cache = GetDriverCacheLower(ndriver);
+ gamedrv = &driver_list::driver(ndriver);
+ gameinfo = &drivers_info[ndriver];
+ machine_config config(*gamedrv, MameUIGlobal());
+
+ bool const have_parent(strcmp(gamedrv->parent, "0"));
+ auto const parent_idx(have_parent ? driver_list::find(gamedrv->parent) : -1);
+ gameinfo->isClone = ( !have_parent || (0 > parent_idx) || BIT(GetDriverCacheLower(parent_idx),9)) ? false : true;
+ gameinfo->isBroken = (cache & 0x4040) ? true : false; // (MACHINE_NOT_WORKING | MACHINE_MECHANICAL)
+ gameinfo->supportsSaveState = BIT(cache, 7) ^ 1; //MACHINE_SUPPORTS_SAVE
+ gameinfo->isHarddisk = false;
+ gameinfo->isVertical = BIT(cache, 2); //ORIENTATION_SWAP_XY
+
+ ram_device_iterator iter1(config.root_device());
+ gameinfo->hasRam = (iter1.first() );
+
+ for (device_t &device : device_iterator(config.root_device()))
+ for (region = rom_first_region(device); region; region = rom_next_region(region))
+ if (ROMREGION_ISDISKDATA(region))
+ gameinfo->isHarddisk = true;
+
+ gameinfo->hasOptionalBIOS = false;
+ if (gamedrv->rom)
+ {
+ auto rom_entries = rom_build_entries(gamedrv->rom);
+ for (rom = rom_entries.data(); !ROMENTRY_ISEND(rom); rom++)
+ if (ROMENTRY_ISSYSTEM_BIOS(rom))
+ gameinfo->hasOptionalBIOS = true;
+ }
+
+ num_speakers = numberOfSpeakers(&config);
+
+ gameinfo->isStereo = (num_speakers > 1);
+ gameinfo->screenCount = numberOfScreens(&config);
+ gameinfo->isVector = isDriverVector(&config); // ((drv.video_attributes & VIDEO_TYPE_VECTOR) != 0);
+ gameinfo->usesRoms = false;
+ for (device_t &device : device_iterator(config.root_device()))
+ for (region = rom_first_region(device); region; region = rom_next_region(region))
+ for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ gameinfo->usesRoms = true;
+
+ samples_device_iterator iter(config.root_device());
+ gameinfo->usesSamples = iter.count() ? true : false;
+
+ gameinfo->usesTrackball = false;
+ gameinfo->usesLightGun = false;
+ gameinfo->usesMouse = false;
+
+ if (gamedrv->ipt)
+ {
+ ioport_list portlist;
+ std::string errors;
+ for (device_t &cfg : device_iterator(config.root_device()))
+ if (cfg.input_ports())
+ portlist.append(cfg, errors);
+
+ for (auto &port : portlist)
+ {
+ for (ioport_field &field : port.second->fields())
+ {
+ UINT32 type;
+ type = field.type();
+ if (type == IPT_END)
+ break;
+ if (type == IPT_DIAL || type == IPT_PADDLE || type == IPT_TRACKBALL_X || type == IPT_TRACKBALL_Y || type == IPT_AD_STICK_X || type == IPT_AD_STICK_Y)
+ gameinfo->usesTrackball = true;
+ if (type == IPT_LIGHTGUN_X || type == IPT_LIGHTGUN_Y)
+ gameinfo->usesLightGun = true;
+ if (type == IPT_MOUSE_X || type == IPT_MOUSE_Y)
+ gameinfo->usesMouse = true;
+ }
+ }
+ }
+ }
+
+ SetDriversInfo();
+ printf("InitDriversInfo: Finished\n");fflush(stdout);
+}
+
+static int InitDriversCache(void)
+{
+ printf("InitDriversCache: A\n");fflush(stdout);
+ if (RequiredDriverCache())
+ {
+ printf("InitDriversCache: B\n");fflush(stdout);
+ InitDriversInfo();
+ return 0;
+ }
+
+ printf("InitDriversCache: C\n");fflush(stdout);
+ uint32_t cache_lower, cache_upper;
+ uint32_t total = driver_list::total();
+ struct DriversInfo *gameinfo = NULL;
+
+ printf("InitDriversCache: D\n");fflush(stdout);
+ for (uint32_t ndriver = 0; ndriver < total; ndriver++)
+ {
+ gameinfo = &drivers_info[ndriver];
+ cache_lower = GetDriverCacheLower(ndriver);
+ cache_upper = GetDriverCacheUpper(ndriver);
+
+ gameinfo->isBroken = (cache_lower & 0x4040) ? true : false; //MACHINE_NOT_WORKING | MACHINE_MECHANICAL
+ gameinfo->supportsSaveState = BIT(cache_lower, 7) ? false : true; //MACHINE_SUPPORTS_SAVE
+ gameinfo->isVertical = BIT(cache_lower, 2) ? true : false; //ORIENTATION_XY
+ gameinfo->screenCount = cache_upper & DRIVER_CACHE_SCREEN;
+ gameinfo->isClone = ((cache_upper & DRIVER_CACHE_CLONE) != 0);
+ gameinfo->isHarddisk = ((cache_upper & DRIVER_CACHE_HARDDISK) != 0);
+ gameinfo->hasOptionalBIOS = ((cache_upper & DRIVER_CACHE_BIOS) != 0);
+ gameinfo->isStereo = ((cache_upper & DRIVER_CACHE_STEREO) != 0);
+ gameinfo->isVector = ((cache_upper & DRIVER_CACHE_VECTOR) != 0);
+ gameinfo->usesRoms = ((cache_upper & DRIVER_CACHE_ROMS) != 0);
+ gameinfo->usesSamples = ((cache_upper & DRIVER_CACHE_SAMPLES) != 0);
+ gameinfo->usesTrackball = ((cache_upper & DRIVER_CACHE_TRACKBALL) != 0);
+ gameinfo->usesLightGun = ((cache_upper & DRIVER_CACHE_LIGHTGUN) != 0);
+ gameinfo->usesMouse = ((cache_upper & DRIVER_CACHE_MOUSE) != 0);
+ gameinfo->hasRam = ((cache_upper & DRIVER_CACHE_RAM) != 0);
+ }
+
+ printf("InitDriversCache: Finished\n");fflush(stdout);
+ return 0;
+}
+
+static struct DriversInfo* GetDriversInfo(uint32_t driver_index)
+{
+ if (bFirst)
+ {
+ bFirst = false;
+
+ drivers_info.clear();
+ drivers_info.resize(driver_list::total());
+ std::fill(drivers_info.begin(), drivers_info.end(), DriversInfo{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
+ printf("DriversInfo: B\n");fflush(stdout);
+ InitDriversCache();
+ }
+
+ return &drivers_info[driver_index];
+}
+
+BOOL DriverIsClone(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->isClone;
+}
+
+BOOL DriverIsBroken(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->isBroken;
+}
+
+BOOL DriverIsHarddisk(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->isHarddisk;
+}
+
+BOOL DriverIsBios(uint32_t driver_index)
+{
+ return BIT(GetDriverCacheLower(driver_index), 9);
+}
+
+BOOL DriverIsMechanical(uint32_t driver_index)
+{
+ return BIT(GetDriverCacheLower(driver_index), 14);
+}
+
+BOOL DriverIsArcade(uint32_t driver_index)
+{
+ return ((GetDriverCacheLower(driver_index) & 3) == 0) ? true: false; //TYPE_ARCADE
+}
+
+BOOL DriverHasOptionalBIOS(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->hasOptionalBIOS;
+}
+
+BOOL DriverIsStereo(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->isStereo;
+}
+
+int DriverNumScreens(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->screenCount;
+}
+
+BOOL DriverIsVector(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->isVector;
+}
+
+BOOL DriverUsesRoms(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->usesRoms;
+}
+
+BOOL DriverUsesSamples(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->usesSamples;
+}
+
+BOOL DriverUsesTrackball(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->usesTrackball;
+}
+
+BOOL DriverUsesLightGun(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->usesLightGun;
+}
+
+BOOL DriverUsesMouse(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->usesMouse;
+}
+
+BOOL DriverSupportsSaveState(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->supportsSaveState;
+}
+
+BOOL DriverIsVertical(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->isVertical;
+}
+
+BOOL DriverHasRam(uint32_t driver_index)
+{
+ return GetDriversInfo(driver_index)->hasRam;
+}
+
+void FlushFileCaches(void)
+{
+ util::archive_file::cache_clear();
+}
+
+BOOL StringIsSuffixedBy(const char *s, const char *suffix)
+{
+ return (strlen(s) > strlen(suffix)) && (strcmp(s + strlen(s) - strlen(suffix), suffix) == 0);
+}
+
+/***************************************************************************
+ Win32 wrappers
+ ***************************************************************************/
+
+BOOL SafeIsAppThemed(void)
+{
+ BOOL bResult = false;
+ BOOL (WINAPI *pfnIsAppThemed)(void);
+
+ HMODULE hThemes = LoadLibrary(TEXT("uxtheme.dll"));
+ if (hThemes)
+ {
+ pfnIsAppThemed = (BOOL (WINAPI *)(void)) GetProcAddress(hThemes, "IsAppThemed");
+ if (pfnIsAppThemed)
+ bResult = pfnIsAppThemed();
+ FreeLibrary(hThemes);
+ }
+ return bResult;
+
+}
+
+
+void GetSystemErrorMessage(DWORD dwErrorId, TCHAR **tErrorMessage)
+{
+ if( FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorId, 0, (LPTSTR)tErrorMessage, 0, NULL) == 0 )
+ {
+ *tErrorMessage = (LPTSTR)LocalAlloc(LPTR, MAX_PATH * sizeof(TCHAR));
+ _tcscpy(*tErrorMessage, TEXT("Unknown Error"));
+ }
+}
+
+
+//============================================================
+// win_extract_icon_utf8
+//============================================================
+
+HICON win_extract_icon_utf8(HINSTANCE inst, const char* exefilename, UINT iconindex)
+{
+ HICON icon = 0;
+ TCHAR* t_exefilename = ui_wstring_from_utf8(exefilename);
+ if( !t_exefilename )
+ return icon;
+
+ icon = ExtractIcon(inst, t_exefilename, iconindex);
+
+ free(t_exefilename);
+
+ return icon;
+}
+
+
+
+//============================================================
+// win_tstring_strdup
+//============================================================
+
+TCHAR* win_tstring_strdup(LPCTSTR str)
+{
+ TCHAR *cpy = NULL;
+ if (str)
+ {
+ cpy = (TCHAR*)malloc((_tcslen(str) + 1) * sizeof(TCHAR));
+ if (cpy)
+ _tcscpy(cpy, str);
+ }
+ return cpy;
+}
+
+//============================================================
+// win_create_file_utf8
+//============================================================
+
+HANDLE win_create_file_utf8(const char* filename, DWORD desiredmode, DWORD sharemode, LPSECURITY_ATTRIBUTES securityattributes,
+ DWORD creationdisposition, DWORD flagsandattributes, HANDLE templatehandle)
+{
+ HANDLE result = 0;
+ TCHAR* t_filename = ui_wstring_from_utf8(filename);
+ if( !t_filename )
+ return result;
+
+ result = CreateFile(t_filename, desiredmode, sharemode, securityattributes, creationdisposition, flagsandattributes, templatehandle);
+
+ free(t_filename);
+
+ return result;
+}
+
+//============================================================
+// win_get_current_directory_utf8
+//============================================================
+
+DWORD win_get_current_directory_utf8(DWORD bufferlength, char* buffer)
+{
+ DWORD result = 0;
+ TCHAR* t_buffer = NULL;
+
+ if( bufferlength > 0 )
+ {
+ t_buffer = (TCHAR*)malloc((bufferlength * sizeof(TCHAR)) + 1);
+ if( !t_buffer )
+ return result;
+ }
+
+ result = GetCurrentDirectory(bufferlength, t_buffer);
+
+ char* utf8_buffer = NULL;
+ if( bufferlength > 0 )
+ {
+ utf8_buffer = ui_utf8_from_wstring(t_buffer);
+ if( !utf8_buffer )
+ {
+ free(t_buffer);
+ return result;
+ }
+ }
+
+ strncpy(buffer, utf8_buffer, bufferlength);
+
+ if( utf8_buffer )
+ free(utf8_buffer);
+
+ if( t_buffer )
+ free(t_buffer);
+
+ return result;
+}
+
+//============================================================
+// win_find_first_file_utf8
+//============================================================
+
+HANDLE win_find_first_file_utf8(const char* filename, LPWIN32_FIND_DATA findfiledata)
+{
+ HANDLE result = 0;
+ TCHAR* t_filename = ui_wstring_from_utf8(filename);
+ if( !t_filename )
+ return result;
+
+ result = FindFirstFile(t_filename, findfiledata);
+
+ free(t_filename);
+
+ return result;
+}
+
diff --git a/docs/release/src/osd/winui/mui_util.h b/docs/release/src/osd/winui/mui_util.h
new file mode 100644
index 00000000000..0939f7338d1
--- /dev/null
+++ b/docs/release/src/osd/winui/mui_util.h
@@ -0,0 +1,102 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef MUI_UTIL_H
+#define MUI_UTIL_H
+
+#include "emucore.h"
+
+extern void __cdecl ErrorMsg(const char* fmt, ...);
+extern void __cdecl dprintf(const char* fmt, ...);
+
+
+extern UINT GetDepth(HWND hWnd);
+
+/* Open a text file */
+extern void DisplayTextFile(HWND hWnd, const char *cName);
+
+#define PACKVERSION(major,minor) MAKELONG(minor,major)
+
+/* Check for old version of comctl32.dll */
+extern LONG GetCommonControlVersion(void);
+
+void ShellExecuteCommon(HWND hWnd, const char *cName);
+extern char * MyStrStrI(const char* pFirst, const char* pSrch);
+extern char * ConvertToWindowsNewlines(const char *source);
+
+extern const char * GetDriverFilename(uint32_t nIndex);
+
+BOOL DriverIsClone(uint32_t driver_index);
+BOOL DriverIsBroken(uint32_t driver_index);
+BOOL DriverIsHarddisk(uint32_t driver_index);
+BOOL DriverHasOptionalBIOS(uint32_t driver_index);
+BOOL DriverIsStereo(uint32_t driver_index);
+BOOL DriverIsVector(uint32_t driver_index);
+int DriverNumScreens(uint32_t driver_index);
+BOOL DriverIsBios(uint32_t driver_index);
+BOOL DriverUsesRoms(uint32_t driver_index);
+BOOL DriverUsesSamples(uint32_t driver_index);
+BOOL DriverUsesTrackball(uint32_t driver_index);
+BOOL DriverUsesLightGun(uint32_t driver_index);
+BOOL DriverUsesMouse(uint32_t driver_index);
+BOOL DriverSupportsSaveState(uint32_t driver_index);
+BOOL DriverIsVertical(uint32_t driver_index);
+BOOL DriverIsMechanical(uint32_t driver_index);
+BOOL DriverIsArcade(uint32_t driver_index);
+BOOL DriverHasRam(uint32_t driver_index);
+
+int isDriverVector(const machine_config *config);
+int numberOfSpeakers(const machine_config *config);
+int numberOfScreens(const machine_config *config);
+
+void FlushFileCaches(void);
+
+BOOL StringIsSuffixedBy(const char *s, const char *suffix);
+
+BOOL SafeIsAppThemed(void);
+
+// provides result of FormatMessage()
+// resulting buffer must be free'd with LocalFree()
+void GetSystemErrorMessage(DWORD dwErrorId, TCHAR **tErrorMessage);
+
+HICON win_extract_icon_utf8(HINSTANCE inst, const char* exefilename, UINT iconindex);
+TCHAR* win_tstring_strdup(LPCTSTR str);
+HANDLE win_create_file_utf8(const char* filename, DWORD desiredmode, DWORD sharemode,
+ LPSECURITY_ATTRIBUTES securityattributes, DWORD creationdisposition,
+ DWORD flagsandattributes, HANDLE templatehandle);
+DWORD win_get_current_directory_utf8(DWORD bufferlength, char* buffer);
+HANDLE win_find_first_file_utf8(const char* filename, LPWIN32_FIND_DATA findfiledata);
+
+ // wstring_from_utf8
+ //============================================================
+
+WCHAR *ui_wstring_from_utf8(const char *utf8string)
+{
+ int char_count;
+ WCHAR *result;
+
+ // convert MAME string (UTF-8) to UTF-16
+ char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, nullptr, 0);
+ result = (WCHAR *)malloc(char_count * sizeof(*result));
+ if (result != nullptr)
+ MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count);
+
+ return result;
+}
+
+char *ui_utf8_from_wstring(const WCHAR *wstring)
+{
+ int char_count;
+ char *result;
+
+ // convert UTF-16 to MAME string (UTF-8)
+ char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, nullptr, 0, nullptr, nullptr);
+ result = (char *)malloc(char_count * sizeof(*result));
+ if (result != nullptr)
+ WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, nullptr, nullptr);
+ return result;
+}
+
+
+#endif /* MUI_UTIL_H */
+
diff --git a/docs/release/src/osd/winui/newui.h b/docs/release/src/osd/winui/newui.h
new file mode 100644
index 00000000000..3a8d0ec6aef
--- /dev/null
+++ b/docs/release/src/osd/winui/newui.h
@@ -0,0 +1,38 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+//============================================================
+//
+// newui.h - NEWUI
+//
+//============================================================
+
+#ifndef NEWUI_H
+#define NEWUI_H
+
+///// INCLUDES /////
+
+#include <windows.h>
+#include <commdlg.h>
+#include <tchar.h>
+#include "emu.h"
+#include "mame.h"
+#include "emuopts.h"
+#include "ui/ui.h"
+#include "newuires.h"
+#include "strconv.h"
+#include "natkeyboard.h"
+#include "imagedev/cassette.h"
+#include "windows/window.h"
+#include "winutf8.h"
+#include "modules/lib/osdobj_common.h"
+
+
+
+// These are called from src/osd/windows/windows.c and
+// provide the linkage between newui and the core.
+
+LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);
+
+int win_create_menu(running_machine &machine, HMENU *menus);
+
+#endif /* NEWUI_H */
diff --git a/docs/release/src/osd/winui/newuires.h b/docs/release/src/osd/winui/newuires.h
new file mode 100644
index 00000000000..aca0d2baccb
--- /dev/null
+++ b/docs/release/src/osd/winui/newuires.h
@@ -0,0 +1,64 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by mess.rc
+//
+#define ID_FILE_LOADSTATE_NEWUI 3101
+#define ID_FILE_SAVESTATE 3102
+#define ID_FILE_SAVESTATE_AS 3103
+#define ID_FILE_SAVESCREENSHOT 3104
+#define ID_FILE_EXIT_NEWUI 3105
+#define ID_EDIT_PASTE 3106
+#define ID_FILE_HIDEMENUBAR 3107
+#define ID_OPTIONS_KEYBOARD 3108
+#define ID_OPTIONS_CONFIGURATION 3109
+#define ID_OPTIONS_DIPSWITCHES 3110
+#define ID_OPTIONS_MISCINPUT 3111
+#define ID_OPTIONS_USEMOUSE 3112
+#define ID_FILE_TOGGLEMENUBAR 3113
+#define ID_OPTIONS_SOFTRESET 3114
+#define ID_OPTIONS_HARDRESET 3115
+#define ID_OPTIONS_FRAMESKIP 3116
+#define ID_OPTIONS_PAUSE 3117
+#define ID_OPTIONS_JOYSTICKS 3118
+#define ID_OPTIONS_ANALOGCONTROLS 3119
+#define ID_FILE_FULLSCREEN 3120
+#define ID_OPTIONS_TOGGLEFPS 3122
+#define ID_KEYBOARD_EMULATED 3124
+#define ID_KEYBOARD_NATURAL 3125
+#define ID_KEYBOARD_CUSTOMIZE 3126
+#define ID_VIDEO_ROTATE_0 3127
+#define ID_VIDEO_ROTATE_90 3128
+#define ID_VIDEO_ROTATE_180 3129
+#define ID_VIDEO_ROTATE_270 3130
+#define ID_THROTTLE_50 3131
+#define ID_THROTTLE_100 3132
+#define ID_THROTTLE_200 3133
+#define ID_THROTTLE_500 3134
+#define ID_THROTTLE_1000 3135
+#define ID_THROTTLE_UNTHROTTLED 3136
+#define ID_FRAMESKIP_AUTO 3137
+#define ID_DEVICES 3138
+#define ID_HELP_ABOUT_NEWUI 3139
+#define ID_HELP_ABOUTSYSTEM 3140
+#define ID_FILE_OLDUI 3141
+#define ID_FILE_UIACTIVE 3142
+#define IDC_SHOW_MENU 3143
+#define IDI_ICON_CART 3200
+#define IDI_ICON_HARD 3201
+#define IDI_ICON_CASS 3202
+#define IDI_ICON_FLOP 3203
+#define IDI_ICON_PRIN 3204
+#define IDI_ICON_SERL 3205
+#define IDI_ICON_SNAP 3206
+#define IDR_RUNTIME_MENU 3300
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 3144
+#define _APS_NEXT_COMMAND_VALUE 40008
+#define _APS_NEXT_CONTROL_VALUE 3306
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/docs/release/src/osd/winui/picker.cpp b/docs/release/src/osd/winui/picker.cpp
new file mode 100644
index 00000000000..300c63be467
--- /dev/null
+++ b/docs/release/src/osd/winui/picker.cpp
@@ -0,0 +1,1603 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+// standard windows headers
+#define _WIN32_IE 0x0501
+#include <windows.h>
+#include <windowsx.h>
+#include <commctrl.h>
+
+// standard C headers
+#include <tchar.h>
+
+// MAME/MAMEUI headers
+#include "picker.h"
+#include "winui.h"
+#include "mui_opts.h"
+#include "treeview.h"
+
+
+// fix warning: cast does not match function type
+#if defined(__GNUC__) && defined(ListView_GetHeader)
+#undef ListView_GetHeader
+#endif
+#if defined(__GNUC__) && defined(ListView_GetImageList)
+#undef ListView_GetImageList
+#undef ListView_GetItemRect
+#endif
+
+#ifndef ListView_GetItemRect
+#define ListView_GetItemRect(w,i,p,c) \
+ (BOOL)SNDMSG((w),LVM_GETITEMRECT,i,((p != NULL)?(((LPRECT)(p))->left=(c),(LPARAM)(LPRECT)(p)):0))
+#endif
+
+#ifndef ListView_GetImageList
+#define ListView_GetImageList(w,i) (HIMAGELIST)(LRESULT)(int)SendMessage((w),LVM_GETIMAGELIST,(i),0)
+#endif // ListView_GetImageList
+
+#ifndef ListView_GetHeader
+#define ListView_GetHeader(w) (HWND)(LRESULT)(int)SNDMSG((w),LVM_GETHEADER,0,0)
+#endif // ListView_GetHeader
+
+#ifndef HDM_SETIMAGELIST
+#define HDM_SETIMAGELIST (HDM_FIRST + 8)
+#endif // HDM_SETIMAGELIST
+
+#ifndef Header_SetImageList
+#define Header_SetImageList(h,i) (HIMAGELIST)(LRESULT)(int)SNDMSG((h), HDM_SETIMAGELIST, 0, (LPARAM)i)
+#endif // Header_SetImageList
+
+#ifndef HDF_SORTUP
+#define HDF_SORTUP 0x400
+#endif
+
+#ifndef HDF_SORTDOWN
+#define HDF_SORTDOWN 0x200
+#endif
+
+
+
+struct PickerInfo
+{
+ const struct PickerCallbacks *pCallbacks;
+ WNDPROC pfnParentWndProc;
+ int nCurrentViewID;
+ int nLastItem;
+ int nColumnCount;
+ int *pnColumnsShown;
+ int *pnColumnsOrder;
+ UINT_PTR nTimer;
+ const LPCTSTR *ppszColumnNames;
+};
+
+
+static struct PickerInfo *GetPickerInfo(HWND hWnd)
+{
+ LONG_PTR l = GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ return (struct PickerInfo *) l;
+}
+
+
+
+static LRESULT CallParentWndProc(WNDPROC pfnParentWndProc, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT rc;
+
+ if (!pfnParentWndProc)
+ pfnParentWndProc = GetPickerInfo(hWnd)->pfnParentWndProc;
+
+ if (IsWindowUnicode(hWnd))
+ rc = CallWindowProcW(pfnParentWndProc, hWnd, message, wParam, lParam);
+ else
+ rc = CallWindowProcA(pfnParentWndProc, hWnd, message, wParam, lParam);
+ return rc;
+}
+
+static BOOL ListViewOnErase(HWND hWnd, HDC hDC)
+{
+ MYBITMAPINFO *pbmDesc = GetBackgroundInfo();
+ HBITMAP hBackground = GetBackgroundBitmap();
+ HPALETTE hPALbg = GetBackgroundPalette();
+
+ // this does not draw the background properly in report view
+
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+
+ HDC htempDC = CreateCompatibleDC(hDC);
+ HBITMAP hOldBitmap = (HBITMAP)SelectObject(htempDC, hBackground);
+
+ HRGN rgnBitmap = CreateRectRgnIndirect(&rcClient);
+ SelectClipRgn(hDC, rgnBitmap);
+ DeleteBitmap(rgnBitmap);
+
+ HPALETTE hPAL = (!hPALbg) ? CreateHalftonePalette(hDC) : hPALbg;
+
+ if (GetDeviceCaps(htempDC, RASTERCAPS) & RC_PALETTE && hPAL != NULL)
+ {
+ SelectPalette(htempDC, hPAL, false);
+ RealizePalette(htempDC);
+ }
+
+ // Get x and y offset
+ POINT pt = {0,0};
+ MapWindowPoints(hWnd, GetTreeView(), &pt, 1);
+ POINT ptOrigin;
+ GetDCOrgEx(hDC, &ptOrigin);
+ ptOrigin.x -= pt.x;
+ ptOrigin.y -= pt.y;
+ ptOrigin.x = -GetScrollPos(hWnd, SB_HORZ);
+ ptOrigin.y = -GetScrollPos(hWnd, SB_VERT);
+
+ if (pbmDesc->bmWidth && pbmDesc->bmHeight)
+ for (int i = ptOrigin.x; i < rcClient.right; i += pbmDesc->bmWidth)
+ for (int j = ptOrigin.y; j < rcClient.bottom; j += pbmDesc->bmHeight)
+ BitBlt(hDC, i, j, pbmDesc->bmWidth, pbmDesc->bmHeight, htempDC, 0, 0, SRCCOPY);
+
+ SelectObject(htempDC, hOldBitmap);
+ DeleteDC(htempDC);
+
+ if (!pbmDesc->bmColors)
+ {
+ DeletePalette(hPAL);
+ hPAL = 0;
+ }
+
+ return true;
+}
+
+
+
+static BOOL ListViewNotify(HWND hWnd, LPNMHDR lpNmHdr)
+{
+ // This code is for using bitmap in the background
+ // Invalidate the right side of the control when a column is resized
+ if (lpNmHdr->code == HDN_ITEMCHANGINGA || lpNmHdr->code == HDN_ITEMCHANGINGW)
+ {
+ DWORD dwPos = GetMessagePos();
+ POINT pt;
+ pt.x = LOWORD(dwPos);
+ pt.y = HIWORD(dwPos);
+
+ RECT rcClient;
+ GetClientRect(hWnd, &rcClient);
+ ScreenToClient(hWnd, &pt);
+ rcClient.left = pt.x;
+ InvalidateRect(hWnd, &rcClient, false);
+ }
+ return false;
+}
+
+
+
+static BOOL ListViewContextMenu(HWND hwndPicker, LPARAM lParam)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hwndPicker);
+
+ // Extract the point out of the lparam
+ POINT pt;
+ pt.x = GET_X_LPARAM(lParam);
+ pt.y = GET_Y_LPARAM(lParam);
+ if (pt.x < 0 && pt.y < 0)
+ GetCursorPos(&pt);
+
+ // Figure out which header column was clicked, if at all
+ int nViewID = Picker_GetViewID(hwndPicker);
+ int nColumn = -1;
+
+ if ((nViewID == VIEW_REPORT) || (nViewID == VIEW_GROUPED))
+ {
+ HWND hwndHeader = ListView_GetHeader(hwndPicker);
+ POINT headerPt = pt;
+ ScreenToClient(hwndHeader, &headerPt);
+
+ RECT rcCol;
+ for (int i = 0; Header_GetItemRect(hwndHeader, i, &rcCol); i++)
+ {
+ if (PtInRect(&rcCol, headerPt))
+ {
+ nColumn = i;
+ break;
+ }
+ }
+ }
+
+ if (nColumn >= 0)
+ {
+ // A column header was clicked
+ if (pPickerInfo->pCallbacks->pfnOnHeaderContextMenu)
+ pPickerInfo->pCallbacks->pfnOnHeaderContextMenu(pt, nColumn);
+ }
+ else
+ {
+ // The body was clicked
+ if (pPickerInfo->pCallbacks->pfnOnBodyContextMenu)
+ pPickerInfo->pCallbacks->pfnOnBodyContextMenu(pt);
+ }
+ return true;
+}
+
+
+
+static void Picker_Free(struct PickerInfo *pPickerInfo)
+{
+ // Free up all resources associated with this picker structure
+ if (pPickerInfo->pnColumnsShown)
+ free(pPickerInfo->pnColumnsShown);
+ if (pPickerInfo->pnColumnsOrder)
+ free(pPickerInfo->pnColumnsOrder);
+ free(pPickerInfo);
+}
+
+
+
+static LRESULT CALLBACK ListViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ struct PickerInfo *pPickerInfo;
+ LRESULT rc = 0;
+ BOOL bHandled = false;
+ WNDPROC pfnParentWndProc;
+ HWND hwndHeaderCtrl = NULL;
+ HFONT hHeaderCtrlFont = NULL;
+
+ pPickerInfo = GetPickerInfo(hWnd);
+ pfnParentWndProc = pPickerInfo->pfnParentWndProc;
+
+ switch(message)
+ {
+ case WM_MOUSEMOVE:
+ if (MouseHasBeenMoved())
+ ShowCursor(true);
+ break;
+
+ case WM_ERASEBKGND:
+ if (GetBackgroundBitmap())
+ {
+ rc = ListViewOnErase(hWnd, (HDC) wParam);
+ bHandled = true;
+ }
+ break;
+
+ case WM_NOTIFY:
+ bHandled = ListViewNotify(hWnd, (LPNMHDR) lParam);
+ break;
+
+ case WM_SETFONT:
+ hwndHeaderCtrl = ListView_GetHeader(hWnd);
+ if (hwndHeaderCtrl)
+ hHeaderCtrlFont = GetWindowFont(hwndHeaderCtrl);
+ break;
+
+ case WM_CONTEXTMENU:
+ bHandled = ListViewContextMenu(hWnd, lParam);
+ break;
+
+ case WM_DESTROY:
+ // Received WM_DESTROY; time to clean up
+ if (pPickerInfo->pCallbacks->pfnSetViewMode)
+ pPickerInfo->pCallbacks->pfnSetViewMode(pPickerInfo->nCurrentViewID);
+ Picker_Free(pPickerInfo);
+ SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR) pfnParentWndProc);
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) NULL);
+ break;
+ }
+
+ if (!bHandled)
+ rc = CallParentWndProc(pfnParentWndProc, hWnd, message, wParam, lParam);
+
+ // If we received WM_SETFONT, reset header ctrl font back to original font
+ if (hwndHeaderCtrl)
+ SetWindowFont(hwndHeaderCtrl, hHeaderCtrlFont, true);
+
+ return rc;
+}
+
+
+
+// Re/initialize the ListControl Columns
+static void Picker_InternalResetColumnDisplay(HWND hWnd, BOOL bFirstTime)
+{
+ LV_COLUMN lvc;
+ int i = 0;
+ int nColumn = 0;
+ //int shown_columns;
+ LVCOLUMN col;
+ struct PickerInfo *pPickerInfo;
+ HRESULT res = 0;
+ BOOL b_res = 0;
+
+ pPickerInfo = GetPickerInfo(hWnd);
+
+ int *widths, *order, *shown;
+ widths = (int*)malloc(pPickerInfo->nColumnCount * sizeof(*widths));
+ order = (int*)malloc(pPickerInfo->nColumnCount * sizeof(*order));
+ shown = (int*)malloc(pPickerInfo->nColumnCount * sizeof(*shown));
+ if (!widths || !order || !shown)
+ goto done;
+
+ memset(widths, 0, pPickerInfo->nColumnCount * sizeof(*widths));
+ memset(order, 0, pPickerInfo->nColumnCount * sizeof(*order));
+ memset(shown, 0, pPickerInfo->nColumnCount * sizeof(*shown));
+ pPickerInfo->pCallbacks->pfnGetColumnWidths(widths);
+ pPickerInfo->pCallbacks->pfnGetColumnOrder(order);
+ pPickerInfo->pCallbacks->pfnGetColumnShown(shown);
+
+ if (!bFirstTime)
+ {
+ DWORD style = GetWindowLong(hWnd, GWL_STYLE);
+
+ // switch the list view to LVS_REPORT style so column widths reported correctly
+ SetWindowLong(hWnd, GWL_STYLE, (GetWindowLong(hWnd, GWL_STYLE) & ~LVS_TYPEMASK) | LVS_REPORT);
+
+ // Retrieve each of the column widths
+ i = 0;
+ memset(&col, 0, sizeof(col));
+ col.mask = LVCF_WIDTH;
+ while(ListView_GetColumn(hWnd, 0, &col))
+ {
+ nColumn = Picker_GetRealColumnFromViewColumn(hWnd, i++);
+ widths[nColumn] = col.cx;
+ b_res = ListView_DeleteColumn(hWnd, 0);
+ }
+
+ pPickerInfo->pCallbacks->pfnSetColumnWidths(widths);
+
+ // restore old style
+ SetWindowLong(hWnd, GWL_STYLE, style);
+ }
+
+ nColumn = 0;
+ for (i = 0; i < pPickerInfo->nColumnCount; i++)
+ {
+ if (shown[order[i]])
+ {
+ lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
+ lvc.pszText = (LPTSTR) pPickerInfo->ppszColumnNames[order[i]];
+ lvc.iSubItem = nColumn;
+ lvc.cx = widths[order[i]];
+ lvc.fmt = LVCFMT_LEFT;
+ if (lvc.pszText[0] > 0) // column name cannot be blank
+ {
+ res = ListView_InsertColumn(hWnd, nColumn, &lvc);
+ pPickerInfo->pnColumnsOrder[nColumn] = order[i];
+ //printf("Visible column %d: Logical column %d; Width=%d\n", nColumn, order[i], widths[order[i]]);
+ nColumn++;
+ }
+ }
+ }
+
+ //shown_columns = nColumn;
+
+ /* Fill this in so we can still sort on columns NOT shown */
+ for (i = 0; i < pPickerInfo->nColumnCount && nColumn < pPickerInfo->nColumnCount; i++)
+ {
+ if (!shown[order[i]])
+ {
+ pPickerInfo->pnColumnsOrder[nColumn] = order[i];
+ nColumn++;
+ }
+ }
+
+ if (GetListFontColor() == RGB(255, 255, 255))
+ b_res = ListView_SetTextColor(hWnd, RGB(240, 240, 240));
+ else
+ b_res = ListView_SetTextColor(hWnd, GetListFontColor());
+
+done:
+ if (widths)
+ free(widths);
+ if (order)
+ free(order);
+ if (shown)
+ free(shown);
+ res++;
+ b_res++;
+}
+
+
+
+void Picker_ResetColumnDisplay(HWND hWnd)
+{
+ Picker_InternalResetColumnDisplay(hWnd, false);
+}
+
+
+
+void Picker_ClearIdle(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ if (pPickerInfo->nTimer)
+ {
+ KillTimer(hwndPicker, 0);
+ pPickerInfo->nTimer = 0;
+ }
+}
+
+
+
+static void CALLBACK Picker_TimerProc(HWND hwndPicker, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+{
+ struct PickerInfo *pPickerInfo;
+ DWORD nTickCount = 0;
+ DWORD nMaxIdleTicks = 50;
+
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ BOOL bContinueIdle = false;
+ DWORD nBaseTickCount = GetTickCount();
+
+ // This idle procedure will loop until either idling is over, or until
+ // a specified amount of time elapses (in this case, 50ms). This frees
+ // idle callbacks of any responsibility for balancing their workloads; the
+ // picker code will
+ do
+ {
+ if (pPickerInfo->pCallbacks->pfnOnIdle)
+ bContinueIdle = pPickerInfo->pCallbacks->pfnOnIdle(hwndPicker);
+ nTickCount = GetTickCount();
+ }
+ while(bContinueIdle && ((nTickCount - nBaseTickCount) < nMaxIdleTicks));
+
+ if (!bContinueIdle)
+ Picker_ClearIdle(hwndPicker);
+}
+
+
+
+// Instructs this picker to reset idling; idling will continue until the
+// idle function returns false
+void Picker_ResetIdle(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+
+ pPickerInfo = GetPickerInfo(hwndPicker);
+
+ Picker_ClearIdle(hwndPicker);
+ if (pPickerInfo->pCallbacks->pfnOnIdle)
+ pPickerInfo->nTimer = SetTimer(hwndPicker, 0, 0, Picker_TimerProc);
+}
+
+
+
+BOOL Picker_IsIdling(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ return pPickerInfo->nTimer != 0;
+}
+
+
+
+BOOL SetupPicker(HWND hwndPicker, const struct PickerOptions *pOptions)
+{
+ struct PickerInfo *pPickerInfo;
+ int i = 0;
+ LONG_PTR l = 0;
+ HRESULT res = 0;
+
+ //assert(hwndPicker);
+
+ // Allocate the list view struct
+ pPickerInfo = (struct PickerInfo *) malloc(sizeof(struct PickerInfo));
+ if (!pPickerInfo)
+ return false;
+
+ // And fill it out
+ memset(pPickerInfo, 0, sizeof(*pPickerInfo));
+ pPickerInfo->pCallbacks = pOptions->pCallbacks;
+ pPickerInfo->nColumnCount = pOptions->nColumnCount;
+ pPickerInfo->ppszColumnNames = pOptions->ppszColumnNames;
+ pPickerInfo->nLastItem = -1;
+
+ if (pPickerInfo->nColumnCount)
+ {
+ // Allocate space for the column order and columns shown array
+ pPickerInfo->pnColumnsOrder = (int*)malloc(pPickerInfo->nColumnCount *
+ sizeof(*pPickerInfo->pnColumnsOrder));
+ pPickerInfo->pnColumnsShown = (int*)malloc(pPickerInfo->nColumnCount *
+ sizeof(*pPickerInfo->pnColumnsShown));
+ if (!pPickerInfo->pnColumnsOrder || !pPickerInfo->pnColumnsShown)
+ goto error;
+
+ // set up initial values
+ for (i = 0; i < pPickerInfo->nColumnCount; i++)
+ {
+ pPickerInfo->pnColumnsOrder[i] = i;
+ pPickerInfo->pnColumnsShown[i] = true;
+ }
+
+ if (GetUseOldControl())
+ {
+ if (pPickerInfo->pCallbacks->pfnSetColumnOrder)
+ pPickerInfo->pCallbacks->pfnSetColumnOrder(pPickerInfo->pnColumnsOrder);
+ if (pPickerInfo->pCallbacks->pfnSetColumnShown)
+ pPickerInfo->pCallbacks->pfnSetColumnShown(pPickerInfo->pnColumnsShown);
+ }
+ else
+ {
+ if (pPickerInfo->pCallbacks->pfnGetColumnOrder)
+ pPickerInfo->pCallbacks->pfnGetColumnOrder(pPickerInfo->pnColumnsOrder);
+ if (pPickerInfo->pCallbacks->pfnGetColumnShown)
+ pPickerInfo->pCallbacks->pfnGetColumnShown(pPickerInfo->pnColumnsShown);
+ }
+ }
+
+ // Hook in our wndproc and userdata pointer
+ l = GetWindowLongPtr(hwndPicker, GWLP_WNDPROC);
+ pPickerInfo->pfnParentWndProc = (WNDPROC) l;
+ SetWindowLongPtr(hwndPicker, GWLP_USERDATA, (LONG_PTR) pPickerInfo);
+ SetWindowLongPtr(hwndPicker, GWLP_WNDPROC, (LONG_PTR) ListViewWndProc);
+
+ res = ListView_SetExtendedListViewStyle(hwndPicker, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP |
+ LVS_EX_UNDERLINEHOT | LVS_EX_UNDERLINECOLD | LVS_EX_LABELTIP);
+
+ Picker_InternalResetColumnDisplay(hwndPicker, true);
+ Picker_ResetIdle(hwndPicker);
+ res++;
+ return true;
+
+error:
+ if (pPickerInfo)
+ Picker_Free(pPickerInfo);
+ return false;
+}
+
+
+
+int Picker_GetViewID(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ return pPickerInfo->nCurrentViewID;
+}
+
+
+
+void Picker_SetViewID(HWND hwndPicker, int nViewID)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hwndPicker);
+
+ // Change the nCurrentViewID member
+ pPickerInfo->nCurrentViewID = nViewID;
+ if (pPickerInfo->pCallbacks->pfnSetViewMode)
+ pPickerInfo->pCallbacks->pfnSetViewMode(pPickerInfo->nCurrentViewID);
+
+ // Change the ListView flags in accordance
+ LONG_PTR nListViewStyle;
+ switch(nViewID)
+ {
+ case VIEW_LARGE_ICONS:
+ nListViewStyle = LVS_ICON;
+ break;
+ case VIEW_SMALL_ICONS:
+ nListViewStyle = LVS_SMALLICON;
+ break;
+ case VIEW_INLIST:
+ nListViewStyle = LVS_LIST;
+ break;
+ case VIEW_GROUPED:
+ case VIEW_REPORT:
+ default:
+ nListViewStyle = LVS_REPORT;
+ break;
+ }
+
+ DWORD dwStyle = GetWindowLong(hwndPicker, GWL_STYLE);
+ if (GetUseXPControl())
+ {
+ // RS Microsoft must have changed something in the Ownerdraw handling with Version 6 of the Common Controls
+ // as on all other OSes it works without this...
+ if (nViewID == VIEW_LARGE_ICONS || nViewID == VIEW_SMALL_ICONS)
+ {
+ // remove Ownerdraw style for Icon views
+ dwStyle &= ~LVS_OWNERDRAWFIXED;
+ if( nViewID == VIEW_SMALL_ICONS )
+ {
+ // to properly get them to arrange, otherwise the entries might overlap
+ // we have to call SetWindowLong to get it into effect !!
+ // It's no use just setting the Style, as it's changed again further down...
+ SetWindowLong(hwndPicker, GWL_STYLE, (GetWindowLong(hwndPicker, GWL_STYLE) & ~LVS_TYPEMASK) | LVS_ICON);
+ }
+ }
+ else
+ {
+ // add again..
+ dwStyle |= LVS_OWNERDRAWFIXED;
+ }
+ }
+
+ dwStyle &= ~LVS_TYPEMASK;
+ dwStyle |= nListViewStyle;
+ SetWindowLong(hwndPicker, GWL_STYLE, dwStyle);
+ RedrawWindow(hwndPicker, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME);
+}
+
+
+static BOOL PickerHitTest(HWND hWnd)
+{
+ LVHITTESTINFO htInfo;
+ memset(&htInfo, 0, sizeof(htInfo));
+ RECT rect;
+ GetWindowRect(hWnd, &rect);
+ DWORD res = GetMessagePos();
+ POINTS p = MAKEPOINTS(res);
+ htInfo.pt.x = p.x - rect.left;
+ htInfo.pt.y = p.y - rect.top;
+ HRESULT result = ListView_HitTest(hWnd, &htInfo);
+ result++;
+ return (! (htInfo.flags & LVHT_NOWHERE));
+}
+
+
+int Picker_GetSelectedItem(HWND hWnd)
+{
+ int nItem = ListView_GetNextItem(hWnd, -1, LVIS_SELECTED | LVIS_FOCUSED);
+ if (nItem < 0)
+ return nItem;
+
+ LV_ITEM lvi;
+ memset(&lvi, 0, sizeof(lvi));
+ lvi.iItem = nItem;
+ lvi.mask = LVIF_PARAM;
+ BOOL res = ListView_GetItem(hWnd, &lvi);
+ res++;
+ return lvi.lParam;
+}
+
+
+// This highlights a selected game, and scrolls it into view
+void Picker_SetSelectedPick(HWND hWnd, uint32_t nIndex)
+{
+ // nCount is one more than number of last game
+ int nCount = ListView_GetItemCount(hWnd);
+ // No games to show
+ if (nCount < 1)
+ return;
+ nCount--;
+ if (nCount < nIndex)
+ nIndex = nCount;
+ // Highlight a game
+ ListView_SetItemState(hWnd, nIndex, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ // Bring the game into view
+ (void)ListView_EnsureVisible(hWnd, nIndex, false);
+}
+
+
+
+void Picker_SetSelectedItem(HWND hWnd, uint32_t nItem)
+{
+ LV_FINDINFO lvfi;
+ lvfi.flags = LVFI_PARAM;
+ lvfi.lParam = nItem;
+ int i = ListView_FindItem(hWnd, -1, &lvfi);
+ if (i == -1)
+ {
+ POINT p = {0,0};
+ lvfi.flags = LVFI_NEARESTXY;
+ lvfi.pt = p;
+ i = ListView_FindItem(hWnd, -1, &lvfi);
+ }
+ Picker_SetSelectedPick(hWnd, (i == -1) ? 0 : i);
+}
+
+
+
+static const TCHAR *Picker_CallGetItemString(HWND hwndPicker, int nItem, int nColumn, TCHAR *pszBuffer, UINT nBufferLength)
+{
+ // this call wraps the pfnGetItemString callback to properly set up the
+ // buffers, and normalize the results
+ struct PickerInfo *pPickerInfo;
+ const TCHAR *s;
+
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ pszBuffer[0] = '\0';
+ s = NULL;
+
+ if (pPickerInfo->pCallbacks->pfnGetItemString)
+ s = pPickerInfo->pCallbacks->pfnGetItemString(hwndPicker, nItem, nColumn, pszBuffer, nBufferLength);
+
+ if (!s)
+ s = pszBuffer;
+ return s;
+}
+
+
+
+// put the arrow on the new sort column
+static void Picker_ResetHeaderSortIcon(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ HWND hwndHeader = ListView_GetHeader(hwndPicker);
+ BOOL res;
+
+ // take arrow off non-current columns
+ HD_ITEM hdi;
+ hdi.mask = HDI_FORMAT;
+ hdi.fmt = HDF_STRING;
+ for (int i = 0; i < pPickerInfo->nColumnCount; i++)
+ if (i != pPickerInfo->pCallbacks->pfnGetSortColumn())
+ res = Header_SetItem(hwndHeader, Picker_GetViewColumnFromRealColumn(hwndPicker, i), &hdi);
+
+ if (GetUseXPControl())
+ {
+ // use built in sort arrows
+ hdi.mask = HDI_FORMAT;
+ hdi.fmt = HDF_STRING | (pPickerInfo->pCallbacks->pfnGetSortReverse() ? HDF_SORTDOWN : HDF_SORTUP);
+ }
+ else
+ {
+ // put our arrow icon next to the text
+ hdi.mask = HDI_FORMAT | HDI_IMAGE;
+ hdi.fmt = HDF_STRING | HDF_IMAGE | HDF_BITMAP_ON_RIGHT;
+ hdi.iImage = pPickerInfo->pCallbacks->pfnGetSortReverse() ? 1 : 0;
+ }
+
+ int nViewColumn = Picker_GetViewColumnFromRealColumn(hwndPicker, pPickerInfo->pCallbacks->pfnGetSortColumn());
+ res = Header_SetItem(hwndHeader, nViewColumn, &hdi);
+ res++;
+}
+
+
+
+struct CompareProcParams
+{
+ HWND hwndPicker;
+ struct PickerInfo *pPickerInfo;
+ int nSortColumn;
+ int nViewMode;
+ BOOL bReverse;
+};
+
+
+
+static void Picker_PopulateCompareProcParams(HWND hwndPicker, struct CompareProcParams *pParams)
+{
+ struct PickerInfo *pPickerInfo;
+
+ pPickerInfo = GetPickerInfo(hwndPicker);
+
+ // populate the CompareProcParams structure
+ memset(pParams, 0, sizeof(*pParams));
+ pParams->hwndPicker = hwndPicker;
+ pParams->pPickerInfo = pPickerInfo;
+ pParams->nViewMode = pPickerInfo->pCallbacks->pfnGetViewMode();
+ if (pPickerInfo->pCallbacks->pfnGetSortColumn)
+ pParams->nSortColumn = pPickerInfo->pCallbacks->pfnGetSortColumn();
+ if (pPickerInfo->pCallbacks->pfnGetSortReverse)
+ pParams->bReverse = pPickerInfo->pCallbacks->pfnGetSortReverse();
+}
+
+
+
+static int CALLBACK Picker_CompareProc(LPARAM index1, LPARAM index2, LPARAM nParamSort)
+{
+ struct CompareProcParams *pcpp = (struct CompareProcParams *) nParamSort;
+ struct PickerInfo *pPickerInfo = pcpp->pPickerInfo;
+ BOOL bCallCompare = true;
+ int nResult = 0, nParent1 = 0, nParent2 = 0;
+ TCHAR szBuffer1[256], szBuffer2[256];
+ const TCHAR *s1, *s2;
+
+ if (pcpp->nViewMode == VIEW_GROUPED)
+ {
+ // do our fancy compare, with clones grouped under parents
+ // first thing we need to do is identify both item's parents
+ if (pPickerInfo->pCallbacks->pfnFindItemParent)
+ {
+ nParent1 = pPickerInfo->pCallbacks->pfnFindItemParent(pcpp->hwndPicker, index1);
+ nParent2 = pPickerInfo->pCallbacks->pfnFindItemParent(pcpp->hwndPicker, index2);
+ }
+ else
+ {
+ nParent1 = nParent2 = -1;
+ }
+
+ if ((nParent1 < 0) && (nParent2 < 0))
+ {
+ // if both entries are both parents, we just do a basic sort
+ }
+ else if ((nParent1 >= 0) && (nParent2 >= 0))
+ {
+ // if both entries are children and the parents are different,
+ // sort on their parents
+ if (nParent1 != nParent2)
+ {
+ index1 = nParent1;
+ index2 = nParent2;
+ }
+ }
+ else
+ {
+ // one parent, one child
+ if (nParent1 >= 0)
+ {
+ // first one is a child
+ if (nParent1 == index2)
+ {
+ // if this is a child and its parent, put child after
+ nResult = 1;
+ bCallCompare = false;
+ }
+ else
+ {
+ // sort on parent
+ index1 = nParent1;
+ }
+ }
+ else
+ {
+ // second one is a child
+ if (nParent2 == index1)
+ {
+ // if this is a child and its parent, put child after
+ nResult = -1;
+ bCallCompare = false;
+ }
+ else
+ {
+ // sort on parent
+ index2 = nParent2;
+ }
+ }
+ }
+ }
+
+ if (bCallCompare)
+ {
+ if (pPickerInfo->pCallbacks->pfnCompare)
+ {
+ nResult = pPickerInfo->pCallbacks->pfnCompare(pcpp->hwndPicker,
+ index1, index2, pcpp->nSortColumn);
+ }
+ else
+ {
+ // no default sort proc, just get the string and compare them
+ s1 = Picker_CallGetItemString(pcpp->hwndPicker, index1, pcpp->nSortColumn,
+ szBuffer1, sizeof(szBuffer1) / sizeof(szBuffer1[0]));
+ s2 = Picker_CallGetItemString(pcpp->hwndPicker, index2, pcpp->nSortColumn,
+ szBuffer2, sizeof(szBuffer2) / sizeof(szBuffer2[0]));
+ nResult = _tcsicmp(s1, s2);
+ }
+
+ if (pcpp->bReverse)
+ nResult = -nResult;
+ }
+ return nResult;
+}
+
+
+
+void Picker_Sort(HWND hwndPicker)
+{
+ //struct PickerInfo *pPickerInfo;
+ struct CompareProcParams params;
+
+ //pPickerInfo = GetPickerInfo(hwndPicker);
+
+ // populate the CompareProcParams structure
+ Picker_PopulateCompareProcParams(hwndPicker, &params);
+
+ BOOL res = ListView_SortItems(hwndPicker, Picker_CompareProc, (LPARAM) &params);
+
+ Picker_ResetHeaderSortIcon(hwndPicker);
+
+ LV_FINDINFO lvfi;
+ memset(&lvfi, 0, sizeof(lvfi));
+ lvfi.flags = LVFI_PARAM;
+ lvfi.lParam = Picker_GetSelectedItem(hwndPicker);
+ int nItem = ListView_FindItem(hwndPicker, -1, &lvfi);
+
+ res = ListView_EnsureVisible(hwndPicker, nItem, false);
+ res++;
+}
+
+
+
+int Picker_InsertItemSorted(HWND hwndPicker, int nParam)
+{
+ //struct PickerInfo *pPickerInfo;
+ int nLow = 0, nMid = 0;
+ struct CompareProcParams params;
+ int nCompareResult = 0;
+ LVITEM lvi;
+ BOOL res = 0;
+
+ //pPickerInfo = GetPickerInfo(hwndPicker);
+
+ int nHigh = ListView_GetItemCount(hwndPicker);
+
+ // populate the CompareProcParams structure
+ Picker_PopulateCompareProcParams(hwndPicker, &params);
+
+ while(nLow < nHigh)
+ {
+ nMid = (nHigh + nLow) / 2;
+
+ memset(&lvi, 0, sizeof(lvi));
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = nMid;
+ res = ListView_GetItem(hwndPicker, &lvi);
+ nCompareResult = Picker_CompareProc(nParam, lvi.lParam, (LPARAM) &params);
+
+ if (nCompareResult > 0)
+ nLow = nMid + 1;
+ else if (nCompareResult < 0)
+ nHigh = nMid;
+ else
+ {
+ nLow = nMid;
+ break;
+ }
+ }
+
+ res++;
+ memset(&lvi, 0, sizeof(lvi));
+ lvi.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
+ lvi.iItem = nLow;
+ lvi.iSubItem = 0;
+ lvi.lParam = nParam;
+ lvi.pszText = LPSTR_TEXTCALLBACK;
+ lvi.iImage = I_IMAGECALLBACK;
+
+ return ListView_InsertItem(hwndPicker, &lvi);
+}
+
+
+
+int Picker_GetRealColumnFromViewColumn(HWND hWnd, int nViewColumn)
+{
+ struct PickerInfo *pPickerInfo;
+ int nRealColumn = 0;
+
+ pPickerInfo = GetPickerInfo(hWnd);
+ if (nViewColumn >= 0 && nViewColumn < pPickerInfo->nColumnCount)
+ nRealColumn = pPickerInfo->pnColumnsOrder[nViewColumn];
+ return nRealColumn;
+}
+
+
+
+int Picker_GetViewColumnFromRealColumn(HWND hWnd, int nRealColumn)
+{
+ struct PickerInfo *pPickerInfo;
+
+ pPickerInfo = GetPickerInfo(hWnd);
+ for (int i = 0; i < pPickerInfo->nColumnCount; i++)
+ if (pPickerInfo->pnColumnsOrder[i] == nRealColumn)
+ return i;
+
+ // major error, shouldn't be possible, but no good way to warn
+ return 0;
+}
+
+
+
+BOOL Picker_HandleNotify(LPNMHDR lpNmHdr)
+{
+ struct PickerInfo *pPickerInfo;
+ HWND hWnd;
+ BOOL bResult = false;
+ NM_LISTVIEW *pnmv;
+ LV_DISPINFO *pDispInfo;
+ int nItem = 0, nColumn = 0;
+ const TCHAR *s;
+ BOOL bReverse = 0;
+
+ hWnd = lpNmHdr->hwndFrom;
+ pPickerInfo = GetPickerInfo(hWnd);
+ pnmv = (NM_LISTVIEW *) lpNmHdr;
+
+ switch(lpNmHdr->code)
+ {
+ case NM_RCLICK:
+ case NM_CLICK:
+ case NM_DBLCLK:
+ // don't allow selection of blank spaces in the listview
+ if (!PickerHitTest(hWnd))
+ {
+ // we have no current item selected
+ if (pPickerInfo->nLastItem != -1)
+ {
+ Picker_SetSelectedItem(hWnd, pPickerInfo->nLastItem);
+ }
+ bResult = true;
+ }
+ else if ((lpNmHdr->code == NM_DBLCLK) && (pPickerInfo->pCallbacks->pfnDoubleClick))
+ {
+ // double click!
+ pPickerInfo->pCallbacks->pfnDoubleClick();
+ bResult = true;
+ }
+ break;
+
+ case LVN_GETDISPINFO:
+ pDispInfo = (LV_DISPINFO *) lpNmHdr;
+ nItem = (int) pDispInfo->item.lParam;
+
+ if (pDispInfo->item.mask & LVIF_IMAGE)
+ {
+ // retrieve item image
+ if (pPickerInfo->pCallbacks->pfnGetItemImage)
+ pDispInfo->item.iImage = pPickerInfo->pCallbacks->pfnGetItemImage(hWnd, nItem);
+ else
+ pDispInfo->item.iImage = 0;
+ bResult = true;
+ }
+
+ if (pDispInfo->item.mask & LVIF_STATE)
+ {
+ pDispInfo->item.state = 0;
+ bResult = true;
+ }
+
+ if (pDispInfo->item.mask & LVIF_TEXT)
+ {
+ // retrieve item text
+ nColumn = Picker_GetRealColumnFromViewColumn(hWnd, pDispInfo->item.iSubItem);
+
+ s = Picker_CallGetItemString(hWnd, nItem, nColumn,
+ pDispInfo->item.pszText, pDispInfo->item.cchTextMax);
+
+ pDispInfo->item.pszText = (TCHAR *) s;
+ bResult = true;
+ }
+ break;
+
+ case LVN_ITEMCHANGED:
+ if ((pnmv->uOldState & LVIS_SELECTED)
+ && !(pnmv->uNewState & LVIS_SELECTED))
+ {
+ if (pnmv->lParam != -1)
+ pPickerInfo->nLastItem = pnmv->lParam;
+ if (pPickerInfo->pCallbacks->pfnLeavingItem)
+ pPickerInfo->pCallbacks->pfnLeavingItem(hWnd, pnmv->lParam);
+ }
+ if (!(pnmv->uOldState & LVIS_SELECTED)
+ && (pnmv->uNewState & LVIS_SELECTED))
+ {
+ if (pPickerInfo->pCallbacks->pfnEnteringItem)
+ pPickerInfo->pCallbacks->pfnEnteringItem(hWnd, pnmv->lParam);
+ }
+ bResult = true;
+ break;
+
+ case LVN_COLUMNCLICK:
+ // if clicked on the same column we're sorting by, reverse it
+ if (pPickerInfo->pCallbacks->pfnGetSortColumn() == Picker_GetRealColumnFromViewColumn(hWnd, pnmv->iSubItem))
+ bReverse = !pPickerInfo->pCallbacks->pfnGetSortReverse();
+ else
+ bReverse = false;
+ pPickerInfo->pCallbacks->pfnSetSortReverse(bReverse);
+ pPickerInfo->pCallbacks->pfnSetSortColumn(Picker_GetRealColumnFromViewColumn(hWnd, pnmv->iSubItem));
+ Picker_Sort(hWnd);
+ bResult = true;
+ break;
+
+ case LVN_BEGINDRAG:
+ if (pPickerInfo->pCallbacks->pfnBeginListViewDrag)
+ pPickerInfo->pCallbacks->pfnBeginListViewDrag(pnmv);
+ break;
+ }
+ return bResult;
+}
+
+
+
+int Picker_GetNumColumns(HWND hWnd)
+{
+ int nColumnCount = 0;
+ int *shown;
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hWnd);
+
+ shown = (int*)malloc(pPickerInfo->nColumnCount * sizeof(*shown));
+ if (!shown)
+ return -1;
+
+ pPickerInfo->pCallbacks->pfnGetColumnShown(shown);
+ HWND hwndHeader = ListView_GetHeader(hWnd);
+
+ if (GetUseOldControl() || (nColumnCount = Header_GetItemCount(hwndHeader)) < 1)
+ {
+ nColumnCount = 0;
+ for (int i = 0; i < pPickerInfo->nColumnCount ; i++ )
+ if (shown[i])
+ nColumnCount++;
+ }
+
+ free(shown);
+ return nColumnCount;
+}
+
+
+
+/* Add ... to Items in ListView if needed */
+static LPCTSTR MakeShortString(HDC hDC, LPCTSTR lpszLong, int nColumnLen, int nOffset)
+{
+ static const TCHAR szThreeDots[] = TEXT("...");
+ static TCHAR szShort[MAX_PATH];
+ int nStringLen = lstrlen(lpszLong);
+ SIZE size;
+
+ GetTextExtentPoint32(hDC, lpszLong, nStringLen, &size);
+ if (nStringLen == 0 || size.cx + nOffset <= nColumnLen)
+ return lpszLong;
+
+ lstrcpy(szShort, lpszLong);
+ GetTextExtentPoint32(hDC, szThreeDots, ARRAY_LENGTH(szThreeDots), &size);
+ int nAddLen = size.cx;
+
+ for (int i = nStringLen - 1; i > 0; i--)
+ {
+ szShort[i] = 0;
+ GetTextExtentPoint32(hDC, szShort, i, &size);
+ if (size.cx + nOffset + nAddLen <= nColumnLen)
+ break;
+ }
+
+ lstrcat(szShort, szThreeDots);
+
+ return szShort;
+}
+
+#define ListView_GetItemRect_Modified(hwnd,i,prc,code) (BOOL)SNDMSG((hwnd),LVM_GETITEMRECT,(WPARAM)(int)(i),(((RECT *)(prc))->left = (code),(LPARAM)(RECT *)(prc)))
+
+void Picker_HandleDrawItem(HWND hWnd, LPDRAWITEMSTRUCT lpDrawItemStruct)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hWnd);
+ int *order;
+ order = (int*)malloc(pPickerInfo->nColumnCount * sizeof(*order));
+ if (!order)
+ return;
+
+ HDC hDC = lpDrawItemStruct->hDC;
+ RECT rcItem = lpDrawItemStruct->rcItem;
+ UINT uiFlags = ILD_TRANSPARENT;
+ HIMAGELIST hImageList;
+ int nItem = lpDrawItemStruct->itemID;
+ COLORREF clrTextSave = 0;
+ COLORREF clrBkSave = 0;
+ COLORREF clrImage = GetSysColor(COLOR_WINDOW);
+ static TCHAR szBuff[MAX_PATH];
+ BOOL bFocus = (GetFocus() == hWnd);
+ LPCTSTR pszText;
+ UINT nStateImageMask = 0;
+ BOOL bSelected = 0;
+ LV_COLUMN lvc;
+ LV_ITEM lvi;
+ RECT rcAllLabels;
+ RECT rcLabel;
+ RECT rcIcon;
+ int offset = 0;
+ SIZE size;
+ int i = 0, j = 0;
+ int nColumn = 0;
+ BOOL bDrawAsChild = 0;
+ int indent_space = 0;
+ BOOL bColorChild = false;
+ BOOL bParentFound = false;
+ int nParent = 0;
+ HBITMAP hBackground = GetBackgroundBitmap();
+ MYBITMAPINFO *pbmDesc = GetBackgroundInfo();
+ BOOL res = 0;
+
+ int nColumnMax = Picker_GetNumColumns(hWnd);
+
+ if (GetUseOldControl())
+ pPickerInfo->pCallbacks->pfnGetColumnOrder(order);
+ else
+ {
+ /* Get the Column Order and save it */
+ res = ListView_GetColumnOrderArray(hWnd, nColumnMax, order);
+
+ /* Disallow moving column 0 */
+ if (order[0] != 0)
+ {
+ for (i = 0; i < nColumnMax; i++)
+ {
+ if (order[i] == 0)
+ {
+ order[i] = order[0];
+ order[0] = 0;
+ }
+ }
+ res = ListView_SetColumnOrderArray(hWnd, nColumnMax, order);
+ }
+ }
+
+ /* Labels are offset by a certain amount */
+ /* This offset is related to the width of a space character */
+ GetTextExtentPoint32(hDC, TEXT(" "), 1, &size);
+ offset = size.cx;
+
+ lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE | LVIF_PARAM;
+ lvi.iItem = nItem;
+ lvi.iSubItem = order[0];
+ lvi.pszText = szBuff;
+ lvi.cchTextMax = sizeof(szBuff) / sizeof(szBuff[0]);
+ lvi.stateMask = 0xFFFF; /* get all state flags */
+ res = ListView_GetItem(hWnd, &lvi);
+
+ bSelected = ((lvi.state & LVIS_DROPHILITED) || ( (lvi.state & LVIS_SELECTED) && ((bFocus) || (GetWindowLong(hWnd, GWL_STYLE) & LVS_SHOWSELALWAYS))));
+
+ /* figure out if we indent and draw grayed */
+ if (pPickerInfo->pCallbacks->pfnFindItemParent)
+ nParent = pPickerInfo->pCallbacks->pfnFindItemParent(hWnd, lvi.lParam);
+ else
+ nParent = -1;
+ bDrawAsChild = (pPickerInfo->pCallbacks->pfnGetViewMode() == VIEW_GROUPED && (nParent >= 0));
+
+ /* only indent if parent is also in this view */
+#if 1 // minimal listview flickering.
+ if ((nParent >= 0) && bDrawAsChild)
+ {
+ if (GetParentFound(lvi.lParam))
+ bParentFound = TRUE;
+ }
+#else
+ if ((nParent >= 0) && bDrawAsChild)
+ {
+ for (i = 0; i < ListView_GetItemCount(hWnd); i++)
+ {
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = i;
+ res = ListView_GetItem(hWnd, &lvi);
+
+ if (lvi.lParam == nParent)
+ {
+ bParentFound = TRUE;
+ break;
+ }
+ }
+ }
+#endif
+
+ if (pPickerInfo->pCallbacks->pfnGetOffsetChildren && pPickerInfo->pCallbacks->pfnGetOffsetChildren())
+ {
+ if (!bParentFound && bDrawAsChild)
+ {
+ /*Reset it, as no Parent is there*/
+ bDrawAsChild = false;
+ bColorChild = true;
+ }
+ else
+ {
+ nParent = -1;
+ bParentFound = false;
+ }
+ }
+
+ res = ListView_GetItemRect_Modified(hWnd, nItem, &rcAllLabels, LVIR_BOUNDS);
+ res = ListView_GetItemRect_Modified(hWnd, nItem, &rcLabel, LVIR_LABEL);
+
+ rcAllLabels.left = rcLabel.left;
+
+ if (hBackground)
+ {
+ RECT rcClient;
+ HRGN rgnBitmap;
+ RECT rcTmpBmp = rcItem;
+ RECT rcFirstItem;
+ HPALETTE hPAL;
+
+ HDC htempDC = CreateCompatibleDC(hDC);
+
+ HBITMAP oldBitmap = (HBITMAP)SelectObject(htempDC, hBackground);
+
+ GetClientRect(hWnd, &rcClient);
+ rcTmpBmp.right = rcClient.right;
+ /* We also need to check whether it is the last item
+ The update region has to be extended to the bottom if it is */
+ if (nItem == ListView_GetItemCount(hWnd) - 1)
+ rcTmpBmp.bottom = rcClient.bottom;
+
+ rgnBitmap = CreateRectRgnIndirect(&rcTmpBmp);
+ SelectClipRgn(hDC, rgnBitmap);
+ DeleteBitmap(rgnBitmap);
+
+ hPAL = GetBackgroundPalette();
+ if (hPAL == NULL)
+ hPAL = CreateHalftonePalette(hDC);
+
+ if (GetDeviceCaps(htempDC, RASTERCAPS) & RC_PALETTE && hPAL != NULL)
+ {
+ SelectPalette(htempDC, hPAL, false);
+ RealizePalette(htempDC);
+ }
+
+ res = ListView_GetItemRect_Modified(hWnd, 0, &rcFirstItem, LVIR_BOUNDS);
+
+ for (i = rcFirstItem.left; i < rcClient.right; i += pbmDesc->bmWidth)
+ for (j = rcFirstItem.top; j < rcClient.bottom; j += pbmDesc->bmHeight)
+ BitBlt(hDC, i, j, pbmDesc->bmWidth, pbmDesc->bmHeight, htempDC, 0, 0, SRCCOPY);
+
+ SelectObject(htempDC, oldBitmap);
+ DeleteDC(htempDC);
+
+ if (GetBackgroundPalette() == NULL)
+ {
+ DeletePalette(hPAL);
+ hPAL = NULL;
+ }
+ }
+
+ indent_space = 0;
+
+ if (bDrawAsChild)
+ {
+ RECT rect;
+
+ res = ListView_GetItemRect_Modified(hWnd, nItem, &rect, LVIR_ICON);
+
+ /* indent width of icon + the space between the icon and text
+ * so left of clone icon starts at text of parent
+ */
+ indent_space = rect.right - rect.left + offset;
+ }
+
+ rcAllLabels.left += indent_space;
+
+ if (bSelected)
+ {
+ HBRUSH hBrush;
+ HBRUSH hOldBrush;
+
+ if (bFocus)
+ {
+ clrTextSave = SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
+ clrBkSave = SetBkColor(hDC, GetSysColor(COLOR_HIGHLIGHT));
+ hBrush = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
+ }
+ else
+ {
+ clrTextSave = SetTextColor(hDC, GetSysColor(COLOR_BTNTEXT));
+ clrBkSave = SetBkColor(hDC, GetSysColor(COLOR_BTNFACE));
+ hBrush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
+ }
+
+ hOldBrush = (HBRUSH)SelectObject(hDC, hBrush);
+ FillRect(hDC, &rcAllLabels, hBrush);
+ SelectObject(hDC, hOldBrush);
+ DeleteBrush(hBrush);
+ }
+ else
+ {
+ if (hBackground == NULL)
+ {
+ HBRUSH hBrush = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
+ FillRect(hDC, &rcAllLabels, hBrush);
+ DeleteBrush(hBrush);
+ }
+
+ if (pPickerInfo->pCallbacks->pfnGetOffsetChildren && pPickerInfo->pCallbacks->pfnGetOffsetChildren())
+ {
+ if (bDrawAsChild || bColorChild)
+ clrTextSave = SetTextColor(hDC, GetListCloneColor());
+ else
+ clrTextSave = SetTextColor(hDC, GetListFontColor());
+ }
+ else
+ {
+ if (bDrawAsChild)
+ clrTextSave = SetTextColor(hDC, GetListCloneColor());
+ else
+ clrTextSave = SetTextColor(hDC, GetListFontColor());
+ }
+
+ clrBkSave = SetBkColor(hDC, GetSysColor(COLOR_WINDOW));
+ }
+
+
+ if (lvi.state & LVIS_CUT)
+ {
+ clrImage = GetSysColor(COLOR_WINDOW);
+ uiFlags |= ILD_BLEND50;
+ }
+ else
+ if (bSelected)
+ {
+ if (bFocus)
+ clrImage = GetSysColor(COLOR_HIGHLIGHT);
+ else
+ clrImage = GetSysColor(COLOR_BTNFACE);
+
+ uiFlags |= ILD_BLEND50;
+ }
+
+ nStateImageMask = lvi.state & LVIS_STATEIMAGEMASK;
+
+ if (nStateImageMask)
+ {
+ int nImage = (nStateImageMask >> 12) - 1;
+ hImageList = ListView_GetImageList(hWnd, LVSIL_STATE);
+ if (hImageList)
+ ImageList_Draw(hImageList, nImage, hDC, rcItem.left, rcItem.top, ILD_TRANSPARENT);
+ }
+
+ res = ListView_GetItemRect_Modified(hWnd, nItem, &rcIcon, LVIR_ICON);
+
+ rcIcon.left += indent_space;
+
+ res = ListView_GetItemRect_Modified(hWnd, nItem, &rcItem, LVIR_LABEL);
+
+ hImageList = ListView_GetImageList(hWnd, LVSIL_SMALL);
+ if (hImageList)
+ {
+ UINT nOvlImageMask = lvi.state & LVIS_OVERLAYMASK;
+ if (rcIcon.left + 16 + indent_space < rcItem.right)
+ ImageList_DrawEx(hImageList, lvi.iImage, hDC, rcIcon.left, rcIcon.top, 16, 16, GetSysColor(COLOR_WINDOW), clrImage, uiFlags | nOvlImageMask);
+ }
+
+ res = ListView_GetItemRect_Modified(hWnd, nItem, &rcItem, LVIR_LABEL);
+
+ pszText = MakeShortString(hDC, szBuff, rcItem.right - rcItem.left, 2*offset + indent_space);
+
+ rcLabel = rcItem;
+ rcLabel.left += offset + indent_space;
+ rcLabel.right -= offset;
+
+ DrawText(hDC, pszText, -1, &rcLabel, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER);
+
+ for (nColumn = 1; nColumn < nColumnMax; nColumn++)
+ {
+ int nRetLen;
+ UINT nJustify;
+ LV_ITEM lvItem;
+
+ lvc.mask = LVCF_FMT | LVCF_WIDTH;
+ res = ListView_GetColumn(hWnd, order[nColumn], &lvc);
+
+ lvItem.mask = LVIF_TEXT;
+ lvItem.iItem = nItem;
+ lvItem.iSubItem = order[nColumn];
+ lvItem.pszText = szBuff;
+ lvItem.cchTextMax = sizeof(szBuff) / sizeof(szBuff[0]);
+
+ if (ListView_GetItem(hWnd, &lvItem) == false)
+ continue;
+
+ rcItem.left = rcItem.right;
+ rcItem.right += lvc.cx;
+
+ nRetLen = _tcslen(szBuff);
+ if (nRetLen == 0)
+ continue;
+
+ pszText = MakeShortString(hDC, szBuff, rcItem.right - rcItem.left, 2 * offset);
+
+ nJustify = DT_LEFT;
+
+ if (pszText == szBuff)
+ {
+ switch (lvc.fmt & LVCFMT_JUSTIFYMASK)
+ {
+ case LVCFMT_RIGHT:
+ nJustify = DT_RIGHT;
+ break;
+
+ case LVCFMT_CENTER:
+ nJustify = DT_CENTER;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ rcLabel = rcItem;
+ rcLabel.left += offset;
+ rcLabel.right -= offset;
+ DrawText(hDC, pszText, -1, &rcLabel, nJustify | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER);
+ }
+
+ if (lvi.state & LVIS_FOCUSED && bFocus)
+ DrawFocusRect(hDC, &rcAllLabels);
+
+ SetTextColor(hDC, clrTextSave);
+ SetBkColor(hDC, clrBkSave);
+ free(order);
+ res++;
+}
+
+
+
+
+const struct PickerCallbacks *Picker_GetCallbacks(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ return pPickerInfo->pCallbacks;
+}
+
+
+
+int Picker_GetColumnCount(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ return pPickerInfo->nColumnCount;
+}
+
+
+
+const LPCTSTR *Picker_GetColumnNames(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+ pPickerInfo = GetPickerInfo(hwndPicker);
+ return pPickerInfo->ppszColumnNames;
+}
+
+
+
+void Picker_SetHeaderImageList(HWND hwndPicker, HIMAGELIST hHeaderImages)
+{
+ HWND hwndHeader;
+ hwndHeader = ListView_GetHeader(hwndPicker);
+ SendMessage(hwndHeader, HDM_SETIMAGELIST, 0, (LPARAM) (void *) hHeaderImages);
+}
+
+
+
+BOOL Picker_SaveColumnWidths(HWND hwndPicker)
+{
+ struct PickerInfo *pPickerInfo;
+ int nColumnMax = 0, i = 0;
+ BOOL bSuccess = false;
+ BOOL res = 0;
+
+ pPickerInfo = GetPickerInfo(hwndPicker);
+
+ /* allocate space for the column info */
+ int *widths, *order, *tmpOrder;
+ widths = (int*)malloc(pPickerInfo->nColumnCount * sizeof(*widths));
+ order = (int*)malloc(pPickerInfo->nColumnCount * sizeof(*order));
+ tmpOrder = (int*)malloc(pPickerInfo->nColumnCount * sizeof(*tmpOrder));
+ if (!widths || !order || !tmpOrder)
+ goto done;
+
+ /* retrieve the values */
+ memset(widths, 0, pPickerInfo->nColumnCount * sizeof(*widths));
+ memset(order, 0, pPickerInfo->nColumnCount * sizeof(*order));
+ pPickerInfo->pCallbacks->pfnGetColumnWidths(widths);
+ pPickerInfo->pCallbacks->pfnGetColumnOrder(order);
+
+ /* switch the list view to LVS_REPORT style so column widths reported correctly */
+ SetWindowLong(hwndPicker, GWL_STYLE, (GetWindowLong(hwndPicker, GWL_STYLE) & ~LVS_TYPEMASK) | LVS_REPORT);
+
+ nColumnMax = Picker_GetNumColumns(hwndPicker);
+
+ if (GetUseOldControl())
+ for (i = 0; i < nColumnMax; i++)
+ widths[Picker_GetRealColumnFromViewColumn(hwndPicker, i)] = ListView_GetColumnWidth(hwndPicker, i);
+ else
+ {
+ /* Get the Column Order and save it */
+ res = ListView_GetColumnOrderArray(hwndPicker, nColumnMax, tmpOrder);
+
+ for (i = 0; i < nColumnMax; i++)
+ {
+ widths[Picker_GetRealColumnFromViewColumn(hwndPicker, i)] = ListView_GetColumnWidth(hwndPicker, i);
+ order[i] = Picker_GetRealColumnFromViewColumn(hwndPicker, tmpOrder[i]);
+ }
+ }
+
+ pPickerInfo->pCallbacks->pfnSetColumnWidths(widths);
+ pPickerInfo->pCallbacks->pfnSetColumnOrder(order);
+ bSuccess = true;
+
+done:
+ if (widths)
+ free(widths);
+ if (order)
+ free(order);
+ if (tmpOrder)
+ free(tmpOrder);
+ res++;
+ return bSuccess;
+}
diff --git a/docs/release/src/osd/winui/picker.h b/docs/release/src/osd/winui/picker.h
new file mode 100644
index 00000000000..a8ff2edf91a
--- /dev/null
+++ b/docs/release/src/osd/winui/picker.h
@@ -0,0 +1,89 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef PICKER_H
+#define PICKER_H
+
+#include <stdint.h>
+
+struct PickerCallbacks
+{
+ // Options retrieval
+ void (*pfnSetSortColumn)(int column);
+ int (*pfnGetSortColumn)(void);
+ void (*pfnSetSortReverse)(BOOL reverse);
+ BOOL (*pfnGetSortReverse)(void);
+ void (*pfnSetViewMode)(int val);
+ int (*pfnGetViewMode)(void);
+ void (*pfnSetColumnWidths)(int widths[]);
+ void (*pfnGetColumnWidths)(int widths[]);
+ void (*pfnSetColumnOrder)(int order[]);
+ void (*pfnGetColumnOrder)(int order[]);
+ void (*pfnSetColumnShown)(int shown[]);
+ void (*pfnGetColumnShown)(int shown[]);
+ BOOL (*pfnGetOffsetChildren)(void);
+
+ int (*pfnCompare)(HWND hwndPicker, int nIndex1, int nIndex2, int nSortSubItem);
+ void (*pfnDoubleClick)(void);
+ const TCHAR *(*pfnGetItemString)(HWND hwndPicker, int nItem, int nColumn, TCHAR *pszBuffer, UINT nBufferLength);
+ int (*pfnGetItemImage)(HWND hwndPicker, int nItem);
+ void (*pfnLeavingItem)(HWND hwndPicker, int nItem);
+ void (*pfnEnteringItem)(HWND hwndPicker, int nItem);
+ void (*pfnBeginListViewDrag)(NM_LISTVIEW *pnlv);
+ int (*pfnFindItemParent)(HWND hwndPicker, int nItem);
+ BOOL (*pfnOnIdle)(HWND hwndPicker);
+ void (*pfnOnHeaderContextMenu)(POINT pt, int nColumn);
+ void (*pfnOnBodyContextMenu)(POINT pt);
+};
+
+struct PickerOptions
+{
+ const struct PickerCallbacks *pCallbacks;
+ BOOL bOldControl;
+ BOOL bXPControl;
+ int nColumnCount;
+ const LPCTSTR *ppszColumnNames;
+};
+
+enum
+{
+ VIEW_LARGE_ICONS = 0,
+ VIEW_SMALL_ICONS,
+ VIEW_INLIST,
+ VIEW_REPORT,
+ VIEW_GROUPED,
+ VIEW_MAX
+};
+
+
+
+BOOL SetupPicker(HWND hwndPicker, const struct PickerOptions *pOptions);
+
+int Picker_GetViewID(HWND hwndPicker);
+void Picker_SetViewID(HWND hwndPicker, int nViewID);
+int Picker_GetRealColumnFromViewColumn(HWND hwndPicker, int nViewColumn);
+int Picker_GetViewColumnFromRealColumn(HWND hwndPicker, int nRealColumn);
+void Picker_Sort(HWND hwndPicker);
+void Picker_ResetColumnDisplay(HWND hwndPicker);
+int Picker_GetSelectedItem(HWND hwndPicker);
+void Picker_SetSelectedItem(HWND hwndPicker, uint32_t nItem);
+void Picker_SetSelectedPick(HWND hwndPicker, uint32_t nIndex);
+int Picker_GetNumColumns(HWND hWnd);
+void Picker_ClearIdle(HWND hwndPicker);
+void Picker_ResetIdle(HWND hwndPicker);
+BOOL Picker_IsIdling(HWND hwndPicker);
+void Picker_SetHeaderImageList(HWND hwndPicker, HIMAGELIST hHeaderImages);
+int Picker_InsertItemSorted(HWND hwndPicker, int nParam);
+BOOL Picker_SaveColumnWidths(HWND hwndPicker);
+
+// These are used to handle events received by the parent regarding
+// picker controls
+BOOL Picker_HandleNotify(LPNMHDR lpNmHdr);
+void Picker_HandleDrawItem(HWND hwndPicker, LPDRAWITEMSTRUCT lpDrawItemStruct);
+
+// Accessors
+const struct PickerCallbacks *Picker_GetCallbacks(HWND hwndPicker);
+int Picker_GetColumnCount(HWND hwndPicker);
+const LPCTSTR *Picker_GetColumnNames(HWND hwndPicker);
+
+#endif // PICKER_H
diff --git a/docs/release/src/osd/winui/properties.cpp b/docs/release/src/osd/winui/properties.cpp
new file mode 100644
index 00000000000..d01f23732f3
--- /dev/null
+++ b/docs/release/src/osd/winui/properties.cpp
@@ -0,0 +1,3695 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ Properties.cpp
+
+ Properties Popup and Misc UI support routines.
+
+ Created 8/29/98 by Mike Haaland (mhaaland@hypertech.com)
+
+***************************************************************************/
+
+/***************************************************************************
+
+MSH - 20070809
+--
+Notes on properties and ini files, reset and reset to default.
+----------------------------------------------------------------------------
+Each ini contains a complete option set.
+
+Priority order for option sets (Lowest to Highest):
+
+built-in defaults
+program ini (executable root filename ini)
+debug ini (if running a debug build)
+driver ini (source code root filename in which this driver is found)
+game ini (where game is the driver name for this game)
+
+To determine which option set to use, start at the top level (lowest
+priority), and overlay all higher priority ini's until the desired level
+is reached.
+
+The 'default' option set is the next priority higher up the list from
+the desired level. For the default (program.ini) level, it is also the
+default.
+
+When MAME is run, the desired level is game ini.
+
+Expected Code behavior:
+----------------------------------------------------------------------------
+This approach requires 3 option sets, 'current', 'original' and 'default'.
+
+'current': used to populate the property pages, and to initialize the
+'original' set.
+
+'original': used to evaluate if the 'Reset' button is enabled.
+If 'current' matches 'original', the 'Reset' button is disabled,
+otherwise it is enabled.
+
+'default': used to evaluate if the 'Restore to Defaults' button is enabled.
+If 'current' matches 'default', the 'Restore to Defaults' button is disabled,
+otherwise it is enabled.
+
+When editing any option set, the desired level is set to the one being
+edited, the default set for that level, is the next lower priority set found.
+
+Upon entering the properties dialog:
+a) 'current' is initialized
+b) 'original' is initialized by 'current'
+c) 'default' is initialized
+d) Populate Property pages with 'current'
+e) 'Reset' and 'Restore to Defaults' buttons are evaluated.
+
+After any change:
+a) 'current' is updated
+b) 'Reset' and 'Restore to Defaults' buttons are re-evaluated.
+
+Reset:
+a) 'current' is reinitialized to 'original'
+b) Re-populate Property pages with 'current'
+c) 'Reset' and 'Restore to Defaults' buttons are re-evaluated.
+
+Restore to Defaults:
+a) 'current' is reinitialized to 'default'
+b) Re-populate Property pages with 'current'
+b) 'Reset' and 'Restore to Defaults' buttons are re-evaluated.
+
+Apply:
+a) 'original' is reinitialized to 'current'
+b) 'Reset' and 'Restore to defaults' are re-evaluated.
+c) If they 'current' matches 'default', remove the ini from disk.
+ Otherwise, write the ini to disk.
+
+Cancel:
+a) Exit the dialog.
+
+OK:
+a) If they 'current' matches 'default', remove the ini from disk.
+ Otherwise, write the ini to disk.
+b) Exit the dialog.
+
+
+***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+
+// standard C headers
+#include <tchar.h>
+#include <sys/stat.h> // for S_IFDIR
+
+// MAME/MAMEUI headers
+#include "emu.h"
+#include "screen.h"
+#include "mui_audit.h"
+#include "mui_opts.h"
+#include "resource.h"
+#include "dijoystick.h" /* For DIJoystick availability. */
+#include "mui_util.h"
+#include "datamap.h"
+#include "help.h"
+#include "winui.h"
+#include "strconv.h"
+#include "winutf8.h"
+#include "directories.h"
+#include "sound/samples.h"
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+#include "newuires.h"
+#ifdef UI_DIRECTDRAW
+#include "directdraw.h" /* has to be after samples.h */
+#endif
+#include "properties.h"
+#include "drivenum.h"
+#include "machine/ram.h"
+#include <shlwapi.h>
+
+
+#if defined(__GNUC__)
+/* fix warning: cast does not match function type */
+#undef PropSheet_GetTabControl
+#define PropSheet_GetTabControl(d) (HWND)(LRESULT)(int)SendMessage((d),PSM_GETTABCONTROL,0,0)
+#endif /* defined(__GNUC__) */
+
+/* Enable this if MAME supports multiple versions of D3D */
+//#define D3DVERSION
+
+/***************************************************************
+ * Imported function prototypes
+ ***************************************************************/
+
+/**************************************************************
+ * Local function prototypes
+ **************************************************************/
+
+static void SetSamplesEnabled(HWND hWnd, int nIndex, BOOL bSoundEnabled);
+static void InitializeOptions(HWND hDlg);
+static void InitializeMisc(HWND hDlg);
+static void OptOnHScroll(HWND hWnd, HWND hwndCtl, UINT code, int pos);
+static void NumScreensSelectionChange(HWND hwnd);
+static void RefreshSelectionChange(HWND hWnd, HWND hWndCtrl);
+static void InitializeSoundUI(HWND hwnd);
+static void InitializeSkippingUI(HWND hwnd);
+static void InitializeRotateUI(HWND hwnd);
+static void UpdateSelectScreenUI(HWND hwnd);
+static void InitializeSelectScreenUI(HWND hwnd);
+#ifdef D3DVERSION
+static void InitializeD3DVersionUI(HWND hwnd);
+#endif
+static void InitializeVideoUI(HWND hwnd);
+static void InitializeBIOSUI(HWND hwnd);
+static void InitializeControllerMappingUI(HWND hwnd);
+static void InitializeLanguageUI(HWND hWnd);
+static void InitializePluginsUI(HWND hWnd);
+//static void InitializeGLSLFilterUI(HWND hWnd);
+static void UpdateOptions(HWND hDlg, datamap *map, windows_options &opts);
+static void UpdateProperties(HWND hDlg, datamap *map, windows_options &opts);
+static void PropToOptions(HWND hWnd, windows_options &o);
+static void OptionsToProp(HWND hWnd, windows_options &o);
+static void SetPropEnabledControls(HWND hWnd);
+static bool SelectLUAScript(HWND hWnd);
+static bool ResetLUAScript(HWND hWnd);
+static bool SelectPlugins(HWND hWnd);
+static bool ResetPlugins(HWND hWnd);
+//static bool SelectBGFXChains(HWND hWnd);
+//static bool ResetBGFXChains(HWND hWnd);
+static BOOL SelectEffect(HWND hWnd);
+static BOOL ResetEffect(HWND hWnd);
+static BOOL SelectJoystickMap(HWND hWnd);
+static BOOL ResetJoystickMap(HWND hWnd);
+static BOOL SelectDebugscript(HWND hWnd);
+static BOOL ResetDebugscript(HWND hWnd);
+
+static void BuildDataMap(void);
+static void ResetDataMap(HWND hWnd);
+
+static void UpdateBackgroundBrush(HWND hwndTab);
+static HBRUSH hBkBrush;
+
+#ifdef MESS
+static BOOL DirListReadControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name);
+static BOOL DirListPopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name);
+static BOOL RamPopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name);
+extern BOOL BrowseForDirectory(HWND hwnd, LPCTSTR pStartDir, TCHAR* pResult);
+//static BOOL g_bModifiedSoftwarePaths = false;
+#endif
+
+/**************************************************************
+ * Local private variables
+ **************************************************************/
+
+/* No longer used by the core, but we need it to predefine configurable screens for all games. */
+#ifndef MAX_SCREENS
+/* maximum number of screens for one game */
+#define MAX_SCREENS 4
+#endif
+
+static windows_options pOrigOpts, pDefaultOpts, pCurrentOpts;
+static datamap *properties_datamap;
+
+static int g_nGame = 0;
+static int g_nFolder = 0;
+static int g_nFolderGame = 0;
+static OPTIONS_TYPE g_nPropertyMode = OPTIONS_GAME;
+static BOOL g_bAutoAspect[MAX_SCREENS] = {false, false, false, false};
+static BOOL g_bAutoSnapSize = false;
+static HICON g_hIcon = NULL;
+std::vector<string> plugin_names(32);
+
+/* Property sheets */
+
+#define HIGHLIGHT_COLOR RGB(0,196,0)
+static HBRUSH highlight_brush = NULL;
+static HBRUSH background_brush = NULL;
+
+#define ORIENTATION_COLOR RGB( 190, 128, 0) //LIGHT BROWN
+#define VECTOR_COLOR RGB( 190, 0, 0) //DARK RED
+#define FOLDER_COLOR RGB( 0, 128, 0 ) // DARK GREEN
+#define PARENT_COLOR RGB( 190, 128, 192 ) // PURPLE
+#define GAME_COLOR RGB( 0, 128, 192 ) // DARK BLUE
+
+
+BOOL PropSheetFilter_Vector(const machine_config *drv, const game_driver *gamedrv)
+{
+ return isDriverVector(drv);
+}
+
+/* Help IDs - moved to auto-generated helpids.c */
+extern const DWORD dwHelpIDs[];
+
+typedef struct
+{
+ const TCHAR* m_pText;
+ const char* m_pData;
+}
+DUALCOMBOSTR;
+
+typedef struct
+{
+ const TCHAR* m_pText;
+ const int m_pData;
+}
+DUALCOMBOINT;
+
+const DUALCOMBOSTR g_ComboBoxVideo[] =
+{
+ { TEXT("Auto"), "auto" },
+ { TEXT("GDI"), "gdi" },
+#ifdef UI_DIRECTDRAW
+ { TEXT("DirectDraw"), "ddraw" }, // removed 20160217
+#endif
+ { TEXT("Direct3D"), "d3d" },
+ { TEXT("BGFX"), "bgfx" },
+ { TEXT("OpenGL"), "opengl" },
+};
+#define NUMVIDEO (sizeof(g_ComboBoxVideo) / sizeof(g_ComboBoxVideo[0]))
+
+const DUALCOMBOSTR g_ComboBoxSound[] =
+{
+ { TEXT("None"), "none" },
+ { TEXT("Auto"), "auto" },
+ { TEXT("DirectSound"), "dsound" },
+ { TEXT("PortAudio"), "portaudio" },
+// { TEXT("XAudio2"), "xaudio2" }, // invalid option
+};
+#define NUMSOUND (sizeof(g_ComboBoxSound) / sizeof(g_ComboBoxSound[0]))
+#ifdef D3DVERSION
+const DUALCOMBOINT g_ComboBoxD3DVersion[] =
+{
+ { TEXT("Version 9"), 9 },
+// { TEXT("Version 8"), 8 },
+};
+
+#define NUMD3DVERSIONS (sizeof(g_ComboBoxD3DVersion) / sizeof(g_ComboBoxD3DVersion[0]))
+#define WINOPTION_D3DVERSION "9"
+#endif
+const DUALCOMBOINT g_ComboBoxSelectScreen[] =
+{
+ { TEXT("Screen 0"), 0 },
+ { TEXT("Screen 1"), 1 },
+ { TEXT("Screen 2"), 2 },
+ { TEXT("Screen 3"), 3 },
+};
+#define NUMSELECTSCREEN (sizeof(g_ComboBoxSelectScreen) / sizeof(g_ComboBoxSelectScreen[0]))
+
+const DUALCOMBOSTR g_ComboBoxView[] =
+{
+ { TEXT("Auto"), "auto" },
+ { TEXT("Standard"), "standard" },
+ { TEXT("Pixel Aspect"), "pixel" },
+ { TEXT("Cocktail"), "cocktail" },
+};
+#define NUMVIEW (sizeof(g_ComboBoxView) / sizeof(g_ComboBoxView[0]))
+
+
+
+const DUALCOMBOSTR g_ComboBoxDevice[] =
+{
+ { TEXT("None"), "none" },
+ { TEXT("Keyboard"), "keyboard" },
+ { TEXT("Mouse"), "mouse" },
+ { TEXT("Joystick"), "joystick" },
+ { TEXT("Lightgun"), "lightgun" },
+};
+
+#define NUMDEVICES (sizeof(g_ComboBoxDevice) / sizeof(g_ComboBoxDevice[0]))
+
+const DUALCOMBOSTR g_ComboBoxSnapView[] =
+{
+ { TEXT("Internal"), "internal" },
+ { TEXT("Auto"), "auto" },
+ { TEXT("Standard"), "standard" },
+ { TEXT("Pixel Aspect"), "pixel" },
+ { TEXT("Cocktail"), "cocktail" },
+};
+#define NUMSNAPVIEW (sizeof(g_ComboBoxSnapView) / sizeof(g_ComboBoxSnapView[0]))
+
+
+/***************************************************************
+ * Public functions
+ ***************************************************************/
+
+
+int PropertiesCurrentGame(HWND hDlg)
+{
+ return g_nGame;
+}
+
+DWORD_PTR GetHelpIDs(void)
+{
+ return (DWORD_PTR)dwHelpIDs;
+}
+
+static int GetSelectedScreen(HWND hWnd)
+{
+ int nSelectedScreen = 0;
+ HWND hCtrl = GetDlgItem(hWnd, IDC_SCREENSELECT);
+ if (hCtrl)
+ nSelectedScreen = ComboBox_GetCurSel(hCtrl);
+ if ((nSelectedScreen < 0) || (nSelectedScreen >= NUMSELECTSCREEN))
+ nSelectedScreen = 0;
+ return nSelectedScreen;
+
+}
+
+static PROPSHEETPAGE *CreatePropSheetPages(HINSTANCE hInst, BOOL bOnlyDefault,
+// const game_driver *gamedrv, UINT *pnMaxPropSheets, BOOL isGame )
+ int nGame, UINT *pnMaxPropSheets, BOOL isGame )
+{
+ PROPSHEETPAGE *pspages;
+ int maxPropSheets = 0;
+ int possiblePropSheets;
+ int i = ( isGame ) ? 0 : 2;
+
+ for (; g_propSheets[i].pfnDlgProc; i++)
+ ;
+
+ possiblePropSheets = (isGame) ? i + 1 : i - 1;
+
+ pspages = (PROPSHEETPAGE *)malloc(sizeof(PROPSHEETPAGE) * possiblePropSheets);
+ if (!pspages)
+ return NULL;
+
+ memset(pspages, 0, sizeof(PROPSHEETPAGE) * possiblePropSheets);
+
+ i = ( isGame ) ? 0 : 2;
+
+ for (; g_propSheets[i].pfnDlgProc; i++)
+ {
+ if (nGame < 0)
+ {
+ if (g_propSheets[i].bOnDefaultPage)
+ {
+ pspages[maxPropSheets].dwSize = sizeof(PROPSHEETPAGE);
+ pspages[maxPropSheets].dwFlags = 0;
+ pspages[maxPropSheets].hInstance = hInst;
+ pspages[maxPropSheets].pszTemplate = MAKEINTRESOURCE(g_propSheets[i].dwDlgID);
+ pspages[maxPropSheets].pfnCallback = NULL;
+ pspages[maxPropSheets].lParam = 0;
+ pspages[maxPropSheets].pfnDlgProc = g_propSheets[i].pfnDlgProc;
+ maxPropSheets++;
+ }
+ }
+ else
+ if ((nGame >= 0) || g_propSheets[i].bOnDefaultPage)
+ {
+ //machine_config config(*gamedrv,pCurrentOpts);
+
+// if (!gamedrv || !g_propSheets[i].pfnFilterProc || g_propSheets[i].pfnFilterProc(&config, gamedrv))
+ if (nGame < 0 || !g_propSheets[i].pfnFilterProc || g_propSheets[i].pfnFilterProc(nGame))
+ {
+ pspages[maxPropSheets].dwSize = sizeof(PROPSHEETPAGE);
+ pspages[maxPropSheets].dwFlags = 0;
+ pspages[maxPropSheets].hInstance = hInst;
+ pspages[maxPropSheets].pszTemplate = MAKEINTRESOURCE(g_propSheets[i].dwDlgID);
+ pspages[maxPropSheets].pfnCallback = NULL;
+ pspages[maxPropSheets].lParam = 0;
+ pspages[maxPropSheets].pfnDlgProc = g_propSheets[i].pfnDlgProc;
+ maxPropSheets++;
+ }
+ }
+ }
+
+ if (pnMaxPropSheets)
+ *pnMaxPropSheets = maxPropSheets;
+
+ return pspages;
+}
+
+// This is for the DEFAULT property-page options only
+void InitDefaultPropertyPage(HINSTANCE hInst, HWND hWnd)
+{
+ // clear globals
+ g_nGame = GLOBAL_OPTIONS;
+ windows_options dummy;
+ OptionsCopy(dummy,pDefaultOpts);
+ OptionsCopy(dummy,pOrigOpts);
+ OptionsCopy(dummy,pCurrentOpts);
+
+ /* Get default options to populate property sheets */
+ load_options(pCurrentOpts, OPTIONS_GLOBAL, g_nGame, 0);
+ load_options(pOrigOpts, OPTIONS_GLOBAL, g_nGame, 0);
+ load_options(pDefaultOpts, OPTIONS_GLOBAL, -2, 0);
+
+ g_nPropertyMode = OPTIONS_GLOBAL;
+ BuildDataMap();
+
+ PROPSHEETHEADER pshead;
+ ZeroMemory(&pshead, sizeof(pshead));
+
+ PROPSHEETPAGE *pspage;
+ pspage = CreatePropSheetPages(hInst, true, -1, &pshead.nPages, false);
+ if (!pspage)
+ return;
+
+ /* Fill in the property sheet header */
+ pshead.hwndParent = hWnd;
+ pshead.dwSize = sizeof(PROPSHEETHEADER);
+ pshead.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_PROPTITLE;
+ pshead.hInstance = hInst;
+ pshead.pszCaption = TEXT("Default Game");
+ pshead.nStartPage = 0;
+ pshead.pszIcon = MAKEINTRESOURCE(IDI_MAMEUI_ICON);
+ pshead.ppsp = pspage;
+
+ /* Create the Property sheet and display it */
+ if (PropertySheet(&pshead) == -1)
+ {
+ char temp[100];
+ DWORD dwError = GetLastError();
+ sprintf(temp, "Property Sheet Error %d %X", (int)dwError, (int)dwError);
+ win_message_box_utf8(0, temp, "Error", IDOK);
+ }
+
+ free(pspage);
+}
+
+/* Initialize the property pages for anything but the Default option set */
+void InitPropertyPage(HINSTANCE hInst, HWND hWnd, HICON hIcon, OPTIONS_TYPE opt_type, int folder_id, int game_num)
+{
+ InitPropertyPageToPage(hInst, hWnd, hIcon, opt_type, folder_id, game_num, PROPERTIES_PAGE);
+}
+
+void InitPropertyPageToPage(HINSTANCE hInst, HWND hWnd, HICON hIcon, OPTIONS_TYPE opt_type, int folder_id, int game_num, int start_page )
+{
+ if (highlight_brush == NULL)
+ highlight_brush = CreateSolidBrush(HIGHLIGHT_COLOR);
+
+ if (background_brush == NULL)
+ background_brush = CreateSolidBrush(GetSysColor(COLOR_3DFACE));
+
+ // Initialize the options
+ windows_options dummy;
+ OptionsCopy(dummy,pDefaultOpts);
+ OptionsCopy(dummy,pOrigOpts);
+ OptionsCopy(dummy,pCurrentOpts);
+
+ load_options(pCurrentOpts, opt_type, game_num, 1);
+ load_options(pOrigOpts, opt_type, game_num, 1);
+ if (game_num == GLOBAL_OPTIONS)
+ load_options(pDefaultOpts, OPTIONS_GLOBAL, -2, 0); // base opts is the backup for global
+ else
+ load_options(pDefaultOpts, OPTIONS_GLOBAL, -1, 0); // global is the backup for games
+
+ // Copy icon to use for the property pages
+ g_hIcon = CopyIcon(hIcon);
+
+ // These MUST be valid, they are used as indicies
+ g_nGame = game_num;
+ g_nFolder = folder_id;
+
+ // Keep track of OPTIONS_TYPE that was passed in.
+ g_nPropertyMode = opt_type;
+
+ BuildDataMap();
+
+ PROPSHEETHEADER pshead;
+ ZeroMemory(&pshead, sizeof(PROPSHEETHEADER));
+
+ // Set the game to audit to this game
+
+ // Create the property sheets
+ PROPSHEETPAGE *pspage;
+ if( OPTIONS_GAME == opt_type )
+ {
+ InitGameAudit(game_num);
+ pspage = CreatePropSheetPages(hInst, false, game_num, &pshead.nPages, true);
+ }
+ else
+ pspage = CreatePropSheetPages(hInst, false, -1, &pshead.nPages, false);
+
+ if (!pspage)
+ return;
+
+ // Get the description use as the dialog caption.
+ TCHAR* t_description = 0;
+ switch( opt_type )
+ {
+ case OPTIONS_GAME:
+ t_description = ui_wstring_from_utf8(ModifyThe(driver_list::driver(g_nGame).type.fullname()));
+ break;
+ case OPTIONS_SOURCE:
+ t_description = ui_wstring_from_utf8(GetDriverFilename(g_nGame));
+ break;
+ case OPTIONS_GLOBAL:
+ t_description = ui_wstring_from_utf8("Default Settings");
+ break;
+ default:
+ return;
+ }
+ // If we have no description, return.
+ if( !t_description )
+ return;
+
+ /* Fill in the property sheet header */
+ pshead.pszCaption = t_description;
+ pshead.hwndParent = hWnd;
+ pshead.dwSize = sizeof(PROPSHEETHEADER);
+ pshead.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_PROPTITLE;
+ pshead.hInstance = hInst;
+ pshead.nStartPage = start_page;
+ pshead.pszIcon = MAKEINTRESOURCE(IDI_MAMEUI_ICON);
+ pshead.ppsp = pspage;
+
+ /* Create the Property sheet and display it */
+ if (PropertySheet(&pshead) == -1)
+ {
+ char temp[100];
+ DWORD dwError = GetLastError();
+ sprintf(temp, "Property Sheet Error %d %X", (int)dwError, (int)dwError);
+ win_message_box_utf8(0, temp, "Error", IDOK);
+ }
+
+ free(t_description);
+ free(pspage);
+}
+
+
+/*********************************************************************
+ * Local Functions
+ *********************************************************************/
+#define WINUI_ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
+
+/* Build CPU info string */
+static char *GameInfoCPU(int nIndex)
+{
+ machine_config config(driver_list::driver(nIndex), MameUIGlobal());
+ execute_interface_iterator cpuiter(config.root_device());
+ std::unordered_set<std::string> exectags;
+ static char buffer[1024];
+
+ memset(&buffer, 0, sizeof(buffer));
+
+ for (device_execute_interface &exec : cpuiter)
+ {
+ if (!exectags.insert(exec.device().tag()).second)
+ continue;
+
+ char temp[300];
+ int count = 1;
+ int clock = exec.device().clock();
+ const char *name = exec.device().name();
+
+ for (device_execute_interface &scan : cpuiter)
+ {
+ if (exec.device().type() == scan.device().type() && strcmp(name, scan.device().name()) == 0 && clock == scan.device().clock())
+ if (exectags.insert(scan.device().tag()).second)
+ count++;
+ }
+
+ if (count > 1)
+ {
+ snprintf(temp, WINUI_ARRAY_LENGTH(temp), "%d x ", count);
+ strcat(buffer, temp);
+ }
+
+ if (clock >= 1000000)
+ snprintf(temp, WINUI_ARRAY_LENGTH(temp), "%s %d.%06d MHz\r\n", name, clock / 1000000, clock % 1000000);
+ else
+ snprintf(temp, WINUI_ARRAY_LENGTH(temp), "%s %d.%03d kHz\r\n", name, clock / 1000, clock % 1000);
+
+ strcat(buffer, temp);
+ }
+
+ return buffer;
+}
+
+/* Build Sound system info string */
+static char *GameInfoSound(int nIndex)
+{
+ machine_config config(driver_list::driver(nIndex), MameUIGlobal());
+ sound_interface_iterator sounditer(config.root_device());
+ std::unordered_set<std::string> soundtags;
+ static char buffer[1024];
+
+ memset(&buffer, 0, sizeof(buffer));
+
+ for (device_sound_interface &sound : sounditer)
+ {
+ if (!soundtags.insert(sound.device().tag()).second)
+ continue;
+
+ char temp[300];
+ int count = 1;
+ int clock = sound.device().clock();
+ const char *name = sound.device().name();
+
+ for (device_sound_interface &scan : sounditer)
+ {
+ if (sound.device().type() == scan.device().type() && strcmp(name, scan.device().name()) == 0 && clock == scan.device().clock())
+ if (soundtags.insert(scan.device().tag()).second)
+ count++;
+ }
+
+ if (count > 1)
+ {
+ snprintf(temp, WINUI_ARRAY_LENGTH(temp), "%d x ", count);
+ strcat(buffer, temp);
+ }
+
+ strcat(buffer, name);
+
+ if (clock)
+ {
+ if (clock >= 1000000)
+ snprintf(temp, WINUI_ARRAY_LENGTH(temp), " %d.%06d MHz", clock / 1000000, clock % 1000000);
+ else
+ snprintf(temp, WINUI_ARRAY_LENGTH(temp), " %d.%03d kHz", clock / 1000, clock % 1000);
+
+ strcat(buffer, temp);
+ }
+
+ strcat(buffer, "\r\n");
+ }
+
+ return buffer;
+}
+
+/* Build Display info string */
+static char *GameInfoScreen(UINT nIndex)
+{
+ static char buf[2048];
+ machine_config config(driver_list::driver(nIndex),pCurrentOpts);
+ memset(buf, '\0', 2048);
+
+ if (isDriverVector(&config))
+ strcpy(buf, "Vector Game");
+ else
+ {
+ screen_device_iterator iter(config.root_device());
+ const screen_device *screen = iter.first();
+ if (screen == NULL)
+ strcpy(buf, "Screenless Game");
+ else
+ {
+ for (screen_device &screen : screen_device_iterator(config.root_device()))
+ {
+ char tmpbuf[2048];
+ const rectangle &visarea = screen.visible_area();
+
+ if (BIT(GetDriverCacheLower(nIndex), 2)) //ORIENTATION_SWAP_XY
+ {
+ sprintf(tmpbuf,"%d x %d (V) %f Hz\n",
+ visarea.max_y - visarea.min_y + 1,
+ visarea.max_x - visarea.min_x + 1,
+ ATTOSECONDS_TO_HZ(screen.refresh_attoseconds()));
+ }
+ else
+ {
+ sprintf(tmpbuf,"%d x %d (H) %f Hz\n",
+ visarea.max_x - visarea.min_x + 1,
+ visarea.max_y - visarea.min_y + 1,
+ ATTOSECONDS_TO_HZ(screen.refresh_attoseconds()));
+ }
+ strcat(buf, tmpbuf);
+ }
+ }
+ }
+ return buf;
+}
+
+
+/* Build game status string */
+const char *GameInfoStatus(int driver_index, BOOL bRomStatus)
+{
+ static char buffer[2048];
+ memset(buffer,0,sizeof(char)*2048);
+ if (driver_index < 0)
+ return buffer;
+
+ int audit_result = GetRomAuditResults(driver_index);
+ uint32_t cache = GetDriverCacheLower(driver_index);
+ if ( bRomStatus )
+ {
+ if (IsAuditResultKnown(audit_result) == false)
+ strcpy(buffer, "Unknown");
+ else
+ if (IsAuditResultYes(audit_result))
+ {
+ if (DriverIsBroken(driver_index))
+ {
+ strcpy(buffer, "Not working");
+
+ if (BIT(cache, 22))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game protection isn't fully emulated");
+ }
+ if (BIT(cache, 21))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Colors are completely wrong");
+ }
+ if (BIT(cache, 20))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Colors aren't 100% accurate");
+ }
+ if (BIT(cache, 18))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Video emulation isn't 100% accurate");
+ }
+ if (BIT(cache, 17))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game lacks sound");
+ }
+ if (BIT(cache, 16))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Sound emulation isn't 100% accurate");
+ }
+ if (BIT(cache, 8))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Screen flipping is not supported");
+ }
+ if (BIT(cache, 10))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game requires artwork");
+ }
+ }
+ else
+ {
+ strcpy(buffer, "Working");
+
+ if (BIT(cache, 22))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game protection isn't fully emulated");
+ }
+ if (BIT(cache, 21))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Colors are completely wrong");
+ }
+ if (BIT(cache, 20))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Colors aren't 100% accurate");
+ }
+ if (BIT(cache, 18))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Video emulation isn't 100% accurate");
+ }
+ if (BIT(cache, 17))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game lacks sound");
+ }
+ if (BIT(cache, 16))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Sound emulation isn't 100% accurate");
+ }
+ if (BIT(cache, 8))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Screen flipping is not supported");
+ }
+ if (BIT(cache, 10))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game requires artwork");
+ }
+ }
+ }
+ else
+ // audit result is no
+ strcpy(buffer, "BIOS missing");
+ }
+ else
+ {
+ //Just show the emulation flags
+ if (DriverIsBroken(driver_index))
+ strcpy(buffer, "Not working");
+ else
+ strcpy(buffer, "Working");
+
+ if (BIT(cache, 22))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game protection isn't fully emulated");
+ }
+ if (BIT(cache, 21))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Colors are completely wrong");
+ }
+ if (BIT(cache, 20))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Colors aren't 100% accurate");
+ }
+ if (BIT(cache, 18))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Video emulation isn't 100% accurate");
+ }
+ if (BIT(cache, 17))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game lacks sound");
+ }
+ if (BIT(cache, 16))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Sound emulation isn't 100% accurate");
+ }
+ if (BIT(cache, 8))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Screen flipping is not supported");
+ }
+ if (BIT(cache, 10))
+ {
+ if (*buffer != '\0')
+ strcat(buffer, "\r\n");
+ strcat(buffer, "Game requires artwork");
+ }
+ }
+ return buffer;
+}
+
+/* Build game manufacturer string */
+static char *GameInfoManufactured(UINT nIndex)
+{
+ static char buffer[1024];
+
+ snprintf(buffer,sizeof(buffer),"%s %s",driver_list::driver(nIndex).year,driver_list::driver(nIndex).manufacturer);
+ return buffer;
+}
+
+/* Build Game title string */
+char *GameInfoTitle(OPTIONS_TYPE opt_type, UINT nIndex)
+{
+ static char buf[1024];
+
+ if (OPTIONS_GLOBAL == opt_type)
+ strcpy(buf, "Global game options\nDefault options used by all games");
+ else
+ if (OPTIONS_SOURCE == opt_type)
+ strcpy(buf, "Options used by all games in the source");
+ else
+ if (OPTIONS_VECTOR == opt_type)
+ strcpy(buf, "Global vector options");
+ else
+ if (OPTIONS_GAME == opt_type)
+ sprintf(buf, "%s\n\"%s\"", ModifyThe(driver_list::driver(nIndex).type.fullname()), driver_list::driver(nIndex).name);
+ return buf;
+}
+
+/* Build game clone information string */
+static char *GameInfoCloneOf(UINT nIndex)
+{
+ static char buf[1024];
+ int nParentIndex= -1;
+
+ buf[0] = '\0';
+
+ if (DriverIsClone(nIndex))
+ {
+ nParentIndex = GetParentIndex(&driver_list::driver(nIndex));
+ sprintf(buf, "%s - \"%s\"",
+ ConvertAmpersandString(ModifyThe(driver_list::driver(nParentIndex).type.fullname())),
+ driver_list::driver(nParentIndex).name);
+ }
+
+ return buf;
+}
+
+static const char * GameInfoSource(UINT nIndex)
+{
+ return GetDriverFilename(nIndex);
+}
+
+/* Handle the information property page */
+INT_PTR CALLBACK GamePropertiesDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+HWND hWnd;
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ if (g_hIcon)
+ SendDlgItemMessage(hDlg, IDC_GAME_ICON, STM_SETICON, (WPARAM) g_hIcon, 0);
+#if defined(USE_SINGLELINE_TABCONTROL)
+ {
+ HWND hWnd = PropSheet_GetTabControl(GetParent(hDlg));
+ DWORD tabStyle = (GetWindowLong(hWnd,GWL_STYLE) & ~TCS_MULTILINE);
+ SetWindowLong(hWnd,GWL_STYLE,tabStyle | TCS_SINGLELINE);
+ }
+#endif
+
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_TITLE), GameInfoTitle(g_nPropertyMode, g_nGame));
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_MANUFACTURED), GameInfoManufactured(g_nGame));
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_STATUS), GameInfoStatus(g_nGame, false));
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_CPU), GameInfoCPU(g_nGame));
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_SOUND), GameInfoSound(g_nGame));
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_SCREEN), GameInfoScreen(g_nGame));
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_CLONEOF), GameInfoCloneOf(g_nGame));
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_SOURCE), GameInfoSource(g_nGame));
+
+ if (DriverIsClone(g_nGame))
+ ShowWindow(GetDlgItem(hDlg, IDC_PROP_CLONEOF_TEXT), SW_SHOW);
+ else
+ ShowWindow(GetDlgItem(hDlg, IDC_PROP_CLONEOF_TEXT), SW_HIDE);
+
+ hWnd = PropSheet_GetTabControl(GetParent(hDlg));
+ UpdateBackgroundBrush(hWnd);
+ ShowWindow(hDlg, SW_SHOW);
+ return 1;
+ }
+ return 0;
+}
+
+/* Handle all options property pages */
+INT_PTR CALLBACK GameOptionsProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ BOOL g_bUseDefaults = false, g_bReset = false;
+
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ /* Fill in the Game info at the top of the sheet */
+ win_set_window_text_utf8(GetDlgItem(hDlg, IDC_PROP_TITLE), GameInfoTitle(g_nPropertyMode, g_nGame));
+ InitializeOptions(hDlg);
+ InitializeMisc(hDlg);
+
+ UpdateProperties(hDlg, properties_datamap, pCurrentOpts);
+
+ g_bUseDefaults = AreOptionsEqual(pCurrentOpts, pDefaultOpts) ? false : true;
+ g_bReset = AreOptionsEqual(pCurrentOpts, pOrigOpts) ? false : true;
+
+ // Default button doesn't exist on Default settings
+// if (g_nGame == GLOBAL_OPTIONS)
+// ShowWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), SW_HIDE);
+// else
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), g_bUseDefaults);
+
+ // Setup Reset button
+ EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset);
+ ShowWindow(hDlg, SW_SHOW);
+ return 1;
+
+ case WM_HSCROLL:
+ /* slider changed */
+ HANDLE_WM_HSCROLL(hDlg, wParam, lParam, OptOnHScroll);
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), true);
+
+ // Enable Apply button
+ PropSheet_Changed(GetParent(hDlg), hDlg);
+
+ // make sure everything's copied over, to determine what's changed
+ UpdateOptions(hDlg, properties_datamap, pCurrentOpts);
+
+ // redraw it, it might be a new color now
+ InvalidateRect((HWND)lParam,NULL,true);
+
+ break;
+
+ case WM_COMMAND:
+ {
+ /* Below, 'changed' is used to signify the 'Apply' button should be enabled. */
+ WORD wID = GET_WM_COMMAND_ID(wParam, lParam);
+ HWND hWndCtrl = GET_WM_COMMAND_HWND(wParam, lParam);
+ WORD wNotifyCode = GET_WM_COMMAND_CMD(wParam, lParam);
+ BOOL changed = false;
+ int nCurSelection = 0;
+ TCHAR szClass[256];
+
+ switch (wID)
+ {
+ case IDC_REFRESH:
+ if (wNotifyCode == LBN_SELCHANGE)
+ {
+ RefreshSelectionChange(hDlg, hWndCtrl);
+ changed = true;
+ }
+ break;
+
+ case IDC_ASPECT:
+ nCurSelection = Button_GetCheck( GetDlgItem(hDlg, IDC_ASPECT));
+ if( g_bAutoAspect[GetSelectedScreen(hDlg)] != nCurSelection )
+ {
+ changed = true;
+ g_bAutoAspect[GetSelectedScreen(hDlg)] = nCurSelection;
+ }
+ break;
+
+ case IDC_SNAPSIZE:
+ nCurSelection = Button_GetCheck( GetDlgItem(hDlg, IDC_SNAPSIZE));
+ if( g_bAutoSnapSize != nCurSelection )
+ {
+ changed = true;
+ g_bAutoSnapSize = nCurSelection;
+ }
+ break;
+
+ case IDC_SELECT_EFFECT:
+ changed = SelectEffect(hDlg);
+ break;
+
+ case IDC_RESET_EFFECT:
+ changed = ResetEffect(hDlg);
+ break;
+
+ case IDC_SELECT_JOYSTICKMAP:
+ changed = SelectJoystickMap(hDlg);
+ break;
+
+ case IDC_RESET_JOYSTICKMAP:
+ changed = ResetJoystickMap(hDlg);
+ break;
+
+ case IDC_SELECT_DEBUGSCRIPT:
+ changed = SelectDebugscript(hDlg);
+ break;
+
+ case IDC_RESET_DEBUGSCRIPT:
+ changed = ResetDebugscript(hDlg);
+ break;
+
+ case IDC_SELECT_LUASCRIPT:
+ changed = SelectLUAScript(hDlg);
+ break;
+
+ case IDC_RESET_LUASCRIPT:
+ changed = ResetLUAScript(hDlg);
+ break;
+
+ case IDC_SELECT_PLUGIN:
+ changed = SelectPlugins(hDlg);
+ break;
+
+ case IDC_RESET_PLUGIN:
+ changed = ResetPlugins(hDlg);
+ break;
+
+ case IDC_PROP_RESET:
+ // RESET Button - Only do it if mouse-clicked
+ if (wNotifyCode != BN_CLICKED)
+ break;
+
+ // Change settings in property sheets back to original
+ UpdateProperties(hDlg, properties_datamap, pOrigOpts);
+ // The original options become the current options.
+ UpdateOptions(hDlg, properties_datamap, pCurrentOpts);
+
+ g_bUseDefaults = AreOptionsEqual(pCurrentOpts, pDefaultOpts) ? false : true;
+ g_bReset = AreOptionsEqual(pCurrentOpts, pOrigOpts) ? false : true;
+ // Turn off Apply
+ PropSheet_UnChanged(GetParent(hDlg), hDlg);
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), g_bUseDefaults);
+ EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset);
+ break;
+
+ case IDC_USE_DEFAULT:
+ // DEFAULT Button - Only do it if mouse-clicked
+ if (wNotifyCode != BN_CLICKED)
+ break;
+
+ // Change settings to be the same as mame.ini
+ UpdateProperties(hDlg, properties_datamap, pDefaultOpts);
+ // The original options become the current options.
+ UpdateOptions(hDlg, properties_datamap, pCurrentOpts);
+
+ g_bUseDefaults = AreOptionsEqual(pCurrentOpts, pDefaultOpts) ? false : true;
+ g_bReset = AreOptionsEqual(pCurrentOpts, pOrigOpts) ? false : true;
+ // Enable/Disable the Reset to Defaults button
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), g_bUseDefaults);
+ EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset);
+ // Tell the dialog to enable/disable the apply button.
+ if (g_nGame != GLOBAL_OPTIONS)
+ {
+ if (g_bReset)
+ PropSheet_Changed(GetParent(hDlg), hDlg);
+ else
+ PropSheet_UnChanged(GetParent(hDlg), hDlg);
+ }
+ break;
+
+ // MSH 20070813 - Update all related controls
+ case IDC_SCREENSELECT:
+ case IDC_SCREEN:
+ // NPW 3-Apr-2007: Ugh I'm only perpetuating the vile hacks in this code
+ if ((wNotifyCode == CBN_SELCHANGE) || (wNotifyCode == CBN_SELENDOK))
+ {
+ changed = datamap_read_control(properties_datamap, hDlg, pCurrentOpts, wID);
+ datamap_populate_control(properties_datamap, hDlg, pCurrentOpts, IDC_SIZES);
+ //MSH 20070814 - Hate to do this, but its either this, or update each individual
+ // control on the SCREEN tab.
+ UpdateProperties(hDlg, properties_datamap, pCurrentOpts);
+ changed = true;
+ /* NOT USED *************
+ datamap_populate_control(properties_datamap, hDlg, pCurrentOpts, IDC_SCREENSELECT);
+ datamap_populate_control(properties_datamap, hDlg, pCurrentOpts, IDC_SCREEN);
+ datamap_populate_control(properties_datamap, hDlg, pCurrentOpts, IDC_REFRESH);
+ datamap_populate_control(properties_datamap, hDlg, pCurrentOpts, IDC_SIZES);
+ datamap_populate_control(properties_datamap, hDlg, pCurrentOpts, IDC_VIEW);
+ datamap_populate_control(properties_datamap, hDlg, pCurrentOpts, IDC_SWITCHRES);
+
+ if (strcmp(options_get_string(pCurrentOpts, "screen0"), options_get_string(pOrigOpts, "screen0")!=0) ||
+ strcmp(options_get_string(pCurrentOpts, "screen1"), options_get_string(pOrigOpts, "screen1")!=0) ||
+ strcmp(options_get_string(pCurrentOpts, "screen2"), options_get_string(pOrigOpts, "screen2")!=0) ||
+ strcmp(options_get_string(pCurrentOpts, "screen3"), options_get_string(pOrigOpts, "screen3")!=0))
+ changed = true;
+ ************************************* */
+ }
+ break;
+ default:
+#ifdef MESS
+ if (MessPropertiesCommand(hDlg, wNotifyCode, wID, &changed))
+ // To Do: add a hook to MessReadMountedSoftware(drvindex); so the software will update itself when the folder is configured
+ break;
+#endif
+
+ // use default behavior; try to get the result out of the datamap if
+ // appropriate
+ GetClassName(hWndCtrl, szClass, ARRAY_LENGTH(szClass));
+ if (!_tcscmp(szClass, WC_COMBOBOX))
+ {
+ // combo box
+ if ((wNotifyCode == CBN_SELCHANGE) || (wNotifyCode == CBN_SELENDOK))
+ changed = datamap_read_control(properties_datamap, hDlg, pCurrentOpts, wID);
+ }
+ else if (!_tcscmp(szClass, WC_BUTTON) && (GetWindowLong(hWndCtrl, GWL_STYLE) & BS_CHECKBOX))
+ {
+ // check box
+ changed = datamap_read_control(properties_datamap, hDlg, pCurrentOpts, wID);
+ }
+ break;
+ }
+
+ if (changed == true)
+ {
+ // make sure everything's copied over, to determine what's changed
+ UpdateOptions(hDlg, properties_datamap, pCurrentOpts);
+ // enable the apply button
+ PropSheet_Changed(GetParent(hDlg), hDlg);
+ g_bUseDefaults = AreOptionsEqual(pCurrentOpts, pDefaultOpts) ? false : true;
+ g_bReset = AreOptionsEqual(pCurrentOpts, pOrigOpts) ? false : true;
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), g_bUseDefaults);
+ EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset);
+ }
+ }
+ break;
+
+ case WM_NOTIFY:
+ {
+ // Set to true if we are exiting the properties dialog
+ //BOOL bClosing = ((LPPSHNOTIFY) lParam)->lParam; // indicates OK was clicked rather than APPLY
+
+ switch (((NMHDR *) lParam)->code)
+ {
+ //We'll need to use a CheckState Table
+ //Because this one gets called for all kinds of other things too, and not only if a check is set
+ case PSN_SETACTIVE:
+ /* Initialize the controls. */
+ UpdateProperties(hDlg, properties_datamap, pCurrentOpts);
+ g_bUseDefaults = AreOptionsEqual(pCurrentOpts, pDefaultOpts) ? false : true;
+ g_bReset = AreOptionsEqual(pCurrentOpts, pOrigOpts) ? false : true;
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), g_bUseDefaults);
+ EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset);
+ break;
+
+ case PSN_APPLY:
+ // Handle more than one PSN_APPLY, since this proc handles more than one
+ // property sheet and can be called multiple times when it's time to exit,
+ // and we may have already freed the windows_options.
+ //if (bClosing)
+ //{
+ //if (NULL == pCurrentOpts)
+ //return true;
+ //}
+
+ // Read the datamap
+ UpdateOptions(hDlg, properties_datamap, pCurrentOpts);
+ // The current options become the original options.
+ UpdateOptions(hDlg, properties_datamap, pOrigOpts);
+
+ // Repopulate the controls? WTF? We just read them, they should be fine.
+ UpdateProperties(hDlg, properties_datamap, pCurrentOpts);
+
+ g_bUseDefaults = AreOptionsEqual(pCurrentOpts, pDefaultOpts) ? false : true;
+ g_bReset = AreOptionsEqual(pCurrentOpts, pOrigOpts) ? false : true;
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), g_bUseDefaults);
+ EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset);
+
+ // Save the current options
+ save_options(pCurrentOpts, g_nPropertyMode, g_nGame);
+
+ // Disable apply button
+ PropSheet_UnChanged(GetParent(hDlg), hDlg);
+ SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
+
+ return true;
+
+ case PSN_KILLACTIVE:
+ /* Save Changes to the options here. */
+ UpdateOptions(hDlg, properties_datamap, pCurrentOpts);
+ // Determine button states.
+ g_bUseDefaults = AreOptionsEqual(pCurrentOpts, pDefaultOpts) ? false : true;
+ g_bReset = AreOptionsEqual(pCurrentOpts, pOrigOpts) ? false : true;
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), g_bUseDefaults);
+ EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset);
+
+ ResetDataMap(hDlg);
+ SetWindowLongPtr(hDlg, DWLP_MSGRESULT, false);
+ return 1;
+
+ case PSN_RESET:
+ // Reset to the original values. Disregard changes
+ //pCurrentOpts = pOrigOpts;
+ g_bUseDefaults = AreOptionsEqual(pCurrentOpts, pDefaultOpts) ? false : true;
+ g_bReset = AreOptionsEqual(pCurrentOpts, pOrigOpts) ? false : true;
+ EnableWindow(GetDlgItem(hDlg, IDC_USE_DEFAULT), g_bUseDefaults);
+ EnableWindow(GetDlgItem(hDlg, IDC_PROP_RESET), g_bReset);
+ SetWindowLongPtr(hDlg, DWLP_MSGRESULT, false);
+ break;
+
+ case PSN_HELP:
+ // User wants help for this property page
+ break;
+ }
+ }
+ break;
+
+ case WM_HELP:
+ /* User clicked the ? from the upper right on a control */
+ HelpFunction((HWND)((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP, HH_TP_HELP_WM_HELP, GetHelpIDs());
+ break;
+
+ case WM_CONTEXTMENU:
+ HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, GetHelpIDs());
+ break;
+
+ }
+
+ return 0;
+}
+
+/* Read controls that are not handled in the DataMap */
+static void PropToOptions(HWND hWnd, windows_options &o)
+{
+ HWND hCtrl;
+ HWND hCtrl2;
+ HWND hCtrl3;
+
+ /* aspect ratio */
+ hCtrl = GetDlgItem(hWnd, IDC_ASPECTRATION);
+ hCtrl2 = GetDlgItem(hWnd, IDC_ASPECTRATIOD);
+ hCtrl3 = GetDlgItem(hWnd, IDC_ASPECT);
+ if (hCtrl && hCtrl2 && hCtrl3)
+ {
+ char aspect_option[32];
+ snprintf(aspect_option, ARRAY_LENGTH(aspect_option), "aspect%d", GetSelectedScreen(hWnd));
+
+ if (Button_GetCheck(hCtrl3))
+ {
+ o.set_value(aspect_option, "auto", OPTION_PRIORITY_CMDLINE);
+ }
+ else
+ {
+ int n = 0;
+ int d = 0;
+ TCHAR buffer[200];
+ char buffer2[200];
+
+ Edit_GetText(hCtrl, buffer, ARRAY_LENGTH(buffer));
+ _stscanf(buffer,TEXT("%d"),&n);
+
+ Edit_GetText(hCtrl2, buffer, ARRAY_LENGTH(buffer));
+ _stscanf(buffer,TEXT("%d"),&d);
+
+ if (n == 0 || d == 0)
+ {
+ n = 4;
+ d = 3;
+ }
+
+ snprintf(buffer2, sizeof(buffer2), "%d:%d", n, d);
+ o.set_value(aspect_option, buffer2, OPTION_PRIORITY_CMDLINE);
+ }
+ }
+ /* aspect ratio */
+ hCtrl = GetDlgItem(hWnd, IDC_SNAPSIZEWIDTH);
+ hCtrl2 = GetDlgItem(hWnd, IDC_SNAPSIZEHEIGHT);
+ hCtrl3 = GetDlgItem(hWnd, IDC_SNAPSIZE);
+ if (hCtrl && hCtrl2 && hCtrl3)
+ {
+ if (Button_GetCheck(hCtrl3))
+ {
+ o.set_value(OPTION_SNAPSIZE, "auto", OPTION_PRIORITY_CMDLINE);
+ }
+ else
+ {
+ int width = 0;
+ int height = 0;
+ TCHAR buffer[200];
+ char buffer2[200];
+
+ Edit_GetText(hCtrl, buffer, ARRAY_LENGTH(buffer));
+ _stscanf(buffer, TEXT("%d"), &width);
+
+ Edit_GetText(hCtrl2, buffer, ARRAY_LENGTH(buffer));
+ _stscanf(buffer, TEXT("%d"), &height);
+
+ if (width == 0 || height == 0)
+ {
+ width = 640;
+ height = 480;
+ }
+
+ snprintf(buffer2, sizeof(buffer2), "%dx%d", width, height);
+ o.set_value(OPTION_SNAPSIZE, buffer2, OPTION_PRIORITY_CMDLINE);
+ }
+ }
+}
+
+/* Update options from the dialog */
+static void UpdateOptions(HWND hDlg, datamap *map, windows_options &opts)
+{
+ /* These are always called together, so make one convenient function. */
+ datamap_read_all_controls(map, hDlg, opts);
+ PropToOptions(hDlg, opts);
+}
+
+/* Update the dialog from the options */
+static void UpdateProperties(HWND hDlg, datamap *map, windows_options &opts)
+{
+ /* These are always called together, so make one convenient function. */
+ datamap_populate_all_controls(map, hDlg, opts);
+ OptionsToProp(hDlg, opts);
+ SetPropEnabledControls(hDlg);
+}
+
+/* Populate controls that are not handled in the DataMap */
+static void OptionsToProp(HWND hWnd, windows_options& o)
+{
+ HWND hCtrl2;
+ TCHAR buf[1024];
+ int n = 0;
+ int d = 0;
+ int width = 0;
+ int height = 0;
+ int res = 0;
+
+ /* video */
+
+ /* Setup refresh list based on depth. */
+ datamap_update_control(properties_datamap, hWnd, pCurrentOpts, IDC_REFRESH);
+ /* Setup Select screen*/
+ UpdateSelectScreenUI(hWnd );
+
+ HWND hCtrl = GetDlgItem(hWnd, IDC_ASPECT);
+ if (hCtrl)
+ Button_SetCheck(hCtrl, g_bAutoAspect[GetSelectedScreen(hWnd)] );
+
+ hCtrl = GetDlgItem(hWnd, IDC_SNAPSIZE);
+ if (hCtrl)
+ Button_SetCheck(hCtrl, g_bAutoSnapSize );
+
+ /* Bios select list */
+ hCtrl = GetDlgItem(hWnd, IDC_BIOS);
+ if (hCtrl)
+ {
+ const char* cBuffer;
+ for( uint8_t i = 0; i < ComboBox_GetCount( hCtrl ); i++ )
+ {
+ cBuffer = (const char*)ComboBox_GetItemData( hCtrl, i );
+ if (strcmp(cBuffer, pCurrentOpts.value(OPTION_BIOS) ) == 0)
+ {
+ res = ComboBox_SetCurSel(hCtrl, i);
+ break;
+ }
+
+ }
+ }
+
+
+ hCtrl = GetDlgItem(hWnd, IDC_ASPECT);
+ if (hCtrl)
+ {
+ char aspect_option[32];
+ snprintf(aspect_option, ARRAY_LENGTH(aspect_option), "aspect%d", GetSelectedScreen(hWnd));
+ if( strcmp(o.value(aspect_option), "auto") == 0)
+ {
+ Button_SetCheck(hCtrl, true);
+ g_bAutoAspect[GetSelectedScreen(hWnd)] = true;
+ }
+ else
+ {
+ Button_SetCheck(hCtrl, false);
+ g_bAutoAspect[GetSelectedScreen(hWnd)] = false;
+ }
+ }
+
+ /* aspect ratio */
+ hCtrl = GetDlgItem(hWnd, IDC_ASPECTRATION);
+ hCtrl2 = GetDlgItem(hWnd, IDC_ASPECTRATIOD);
+ if (hCtrl && hCtrl2)
+ {
+ char aspect_option[32];
+ snprintf(aspect_option, ARRAY_LENGTH(aspect_option), "aspect%d", GetSelectedScreen(hWnd));
+
+ n = 0;
+ d = 0;
+ if (o.value(aspect_option))
+ {
+ if (sscanf(o.value(aspect_option), "%d:%d", &n, &d) == 2 && n != 0 && d != 0)
+ {
+ _stprintf(buf, TEXT("%d"), n);
+ Edit_SetText(hCtrl, buf);
+ _stprintf(buf, TEXT("%d"), d);
+ Edit_SetText(hCtrl2, buf);
+ }
+ else
+ {
+ Edit_SetText(hCtrl, TEXT("4"));
+ Edit_SetText(hCtrl2, TEXT("3"));
+ }
+ }
+ else
+ {
+ Edit_SetText(hCtrl, TEXT("4"));
+ Edit_SetText(hCtrl2, TEXT("3"));
+ }
+ }
+
+ hCtrl = GetDlgItem(hWnd, IDC_EFFECT);
+ if (hCtrl) {
+ const char* effect = o.value(OPTION_EFFECT);
+ if (effect == NULL) {
+ effect = "none";
+ o.set_value(OPTION_EFFECT, effect, OPTION_PRIORITY_CMDLINE);
+ }
+ win_set_window_text_utf8(hCtrl, effect);
+ }
+
+ hCtrl = GetDlgItem(hWnd, IDC_SNAPSIZE);
+ if (hCtrl)
+ {
+ if( strcmp(o.value(OPTION_SNAPSIZE), "auto") == 0)
+ {
+ Button_SetCheck(hCtrl, true);
+ g_bAutoSnapSize = true;
+ }
+ else
+ {
+ Button_SetCheck(hCtrl, false);
+ g_bAutoSnapSize = false;
+ }
+ }
+#if 0
+ for (int i = 0; i < 5; i++)
+ {
+ UpdateMameShader(hWnd, i, opts);
+ UpdateScreenShader(hWnd, i, opts);
+ }
+
+ hCtrl = GetDlgItem(hWnd, IDC_CHEATFILE);
+
+ if (hCtrl)
+ {
+ const char* cheatfile = opts.value(OPTION_CHEATPATH);
+
+ if (strcmp(cheatfile, "cheat") == 0)
+ winui_set_window_text_utf8(hCtrl, "Default");
+ else
+ {
+ char *cheatname = strrchr(cheatfile, '\\');
+
+ if (cheatname != NULL)
+ {
+ strcpy(buffer, cheatname + 1);
+ winui_set_window_text_utf8(hCtrl, buffer);
+ }
+ else
+ winui_set_window_text_utf8(hCtrl, cheatfile);
+ }
+ }
+#endif
+ hCtrl = GetDlgItem(hWnd, IDC_JOYSTICKMAP);
+
+ if (hCtrl)
+ {
+ const char* joymap = o.value(OPTION_JOYSTICK_MAP);
+
+ win_set_window_text_utf8(hCtrl, joymap);
+ }
+
+ hCtrl = GetDlgItem(hWnd, IDC_LUASCRIPT);
+
+ if (hCtrl)
+ {
+ const char* script = o.value(OPTION_AUTOBOOT_SCRIPT);
+
+ if (strcmp(script, "") == 0)
+ win_set_window_text_utf8(hCtrl, "None");
+ else
+ {
+ char buffer[260];
+ wchar_t *t_filename = ui_wstring_from_utf8(script);
+ wchar_t *tempname = PathFindFileName(t_filename);
+ PathRemoveExtension(tempname);
+ char *optname = ui_utf8_from_wstring(tempname);
+ strcpy(buffer, optname);
+ free(t_filename);
+ free(optname);
+ win_set_window_text_utf8(hCtrl, buffer);
+ }
+ }
+
+ hCtrl = GetDlgItem(hWnd, IDC_PLUGIN);
+
+ if (hCtrl)
+ {
+ string t1 = GetPlugins();
+ const char* plugin = t1.c_str();
+
+ if (strlen(plugin) == 0)
+ //if (strcmp(plugin, "") == 0)
+ win_set_window_text_utf8(hCtrl, "None");
+ else
+ win_set_window_text_utf8(hCtrl, plugin);
+ }
+#if 0
+ hCtrl = GetDlgItem(hWnd, IDC_BGFX_CHAINS);
+
+ if (hCtrl)
+ {
+ const char* chains = o.value(OSDOPTION_BGFX_SCREEN_CHAINS);
+
+ if (strcmp(chains, "default") == 0)
+ winui_set_window_text_utf8(hCtrl, "Default");
+ else
+ winui_set_window_text_utf8(hCtrl, chains);
+ }
+#endif
+ /* snapshot size */
+ hCtrl = GetDlgItem(hWnd, IDC_SNAPSIZEWIDTH);
+ hCtrl2 = GetDlgItem(hWnd, IDC_SNAPSIZEHEIGHT);
+ if (hCtrl && hCtrl2)
+ {
+ n = 0;
+ d = 0;
+ if (o.value(OPTION_SNAPSIZE))
+ {
+ if (sscanf(o.value(OPTION_SNAPSIZE), "%dx%d", &width, &height) == 2 && width && height)
+ {
+ _stprintf(buf, TEXT("%d"), width);
+ Edit_SetText(hCtrl, buf);
+ _stprintf(buf, TEXT("%d"), height);
+ Edit_SetText(hCtrl2, buf);
+ }
+ else
+ {
+ Edit_SetText(hCtrl, TEXT("640"));
+ Edit_SetText(hCtrl2, TEXT("480"));
+ }
+ }
+ else
+ {
+ Edit_SetText(hCtrl, TEXT("640"));
+ Edit_SetText(hCtrl2, TEXT("480"));
+ }
+ }
+ res++;
+}
+
+/* Adjust controls - tune them to the currently selected game */
+static void SetPropEnabledControls(HWND hWnd)
+{
+ bool useart = true;
+ BOOL joystick_attached = false;
+ bool in_window = false;
+ int nIndex = g_nGame;
+
+ // auto is a reserved word
+ bool autov = (core_stricmp(pCurrentOpts.value(OSDOPTION_VIDEO), "auto")==0);
+ bool d3d = (core_stricmp(pCurrentOpts.value(OSDOPTION_VIDEO), "d3d")==0) | autov;
+#ifdef UI_DIRECTDRAW
+ bool ddraw = (core_stricmp(pCurrentOpts.value(OSDOPTION_VIDEO), "ddraw")==0) | autov;
+#else
+ bool ddraw = false;
+#endif
+
+ in_window = pCurrentOpts.bool_value(OSDOPTION_WINDOW);
+ Button_SetCheck(GetDlgItem(hWnd, IDC_ASPECT), g_bAutoAspect[GetSelectedScreen(hWnd)] );
+
+ EnableWindow(GetDlgItem(hWnd, IDC_WAITVSYNC), d3d|ddraw);
+ EnableWindow(GetDlgItem(hWnd, IDC_TRIPLE_BUFFER), d3d|ddraw);
+ EnableWindow(GetDlgItem(hWnd, IDC_PRESCALE), d3d|ddraw);
+ EnableWindow(GetDlgItem(hWnd, IDC_PRESCALEDISP), d3d|ddraw);
+ EnableWindow(GetDlgItem(hWnd, IDC_PRESCALETEXT), d3d|ddraw);
+#ifdef UI_DIRECTDRAW
+ EnableWindow(GetDlgItem(hWnd, IDC_HWSTRETCH), ddraw && DirectDraw_HasHWStretch());
+#else
+ EnableWindow(GetDlgItem(hWnd, IDC_HWSTRETCH), false);
+#endif
+ EnableWindow(GetDlgItem(hWnd, IDC_SWITCHRES), true);
+ EnableWindow(GetDlgItem(hWnd, IDC_SYNCREFRESH), true);
+ EnableWindow(GetDlgItem(hWnd, IDC_REFRESH), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_REFRESHTEXT), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSGAMMA), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSGAMMATEXT), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSGAMMADISP), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSBRIGHTNESS), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSBRIGHTNESSTEXT), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSBRIGHTNESSDISP), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSCONTRAST), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSCONTRASTTEXT), !in_window);
+ EnableWindow(GetDlgItem(hWnd, IDC_FSCONTRASTDISP), !in_window);
+
+ EnableWindow(GetDlgItem(hWnd, IDC_ASPECTRATIOTEXT), !g_bAutoAspect[GetSelectedScreen(hWnd)]);
+ EnableWindow(GetDlgItem(hWnd, IDC_ASPECTRATION), !g_bAutoAspect[GetSelectedScreen(hWnd)]);
+ EnableWindow(GetDlgItem(hWnd, IDC_ASPECTRATIOD), !g_bAutoAspect[GetSelectedScreen(hWnd)]);
+
+ EnableWindow(GetDlgItem(hWnd, IDC_SNAPSIZETEXT), !g_bAutoSnapSize);
+ EnableWindow(GetDlgItem(hWnd, IDC_SNAPSIZEHEIGHT), !g_bAutoSnapSize);
+ EnableWindow(GetDlgItem(hWnd, IDC_SNAPSIZEWIDTH), !g_bAutoSnapSize);
+ EnableWindow(GetDlgItem(hWnd, IDC_SNAPSIZEX), !g_bAutoSnapSize);
+
+ EnableWindow(GetDlgItem(hWnd, IDC_D3D_FILTER),d3d);
+#ifdef D3DVERSION
+ EnableWindow(GetDlgItem(hWnd, IDC_D3D_VERSION),(NUMD3DVERSIONS>1) & d3d);
+#endif
+
+ //Switchres and D3D or ddraw enable the per screen parameters
+ EnableWindow(GetDlgItem(hWnd, IDC_NUMSCREENS), ddraw | d3d);
+ EnableWindow(GetDlgItem(hWnd, IDC_NUMSCREENSDISP), ddraw | d3d);
+ EnableWindow(GetDlgItem(hWnd, IDC_SCREENSELECT), ddraw | d3d);
+ EnableWindow(GetDlgItem(hWnd, IDC_SCREENSELECTTEXT), ddraw | d3d);
+
+ EnableWindow(GetDlgItem(hWnd, IDC_ARTWORK_CROP), useart);
+ EnableWindow(GetDlgItem(hWnd, IDC_BACKDROPS), useart);
+ EnableWindow(GetDlgItem(hWnd, IDC_BEZELS), useart);
+ EnableWindow(GetDlgItem(hWnd, IDC_OVERLAYS), useart);
+ EnableWindow(GetDlgItem(hWnd, IDC_CPANELS), useart);
+ EnableWindow(GetDlgItem(hWnd, IDC_MARQUEES), useart);
+ EnableWindow(GetDlgItem(hWnd, IDC_ARTMISCTEXT), useart);
+
+ /* Joystick options */
+ joystick_attached = DIJoystick.Available();
+
+ Button_Enable(GetDlgItem(hWnd,IDC_JOYSTICK), joystick_attached);
+ EnableWindow(GetDlgItem(hWnd, IDC_JDZTEXT), joystick_attached);
+ EnableWindow(GetDlgItem(hWnd, IDC_JDZDISP), joystick_attached);
+ EnableWindow(GetDlgItem(hWnd, IDC_JDZ), joystick_attached);
+ EnableWindow(GetDlgItem(hWnd, IDC_JSATTEXT), joystick_attached);
+ EnableWindow(GetDlgItem(hWnd, IDC_JSATDISP), joystick_attached);
+ EnableWindow(GetDlgItem(hWnd, IDC_JSAT), joystick_attached);
+ /* Trackball / Mouse options */
+ if (nIndex <= -1 || DriverUsesTrackball(nIndex) || DriverUsesLightGun(nIndex))
+ Button_Enable(GetDlgItem(hWnd,IDC_USE_MOUSE),true);
+ else
+ Button_Enable(GetDlgItem(hWnd,IDC_USE_MOUSE),false);
+
+ if (!in_window && (nIndex <= -1 || DriverUsesLightGun(nIndex)))
+ {
+ // on WinXP the Lightgun and Dual Lightgun switches are no longer supported use mouse instead
+ OSVERSIONINFOEX osvi;
+ BOOL bOsVersionInfoEx;
+ // Try calling GetVersionEx using the OSVERSIONINFOEX structure.
+ // If that fails, try using the OSVERSIONINFO structure.
+
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+
+ if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
+ {
+ osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+ bOsVersionInfoEx = GetVersionEx ( (OSVERSIONINFO *) &osvi);
+ }
+
+// if( bOsVersionInfoEx && (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvi.dwMajorVersion >= 5) )
+// {
+ BOOL use_lightgun;
+ //XP and above...
+ Button_Enable(GetDlgItem(hWnd,IDC_LIGHTGUN),false);
+ use_lightgun = Button_GetCheck(GetDlgItem(hWnd,IDC_USE_MOUSE));
+ Button_Enable(GetDlgItem(hWnd,IDC_DUAL_LIGHTGUN),false);
+ Button_Enable(GetDlgItem(hWnd,IDC_RELOAD),use_lightgun);
+// }
+// else
+// {
+// BOOL use_lightgun;
+ // Older than XP
+// Button_Enable(GetDlgItem(hWnd,IDC_LIGHTGUN),true);
+// use_lightgun = Button_GetCheck(GetDlgItem(hWnd,IDC_LIGHTGUN));
+// Button_Enable(GetDlgItem(hWnd,IDC_DUAL_LIGHTGUN),use_lightgun);
+// Button_Enable(GetDlgItem(hWnd,IDC_RELOAD),use_lightgun);
+// }
+ }
+ else
+ {
+ Button_Enable(GetDlgItem(hWnd,IDC_LIGHTGUN),false);
+ Button_Enable(GetDlgItem(hWnd,IDC_DUAL_LIGHTGUN),false);
+ Button_Enable(GetDlgItem(hWnd,IDC_RELOAD),false);
+ }
+
+
+ /* Sound options */
+ bool sound = (core_stricmp(pCurrentOpts.value(OSDOPTION_SOUND), "none")!=0);
+ ComboBox_Enable(GetDlgItem(hWnd, IDC_SAMPLERATE), sound);
+ EnableWindow(GetDlgItem(hWnd,IDC_VOLUME),sound);
+ EnableWindow(GetDlgItem(hWnd,IDC_RATETEXT),sound);
+ EnableWindow(GetDlgItem(hWnd,IDC_VOLUMEDISP),sound);
+ EnableWindow(GetDlgItem(hWnd,IDC_VOLUMETEXT),sound);
+ EnableWindow(GetDlgItem(hWnd,IDC_AUDIO_LATENCY),sound);
+ EnableWindow(GetDlgItem(hWnd,IDC_AUDIO_LATENCY_DISP),sound);
+ EnableWindow(GetDlgItem(hWnd,IDC_AUDIO_LATENCY_TEXT),sound);
+ SetSamplesEnabled(hWnd, nIndex, sound);
+
+ if (Button_GetCheck(GetDlgItem(hWnd, IDC_AUTOFRAMESKIP)))
+ EnableWindow(GetDlgItem(hWnd, IDC_FRAMESKIP), false);
+ else
+ EnableWindow(GetDlgItem(hWnd, IDC_FRAMESKIP), 1);
+
+ if (nIndex <= -1 || DriverHasOptionalBIOS(nIndex))
+ EnableWindow(GetDlgItem(hWnd,IDC_BIOS),true);
+ else
+ EnableWindow(GetDlgItem(hWnd,IDC_BIOS),false);
+
+}
+
+//============================================================
+// CONTROL HELPER FUNCTIONS FOR DATA EXCHANGE
+//============================================================
+
+static BOOL RotateReadControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ int selected_index = ComboBox_GetCurSel(control);
+ int original_selection = 0;
+
+ // Figure out what the original selection value is
+ if (opts->bool_value(OPTION_ROR) && !opts->bool_value(OPTION_ROL))
+ original_selection = 1;
+ else if (!opts->bool_value(OPTION_ROR) && opts->bool_value(OPTION_ROL))
+ original_selection = 2;
+ else if (!opts->bool_value(OPTION_ROTATE))
+ original_selection = 3;
+ else if (opts->bool_value(OPTION_AUTOROR))
+ original_selection = 4;
+ else if (opts->bool_value(OPTION_AUTOROL))
+ original_selection = 5;
+
+ // Any work to do? If so, make the changes and return true.
+ if (selected_index != original_selection)
+ {
+ // Set the options based on the new selection.
+ opts->set_value(OPTION_ROR, selected_index == 1, OPTION_PRIORITY_CMDLINE);
+ opts->set_value(OPTION_ROL, selected_index == 2, OPTION_PRIORITY_CMDLINE);
+ opts->set_value(OPTION_ROTATE, selected_index != 3, OPTION_PRIORITY_CMDLINE);
+ opts->set_value(OPTION_AUTOROR, selected_index == 4, OPTION_PRIORITY_CMDLINE);
+ opts->set_value(OPTION_AUTOROL, selected_index == 5, OPTION_PRIORITY_CMDLINE);
+ return true;
+ }
+
+ // No changes
+ return false;
+}
+
+
+
+static BOOL RotatePopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ int res, selected_index = 0;
+ if (opts->bool_value(OPTION_ROR) && !opts->bool_value(OPTION_ROL))
+ selected_index = 1;
+ else if (!opts->bool_value(OPTION_ROR) && opts->bool_value(OPTION_ROL))
+ selected_index = 2;
+ else if (!opts->bool_value(OPTION_ROTATE))
+ selected_index = 3;
+ else if (opts->bool_value(OPTION_AUTOROR))
+ selected_index = 4;
+ else if (opts->bool_value(OPTION_AUTOROL))
+ selected_index = 5;
+
+ res = ComboBox_SetCurSel(control, selected_index);
+ res++;
+ return false;
+}
+
+
+
+static BOOL ScreenReadControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ char screen_option_name[32];
+ int selected_screen = GetSelectedScreen(dialog);
+ int screen_option_index = ComboBox_GetCurSel(control);
+ TCHAR *screen_option_value = (TCHAR*) ComboBox_GetItemData(control, screen_option_index);
+ snprintf(screen_option_name, ARRAY_LENGTH(screen_option_name), "screen%d", selected_screen);
+ char *op_val = ui_utf8_from_wstring(screen_option_value);
+ opts->set_value(screen_option_name, op_val, OPTION_PRIORITY_CMDLINE);
+ free(op_val);
+ return false;
+}
+
+
+
+static BOOL ScreenPopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ //int iMonitors;
+ DISPLAY_DEVICE dd;
+ int res, i = 0;
+ int nSelection = 0;
+ TCHAR* t_option = 0;
+
+ /* Remove all items in the list. */
+ res = ComboBox_ResetContent(control);
+ res = ComboBox_InsertString(control, 0, TEXT("Auto"));
+ res = ComboBox_SetItemData(control, 0, (void*)ui_wstring_from_utf8("auto"));
+
+ //Dynamically populate it, by enumerating the Monitors
+ //iMonitors = GetSystemMetrics(SM_CMONITORS); // this gets the count of monitors attached
+ ZeroMemory(&dd, sizeof(dd));
+ dd.cb = sizeof(dd);
+ for(i=0; EnumDisplayDevices(NULL, i, &dd, 0); i++)
+ {
+ if( !(dd.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) )
+ {
+ char screen_option[32];
+
+ //we have to add 1 to account for the "auto" entry
+ res = ComboBox_InsertString(control, i+1, win_tstring_strdup(dd.DeviceName));
+ res = ComboBox_SetItemData(control, i+1, (void*)win_tstring_strdup(dd.DeviceName));
+
+ snprintf(screen_option, ARRAY_LENGTH(screen_option), "screen%d", GetSelectedScreen(dialog));
+ t_option = ui_wstring_from_utf8(opts->value(screen_option));
+ if( !t_option )
+ return false;
+ if (_tcscmp(t_option, dd.DeviceName) == 0)
+ nSelection = i+1;
+ free(t_option);
+ }
+ }
+ res = ComboBox_SetCurSel(control, nSelection);
+ res++;
+ return false;
+}
+
+
+
+static void ViewSetOptionName(datamap *map, HWND dialog, HWND control, char *buffer, size_t buffer_size)
+{
+ snprintf(buffer, buffer_size, "view%d", GetSelectedScreen(dialog));
+}
+
+static BOOL ViewPopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ int selected_index = 0;
+ char view_option[32];
+
+ // determine the view option value
+ snprintf(view_option, ARRAY_LENGTH(view_option), "view%d", GetSelectedScreen(dialog));
+ const char *view = opts->value(view_option);
+
+ int res = ComboBox_ResetContent(control);
+ for (int i = 0; i < NUMVIEW; i++)
+ {
+ res = ComboBox_InsertString(control, i, g_ComboBoxView[i].m_pText);
+ res = ComboBox_SetItemData(control, i, g_ComboBoxView[i].m_pData);
+
+ if (strcmp(view, g_ComboBoxView[i].m_pData)==0)
+ selected_index = i;
+ }
+ res = ComboBox_SetCurSel(control, selected_index);
+ res++;
+ return false;
+}
+
+static BOOL SnapViewPopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ int selected_index = 0;
+
+ // determine the snapview option value
+ const char *snapview = opts->value(OPTION_SNAPVIEW);
+
+ int res = ComboBox_ResetContent(control);
+ for (int i = 0; i < NUMSNAPVIEW; i++)
+ {
+ res = ComboBox_InsertString(control, i, g_ComboBoxSnapView[i].m_pText);
+ res = ComboBox_SetItemData(control, i, g_ComboBoxSnapView[i].m_pData);
+
+ if (strcmp(snapview, g_ComboBoxSnapView[i].m_pData)==0)
+ selected_index = i;
+ }
+ res = ComboBox_SetCurSel(control, selected_index);
+ res++;
+ return false;
+}
+
+static BOOL DefaultInputReadControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ int input_option_index = ComboBox_GetCurSel(control);
+ TCHAR *input_option_value = (TCHAR*) ComboBox_GetItemData(control, input_option_index);
+ char *op_val = ui_utf8_from_wstring(input_option_value);
+ opts->set_value(OPTION_CTRLR, input_option_index ? op_val : "", OPTION_PRIORITY_CMDLINE);
+ free(op_val);
+ return false;
+}
+
+wchar_t *win_wstring_from_utf8(const char *utf8string)
+{
+ // convert MAME string (UTF-8) to UTF-16
+ int char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, nullptr, 0);
+ wchar_t *result = (wchar_t *)malloc(char_count * sizeof(*result));
+
+ if (result != nullptr)
+ MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count);
+
+ return result;
+}
+
+char *win_utf8_from_wstring(const wchar_t *wstring)
+{
+ // convert UTF-16 to MAME string (UTF-8)
+ int char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, nullptr, 0, nullptr, nullptr);
+ char *result = (char *)malloc(char_count * sizeof(*result));
+
+ if (result != nullptr)
+ WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, nullptr, nullptr);
+
+ return result;
+}
+
+HANDLE winui_find_first_file_utf8(const char* filename, WIN32_FIND_DATA *findfiledata)
+{
+ wchar_t *t_filename = win_wstring_from_utf8(filename);
+
+ if (!t_filename)
+ return NULL;
+
+ HANDLE result = FindFirstFile(t_filename, findfiledata);
+ free(t_filename);
+ return result;
+}
+
+static BOOL DefaultInputPopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ WIN32_FIND_DATA FindFileData;
+ char path[MAX_PATH];
+ int selected = 0;
+ int index = 0;
+
+ // determine the ctrlr option
+ const char *ctrlr_option = opts->value(OPTION_CTRLR);
+
+ // reset the controllers dropdown
+ (void)ComboBox_ResetContent(control);
+ (void)ComboBox_InsertString(control, index, TEXT("Default"));
+ (void)ComboBox_SetItemData(control, index, "");
+ index++;
+ snprintf(path, WINUI_ARRAY_LENGTH(path), "%s\\*.*", GetCtrlrDir().c_str());
+ HANDLE hFind = winui_find_first_file_utf8(path, &FindFileData);
+
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ while (FindNextFile (hFind, &FindFileData) != 0)
+ {
+ // copy the filename
+ const char *root = win_utf8_from_wstring(FindFileData.cFileName);
+ // find the extension
+ char *ext = strrchr(root, '.');
+
+ if (ext)
+ {
+ // check if it's a cfg file
+ if (strcmp (ext, ".cfg") == 0)
+ {
+ // and strip off the extension
+ *ext = 0;
+
+ // set the option?
+ if (!strcmp(root, ctrlr_option))
+ selected = index;
+
+ // add it as an option
+ wchar_t *t_root = win_wstring_from_utf8(root);
+ (void)ComboBox_InsertString(control, index, t_root);
+ (void)ComboBox_SetItemData(control, index, root);
+ free(t_root);
+ root = NULL;
+ index++;
+ }
+ }
+ }
+
+ FindClose (hFind);
+ }
+
+ (void)ComboBox_SetCurSel(control, selected);
+
+ return false;
+}
+
+
+
+static void ResolutionSetOptionName(datamap *map, HWND dialog, HWND control, char *buffer, size_t buffer_size)
+{
+ snprintf(buffer, buffer_size, "resolution%d", GetSelectedScreen(dialog));
+}
+
+
+static BOOL ResolutionReadControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ HWND refresh_control = GetDlgItem(dialog, IDC_REFRESH);
+ HWND sizes_control = GetDlgItem(dialog, IDC_SIZES);
+ int res = 0, width = 0, height = 0;
+ char option_value[256];
+
+ if (refresh_control && sizes_control)
+ {
+ TCHAR buffer[256];
+ res = ComboBox_GetText(sizes_control, buffer, ARRAY_LENGTH(buffer) - 1);
+ if (_stscanf(buffer, TEXT("%d x %d"), &width, &height) == 2)
+ {
+ int refresh_index = ComboBox_GetCurSel(refresh_control);
+ int refresh_value = ComboBox_GetItemData(refresh_control, refresh_index);
+ snprintf(option_value, ARRAY_LENGTH(option_value), "%dx%d@%d", width, height, refresh_value);
+ }
+ else
+ snprintf(option_value, ARRAY_LENGTH(option_value), "auto");
+
+ opts->set_value(option_name, option_value, OPTION_PRIORITY_CMDLINE);
+ }
+ res++;
+ return false;
+}
+
+
+
+static BOOL ResolutionPopulateControl(datamap *map, HWND dialog, HWND control_, windows_options *opts, const char *option_name)
+{
+ HWND sizes_control = GetDlgItem(dialog, IDC_SIZES);
+ HWND refresh_control = GetDlgItem(dialog, IDC_REFRESH);
+ int width, height, refresh;
+ const char *option_value;
+ int sizes_index = 0;
+ int refresh_index = 0;
+ int sizes_selection = 0;
+ int refresh_selection = 0;
+ char screen_option[32];
+ const char *screen;
+ LPTSTR t_screen;
+ TCHAR buf[16];
+ int res = 0, i;
+ DEVMODE devmode;
+
+ if (sizes_control && refresh_control)
+ {
+ // determine the resolution
+ option_value = opts->value(option_name);
+ if (sscanf(option_value, "%dx%d@%d", &width, &height, &refresh) != 3)
+ {
+ width = 0;
+ height = 0;
+ refresh = 0;
+ }
+
+ // reset sizes control
+ res = ComboBox_ResetContent(sizes_control);
+ res = ComboBox_InsertString(sizes_control, sizes_index, TEXT("Auto"));
+ res = ComboBox_SetItemData(sizes_control, sizes_index, 0);
+ sizes_index++;
+
+ // reset refresh control
+ res = ComboBox_ResetContent(refresh_control);
+ res = ComboBox_InsertString(refresh_control, refresh_index, TEXT("Auto"));
+ res = ComboBox_SetItemData(refresh_control, refresh_index, 0);
+ refresh_index++;
+
+ // determine which screen we're using
+ snprintf(screen_option, ARRAY_LENGTH(screen_option), "screen%d", GetSelectedScreen(dialog));
+ screen = opts->value(screen_option);
+ t_screen = ui_wstring_from_utf8(screen);
+
+ // retrieve screen information
+ devmode.dmSize = sizeof(devmode);
+ for (i = 0; EnumDisplaySettings(t_screen, i, &devmode); i++)
+ {
+ if ((devmode.dmBitsPerPel == 32 ) // Only 32 bit depth supported by core
+ &&(devmode.dmDisplayFrequency == refresh || refresh == 0))
+ {
+ _sntprintf(buf, ARRAY_LENGTH(buf), TEXT("%li x %li"),
+ devmode.dmPelsWidth, devmode.dmPelsHeight);
+
+ if (ComboBox_FindString(sizes_control, 0, buf) == CB_ERR)
+ {
+ res = ComboBox_InsertString(sizes_control, sizes_index, buf);
+
+ if ((width == devmode.dmPelsWidth) && (height == devmode.dmPelsHeight))
+ sizes_selection = sizes_index;
+ sizes_index++;
+
+ }
+ }
+ if (devmode.dmDisplayFrequency >= 10 )
+ {
+ // I have some devmode "vga" which specifes 1 Hz, which is probably bogus, so we filter it out
+
+ _sntprintf(buf, ARRAY_LENGTH(buf), TEXT("%li Hz"), devmode.dmDisplayFrequency);
+
+ if (ComboBox_FindString(refresh_control, 0, buf) == CB_ERR)
+ {
+ res = ComboBox_InsertString(refresh_control, refresh_index, buf);
+ res = ComboBox_SetItemData(refresh_control, refresh_index, devmode.dmDisplayFrequency);
+
+ if (refresh == devmode.dmDisplayFrequency)
+ refresh_selection = refresh_index;
+
+ refresh_index++;
+ }
+ }
+ }
+ free(t_screen);
+
+ res = ComboBox_SetCurSel(sizes_control, sizes_selection);
+ res = ComboBox_SetCurSel(refresh_control, refresh_selection);
+ }
+ res++;
+ return false;
+}
+
+
+/************************************************************
+ * DataMap initializers
+ ************************************************************/
+
+/* Initialize local helper variables */
+static void ResetDataMap(HWND hWnd)
+{
+ char screen_option[32];
+
+ snprintf(screen_option, ARRAY_LENGTH(screen_option), "screen%d", GetSelectedScreen(hWnd));
+
+ if (pCurrentOpts.value(screen_option) == NULL
+ || (core_stricmp(pCurrentOpts.value(screen_option), "") == 0 )
+ || (core_stricmp(pCurrentOpts.value(screen_option), "auto") == 0 ) )
+ {
+ pCurrentOpts.set_value(screen_option, "auto", OPTION_PRIORITY_CMDLINE);
+ }
+}
+
+
+/* Build the control mapping by adding all needed information to the DataMap */
+static void BuildDataMap(void)
+{
+ properties_datamap = datamap_create();
+
+ // core state options
+ datamap_add(properties_datamap, IDC_ENABLE_AUTOSAVE, DM_BOOL, OPTION_AUTOSAVE);
+ datamap_add(properties_datamap, IDC_SNAPVIEW, DM_STRING, OPTION_SNAPVIEW);
+ datamap_add(properties_datamap, IDC_SNAPSIZEWIDTH, DM_STRING, NULL);
+ datamap_add(properties_datamap, IDC_SNAPSIZEHEIGHT, DM_STRING, NULL);
+
+ // core performance options
+ datamap_add(properties_datamap, IDC_AUTOFRAMESKIP, DM_BOOL, OPTION_AUTOFRAMESKIP);
+ datamap_add(properties_datamap, IDC_FRAMESKIP, DM_INT, OPTION_FRAMESKIP);
+ datamap_add(properties_datamap, IDC_SECONDSTORUN, DM_INT, OPTION_SECONDS_TO_RUN);
+ datamap_add(properties_datamap, IDC_SECONDSTORUNDISP, DM_INT, OPTION_SECONDS_TO_RUN);
+ datamap_add(properties_datamap, IDC_THROTTLE, DM_BOOL, OPTION_THROTTLE);
+ datamap_add(properties_datamap, IDC_SLEEP, DM_BOOL, OPTION_SLEEP);
+ datamap_add(properties_datamap, IDC_SPEED, DM_FLOAT, OPTION_SPEED);
+ datamap_add(properties_datamap, IDC_SPEEDDISP, DM_FLOAT, OPTION_SPEED);
+ datamap_add(properties_datamap, IDC_REFRESHSPEED, DM_BOOL, OPTION_REFRESHSPEED);
+
+ // core retation options
+ datamap_add(properties_datamap, IDC_ROTATE, DM_INT, NULL);
+ // ror, rol, autoror, autorol handled by callback
+ datamap_add(properties_datamap, IDC_FLIPX, DM_BOOL, OPTION_FLIPX);
+ datamap_add(properties_datamap, IDC_FLIPY, DM_BOOL, OPTION_FLIPY);
+
+ // core artwork options
+ datamap_add(properties_datamap, IDC_ARTWORK_CROP, DM_BOOL, OPTION_ARTWORK_CROP);
+ datamap_add(properties_datamap, IDC_BACKDROPS, DM_BOOL, OPTION_USE_BACKDROPS);
+ datamap_add(properties_datamap, IDC_OVERLAYS, DM_BOOL, OPTION_USE_OVERLAYS);
+ datamap_add(properties_datamap, IDC_BEZELS, DM_BOOL, OPTION_USE_BEZELS);
+ datamap_add(properties_datamap, IDC_CPANELS, DM_BOOL, OPTION_USE_CPANELS);
+ datamap_add(properties_datamap, IDC_MARQUEES, DM_BOOL, OPTION_USE_MARQUEES);
+
+ // core screen options
+ datamap_add(properties_datamap, IDC_BRIGHTCORRECT, DM_FLOAT, OPTION_BRIGHTNESS);
+ datamap_add(properties_datamap, IDC_BRIGHTCORRECTDISP, DM_FLOAT, OPTION_BRIGHTNESS);
+ datamap_add(properties_datamap, IDC_CONTRAST, DM_FLOAT, OPTION_CONTRAST);
+ datamap_add(properties_datamap, IDC_CONTRASTDISP, DM_FLOAT, OPTION_CONTRAST);
+ datamap_add(properties_datamap, IDC_GAMMA, DM_FLOAT, OPTION_GAMMA);
+ datamap_add(properties_datamap, IDC_GAMMADISP, DM_FLOAT, OPTION_GAMMA);
+ datamap_add(properties_datamap, IDC_PAUSEBRIGHT, DM_FLOAT, OPTION_PAUSE_BRIGHTNESS);
+ datamap_add(properties_datamap, IDC_PAUSEBRIGHTDISP, DM_FLOAT, OPTION_PAUSE_BRIGHTNESS);
+ datamap_add(properties_datamap, IDC_BURNIN, DM_BOOL, OPTION_BURNIN);
+ datamap_add(properties_datamap, IDC_SNAPBILINEAR, DM_BOOL, OPTION_SNAPBILINEAR);
+
+ // core vector options
+ datamap_add(properties_datamap, IDC_BEAM_MIN, DM_FLOAT, OPTION_BEAM_WIDTH_MIN);
+ datamap_add(properties_datamap, IDC_BEAM_MINDISP, DM_FLOAT, OPTION_BEAM_WIDTH_MIN);
+ datamap_add(properties_datamap, IDC_BEAM_MAX, DM_FLOAT, OPTION_BEAM_WIDTH_MAX);
+ datamap_add(properties_datamap, IDC_BEAM_MAXDISP, DM_FLOAT, OPTION_BEAM_WIDTH_MAX);
+ datamap_add(properties_datamap, IDC_BEAM_INTEN, DM_FLOAT, OPTION_BEAM_INTENSITY_WEIGHT);
+ datamap_add(properties_datamap, IDC_BEAM_INTENDISP, DM_FLOAT, OPTION_BEAM_INTENSITY_WEIGHT);
+ datamap_add(properties_datamap, IDC_FLICKER, DM_FLOAT, OPTION_FLICKER);
+ datamap_add(properties_datamap, IDC_FLICKERDISP, DM_FLOAT, OPTION_FLICKER);
+
+ // core sound options
+ datamap_add(properties_datamap, IDC_SAMPLERATE, DM_INT, OPTION_SAMPLERATE);
+ datamap_add(properties_datamap, IDC_SAMPLES, DM_BOOL, OPTION_SAMPLES);
+ datamap_add(properties_datamap, IDC_SOUND_MODE, DM_STRING, OSDOPTION_SOUND);
+ datamap_add(properties_datamap, IDC_VOLUME, DM_INT, OPTION_VOLUME);
+ datamap_add(properties_datamap, IDC_VOLUMEDISP, DM_INT, OPTION_VOLUME);
+
+ // core input options
+ datamap_add(properties_datamap, IDC_COINLOCKOUT, DM_BOOL, OPTION_COIN_LOCKOUT);
+ datamap_add(properties_datamap, IDC_DEFAULT_INPUT, DM_STRING, OPTION_CTRLR);
+ datamap_add(properties_datamap, IDC_USE_MOUSE, DM_BOOL, OPTION_MOUSE);
+ datamap_add(properties_datamap, IDC_JOYSTICK, DM_BOOL, OPTION_JOYSTICK);
+ datamap_add(properties_datamap, IDC_LIGHTGUN, DM_BOOL, OPTION_LIGHTGUN);
+ datamap_add(properties_datamap, IDC_STEADYKEY, DM_BOOL, OPTION_STEADYKEY);
+ datamap_add(properties_datamap, IDC_MULTIKEYBOARD, DM_BOOL, OPTION_MULTIKEYBOARD);
+ datamap_add(properties_datamap, IDC_MULTIMOUSE, DM_BOOL, OPTION_MULTIMOUSE);
+ datamap_add(properties_datamap, IDC_RELOAD, DM_BOOL, OPTION_OFFSCREEN_RELOAD);
+
+ datamap_add(properties_datamap, IDC_JDZ, DM_FLOAT, OPTION_JOYSTICK_DEADZONE);
+ datamap_add(properties_datamap, IDC_JDZDISP, DM_FLOAT, OPTION_JOYSTICK_DEADZONE);
+ datamap_add(properties_datamap, IDC_JSAT, DM_FLOAT, OPTION_JOYSTICK_SATURATION);
+ datamap_add(properties_datamap, IDC_JSATDISP, DM_FLOAT, OPTION_JOYSTICK_SATURATION);
+ datamap_add(properties_datamap, IDC_JOYSTICKMAP, DM_STRING, OPTION_JOYSTICK_MAP);
+
+ // core input automatic enable options
+ datamap_add(properties_datamap, IDC_PADDLE, DM_STRING, OPTION_PADDLE_DEVICE);
+ datamap_add(properties_datamap, IDC_ADSTICK, DM_STRING, OPTION_ADSTICK_DEVICE);
+ datamap_add(properties_datamap, IDC_PEDAL, DM_STRING, OPTION_PEDAL_DEVICE);
+ datamap_add(properties_datamap, IDC_DIAL, DM_STRING, OPTION_DIAL_DEVICE);
+ datamap_add(properties_datamap, IDC_TRACKBALL, DM_STRING, OPTION_TRACKBALL_DEVICE);
+ datamap_add(properties_datamap, IDC_LIGHTGUNDEVICE, DM_STRING, OPTION_LIGHTGUN_DEVICE);
+ datamap_add(properties_datamap, IDC_POSITIONAL, DM_STRING, OPTION_POSITIONAL_DEVICE);
+ datamap_add(properties_datamap, IDC_MOUSE, DM_STRING, OPTION_MOUSE_DEVICE);
+
+ // core debugging options
+ datamap_add(properties_datamap, IDC_LOG, DM_BOOL, OPTION_LOG);
+ datamap_add(properties_datamap, IDC_DEBUG, DM_BOOL, OPTION_DEBUG);
+ datamap_add(properties_datamap, IDC_VERBOSE, DM_BOOL, OPTION_VERBOSE);
+ datamap_add(properties_datamap, IDC_UPDATEINPAUSE, DM_BOOL, OPTION_UPDATEINPAUSE);
+ datamap_add(properties_datamap, IDC_DEBUGSCRIPT, DM_STRING, OPTION_DEBUGSCRIPT);
+
+ // core misc options
+ datamap_add(properties_datamap, IDC_BIOS, DM_STRING, OPTION_BIOS);
+ datamap_add(properties_datamap, IDC_CHEAT, DM_BOOL, OPTION_CHEAT);
+ datamap_add(properties_datamap, IDC_SKIP_GAME_INFO, DM_BOOL, OPTION_SKIP_GAMEINFO);
+
+ datamap_add(properties_datamap, IDC_LANGUAGE, DM_STRING, OPTION_LANGUAGE);
+ datamap_add(properties_datamap, IDC_LUASCRIPT, DM_STRING, OPTION_AUTOBOOT_SCRIPT);
+ datamap_add(properties_datamap, IDC_BOOTDELAY, DM_INT, OPTION_AUTOBOOT_DELAY);
+ datamap_add(properties_datamap, IDC_BOOTDELAYDISP, DM_INT, OPTION_AUTOBOOT_DELAY);
+ datamap_add(properties_datamap, IDC_PLUGINS, DM_BOOL, OPTION_PLUGINS);
+ datamap_add(properties_datamap, IDC_PLUGIN, DM_STRING, OPTION_PLUGIN);
+ datamap_add(properties_datamap, IDC_NVRAM_SAVE, DM_BOOL, OPTION_NVRAM_SAVE);
+ datamap_add(properties_datamap, IDC_REWIND, DM_BOOL, OPTION_REWIND);
+
+ // windows debugging options
+ datamap_add(properties_datamap, IDC_OSLOG, DM_BOOL, OPTION_OSLOG);
+
+ // windows performance options
+ datamap_add(properties_datamap, IDC_HIGH_PRIORITY, DM_INT, WINOPTION_PRIORITY);
+ datamap_add(properties_datamap, IDC_HIGH_PRIORITYTXT, DM_INT, WINOPTION_PRIORITY);
+
+ // windows video options
+ datamap_add(properties_datamap, IDC_VIDEO_MODE, DM_STRING, OSDOPTION_VIDEO);
+ datamap_add(properties_datamap, IDC_NUMSCREENS, DM_INT, OSDOPTION_NUMSCREENS);
+ datamap_add(properties_datamap, IDC_NUMSCREENSDISP, DM_INT, OSDOPTION_NUMSCREENS);
+ datamap_add(properties_datamap, IDC_WINDOWED, DM_BOOL, OSDOPTION_WINDOW);
+ datamap_add(properties_datamap, IDC_MAXIMIZE, DM_BOOL, OSDOPTION_MAXIMIZE);
+ datamap_add(properties_datamap, IDC_KEEPASPECT, DM_BOOL, OPTION_KEEPASPECT);
+ datamap_add(properties_datamap, IDC_PRESCALE, DM_INT, OSDOPTION_PRESCALE);
+ datamap_add(properties_datamap, IDC_PRESCALEDISP, DM_INT, OSDOPTION_PRESCALE);
+ datamap_add(properties_datamap, IDC_EFFECT, DM_STRING, OPTION_EFFECT);
+ datamap_add(properties_datamap, IDC_WAITVSYNC, DM_BOOL, OSDOPTION_WAITVSYNC);
+ datamap_add(properties_datamap, IDC_SYNCREFRESH, DM_BOOL, OSDOPTION_SYNCREFRESH);
+
+ // Direct3D specific options
+#ifdef D3DVERSION
+ datamap_add(properties_datamap, IDC_D3D_VERSION, DM_INT, WINOPTION_D3DVERSION);
+#endif
+ datamap_add(properties_datamap, IDC_D3D_FILTER, DM_BOOL, OSDOPTION_FILTER);
+
+ // per window video options
+ datamap_add(properties_datamap, IDC_SCREEN, DM_STRING, NULL);
+ datamap_add(properties_datamap, IDC_SCREENSELECT, DM_STRING, NULL);
+ datamap_add(properties_datamap, IDC_VIEW, DM_STRING, NULL);
+ datamap_add(properties_datamap, IDC_ASPECTRATIOD, DM_STRING, NULL);
+ datamap_add(properties_datamap, IDC_ASPECTRATION, DM_STRING, NULL);
+ datamap_add(properties_datamap, IDC_REFRESH, DM_STRING, NULL);
+ datamap_add(properties_datamap, IDC_SIZES, DM_STRING, NULL);
+
+ // full screen options
+ datamap_add(properties_datamap, IDC_TRIPLE_BUFFER, DM_BOOL, WINOPTION_TRIPLEBUFFER);
+ datamap_add(properties_datamap, IDC_SWITCHRES, DM_BOOL, OSDOPTION_SWITCHRES);
+ datamap_add(properties_datamap, IDC_FSBRIGHTNESS, DM_FLOAT, WINOPTION_FULLSCREENBRIGHTNESS);
+ datamap_add(properties_datamap, IDC_FSBRIGHTNESSDISP, DM_FLOAT, WINOPTION_FULLSCREENBRIGHTNESS);
+ datamap_add(properties_datamap, IDC_FSCONTRAST, DM_FLOAT, WINOPTION_FULLSCREENCONTRAST);
+ datamap_add(properties_datamap, IDC_FSCONTRASTDISP, DM_FLOAT, WINOPTION_FULLSCREENCONTRAST);
+ datamap_add(properties_datamap, IDC_FSGAMMA, DM_FLOAT, WINOPTION_FULLSCREENGAMMA);
+ datamap_add(properties_datamap, IDC_FSGAMMADISP, DM_FLOAT, WINOPTION_FULLSCREENGAMMA);
+
+ // windows sound options
+ datamap_add(properties_datamap, IDC_AUDIO_LATENCY, DM_INT, OSDOPTION_AUDIO_LATENCY);
+ datamap_add(properties_datamap, IDC_AUDIO_LATENCY_DISP, DM_INT, OSDOPTION_AUDIO_LATENCY);
+
+ // input device options
+ datamap_add(properties_datamap, IDC_DUAL_LIGHTGUN, DM_BOOL, WINOPTION_DUAL_LIGHTGUN);
+
+ // show menu
+ datamap_add(properties_datamap, IDC_SHOW_MENU, DM_BOOL, WINOPTION_MENU);
+
+ // set up callbacks
+ datamap_set_callback(properties_datamap, IDC_ROTATE, DCT_READ_CONTROL, RotateReadControl);
+ datamap_set_callback(properties_datamap, IDC_ROTATE, DCT_POPULATE_CONTROL, RotatePopulateControl);
+ datamap_set_callback(properties_datamap, IDC_SCREEN, DCT_READ_CONTROL, ScreenReadControl);
+ datamap_set_callback(properties_datamap, IDC_SCREEN, DCT_POPULATE_CONTROL, ScreenPopulateControl);
+ datamap_set_callback(properties_datamap, IDC_VIEW, DCT_POPULATE_CONTROL, ViewPopulateControl);
+ datamap_set_callback(properties_datamap, IDC_REFRESH, DCT_READ_CONTROL, ResolutionReadControl);
+ datamap_set_callback(properties_datamap, IDC_REFRESH, DCT_POPULATE_CONTROL, ResolutionPopulateControl);
+ datamap_set_callback(properties_datamap, IDC_SIZES, DCT_READ_CONTROL, ResolutionReadControl);
+ datamap_set_callback(properties_datamap, IDC_SIZES, DCT_POPULATE_CONTROL, ResolutionPopulateControl);
+ datamap_set_callback(properties_datamap, IDC_DEFAULT_INPUT, DCT_READ_CONTROL, DefaultInputReadControl);
+ datamap_set_callback(properties_datamap, IDC_DEFAULT_INPUT, DCT_POPULATE_CONTROL, DefaultInputPopulateControl);
+ datamap_set_callback(properties_datamap, IDC_SNAPVIEW, DCT_POPULATE_CONTROL, SnapViewPopulateControl);
+
+ datamap_set_option_name_callback(properties_datamap, IDC_VIEW, ViewSetOptionName);
+ //missing population of views with per game defined additional views
+ datamap_set_option_name_callback(properties_datamap, IDC_REFRESH, ResolutionSetOptionName);
+ datamap_set_option_name_callback(properties_datamap, IDC_SIZES, ResolutionSetOptionName);
+
+
+ // formats
+ datamap_set_int_format(properties_datamap, IDC_VOLUMEDISP, "%ddB");
+ datamap_set_int_format(properties_datamap, IDC_AUDIO_LATENCY_DISP, "%d/5");
+ datamap_set_float_format(properties_datamap, IDC_BEAM_MINDISP, "%3.2f");
+ datamap_set_float_format(properties_datamap, IDC_BEAM_MAXDISP, "%3.2f");
+ datamap_set_float_format(properties_datamap, IDC_BEAM_INTENDISP, "%3.2f");
+ datamap_set_float_format(properties_datamap, IDC_FLICKERDISP, "%3.2f");
+ datamap_set_float_format(properties_datamap, IDC_GAMMADISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_BRIGHTCORRECTDISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_CONTRASTDISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_PAUSEBRIGHTDISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_FSGAMMADISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_FSBRIGHTNESSDISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_FSCONTRASTDISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_JDZDISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_JSATDISP, "%03.2f");
+ datamap_set_float_format(properties_datamap, IDC_SPEEDDISP, "%03.2f");
+
+ // trackbar ranges - slider-name,start,end,step
+ datamap_set_trackbar_range(properties_datamap, IDC_JDZ, 0.00, 1.00, (float)0.05);
+ datamap_set_trackbar_range(properties_datamap, IDC_JSAT, 0.00, 1.00, (float)0.05);
+ datamap_set_trackbar_range(properties_datamap, IDC_SPEED, 0.00, 3.00, (float)0.01);
+ datamap_set_trackbar_range(properties_datamap, IDC_BEAM_MIN, 0.00, 1.00, (float)0.01);
+ datamap_set_trackbar_range(properties_datamap, IDC_BEAM_MAX, 1.00, 10.00, (float)0.01);
+ datamap_set_trackbar_range(properties_datamap, IDC_BEAM_INTEN, -10.00, 10.00, (float)0.01);
+ datamap_set_trackbar_range(properties_datamap, IDC_FLICKER, 0.00, 1.00, (float)0.01);
+ datamap_set_trackbar_range(properties_datamap, IDC_AUDIO_LATENCY, 1, 5, 1);
+ datamap_set_trackbar_range(properties_datamap, IDC_VOLUME, -32, 0, 1);
+ datamap_set_trackbar_range(properties_datamap, IDC_SECONDSTORUN, 0, 60, 1);
+ datamap_set_trackbar_range(properties_datamap, IDC_NUMSCREENS, 1, 4, 1);
+ datamap_set_trackbar_range(properties_datamap, IDC_PRESCALE, 1, 3, 1);
+ datamap_set_trackbar_range(properties_datamap, IDC_FSGAMMA, 0.0, 3.0, (float)0.1);
+ datamap_set_trackbar_range(properties_datamap, IDC_FSBRIGHTNESS, 0.00, 2.0, (float)0.1);
+ datamap_set_trackbar_range(properties_datamap, IDC_FSCONTRAST, 0.0, 2.0, (float)0.1);
+ datamap_set_trackbar_range(properties_datamap, IDC_GAMMA, 0.0, 3.0, (float)0.1);
+ datamap_set_trackbar_range(properties_datamap, IDC_BRIGHTCORRECT, 0.00, 2.0, (float)0.1);
+ datamap_set_trackbar_range(properties_datamap, IDC_CONTRAST, 0.0, 2.0, (float)0.1);
+ datamap_set_trackbar_range(properties_datamap, IDC_PAUSEBRIGHT, 0.00, 1.00, (float)0.05);
+ datamap_set_trackbar_range(properties_datamap, IDC_BOOTDELAY, 0, 5, 1);
+
+#ifdef MESS
+ // MESS specific stuff
+ datamap_add(properties_datamap, IDC_DIR_LIST, DM_STRING, NULL);
+ datamap_add(properties_datamap, IDC_RAM_COMBOBOX, DM_INT, OPTION_RAMSIZE);
+
+ // set up callbacks
+ datamap_set_callback(properties_datamap, IDC_DIR_LIST, DCT_READ_CONTROL, DirListReadControl);
+ datamap_set_callback(properties_datamap, IDC_DIR_LIST, DCT_POPULATE_CONTROL, DirListPopulateControl);
+ datamap_set_callback(properties_datamap, IDC_RAM_COMBOBOX, DCT_POPULATE_CONTROL, RamPopulateControl);
+#endif
+}
+
+
+static void SetSamplesEnabled(HWND hWnd, int nIndex, BOOL bSoundEnabled)
+{
+ BOOL enabled = false;
+ HWND hCtrl = GetDlgItem(hWnd, IDC_SAMPLES);
+
+
+ if (hCtrl)
+ {
+ if ( nIndex > -1 )
+ {
+ machine_config config(driver_list::driver(nIndex),pCurrentOpts);
+
+ for (device_sound_interface &sound : sound_interface_iterator(config.root_device()))
+ if (sound.device().type() == SAMPLES)
+ enabled = true;
+ }
+ enabled = enabled && bSoundEnabled;
+ EnableWindow(hCtrl, enabled);
+ }
+}
+
+/* Moved here cause it's called in a few places */
+static void InitializeOptions(HWND hDlg)
+{
+// from FX
+// InitializeSampleRateUI(hDlg);
+ InitializeSoundUI(hDlg);
+// InitializeSoundModeUI(hDlg);
+ InitializeSkippingUI(hDlg);
+ InitializeRotateUI(hDlg);
+ InitializeSelectScreenUI(hDlg);
+ InitializeBIOSUI(hDlg);
+ InitializeControllerMappingUI(hDlg);
+ InitializeVideoUI(hDlg);
+// InitializeSnapViewUI(hDlg);
+// InitializeSnapNameUI(hDlg);
+ InitializeLanguageUI(hDlg);
+ InitializePluginsUI(hDlg);
+// InitializeGLSLFilterUI(hDlg);
+#ifdef D3DVERSION
+ InitializeD3DVersionUI(hDlg);
+#endif
+}
+
+/* Moved here because it is called in several places */
+static void InitializeMisc(HWND hDlg)
+{
+ Button_Enable(GetDlgItem(hDlg, IDC_JOYSTICK), DIJoystick.Available());
+}
+
+static void OptOnHScroll(HWND hwnd, HWND hwndCtl, UINT code, int pos)
+{
+ if (hwndCtl == GetDlgItem(hwnd, IDC_NUMSCREENS))
+ NumScreensSelectionChange(hwnd);
+}
+
+/* Handle changes to the Numscreens slider */
+static void NumScreensSelectionChange(HWND hwnd)
+{
+ //Also Update the ScreenSelect Combo with the new number of screens
+ UpdateSelectScreenUI(hwnd );
+}
+
+/* Handle changes to the Refresh drop down */
+static void RefreshSelectionChange(HWND hWnd, HWND hWndCtrl)
+{
+ int nCurSelection = ComboBox_GetCurSel(hWndCtrl);
+
+ if (nCurSelection != CB_ERR)
+ {
+ datamap_read_control(properties_datamap, hWnd, pCurrentOpts, IDC_SIZES);
+ datamap_populate_control(properties_datamap, hWnd, pCurrentOpts, IDC_SIZES);
+ }
+}
+
+/* Initialize the sound options */
+static void InitializeSoundUI(HWND hwnd)
+{
+ int res = 0, i;
+
+ HWND hCtrl = GetDlgItem(hwnd, IDC_SOUND_MODE);
+ if (hCtrl)
+ {
+ for (i = 0; i < NUMSOUND; i++)
+ {
+ res = ComboBox_InsertString(hCtrl, i, g_ComboBoxSound[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl, i, g_ComboBoxSound[i].m_pData);
+ }
+ }
+
+ i = 0;
+
+ hCtrl = GetDlgItem(hwnd, IDC_SAMPLERATE);
+ if (hCtrl)
+ {
+ res = ComboBox_AddString(hCtrl, TEXT("11025"));
+ res = ComboBox_SetItemData(hCtrl, i++, 11025);
+ res = ComboBox_AddString(hCtrl, TEXT("22050"));
+ res = ComboBox_SetItemData(hCtrl, i++, 22050);
+ res = ComboBox_AddString(hCtrl, TEXT("44100"));
+ res = ComboBox_SetItemData(hCtrl, i++, 44100);
+ res = ComboBox_AddString(hCtrl, TEXT("48000"));
+ res = ComboBox_SetItemData(hCtrl, i++, 48000);
+ res = ComboBox_SetCurSel(hCtrl, 1);
+ }
+ res++;
+}
+
+/* Populate the Frame Skipping drop down */
+static void InitializeSkippingUI(HWND hwnd)
+{
+ HWND hCtrl = GetDlgItem(hwnd, IDC_FRAMESKIP);
+ int res = 0, i = 0;
+
+ if (hCtrl)
+ {
+ res = ComboBox_AddString(hCtrl, TEXT("Draw every frame"));
+ res = ComboBox_SetItemData(hCtrl, i++, 0);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 1 frame"));
+ res = ComboBox_SetItemData(hCtrl, i++, 1);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 2 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 2);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 3 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 3);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 4 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 4);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 5 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 5);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 6 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 6);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 7 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 7);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 8 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 8);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 9 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 9);
+ res = ComboBox_AddString(hCtrl, TEXT("Skip 10 frames"));
+ res = ComboBox_SetItemData(hCtrl, i++, 10);
+ }
+ res++;
+}
+
+/* Populate the Rotate drop down */
+static void InitializeRotateUI(HWND hwnd)
+{
+ HWND hCtrl = GetDlgItem(hwnd, IDC_ROTATE);
+ int res = 0;
+
+ if (hCtrl)
+ {
+ res = ComboBox_AddString(hCtrl, TEXT("Default")); // 0
+ res = ComboBox_AddString(hCtrl, TEXT("Clockwise")); // 1
+ res = ComboBox_AddString(hCtrl, TEXT("Anti-clockwise")); // 2
+ res = ComboBox_AddString(hCtrl, TEXT("None")); // 3
+ res = ComboBox_AddString(hCtrl, TEXT("Auto clockwise")); // 4
+ res = ComboBox_AddString(hCtrl, TEXT("Auto anti-clockwise")); // 5
+ }
+ res++;
+}
+
+/* Populate the Video Mode drop down */
+static void InitializeVideoUI(HWND hwnd)
+{
+ int res = 0;
+
+ HWND hCtrl = GetDlgItem(hwnd, IDC_VIDEO_MODE);
+ if (hCtrl)
+ {
+ for (int i = 0; i < NUMVIDEO; i++)
+ {
+ res = ComboBox_InsertString(hCtrl, i, g_ComboBoxVideo[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl, i, g_ComboBoxVideo[i].m_pData);
+ }
+ }
+ res++;
+}
+
+#ifdef D3DVERSION
+/* Populate the D3D Version drop down */
+static void InitializeD3DVersionUI(HWND hwnd)
+{
+ HWND hCtrl = GetDlgItem(hwnd, IDC_D3D_VERSION);
+ int res = 0;
+ if (hCtrl)
+ {
+ for (int i = 0; i < NUMD3DVERSIONS; i++)
+ {
+ res = ComboBox_InsertString(hCtrl, i, g_ComboBoxD3DVersion[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl, i, g_ComboBoxD3DVersion[i].m_pData);
+ }
+ }
+ res++;
+}
+#endif
+static void UpdateSelectScreenUI(HWND hwnd)
+{
+ int res = 0, i, curSel;
+ HWND hCtrl = GetDlgItem(hwnd, IDC_SCREENSELECT);
+ if (hCtrl)
+ {
+ curSel = ComboBox_GetCurSel(hCtrl);
+ if ((curSel < 0) || (curSel >= NUMSELECTSCREEN))
+ curSel = 0;
+ res = ComboBox_ResetContent(hCtrl);
+ for (i = 0; i < NUMSELECTSCREEN && i < pCurrentOpts.int_value(OSDOPTION_NUMSCREENS) ; i++)
+ {
+ res = ComboBox_InsertString(hCtrl, i, g_ComboBoxSelectScreen[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl, i, g_ComboBoxSelectScreen[i].m_pData);
+ }
+ // Smaller Amount of screens was selected, so use 0
+ if( i < curSel )
+ res = ComboBox_SetCurSel(hCtrl, 0);
+ else
+ res = ComboBox_SetCurSel(hCtrl, curSel);
+ }
+ res++;
+}
+
+/* Populate the Select Screen drop down */
+static void InitializeSelectScreenUI(HWND hwnd)
+{
+ UpdateSelectScreenUI(hwnd);
+}
+
+static void InitializeControllerMappingUI(HWND hwnd)
+{
+ int res = 0;
+ HWND hCtrl = GetDlgItem(hwnd,IDC_PADDLE);
+ HWND hCtrl1 = GetDlgItem(hwnd,IDC_ADSTICK);
+ HWND hCtrl2 = GetDlgItem(hwnd,IDC_PEDAL);
+ HWND hCtrl3 = GetDlgItem(hwnd,IDC_MOUSE);
+ HWND hCtrl4 = GetDlgItem(hwnd,IDC_DIAL);
+ HWND hCtrl5 = GetDlgItem(hwnd,IDC_TRACKBALL);
+ HWND hCtrl6 = GetDlgItem(hwnd,IDC_LIGHTGUNDEVICE);
+ HWND hCtrl7 = GetDlgItem(hwnd,IDC_POSITIONAL);
+
+ for (int i = 0; i < NUMDEVICES; i++)
+ {
+ if (hCtrl)
+ {
+ res = ComboBox_InsertString(hCtrl, i, g_ComboBoxDevice[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl, i, g_ComboBoxDevice[i].m_pData);
+ }
+
+ if (hCtrl1)
+ {
+ res = ComboBox_InsertString(hCtrl1, i, g_ComboBoxDevice[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl1, i, g_ComboBoxDevice[i].m_pData);
+ }
+
+ if (hCtrl2)
+ {
+ res = ComboBox_InsertString(hCtrl2, i, g_ComboBoxDevice[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl2, i, g_ComboBoxDevice[i].m_pData);
+ }
+
+ if (hCtrl3)
+ {
+ res = ComboBox_InsertString(hCtrl3, i, g_ComboBoxDevice[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl3, i, g_ComboBoxDevice[i].m_pData);
+ }
+
+ if (hCtrl4)
+ {
+ res = ComboBox_InsertString(hCtrl4, i, g_ComboBoxDevice[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl4, i, g_ComboBoxDevice[i].m_pData);
+ }
+
+ if (hCtrl5)
+ {
+ res = ComboBox_InsertString(hCtrl5, i, g_ComboBoxDevice[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl5, i, g_ComboBoxDevice[i].m_pData);
+ }
+
+ if (hCtrl6)
+ {
+ res = ComboBox_InsertString(hCtrl6, i, g_ComboBoxDevice[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl6, i, g_ComboBoxDevice[i].m_pData);
+ }
+
+ if (hCtrl7)
+ {
+ res = ComboBox_InsertString(hCtrl7, i, g_ComboBoxDevice[i].m_pText);
+ res = ComboBox_SetItemData( hCtrl7, i, g_ComboBoxDevice[i].m_pData);
+ }
+ }
+ res++;
+}
+
+
+static void InitializeBIOSUI(HWND hwnd)
+{
+ HWND hCtrl = GetDlgItem(hwnd,IDC_BIOS);
+ int res = 0, i = 0;
+ TCHAR* t_s;
+ if (hCtrl)
+ {
+ const game_driver *gamedrv = &driver_list::driver(g_nGame);
+ const rom_entry *rom;
+
+ if (g_nGame == GLOBAL_OPTIONS)
+ {
+ res = ComboBox_InsertString(hCtrl, i, TEXT("None"));
+ res = ComboBox_SetItemData( hCtrl, i++, "");
+ return;
+ }
+ if (g_nGame == LOCAL_OPTIONS) //Folder Options: This is the only place that LOCAL_OPTIONS is used, is this code ever executed?
+ {
+ gamedrv = &driver_list::driver(g_nFolderGame);
+ if (DriverHasOptionalBIOS(g_nFolderGame) == false)
+ {
+ res = ComboBox_InsertString(hCtrl, i, TEXT("None"));
+ res = ComboBox_SetItemData( hCtrl, i++, "");
+ return;
+ }
+ res = ComboBox_InsertString(hCtrl, i, TEXT("Default"));
+ res = ComboBox_SetItemData( hCtrl, i++, "");
+
+ if (gamedrv->rom)
+ {
+ auto rom_entries = rom_build_entries(gamedrv->rom);
+ for (rom = rom_entries.data(); !ROMENTRY_ISEND(rom); rom++)
+ {
+ if (ROMENTRY_ISSYSTEM_BIOS(rom))
+ {
+ const char *name = ROM_GETHASHDATA(rom);
+ const char *biosname = ROM_GETNAME(rom);
+ t_s = ui_wstring_from_utf8(name);
+ if( !t_s )
+ return;
+ res = ComboBox_InsertString(hCtrl, i, win_tstring_strdup(t_s));
+ res = ComboBox_SetItemData( hCtrl, i++, biosname);
+ free(t_s);
+ }
+ }
+ }
+ return;
+ }
+
+ if (DriverHasOptionalBIOS(g_nGame) == false)
+ {
+ res = ComboBox_InsertString(hCtrl, i, TEXT("None"));
+ res = ComboBox_SetItemData( hCtrl, i++, "");
+ return;
+ }
+ res = ComboBox_InsertString(hCtrl, i, TEXT("Default"));
+ res = ComboBox_SetItemData( hCtrl, i++, "");
+
+ if (gamedrv->rom)
+ {
+ auto rom_entries = rom_build_entries(gamedrv->rom);
+ for (rom = rom_entries.data(); !ROMENTRY_ISEND(rom); rom++)
+ {
+ if (ROMENTRY_ISSYSTEM_BIOS(rom))
+ {
+ const char *name = ROM_GETHASHDATA(rom);
+ const char *biosname = ROM_GETNAME(rom);
+ t_s = ui_wstring_from_utf8(name);
+ if( !t_s )
+ return;
+ res = ComboBox_InsertString(hCtrl, i, win_tstring_strdup(t_s));
+ res = ComboBox_SetItemData( hCtrl, i++, biosname);
+ free(t_s);
+ }
+ }
+ }
+ }
+ res++;
+}
+
+static void InitializeLanguageUI(HWND hWnd)
+{
+ HWND hCtrl = GetDlgItem(hWnd, IDC_LANGUAGE);
+
+ if (hCtrl)
+ {
+ int count = 0;
+ string t1 = GetLangDir();
+ const char* t2 = t1.c_str();
+ osd::directory::ptr directory = osd::directory::open(t2);
+
+ if (directory == nullptr)
+ return;
+
+ for (const osd::directory::entry *entry = directory->read(); entry; entry = directory->read())
+ {
+ if (entry->type == osd::directory::entry::entry_type::DIR)
+ {
+ string name = entry->name;
+
+ if (!(name == "." || name == ".."))
+ {
+ char *value = strdup(entry->name);
+ wchar_t *text = ui_wstring_from_utf8(entry->name);
+ (void)ComboBox_InsertString(hCtrl, count, text);
+ (void)ComboBox_SetItemData(hCtrl, count, value);
+ count++;
+ free(text);
+ free(value);
+ }
+ }
+ }
+
+ directory.reset();
+ }
+}
+
+static void InitializePluginsUI(HWND hWnd)
+{
+ HWND hCtrl = GetDlgItem(hWnd, IDC_SELECT_PLUGIN);
+
+ if (hCtrl)
+ {
+ string t1 = GetPluginsDir();
+ const char* t2 = t1.c_str();
+ osd::directory::ptr directory = osd::directory::open(t2);
+
+ if (directory == nullptr)
+ return;
+
+ TCHAR* t_s;
+ int count = 0;
+
+ for (const osd::directory::entry *entry = directory->read(); entry; entry = directory->read())
+ {
+ if (entry->type == osd::directory::entry::entry_type::DIR)
+ {
+ string name = entry->name;
+
+ if (!(name == "." || name == ".." || name == "json"))
+ {
+ plugin_names[count] = name;
+ const char* label = name.c_str();
+ t_s = ui_wstring_from_utf8(label);
+ label = 0;
+ if( !t_s )
+ return;
+ if (ComboBox_InsertString(hCtrl, count++, win_tstring_strdup(t_s)) == CB_ERR)
+ return;
+ free(t_s);
+ }
+ }
+ }
+ directory.reset();
+ }
+
+ (void)ComboBox_SetCurSel(hCtrl, -1);
+ (void)ComboBox_SetCueBannerText(hCtrl, TEXT("Select a plugin"));
+}
+#if 0
+static void InitializeGLSLFilterUI(HWND hWnd)
+{
+ HWND hCtrl = GetDlgItem(hWnd, IDC_GLSLFILTER);
+
+ if (hCtrl)
+ {
+ for (int i = 0; i < NUMGLSLFILTER; i++)
+ {
+ (void)ComboBox_InsertString(hCtrl, i, g_ComboBoxGLSLFilter[i].m_pText);
+ (void)ComboBox_SetItemData(hCtrl, i, g_ComboBoxGLSLFilter[i].m_pData);
+ }
+ }
+}
+#endif
+static BOOL SelectEffect(HWND hWnd)
+{
+ char filename[MAX_PATH];
+ BOOL changed = false;
+
+ *filename = 0;
+ if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_EFFECT_FILES))
+ {
+ //strip Path and extension
+ char buff[MAX_PATH];
+ int i, j = 0, k = 0, l = 0;
+ for(i=0; i<strlen(filename); i++ )
+ {
+ if( filename[i] == '\\' )
+ j = i;
+ if( filename[i] == '.' )
+ k = i;
+ }
+ for(i=j+1; i<k; i++)
+ buff[l++] = filename[i];
+
+ buff[l] = '\0';
+
+ if (strcmp(buff, pCurrentOpts.value(OPTION_EFFECT))!=0)
+ {
+ HWND control = GetDlgItem(hWnd, IDC_EFFECT);
+ pCurrentOpts.set_value(OPTION_EFFECT, buff, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(control, buff);
+ // datamap_populate_control(properties_datamap, hWnd, pCurrentOpts, IDC_EFFECT);
+ changed = true;
+ }
+ }
+ return changed;
+}
+
+static BOOL ResetEffect(HWND hWnd)
+{
+ BOOL changed = false;
+ const char *new_value = "none";
+
+ if (strcmp(new_value, pCurrentOpts.value(OPTION_EFFECT))!=0)
+ {
+ HWND control = GetDlgItem(hWnd, IDC_EFFECT);
+ pCurrentOpts.set_value(OPTION_EFFECT, new_value, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(control, new_value);
+ // datamap_populate_control(properties_datamap, hWnd, pCurrentOpts, IDC_EFFECT);
+ changed = true;
+ }
+ return changed;
+}
+
+static BOOL SelectJoystickMap(HWND hWnd)
+{
+ char filename[MAX_PATH];
+ BOOL changed = false;
+
+ *filename = 0;
+ if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_JOYMAP_FILES))
+ {
+ if (strcmp(filename, pCurrentOpts.value(OPTION_JOYSTICK_MAP))!=0)
+ {
+ HWND control = GetDlgItem(hWnd, IDC_JOYSTICKMAP);
+ pCurrentOpts.set_value(OPTION_JOYSTICK_MAP, filename, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(control, filename);
+ changed = true;
+ }
+ }
+ return changed;
+}
+
+static BOOL ResetJoystickMap(HWND hWnd)
+{
+ BOOL changed = false;
+ const char *new_value = "auto";
+
+ if (strcmp(new_value, pCurrentOpts.value(OPTION_JOYSTICK_MAP))!=0)
+ {
+ HWND control = GetDlgItem(hWnd, IDC_JOYSTICKMAP);
+ pCurrentOpts.set_value(OPTION_JOYSTICK_MAP, new_value, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(control, new_value);
+ changed = true;
+ }
+ return changed;
+}
+
+static bool SelectLUAScript(HWND hWnd)
+{
+ char filename[MAX_PATH];
+ bool changed = false;
+
+ *filename = 0;
+
+ if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_LUASCRIPT_FILES))
+ {
+ char option[MAX_PATH];
+ char script[MAX_PATH];
+ wchar_t *t_filename = ui_wstring_from_utf8(filename);
+ wchar_t *tempname = PathFindFileName(t_filename);
+ char *optvalue = ui_utf8_from_wstring(tempname);
+ strcpy(script, optvalue);
+ PathRemoveExtension(tempname);
+ char *optname = ui_utf8_from_wstring(tempname);
+ strcpy(option, optname);
+ free(t_filename);
+ free(optname);
+ free(optvalue);
+
+ if (strcmp(script, pCurrentOpts.value(OPTION_AUTOBOOT_SCRIPT)))
+ {
+ pCurrentOpts.set_value(OPTION_AUTOBOOT_SCRIPT, script, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(GetDlgItem(hWnd, IDC_LUASCRIPT), option);
+ changed = true;
+ }
+ }
+
+ return changed;
+}
+
+static bool ResetLUAScript(HWND hWnd)
+{
+ bool changed = false;
+ const char *new_value = "";
+
+ if (strcmp(new_value, pCurrentOpts.value(OPTION_AUTOBOOT_SCRIPT)))
+ {
+ pCurrentOpts.set_value(OPTION_AUTOBOOT_SCRIPT, new_value, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(GetDlgItem(hWnd, IDC_LUASCRIPT), "None");
+ changed = true;
+ }
+
+ return changed;
+}
+
+static bool SelectPlugins(HWND hWnd)
+{
+ bool changed = false;
+ bool already_enabled = false;
+ HWND hcontrol = GetDlgItem(hWnd, IDC_SELECT_PLUGIN);
+ if (!hcontrol)
+ return changed;
+
+ int index = ComboBox_GetCurSel(hcontrol);
+ if (index == CB_ERR)
+ return changed;
+
+ const char *new_value = plugin_names[index].c_str();
+ string t1 = GetPlugins();
+ const char* value = t1.c_str();
+
+ char *token = NULL;
+ char buffer[990]; // hold all plugins
+ char plugins[24][32]; // number of possible plugins, max length of name
+ int num_plugins = 0;
+
+ strcpy(buffer, value);
+ token = strtok(buffer, ",");
+
+ if (token == NULL)
+ {
+ strcpy(plugins[num_plugins], buffer);
+ }
+ else
+ {
+ while (token != NULL)
+ {
+ strcpy(plugins[num_plugins], token);
+ num_plugins++;
+ token = strtok(NULL, ",");
+ }
+ }
+
+ if (strcmp(value, "") == 0)
+ {
+ pCurrentOpts.set_value(OPTION_PLUGIN, new_value, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(GetDlgItem(hWnd, IDC_PLUGIN), new_value);
+ changed = true;
+ (void)ComboBox_SetCurSel(GetDlgItem(hWnd, IDC_SELECT_PLUGIN), -1);
+ return changed;
+ }
+
+ for (int i = 0; i < num_plugins; i++)
+ {
+ if (strcmp(new_value, plugins[i]) == 0)
+ {
+ already_enabled = true;
+ break;
+ }
+ }
+
+ if (!already_enabled)
+ {
+ char new_option[256];
+ snprintf(new_option, WINUI_ARRAY_LENGTH(new_option), "%s,%s", value, new_value);
+ pCurrentOpts.set_value(OPTION_PLUGIN, new_option, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(GetDlgItem(hWnd, IDC_PLUGIN), new_option);
+ changed = true;
+ }
+
+ (void)ComboBox_SetCurSel(GetDlgItem(hWnd, IDC_SELECT_PLUGIN), -1);
+ return changed;
+}
+
+static bool ResetPlugins(HWND hWnd)
+{
+ bool changed = false;
+ pCurrentOpts.set_value(OPTION_PLUGIN, "", OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(GetDlgItem(hWnd, IDC_PLUGIN), "None");
+ changed = true;
+ (void)ComboBox_SetCurSel(GetDlgItem(hWnd, IDC_SELECT_PLUGIN), -1);
+ return changed;
+}
+
+static BOOL SelectDebugscript(HWND hWnd)
+{
+ char filename[MAX_PATH];
+ BOOL changed = false;
+
+ *filename = 0;
+ if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_DEBUGSCRIPT_FILES))
+ {
+ if (strcmp(filename, pCurrentOpts.value(OPTION_DEBUGSCRIPT))!=0)
+ {
+ HWND control = GetDlgItem(hWnd, IDC_DEBUGSCRIPT);
+ pCurrentOpts.set_value(OPTION_DEBUGSCRIPT, filename, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(control, filename);
+ changed = true;
+ }
+ }
+ return changed;
+}
+
+static BOOL ResetDebugscript(HWND hWnd)
+{
+ BOOL changed = false;
+ const char *new_value = "";
+
+ if (strcmp(new_value, pCurrentOpts.value(OPTION_DEBUGSCRIPT))!=0)
+ {
+ HWND control = GetDlgItem(hWnd, IDC_DEBUGSCRIPT);
+ pCurrentOpts.set_value(OPTION_DEBUGSCRIPT, new_value, OPTION_PRIORITY_CMDLINE);
+ win_set_window_text_utf8(control, new_value);
+ changed = true;
+ }
+ return changed;
+}
+
+void UpdateBackgroundBrush(HWND hwndTab)
+{
+ // Destroy old brush
+ if (hBkBrush)
+ DeleteBrush(hBkBrush);
+
+ hBkBrush = NULL;
+
+ // Only do this if the theme is active
+ if (SafeIsAppThemed())
+ {
+ // Get tab control dimensions
+ RECT rc;
+ GetWindowRect( hwndTab, &rc);
+
+ // Get the tab control DC
+ HDC hDC = GetDC(hwndTab);
+
+ // Create a compatible DC
+ HDC hDCMem = CreateCompatibleDC(hDC);
+ HBITMAP hBmp = CreateCompatibleBitmap(hDC, rc.right - rc.left, rc.bottom - rc.top);
+ HBITMAP hBmpOld = (HBITMAP)(SelectObject(hDCMem, hBmp));
+
+ // Tell the tab control to paint in our DC
+ SendMessage(hwndTab, WM_PRINTCLIENT, (WPARAM)(hDCMem), (LPARAM)(PRF_ERASEBKGND | PRF_CLIENT | PRF_NONCLIENT));
+
+ // Create a pattern brush from the bitmap selected in our DC
+ hBkBrush = CreatePatternBrush(hBmp);
+
+ // Restore the bitmap
+ SelectObject(hDCMem, hBmpOld);
+
+ // Cleanup
+ DeleteBitmap(hBmp);
+ DeleteDC(hDCMem);
+ ReleaseDC(hwndTab, hDC);
+ }
+}
+
+
+// from propertiesms.cpp (MESSUI)
+
+
+//============================================================
+#ifdef MESS
+//============================================================
+// DATAMAP HANDLERS FOR MESS
+//============================================================
+
+static void AppendList(HWND hList, LPCTSTR lpItem, int nItem)
+{
+ LV_ITEM Item;
+ memset(&Item, 0, sizeof(LV_ITEM));
+ Item.mask = LVIF_TEXT;
+ Item.pszText = (LPTSTR) lpItem;
+ Item.iItem = nItem;
+ HRESULT res = ListView_InsertItem(hList, &Item);
+ res++;
+}
+
+static BOOL DirListReadControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ int directory_count;
+ LV_ITEM lvi;
+ TCHAR buffer[2048];
+ int pos = 0;
+ BOOL res;
+
+ // determine the directory count; note that one item is the "< >" entry
+ directory_count = ListView_GetItemCount(control);
+ if (directory_count > 0)
+ directory_count--;
+
+ buffer[0] = '\0';
+
+ for (int i = 0; i < directory_count; i++)
+ {
+ // append a semicolon, if we're past the first entry
+ if (i > 0)
+ pos += _sntprintf(&buffer[pos], ARRAY_LENGTH(buffer) - pos, TEXT(";"));
+
+ // retrieve the next entry
+ memset(&lvi, '\0', sizeof(lvi));
+ lvi.mask = LVIF_TEXT;
+ lvi.iItem = i;
+ lvi.pszText = &buffer[pos];
+ lvi.cchTextMax = ARRAY_LENGTH(buffer) - pos;
+ res = ListView_GetItem(control, &lvi);
+
+ // advance the position
+ pos += _tcslen(&buffer[pos]);
+ }
+
+ char* paths = ui_utf8_from_wstring(buffer);
+ if ((buffer[1] == 0x3A) || (buffer[0] == 0)) // must be a folder or null
+ pCurrentOpts.set_value(OPTION_SWPATH, paths, OPTION_PRIORITY_CMDLINE);
+
+ free (paths);
+ res++;
+ return true;
+}
+
+
+static BOOL DirListPopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ int new_pos = 0;
+
+ // access the directory list, and convert to TCHARs
+ int driver_index = PropertiesCurrentGame(dialog);
+ windows_options o;
+ load_options(o, OPTIONS_GAME, driver_index, 0);
+ const char* paths = o.value(OPTION_SWPATH);
+ TCHAR* t_dir_list = ui_wstring_from_utf8(paths);
+ paths = 0;
+ if (!t_dir_list)
+ return false;
+
+ // delete all items in the list control
+ BOOL b_res = ListView_DeleteAllItems(control);
+
+ // add the column
+ RECT r;
+ GetClientRect(control, &r);
+ LV_COLUMN lvc;
+ memset(&lvc, 0, sizeof(LVCOLUMN));
+ lvc.mask = LVCF_WIDTH;
+ lvc.cx = r.right - r.left - GetSystemMetrics(SM_CXHSCROLL);
+ HRESULT res = ListView_InsertColumn(control, 0, &lvc);
+
+ // add each of the directories
+ int pos = 0;
+ int current_item = 0;
+ while(t_dir_list[pos] != '\0')
+ {
+ // parse off this item
+ TCHAR *s = _tcschr(&t_dir_list[pos], ';');
+ if (s)
+ {
+ *s = '\0';
+ new_pos = s - t_dir_list + 1;
+ }
+ else
+ new_pos = pos + _tcslen(&t_dir_list[pos]);
+
+ // append this item
+ AppendList(control, &t_dir_list[pos], current_item);
+
+ // advance to next item
+ pos = new_pos;
+ current_item++;
+ }
+
+ // finish up
+ AppendList(control, TEXT(DIRLIST_NEWENTRYTEXT), current_item);
+ ListView_SetItemState(control, 0, LVIS_SELECTED, LVIS_SELECTED);
+ free(t_dir_list);
+ res++;
+ b_res++;
+ return true;
+}
+
+
+
+static const char *messram_string(char *buffer, UINT32 ram)
+{
+ const char *suffix;
+
+ if ((ram % (1024*1024)) == 0)
+ {
+ ram /= 1024*1024;
+ suffix = "MB";
+ }
+ else if ((ram % 1024) == 0)
+ {
+ ram /= 1024;
+ suffix = "KB";
+ }
+ else
+ suffix = "";
+
+ sprintf(buffer, "%u%s", ram, suffix);
+ return buffer;
+}
+
+//-------------------------------------------------
+// parse_string - convert a ram string to an
+// integer value
+//-------------------------------------------------
+
+static uint32_t parse_string(const char *s)
+{
+ static const struct
+ {
+ const char *suffix;
+ unsigned multiple;
+ } s_suffixes[] =
+ {
+ { "", 1 },
+ { "k", 1024 },
+ { "kb", 1024 },
+ { "kib", 1024 },
+ { "m", 1024 * 1024 },
+ { "mb", 1024 * 1024 },
+ { "mib", 1024 * 1024 }
+ };
+
+ // parse the string
+ unsigned ram = 0;
+ char suffix[8] = { 0, };
+ sscanf(s, "%u%7s", &ram, suffix);
+
+ // perform the lookup
+ auto iter = std::find_if(std::begin(s_suffixes), std::end(s_suffixes), [&suffix](const auto &potential_suffix)
+ { return !core_stricmp(suffix, potential_suffix.suffix); } );
+
+ // identify the multiplier (or 0 if not recognized, signalling a parse failure)
+ unsigned multiple = iter != std::end(s_suffixes) ? iter->multiple : 0;
+
+ // return the result
+ return ram * multiple;
+}
+
+static BOOL RamPopulateControl(datamap *map, HWND dialog, HWND control, windows_options *opts, const char *option_name)
+{
+ int i = 0, current_index = 0;
+
+ // identify the driver
+ int driver_index = PropertiesCurrentGame(dialog);
+ const game_driver *gamedrv = &driver_list::driver(driver_index);
+
+ // clear out the combo box
+ int res = ComboBox_ResetContent(control);
+
+ // allocate the machine config
+ machine_config cfg(*gamedrv,*opts);
+
+ // identify how many options that we have
+ ram_device_iterator iter(cfg.root_device());
+ ram_device *device = iter.first();
+
+ EnableWindow(control, (device != NULL));
+
+ // we can only do something meaningful if there is more than one option
+ if (device)
+ {
+ const ram_device *ramdev = dynamic_cast<const ram_device *>(device);
+
+ // identify the current amount of RAM
+ const char *this_ram_string = opts->value(OPTION_RAMSIZE);
+ uint32_t current_ram = (this_ram_string) ? parse_string(this_ram_string) : 0;
+ uint32_t ram = ramdev->default_size();
+ if (current_ram == 0)
+ current_ram = ram;
+
+ char ramtext[20];
+ messram_string(ramtext, ram);
+ TCHAR *t_ramstring = ui_wstring_from_utf8(ramtext);
+ if( !t_ramstring )
+ return false;
+
+ res = ComboBox_InsertString(control, i, win_tstring_strdup(t_ramstring));
+ res = ComboBox_SetItemData(control, i, ram);
+
+ if (!ramdev->extra_options().empty())
+ {
+ /* try to parse each option */
+ for (ram_device::extra_option const &option : ramdev->extra_options())
+ {
+ // identify this option
+ t_ramstring = ui_wstring_from_utf8(option.first.c_str());
+ if( t_ramstring )
+ {
+ i++;
+ // add this option to the combo box
+ res = ComboBox_InsertString(control, i, win_tstring_strdup(t_ramstring));
+ res = ComboBox_SetItemData(control, i, option.second);
+
+ // is this the current option? record the index if so
+ if (option.second == current_ram)
+ current_index = i;
+ }
+ }
+ }
+ if (t_ramstring)
+ free (t_ramstring);
+ // set the combo box
+ res = ComboBox_SetCurSel(control, current_index);
+ }
+ res++;
+ return true;
+}
+
+
+static void MarkChanged(HWND hDlg)
+{
+ /* fake a CBN_SELCHANGE event from IDC_SIZES to force it to be changed */
+ HWND hCtrl = GetDlgItem(hDlg, IDC_SIZES);
+ PostMessage(hDlg, WM_COMMAND, (CBN_SELCHANGE << 16) | IDC_SIZES, (LPARAM) hCtrl);
+}
+
+
+static BOOL SoftwareDirectories_OnInsertBrowse(HWND hDlg, BOOL bBrowse, LPCTSTR lpItem)
+{
+ TCHAR inbuf[MAX_PATH];
+ TCHAR outbuf[MAX_PATH];
+ LPTSTR lpIn;
+ BOOL res = false;
+
+ g_bModifiedSoftwarePaths = true;
+
+ HWND hList = GetDlgItem(hDlg, IDC_DIR_LIST);
+ int nItem = ListView_GetNextItem(hList, -1, LVNI_SELECTED);
+
+ if (nItem == -1)
+ return false;
+
+ /* Last item is placeholder for append */
+ if (nItem == ListView_GetItemCount(hList) - 1)
+ bBrowse = false;
+
+ if (!lpItem)
+ {
+ if (bBrowse)
+ {
+ ListView_GetItemText(hList, nItem, 0, inbuf, ARRAY_LENGTH(inbuf));
+ lpIn = inbuf;
+ }
+ else
+ lpIn = NULL;
+
+ if (!BrowseForDirectory(hDlg, lpIn, outbuf))
+ return false;
+
+ lpItem = outbuf;
+ }
+
+ AppendList(hList, lpItem, nItem);
+ if (bBrowse)
+ res = ListView_DeleteItem(hList, nItem+1);
+ MarkChanged(hDlg);
+ res++;
+ return true;
+}
+
+
+
+static BOOL SoftwareDirectories_OnDelete(HWND hDlg)
+{
+ int nSelect = 0;
+ HWND hList = GetDlgItem(hDlg, IDC_DIR_LIST);
+
+ g_bModifiedSoftwarePaths = true;
+
+ int nItem = ListView_GetNextItem(hList, -1, LVNI_SELECTED | LVNI_ALL);
+
+ if (nItem == -1)
+ return false;
+
+ /* Don't delete "Append" placeholder. */
+ if (nItem == ListView_GetItemCount(hList) - 1)
+ return false;
+
+ BOOL res = ListView_DeleteItem(hList, nItem);
+
+ int nCount = ListView_GetItemCount(hList);
+ if (nCount <= 1)
+ return false;
+
+ /* If the last item was removed, select the item above. */
+ if (nItem == nCount - 1)
+ nSelect = nCount - 2;
+ else
+ nSelect = nItem;
+
+ ListView_SetItemState(hList, nSelect, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ MarkChanged(hDlg);
+ res++;
+ return true;
+}
+
+
+
+static BOOL SoftwareDirectories_OnBeginLabelEdit(HWND hDlg, NMHDR* pNMHDR)
+{
+ BOOL bResult = false;
+ NMLVDISPINFO* pDispInfo = (NMLVDISPINFO*)pNMHDR;
+ LVITEM* pItem = &pDispInfo->item;
+ HWND hList = GetDlgItem(hDlg, IDC_DIR_LIST);
+
+ /* Last item is placeholder for append */
+ if (pItem->iItem == ListView_GetItemCount(hList) - 1)
+ {
+ HWND hEdit = (HWND) (uintptr_t) SendMessage(hList, LVM_GETEDITCONTROL, 0, 0);
+ win_set_window_text_utf8(hEdit, "");
+ }
+
+ return bResult;
+}
+
+
+
+static BOOL SoftwareDirectories_OnEndLabelEdit(HWND hDlg, NMHDR* pNMHDR)
+{
+ BOOL bResult = false;
+ NMLVDISPINFO* pDispInfo = (NMLVDISPINFO*)pNMHDR;
+ LVITEM* pItem = &pDispInfo->item;
+
+ if (pItem->pszText)
+ {
+ struct _stat file_stat;
+
+ /* Don't allow empty entries. */
+ if (!_tcscmp(pItem->pszText, TEXT("")))
+ return false;
+
+ /* Check validity of edited directory. */
+ if ((_tstat(pItem->pszText, &file_stat) == 0) && (file_stat.st_mode & S_IFDIR))
+ bResult = true;
+ else
+ if (win_message_box_utf8(NULL, "Folder does not exist, continue anyway?", MAMEUINAME, MB_OKCANCEL) == IDOK)
+ bResult = true;
+ }
+
+ if (bResult == true)
+ SoftwareDirectories_OnInsertBrowse(hDlg, true, pItem->pszText);
+
+ return bResult;
+}
+
+
+static BOOL DriverHasDevice(const game_driver *gamedrv, iodevice_t type)
+{
+ BOOL b = false;
+
+ // allocate the machine config
+ machine_config config(*gamedrv,MameUIGlobal());
+
+ for (device_image_interface &dev : image_interface_iterator(config.root_device()))
+ {
+ if (!dev.user_loadable())
+ continue;
+ if (dev.image_type() == type)
+ {
+ b = true;
+ break;
+ }
+ }
+ return b;
+}
+
+BOOL PropSheetFilter_Config(const machine_config *drv, const game_driver *gamedrv)
+{
+ ram_device_iterator iter(drv->root_device());
+ return (iter.first()) || DriverHasDevice(gamedrv, IO_PRINTER);
+}
+
+INT_PTR CALLBACK GameMessOptionsProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ INT_PTR rc = 0;
+ BOOL bHandled = false;
+
+ switch (Msg)
+ {
+ case WM_NOTIFY:
+ switch (((NMHDR *) lParam)->code)
+ {
+ case LVN_ENDLABELEDIT:
+ rc = SoftwareDirectories_OnEndLabelEdit(hDlg, (NMHDR *) lParam);
+ bHandled = true;
+ break;
+
+ case LVN_BEGINLABELEDIT:
+ rc = SoftwareDirectories_OnBeginLabelEdit(hDlg, (NMHDR *) lParam);
+ bHandled = true;
+ break;
+ }
+ }
+
+ if (!bHandled)
+ rc = GameOptionsProc(hDlg, Msg, wParam, lParam);
+
+ return rc;
+}
+
+
+
+BOOL MessPropertiesCommand(HWND hWnd, WORD wNotifyCode, WORD wID, BOOL *changed)
+{
+ BOOL handled = true;
+
+ switch(wID)
+ {
+ case IDC_DIR_BROWSE:
+ if (wNotifyCode == BN_CLICKED)
+ *changed = SoftwareDirectories_OnInsertBrowse(hWnd, true, NULL);
+ break;
+
+ case IDC_DIR_INSERT:
+ if (wNotifyCode == BN_CLICKED)
+ *changed = SoftwareDirectories_OnInsertBrowse(hWnd, false, NULL);
+ break;
+
+ case IDC_DIR_DELETE:
+ if (wNotifyCode == BN_CLICKED)
+ *changed = SoftwareDirectories_OnDelete(hWnd);
+ break;
+
+ default:
+ handled = false;
+ break;
+ }
+ return handled;
+}
+
+#endif
+
diff --git a/docs/release/src/osd/winui/properties.h b/docs/release/src/osd/winui/properties.h
new file mode 100644
index 00000000000..f7b1696b4c3
--- /dev/null
+++ b/docs/release/src/osd/winui/properties.h
@@ -0,0 +1,58 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef PROPERTIES_H
+#define PROPERTIES_H
+
+/* Get title string to display in the top of the property page,
+ * Called also in ui_audit.cpp
+ */
+char* GameInfoTitle(OPTIONS_TYPE opt_type, UINT nIndex);
+
+/* Called in winui.cpp to create the property page */
+void InitPropertyPage(HINSTANCE hInst, HWND hWnd, HICON hIcon, OPTIONS_TYPE opt_type, int folder_id, int game_num);
+
+#define PROPERTIES_PAGE 0
+#define AUDIT_PAGE 1
+
+void InitPropertyPageToPage(HINSTANCE hInst, HWND hWnd, HICON hIcon, OPTIONS_TYPE opt_type, int folder_id, int game_num, int start_page);
+void InitDefaultPropertyPage(HINSTANCE hInst, HWND hWnd);
+
+/* Get Help ID array for WM_HELP and WM_CONTEXTMENU */
+DWORD_PTR GetHelpIDs(void);
+
+/* Get Game status text string */
+const char* GameInfoStatus(int driver_index, BOOL bRomStatus);
+
+/* Property sheet info for layout.c */
+typedef struct
+{
+ BOOL bOnDefaultPage;
+// BOOL (*pfnFilterProc)(const machine_config *drv, const game_driver *gamedrv);
+ BOOL (*pfnFilterProc)(uint32_t driver_index);
+ DWORD dwDlgID;
+ DLGPROC pfnDlgProc;
+} PROPERTYSHEETINFO;
+
+extern const PROPERTYSHEETINFO g_propSheets[];
+
+BOOL PropSheetFilter_Vector(const machine_config *drv, const game_driver *gamedrv);
+
+INT_PTR CALLBACK GamePropertiesDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK GameOptionsProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+
+int PropertiesCurrentGame(HWND hDlg);
+
+// from propertiesms.h (MESSUI)
+
+BOOL MessPropertiesCommand(HWND hWnd, WORD wNotifyCode, WORD wID, BOOL *changed);
+BOOL g_bModifiedSoftwarePaths = FALSE;
+INT_PTR CALLBACK GameMessOptionsProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+BOOL PropSheetFilter_Config(const machine_config *drv, const game_driver *gamedrv);
+
+#include "datamap.h"
+void MessBuildDataMap(datamap *properties_datamap);
+
+
+#endif
+
diff --git a/docs/release/src/osd/winui/res/about.bmp b/docs/release/src/osd/winui/res/about.bmp
new file mode 100644
index 00000000000..e04a46ca022
--- /dev/null
+++ b/docs/release/src/osd/winui/res/about.bmp
Binary files differ
diff --git a/docs/release/src/osd/winui/res/bkgnd16.bmp b/docs/release/src/osd/winui/res/bkgnd16.bmp
new file mode 100644
index 00000000000..c4a589a32d4
--- /dev/null
+++ b/docs/release/src/osd/winui/res/bkgnd16.bmp
Binary files differ
diff --git a/docs/release/src/osd/winui/res/bkground.bmp b/docs/release/src/osd/winui/res/bkground.bmp
new file mode 100644
index 00000000000..f7e49de3084
--- /dev/null
+++ b/docs/release/src/osd/winui/res/bkground.bmp
Binary files differ
diff --git a/docs/release/src/osd/winui/res/checkmark.ico b/docs/release/src/osd/winui/res/checkmark.ico
new file mode 100644
index 00000000000..dd272c2e536
--- /dev/null
+++ b/docs/release/src/osd/winui/res/checkmark.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/controller.ico b/docs/release/src/osd/winui/res/controller.ico
new file mode 100644
index 00000000000..390c18db340
--- /dev/null
+++ b/docs/release/src/osd/winui/res/controller.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/cpu.ico b/docs/release/src/osd/winui/res/cpu.ico
new file mode 100644
index 00000000000..9c6843fbed5
--- /dev/null
+++ b/docs/release/src/osd/winui/res/cpu.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/custom.ico b/docs/release/src/osd/winui/res/custom.ico
new file mode 100644
index 00000000000..8047b9d0b43
--- /dev/null
+++ b/docs/release/src/osd/winui/res/custom.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/display.ico b/docs/release/src/osd/winui/res/display.ico
new file mode 100644
index 00000000000..b81df196948
--- /dev/null
+++ b/docs/release/src/osd/winui/res/display.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/foldavail.ico b/docs/release/src/osd/winui/res/foldavail.ico
new file mode 100644
index 00000000000..b8bcb595bf9
--- /dev/null
+++ b/docs/release/src/osd/winui/res/foldavail.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/folder.ico b/docs/release/src/osd/winui/res/folder.ico
new file mode 100644
index 00000000000..8a801462d62
--- /dev/null
+++ b/docs/release/src/osd/winui/res/folder.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/foldmanu.ico b/docs/release/src/osd/winui/res/foldmanu.ico
new file mode 100644
index 00000000000..8a801462d62
--- /dev/null
+++ b/docs/release/src/osd/winui/res/foldmanu.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/foldopen.ico b/docs/release/src/osd/winui/res/foldopen.ico
new file mode 100644
index 00000000000..7bab12a3abc
--- /dev/null
+++ b/docs/release/src/osd/winui/res/foldopen.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/foldsrc.ico b/docs/release/src/osd/winui/res/foldsrc.ico
new file mode 100644
index 00000000000..8a801462d62
--- /dev/null
+++ b/docs/release/src/osd/winui/res/foldsrc.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/foldunav.ico b/docs/release/src/osd/winui/res/foldunav.ico
new file mode 100644
index 00000000000..b74cc8edfc8
--- /dev/null
+++ b/docs/release/src/osd/winui/res/foldunav.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/foldyear.ico b/docs/release/src/osd/winui/res/foldyear.ico
new file mode 100644
index 00000000000..8a801462d62
--- /dev/null
+++ b/docs/release/src/osd/winui/res/foldyear.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/harddisk.ico b/docs/release/src/osd/winui/res/harddisk.ico
new file mode 100644
index 00000000000..580d379fab4
--- /dev/null
+++ b/docs/release/src/osd/winui/res/harddisk.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/hbmame.ico b/docs/release/src/osd/winui/res/hbmame.ico
new file mode 100644
index 00000000000..845ec9aedd7
--- /dev/null
+++ b/docs/release/src/osd/winui/res/hbmame.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/hbmameui.ico b/docs/release/src/osd/winui/res/hbmameui.ico
new file mode 100644
index 00000000000..845ec9aedd7
--- /dev/null
+++ b/docs/release/src/osd/winui/res/hbmameui.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/header_down.ico b/docs/release/src/osd/winui/res/header_down.ico
new file mode 100644
index 00000000000..490eb0f7880
--- /dev/null
+++ b/docs/release/src/osd/winui/res/header_down.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/header_up.ico b/docs/release/src/osd/winui/res/header_up.ico
new file mode 100644
index 00000000000..e7cbd555c4e
--- /dev/null
+++ b/docs/release/src/osd/winui/res/header_up.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/horz.ico b/docs/release/src/osd/winui/res/horz.ico
new file mode 100644
index 00000000000..c4a5e940d09
--- /dev/null
+++ b/docs/release/src/osd/winui/res/horz.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/icon_asc.ico b/docs/release/src/osd/winui/res/icon_asc.ico
new file mode 100644
index 00000000000..95f04736dc3
--- /dev/null
+++ b/docs/release/src/osd/winui/res/icon_asc.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/icon_des.ico b/docs/release/src/osd/winui/res/icon_des.ico
new file mode 100644
index 00000000000..cda58ae29b5
--- /dev/null
+++ b/docs/release/src/osd/winui/res/icon_des.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/icon_snd.ico b/docs/release/src/osd/winui/res/icon_snd.ico
new file mode 100644
index 00000000000..8b085042313
--- /dev/null
+++ b/docs/release/src/osd/winui/res/icon_snd.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/icon_sndn.ico b/docs/release/src/osd/winui/res/icon_sndn.ico
new file mode 100644
index 00000000000..ce7d03df4b3
--- /dev/null
+++ b/docs/release/src/osd/winui/res/icon_sndn.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/joystick.ico b/docs/release/src/osd/winui/res/joystick.ico
new file mode 100644
index 00000000000..4a7c5c7cd05
--- /dev/null
+++ b/docs/release/src/osd/winui/res/joystick.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/keyboard.ico b/docs/release/src/osd/winui/res/keyboard.ico
new file mode 100644
index 00000000000..1e11e2c382f
--- /dev/null
+++ b/docs/release/src/osd/winui/res/keyboard.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/mameui.manifest b/docs/release/src/osd/winui/res/mameui.manifest
new file mode 100644
index 00000000000..1ff7516257c
--- /dev/null
+++ b/docs/release/src/osd/winui/res/mameui.manifest
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+ <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+ <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="HBMAMEUI" type="win32" />
+ <description>Homebrew MAME-based Arcade Emulator</description>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/>
+ </dependentAssembly>
+ </dependency>
+ <asmv3:application>
+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+ <dpiAware>TRUE</dpiAware>
+ </asmv3:windowsSettings>
+ </asmv3:application>
+</assembly>
diff --git a/docs/release/src/osd/winui/res/manufact.ico b/docs/release/src/osd/winui/res/manufact.ico
new file mode 100644
index 00000000000..85d8136f08e
--- /dev/null
+++ b/docs/release/src/osd/winui/res/manufact.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/nonwork.ico b/docs/release/src/osd/winui/res/nonwork.ico
new file mode 100644
index 00000000000..8964fc75367
--- /dev/null
+++ b/docs/release/src/osd/winui/res/nonwork.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/samples.ico b/docs/release/src/osd/winui/res/samples.ico
new file mode 100644
index 00000000000..96851b31582
--- /dev/null
+++ b/docs/release/src/osd/winui/res/samples.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/sound.ico b/docs/release/src/osd/winui/res/sound.ico
new file mode 100644
index 00000000000..9f7edeaa6cd
--- /dev/null
+++ b/docs/release/src/osd/winui/res/sound.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/source.ico b/docs/release/src/osd/winui/res/source.ico
new file mode 100644
index 00000000000..94618b8c6fd
--- /dev/null
+++ b/docs/release/src/osd/winui/res/source.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/splith.cur b/docs/release/src/osd/winui/res/splith.cur
new file mode 100644
index 00000000000..7342d296e81
--- /dev/null
+++ b/docs/release/src/osd/winui/res/splith.cur
Binary files differ
diff --git a/docs/release/src/osd/winui/res/toolbar.bmp b/docs/release/src/osd/winui/res/toolbar.bmp
new file mode 100644
index 00000000000..6e7e26055e4
--- /dev/null
+++ b/docs/release/src/osd/winui/res/toolbar.bmp
Binary files differ
diff --git a/docs/release/src/osd/winui/res/vert.ico b/docs/release/src/osd/winui/res/vert.ico
new file mode 100644
index 00000000000..2855e6176d7
--- /dev/null
+++ b/docs/release/src/osd/winui/res/vert.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/win_clone.ico b/docs/release/src/osd/winui/res/win_clone.ico
new file mode 100644
index 00000000000..6c4cb094351
--- /dev/null
+++ b/docs/release/src/osd/winui/res/win_clone.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/win_imp.ico b/docs/release/src/osd/winui/res/win_imp.ico
new file mode 100644
index 00000000000..69a503855d6
--- /dev/null
+++ b/docs/release/src/osd/winui/res/win_imp.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/win_noro.ico b/docs/release/src/osd/winui/res/win_noro.ico
new file mode 100644
index 00000000000..1f313aa4b95
--- /dev/null
+++ b/docs/release/src/osd/winui/res/win_noro.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/win_redx.ico b/docs/release/src/osd/winui/res/win_redx.ico
new file mode 100644
index 00000000000..1d4f2458314
--- /dev/null
+++ b/docs/release/src/osd/winui/res/win_redx.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/win_roms.ico b/docs/release/src/osd/winui/res/win_roms.ico
new file mode 100644
index 00000000000..9c6843fbed5
--- /dev/null
+++ b/docs/release/src/osd/winui/res/win_roms.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/win_unkn.ico b/docs/release/src/osd/winui/res/win_unkn.ico
new file mode 100644
index 00000000000..4d7f401a4fa
--- /dev/null
+++ b/docs/release/src/osd/winui/res/win_unkn.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/working.ico b/docs/release/src/osd/winui/res/working.ico
new file mode 100644
index 00000000000..4a3f53c6f3b
--- /dev/null
+++ b/docs/release/src/osd/winui/res/working.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/res/year.ico b/docs/release/src/osd/winui/res/year.ico
new file mode 100644
index 00000000000..4f8d93dbbd3
--- /dev/null
+++ b/docs/release/src/osd/winui/res/year.ico
Binary files differ
diff --git a/docs/release/src/osd/winui/resource.h b/docs/release/src/osd/winui/resource.h
new file mode 100644
index 00000000000..8bdf3e5ed84
--- /dev/null
+++ b/docs/release/src/osd/winui/resource.h
@@ -0,0 +1,503 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by mameui.rc
+//
+#define IDPAUSE 3
+#define IDS_UI_FILE 61
+#define IDS_UI_VIEW 62
+#define IDS_UI_OPTIONS 63
+#define IDS_UI_HELP 64
+#define IDS_VIEW_TOOLBAR 70
+#define IDS_VIEW_STATUSBAR 71
+#define IDS_VIEW_FOLDERLIST 72
+#define IDS_VIEW_SCREENSHOT 73
+#define IDS_VIEW_PICTURETABS 74
+#define IDS_VIEW_SPACER1 75
+#define IDS_VIEW_FULLSCREEN 76
+#define IDS_VIEW_SPACER2 77
+#define IDS_VIEW_SHOWPICTURES 78
+#define IDS_VIEW_SPACER3 79
+#define IDS_VIEW_LARGEICONS 80
+#define IDS_VIEW_SMALLICONS 81
+#define IDS_VIEW_LIST 82
+#define IDS_VIEW_DETAILS 83
+#define IDS_VIEW_GROUPED 84
+#define IDS_VIEW_SPACER4 85
+#define IDS_VIEW_ARRANGE 86
+#define IDS_VIEW_LINEUPICONS 87
+#define IDS_VIEW_SPACER5 88
+#define IDS_VIEW_REFRESH 89
+#define IDS_VIEW_CONTEXTFILTERS 90
+#define IDS_VIEW_CUSTOMIZEFIELDS 91
+#define ID_TOOLBAR_EDIT 92
+#define IDD_MAIN 101
+#define IDA_TAB_KEYS 106
+#define IDI_MAMEUI_ICON 107
+#define IDD_ABOUT 108
+#define IDR_MAIN_MENU 109
+#define IDR_UI_MENU 110
+#define IDB_ABOUT 113
+#define IDD_DIRECTX 114
+#define IDD_AUDIT 115
+#define IDD_DIRECTORIES 116
+#define IDD_CUSTOM_FILE 117
+#define IDR_CONTEXT_MENU 118
+#define IDI_WIN_NOROMS 119
+#define IDI_WIN_ROMS 120
+#define IDI_WIN_UNKNOWN 121
+#define IDI_WIN_CLONE 122
+#define IDI_WIN_REDX 123
+#define IDI_FOLDER_OPEN 124
+#define IDI_FOLDER 125
+#define IDI_FOLDER_AVAILABLE 126
+#define IDI_FOLDER_MANUFACTURER 127
+#define IDI_FOLDER_UNAVAILABLE 128
+#define IDI_FOLDER_YEAR 129
+#define IDI_FOLDER_SOURCE 130
+#define IDI_MANUFACTURER 131
+#define IDI_WORKING 132
+#define IDI_NONWORKING 133
+#define IDI_YEAR 134
+#define IDI_SOUND 135
+#define IDI_CPU 136
+#define IDI_HARDDISK 137
+#define IDI_SOURCE 138
+#define IDI_FOLDER_HORIZONTAL 139
+#define IDI_FOLDER_VERTICAL 140
+#define IDR_CONTEXT_HEADER 151
+#define IDD_PROP_GAME 152
+#define IDD_PROP_AUDIT 153
+#define IDD_PROP_DISPLAY 154
+#define IDD_PROP_SOUND 155
+#define IDD_PROP_ADVANCED 156
+#define IDD_PROP_INPUT 157
+#define IDD_PROP_MISC 158
+#define IDD_PROP_VECTOR 159
+#define IDD_COLUMNS 160
+#define IDI_KEYBOARD 161
+#define IDI_JOYSTICK 162
+#define IDI_DISPLAY 163
+#define IDI_CHECKMARK 164
+#define IDC_CURSOR_HSPLIT 165
+#define IDB_TOOLBAR 166
+#define IDR_CONTEXT_TREE 168
+#define IDD_FILTERS 169
+#define IDD_RESET 170
+#define IDD_LOAD_PROGRESS 171
+#define IDD_INTERFACE_OPTIONS 173
+#define IDR_CONTEXT_SCREENSHOT 181
+#define IDI_HEADER_UP 182
+#define IDI_HEADER_DOWN 183
+#define IDD_PROP_CONTROLLER 185
+#define IDD_PROP_SCREEN 187
+#define IDD_PROP_DEBUG 188
+#define IDI_WIN_IMPERFECT 198
+#define IDI_SOUNDTAB 666
+#define IDC_LIST 1000
+#define IDC_JOYSTICK 1003
+#define IDC_SIZES 1005
+#define IDC_FRAMESKIP 1009
+#define IDC_ROTATE 1010
+#define IDC_SCREEN 1012
+#define IDC_VIEW 1013
+#define IDC_SCREENSELECT 1014
+#define IDC_CHEAT 1015
+#define IDC_LOG 1016
+#define IDC_ARTWORK_CROP 1017
+#define IDC_OVERLAYS 1018
+#define IDC_BEZELS 1019
+#define IDC_CPANELS 1020
+#define IDC_MARQUEES 1021
+#define IDC_SLEEP 1022
+#define IDC_GAMMA 1023
+#define IDC_BRIGHTCORRECT 1024
+#define IDC_USE_DEFAULT 1025
+#define IDC_CONTRAST 1026
+#define IDC_SAMPLERATE 1027
+#define IDC_NUMSCREENS 1028
+#define IDC_BEAM 1030
+#define IDC_FLICKER 1031
+#define IDC_FLIPX 1032
+#define IDC_FLIPY 1033
+#define IDC_BACKDROPS 1034
+#define IDC_DIRECTX_HELP 1035
+#define IDC_FLICKERDISP 1036
+#define IDB_WEB_PAGE 1037
+#define IDC_FSCONTRAST 1038
+#define IDC_ROMS_PROGRESS 1039
+#define IDC_SECONDSTORUN 1039
+#define IDC_CONTRASTDISP 1040
+#define IDC_ROMS_CORRECT 1041
+#define IDC_FSCONTRASTDISP 1042
+#define IDC_ROMS_INCORRECT 1043
+#define IDC_SECONDSTORUNDISP 1043
+#define IDC_NUMSCREENSDISP 1044
+#define IDC_ROMS_TOTAL 1045
+#define IDC_SAMPLES_PROGRESS 1046
+#define IDC_SAMPLES_CORRECT 1047
+#define IDC_BEAMDISP 1048
+#define IDC_SAMPLES_INCORRECT 1049
+#define IDC_SAMPLES_TOTAL 1050
+#define IDC_AUDIT_DETAILS 1051
+#define IDC_DIR_COMBO 1053
+#define IDC_DIR_LIST 1054
+#define IDC_DIR_BROWSE 1055
+#define IDC_DIR_INSERT 1056
+#define IDC_DIR_DELETE 1057
+#define IDC_FLICKERTEXT 1058
+#define IDC_SSFRAME 1059
+#define IDC_PRESCALE 1060
+#define IDC_SSPICTURE 1062
+#define IDC_BEAMTEXT 1063
+#define IDC_MULTIKEYBOARD 1065
+#define IDC_RATETEXT 1069
+#define IDC_LISTAVAILABLECOLUMNS 1070
+#define IDC_LISTSHOWCOLUMNS 1071
+#define IDC_BUTTONADD 1072
+#define IDC_BUTTONREMOVE 1073
+#define IDC_BUTTONMOVEDOWN 1074
+#define IDC_BUTTONMOVEUP 1075
+#define IDC_PROP_SOUND 1076
+#define IDC_PROP_CPU 1077
+#define IDC_PROP_TITLE 1078
+#define IDC_PROP_MANUFACTURED 1079
+#define IDC_PROP_STATUS 1080
+#define IDC_PROP_SCREEN 1081
+#define IDC_PROP_COLORS 1082
+#define IDC_PROP_ROMS 1083
+#define IDC_PROP_SAMPLES 1084
+#define IDC_PROP_CLONEOF_TEXT 1085
+#define IDC_PROP_CLONEOF 1086
+#define IDC_VERSION 1088
+#define IDC_FSGAMMA 1090
+#define IDC_GAMMADISP 1091
+#define IDC_FSBRIGHTNESS 1092
+#define IDC_FSGAMMADISP 1093
+#define IDC_PRESCALEDISP 1094
+#define IDC_BRIGHTCORRECTDISP 1095
+#define IDC_FSBRIGHTNESSDISP 1096
+#define IDC_AUTOFRAMESKIP 1097
+#define IDC_TREE 1098
+#define IDC_WINDOWED 1099
+#define IDC_PROP_RESET 1101
+#define IDC_SPLITTER 1102
+#define IDC_SPLITTER2 1103
+#define IDC_DIVIDER 1104
+#define IDC_FILTER_VECTOR 1105
+#define IDC_FILTER_RASTER 1106
+#define IDC_FILTER_UNAVAILABLE 1107
+#define IDC_FILTER_NONWORKING 1108
+#define IDC_FILTER_CLONES 1109
+#define IDC_RESET_GAMES 1110
+#define IDC_RESET_UI 1111
+#define IDC_RESET_FILTERS 1112
+#define IDC_RESET_EFFECT 1113
+#define IDC_RESET_DEFAULT 1114
+#define IDC_FILTER_ORIGINALS 1115
+#define IDC_FILTER_WORKING 1116
+#define IDC_FILTER_AVAILABLE 1117
+#define IDC_FILTER_ARCADE 1118
+#define IDC_FILTER_MESS 1119
+#define IDC_START_GAME_CHECK 1120
+#define IDC_VOLUME 1121
+#define IDC_VOLUMEDISP 1122
+#define IDC_HISTORY 1124
+#define IDC_SAMPLES 1125
+#define IDC_TRIPLE_BUFFER 1127
+#define IDC_LOAD_ROMNAME 1128
+#define IDC_DEFAULT_INPUT 1129
+#define IDC_LANGUAGECHECK 1130
+#define IDC_LANGUAGEBROWSE 1131
+#define IDC_LANGUAGEEDIT 1132
+#define IDC_FILTER_EDIT 1133
+#define IDC_ABOUT 1134
+#define IDC_USE_SOUND 1136
+#define IDC_WAITVSYNC 1137
+#define IDC_HWSTRETCH 1138
+#define IDC_SWITCHRES 1139
+#define IDC_MAXIMIZE 1140
+#define IDC_KEEPASPECT 1141
+#define IDC_SYNCREFRESH 1142
+#define IDC_USE_MOUSE 1143
+#define IDC_THROTTLE 1144
+#define IDC_VOLUMETEXT 1146
+#define IDC_REFRESH 1148
+#define IDC_REFRESHTEXT 1149
+#define IDC_EFFECT 1150
+#define IDC_FSGAMMATEXT 1151
+#define IDC_STEADYKEY 1152
+#define IDC_ASPECTRATION 1154
+#define IDC_ASPECTRATIOD 1155
+#define IDC_ASPECTRATIOTEXT 1156
+#define IDC_JOY_GUI 1157
+#define IDC_BROADCAST 1158
+#define IDC_JDZ 1159
+#define IDC_JDZDISP 1160
+#define IDC_JDZTEXT 1161
+#define IDC_JSATTEXT 1162
+#define IDC_JSAT 1163
+#define IDC_JSATDISP 1164
+#define IDC_AUDIO_LATENCY_DISP 1165
+#define IDC_PLAY_GAME 1166
+#define IDC_LIGHTGUN 1167
+#define IDC_SSTAB 1168
+#define IDC_GAME_ICON 1169
+#define IDC_RANDOM_BG 1170
+#define IDC_CUSTOM_TREE 1171
+#define IDC_CUSTOMFILE_GAME 1173
+#define IDC_LOAD_STATUS 1174
+#define IDC_ERROR_TEXT 1175
+#define IDC_ARTMISCTEXT 1176
+#define IDC_ENABLE_AUTOSAVE 1177
+#define IDC_SKIP_GAME_INFO 1178
+#define IDC_PROP_SOURCE 1179
+#define IDC_FILTER_HORIZONTAL 1180
+#define IDC_PAUSEBRIGHT 1181
+#define IDC_PAUSEBRIGHTDISP 1182
+#define IDC_HIGH_PRIORITY 1183
+#define IDC_D3D_FILTER 1184
+#define IDC_HIDE_MOUSE 1185
+#define IDC_AUDIO_LATENCY 1186
+#define IDC_D3D_VERSION 1187
+#define IDC_AUDIT_DETAILS_PROP 1188
+#define IDC_CYCLETIMESEC 1190
+#define IDC_AUDIO_LATENCY_TEXT 1191
+#define IDC_STRETCH_SCREENSHOT_LARGER 1192
+#define IDC_FILTER_INHERIT 1193
+#define IDC_RESET_PLAYSTATS 1194
+#define IDC_INHERITED 1196
+#define IDC_KEY_GUI 1197
+#define IDC_RELOAD 1198
+#define IDC_DUAL_LIGHTGUN 1199
+#define IDC_NOOFFSET_CLONES 1200
+#define IDC_BIOS 1201
+#define IDC_HISTORY_TAB 1202
+#define IDC_SNAPVIEW 1202
+#define IDC_SCREENSHOT_BORDERSIZE 1204
+#define IDC_SCREENSHOT_BORDERCOLOR 1205
+#define IDC_CYCLETIMESECTXT 1206
+#define IDC_SCREENSHOT_BORDERSIZETXT 1207
+#define IDC_PADDLE 1208
+#define IDC_ADSTICK 1209
+#define IDC_PEDAL 1210
+#define IDC_DIAL 1211
+#define IDC_TRACKBALL 1212
+#define IDC_LIGHTGUNDEVICE 1213
+#define IDC_MOUSE 1214
+#define IDC_POSITIONAL 1215
+#define IDC_HIGH_PRIORITY_TEXT 1216
+#define IDC_HIGH_PRIORITYTXT 1217
+#define IDC_SELECT_EFFECT 1218
+#define IDC_MULTITHREAD_RENDERING 1219
+#define IDC_ASPECT 1220
+#define IDC_LOAD_PROGRESS 1223
+#define IDC_FSBRIGHTNESSTEXT 1224
+#define IDC_FSCONTRASTTEXT 1225
+#define IDC_VIDEO_MODE 1226
+#define IDC_SCREENSELECTTEXT 1227
+#define IDC_PRESCALETEXT 1228
+#define IDC_SOUND_MODE 1229
+#define IDC_MULTIMOUSE 1230
+#define IDC_DEBUG 1231
+#define IDC_REFRESHSPEED 1232
+#define IDC_SPEEDTEXT 1233
+#define IDC_SPEED 1234
+#define IDC_SPEEDDISP 1235
+#define IDC_FILTER_VERTICAL 1236
+#define IDC_SNAPNAME 1237
+#define IDC_COINLOCKOUT 1238
+#define IDC_SECONDSTORUNTEXT 1239
+#define IDC_OSLOG 1240
+#define IDC_VERBOSE 1241
+#define IDC_UPDATEINPAUSE 1242
+#define IDC_DEBUGSCRIPT 1243
+#define IDC_SELECT_DEBUGSCRIPT 1244
+#define IDC_RESET_DEBUGSCRIPT 1245
+#define IDC_SELECT_JOYSTICKMAP 1246
+#define IDC_RESET_JOYSTICKMAP 1247
+#define IDC_JOYSTICKMAP 1248
+#define IDC_SNAPSIZE 1249
+#define IDC_SNAPSIZEWIDTH 1250
+#define IDC_SNAPSIZEHEIGHT 1251
+#define IDC_SNAPSIZETEXT 1252
+#define IDC_SNAPSIZEX 1253
+#define IDC_FILTER_MECHANICAL 1254
+#define IDC_BURNIN 1280
+#define IDC_OVERRIDE_REDX 1352
+#define IDC_SNAPBILINEAR 1353
+#define IDC_BEAM_MIN 1367
+#define IDC_BEAM_MAX 1368
+#define IDC_BEAM_INTEN 1369
+#define IDC_BEAM_MINDISP 1370
+#define IDC_BEAM_MAXDISP 1371
+#define IDC_BEAM_INTENDISP 1372
+#define IDC_LANGUAGE 1380
+#define IDC_BOOTDELAY 1383
+#define IDC_BOOTDELAYDISP 1384
+#define IDC_PLUGINS 1386
+#define IDC_PLUGIN 1387
+#define IDC_SELECT_PLUGIN 1388
+#define IDC_RESET_PLUGIN 1389
+#define IDC_NVRAM_SAVE 1401
+#define IDC_REWIND 1402
+#define IDC_AUTOBOOT_DELAY 1403
+#define IDC_LUASCRIPT 1404
+#define IDC_SELECT_LUASCRIPT 1405
+#define IDC_RESET_LUASCRIPT 1406
+#define IDC_SPLITTER3 2000
+#define IDC_SWTAB 2001
+#define IDC_SWLIST 2002
+#define IDC_SWDEVVIEW 2003
+#define IDC_FILTER_COMPUTER 2004
+#define IDC_FILTER_CONSOLE 2005
+#define IDC_FILTER_MODIFIED 2006
+#define IDC_RAM_COMBOBOX 2008
+#define IDC_RAM_CAPTION 2009
+#define IDC_SOFTLIST 2010
+#define IDI_WIN_NOROMSNEEDED 2100
+#define IDI_WIN_MISSINGOPTROM 2101
+#define IDI_WIN_FLOP 2102
+#define IDI_WIN_CASS 2103
+#define IDI_WIN_SERL 2104
+#define IDI_WIN_SNAP 2105
+#define IDI_WIN_PRIN 2106
+#define IDI_WIN_HARD 2107
+#define IDI_WIN_CYLN 2110
+#define IDI_WIN_PTAP 2111
+#define IDI_WIN_PCRD 2112
+#define IDI_WIN_MIDI 2113
+#define ID_MESS_OPEN_SOFTWARE 2200
+#define IDD_PROP_SOFTWARE 2202
+#define IDD_PROP_CONFIGURATION 2203
+#define ID_CONTEXT_SHOW_FOLDER_START 39000
+#define ID_CONTEXT_SHOW_FOLDER_END 39200
+#define ID_FILE_EXIT 40001
+#define ID_ABOUT 40003
+#define ID_FILE_PLAY 40004
+#define ID_HELP_ABOUT 40006
+#define ID_VIEW_LARGE_ICON 40007
+#define ID_VIEW_SMALL_ICON 40008
+#define ID_VIEW_LIST_MENU 40009
+#define ID_VIEW_DETAIL 40010
+#define ID_VIEW_GROUPED 40011
+#define ID_OPTIONS_FONT 40012
+#define ID_OPTIONS_CLONE_COLOR 40013
+#define ID_OPTIONS_DIR 40014
+#define ID_OPTIONS_DEFAULTS 40015
+#define ID_OPTIONS_RESET_DEFAULTS 40016
+#define ID_OPTIONS_INTERFACE 40017
+#define ID_FILE_AUDIT 40018
+#define ID_FILE_PLAY_RECORD 40019
+#define ID_FILE_PLAY_BACK 40020
+#define ID_FILE_PLAY_RECORD_WAVE 40021
+#define ID_FILE_PLAY_RECORD_MNG 40022
+#define ID_FILE_PLAY_RECORD_AVI 40023
+#define ID_VIEW_PICTURE_AREA 40024
+#define ID_HELP_CONTENTS 40025
+#define ID_HELP_WHATS_NEWUI 40026
+#define ID_HELP_TROUBLE 40027
+#define ID_HELP_RELEASE 40028
+#define ID_HELP_WHATS_NEW 40029
+#define ID_HELP_CHEATS 40030
+#define ID_FILE_AUDIT_X 40031
+#define ID_VIEW_BYGAME 40034
+#define ID_VIEW_BYDIRECTORY 40035
+#define ID_VIEW_BYMANUFACTURER 40036
+#define ID_VIEW_BYYEAR 40037
+#define ID_VIEW_BYTYPE 40038
+#define ID_VIEW_BYTIMESPLAYED 40039
+#define ID_VIEW_LINEUPICONS 40040
+#define ID_UPDATE_GAMELIST 40042
+#define ID_UPDATE_CACHE 40043
+#define ID_SORT_ASCENDING 40045
+#define ID_SORT_DESCENDING 40046
+#define ID_CUSTOMIZE_FIELDS 40048
+#define ID_GAME_PROPERTIES 40049
+#define ID_VIEW_PAGETAB 40050
+#define ID_VIEW_FOLDERS 40051
+#define ID_VIEW_TOOLBARS 40052
+#define ID_VIEW_STATUS 40053
+#define ID_CONTEXT_FILTERS 40054
+#define ID_CONTEXT_RENAME_CUSTOM 40055
+#define ID_CONTEXT_ADD_CUSTOM 40057
+#define ID_CONTEXT_REMOVE_CUSTOM 40058
+#define ID_GAME_AUDIT 40059
+#define ID_CONTEXT_SELECT_RANDOM 40060
+#define ID_OPTIONS_BG 40070
+#define ID_VIEW_FULLSCREEN 40079
+#define ID_CONTEXT_RESET_PLAYSTATS 40081
+#define ID_FOLDER_PROPERTIES 40082
+#define ID_FOLDER_AUDIT 40083
+#define ID_UI_UP 40084
+#define ID_UI_DOWN 40085
+#define ID_UI_LEFT 40086
+#define ID_UI_RIGHT 40087
+#define ID_UI_START 40088
+#define ID_UI_PGUP 40089
+#define ID_UI_PGDOWN 40090
+#define ID_UI_HOME 40091
+#define ID_UI_END 40092
+#define ID_UI_HISTORY_UP 40093
+#define ID_UI_HISTORY_DOWN 40094
+#define ID_FILE_LOADSTATE 40095
+#define ID_FOLDER_SOURCEPROPERTIES 40096
+#define ID_FOLDER_VECTORPROPERTIES 40097
+#define ID_OPTIONS_MAMEINFO 40100
+#define ID_OPTIONS_HISTORY 40101
+#define ID_VIEW_SOFTWARE_AREA 40102
+#define ID_MANUAL 40108
+#define ID_VIDEO_SNAP 40109
+#define ID_PLAY_VIDEO 40110
+#define ID_PLAY_AUDIO 40111
+#define ID_PLAY_MNG 40112
+#define ID_PLAY_M1 40113
+#define ID_VIEW_TAB_ARTWORK 40120
+#define ID_VIEW_TAB_BOSSES 40121
+#define ID_VIEW_TAB_CABINET 40122
+#define ID_VIEW_TAB_CONTROL_PANEL 40123
+#define ID_VIEW_TAB_COVER 40124
+#define ID_VIEW_TAB_ENDS 40125
+#define ID_VIEW_TAB_FLYER 40126
+#define ID_VIEW_TAB_GAMEOVER 40127
+#define ID_VIEW_TAB_HOWTO 40128
+#define ID_VIEW_TAB_LOGO 40129
+#define ID_VIEW_TAB_MARQUEE 40130
+#define ID_VIEW_TAB_PCB 40131
+#define ID_VIEW_TAB_SCORES 40132
+#define ID_VIEW_TAB_SELECT 40133
+#define ID_VIEW_TAB_SCREENSHOT 40134
+#define ID_VIEW_TAB_TITLE 40135
+#define ID_VIEW_TAB_VERSUS 40136
+#define ID_VIEW_TAB_HISTORY 40137
+#define ID_TOGGLE_TAB_ARTWORK 40150
+#define ID_TOGGLE_TAB_BOSSES 40151
+#define ID_TOGGLE_TAB_CABINET 40152
+#define ID_TOGGLE_TAB_CONTROL_PANEL 40153
+#define ID_TOGGLE_TAB_COVER 40154
+#define ID_TOGGLE_TAB_ENDS 40155
+#define ID_TOGGLE_TAB_FLYER 40156
+#define ID_TOGGLE_TAB_GAMEOVER 40157
+#define ID_TOGGLE_TAB_HOWTO 40158
+#define ID_TOGGLE_TAB_LOGO 40159
+#define ID_TOGGLE_TAB_MARQUEE 40160
+#define ID_TOGGLE_TAB_PCB 40161
+#define ID_TOGGLE_TAB_SCORES 40162
+#define ID_TOGGLE_TAB_SELECT 40163
+#define ID_TOGGLE_TAB_SCREENSHOT 40164
+#define ID_TOGGLE_TAB_TITLE 40165
+#define ID_TOGGLE_TAB_VERSUS 40166
+#define ID_TOGGLE_TAB_HISTORY 40167
+#define IDC_STATIC -1
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC 1
+#define _APS_3D_CONTROLS 1
+#define _APS_NEXT_RESOURCE_VALUE 192
+#define _APS_NEXT_COMMAND_VALUE 40157
+#define _APS_NEXT_CONTROL_VALUE 1353
+#define _APS_NEXT_SYMED_VALUE 93
+#endif
+#endif
diff --git a/docs/release/src/osd/winui/resource.hm b/docs/release/src/osd/winui/resource.hm
new file mode 100644
index 00000000000..0934c33b73d
--- /dev/null
+++ b/docs/release/src/osd/winui/resource.hm
@@ -0,0 +1,122 @@
+// Microsoft Visual C++ generated Help ID include file.
+// Used by mameui.rc
+//
+#define HIDC_ADSTICK 0x80b904b9 // IDD_PROP_CONTROLLER [English (U.S.)]
+#define HIDC_ANTIALIAS 0x809f0405 // IDD_PROP_VECTOR [English (U.S.)]
+#define HIDC_ARTWORK_CROP 0x809e03fa // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_ASPECT 0x80bb04c4 // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_ASPECTRATIOD 0x80bb0483 // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_ASPECTRATION 0x80bb0482 // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_AUDIO_LATENCY 0x809b04a2 // IDD_PROP_SOUND [English (U.S.)]
+#define HIDC_AUTOFRAMESKIP 0x809c0449 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_BACKDROPS 0x809e040a // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_BEAM 0x809f0406 // IDD_PROP_VECTOR [English (U.S.)]
+#define HIDC_BEZELS 0x809e03fd // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_BIOS 0x809e04b1 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_BRIGHTCORRECT 0x809a0400 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_BROADCAST 0x80ad0486 // IDD_INTERFACE_OPTIONS [English (U.S.)]
+#define HIDC_CHEAT 0x809e03f8 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_COINLOCKOUT 0x809e04d6 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_CONTRAST 0x809a0402 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_CYCLETIMESEC 0x80ad04a6 // IDD_INTERFACE_OPTIONS [English (U.S.)]
+#define HIDC_D3D_FILTER 0x809a04a0 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_D3D_VERSION 0x809a04a3 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_DEBUG 0x80bc04cf // IDD_PROP_DEBUG [English (U.S.)]
+#define HIDC_DEFAULT_INPUT 0x809d0469 // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_DIAL 0x80b904bb // IDD_PROP_CONTROLLER [English (U.S.)]
+#define HIDC_DUAL_LIGHTGUN 0x809d04af // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_ENABLE_AUTOSAVE 0x809e0499 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_FILTER_CLONES 0x80a90455 // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_EDIT 0x80a9046d // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_HORIZONTAL 0x80a9049c // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_NONWORKING 0x80a90454 // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_ORIGINALS 0x80a9045b // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_RASTER 0x80a90452 // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_UNAVAILABLE 0x80a90453 // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_VECTOR 0x80a90451 // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_VERTICAL 0x80a90460 // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_WORKING 0x80a9045c // IDD_FILTERS [English (U.S.)]
+#define HIDC_FILTER_MECHANICAL 0x80a90461 // IDD_FILTERS [English (U.S.)]
+#define HIDC_FLICKER 0x809f0407 // IDD_PROP_VECTOR [English (U.S.)]
+#define HIDC_FLIPX 0x809a0408 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_FLIPY 0x809a0409 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_FRAMESKIP 0x809c03f1 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_FSBRIGHTNESS 0x809c0444 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_FSCONTRAST 0x809c040e // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_FSGAMMA 0x809c0442 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_GAMMA 0x809a03ff // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_HIDE_MOUSE 0x80ad04a1 // IDD_INTERFACE_OPTIONS [English (U.S.)]
+#define HIDC_HIGH_PRIORITY 0x809e049f // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_HISTORY 0x806504cb // IDD_MAIN [English (U.S.)]
+#define HIDC_HWSTRETCH 0x809a046c // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_JDZ 0x809d0487 // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_JOYSTICK 0x809d03eb // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_JOY_GUI 0x80ad0485 // IDD_INTERFACE_OPTIONS [English (U.S.)]
+#define HIDC_JSAT 0x809d048b // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_KEEPASPECT 0x809a0474 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_LANGUAGECHECK 0x80b204d1 // IDD_LANGUAGE [English (U.S.)]
+#define HIDC_LANGUAGEEDIT 0x80b204d4 // IDD_LANGUAGE [English (U.S.)]
+#define HIDC_LIGHTGUN 0x809d048f // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_LIGHTGUNDEVICE 0x80b904bd // IDD_PROP_CONTROLLER [English (U.S.)]
+#define HIDC_LOG 0x80bc03f9 // IDD_PROP_DEBUG [English (U.S.)]
+#define HIDC_MAXIMIZE 0x809a046e // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_MOUSE 0x80b904be // IDD_PROP_CONTROLLER [English (U.S.)]
+#define HIDC_MULTIKEYBOARD 0x809d0429 // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_MULTIMOUSE 0x809d04ce // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_MULTITHREAD_RENDERING 0x809e04c3 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_NUMSCREENS 0x80bb0404 // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_OSLOG 0x80bc04d8 // IDD_PROP_DEBUG [English (U.S.)]
+#define HIDC_OVERLAYS 0x809e03fb // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_PADDLE 0x80b904b8 // IDD_PROP_CONTROLLER [English (U.S.)]
+#define HIDC_PAUSEBRIGHT 0x809a049c // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_PEDAL 0x80b904ba // IDD_PROP_CONTROLLER [English (U.S.)]
+#define HIDC_POSITIONAL 0x80b904bf // IDD_PROP_CONTROLLER [English (U.S.)]
+#define HIDC_PRESCALE 0x809a041f // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_PROP_RESET 0x809c044d // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_RANDOM_BG 0x80ad0492 // IDD_INTERFACE_OPTIONS [English (U.S.)]
+#define HIDC_REFRESH 0x80bb047c // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_REFRESHSPEED 0x809c04d0 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_RELOAD 0x809d04ae // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_RESET_DEBUGSCRIPT 0x80bc04dd // IDD_PROP_DEBUG [English (U.S.)]
+#define HIDC_RESET_DEFAULT 0x80aa04a2 // IDD_RESET [English (U.S.)]
+#define HIDC_RESET_EFFECT 0x809c0459 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_RESET_FILTERS 0x80aa049f // IDD_RESET [English (U.S.)]
+#define HIDC_RESET_GAMES 0x80aa049d // IDD_RESET [English (U.S.)]
+#define HIDC_RESET_JOYSTICKMAP 0x809d04df // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_RESET_UI 0x80aa049e // IDD_RESET [English (U.S.)]
+#define HIDC_ROTATE 0x809a03f2 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_SAMPLERATE 0x809b0403 // IDD_PROP_SOUND [English (U.S.)]
+#define HIDC_SAMPLES 0x809b0461 // IDD_PROP_SOUND [English (U.S.)]
+#define HIDC_SCREEN 0x80bb03f4 // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_SCREENSELECT 0x80bb03f7 // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_SECONDSTORUN 0x809c040f // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_SELECT_DEBUGSCRIPT 0x80bc04dc // IDD_PROP_DEBUG [English (U.S.)]
+#define HIDC_SELECT_EFFECT 0x809c04c2 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_SELECT_JOYSTICKMAP 0x809d04de // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_SIZES 0x80bb03ed // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_SKIP_GAME_INFO 0x809e049a // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_SLEEP 0x809e03fe // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_SNAPNAME 0x80ad04d5 // IDD_INTERFACE_OPTIONS [English (U.S.)]
+#define HIDC_SNAPSIZE 0x809e04e1 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_SNAPSIZEHEIGHT 0x809e04e3 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_SNAPSIZEWIDTH 0x809e04e2 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_SNAPVIEW 0x809e04b2 // IDD_PROP_MISC [English (U.S.)]
+#define HIDC_SPEED 0x809c04d2 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_START_GAME_CHECK 0x80ad0460 // IDD_INTERFACE_OPTIONS [English (U.S.)]
+#define HIDC_STEADYKEY 0x809d0480 // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_STRETCH_SCREENSHOT_LARGER 0x80ad04a8 // IDD_INTERFACE_OPTIONS [English (U.S.)]
+#define HIDC_SWITCHRES 0x80bb046d // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_SYNCREFRESH 0x809c0476 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_THROTTLE 0x809a0478 // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_TRACKBALL 0x80b904bc // IDD_PROP_CONTROLLER [English (U.S.)]
+#define HIDC_TRIPLE_BUFFER 0x809c0467 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_UPDATEINPAUSE 0x80bc04da // IDD_PROP_DEBUG [English (U.S.)]
+#define HIDC_USE_DEFAULT 0x809c0401 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_USE_MOUSE 0x809d0477 // IDD_PROP_INPUT [English (U.S.)]
+#define HIDC_USE_SOUND 0x809b046d // IDD_PROP_SOUND [English (U.S.)]
+#define HIDC_VERBOSE 0x80bc04d9 // IDD_PROP_DEBUG [English (U.S.)]
+#define HIDC_VIDEO_MODE 0x809a04ca // IDD_PROP_DISPLAY [English (U.S.)]
+#define HIDC_VIEW 0x80bb03f6 // IDD_PROP_SCREEN [English (U.S.)]
+#define HIDC_VOLUME 0x809b045d // IDD_PROP_SOUND [English (U.S.)]
+#define HIDC_WAITVSYNC 0x809c0471 // IDD_PROP_ADVANCED [English (U.S.)]
+#define HIDC_WINDOWED 0x809a0497 // IDD_PROP_DISPLAY [English (U.S.)]
diff --git a/docs/release/src/osd/winui/screenshot.cpp b/docs/release/src/osd/winui/screenshot.cpp
new file mode 100644
index 00000000000..134131b4d47
--- /dev/null
+++ b/docs/release/src/osd/winui/screenshot.cpp
@@ -0,0 +1,743 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/***************************************************************************
+
+ Screenshot.cpp
+
+ Displays snapshots, control panels and other pictures.
+ Files must be of type .PNG, .JPG or .JPEG .
+ If Software tab is chosen, software-specific pictures can be displayed.
+ Background picture must be PNG, and can be chosen from anywhere, but
+ must be uncompressed (not in a zip file).
+
+***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+#include <setjmp.h>
+
+// MAME/MAMEUI headers
+#include "png.h"
+#include "unzip.h"
+#include "mui_opts.h"
+#include "mui_util.h" // for DriverIsClone
+#include "drivenum.h"
+#include "libjpeg/jpeglib.h"
+
+/***************************************************************************
+ Static global variables
+***************************************************************************/
+
+/* these refer to the single image currently loaded by the ScreenShot functions */
+static HGLOBAL m_hDIB = nullptr;
+static HPALETTE m_hPal = nullptr;
+static HANDLE m_hDDB = nullptr;
+
+/* PNG variables */
+
+static int copy_size = 0;
+static char* pixel_ptr = nullptr;
+static int row = 0;
+static int effWidth;
+
+/***************************************************************************
+ Functions
+***************************************************************************/
+
+// called by winui.cpp twice
+BOOL ScreenShotLoaded(void)
+{
+ return m_hDDB != NULL;
+}
+
+// called by winui.cpp once
+HANDLE GetScreenShotHandle()
+{
+ return m_hDDB;
+}
+
+// called by winui.cpp twice
+int GetScreenShotWidth(void)
+{
+ return abs( ((LPBITMAPINFO)m_hDIB)->bmiHeader.biWidth);
+}
+
+// called by winui.cpp twice
+int GetScreenShotHeight(void)
+{
+ return abs( ((LPBITMAPINFO)m_hDIB)->bmiHeader.biHeight);
+}
+
+// called by winui.cpp
+/* Delete the HPALETTE and Free the HDIB memory */
+void FreeScreenShot(void)
+{
+ if (m_hDIB != NULL)
+ GlobalFree(m_hDIB);
+ m_hDIB = NULL;
+
+ if (m_hPal != NULL)
+ DeletePalette(m_hPal);
+ m_hPal = NULL;
+
+ if (m_hDDB != NULL)
+ DeleteObject(m_hDDB);
+ m_hDDB = NULL;
+}
+
+/***************************************************************************
+ JPEG graphics handling functions
+***************************************************************************/
+
+struct mameui_jpeg_error_mgr
+{
+ struct jpeg_error_mgr pub; /* "public" fields */
+ jmp_buf setjmp_buffer; /* for return to caller */
+};
+
+METHODDEF(void) mameui_jpeg_error_exit(j_common_ptr cinfo)
+{
+ mameui_jpeg_error_mgr* myerr = (mameui_jpeg_error_mgr*)cinfo->err;
+ (*cinfo->err->output_message) (cinfo);
+ longjmp(myerr->setjmp_buffer, 1);
+}
+
+static bool jpeg_read_bitmap_gui(util::core_file &mfile, HGLOBAL *phDIB, HPALETTE *pPAL)
+{
+ uint64_t bytes = mfile.size();
+ unsigned char* content = (unsigned char*)::malloc(bytes * sizeof(unsigned char));
+ ::memcpy(content, mfile.buffer(), bytes);
+
+ *pPAL = NULL;
+ HGLOBAL hDIB = NULL;
+ jpeg_decompress_struct info;
+ mameui_jpeg_error_mgr err;
+ info.err = jpeg_std_error(&err.pub);
+ err.pub.error_exit = mameui_jpeg_error_exit;
+
+ if (setjmp(err.setjmp_buffer))
+ {
+ jpeg_destroy_decompress(&info);
+ ::free(content);
+ copy_size = 0;
+ pixel_ptr = NULL;
+ effWidth = 0;
+ row = 0;
+ if (hDIB)
+ ::GlobalFree(hDIB);
+ return false;
+ }
+
+ jpeg_create_decompress(&info);
+ jpeg_mem_src(&info, content, bytes);
+ jpeg_read_header(&info, TRUE);
+ if (info.num_components != 3 || info.out_color_space != JCS_RGB)
+ {
+ jpeg_destroy_decompress(&info);
+ ::free(content);
+ return false;
+ }
+
+ BITMAPINFOHEADER bi;
+ LPBITMAPINFOHEADER lpbi;
+ LPVOID lpDIBBits = 0;
+ int lineWidth = 0;
+ LPSTR pRgb;
+ copy_size = 0;
+ pixel_ptr = NULL;
+ row = info.image_height;
+ lineWidth = info.image_width;
+
+ bi.biSize = sizeof(BITMAPINFOHEADER);
+ bi.biWidth = info.image_width;
+ bi.biHeight = -info.image_height; //top down bitmap
+ bi.biPlanes = 1;
+ bi.biBitCount = 24;
+ bi.biCompression = BI_RGB;
+ bi.biSizeImage = 0;
+ bi.biXPelsPerMeter = 2835;
+ bi.biYPelsPerMeter = 2835;
+ bi.biClrUsed = 0;
+ bi.biClrImportant = 0;
+
+ effWidth = (long)(((long)lineWidth*bi.biBitCount + 31) / 32) * 4;
+ int dibSize = (effWidth * info.image_height);
+ hDIB = ::GlobalAlloc(GMEM_FIXED, bi.biSize + dibSize);
+
+ if (!hDIB)
+ {
+ ::free(content);
+ return false;
+ }
+
+ jpeg_start_decompress(&info);
+
+ lpbi = (LPBITMAPINFOHEADER)hDIB;
+ ::memcpy(lpbi, &bi, sizeof(BITMAPINFOHEADER));
+ pRgb = (LPSTR)lpbi + bi.biSize;
+ lpDIBBits = (LPVOID)((LPSTR)lpbi + bi.biSize);
+
+ while (info.output_scanline < info.output_height) // loop
+ {
+ unsigned char* cacheRow[1] = { (unsigned char*)pRgb };
+ jpeg_read_scanlines(&info, cacheRow, 1);
+ //rgb to win32 bgr
+ for (JDIMENSION i = 0; i < info.output_width; ++i)
+ std::swap(cacheRow[0][i * 3 + 0], cacheRow[0][i * 3 + 2]);
+ pRgb += effWidth;
+ }
+ jpeg_finish_decompress(&info);
+ jpeg_destroy_decompress(&info);
+ copy_size = dibSize;
+ pixel_ptr = (char*)lpDIBBits;
+ *phDIB = hDIB;
+ return true;
+}
+
+
+/***************************************************************************
+ PNG graphics handling functions
+***************************************************************************/
+
+static BOOL AllocatePNG(png_info *p, HGLOBAL *phDIB, HPALETTE *pPal)
+{
+ int nColors = 0;
+ copy_size = 0;
+ pixel_ptr = 0;
+ row = p->height - 1;
+ int lineWidth = p->width;
+
+ BITMAPINFOHEADER bi;
+ if (p->color_type != 2 && p->num_palette <= 256)
+ nColors = p->num_palette;
+
+ bi.biSize = sizeof(BITMAPINFOHEADER);
+ bi.biWidth = p->width;
+ bi.biHeight = p->height;
+ bi.biPlanes = 1;
+ bi.biBitCount = (p->color_type == 3) ? 8 : 24; /* bit_depth; */
+ bi.biCompression = BI_RGB;
+ bi.biSizeImage = 0;
+ bi.biXPelsPerMeter = 0;
+ bi.biYPelsPerMeter = 0;
+ bi.biClrUsed = nColors;
+ bi.biClrImportant = nColors;
+
+ effWidth = (long)(((long)lineWidth*bi.biBitCount + 31) / 32) * 4;
+
+ int dibSize = effWidth * bi.biHeight;
+ HGLOBAL hDIB = GlobalAlloc(GMEM_FIXED, bi.biSize + (nColors * sizeof(RGBQUAD)) + dibSize);
+
+ if (!hDIB)
+ return FALSE;
+
+ LPBITMAPINFOHEADER lpbi = (LPBITMAPINFOHEADER)hDIB;
+ memcpy(lpbi, &bi, sizeof(BITMAPINFOHEADER));
+ RGBQUAD* pRgb = (RGBQUAD*)((LPSTR)lpbi + bi.biSize);
+ LPVOID lpDIBBits = (LPVOID)((LPSTR)lpbi + bi.biSize + (nColors * sizeof(RGBQUAD)));
+
+ if (nColors)
+ {
+ int i;
+ /* Convert a PNG palette (3 byte RGBTRIPLEs) to a new color table (4 byte RGBQUADs) */
+ for (i = 0; i < nColors; i++)
+ {
+ RGBQUAD rgb;
+ rgb.rgbRed = p->palette[i * 3 + 0];
+ rgb.rgbGreen = p->palette[i * 3 + 1];
+ rgb.rgbBlue = p->palette[i * 3 + 2];
+ rgb.rgbReserved = (BYTE)0;
+ pRgb[i] = rgb;
+ }
+ }
+
+ LPBITMAPINFO bmInfo = (LPBITMAPINFO)hDIB;
+
+ /* Create a halftone palette if colors > 256. */
+ if (0 == nColors || nColors > 256)
+ {
+ HDC hDC = CreateCompatibleDC(0); /* Desktop DC */
+ *pPal = CreateHalftonePalette(hDC);
+ DeleteDC(hDC);
+ }
+ else
+ {
+ UINT nSize = sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * nColors);
+ LOGPALETTE *pLP = (LOGPALETTE *)malloc(nSize);
+ int i;
+
+ pLP->palVersion = 0x300;
+ pLP->palNumEntries = nColors;
+
+ for (i = 0; i < nColors; i++)
+ {
+ pLP->palPalEntry[i].peRed = bmInfo->bmiColors[i].rgbRed;
+ pLP->palPalEntry[i].peGreen = bmInfo->bmiColors[i].rgbGreen;
+ pLP->palPalEntry[i].peBlue = bmInfo->bmiColors[i].rgbBlue;
+ pLP->palPalEntry[i].peFlags = 0;
+ }
+
+ *pPal = CreatePalette(pLP);
+
+ free (pLP);
+ }
+
+ copy_size = dibSize;
+ pixel_ptr = (char*)lpDIBBits;
+ *phDIB = hDIB;
+ return TRUE;
+}
+
+inline void store_pixels(UINT8 *buf, int len)
+{
+ if (pixel_ptr && copy_size)
+ {
+ memcpy(&pixel_ptr[row * effWidth], buf, len);
+ row--;
+ copy_size -= len;
+ }
+}
+
+
+/* Copied and modified from png.cpp
+ logerror doesn't work here... changed to printf */
+static bool png_read_bitmap_gui(util::core_file &mfile, HGLOBAL *phDIB, HPALETTE *pPAL)
+{
+ png_info p;
+ if (p.read_file(mfile) != PNGERR_NONE)
+ return false;
+
+ if (p.color_type != 3 && p.color_type != 2)
+ {
+ printf("PNG Unsupported color type %i (has to be 2 or 3)\n", p.color_type);
+ //return false; Leave in so ppl can see incompatibility
+ }
+
+ if (p.interlace_method != 0)
+ {
+ printf("PNG Interlace unsupported\n");
+ return false;
+ }
+
+ /* Convert < 8 bit to 8 bit */
+ p.expand_buffer_8bit();
+
+ if (!AllocatePNG(&p, phDIB, pPAL))
+ {
+ printf("PNG Unable to allocate memory to display screenshot\n");
+ return false;
+ }
+
+ int bytespp = (p.color_type == 2) ? 3 : 1;
+
+ for (uint32_t i = 0; i < p.height; i++)
+ {
+ UINT8 *ptr = &p.image[i * (p.width * bytespp)];
+
+ if (p.color_type == 2) /*(p->bit_depth > 8) */
+ {
+ int j;
+ UINT8 bTmp;
+
+ for (j = 0; j < p.width; j++)
+ {
+ bTmp = ptr[0];
+ ptr[0] = ptr[2];
+ ptr[2] = bTmp;
+ ptr += 3;
+ }
+ }
+ store_pixels(&p.image[i * (p.width * bytespp)], p.width * bytespp);
+ }
+
+ return true;
+}
+
+
+
+/***************************************************************************
+ File search functions
+***************************************************************************/
+
+static osd_file::error OpenRawDIBFile(const char *dir_name, const char *filename, util::core_file::ptr &file)
+{
+ // clear out result
+ file = NULL;
+
+ // look for the raw file
+ string fname = string(dir_name) + PATH_SEPARATOR + string(filename);
+ return util::core_file::open(fname.c_str(), OPEN_FLAG_READ, file);
+}
+
+static osd_file::error OpenZipDIBFile(const char *dir_name, const char *zip_name, const char *filename, util::core_file::ptr &file, void **buffer)
+{
+ util::archive_file::error ziperr = util::archive_file::error::NONE;
+ util::archive_file::ptr zip;
+
+ // clear out result
+ file = nullptr;
+
+ // look for the raw file
+ string fname = string(dir_name).append(PATH_SEPARATOR).append(filename);
+ osd_file::error filerr = util::core_file::open(fname, OPEN_FLAG_READ, file);
+
+ // did the raw file not exist?
+ if (filerr != osd_file::error::NONE)
+ {
+ // look into zip file
+ fname = std::string(dir_name).append(PATH_SEPARATOR).append(zip_name).append(".zip");
+ ziperr = util::archive_file::open_zip(fname, zip);
+
+ if (ziperr == util::archive_file::error::NONE)
+ {
+ int found = zip->search(filename, false);
+
+ if (found >= 0)
+ {
+ *buffer = malloc(zip->current_uncompressed_length());
+ ziperr = zip->decompress(*buffer, zip->current_uncompressed_length());
+
+ if (ziperr == util::archive_file::error::NONE)
+ filerr = util::core_file::open_ram(*buffer, zip->current_uncompressed_length(), OPEN_FLAG_READ, file);
+ }
+
+ zip.reset();
+ }
+ }
+
+ if ((filerr != osd_file::error::NONE) || (ziperr != util::archive_file::error::NONE))
+ {
+ // look into 7z file
+ fname = std::string(dir_name).append(PATH_SEPARATOR).append(zip_name).append(".7z");
+ ziperr = util::archive_file::open_7z(fname, zip);
+
+ if (ziperr == util::archive_file::error::NONE)
+ {
+ int found = zip->search(filename, false);
+
+ if (found >= 0)
+ {
+ *buffer = malloc(zip->current_uncompressed_length());
+ ziperr = zip->decompress(*buffer, zip->current_uncompressed_length());
+
+ if (ziperr == util::archive_file::error::NONE)
+ filerr = util::core_file::open_ram(*buffer, zip->current_uncompressed_length(), OPEN_FLAG_READ, file);
+ }
+
+ zip.reset();
+ }
+ }
+
+ return filerr;
+}
+
+// display a snap, cabinet, title, flyer, marquee, pcb, control panel
+static BOOL LoadDIB(const char *filename, HGLOBAL *phDIB, HPALETTE *pPal, int pic_type)
+{
+ osd_file::error filerr = osd_file::error::NOT_FOUND; // defined in osdcore.h
+ util::core_file::ptr file = NULL;
+ char fullpath[2048];
+ const char* zip_name;
+ string t;
+
+ if (pPal)
+ DeletePalette(pPal);
+
+ switch (pic_type)
+ {
+ case TAB_ARTWORK:
+ t = GetArtworkDir();
+ zip_name = "artpreview";
+ break;
+ case TAB_BOSSES:
+ t = GetBossesDir();
+ zip_name = "bosses";
+ break;
+ case TAB_CABINET:
+ t = GetCabinetDir();
+ zip_name = "cabinets";
+ break;
+ case TAB_CONTROL_PANEL:
+ t = GetControlPanelDir();
+ zip_name = "cpanel";
+ break;
+ case TAB_COVER:
+ t = GetCoversDir();
+ zip_name = "covers";
+ break;
+ case TAB_ENDS:
+ t = GetEndsDir();
+ zip_name = "ends";
+ break;
+ case TAB_FLYER:
+ t = GetFlyerDir();
+ zip_name = "flyers";
+ break;
+ case TAB_GAMEOVER:
+ t = GetGameOverDir();
+ zip_name = "gameover";
+ break;
+ case TAB_HOWTO:
+ t = GetHowToDir();
+ zip_name = "howto";
+ break;
+ case TAB_LOGO:
+ t = GetLogoDir();
+ zip_name = "logo";
+ break;
+ case TAB_MARQUEE:
+ t = GetMarqueeDir();
+ zip_name = "marquees";
+ break;
+ case TAB_PCB:
+ t = GetPcbDir();
+ zip_name = "pcb";
+ break;
+ case TAB_SCORES:
+ t = GetScoresDir();
+ zip_name = "scores";
+ break;
+ case TAB_SCREENSHOT:
+ t = GetImgDir();
+ zip_name = "snap";
+ break;
+ case TAB_SELECT:
+ t = GetSelectDir();
+ zip_name = "select";
+ break;
+ case TAB_TITLE:
+ t = GetTitlesDir();
+ zip_name = "titles";
+ break;
+ case TAB_VERSUS:
+ t = GetVersusDir();
+ zip_name = "versus";
+ break;
+ default :
+ // shouldn't get here
+ return false;
+ }
+
+ string ext;
+ BOOL success;
+ void *buffer = NULL;
+
+ for (u8 extnum = 0; extnum < 3; extnum++)
+ {
+ switch (extnum)
+ {
+ case 1:
+ ext = ".jpg";
+ break;
+ case 2:
+ ext = ".jpeg";
+ break;
+ default:
+ ext = ".png";
+ }
+ // we need to split the filename into the game name (system_name), and the software-list item name (file_name)
+ strcpy(fullpath, t.c_str());
+ char tempfile[2048];
+ strcpy(tempfile, filename);
+ char* system_name = strtok(tempfile, ":");
+ char* file_name = strtok(NULL, ":");
+ string fname;
+ buffer = 0;
+ success = false;
+
+ // Support multiple paths
+ char* partpath = strtok(fullpath, ";");
+
+ while (partpath && filerr != osd_file::error::NONE)
+ {
+ //Add handling for the displaying of all the different supported snapshot pattern types
+
+ // Do software checks first
+ if (file_name)
+ {
+ // Try dir/system/game.png
+ fname = string(system_name) + PATH_SEPARATOR + string(file_name) + ext;
+ filerr = OpenRawDIBFile(partpath, fname.c_str(), file);
+
+ // Try dir/system.zip/game.png
+ if (filerr != osd_file::error::NONE)
+ {
+ fname = string(file_name) + ext;
+ filerr = OpenZipDIBFile(partpath, system_name, fname.c_str(), file, &buffer);
+ }
+
+ // Try dir/system.zip/system/game.png
+ if (filerr != osd_file::error::NONE)
+ {
+ fname = string(system_name) + "/" + string(file_name) + ext;
+ filerr = OpenZipDIBFile(partpath, system_name, fname.c_str(), file, &buffer);
+ }
+
+ // Try dir/zipfile/system/game.png
+ if (filerr != osd_file::error::NONE)
+ {
+ filerr = OpenZipDIBFile(partpath, zip_name, fname.c_str(), file, &buffer);
+ }
+ }
+
+ // give up on software-specific.
+ // For SNAPS only, try filenames with 0000.png
+ if ((pic_type == TAB_SCREENSHOT) && (extnum == 0))
+ {
+ if (filerr != osd_file::error::NONE)
+ {
+ //%g/%i
+ fname = string(system_name) + PATH_SEPARATOR + "0000.png";
+ filerr = OpenRawDIBFile(partpath, fname.c_str(), file);
+ }
+ }
+
+ // Try dir/system.png %g
+ if (filerr != osd_file::error::NONE)
+ {
+ fname = string(system_name) + ext;
+ filerr = OpenRawDIBFile(partpath, fname.c_str(), file);
+ }
+
+ //%g/%g
+ if (filerr != osd_file::error::NONE)
+ {
+ fname = string(system_name) + PATH_SEPARATOR + string(system_name) + ext;
+ filerr = OpenRawDIBFile(partpath, fname.c_str(), file);
+ }
+
+ // Try dir/zipfile/system.png
+ if (filerr != osd_file::error::NONE)
+ {
+ fname = string(system_name) + ext;
+ filerr = OpenZipDIBFile(partpath, zip_name, fname.c_str(), file, &buffer);
+ }
+
+ partpath = strtok(NULL, ";");
+ }
+
+ if (filerr == osd_file::error::NONE)
+ {
+ if (extnum)
+ success = jpeg_read_bitmap_gui(*file, phDIB, pPal);
+ else
+ success = png_read_bitmap_gui(*file, phDIB, pPal);
+ file.reset();
+ }
+ if (success)
+ break;
+ }
+
+ // free the buffer if we have to
+ if (buffer)
+ free(buffer);
+
+ return success;
+}
+
+// called from winui.cpp and here
+HBITMAP DIBToDDB(HDC hDC, HANDLE hDIB, LPMYBITMAPINFO desc)
+{
+ BITMAPINFO * bmInfo = (LPBITMAPINFO)hDIB;
+
+ if (hDIB == NULL)
+ return NULL;
+
+ LPBITMAPINFOHEADER lpbi = (LPBITMAPINFOHEADER)hDIB;
+ int nColors = lpbi->biClrUsed ? lpbi->biClrUsed : 1 << lpbi->biBitCount;
+
+ LPVOID lpDIBBits;
+ if (bmInfo->bmiHeader.biBitCount > 8)
+ lpDIBBits = (LPVOID)((LPDWORD)(bmInfo->bmiColors + bmInfo->bmiHeader.biClrUsed) +
+ ((bmInfo->bmiHeader.biCompression == BI_BITFIELDS) ? 3 : 0));
+ else
+ lpDIBBits = (LPVOID)(bmInfo->bmiColors + nColors);
+
+ if (desc != 0)
+ {
+ /* Store for easy retrieval later */
+ desc->bmWidth = bmInfo->bmiHeader.biWidth;
+ desc->bmHeight = bmInfo->bmiHeader.biHeight;
+ desc->bmColors = (nColors <= 256) ? nColors : 0;
+ }
+
+ HBITMAP hBM = CreateDIBitmap(hDC, // handle to device context
+ (LPBITMAPINFOHEADER)lpbi, // pointer to bitmap info header
+ (LONG)CBM_INIT, // initialization flag
+ lpDIBBits, // pointer to initialization data
+ (LPBITMAPINFO)lpbi, // pointer to bitmap info
+ DIB_RGB_COLORS); // color-data usage
+
+ return hBM;
+}
+
+
+
+// main call from winui to display a picture
+BOOL LoadScreenShot(int nGame, LPCSTR lpSoftwareName, int nType)
+{
+ /* Delete the last ones */
+ //printf("LoadScreenShot: A\n");fflush(stdout);
+ FreeScreenShot();
+
+ //printf("LoadScreenShot: B\n");fflush(stdout);
+ BOOL loaded = false;
+ BOOL isclone = DriverIsClone(nGame);
+ int nParentIndex = -1;
+ if (isclone)
+ nParentIndex = GetParentIndex(&driver_list::driver(nGame));
+
+ // If software item, see if picture exist (correct parent is passed in lpSoftwareName)
+ //printf("LoadScreenShot: C\n");fflush(stdout);
+ if (lpSoftwareName)
+ loaded = LoadDIB(lpSoftwareName, &m_hDIB, &m_hPal, nType);
+
+ // If game, see if picture exist. Or, if no picture for the software, use game's picture.
+ //printf("LoadScreenShot: D\n");fflush(stdout);
+ if (!loaded)
+ {
+ //printf("LoadScreenShot: E\n");fflush(stdout);
+ loaded = LoadDIB(driver_list::driver(nGame).name, &m_hDIB, &m_hPal, nType);
+ // none? try parent
+ //printf("LoadScreenShot: F\n");fflush(stdout);
+ if (!loaded && isclone)
+ {
+ //printf("LoadScreenShot: G\n");fflush(stdout);
+ loaded = LoadDIB(driver_list::driver(nParentIndex).name, &m_hDIB, &m_hPal, nType);
+ }
+ }
+
+ //printf("LoadScreenShot: K\n");fflush(stdout);
+ if (loaded)
+ {
+ HDC hdc = GetDC(GetMainWindow());
+ m_hDDB = DIBToDDB(hdc, m_hDIB, NULL);
+ ReleaseDC(GetMainWindow(),hdc);
+ }
+
+ printf("LoadScreenShot: Finished\n");fflush(stdout);
+ return loaded;
+}
+
+// called from winui.cpp to display the background
+BOOL LoadDIBBG(HGLOBAL *phDIB, HPALETTE *pPal)
+{
+ util::core_file::ptr file = NULL;
+ BOOL success = false;
+ if (pPal)
+ DeletePalette(pPal);
+
+ // look for the raw file
+ string fname = GetBgDir();
+ if (util::core_file::open(fname.c_str(), OPEN_FLAG_READ, file) == osd_file::error::NONE)
+ {
+ success = png_read_bitmap_gui(*file, phDIB, pPal);
+ file.reset();
+ }
+
+ return success;
+}
+
diff --git a/docs/release/src/osd/winui/screenshot.h b/docs/release/src/osd/winui/screenshot.h
new file mode 100644
index 00000000000..e5d9253b181
--- /dev/null
+++ b/docs/release/src/osd/winui/screenshot.h
@@ -0,0 +1,60 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+#ifndef WINUI_SCREENSHOT_H
+#define WINUI_SCREENSHOT_H
+
+typedef struct _mybitmapinfo
+{
+ int bmWidth;
+ int bmHeight;
+ int bmColors;
+} MYBITMAPINFO, *LPMYBITMAPINFO;
+
+extern BOOL LoadScreenShot(int nGame, LPCSTR lpSoftwareName, int nType);
+extern HANDLE GetScreenShotHandle(void);
+extern int GetScreenShotWidth(void);
+extern int GetScreenShotHeight(void);
+
+extern void FreeScreenShot(void);
+extern BOOL ScreenShotLoaded(void);
+
+extern BOOL LoadDIBBG(HGLOBAL *phDIB, HPALETTE *pPal);
+extern HBITMAP DIBToDDB(HDC hDC, HANDLE hDIB, LPMYBITMAPINFO desc);
+
+#if 0
+typedef struct
+{
+ TEXT tabtext;
+ const char* zipname;
+ int tabenum;
+ const string (*pfnGetTheseDirs)(void);
+}
+SSINFO;
+
+const SSINFO m_ssInfo[] =
+{
+ { "Snapshot", "snap", TAB_SCREENSHOT, GetImgDir },
+ { "Flyer", "flyers", TAB_FLYER, GetFlyerDir },
+ { "Cabinet", "cabinets", TAB_CABINET, GetCabinetDir },
+ { "Marquee", "marquees", TAB_MARQUEE, GetMarqueeDir },
+ { "Title", "titles", TAB_TITLE, GetTitleDir },
+ { "Control Panel", "cpanel", TAB_CONTROL_PANEL, GetControlPanelDir },
+ { "PCB", "pcb", TAB_PCB, GetPcbDir },
+};
+
+/* if adding a new tab, need to also update:
+- dialogs.cpp (~50) (history on tab or not)
+- winui.cpp MameCommand (~4173) (action the mouse click in the menu)
+- mameui/messui.rc (show in menu)
+- ui_opts.h (tab enabled or not)
+- resource.h
+- mui_opts.cpp/h (directory get function)
+- mui_opts.h enum of names
+- mui_opts.cpp image_tabs_long_name
+- screenshot.cpp (~316) (choose image to display)
+*/
+
+#endif
+#endif
diff --git a/docs/release/src/osd/winui/splitters.cpp b/docs/release/src/osd/winui/splitters.cpp
new file mode 100644
index 00000000000..a694c8cc5a9
--- /dev/null
+++ b/docs/release/src/osd/winui/splitters.cpp
@@ -0,0 +1,371 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+ /***************************************************************************
+
+ splitters.cpp
+
+ Splitter GUI code. - Tree, splitter, list, splitter, pict
+
+ Created 12/03/98 (C) by Mike Haaland (mhaaland@hypertech.com)
+
+***************************************************************************/
+
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+
+// MAME/MAMEUI headers
+#include "splitters.h"
+#include "mui_opts.h"
+
+/* Local Variables */
+static BOOL bTracking = 0;
+static int numSplitters = 0;
+static int currentSplitter = 0;
+static HZSPLITTER *splitter;
+static LPHZSPLITTER lpCurSpltr = 0;
+static HCURSOR hSplitterCursor = 0;
+
+int *nSplitterOffset;
+
+BOOL InitSplitters(void)
+{
+ /* load the cursor for the splitter */
+ hSplitterCursor = LoadCursor(GetModuleHandle(0), MAKEINTRESOURCE(IDC_CURSOR_HSPLIT));
+
+ int nSplitterCount = GetSplitterCount();
+
+ splitter = (HZSPLITTER*)malloc(sizeof(HZSPLITTER) * nSplitterCount);
+ if (!splitter)
+ goto error;
+ memset(splitter, 0, sizeof(HZSPLITTER) * nSplitterCount);
+
+ nSplitterOffset = (int*)malloc(sizeof(int) * nSplitterCount);
+ if (!nSplitterOffset)
+ goto error;
+ memset(nSplitterOffset, 0, sizeof(int) * nSplitterCount);
+
+ return true;
+
+error:
+ SplittersExit();
+ return false;
+}
+
+void SplittersExit(void)
+{
+ if (splitter)
+ {
+ free(splitter);
+ splitter = NULL;
+ }
+ if (nSplitterOffset)
+ {
+ free(nSplitterOffset);
+ nSplitterOffset = NULL;
+ }
+}
+
+
+/* Called with hWnd = Parent Window */
+static void CalcSplitter(HWND hWnd, LPHZSPLITTER lpSplitter)
+{
+ POINT p = {0,0};
+ ClientToScreen(hWnd, &p);
+
+ GetWindowRect(lpSplitter->m_hWnd, &lpSplitter->m_dragRect);
+ RECT leftRect, rightRect;
+ GetWindowRect(lpSplitter->m_hWndLeft, &leftRect);
+ GetWindowRect(lpSplitter->m_hWndRight, &rightRect);
+
+ OffsetRect(&lpSplitter->m_dragRect, -p.x, -p.y);
+ OffsetRect(&leftRect, -p.x, -p.y);
+ OffsetRect(&rightRect, -p.x, -p.y);
+
+ int dragWidth = lpSplitter->m_dragRect.right - lpSplitter->m_dragRect.left;
+
+ lpSplitter->m_limitRect.left = leftRect.left + 20;
+ lpSplitter->m_limitRect.right = rightRect.right - 20;
+ lpSplitter->m_limitRect.top = lpSplitter->m_dragRect.top;
+ lpSplitter->m_limitRect.bottom = lpSplitter->m_dragRect.bottom;
+ if (lpSplitter->m_func)
+ lpSplitter->m_func(hWnd, &lpSplitter->m_limitRect);
+
+ if (lpSplitter->m_dragRect.left < lpSplitter->m_limitRect.left)
+ lpSplitter->m_dragRect.left = lpSplitter->m_limitRect.left;
+
+ if (lpSplitter->m_dragRect.right > lpSplitter->m_limitRect.right)
+ lpSplitter->m_dragRect.left = lpSplitter->m_limitRect.right - dragWidth;
+
+ lpSplitter->m_dragRect.right = lpSplitter->m_dragRect.left + dragWidth;
+}
+
+void AdjustSplitter2Rect(HWND hWnd, LPRECT lpRect)
+{
+ RECT pRect;
+
+ GetClientRect(hWnd, &pRect);
+
+ if (lpRect->right > pRect.right)
+ lpRect->right = pRect.right;
+
+ lpRect->right = MIN(lpRect->right - GetMinimumScreenShotWindowWidth(), lpRect->right);
+
+ lpRect->left = MAX((pRect.right - (pRect.right - pRect.left)) / 2, lpRect->left);
+}
+
+void AdjustSplitter1Rect(HWND hWnd, LPRECT lpRect)
+{
+}
+
+void RecalcSplitters(void)
+{
+ int i;
+
+ for (i = 0; i < numSplitters; i++)
+ {
+ CalcSplitter(GetParent(splitter[i].m_hWnd), &splitter[i]);
+ nSplitterOffset[i] = splitter[i].m_dragRect.left;
+ }
+
+ for (i = numSplitters - 1; i >= 0; i--)
+ {
+ CalcSplitter(GetParent(splitter[i].m_hWnd), &splitter[i]);
+ nSplitterOffset[i] = splitter[i].m_dragRect.left;
+ }
+
+}
+
+void OnSizeSplitter(HWND hWnd)
+{
+ static bool firstTime = true;
+ bool changed = false;
+ RECT rWindowRect;
+ POINT p = {0,0};
+ int i;
+ int nSplitterCount = GetSplitterCount();
+
+ if (firstTime)
+ {
+ for (i = 0; i < nSplitterCount; i++)
+ nSplitterOffset[i] = GetSplitterPos(i);
+ changed = true;
+ firstTime = false;
+ }
+
+ GetWindowRect(hWnd, &rWindowRect);
+
+ for (i = 0; i < nSplitterCount; i++)
+ {
+ p.x = 0;
+ p.y = 0;
+ ClientToScreen(splitter[i].m_hWnd, &p);
+
+ /* We must change if our window is not in the window rect */
+ bool bMustChange = !PtInRect(&rWindowRect, p);
+
+ /* We should also change if we are ahead the next splitter */
+ if ((i < nSplitterCount-1) && (nSplitterOffset[i] >= nSplitterOffset[i+1]))
+ bMustChange = true;
+
+ /* ...or if we are behind the previous splitter */
+ if ((i > 0) && (nSplitterOffset[i] <= nSplitterOffset[i-1]))
+ bMustChange = true;
+#ifdef MESS
+ if ((i==1)&&(!BIT(GetWindowPanes(), 2))) // sw
+ bMustChange = false;
+ if ((i==2)&&(!BIT(GetWindowPanes(), 3))) // images
+ bMustChange = false;
+#endif
+ if (bMustChange)
+ {
+ nSplitterOffset[i] = (rWindowRect.right - rWindowRect.left) * g_splitterInfo[i].dPosition;
+ changed = true;
+ }
+ }
+
+ if (changed)
+ {
+ ResizePickerControls(hWnd);
+ RecalcSplitters();
+ //UpdateScreenShot();
+ }
+}
+
+void AddSplitter(HWND hWnd, HWND hWndLeft, HWND hWndRight, void (*func)(HWND hWnd,LPRECT lpRect))
+{
+ LPHZSPLITTER lpSpltr = &splitter[numSplitters];
+
+ if (numSplitters >= GetSplitterCount())
+ return;
+
+ lpSpltr->m_hWnd = hWnd;
+ lpSpltr->m_hWndLeft = hWndLeft;
+ lpSpltr->m_hWndRight = hWndRight;
+ lpSpltr->m_func = func;
+ CalcSplitter(GetParent(hWnd), lpSpltr);
+
+ numSplitters++;
+}
+
+static void OnInvertTracker(HWND hWnd, const RECT *rect)
+{
+ HDC hDC = GetDC(hWnd);
+ HBRUSH hBrush = CreateSolidBrush(RGB(0xFF, 0xFF, 0xFF));
+ HBRUSH hOldBrush = 0;
+
+ if (hBrush != 0)
+ hOldBrush = (HBRUSH)SelectObject(hDC, hBrush);
+ PatBlt(hDC, rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top, DSTINVERT);
+ if (hOldBrush != 0)
+ SelectObject(hDC, hOldBrush);
+ ReleaseDC(hWnd, hDC);
+ DeleteBrush(hBrush);
+}
+
+static void StartTracking(HWND hWnd, UINT hitArea)
+{
+ if (!bTracking && lpCurSpltr != 0 && hitArea == SPLITTER_HITITEM)
+ {
+ // Ensure we have an updated cursor structure
+ CalcSplitter(hWnd, lpCurSpltr);
+ // Draw the first splitter shadow
+ OnInvertTracker(hWnd, &lpCurSpltr->m_dragRect);
+ // Capture the mouse
+ SetCapture(hWnd);
+ // Set tracking to TRUE
+ bTracking = true;
+ SetCursor(hSplitterCursor);
+ }
+}
+
+static void StopTracking(HWND hWnd)
+{
+ if (bTracking)
+ {
+ // erase the tracking image
+ OnInvertTracker(hWnd, &lpCurSpltr->m_dragRect);
+ // Release the mouse
+ ReleaseCapture();
+ // set tracking to false
+ bTracking = false;
+ SetCursor(LoadCursor(0, IDC_ARROW));
+ // set the new splitter position
+ nSplitterOffset[currentSplitter] = lpCurSpltr->m_dragRect.left;
+ // Redraw the screen area
+ ResizePickerControls(hWnd);
+ UpdateScreenShot();
+ InvalidateRect(GetMainWindow(), NULL, true);
+ }
+}
+
+static UINT SplitterHitTest(HWND hWnd, POINTS p)
+{
+ POINT pt;
+ pt.x = p.x;
+ pt.y = p.y;
+
+ // Check which area we hit
+ ClientToScreen(hWnd, &pt);
+
+ RECT rect;
+ for (int i = 0; i < numSplitters; i++)
+ {
+ GetWindowRect(splitter[i].m_hWnd, &rect);
+ if (PtInRect(&rect, pt))
+ {
+ lpCurSpltr = &splitter[i];
+ currentSplitter = i;
+ // We hit the splitter
+ return SPLITTER_HITITEM;
+ }
+ }
+ lpCurSpltr = 0;
+ // We missed the splitter
+ return SPLITTER_HITNOTHING;
+}
+
+void OnMouseMove(HWND hWnd, UINT nFlags, POINTS p)
+{
+ if (bTracking) // move the tracking image
+ {
+ POINT pt;
+ pt.x = (int)p.x;
+ pt.y = (int)p.y;
+
+ ClientToScreen(hWnd, &pt);
+ RECT rect;
+ GetWindowRect(hWnd, &rect);
+ if (! PtInRect(&rect, pt))
+ {
+ if ((short)pt.x < (short)rect.left)
+ pt.x = rect.left;
+ if ((short)pt.x > (short)rect.right)
+ pt.x = rect.right;
+ pt.y = rect.top + 1;
+ }
+
+ ScreenToClient(hWnd, &pt);
+
+ // Erase the old tracking image
+ OnInvertTracker(hWnd, &lpCurSpltr->m_dragRect);
+
+ // calc the new one based on p.x draw it
+ int nWidth = lpCurSpltr->m_dragRect.right - lpCurSpltr->m_dragRect.left;
+ lpCurSpltr->m_dragRect.right = pt.x + nWidth / 2;
+ lpCurSpltr->m_dragRect.left = pt.x - nWidth / 2;
+
+ if (pt.x - nWidth / 2 > lpCurSpltr->m_limitRect.right)
+ {
+ lpCurSpltr->m_dragRect.right = lpCurSpltr->m_limitRect.right;
+ lpCurSpltr->m_dragRect.left = lpCurSpltr->m_dragRect.right - nWidth;
+ }
+ if (pt.x + nWidth / 2 < lpCurSpltr->m_limitRect.left)
+ {
+ lpCurSpltr->m_dragRect.left = lpCurSpltr->m_limitRect.left;
+ lpCurSpltr->m_dragRect.right = lpCurSpltr->m_dragRect.left + nWidth;
+ }
+ OnInvertTracker(hWnd, &lpCurSpltr->m_dragRect);
+ }
+ else
+ {
+ switch(SplitterHitTest(hWnd, p))
+ {
+ case SPLITTER_HITNOTHING:
+ SetCursor(LoadCursor(0, IDC_ARROW));
+ break;
+ case SPLITTER_HITITEM:
+ SetCursor(hSplitterCursor);
+ break;
+ }
+ }
+}
+
+void OnLButtonDown(HWND hWnd, UINT nFlags, POINTS p)
+{
+ if (!bTracking) // See if we need to start a splitter drag
+ {
+ StartTracking(hWnd, SplitterHitTest(hWnd, p));
+ }
+}
+
+void OnLButtonUp(HWND hWnd, UINT nFlags, POINTS p)
+{
+ if (bTracking)
+ {
+ StopTracking(hWnd);
+ }
+}
+
+int GetSplitterCount(void)
+{
+ int nSplitterCount = 0;
+ while(g_splitterInfo[nSplitterCount].dPosition > 0)
+ nSplitterCount++;
+ return nSplitterCount;
+}
+
+/* End of file */
diff --git a/docs/release/src/osd/winui/splitters.h b/docs/release/src/osd/winui/splitters.h
new file mode 100644
index 00000000000..a0382865bf9
--- /dev/null
+++ b/docs/release/src/osd/winui/splitters.h
@@ -0,0 +1,80 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+/* Written by Mike Haaland <mhaaland@hypertech.com> */
+
+#ifndef SPLITTER_H
+#define SPLITTER_H
+
+#if !defined(MAX)
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+#include "resource.h"
+#include "winui.h"
+#define SPLITTER_WIDTH 4
+#define MIN_VIEW_WIDTH 10
+
+enum eSplitterHits
+{
+ SPLITTER_HITNOTHING = 0,
+ SPLITTER_HITITEM
+};
+
+typedef struct horzSplitter
+{
+ HWND m_hWnd;
+ HWND m_hWndLeft;
+ HWND m_hWndRight;
+ RECT m_limitRect;
+ RECT m_dragRect;
+ void (*m_func)(HWND hWnd, LPRECT lpRect);
+} HZSPLITTER, *LPHZSPLITTER;
+
+/* Splitter routines */
+void OnMouseMove(HWND hWnd, UINT nFlags, POINTS p);
+void OnLButtonDown(HWND hWnd, UINT nFlags, POINTS p);
+void OnLButtonUp(HWND hWnd, UINT nFlags, POINTS p);
+void OnSizeSplitter(HWND hWnd);
+void AddSplitter(HWND hWnd, HWND hWndLeft, HWND hWndRight, void (*func)(HWND hWnd,LPRECT lpRect));
+void RecalcSplitters(void);
+void AdjustSplitter2Rect(HWND hWnd, LPRECT lpRect);
+void AdjustSplitter1Rect(HWND hWnd, LPRECT lpRect);
+BOOL InitSplitters(void);
+void SplittersExit(void);
+int GetSplitterCount(void);
+
+extern int *nSplitterOffset;
+
+typedef struct
+{
+ double dPosition;
+ int nSplitterWindow;
+ int nLeftWindow;
+ int nRightWindow;
+ void (*pfnAdjust)(HWND hWnd,LPRECT lpRect);
+} SPLITTERINFO;
+
+#ifdef MESS
+const SPLITTERINFO g_splitterInfo[] =
+{
+ { 0.15, IDC_SPLITTER, IDC_TREE, IDC_LIST, AdjustSplitter1Rect },
+ { 0.8, IDC_SPLITTER2, IDC_LIST, IDC_SWTAB, AdjustSplitter1Rect },
+ { 0.9, IDC_SPLITTER3, IDC_SWTAB, IDC_SSFRAME, AdjustSplitter2Rect },
+ { -1 }
+};
+#else
+const SPLITTERINFO g_splitterInfo[] =
+{
+ { 0.25, IDC_SPLITTER, IDC_TREE, IDC_LIST, AdjustSplitter1Rect },
+ { 0.5, IDC_SPLITTER2, IDC_LIST, IDC_SSFRAME, AdjustSplitter2Rect },
+ { -1 }
+};
+#endif
+
+//extern const SPLITTERINFO g_splitterInfo[];
+
+
+#endif /* SPLITTER_H */
diff --git a/docs/release/src/osd/winui/tabview.cpp b/docs/release/src/osd/winui/tabview.cpp
new file mode 100644
index 00000000000..89f3ffb56ba
--- /dev/null
+++ b/docs/release/src/osd/winui/tabview.cpp
@@ -0,0 +1,270 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+#include <commctrl.h>
+
+// MAME/MAMEUI headers
+#include "tabview.h"
+#include "mui_util.h"
+
+
+struct TabViewInfo
+{
+ const struct TabViewCallbacks *pCallbacks;
+ int nTabCount;
+ WNDPROC pfnParentWndProc;
+};
+
+
+
+static struct TabViewInfo *GetTabViewInfo(HWND hWnd)
+{
+ LONG_PTR l = GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ return (struct TabViewInfo *) l;
+}
+
+
+
+static LRESULT CallParentWndProc(WNDPROC pfnParentWndProc, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ if (!pfnParentWndProc)
+ pfnParentWndProc = GetTabViewInfo(hWnd)->pfnParentWndProc;
+
+ LRESULT rc;
+ if (IsWindowUnicode(hWnd))
+ rc = CallWindowProcW(pfnParentWndProc, hWnd, message, wParam, lParam);
+ else
+ rc = CallWindowProcA(pfnParentWndProc, hWnd, message, wParam, lParam);
+ return rc;
+}
+
+
+
+static LRESULT CALLBACK TabViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ struct TabViewInfo *pTabViewInfo;
+ pTabViewInfo = GetTabViewInfo(hWnd);
+
+ WNDPROC pfnParentWndProc = pTabViewInfo->pfnParentWndProc;
+
+ switch(message)
+ {
+ case WM_DESTROY:
+ free(pTabViewInfo);
+ SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR) pfnParentWndProc);
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) NULL);
+ break;
+ }
+
+ LRESULT rc = 0;
+ // this is weird...
+ BOOL bHandled = false;
+ if (!bHandled)
+ rc = CallParentWndProc(pfnParentWndProc, hWnd, message, wParam, lParam);
+
+ switch(message)
+ {
+ case WM_MOVE:
+ case WM_SIZE:
+ if (pTabViewInfo->pCallbacks->pfnOnMoveSize)
+ pTabViewInfo->pCallbacks->pfnOnMoveSize();
+ break;
+ }
+
+ return rc;
+}
+
+
+
+static int TabView_GetTabFromTabIndex(HWND hwndTabView, int tab_index)
+{
+ int shown_tabs = -1;
+ struct TabViewInfo *pTabViewInfo;
+
+ pTabViewInfo = GetTabViewInfo(hwndTabView);
+
+ for (int i = 0; i < pTabViewInfo->nTabCount; i++)
+ {
+ if (!pTabViewInfo->pCallbacks->pfnGetShowTab || pTabViewInfo->pCallbacks->pfnGetShowTab(i))
+ {
+ shown_tabs++;
+ if (shown_tabs == tab_index)
+ return i;
+ }
+ }
+ printf("invalid tab index %i\n", tab_index);
+ return 0;
+}
+
+
+
+int TabView_GetCurrentTab(HWND hwndTabView)
+{
+ struct TabViewInfo *pTabViewInfo;
+ pTabViewInfo = GetTabViewInfo(hwndTabView);
+ return pTabViewInfo->pCallbacks->pfnGetCurrentTab();
+}
+
+
+
+void TabView_SetCurrentTab(HWND hwndTabView, int nTab)
+{
+ struct TabViewInfo *pTabViewInfo;
+ pTabViewInfo = GetTabViewInfo(hwndTabView);
+ pTabViewInfo->pCallbacks->pfnSetCurrentTab(nTab);
+}
+
+
+
+static int TabView_GetCurrentTabIndex(HWND hwndTabView)
+{
+ int shown_tabs = 0;
+ struct TabViewInfo *pTabViewInfo;
+
+ pTabViewInfo = GetTabViewInfo(hwndTabView);
+ int nCurrentTab = TabView_GetCurrentTab(hwndTabView);
+
+ for (int i = 0; i < pTabViewInfo->nTabCount; i++)
+ {
+ if (i == nCurrentTab)
+ break;
+
+ if (!pTabViewInfo->pCallbacks->pfnGetShowTab || pTabViewInfo->pCallbacks->pfnGetShowTab(i))
+ shown_tabs++;
+ }
+ return shown_tabs;
+}
+
+
+
+void TabView_UpdateSelection(HWND hwndTabView)
+{
+ (void)TabCtrl_SetCurSel(hwndTabView, TabView_GetCurrentTabIndex(hwndTabView));
+}
+
+
+
+BOOL TabView_HandleNotify(LPNMHDR lpNmHdr)
+{
+ struct TabViewInfo *pTabViewInfo;
+ BOOL bResult = false;
+
+ HWND hwndTabView = lpNmHdr->hwndFrom;
+ pTabViewInfo = GetTabViewInfo(hwndTabView);
+
+ switch (lpNmHdr->code)
+ {
+ case TCN_SELCHANGE:
+ int nTabIndex = TabCtrl_GetCurSel(hwndTabView);
+ int nTab = TabView_GetTabFromTabIndex(hwndTabView, nTabIndex);
+ TabView_SetCurrentTab(hwndTabView, nTab);
+ if (pTabViewInfo->pCallbacks->pfnOnSelectionChanged)
+ pTabViewInfo->pCallbacks->pfnOnSelectionChanged();
+ bResult = true;
+ break;
+ }
+ return bResult;
+}
+
+
+
+void TabView_CalculateNextTab(HWND hwndTabView)
+{
+ struct TabViewInfo *pTabViewInfo;
+ int nCurrentTab;
+
+ pTabViewInfo = GetTabViewInfo(hwndTabView);
+
+ // at most loop once through all options
+ for (int i = 0; i < pTabViewInfo->nTabCount; i++)
+ {
+ nCurrentTab = TabView_GetCurrentTab(hwndTabView);
+ TabView_SetCurrentTab(hwndTabView, (nCurrentTab + 1) % pTabViewInfo->nTabCount);
+ nCurrentTab = TabView_GetCurrentTab(hwndTabView);
+
+ if (!pTabViewInfo->pCallbacks->pfnGetShowTab || pTabViewInfo->pCallbacks->pfnGetShowTab(nCurrentTab))
+ {
+ // this tab is being shown, so we're all set
+ return;
+ }
+ }
+}
+
+
+void TabView_Reset(HWND hwndTabView)
+{
+ printf("TabView_Reset: A\n");fflush(stdout);
+ struct TabViewInfo *pTabViewInfo;
+ pTabViewInfo = GetTabViewInfo(hwndTabView);
+
+ printf("TabView_Reset: B\n");fflush(stdout);
+ BOOL b_res = TabCtrl_DeleteAllItems(hwndTabView);
+ b_res++;
+
+ TC_ITEM tci;
+ memset(&tci, 0, sizeof(tci));
+ tci.mask = TCIF_TEXT;
+ tci.cchTextMax = 20;
+
+ printf("TabView_Reset: C\n");fflush(stdout);
+ for (int i = 0; i < pTabViewInfo->nTabCount; i++)
+ {
+ if (!pTabViewInfo->pCallbacks->pfnGetShowTab || pTabViewInfo->pCallbacks->pfnGetShowTab(i))
+ {
+ TCHAR* t_text = ui_wstring_from_utf8(pTabViewInfo->pCallbacks->pfnGetTabLongName(i));
+ if( !t_text )
+ return;
+ tci.pszText = t_text;
+ HRESULT res = TabCtrl_InsertItem(hwndTabView, i, &tci);
+ res++;
+ free(t_text);
+ }
+ }
+ printf("TabView_Reset: E\n");fflush(stdout);
+ TabView_UpdateSelection(hwndTabView);
+ printf("TabView_Reset: Finished\n");fflush(stdout);
+}
+
+
+BOOL SetupTabView(HWND hwndTabView, const struct TabViewOptions *pOptions)
+{
+ //assert(hwndTabView);
+ printf("SetupTabView: A\n");fflush(stdout);
+ struct TabViewInfo *pTabViewInfo;
+
+ // Allocate the list view struct
+ pTabViewInfo = (struct TabViewInfo *) malloc(sizeof(struct TabViewInfo));
+ if (!pTabViewInfo)
+ return false;
+
+ // And fill it out
+ printf("SetupTabView: B\n");fflush(stdout);
+ memset(pTabViewInfo, 0, sizeof(*pTabViewInfo));
+ pTabViewInfo->pCallbacks = pOptions->pCallbacks;
+ pTabViewInfo->nTabCount = pOptions->nTabCount;
+
+ // Hook in our wndproc and userdata pointer
+ printf("SetupTabView: C\n");fflush(stdout);
+ LONG_PTR l = GetWindowLongPtr(hwndTabView, GWLP_WNDPROC);
+ pTabViewInfo->pfnParentWndProc = (WNDPROC) l;
+ SetWindowLongPtr(hwndTabView, GWLP_USERDATA, (LONG_PTR) pTabViewInfo);
+ SetWindowLongPtr(hwndTabView, GWLP_WNDPROC, (LONG_PTR) TabViewWndProc);
+
+ printf("SetupTabView: D\n");fflush(stdout);
+ BOOL bShowTabView = pTabViewInfo->pCallbacks->pfnGetShowTabCtrl ? pTabViewInfo->pCallbacks->pfnGetShowTabCtrl() : true;
+ printf("SetupTabView: E\n");fflush(stdout);
+ ShowWindow(hwndTabView, bShowTabView ? SW_SHOW : SW_HIDE);
+
+ printf("SetupTabView: F\n");fflush(stdout);
+ TabView_Reset(hwndTabView);
+ if (pTabViewInfo->pCallbacks->pfnOnSelectionChanged)
+ pTabViewInfo->pCallbacks->pfnOnSelectionChanged();
+ printf("SetupTabView: Finished\n");fflush(stdout);
+ return true;
+}
+
+
diff --git a/docs/release/src/osd/winui/tabview.h b/docs/release/src/osd/winui/tabview.h
new file mode 100644
index 00000000000..8958045a4be
--- /dev/null
+++ b/docs/release/src/osd/winui/tabview.h
@@ -0,0 +1,44 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef TABVIEW_H
+#define TABVIEW_H
+
+struct TabViewCallbacks
+{
+ // Options retrieval
+ BOOL (*pfnGetShowTabCtrl)(void);
+ void (*pfnSetCurrentTab)(int val);
+ int (*pfnGetCurrentTab)(void);
+ void (*pfnSetShowTab)(int nTab, BOOL show);
+ int (*pfnGetShowTab)(int nTab);
+
+ // Accessors
+ LPCSTR (*pfnGetTabShortName)(int nTab);
+ LPCSTR (*pfnGetTabLongName)(int nTab);
+
+ // Callbacks
+ void (*pfnOnSelectionChanged)(void);
+ void (*pfnOnMoveSize)(void);
+};
+
+struct TabViewOptions
+{
+ const struct TabViewCallbacks *pCallbacks;
+ int nTabCount;
+};
+
+
+BOOL SetupTabView(HWND hwndTabView, const struct TabViewOptions *pOptions);
+
+void TabView_Reset(HWND hwndTabView);
+void TabView_CalculateNextTab(HWND hwndTabView);
+int TabView_GetCurrentTab(HWND hwndTabView);
+void TabView_SetCurrentTab(HWND hwndTabView, int nTab);
+void TabView_UpdateSelection(HWND hwndTabView);
+
+// These are used to handle events received by the parent regarding
+// tabview controls
+BOOL TabView_HandleNotify(LPNMHDR lpNmHdr);
+
+#endif // TABVIEW_H
diff --git a/docs/release/src/osd/winui/treeview.cpp b/docs/release/src/osd/winui/treeview.cpp
new file mode 100644
index 00000000000..91a7d74c91e
--- /dev/null
+++ b/docs/release/src/osd/winui/treeview.cpp
@@ -0,0 +1,2513 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+/***************************************************************************
+
+ treeview.c
+
+ TreeView support routines - MSH 11/19/1998
+
+***************************************************************************/
+
+// standard windows headers
+#include <windows.h>
+#include <windowsx.h>
+#include <shellapi.h>
+#include <commctrl.h>
+
+// standard C headers
+#include <stdio.h> // for sprintf
+#include <stdlib.h> // For malloc and free
+#include <ctype.h> // For tolower
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#ifdef _MSC_VER
+#include <direct.h>
+#endif
+#include <tchar.h>
+#include <io.h>
+
+// MAME/MAMEUI headers
+#include "emu.h"
+#include "hash.h"
+#include "mui_util.h"
+#include "bitmask.h"
+#include "winui.h"
+#include "treeview.h"
+#include "resource.h"
+#include "mui_opts.h"
+#include "dialogs.h"
+#include "winutf8.h"
+#include "strconv.h"
+#include "drivenum.h"
+#include "screen.h"
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#endif
+
+#define MAX_EXTRA_FOLDERS 256
+
+/***************************************************************************
+ public structures
+ ***************************************************************************/
+
+#define ICON_MAX ARRAY_LENGTH(treeIconNames)
+
+/* Name used for user-defined custom icons */
+/* external *.ico file to look for. */
+
+typedef struct
+{
+ int nResourceID;
+ LPCSTR lpName;
+} TREEICON;
+
+static TREEICON treeIconNames[] =
+{
+ { IDI_FOLDER_OPEN, "foldopen" },
+ { IDI_FOLDER, "folder" },
+ { IDI_FOLDER_AVAILABLE, "foldavail" },
+ { IDI_FOLDER_MANUFACTURER, "foldmanu" },
+ { IDI_FOLDER_UNAVAILABLE, "foldunav" },
+ { IDI_FOLDER_YEAR, "foldyear" },
+ { IDI_FOLDER_SOURCE, "foldsrc" },
+ { IDI_FOLDER_HORIZONTAL, "horz" },
+ { IDI_FOLDER_VERTICAL, "vert" },
+ { IDI_MANUFACTURER, "manufact" },
+ { IDI_WORKING, "working" },
+ { IDI_NONWORKING, "nonwork" },
+ { IDI_YEAR, "year" },
+ { IDI_SOUND, "sound" },
+ { IDI_CPU, "cpu" },
+ { IDI_HARDDISK, "harddisk" },
+ { IDI_SOURCE, "source" }
+};
+
+/***************************************************************************
+ private variables
+ ***************************************************************************/
+
+/* this has an entry for every folder eventually in the UI, including subfolders */
+static TREEFOLDER **treeFolders = 0;
+static UINT numFolders = 0; /* Number of folder in the folder array */
+static UINT next_folder_id = MAX_FOLDERS;
+static UINT folderArrayLength = 0; /* Size of the folder array */
+static LPTREEFOLDER lpCurrentFolder = nullptr; /* Currently selected folder */
+static UINT nCurrentFolder = 0; /* Current folder ID */
+static WNDPROC g_lpTreeWndProc = 0; /* for subclassing the TreeView */
+static HIMAGELIST hTreeSmall = 0; /* TreeView Image list of icons */
+
+/* this only has an entry for each TOP LEVEL extra folder + SubFolders*/
+LPEXFOLDERDATA ExtraFolderData[MAX_EXTRA_FOLDERS * MAX_EXTRA_SUBFOLDERS];
+static int numExtraFolders = 0;
+static int numExtraIcons = 0;
+static char *ExtraFolderIcons[MAX_EXTRA_FOLDERS];
+
+// built in folders and filters
+static LPCFOLDERDATA g_lpFolderData;
+static LPCFILTER_ITEM g_lpFilterList;
+
+/***************************************************************************
+ private function prototypes
+ ***************************************************************************/
+
+extern BOOL InitFolders(void);
+static BOOL CreateTreeIcons(void);
+static void TreeCtrlOnPaint(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static const char* ParseManufacturer(const char *s, int *pParsedChars );
+static const char* TrimManufacturer(const char *s);
+static BOOL AddFolder(LPTREEFOLDER lpFolder);
+static LPTREEFOLDER NewFolder(const char *lpTitle, UINT nFolderId, int nParent, UINT nIconId, DWORD dwFlags);
+static void DeleteFolder(LPTREEFOLDER lpFolder);
+static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static int InitExtraFolders(void);
+static void FreeExtraFolders(void);
+static void SetExtraIcons(char *name, int *id);
+static BOOL TryAddExtraFolderAndChildren(int parent_index);
+static BOOL TrySaveExtraFolder(LPTREEFOLDER lpFolder);
+static void SaveExternalFolders(int parent_index, const char *fname);
+
+/***************************************************************************
+ public functions
+ ***************************************************************************/
+
+static BOOL win_move_file_utf8(const char* existingfilename, const char* newfilename)
+{
+ TCHAR* t_existingfilename;
+ TCHAR* t_newfilename;
+ BOOL result = FALSE;
+
+ t_existingfilename = ui_wstring_from_utf8(existingfilename);
+ if( !t_existingfilename )
+ return result;
+
+ t_newfilename = ui_wstring_from_utf8(newfilename);
+ if( !t_newfilename ) {
+ free(t_existingfilename);
+ return result;
+ }
+
+ result = MoveFile(t_existingfilename, t_newfilename);
+
+ free(t_newfilename);
+ free(t_existingfilename);
+
+ return result;
+}
+
+/**************************************************************************
+ * ci_strncmp - case insensitive character array compare
+ *
+ * Returns zero if the first n characters of s1 and s2 are equal,
+ * ignoring case.
+ * stolen from datafile.c
+ **************************************************************************/
+static int ci_strncmp (const char *s1, const char *s2, int n)
+{
+ int c1, c2;
+
+ while (n)
+ {
+ if ((c1 = tolower (*s1)) != (c2 = tolower (*s2)))
+ return (c1 - c2);
+ else if (!c1)
+ break;
+ --n;
+
+ s1++;
+ s2++;
+ }
+ return 0;
+}
+
+
+
+/* De-allocate all folder memory */
+void FreeFolders(void)
+{
+ int i = 0;
+
+ if (treeFolders != NULL)
+ {
+ if (numExtraFolders)
+ {
+ FreeExtraFolders();
+ numFolders -= numExtraFolders;
+ }
+
+ for (i = numFolders - 1; i >= 0; i--)
+ {
+ DeleteFolder(treeFolders[i]);
+ treeFolders[i] = NULL;
+ numFolders--;
+ }
+ free(treeFolders);
+ treeFolders = NULL;
+ }
+ numFolders = 0;
+}
+
+/* Reset folder filters */
+void ResetFilters(void)
+{
+ int i = 0;
+
+ if (treeFolders != 0)
+ {
+ for (i = 0; i < (int)numFolders; i++)
+ {
+ treeFolders[i]->m_dwFlags &= ~F_MASK;
+ }
+ }
+}
+
+void InitTree(LPCFOLDERDATA lpFolderData, LPCFILTER_ITEM lpFilterList)
+{
+ LONG_PTR l;
+
+ g_lpFolderData = lpFolderData;
+ g_lpFilterList = lpFilterList;
+
+ InitFolders();
+
+ /* this will subclass the treeview (where WM_DRAWITEM gets sent for the header control) */
+ l = GetWindowLongPtr(GetTreeView(), GWLP_WNDPROC);
+ g_lpTreeWndProc = (WNDPROC)l;
+ SetWindowLongPtr(GetTreeView(), GWLP_WNDPROC, (LONG_PTR)TreeWndProc);
+}
+
+void SetCurrentFolder(LPTREEFOLDER lpFolder)
+{
+ lpCurrentFolder = (lpFolder == 0) ? treeFolders[0] : lpFolder;
+ nCurrentFolder = (lpCurrentFolder) ? lpCurrentFolder->m_nFolderId : 0;
+}
+
+LPTREEFOLDER GetCurrentFolder(void)
+{
+ return lpCurrentFolder;
+}
+
+UINT GetCurrentFolderID(void)
+{
+ return nCurrentFolder;
+}
+
+int GetNumFolders(void)
+{
+ return numFolders;
+}
+
+LPTREEFOLDER GetFolder(UINT nFolder)
+{
+ return (nFolder < numFolders) ? treeFolders[nFolder] : NULL;
+}
+
+LPTREEFOLDER GetFolderByID(UINT nID)
+{
+ UINT i;
+
+ for (i = 0; i < numFolders; i++)
+ {
+ if (treeFolders[i]->m_nFolderId == nID)
+ {
+ return treeFolders[i];
+ }
+ }
+
+ return (LPTREEFOLDER)0;
+}
+
+void AddGame(LPTREEFOLDER lpFolder, UINT nGame)
+{
+ if (lpFolder)
+ SetBit(lpFolder->m_lpGameBits, nGame);
+}
+
+void RemoveGame(LPTREEFOLDER lpFolder, UINT nGame)
+{
+ ClearBit(lpFolder->m_lpGameBits, nGame);
+}
+
+int FindGame(LPTREEFOLDER lpFolder, int nGame)
+{
+ return FindBit(lpFolder->m_lpGameBits, nGame, TRUE);
+}
+
+// Called to re-associate games with folders
+void ResetWhichGamesInFolders(void)
+{
+ UINT i, jj, k;
+ BOOL b;
+ int nGames = driver_list::total();
+
+ for (i = 0; i < numFolders; i++)
+ {
+ LPTREEFOLDER lpFolder = treeFolders[i];
+ // setup the games in our built-in folders
+ for (k = 0; g_lpFolderData[k].m_lpTitle; k++)
+ {
+ if (lpFolder->m_nFolderId == g_lpFolderData[k].m_nFolderId)
+ {
+ if (g_lpFolderData[k].m_pfnQuery || g_lpFolderData[k].m_bExpectedResult)
+ {
+ SetAllBits(lpFolder->m_lpGameBits, FALSE);
+ for (jj = 0; jj < nGames; jj++)
+ {
+ // invoke the query function
+ b = g_lpFolderData[k].m_pfnQuery ? g_lpFolderData[k].m_pfnQuery(jj) : TRUE;
+
+ // if we expect FALSE, flip the result
+ if (!g_lpFolderData[k].m_bExpectedResult)
+ b = !b;
+
+ // if we like what we hear, add the game
+ if (b)
+ AddGame(lpFolder, jj);
+ }
+ }
+ break;
+ }
+ }
+ }
+}
+
+
+/* Used to build the GameList */
+BOOL GameFiltered(int nGame, DWORD dwMask)
+{
+ int i;
+ LPTREEFOLDER lpFolder = GetCurrentFolder();
+ LPTREEFOLDER lpParent = nullptr;
+
+ //Filter out the Bioses on all Folders, except for the Bios Folder
+ if (lpFolder != nullptr && lpFolder->m_nFolderId != FOLDER_BIOS)
+ {
+// if( !( (driver_list::driver(nGame).flags & MACHINE_IS_BIOS_ROOT ) == 0) )
+// return TRUE;
+ if( driver_list::driver(nGame).name[0] == '_' )
+ return TRUE;
+ }
+ // Filter games--return TRUE if the game should be HIDDEN in this view
+ if( GetFilterInherit() )
+ {
+ if( lpFolder != nullptr )
+ {
+ lpParent = GetFolder( lpFolder->m_nParent );
+ if( lpParent != nullptr )
+ {
+ /* Check the Parent Filters and inherit them on child,
+ * The inherited filters don't display on the custom Filter Dialog for the Child folder
+ * No need to promote all games to parent folder, works as is */
+ dwMask |= lpParent->m_dwFlags;
+ }
+ }
+ }
+
+ if (strlen(GetSearchText()) && _stricmp(GetSearchText(), SEARCH_PROMPT))
+ {
+ if (MyStrStrI(driver_list::driver(nGame).type.fullname(),GetSearchText()) == NULL &&
+ MyStrStrI(driver_list::driver(nGame).name,GetSearchText()) == NULL)
+ return TRUE;
+ }
+ /*Filter Text is already global*/
+ if (MyStrStrI(driver_list::driver(nGame).type.fullname(),GetFilterText()) == NULL &&
+ MyStrStrI(driver_list::driver(nGame).name,GetFilterText()) == NULL &&
+ MyStrStrI(driver_list::driver(nGame).type.source(),GetFilterText()) == NULL &&
+ MyStrStrI(driver_list::driver(nGame).manufacturer,GetFilterText()) == NULL)
+ {
+ return TRUE;
+ }
+ // Are there filters set on this folder?
+ if ((dwMask & F_MASK) == 0)
+ return FALSE;
+
+ // Filter out clones?
+ if (dwMask & F_CLONES && DriverIsClone(nGame))
+ return TRUE;
+
+ for (i = 0; g_lpFilterList[i].m_dwFilterType; i++)
+ {
+ if (dwMask & g_lpFilterList[i].m_dwFilterType)
+ {
+ if (g_lpFilterList[i].m_pfnQuery(nGame) == g_lpFilterList[i].m_bExpectedResult)
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/* Get the parent of game in this view */
+BOOL GetParentFound(int nGame) // not used
+{
+ int nParentIndex = -1;
+ LPTREEFOLDER lpFolder = GetCurrentFolder();
+
+ if( lpFolder )
+ {
+ nParentIndex = GetParentIndex(&driver_list::driver(nGame));
+
+ /* return FALSE if no parent is there in this view */
+ if( nParentIndex == -1)
+ return FALSE;
+
+ /* return FALSE if the folder should be HIDDEN in this view */
+ if (TestBit(lpFolder->m_lpGameBits, nParentIndex) == 0)
+ return FALSE;
+
+ /* return FALSE if the game should be HIDDEN in this view */
+ if (GameFiltered(nParentIndex, lpFolder->m_dwFlags))
+ return FALSE;
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+LPCFILTER_ITEM GetFilterList(void)
+{
+ return g_lpFilterList;
+}
+
+/***************************************************************************
+ private functions
+ ***************************************************************************/
+
+void CreateSourceFolders(int parent_index)
+{
+ int i,jj, k = 0;
+ int nGames = driver_list::total();
+ int start_folder = numFolders;
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER lpTemp;
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+ for (jj = 0; jj < nGames; jj++)
+ {
+ const char *s = GetDriverFilename(jj);
+
+ if (s == NULL || s[0] == '\0')
+ continue;
+
+ // look for an existant source treefolder for this game
+ // (likely to be the previous one, so start at the end)
+ for (i=numFolders-1;i>=start_folder;i--)
+ {
+ if (strcmp(treeFolders[i]->m_lpTitle,s) == 0)
+ {
+ AddGame(treeFolders[i],jj);
+ break;
+ }
+ }
+ if (i == start_folder-1)
+ {
+ // nope, it's a source file we haven't seen before, make it.
+ lpTemp = NewFolder(s, next_folder_id, parent_index, IDI_SOURCE, GetFolderFlags(numFolders));
+
+ // Increment next_folder_id here in case code is added above
+ next_folder_id++;
+ AddFolder(lpTemp);
+ AddGame(lpTemp,jj);
+ }
+ }
+ SetNumOptionFolders(k-1);
+ const char *fname = "Source";
+ SaveExternalFolders(parent_index, fname);
+}
+
+void CreateScreenFolders(int parent_index)
+{
+ int i, jj, k = 0;
+ int nGames = driver_list::total();
+ int start_folder = numFolders;
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER lpTemp;
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+ for (jj = 0; jj < nGames; jj++)
+ {
+ int screens = DriverNumScreens(jj);
+ char s[2];
+ itoa(screens, s, 10);
+
+ // look for an existant screens treefolder for this game
+ // (likely to be the previous one, so start at the end)
+ for (i=numFolders-1;i>=start_folder;i--)
+ {
+ if (strcmp(treeFolders[i]->m_lpTitle,s) == 0)
+ {
+ AddGame(treeFolders[i],jj);
+ break;
+ }
+ }
+ if (i == start_folder-1)
+ {
+ // nope, it's a screen file we haven't seen before, make it.
+ lpTemp = NewFolder(s, next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+
+ // Increment next_folder_id here in case code is added above
+ next_folder_id++;
+ AddFolder(lpTemp);
+ AddGame(lpTemp,jj);
+ }
+ }
+ SetNumOptionFolders(k-1);
+ const char *fname = "Screen";
+ SaveExternalFolders(parent_index, fname);
+}
+
+
+void CreateManufacturerFolders(int parent_index)
+{
+ int i, jj;
+ int nGames = driver_list::total();
+ int start_folder = numFolders;
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER lpTemp;
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+
+ for (jj = 0; jj < nGames; jj++)
+ {
+ const char *manufacturer = driver_list::driver(jj).manufacturer;
+ int iChars = 0;
+ while( manufacturer != NULL && manufacturer[0] != '\0' )
+ {
+ const char *s = ParseManufacturer(manufacturer, &iChars);
+ manufacturer += iChars;
+ //shift to next start char
+ if( s != NULL && *s != 0 )
+ {
+ const char *t = TrimManufacturer(s);
+ for (i=numFolders-1;i>=start_folder;i--)
+ {
+ //RS Made it case insensitive
+ if (ci_strncmp(treeFolders[i]->m_lpTitle,t,20) == 0 )
+ {
+ AddGame(treeFolders[i],jj);
+ break;
+ }
+ }
+ if (i == start_folder-1)
+ {
+ // nope, it's a manufacturer we haven't seen before, make it.
+ lpTemp = NewFolder(t, next_folder_id, parent_index, IDI_MANUFACTURER, GetFolderFlags(numFolders));
+ AddFolder(lpTemp);
+ AddGame(lpTemp,jj);
+ }
+ }
+ }
+ }
+ const char *fname = "Manufacturer";
+ SaveExternalFolders(parent_index, fname);
+}
+
+/* Make a reasonable name out of the one found in the driver array */
+static const char* ParseManufacturer(const char *s, int *pParsedChars )
+{
+ static char tmp[256];
+ char* ptmp;
+ char *t;
+ *pParsedChars= 0;
+
+ if ( *s == '?' || *s == '<' || s[3] == '?' )
+ {
+ (*pParsedChars) = strlen(s);
+ return "<unknown>";
+ }
+
+ ptmp = tmp;
+ /*if first char is a space, skip it*/
+ if( *s == ' ' )
+ {
+ (*pParsedChars)++;
+ ++s;
+ }
+ while( *s )
+ {
+ /* combinations where to end string */
+
+ if (
+ ( (*s == ' ') && ( s[1] == '(' || s[1] == '/' || s[1] == '+' ) ) ||
+ ( *s == ']' ) ||
+ ( *s == '/' ) ||
+ ( *s == '?' )
+ )
+ {
+ (*pParsedChars)++;
+ if( s[1] == '/' || s[1] == '+' )
+ (*pParsedChars)++;
+ break;
+ }
+ if( s[0] == ' ' && s[1] == '?' )
+ {
+ (*pParsedChars) += 2;
+ s+=2;
+ }
+
+ /* skip over opening braces*/
+
+ if ( *s != '[' )
+ {
+ *ptmp++ = *s;
+ }
+ (*pParsedChars)++;
+ /*for "distributed by" and "supported by" handling*/
+ if( ( (s[1] == ',') && (s[2] == ' ') && ( (s[3] == 's') || (s[3] == 'd') ) ) )
+ {
+ //*ptmp++ = *s;
+ ++s;
+ break;
+ }
+ ++s;
+ }
+ *ptmp = '\0';
+ t = tmp;
+ if( tmp[0] == '(' || tmp[strlen(tmp)-1] == ')' || tmp[0] == ',')
+ {
+ ptmp = strchr( tmp,'(' );
+ if ( ptmp == NULL )
+ {
+ ptmp = strchr( tmp,',' );
+ if( ptmp != NULL)
+ {
+ //parse the new "supported by" and "distributed by"
+ ptmp++;
+
+ if (ci_strncmp(ptmp, " supported by", 13) == 0)
+ {
+ ptmp += 13;
+ }
+ else if (ci_strncmp(ptmp, " distributed by", 15) == 0)
+ {
+ ptmp += 15;
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+ else
+ {
+ ptmp = tmp;
+ if ( ptmp == NULL )
+ {
+ return NULL;
+ }
+ }
+ }
+ if( tmp[0] == '(' || tmp[0] == ',')
+ {
+ ptmp++;
+ }
+ if (ci_strncmp(ptmp, "licensed from ", 14) == 0)
+ {
+ ptmp += 14;
+ }
+ // for the licenced from case
+ if (ci_strncmp(ptmp, "licenced from ", 14) == 0)
+ {
+ ptmp += 14;
+ }
+
+ while ( (*ptmp != ')' ) && (*ptmp != '/' ) && *ptmp != '\0')
+ {
+ if (*ptmp == ' ' && ci_strncmp(ptmp, " license", 8) == 0)
+ {
+ break;
+ }
+ if (*ptmp == ' ' && ci_strncmp(ptmp, " licence", 8) == 0)
+ {
+ break;
+ }
+ *t++ = *ptmp++;
+ }
+
+ *t = '\0';
+ }
+
+ *ptmp = '\0';
+ return tmp;
+}
+
+/* Analyze Manufacturer Names for typical patterns, that don't distinguish between companies (e.g. Co., Ltd., Inc., etc. */
+static const char* TrimManufacturer(const char *s)
+{
+ //Also remove Country specific suffixes (e.g. Japan, Italy, America, USA, ...)
+ int i=0;
+ char strTemp[256];
+ static char strTemp2[256];
+ int j=0;
+ int k=0;
+ int l = 0;
+ memset(strTemp, '\0', 256 );
+ memset(strTemp2, '\0', 256 );
+ //start analyzing from the back, as these are usually suffixes
+ for(i=strlen(s)-1; i>=0;i-- )
+ {
+
+ l = strlen(strTemp);
+ for(k=l;k>=0; k--)
+ strTemp[k+1] = strTemp[k];
+ strTemp[0] = s[i];
+ strTemp[++l] = '\0';
+ switch (l)
+ {
+ case 2:
+ if( ci_strncmp(strTemp, "co", 2) == 0 )
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 3:
+ if( ci_strncmp(strTemp, "co.", 3) == 0 || ci_strncmp(strTemp, "ltd", 3) == 0 || ci_strncmp(strTemp, "inc", 3) == 0 || ci_strncmp(strTemp, "SRL", 3) == 0 || ci_strncmp(strTemp, "USA", 3) == 0)
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 4:
+ if( ci_strncmp(strTemp, "inc.", 4) == 0 || ci_strncmp(strTemp, "ltd.", 4) == 0 || ci_strncmp(strTemp, "corp", 4) == 0 || ci_strncmp(strTemp, "game", 4) == 0)
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 5:
+ if( ci_strncmp(strTemp, "corp.", 5) == 0 || ci_strncmp(strTemp, "Games", 5) == 0 || ci_strncmp(strTemp, "Italy", 5) == 0 || ci_strncmp(strTemp, "Japan", 5) == 0)
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 6:
+ if( ci_strncmp(strTemp, "co-ltd", 6) == 0 || ci_strncmp(strTemp, "S.R.L.", 6) == 0)
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 7:
+ if( ci_strncmp(strTemp, "co. ltd", 7) == 0 || ci_strncmp(strTemp, "America", 7) == 0)
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 8:
+ if( ci_strncmp(strTemp, "co. ltd.", 8) == 0 )
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 9:
+ if( ci_strncmp(strTemp, "co., ltd.", 9) == 0 || ci_strncmp(strTemp, "gmbh & co", 9) == 0 )
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 10:
+ if( ci_strncmp(strTemp, "corp, ltd.", 10) == 0 || ci_strncmp(strTemp, "industries", 10) == 0 || ci_strncmp(strTemp, "of America", 10) == 0)
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 11:
+ if( ci_strncmp(strTemp, "corporation", 11) == 0 || ci_strncmp(strTemp, "enterprises", 11) == 0 )
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ case 16:
+ if( ci_strncmp(strTemp, "industries japan", 16) == 0 )
+ {
+ j=l;
+ while( s[strlen(s)-j-1] == ' ' || s[strlen(s)-j-1] == ',' )
+ {
+ j++;
+ }
+ if( j!=l)
+ {
+ memset(strTemp2, '\0', 256 );
+ strncpy(strTemp2, s, strlen(s)-j );
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if( *strTemp2 == 0 )
+ return s;
+ return strTemp2;
+}
+
+void CreateCPUFolders(int parent_index)
+{
+ int i, j, device_folder_count = 0;
+ LPTREEFOLDER device_folders[512];
+ LPTREEFOLDER folder;
+ LPTREEFOLDER lpTemp;
+ int nFolder = numFolders;
+
+ for (i = 0; i < driver_list::total(); i++)
+ {
+ machine_config config(driver_list::driver(i),MameUIGlobal());
+
+ // enumerate through all devices
+ for (device_execute_interface &device : execute_interface_iterator(config.root_device()))
+ {
+ // get the name
+ std::string dev_name = device.device().name();
+
+ // do we have a folder for this device?
+ folder = NULL;
+ for (j = 0; j < device_folder_count; j++)
+ {
+ if (!strcmp(dev_name.c_str(), device_folders[j]->m_lpTitle))
+ {
+ folder = device_folders[j];
+ break;
+ }
+ }
+
+ // are we forced to create a folder?
+ if (folder == NULL)
+ {
+ lpTemp = NewFolder(device.device().name(), next_folder_id, parent_index, IDI_CPU, GetFolderFlags(numFolders));
+ AddFolder(lpTemp);
+ folder = treeFolders[nFolder++];
+
+ // record that we found this folder
+ device_folders[device_folder_count++] = folder;
+ }
+
+ // cpu type #'s are one-based
+ AddGame(folder, i);
+ }
+ }
+ const char *fname = "CPU";
+ SaveExternalFolders(parent_index, fname);
+}
+
+void CreateSoundFolders(int parent_index)
+{
+ int i, j, device_folder_count = 0;
+ LPTREEFOLDER device_folders[512];
+ LPTREEFOLDER folder;
+ LPTREEFOLDER lpTemp;
+ int nFolder = numFolders;
+
+ for (i = 0; i < driver_list::total(); i++)
+ {
+ machine_config config(driver_list::driver(i),MameUIGlobal());
+
+ // enumerate through all devices
+
+ for (device_sound_interface &device : sound_interface_iterator(config.root_device()))
+ {
+ // get the name
+ std::string dev_name = device.device().name();
+
+ // do we have a folder for this device?
+ folder = NULL;
+ for (j = 0; j < device_folder_count; j++)
+ {
+ if (!strcmp(dev_name.c_str(), device_folders[j]->m_lpTitle))
+ {
+ folder = device_folders[j];
+ break;
+ }
+ }
+
+ // are we forced to create a folder?
+ if (folder == NULL)
+ {
+
+ lpTemp = NewFolder(device.device().name(), next_folder_id, parent_index, IDI_CPU, GetFolderFlags(numFolders));
+ AddFolder(lpTemp);
+ folder = treeFolders[nFolder++];
+
+ // record that we found this folder
+ device_folders[device_folder_count++] = folder;
+ }
+
+ // cpu type #'s are one-based
+ AddGame(folder, i);
+ }
+ }
+ const char *fname = "BIOS";
+ SaveExternalFolders(parent_index, fname);
+}
+
+void CreateDeficiencyFolders(int parent_index)
+{
+ int jj;
+ int nGames = driver_list::total();
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER lpProt, lpWrongCol, lpImpCol, lpImpGraph, lpMissSnd, lpImpSnd, lpFlip, lpArt;
+
+ // create our subfolders
+ lpProt = NewFolder("Unemulated Protection", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpWrongCol = NewFolder("Wrong Colors", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpImpCol = NewFolder("Imperfect Colors", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpImpGraph = NewFolder("Imperfect Graphics", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpMissSnd = NewFolder("Missing Sound", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpImpSnd = NewFolder("Imperfect Sound", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpFlip = NewFolder("No Cocktail", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpArt = NewFolder("Requires Artwork", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ AddFolder(lpProt);
+ AddFolder(lpWrongCol);
+ AddFolder(lpImpCol);
+ AddFolder(lpImpGraph);
+ AddFolder(lpMissSnd);
+ AddFolder(lpImpSnd);
+ AddFolder(lpFlip);
+ AddFolder(lpArt);
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+
+ for (jj = 0; jj < nGames; jj++)
+ {
+ uint32_t cache = GetDriverCacheLower(jj);
+ if (BIT(cache, 21))
+ AddGame(lpWrongCol,jj);
+
+ if (BIT(cache, 22))
+ AddGame(lpProt,jj);
+
+ if (BIT(cache, 20))
+ AddGame(lpImpCol,jj);
+
+ if (BIT(cache, 18))
+ AddGame(lpImpGraph,jj);
+
+ if (BIT(cache, 17))
+ AddGame(lpMissSnd,jj);
+
+ if (BIT(cache, 16))
+ AddGame(lpImpSnd,jj);
+
+ if (BIT(cache, 8))
+ AddGame(lpFlip,jj);
+
+ if (BIT(cache, 10))
+ AddGame(lpArt,jj);
+ }
+}
+
+void CreateDumpingFolders(int parent_index)
+{
+ int jj;
+ BOOL bBadDump = FALSE;
+ BOOL bNoDump = FALSE;
+ int nGames = driver_list::total();
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER lpBad, lpNo;
+ const rom_entry *region, *rom;
+ const game_driver *gamedrv;
+
+ // create our two subfolders
+ lpBad = NewFolder("Bad Dump", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpNo = NewFolder("No Dump", next_folder_id, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ AddFolder(lpBad);
+ AddFolder(lpNo);
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+
+ for (jj = 0; jj < nGames; jj++)
+ {
+
+ gamedrv = &driver_list::driver(jj);
+
+ if (!gamedrv->rom)
+ continue;
+ bBadDump = FALSE;
+ bNoDump = FALSE;
+ /* Allocate machine config */
+ machine_config config(*gamedrv,MameUIGlobal());
+
+ for (device_t &device : device_iterator(config.root_device()))
+ {
+ for (region = rom_first_region(device); region; region = rom_next_region(region))
+ {
+ for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ {
+ if (ROMREGION_ISROMDATA(region) || ROMREGION_ISDISKDATA(region) )
+ {
+ //name = ROM_GETNAME(rom);
+ util::hash_collection hashes(ROM_GETHASHDATA(rom));
+ if (hashes.flag(util::hash_collection::FLAG_BAD_DUMP))
+ bBadDump = TRUE;
+ if (hashes.flag(util::hash_collection::FLAG_NO_DUMP))
+ bNoDump = TRUE;
+ }
+ }
+ }
+ }
+ if (bBadDump)
+ AddGame(lpBad,jj);
+
+ if (bNoDump)
+ AddGame(lpNo,jj);
+ }
+ const char *fname = "Dumping";
+ SaveExternalFolders(parent_index, fname);
+}
+
+
+void CreateYearFolders(int parent_index)
+{
+ int i, jj;
+ int nGames = driver_list::total();
+ int start_folder = numFolders;
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER lpTemp;
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+
+ for (jj = 0; jj < nGames; jj++)
+ {
+ char s[100];
+ strcpy(s,driver_list::driver(jj).year);
+
+ if (s[0] == '\0')
+ continue;
+
+ // look for an extant year treefolder for this game
+ // (likely to be the previous one, so start at the end)
+ for (i=numFolders-1;i>=start_folder;i--)
+ {
+ if (strncmp(treeFolders[i]->m_lpTitle,s,5) == 0)
+ {
+ AddGame(treeFolders[i],jj);
+ break;
+ }
+ }
+ if (i == start_folder-1)
+ {
+ // nope, it's a year we haven't seen before, make it.
+ lpTemp = NewFolder(s, next_folder_id, parent_index, IDI_YEAR, GetFolderFlags(numFolders));
+ AddFolder(lpTemp);
+ AddGame(lpTemp,jj);
+ }
+ }
+ const char *fname = "Year";
+ SaveExternalFolders(parent_index, fname);
+}
+
+void CreateBIOSFolders(int parent_index)
+{
+ int i, jj;
+ int nGames = driver_list::total();
+ int start_folder = numFolders;
+ const game_driver *drv;
+ int nParentIndex = -1;
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER lpTemp;
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+
+ for (jj = 0; jj < nGames; jj++)
+ {
+ if ( DriverIsClone(jj) )
+ {
+ nParentIndex = GetParentIndex(&driver_list::driver(jj));
+ if (nParentIndex < 0) return;
+ drv = &driver_list::driver(nParentIndex);
+ }
+ else
+ drv = &driver_list::driver(jj);
+ nParentIndex = GetParentIndex(drv);
+
+ if (nParentIndex < 0 || !driver_list::driver(nParentIndex).type.fullname())
+ continue;
+
+ for (i = numFolders-1; i >= start_folder; i--)
+ {
+ if (strcmp(treeFolders[i]->m_lpTitle, driver_list::driver(nParentIndex).type.fullname()) == 0)
+ {
+ AddGame(treeFolders[i],jj);
+ break;
+ }
+ }
+
+ if (i == start_folder-1)
+ {
+ lpTemp = NewFolder(driver_list::driver(nParentIndex).type.fullname(), next_folder_id++, parent_index, IDI_CPU, GetFolderFlags(numFolders));
+ AddFolder(lpTemp);
+ AddGame(lpTemp,jj);
+ }
+ }
+ const char *fname = "BIOS";
+ SaveExternalFolders(parent_index, fname);
+}
+
+void CreateResolutionFolders(int parent_index)
+{
+ int i,jj;
+ int nGames = driver_list::total();
+ int start_folder = numFolders;
+ char Resolution[20];
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER lpVectorV, lpVectorH;
+ LPTREEFOLDER lpTemp;
+
+ // create our two subfolders
+ lpVectorV = NewFolder("Vector (V)", next_folder_id++, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ lpVectorH = NewFolder("Vector (H)", next_folder_id++, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ AddFolder(lpVectorV);
+ AddFolder(lpVectorH);
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+
+ for (jj = 0; jj < nGames; jj++)
+ {
+ machine_config config(driver_list::driver(jj), MameUIGlobal());
+ const screen_device *screen = screen_device_iterator(config.root_device()).first();
+ if (screen != NULL)
+ {
+ const rectangle &visarea = screen->visible_area();
+
+ if (DriverIsVector(jj))
+ {
+ if (driver_list::driver(jj).flags & ORIENTATION_SWAP_XY)
+ {
+ AddGame(lpVectorV,jj);
+ }
+ else
+ {
+ AddGame(lpVectorH,jj);
+ }
+ }
+ else
+ if (driver_list::driver(jj).flags & ORIENTATION_SWAP_XY)
+ {
+ sprintf(Resolution, "%dx%d (V)",
+ visarea.max_y - visarea.min_y + 1,
+ visarea.max_x - visarea.min_x + 1);
+ }
+ else
+ {
+ sprintf(Resolution, "%dx%d (H)",
+ visarea.max_x - visarea.min_x + 1,
+ visarea.max_y - visarea.min_y + 1);
+ }
+
+ for (i=numFolders-1;i>=start_folder;i--)
+ {
+ if (strcmp(treeFolders[i]->m_lpTitle, Resolution) == 0)
+ {
+ AddGame(treeFolders[i],jj);
+ break;
+ }
+ }
+ if (i == start_folder-1)
+ {
+ lpTemp = NewFolder(Resolution, next_folder_id++, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ AddFolder(lpTemp);
+ AddGame(lpTemp,jj);
+ }
+ }
+ }
+ const char *fname = "Resolution";
+ SaveExternalFolders(parent_index, fname);
+}
+
+void CreateFPSFolders(int parent_index)
+{
+ int i, jj;
+ int nGames = driver_list::total();
+ int nFolder = numFolders;
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ LPTREEFOLDER map[256];
+ LPTREEFOLDER lpTemp;
+ float fps[256];
+ int nFPS = 0;
+
+ // no games in top level folder
+ SetAllBits(lpFolder->m_lpGameBits,FALSE);
+
+ for (i = 0; i < nGames; i++)
+ {
+ float f;
+ machine_config config(driver_list::driver(i), MameUIGlobal());
+ const screen_device *screen = screen_device_iterator(config.root_device()).first();
+ if (screen)
+ {
+ f = ATTOSECONDS_TO_HZ(screen->refresh_attoseconds());
+
+ for (jj = 0; jj < nFPS; jj++)
+ if (fps[jj] == f)
+ break;
+
+ if (nFPS == jj)
+ {
+ char buf[50];
+
+ assert(nFPS + 1 < ARRAY_LENGTH(fps));
+ assert(nFPS + 1 < ARRAY_LENGTH(map));
+
+ sprintf(buf, "%f Hz", f);
+
+ lpTemp = NewFolder(buf, next_folder_id++, parent_index, IDI_FOLDER, GetFolderFlags(numFolders));
+ AddFolder(lpTemp);
+ map[nFPS] = treeFolders[nFolder++];
+ fps[nFPS++] = f;
+ }
+
+ AddGame(map[jj],i);
+ }
+ }
+ const char *fname = "Refresh";
+ SaveExternalFolders(parent_index, fname);
+}
+
+// adds these folders to the treeview
+void ResetTreeViewFolders(void)
+{
+ HWND hTreeView = GetTreeView();
+ int i;
+ TVITEM tvi;
+ TVINSERTSTRUCT tvs;
+ BOOL res;
+
+ HTREEITEM shti; // for current child branches
+
+ // currently "cached" parent
+ HTREEITEM hti_parent = NULL;
+ int index_parent = -1;
+
+ res = TreeView_DeleteAllItems(hTreeView);
+
+ //dprintf("Adding folders to tree ui indices %i to %i\n",start_index,end_index);
+
+ tvs.hInsertAfter = TVI_SORT;
+
+ for (i=0;i<numFolders;i++)
+ {
+ LPTREEFOLDER lpFolder = treeFolders[i];
+
+ if (lpFolder->m_nParent == -1)
+ {
+ if (lpFolder->m_nFolderId < MAX_FOLDERS)
+ {
+ // it's a built in folder, let's see if we should show it
+ if (GetShowFolder(lpFolder->m_nFolderId) == FALSE)
+ {
+ continue;
+ }
+ }
+
+ tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvs.hParent = TVI_ROOT;
+ tvi.pszText = lpFolder->m_lptTitle;
+ tvi.lParam = (LPARAM)lpFolder;
+ tvi.iImage = GetTreeViewIconIndex(lpFolder->m_nIconId);
+ tvi.iSelectedImage = 0;
+
+ tvs.item = tvi;
+
+ // Add root branch
+ hti_parent = TreeView_InsertItem(hTreeView, &tvs);
+
+ continue;
+ }
+
+ // not a top level branch, so look for parent
+ if (treeFolders[i]->m_nParent != index_parent)
+ {
+
+ hti_parent = TreeView_GetRoot(hTreeView);
+ while (1)
+ {
+ if (hti_parent == NULL)
+ {
+ // couldn't find parent folder, so it's a built-in but
+ // not shown folder
+ break;
+ }
+
+ tvi.hItem = hti_parent;
+ tvi.mask = TVIF_PARAM;
+ res = TreeView_GetItem(hTreeView,&tvi);
+ if (((LPTREEFOLDER)tvi.lParam) == treeFolders[treeFolders[i]->m_nParent])
+ break;
+
+ hti_parent = TreeView_GetNextSibling(hTreeView,hti_parent);
+ }
+
+ // if parent is not shown, then don't show the child either obviously!
+ if (hti_parent == NULL)
+ continue;
+
+ index_parent = treeFolders[i]->m_nParent;
+ }
+
+ tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvs.hParent = hti_parent;
+ tvi.iImage = GetTreeViewIconIndex(treeFolders[i]->m_nIconId);
+ tvi.iSelectedImage = 0;
+ tvi.pszText = treeFolders[i]->m_lptTitle;
+ tvi.lParam = (LPARAM)treeFolders[i];
+
+ tvs.item = tvi;
+
+ // Add it to this tree branch
+ shti = TreeView_InsertItem(hTreeView, &tvs);
+
+ }
+}
+
+void SelectTreeViewFolder(int folder_id)
+{
+ HWND hTreeView = GetTreeView();
+ HTREEITEM hti;
+ TVITEM tvi;
+ BOOL res;
+
+ memset(&tvi,0,sizeof(tvi));
+
+ hti = TreeView_GetRoot(hTreeView);
+
+ while (hti != NULL)
+ {
+ HTREEITEM hti_next;
+
+ tvi.hItem = hti;
+ tvi.mask = TVIF_PARAM;
+ res = TreeView_GetItem(hTreeView,&tvi);
+
+ if (((LPTREEFOLDER)tvi.lParam)->m_nFolderId == folder_id)
+ {
+ res = TreeView_SelectItem(hTreeView,tvi.hItem);
+ SetCurrentFolder((LPTREEFOLDER)tvi.lParam);
+ return;
+ }
+
+ hti_next = TreeView_GetChild(hTreeView,hti);
+ if (hti_next == NULL)
+ {
+ hti_next = TreeView_GetNextSibling(hTreeView,hti);
+ if (hti_next == NULL)
+ {
+ hti_next = TreeView_GetParent(hTreeView,hti);
+ if (hti_next != NULL)
+ hti_next = TreeView_GetNextSibling(hTreeView,hti_next);
+ }
+ }
+ hti = hti_next;
+ }
+
+ // could not find folder to select
+ // make sure we select something
+ tvi.hItem = TreeView_GetRoot(hTreeView);
+ tvi.mask = TVIF_PARAM;
+ res = TreeView_GetItem(hTreeView,&tvi);
+
+ res = TreeView_SelectItem(hTreeView,tvi.hItem);
+ SetCurrentFolder((LPTREEFOLDER)tvi.lParam);
+}
+
+/*
+ * Does this folder have an INI associated with it?
+ * Currently only TRUE for FOLDER_VECTOR and children
+ * of FOLDER_SOURCE.
+ */
+static BOOL FolderHasIni(LPTREEFOLDER lpFolder) {
+ if (FOLDER_VECTOR == lpFolder->m_nFolderId ||
+ FOLDER_VERTICAL == lpFolder->m_nFolderId ||
+ FOLDER_HORIZONTAL == lpFolder->m_nFolderId) {
+ return TRUE;
+ }
+ if (lpFolder->m_nParent != -1
+ && FOLDER_SOURCE == treeFolders[lpFolder->m_nParent]->m_nFolderId) {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/* Add a folder to the list. Does not allocate */
+static BOOL AddFolder(LPTREEFOLDER lpFolder)
+{
+ TREEFOLDER **tmpTree = NULL;
+ UINT oldFolderArrayLength = folderArrayLength;
+ if (numFolders + 1 >= folderArrayLength)
+ {
+ folderArrayLength += 500;
+ tmpTree = (TREEFOLDER **)malloc(sizeof(TREEFOLDER **) * folderArrayLength);
+ memcpy(tmpTree,treeFolders,sizeof(TREEFOLDER **) * oldFolderArrayLength);
+ if (treeFolders) free(treeFolders);
+ treeFolders = tmpTree;
+ }
+
+ /* Is there an folder.ini that can be edited? */
+ if (FolderHasIni(lpFolder)) {
+ lpFolder->m_dwFlags |= F_INIEDIT;
+ }
+
+ treeFolders[numFolders] = lpFolder;
+ numFolders++;
+ return TRUE;
+}
+
+/* Allocate and initialize a NEW TREEFOLDER */
+static LPTREEFOLDER NewFolder(const char *lpTitle, UINT nFolderId, int nParent, UINT nIconId, DWORD dwFlags)
+{
+ LPTREEFOLDER lpFolder = (LPTREEFOLDER)malloc(sizeof(TREEFOLDER));
+ memset(lpFolder, '\0', sizeof (TREEFOLDER));
+ lpFolder->m_lpTitle = (LPSTR)malloc(strlen(lpTitle) + 1);
+ strcpy((char *)lpFolder->m_lpTitle,lpTitle);
+ lpFolder->m_lptTitle = ui_wstring_from_utf8(lpFolder->m_lpTitle);
+ lpFolder->m_lpGameBits = NewBits(driver_list::total());
+ lpFolder->m_nFolderId = nFolderId;
+ lpFolder->m_nParent = nParent;
+ lpFolder->m_nIconId = nIconId;
+ lpFolder->m_dwFlags = dwFlags;
+ return lpFolder;
+}
+
+/* Deallocate the passed in LPTREEFOLDER */
+static void DeleteFolder(LPTREEFOLDER lpFolder)
+{
+ if (lpFolder)
+ {
+ if (lpFolder->m_lpGameBits)
+ {
+ DeleteBits(lpFolder->m_lpGameBits);
+ lpFolder->m_lpGameBits = 0;
+ }
+ free(lpFolder->m_lptTitle);
+ lpFolder->m_lptTitle = 0;
+ free(lpFolder->m_lpTitle);
+ lpFolder->m_lpTitle = 0;
+ free(lpFolder);
+ lpFolder = 0;
+ }
+}
+
+/* Can be called to re-initialize the array of treeFolders */
+BOOL InitFolders(void)
+{
+ int i = 0;
+ DWORD dwFolderFlags;
+ if (treeFolders)
+ {
+ for (i = numFolders - 1; i >= 0; i--)
+ {
+ DeleteFolder(treeFolders[i]);
+ treeFolders[i] = 0;
+ numFolders--;
+ }
+ }
+ numFolders = 0;
+ if (folderArrayLength == 0)
+ {
+ folderArrayLength = 200;
+ treeFolders = (TREEFOLDER **)malloc(sizeof(TREEFOLDER **) * folderArrayLength);
+ if (!treeFolders)
+ {
+ folderArrayLength = 0;
+ return 0;
+ }
+ else
+ memset(treeFolders,'\0', sizeof(TREEFOLDER **) * folderArrayLength);
+ }
+ // built-in top level folders
+ for (i = 0; g_lpFolderData[i].m_lpTitle; i++)
+ {
+ if (RequiredDriverCache() || (!RequiredDriverCache() && !g_lpFolderData[i].m_process))
+ {
+ LPCFOLDERDATA fData = &g_lpFolderData[i];
+ /* get the saved folder flags */
+ dwFolderFlags = GetFolderFlags(numFolders);
+ /* create the folder */
+ AddFolder(NewFolder(fData->m_lpTitle, fData->m_nFolderId, -1, fData->m_nIconId, dwFolderFlags));
+ }
+ }
+
+ numExtraFolders = InitExtraFolders();
+
+ for (i = 0; i < numExtraFolders; i++)
+ {
+ LPEXFOLDERDATA fExData = ExtraFolderData[i];
+ // OR in the saved folder flags
+ dwFolderFlags = fExData->m_dwFlags | GetFolderFlags(numFolders);
+ // create the folder, but if we are building the cache, the name must not be a pre-built one
+ int k = 0;
+ if (RequiredDriverCache())
+ for (int j = 0; g_lpFolderData[j].m_lpTitle; j++)
+ if (strcmp(fExData->m_szTitle, g_lpFolderData[j].m_lpTitle)==0)
+ k++;
+
+ if (k == 0)
+ AddFolder(NewFolder(fExData->m_szTitle,fExData->m_nFolderId,fExData->m_nParent, fExData->m_nIconId,dwFolderFlags));
+ }
+
+// creates child folders of all the top level folders, including custom ones
+ int num_top_level_folders = numFolders;
+
+ for (int i = 0; i < num_top_level_folders; i++)
+ {
+ LPTREEFOLDER lpFolder = treeFolders[i];
+ LPCFOLDERDATA lpFolderData = NULL;
+
+ for (int j = 0; g_lpFolderData[j].m_lpTitle; j++)
+ {
+ if (g_lpFolderData[j].m_nFolderId == lpFolder->m_nFolderId)
+ {
+ lpFolderData = &g_lpFolderData[j];
+ break;
+ }
+ }
+
+ if (lpFolderData)
+ {
+ if (lpFolderData->m_pfnCreateFolders)
+ {
+ if (RequiredDriverCache() && lpFolderData->m_process) // rebuild cache
+ lpFolderData->m_pfnCreateFolders(i);
+ else
+ if (!lpFolderData->m_process) // build every time (CreateDeficiencyFolders)
+ lpFolderData->m_pfnCreateFolders(i);
+ }
+ }
+ else
+ {
+ if ((lpFolder->m_dwFlags & F_CUSTOM) == 0)
+ {
+ dprintf("Internal inconsistency with non-built-in folder, but not custom\n");
+ continue;
+ }
+
+ //dprintf("Loading custom folder %i %i\n",i,lpFolder->m_nFolderId);
+
+ // load the extra folder files, which also adds children
+ if (TryAddExtraFolderAndChildren(i) == FALSE)
+ {
+ lpFolder->m_nFolderId = FOLDER_NONE;
+ }
+ }
+ }
+
+ CreateTreeIcons();
+ ResetWhichGamesInFolders();
+ ResetTreeViewFolders();
+ SelectTreeViewFolder(GetSavedFolderID());
+ LoadFolderFlags();
+ return TRUE;
+}
+
+// create iconlist and Treeview control
+static BOOL CreateTreeIcons()
+{
+ HICON hIcon;
+ INT i;
+ HINSTANCE hInst = GetModuleHandle(0);
+
+ int numIcons = ICON_MAX + numExtraIcons;
+ hTreeSmall = ImageList_Create (16, 16, ILC_COLORDDB | ILC_MASK, numIcons, numIcons);
+
+ //dprintf("Trying to load %i normal icons\n",ICON_MAX);
+ for (i = 0; i < ICON_MAX; i++)
+ {
+ hIcon = LoadIconFromFile(treeIconNames[i].lpName);
+ if (!hIcon)
+ hIcon = LoadIcon(hInst, MAKEINTRESOURCE(treeIconNames[i].nResourceID));
+
+ if (ImageList_AddIcon (hTreeSmall, hIcon) == -1)
+ {
+ ErrorMsg("Error creating icon on regular folder, %i %i",i,hIcon != NULL);
+ return FALSE;
+ }
+ }
+
+ //dprintf("Trying to load %i extra custom-folder icons\n",numExtraIcons);
+ for (i = 0; i < numExtraIcons; i++)
+ {
+ if ((hIcon = LoadIconFromFile(ExtraFolderIcons[i])) == 0)
+ hIcon = LoadIcon (hInst, MAKEINTRESOURCE(IDI_FOLDER));
+
+ if (ImageList_AddIcon(hTreeSmall, hIcon) == -1)
+ {
+ ErrorMsg("Error creating icon on extra folder, %i %i",i,hIcon != NULL);
+ return FALSE;
+ }
+ }
+
+ // Be sure that all the small icons were added.
+ if (ImageList_GetImageCount(hTreeSmall) < numIcons)
+ {
+ ErrorMsg("Error with icon list--too few images. %i %i", ImageList_GetImageCount(hTreeSmall),numIcons);
+ return FALSE;
+ }
+
+ // Be sure that all the small icons were added.
+
+ if (ImageList_GetImageCount (hTreeSmall) < ICON_MAX)
+ {
+ ErrorMsg("Error with icon list--too few images. %i < %i", ImageList_GetImageCount(hTreeSmall),(INT)ICON_MAX);
+ return FALSE;
+ }
+
+ // Associate the image lists with the list view control.
+ (void)TreeView_SetImageList(GetTreeView(), hTreeSmall, TVSIL_NORMAL);
+
+ return TRUE;
+}
+
+
+static void TreeCtrlOnPaint(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ PAINTSTRUCT ps;
+ HDC hDC;
+ RECT rcClip, rcClient;
+ HDC memDC;
+ HBITMAP bitmap;
+ HBITMAP hOldBitmap;
+
+ HBITMAP hBackground = GetBackgroundBitmap();
+ MYBITMAPINFO *bmDesc = GetBackgroundInfo();
+
+ hDC = BeginPaint(hWnd, &ps);
+
+ GetClipBox(hDC, &rcClip);
+ GetClientRect(hWnd, &rcClient);
+
+ // Create a compatible memory DC
+ memDC = CreateCompatibleDC(hDC);
+
+ // Select a compatible bitmap into the memory DC
+ bitmap = CreateCompatibleBitmap(hDC, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top);
+ hOldBitmap = (HBITMAP)SelectObject(memDC, bitmap);
+
+ // First let the control do its default drawing.
+ CallWindowProc(g_lpTreeWndProc, hWnd, uMsg, (WPARAM)memDC, 0);
+
+ // Draw bitmap in the background
+
+ {
+ HPALETTE hPAL;
+ HDC maskDC;
+ HBITMAP maskBitmap;
+ HDC tempDC;
+ HDC imageDC;
+ HBITMAP bmpImage;
+ HBITMAP hOldBmpImage;
+ HBITMAP hOldMaskBitmap;
+ HBITMAP hOldHBitmap;
+ int i, j;
+ RECT rcRoot;
+
+ // Now create a mask
+ maskDC = CreateCompatibleDC(hDC);
+
+ // Create monochrome bitmap for the mask
+ maskBitmap = CreateBitmap(rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, 1, 1, NULL);
+
+ hOldMaskBitmap = (HBITMAP)SelectObject(maskDC, maskBitmap);
+ SetBkColor(memDC, GetSysColor(COLOR_WINDOW));
+
+ // Create the mask from the memory DC
+ BitBlt(maskDC, 0, 0, rcClient.right - rcClient.left,
+ rcClient.bottom - rcClient.top, memDC,
+ rcClient.left, rcClient.top, SRCCOPY);
+
+ tempDC = CreateCompatibleDC(hDC);
+ hOldHBitmap = (HBITMAP)SelectObject(tempDC, hBackground);
+
+ imageDC = CreateCompatibleDC(hDC);
+ bmpImage = CreateCompatibleBitmap(hDC, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top);
+ hOldBmpImage = (HBITMAP)SelectObject(imageDC, bmpImage);
+
+ hPAL = GetBackgroundPalette();
+ if (hPAL == NULL)
+ hPAL = CreateHalftonePalette(hDC);
+
+ if (GetDeviceCaps(hDC, RASTERCAPS) & RC_PALETTE && hPAL != NULL)
+ {
+ SelectPalette(hDC, hPAL, FALSE);
+ RealizePalette(hDC);
+ SelectPalette(imageDC, hPAL, FALSE);
+ }
+
+ // Get x and y offset
+ TreeView_GetItemRect(hWnd, TreeView_GetRoot(hWnd), &rcRoot, FALSE);
+ rcRoot.left = -GetScrollPos(hWnd, SB_HORZ);
+
+ // Draw bitmap in tiled manner to imageDC
+ for (i = rcRoot.left; i < rcClient.right; i += bmDesc->bmWidth)
+ for (j = rcRoot.top; j < rcClient.bottom; j += bmDesc->bmHeight)
+ BitBlt(imageDC, i, j, bmDesc->bmWidth, bmDesc->bmHeight,
+ tempDC, 0, 0, SRCCOPY);
+
+ // Set the background in memDC to black. Using SRCPAINT with black and any other
+ // color results in the other color, thus making black the transparent color
+ SetBkColor(memDC, RGB(0,0,0));
+ SetTextColor(memDC, RGB(255,255,255));
+ BitBlt(memDC, rcClip.left, rcClip.top, rcClip.right - rcClip.left,
+ rcClip.bottom - rcClip.top,
+ maskDC, rcClip.left, rcClip.top, SRCAND);
+
+ // Set the foreground to black. See comment above.
+ SetBkColor(imageDC, RGB(255,255,255));
+ SetTextColor(imageDC, RGB(0,0,0));
+ BitBlt(imageDC, rcClip.left, rcClip.top, rcClip.right - rcClip.left,
+ rcClip.bottom - rcClip.top,
+ maskDC, rcClip.left, rcClip.top, SRCAND);
+
+ // Combine the foreground with the background
+ BitBlt(imageDC, rcClip.left, rcClip.top, rcClip.right - rcClip.left,
+ rcClip.bottom - rcClip.top,
+ memDC, rcClip.left, rcClip.top, SRCPAINT);
+
+ // Draw the final image to the screen
+ BitBlt(hDC, rcClip.left, rcClip.top, rcClip.right - rcClip.left,
+ rcClip.bottom - rcClip.top,
+ imageDC, rcClip.left, rcClip.top, SRCCOPY);
+
+ SelectObject(maskDC, hOldMaskBitmap);
+ SelectObject(tempDC, hOldHBitmap);
+ SelectObject(imageDC, hOldBmpImage);
+
+ DeleteDC(maskDC);
+ DeleteDC(imageDC);
+ DeleteDC(tempDC);
+ DeleteBitmap(bmpImage);
+ DeleteBitmap(maskBitmap);
+
+ if (GetBackgroundPalette() == NULL)
+ {
+ DeletePalette(hPAL);
+ hPAL = NULL;
+ }
+ }
+
+ SelectObject(memDC, hOldBitmap);
+ DeleteBitmap(bitmap);
+ DeleteDC(memDC);
+ EndPaint(hWnd, &ps);
+ ReleaseDC(hWnd, hDC);
+}
+
+/* Header code - Directional Arrows */
+static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ if (GetBackgroundBitmap() != NULL)
+ {
+ switch (uMsg)
+ {
+ case WM_MOUSEMOVE:
+ {
+ if (MouseHasBeenMoved())
+ ShowCursor(TRUE);
+ break;
+ }
+
+ case WM_KEYDOWN :
+ if (wParam == VK_F2)
+ {
+ if (lpCurrentFolder->m_dwFlags & F_CUSTOM)
+ {
+ TreeView_EditLabel(hWnd,TreeView_GetSelection(hWnd));
+ return TRUE;
+ }
+ }
+ break;
+
+ case WM_ERASEBKGND:
+ return TRUE;
+
+ case WM_PAINT:
+ TreeCtrlOnPaint(hWnd, uMsg, wParam, lParam);
+ UpdateWindow(hWnd);
+ break;
+ }
+ }
+
+ /* message not handled */
+ return CallWindowProc(g_lpTreeWndProc, hWnd, uMsg, wParam, lParam);
+}
+
+/*
+ * Filter code - should be moved to filter.c/filter.h
+ * Added 01/09/99 - MSH <mhaaland@hypertech.com>
+ */
+
+/* find a FOLDERDATA by folderID */
+LPCFOLDERDATA FindFilter(DWORD folderID)
+{
+ int i;
+
+ for (i = 0; g_lpFolderData[i].m_lpTitle; i++)
+ {
+ if (g_lpFolderData[i].m_nFolderId == folderID)
+ return &g_lpFolderData[i];
+ }
+ return (LPFOLDERDATA) 0;
+}
+
+
+LPTREEFOLDER GetFolderByName(int nParentId, const char *pszFolderName)
+{
+ int i = 0, nParent;
+
+ //First Get the Parent TreeviewItem
+ //Enumerate Children
+ for(i = 0; i < numFolders/* ||treeFolders[i] != NULL*/; i++)
+ {
+ if (!strcmp(treeFolders[i]->m_lpTitle, pszFolderName))
+ {
+ nParent = treeFolders[i]->m_nParent;
+ if ((nParent >= 0) && treeFolders[nParent]->m_nFolderId == nParentId)
+ return treeFolders[i];
+ }
+ }
+ return NULL;
+}
+
+static int InitExtraFolders(void)
+{
+ struct stat stat_buffer;
+ struct _finddata_t files;
+ int i, count = 0;
+ char* ext;
+ char buf[256];
+ char curdir[MAX_PATH];
+ const std::string t = GetFolderDir();
+ const char *dir = t.c_str();
+ memset(ExtraFolderData, 0, (MAX_EXTRA_FOLDERS * MAX_EXTRA_SUBFOLDERS)* sizeof(LPEXFOLDERDATA));
+
+ /* NPW 9-Feb-2003 - MSVC stat() doesn't like stat() called with an empty string */
+ if (!dir)
+ dir = ".";
+
+ // Why create the directory if it doesn't exist, just return 0 folders.
+ if (stat(dir, &stat_buffer) != 0)
+ return 0; // _mkdir(dir);
+
+ _getcwd(curdir, MAX_PATH);
+
+ chdir(dir);
+
+ long hLong = _findfirst("*", &files);
+
+ for (i = 0; i < MAX_EXTRA_FOLDERS; i++)
+ ExtraFolderIcons[i] = NULL;
+
+ numExtraIcons = 0;
+
+ while (!_findnext(hLong, &files))
+ {
+ if ((files.attrib & _A_SUBDIR) == 0)
+ {
+ FILE *fp;
+
+ fp = fopen(files.name, "r");
+ if (fp != NULL)
+ {
+ int icon[2] = { 0, 0 };
+ char *p, *name;
+
+ while (fgets(buf, 256, fp))
+ {
+ if (buf[0] == '[')
+ {
+ p = strchr(buf, ']');
+ if (p == NULL)
+ continue;
+
+ *p = '\0';
+ name = &buf[1];
+ if (!strcmp(name, "FOLDER_SETTINGS"))
+ {
+ while (fgets(buf, 256, fp))
+ {
+ name = strtok(buf, " =\r\n");
+ if (name == NULL)
+ break;
+
+ if (!strcmp(name, "RootFolderIcon"))
+ {
+ name = strtok(NULL, " =\r\n");
+ if (name != NULL)
+ SetExtraIcons(name, &icon[0]);
+ }
+ if (!strcmp(name, "SubFolderIcon"))
+ {
+ name = strtok(NULL, " =\r\n");
+ if (name != NULL)
+ SetExtraIcons(name, &icon[1]);
+ }
+ }
+ break;
+ }
+ }
+ }
+ fclose(fp);
+
+ strcpy(buf, files.name);
+ ext = strrchr(buf, '.');
+
+ if (ext && *(ext + 1) && !core_stricmp(ext + 1, "ini"))
+ {
+ ExtraFolderData[count] =(EXFOLDERDATA*) malloc(sizeof(EXFOLDERDATA));
+ if (ExtraFolderData[count])
+ {
+ *ext = '\0';
+
+ memset(ExtraFolderData[count], 0, sizeof(EXFOLDERDATA));
+
+ strncpy(ExtraFolderData[count]->m_szTitle, buf, 63);
+ ExtraFolderData[count]->m_nFolderId = next_folder_id++;
+ ExtraFolderData[count]->m_nParent = -1;
+ ExtraFolderData[count]->m_dwFlags = F_CUSTOM;
+ ExtraFolderData[count]->m_nIconId = icon[0] ? -icon[0] : IDI_FOLDER;
+ ExtraFolderData[count]->m_nSubIconId = icon[1] ? -icon[1] : IDI_FOLDER;
+ //dprintf("extra folder with icon %i, subicon %i\n",
+ //ExtraFolderData[count]->m_nIconId,
+ //ExtraFolderData[count]->m_nSubIconId);
+ count++;
+ }
+ }
+ }
+ }
+ }
+
+ chdir(curdir);
+ return count;
+}
+
+void FreeExtraFolders(void)
+{
+ int i;
+
+ for (i = 0; i < numExtraFolders; i++)
+ {
+ if (ExtraFolderData[i])
+ {
+ free(ExtraFolderData[i]);
+ ExtraFolderData[i] = NULL;
+ }
+ }
+
+ for (i = 0; i < numExtraIcons; i++)
+ {
+ free(ExtraFolderIcons[i]);
+ }
+
+ numExtraIcons = 0;
+
+}
+
+
+static void SetExtraIcons(char *name, int *id)
+{
+ char *p = strchr(name, '.');
+
+ if (p != NULL)
+ *p = '\0';
+
+ ExtraFolderIcons[numExtraIcons] = (char*)malloc(strlen(name) + 1);
+ if (ExtraFolderIcons[numExtraIcons])
+ {
+ *id = ICON_MAX + numExtraIcons;
+ strcpy(ExtraFolderIcons[numExtraIcons], name);
+ numExtraIcons++;
+ }
+}
+
+
+// Called to add child folders of the top level extra folders already created
+BOOL TryAddExtraFolderAndChildren(int parent_index)
+{
+ FILE* fp = NULL;
+ char fname[MAX_PATH];
+ char readbuf[256];
+ char* p;
+ char* name;
+ int id, current_id, i;
+ LPTREEFOLDER lpTemp = NULL;
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+
+ current_id = lpFolder->m_nFolderId;
+
+ id = lpFolder->m_nFolderId - MAX_FOLDERS;
+
+ /* "folder\title.ini" */
+
+ const std::string t = GetFolderDir();
+ sprintf( fname, "%s\\%s.ini", t.c_str(), ExtraFolderData[id]->m_szTitle);
+
+ fp = fopen(fname, "r");
+ if (fp == NULL)
+ return FALSE;
+
+ while ( fgets(readbuf, 256, fp) )
+ {
+ /* do we have [...] ? */
+
+ if (readbuf[0] == '[')
+ {
+ p = strchr(readbuf, ']');
+ if (p == NULL)
+ {
+ continue;
+ }
+
+ *p = '\0';
+ name = &readbuf[1];
+
+ /* is it [FOLDER_SETTINGS]? */
+
+ if (strcmp(name, "FOLDER_SETTINGS") == 0)
+ {
+ current_id = -1;
+ continue;
+ }
+ else
+ {
+ /* it it [ROOT_FOLDER]? */
+
+ if (!strcmp(name, "ROOT_FOLDER"))
+ {
+ current_id = lpFolder->m_nFolderId;
+ lpTemp = lpFolder;
+
+ }
+ else
+ {
+ /* must be [folder name] */
+
+ current_id = next_folder_id++;
+ /* create a new folder with this name,
+ and the flags for this folder as read from the registry */
+ lpTemp = NewFolder(name,current_id,parent_index,
+ ExtraFolderData[id]->m_nSubIconId,
+ GetFolderFlags(numFolders) | F_CUSTOM);
+ ExtraFolderData[current_id] = (EXFOLDERDATA*)malloc(sizeof(EXFOLDERDATA));
+ memset(ExtraFolderData[current_id], 0, sizeof(EXFOLDERDATA));
+
+ ExtraFolderData[current_id]->m_nFolderId = current_id - MAX_EXTRA_FOLDERS;
+ ExtraFolderData[current_id]->m_nIconId = ExtraFolderData[id]->m_nSubIconId;
+ ExtraFolderData[current_id]->m_nParent = ExtraFolderData[id]->m_nFolderId;
+ ExtraFolderData[current_id]->m_nSubIconId = -1;
+ strcpy( ExtraFolderData[current_id]->m_szTitle, name );
+ ExtraFolderData[current_id]->m_dwFlags = ExtraFolderData[id]->m_dwFlags;
+ AddFolder(lpTemp);
+ }
+ }
+ }
+ else if (current_id != -1)
+ {
+ /* string on a line by itself -- game name */
+
+ name = strtok(readbuf, " \t\r\n");
+ if (name == NULL)
+ {
+ current_id = -1;
+ continue;
+ }
+
+ /* IMPORTANT: This assumes that all driver names are lowercase! */
+ for (i = 0; name[i]; i++)
+ name[i] = tolower(name[i]);
+
+ if (lpTemp == NULL)
+ {
+ ErrorMsg("Error parsing %s: missing [folder name] or [ROOT_FOLDER]", fname);
+ current_id = lpFolder->m_nFolderId;
+ lpTemp = lpFolder;
+ }
+ AddGame(lpTemp,GetGameNameIndex(name));
+ }
+ }
+
+ if ( fp )
+ {
+ fclose( fp );
+ }
+
+ return TRUE;
+}
+
+
+void GetFolders(TREEFOLDER ***folders,int *num_folders)
+{
+ *folders = treeFolders;
+ *num_folders = numFolders;
+}
+
+static BOOL TryRenameCustomFolderIni(LPTREEFOLDER lpFolder,const char *old_name,const char *new_name)
+{
+ char filename[MAX_PATH];
+ char new_filename[MAX_PATH];
+ LPTREEFOLDER lpParent = NULL;
+ if (lpFolder->m_nParent >= 0)
+ {
+ //it is a custom SubFolder
+ lpParent = GetFolder( lpFolder->m_nParent );
+ if( lpParent )
+ {
+ snprintf(filename,ARRAY_LENGTH(filename),"%s\\%s\\%s.ini",GetIniDir(),lpParent->m_lpTitle, old_name );
+ snprintf(new_filename,ARRAY_LENGTH(new_filename),"%s\\%s\\%s.ini",GetIniDir(),lpParent->m_lpTitle, new_name );
+ win_move_file_utf8(filename,new_filename);
+ }
+ }
+ else
+ {
+ //Rename the File, if it exists
+ snprintf(filename,ARRAY_LENGTH(filename),"%s\\%s.ini",GetIniDir(),old_name );
+ snprintf(new_filename,ARRAY_LENGTH(new_filename),"%s\\%s.ini",GetIniDir(), new_name );
+ win_move_file_utf8(filename,new_filename);
+ //Rename the Directory, if it exists
+ snprintf(filename,ARRAY_LENGTH(filename),"%s\\%s",GetIniDir(),old_name );
+ snprintf(new_filename,ARRAY_LENGTH(new_filename),"%s\\%s",GetIniDir(), new_name );
+ win_move_file_utf8(filename,new_filename);
+ }
+ return TRUE;
+}
+
+BOOL TryRenameCustomFolder(LPTREEFOLDER lpFolder, const char *new_name)
+{
+ BOOL retval;
+ char filename[MAX_PATH];
+ char new_filename[MAX_PATH];
+
+ if (lpFolder->m_nParent >= 0)
+ {
+ // a child extra folder was renamed, so do the rename and save the parent
+
+ // save old title
+ char *old_title = lpFolder->m_lpTitle;
+
+ // set new title
+ lpFolder->m_lpTitle = (char *)malloc(strlen(new_name) + 1);
+ strcpy(lpFolder->m_lpTitle,new_name);
+
+ // try to save
+ if (TrySaveExtraFolder(lpFolder) == FALSE)
+ {
+ // failed, so free newly allocated title and restore old
+ free(lpFolder->m_lpTitle);
+ lpFolder->m_lpTitle = old_title;
+ return FALSE;
+ }
+ TryRenameCustomFolderIni(lpFolder, old_title, new_name);
+ // successful, so free old title
+ free(old_title);
+ return TRUE;
+ }
+
+ // a parent extra folder was renamed, so rename the file
+
+ const std::string t = GetFolderDir();
+ snprintf(new_filename,ARRAY_LENGTH(new_filename),"%s\\%s.ini", t.c_str(), new_name);
+ snprintf(filename,ARRAY_LENGTH(filename),"%s\\%s.ini", t.c_str(), lpFolder->m_lpTitle);
+
+ retval = win_move_file_utf8(filename,new_filename);
+
+ if (retval)
+ {
+ TryRenameCustomFolderIni(lpFolder, lpFolder->m_lpTitle, new_name);
+ free(lpFolder->m_lpTitle);
+ lpFolder->m_lpTitle = (char *)malloc(strlen(new_name) + 1);
+ strcpy(lpFolder->m_lpTitle,new_name);
+ }
+ else
+ {
+ char buf[500];
+ snprintf(buf,ARRAY_LENGTH(buf),"Error while renaming custom file %s to %s", filename,new_filename);
+ win_message_box_utf8(GetMainWindow(), buf, MAMEUINAME, MB_OK | MB_ICONERROR);
+ }
+ return retval;
+}
+
+void AddToCustomFolder(LPTREEFOLDER lpFolder,int driver_index)
+{
+ if ((lpFolder->m_dwFlags & F_CUSTOM) == 0)
+ {
+ win_message_box_utf8(GetMainWindow(),"Unable to add game to non-custom folder",
+ MAMEUINAME,MB_OK | MB_ICONERROR);
+ return;
+ }
+
+ if (TestBit(lpFolder->m_lpGameBits,driver_index) == 0)
+ {
+ AddGame(lpFolder,driver_index);
+ if (TrySaveExtraFolder(lpFolder) == FALSE)
+ RemoveGame(lpFolder,driver_index); // undo on error
+ }
+}
+
+void RemoveFromCustomFolder(LPTREEFOLDER lpFolder,int driver_index)
+{
+ if ((lpFolder->m_dwFlags & F_CUSTOM) == 0)
+ {
+ win_message_box_utf8(GetMainWindow(),"Unable to remove game from non-custom folder",
+ MAMEUINAME,MB_OK | MB_ICONERROR);
+ return;
+ }
+
+ if (TestBit(lpFolder->m_lpGameBits,driver_index) != 0)
+ {
+ RemoveGame(lpFolder,driver_index);
+ if (TrySaveExtraFolder(lpFolder) == FALSE)
+ AddGame(lpFolder,driver_index); // undo on error
+ }
+}
+
+BOOL TrySaveExtraFolder(LPTREEFOLDER lpFolder)
+{
+ char fname[MAX_PATH];
+ FILE *fp;
+ BOOL error = FALSE;
+ int i,j;
+
+ LPTREEFOLDER root_folder = NULL;
+ LPEXFOLDERDATA extra_folder = NULL;
+
+ for (i=0;i<numExtraFolders;i++)
+ {
+ if (ExtraFolderData[i]->m_nFolderId == lpFolder->m_nFolderId)
+ {
+ root_folder = lpFolder;
+ extra_folder = ExtraFolderData[i];
+ break;
+ }
+
+ if (lpFolder->m_nParent >= 0 &&
+ ExtraFolderData[i]->m_nFolderId == treeFolders[lpFolder->m_nParent]->m_nFolderId)
+ {
+ root_folder = treeFolders[lpFolder->m_nParent];
+ extra_folder = ExtraFolderData[i];
+ break;
+ }
+ }
+
+ if (extra_folder == NULL || root_folder == NULL)
+ {
+ MessageBox(GetMainWindow(), TEXT("Error finding custom file name to save"), (LPCTSTR)MAMEUINAME, MB_OK | MB_ICONERROR);
+ return FALSE;
+ }
+ /* "folder\title.ini" */
+
+ const std::string t = GetFolderDir();
+ snprintf( fname, sizeof(fname), "%s\\%s.ini", t.c_str(), extra_folder->m_szTitle);
+
+ fp = fopen(fname, "wt");
+ if (fp == NULL)
+ error = TRUE;
+ else
+ {
+ TREEFOLDER *folder_data;
+
+
+ fprintf(fp,"[FOLDER_SETTINGS]\n");
+ // negative values for icons means it's custom, so save 'em
+ if (extra_folder->m_nIconId < 0)
+ {
+ fprintf(fp, "RootFolderIcon %s\n", ExtraFolderIcons[(-extra_folder->m_nIconId) - ICON_MAX]);
+ }
+ if (extra_folder->m_nSubIconId < 0)
+ {
+ fprintf(fp,"SubFolderIcon %s\n", ExtraFolderIcons[(-extra_folder->m_nSubIconId) - ICON_MAX]);
+ }
+
+ /* need to loop over all our TREEFOLDERs--first the root one, then each child.
+ start with the root */
+
+ folder_data = root_folder;
+
+ fprintf(fp,"\n[ROOT_FOLDER]\n");
+
+ for (i=0;i<driver_list::total();i++)
+ {
+ if (TestBit(folder_data->m_lpGameBits, i))
+ {
+ fprintf(fp,"%s\n",driver_list::driver(i).name);
+ }
+ }
+
+ /* look through the custom folders for ones with our root as parent */
+ for (j=0;j<numFolders;j++)
+ {
+ folder_data = treeFolders[j];
+
+ if (folder_data->m_nParent >= 0 &&
+ treeFolders[folder_data->m_nParent] == root_folder)
+ {
+ fprintf(fp,"\n[%s]\n",folder_data->m_lpTitle);
+
+ for (i=0;i<driver_list::total();i++)
+ {
+ if (TestBit(folder_data->m_lpGameBits, i))
+ {
+ fprintf(fp,"%s\n",driver_list::driver(i).name);
+ }
+ }
+ }
+ }
+ if (fclose(fp) != 0)
+ error = TRUE;
+ }
+
+ if (error)
+ {
+ char buf[500];
+ snprintf(buf,ARRAY_LENGTH(buf),"Error while saving custom file %s",fname);
+ win_message_box_utf8(GetMainWindow(), buf, MAMEUINAME, MB_OK | MB_ICONERROR);
+ }
+ return !error;
+}
+
+HIMAGELIST GetTreeViewIconList(void)
+{
+ return hTreeSmall;
+}
+
+int GetTreeViewIconIndex(int icon_id)
+{
+ int i;
+
+ if (icon_id < 0)
+ return -icon_id;
+
+ for (i = 0; i < ARRAY_LENGTH(treeIconNames); i++)
+ {
+ if (icon_id == treeIconNames[i].nResourceID)
+ return i;
+ }
+
+ return -1;
+}
+
+static void SaveExternalFolders(int parent_index, const char *fname)
+{
+ string val = GetFolderDir();
+ char s[val.size()+1];
+ strcpy(s, val.c_str());
+ char *fdir = strtok(s, ";"); // get first dir
+
+ // create directory if needed
+ wchar_t *temp = ui_wstring_from_utf8(fdir);
+ BOOL res = CreateDirectory(temp, NULL);
+ free(temp);
+ if (!res)
+ {
+ if (GetLastError() == ERROR_PATH_NOT_FOUND)
+ {
+ printf("SaveExternalFolders: Unable to create the directory \"%s\".\n",fdir);
+ return;
+ }
+ }
+
+ // create/truncate file
+ string filename = fdir + string("\\") + fname + string(".ini");
+ FILE *f = fopen(filename.c_str(), "w");
+ if (f == NULL)
+ {
+ printf("SaveExternalFolders: Unable to open file %s for writing.\n",filename.c_str());
+ return;
+ }
+
+ // Populate the file
+ fprintf(f, "[FOLDER_SETTINGS]\n");
+ fprintf(f, "RootFolderIcon custom\n");
+ fprintf(f, "SubFolderIcon custom\n");
+
+ /* need to loop over all our TREEFOLDERs--first the root one, then each child.
+ start with the root */
+ LPTREEFOLDER lpFolder = treeFolders[parent_index];
+ TREEFOLDER *folder_data = lpFolder;
+ fprintf(f, "\n[ROOT_FOLDER]\n");
+
+ int i;
+ for (i = 0; i < driver_list::total(); i++)
+ {
+ if (TestBit(folder_data->m_lpGameBits, i))
+ fprintf(f, "%s\n", GetGameName(i).c_str());
+ }
+
+ /* look through the custom folders for ones with our root as parent */
+ for (int jj = 0; jj < numFolders; jj++)
+ {
+ folder_data = treeFolders[jj];
+
+ if (folder_data->m_nParent >= 0 && treeFolders[folder_data->m_nParent] == lpFolder)
+ {
+ fprintf(f, "\n[%s]\n", folder_data->m_lpTitle);
+
+ for (i = 0; i < driver_list::total(); i++)
+ {
+ if (TestBit(folder_data->m_lpGameBits, i))
+ fprintf(f, "%s\n", GetGameName(i).c_str());
+ }
+ }
+ }
+
+ fclose(f);
+ printf("SaveExternalFolders: Saved file %s.\n",filename.c_str());
+}
+
+/* End of source file */
diff --git a/docs/release/src/osd/winui/treeview.h b/docs/release/src/osd/winui/treeview.h
new file mode 100644
index 00000000000..0ea08fb592c
--- /dev/null
+++ b/docs/release/src/osd/winui/treeview.h
@@ -0,0 +1,212 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+// NOTE: ifdef MESS doesn't work here
+#ifndef TREEVIEW_H
+#define TREEVIEW_H
+
+/* corrections for commctrl.h */
+
+#if defined(__GNUC__)
+/* fix warning: cast does not match function type */
+#undef TreeView_InsertItem
+#define TreeView_InsertItem(w,i) (HTREEITEM)(LRESULT)(int)SendMessage((w),TVM_INSERTITEM,0,(LPARAM)(LPTV_INSERTSTRUCT)(i))
+
+#undef TreeView_SetImageList
+#define TreeView_SetImageList(w,h,i) (HIMAGELIST)(LRESULT)(int)SendMessage((w),TVM_SETIMAGELIST,i,(LPARAM)(HIMAGELIST)(h))
+
+#undef TreeView_GetNextItem
+#define TreeView_GetNextItem(w,i,c) (HTREEITEM)(LRESULT)(int)SendMessage((w),TVM_GETNEXTITEM,c,(LPARAM)(HTREEITEM)(i))
+
+#undef TreeView_HitTest
+#define TreeView_HitTest(hwnd, lpht) \
+ (HTREEITEM)(LRESULT)(int)SNDMSG((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht))
+
+/* fix wrong return type */
+#undef TreeView_Select
+#define TreeView_Select(w,i,c) (BOOL)(int)SendMessage((w),TVM_SELECTITEM,c,(LPARAM)(HTREEITEM)(i))
+
+#undef TreeView_EditLabel
+#define TreeView_EditLabel(w, i) \
+ SNDMSG(w,TVM_EDITLABEL,0,(LPARAM)(i))
+
+#endif /* defined(__GNUC__) */
+#include "bitmask.h"
+#include <stdint.h>
+
+/***************************************************************************
+ Folder And Filter Definitions
+ ***************************************************************************/
+
+typedef struct
+{
+ const char *m_lpTitle; // Folder Title
+ const char *short_name; // for saving in the .ini
+ UINT m_nFolderId; // ID
+ UINT m_nIconId; // if >= 0, resource id of icon (IDI_xxx), otherwise index in image list
+ DWORD m_dwUnset; // Excluded filters
+ DWORD m_dwSet; // Implied filters
+ BOOL m_process; // 1 = process only if rebuilding the cache
+ void (*m_pfnCreateFolders)(int parent_index); // Constructor for special folders
+ BOOL (*m_pfnQuery)(uint32_t nDriver); // Query function
+ BOOL m_bExpectedResult; // Expected query result
+} FOLDERDATA, *LPFOLDERDATA;
+
+typedef const FOLDERDATA *LPCFOLDERDATA;
+
+typedef struct
+{
+ DWORD m_dwFilterType; /* Filter value */
+ DWORD m_dwCtrlID; /* Control ID that represents it */
+ BOOL (*m_pfnQuery)(uint32_t nDriver); /* Query function */
+ BOOL m_bExpectedResult; /* Expected query result */
+} FILTER_ITEM, *LPFILTER_ITEM;
+
+typedef const FILTER_ITEM *LPCFILTER_ITEM;
+
+/***************************************************************************
+ Functions to build builtin folder lists
+ ***************************************************************************/
+
+void CreateManufacturerFolders(int parent_index);
+void CreateYearFolders(int parent_index);
+void CreateSourceFolders(int parent_index);
+void CreateScreenFolders(int parent_index);
+void CreateResolutionFolders(int parent_index);
+void CreateFPSFolders(int parent_index);
+void CreateBIOSFolders(int parent_index);
+void CreateCPUFolders(int parent_index);
+void CreateSoundFolders(int parent_index);
+void CreateOrientationFolders(int parent_index);
+void CreateDeficiencyFolders(int parent_index);
+void CreateDumpingFolders(int parent_index);
+
+/***************************************************************************/
+
+#define MAX_EXTRA_FOLDERS 256
+#define MAX_EXTRA_SUBFOLDERS 256
+
+/* TreeView structures */
+enum
+{
+ FOLDER_NONE = 0,
+ FOLDER_ALLGAMES,
+ FOLDER_AVAILABLE,
+ FOLDER_BIOS,
+ FOLDER_CLONES,
+ FOLDER_COMPUTER,
+ FOLDER_CONSOLE,
+ FOLDER_CPU,
+ FOLDER_DEFICIENCY,
+ FOLDER_DUMPING,
+ FOLDER_FPS,
+ FOLDER_HARDDISK,
+ FOLDER_HORIZONTAL,
+ FOLDER_LIGHTGUN,
+ FOLDER_MANUFACTURER,
+ FOLDER_MECHANICAL,
+ FOLDER_MODIFIED,
+ FOLDER_MOUSE,
+ FOLDER_NONMECHANICAL,
+ FOLDER_NONWORKING,
+ FOLDER_ORIGINAL,
+ FOLDER_RASTER,
+ FOLDER_RESOLUTION,
+ FOLDER_SAMPLES,
+ FOLDER_SAVESTATE,
+ FOLDER_SCREENS,
+ FOLDER_SND,
+ FOLDER_SOURCE,
+ FOLDER_STEREO,
+ FOLDER_TRACKBALL,
+ FOLDER_UNAVAILABLE,
+ FOLDER_VECTOR,
+ FOLDER_VERTICAL,
+ FOLDER_WORKING,
+ FOLDER_YEAR,
+ MAX_FOLDERS,
+};
+
+typedef enum
+{
+ F_CLONES = 0x00000001,
+ F_NONWORKING = 0x00000002,
+ F_UNAVAILABLE = 0x00000004,
+ F_VECTOR = 0x00000008,
+ F_RASTER = 0x00000010,
+ F_ORIGINALS = 0x00000020,
+ F_WORKING = 0x00000040,
+ F_AVAILABLE = 0x00000080,
+ F_HORIZONTAL = 0x00000100,
+ F_VERTICAL = 0x00000200,
+ F_MECHANICAL = 0x00000400,
+ F_ARCADE = 0x00000800,
+ F_MESS = 0x00001000,
+ F_COMPUTER = 0x00002000,
+ F_CONSOLE = 0x00004000,
+ F_MODIFIED = 0x00008000,
+ F_MASK = 0x0000FFFF,
+ F_INIEDIT = 0x00010000, // There is an .ini that can be edited. MSH 20070811
+ F_CUSTOM = 0x01000000 // for current .ini custom folders
+} FOLDERFLAG;
+
+typedef struct
+{
+ LPSTR m_lpTitle; // String contains the folder name
+ LPTSTR m_lptTitle; // String contains the folder name as TCHAR*
+ UINT m_nFolderId; // Index / Folder ID number
+ int m_nParent; // Parent folder index in treeFolders[]
+ int m_nIconId; // negative icon index into the ImageList, or IDI_xxx resource id
+ DWORD m_dwFlags; // Misc flags
+ LPBITS m_lpGameBits; // Game bits, represent game indices
+} TREEFOLDER, *LPTREEFOLDER;
+
+typedef struct
+{
+ char m_szTitle[64]; // Folder Title
+ UINT m_nFolderId; // ID
+ int m_nParent; // Parent Folder index in treeFolders[]
+ DWORD m_dwFlags; // Flags - Customisable and Filters
+ int m_nIconId; // negative icon index into the ImageList, or IDI_xxx resource id
+ int m_nSubIconId; // negative icon index into the ImageList, or IDI_xxx resource id
+} EXFOLDERDATA, *LPEXFOLDERDATA;
+
+void FreeFolders(void);
+void ResetFilters(void);
+void InitTree(LPCFOLDERDATA lpFolderData, LPCFILTER_ITEM lpFilterList);
+void SetCurrentFolder(LPTREEFOLDER lpFolder);
+UINT GetCurrentFolderID(void);
+
+LPTREEFOLDER GetCurrentFolder(void);
+int GetNumFolders(void);
+LPTREEFOLDER GetFolder(UINT nFolder);
+LPTREEFOLDER GetFolderByID(UINT nID);
+LPTREEFOLDER GetFolderByName(int nParentId, const char *pszFolderName);
+
+void AddGame(LPTREEFOLDER lpFolder, UINT nGame);
+void RemoveGame(LPTREEFOLDER lpFolder, UINT nGame);
+int FindGame(LPTREEFOLDER lpFolder, int nGame);
+
+void ResetWhichGamesInFolders(void);
+
+LPCFOLDERDATA FindFilter(DWORD folderID);
+
+BOOL GameFiltered(int nGame, DWORD dwFlags);
+BOOL GetParentFound(int nGame);
+
+LPCFILTER_ITEM GetFilterList(void);
+
+void SetTreeIconSize(HWND hWnd, BOOL bLarge);
+BOOL GetTreeIconSize(void);
+
+void GetFolders(TREEFOLDER ***folders,int *num_folders);
+BOOL TryRenameCustomFolder(LPTREEFOLDER lpFolder,const char *new_name);
+void AddToCustomFolder(LPTREEFOLDER lpFolder,int driver_index);
+void RemoveFromCustomFolder(LPTREEFOLDER lpFolder,int driver_index);
+
+HIMAGELIST GetTreeViewIconList(void);
+int GetTreeViewIconIndex(int icon_id);
+
+void ResetTreeViewFolders(void);
+void SelectTreeViewFolder(int folder_id);
+
+#endif /* TREEVIEW_H */
diff --git a/docs/release/src/osd/winui/ui_opts.h b/docs/release/src/osd/winui/ui_opts.h
new file mode 100644
index 00000000000..6b222712995
--- /dev/null
+++ b/docs/release/src/osd/winui/ui_opts.h
@@ -0,0 +1,396 @@
+// For licensing and usage information, read docs/winui_license.txt
+// MASTER
+//****************************************************************************
+
+#ifndef WINUI_UIOPTS_H
+#define WINUI_UIOPTS_H
+
+#define MUIOPTION_OVERRIDE_REDX "override_redx"
+#define MUIOPTION_LIST_MODE "list_mode"
+#define MUIOPTION_CHECK_GAME "check_game"
+#define MUIOPTION_JOYSTICK_IN_INTERFACE "joystick_in_interface"
+#define MUIOPTION_KEYBOARD_IN_INTERFACE "keyboard_in_interface"
+#define MUIOPTION_CYCLE_SCREENSHOT "cycle_screenshot"
+#define MUIOPTION_STRETCH_SCREENSHOT_LARGER "stretch_screenshot_larger"
+#define MUIOPTION_SCREENSHOT_BORDER_SIZE "screenshot_bordersize"
+#define MUIOPTION_SCREENSHOT_BORDER_COLOR "screenshot_bordercolor"
+#define MUIOPTION_INHERIT_FILTER "inherit_filter"
+#define MUIOPTION_OFFSET_CLONES "offset_clones"
+#define MUIOPTION_DEFAULT_FOLDER_ID "default_folder_id"
+#define MUIOPTION_HIDE_FOLDERS "hide_folders"
+#define MUIOPTION_SHOW_STATUS_BAR "show_status_bar"
+#define MUIOPTION_SHOW_TABS "show_tabs"
+#define MUIOPTION_SHOW_TOOLBAR "show_tool_bar"
+#define MUIOPTION_CURRENT_TAB "current_tab"
+#define MUIOPTION_WINDOW_X "window_x"
+#define MUIOPTION_WINDOW_Y "window_y"
+#define MUIOPTION_WINDOW_WIDTH "window_width"
+#define MUIOPTION_WINDOW_HEIGHT "window_height"
+#define MUIOPTION_WINDOW_STATE "window_state"
+#define MUIOPTION_WINDOW_PANES "window_panes"
+#define MUIOPTION_CUSTOM_COLOR "custom_color"
+#define MUIOPTION_LIST_FONT "list_font"
+#define MUIOPTION_TEXT_COLOR "text_color"
+#define MUIOPTION_CLONE_COLOR "clone_color"
+#define MUIOPTION_HIDE_TABS "hide_tabs"
+#define MUIOPTION_HISTORY_TAB "history_tab"
+#define MUIOPTION_COLUMN_WIDTHS "column_widths"
+#define MUIOPTION_COLUMN_ORDER "column_order"
+#define MUIOPTION_COLUMN_SHOWN "column_shown"
+#define MUIOPTION_SPLITTERS "splitters"
+#define MUIOPTION_SORT_COLUMN "sort_column"
+#define MUIOPTION_SORT_REVERSED "sort_reversed"
+#define MUIOPTION_ICONS_DIRECTORY "icons_directory"
+#define MUIOPTION_BACKGROUND_DIRECTORY "background_directory"
+#define MUIOPTION_DATS_DIRECTORY "dats_directory"
+#define MUIOPTION_VIDEO_DIRECTORY "video_directory"
+#define MUIOPTION_MANUALS_DIRECTORY "manuals_directory"
+#define MUIOPTION_UI_KEY_UP "ui_key_up"
+#define MUIOPTION_UI_KEY_DOWN "ui_key_down"
+#define MUIOPTION_UI_KEY_LEFT "ui_key_left"
+#define MUIOPTION_UI_KEY_RIGHT "ui_key_right"
+#define MUIOPTION_UI_KEY_START "ui_key_start"
+#define MUIOPTION_UI_KEY_PGUP "ui_key_pgup"
+#define MUIOPTION_UI_KEY_PGDWN "ui_key_pgdwn"
+#define MUIOPTION_UI_KEY_HOME "ui_key_home"
+#define MUIOPTION_UI_KEY_END "ui_key_end"
+#define MUIOPTION_UI_KEY_SS_CHANGE "ui_key_ss_change"
+#define MUIOPTION_UI_KEY_HISTORY_UP "ui_key_history_up"
+#define MUIOPTION_UI_KEY_HISTORY_DOWN "ui_key_history_down"
+#define MUIOPTION_UI_KEY_CONTEXT_FILTERS "ui_key_context_filters"
+#define MUIOPTION_UI_KEY_SELECT_RANDOM "ui_key_select_random"
+#define MUIOPTION_UI_KEY_GAME_AUDIT "ui_key_game_audit"
+#define MUIOPTION_UI_KEY_GAME_PROPERTIES "ui_key_game_properties"
+#define MUIOPTION_UI_KEY_HELP_CONTENTS "ui_key_help_contents"
+#define MUIOPTION_UI_KEY_UPDATE_GAMELIST "ui_key_update_gamelist"
+#define MUIOPTION_UI_KEY_VIEW_FOLDERS "ui_key_view_folders"
+#define MUIOPTION_UI_KEY_VIEW_FULLSCREEN "ui_key_view_fullscreen"
+#define MUIOPTION_UI_KEY_VIEW_PAGETAB "ui_key_view_pagetab"
+#define MUIOPTION_UI_KEY_VIEW_PICTURE_AREA "ui_key_view_picture_area"
+#define MUIOPTION_UI_KEY_VIEW_STATUS "ui_key_view_status"
+#define MUIOPTION_UI_KEY_VIEW_TOOLBARS "ui_key_view_toolbars"
+#define MUIOPTION_UI_KEY_VIEW_TAB_CABINET "ui_key_view_tab_cabinet"
+#define MUIOPTION_UI_KEY_VIEW_TAB_CPANEL "ui_key_view_tab_cpanel"
+#define MUIOPTION_UI_KEY_VIEW_TAB_FLYER "ui_key_view_tab_flyer"
+#define MUIOPTION_UI_KEY_VIEW_TAB_HISTORY "ui_key_view_tab_history"
+#define MUIOPTION_UI_KEY_VIEW_TAB_MARQUEE "ui_key_view_tab_marquee"
+#define MUIOPTION_UI_KEY_VIEW_TAB_SCREENSHOT "ui_key_view_tab_screenshot"
+#define MUIOPTION_UI_KEY_VIEW_TAB_TITLE "ui_key_view_tab_title"
+#define MUIOPTION_UI_KEY_VIEW_TAB_PCB "ui_key_view_tab_pcb"
+#define MUIOPTION_UI_KEY_QUIT "ui_key_quit"
+#define MUIOPTION_UI_JOY_UP "ui_joy_up"
+#define MUIOPTION_UI_JOY_DOWN "ui_joy_down"
+#define MUIOPTION_UI_JOY_LEFT "ui_joy_left"
+#define MUIOPTION_UI_JOY_RIGHT "ui_joy_right"
+#define MUIOPTION_UI_JOY_START "ui_joy_start"
+#define MUIOPTION_UI_JOY_PGUP "ui_joy_pgup"
+#define MUIOPTION_UI_JOY_PGDWN "ui_joy_pgdwn"
+#define MUIOPTION_UI_JOY_HOME "ui_joy_home"
+#define MUIOPTION_UI_JOY_END "ui_joy_end"
+#define MUIOPTION_UI_JOY_SS_CHANGE "ui_joy_ss_change"
+#define MUIOPTION_UI_JOY_HISTORY_UP "ui_joy_history_up"
+#define MUIOPTION_UI_JOY_HISTORY_DOWN "ui_joy_history_down"
+#define MUIOPTION_UI_JOY_EXEC "ui_joy_exec"
+#define MUIOPTION_EXEC_COMMAND "exec_command"
+#define MUIOPTION_EXEC_WAIT "exec_wait"
+#define MUIOPTION_HIDE_MOUSE "hide_mouse"
+#define MUIOPTION_FULL_SCREEN "full_screen"
+#define MUIOPTION_UI_KEY_VIEW_SOFTWARE_AREA "ui_key_view_software_area"
+
+#ifdef MESS
+#define MUIOPTION_DEFAULT_GAME "default_system"
+#define MUIDEFAULT_SELECTION "0"
+#define MUIDEFAULT_SPLITTERS "133,1125,1706"
+#else
+#define MUIOPTION_DEFAULT_GAME "default_machine"
+#define MUIDEFAULT_SELECTION "0"
+#define MUIDEFAULT_SPLITTERS "164,1700"
+#endif
+
+#define MESSUI_SL_COLUMN_SHOWN "sl_column_shown"
+#define MESSUI_SL_COLUMN_WIDTHS "sl_column_widths"
+#define MESSUI_SL_COLUMN_ORDER "sl_column_order"
+#define MESSUI_SL_SORT_REVERSED "sl_sort_reversed"
+#define MESSUI_SL_SORT_COLUMN "sl_sort_column"
+#define MESSUI_SW_COLUMN_SHOWN "sw_column_shown"
+#define MESSUI_SW_COLUMN_WIDTHS "sw_column_widths"
+#define MESSUI_SW_COLUMN_ORDER "sw_column_order"
+#define MESSUI_SW_SORT_REVERSED "sw_sort_reversed"
+#define MESSUI_SW_SORT_COLUMN "sw_sort_column"
+#define MESSUI_SOFTWARE_TAB "current_software_tab"
+
+typedef struct
+{
+ std::string name; // name of the option
+ std::string value; // initial value if ini file not found
+ const core_options::option_type unused1; // option type (unused)
+ char* unused2; // help text (unused)
+}
+WINUIOPTS;
+// UI options in MAMEui.ini
+const WINUIOPTS option_entries[] =
+{
+ { MUIOPTION_OVERRIDE_REDX, "0", OPTION_INTEGER, NULL },
+ { MUIOPTION_DEFAULT_GAME, MUIDEFAULT_SELECTION, OPTION_INTEGER, NULL },
+ { MUIOPTION_DEFAULT_FOLDER_ID, "0", OPTION_INTEGER, NULL },
+ { MUIOPTION_FULL_SCREEN, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_CURRENT_TAB, "0", OPTION_STRING, NULL },
+ { MESSUI_SOFTWARE_TAB, "0", OPTION_INTEGER, NULL },
+ { MUIOPTION_SHOW_TOOLBAR, "1", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_SHOW_STATUS_BAR, "1", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_HIDE_FOLDERS, "", OPTION_STRING, NULL },
+ { MUIOPTION_SHOW_TABS, "1", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_HIDE_TABS, "artpreview,boss,cpanel,cover,end,flyer,gameover,howto,logo,marquee,pcb,scores,select,title,versus", OPTION_STRING, NULL },
+ { MUIOPTION_HISTORY_TAB, "0", OPTION_INTEGER, NULL },
+ { MUIOPTION_SORT_COLUMN, "0", OPTION_INTEGER, NULL },
+ { MUIOPTION_SORT_REVERSED, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_WINDOW_X, "0", OPTION_INTEGER, NULL }, // main window position, left
+ { MUIOPTION_WINDOW_Y, "0", OPTION_INTEGER, NULL }, // main window position, top
+ { MUIOPTION_WINDOW_WIDTH, "2000", OPTION_INTEGER, NULL }, // main window width
+ { MUIOPTION_WINDOW_HEIGHT, "1000", OPTION_INTEGER, NULL }, // main window height
+ { MUIOPTION_WINDOW_STATE, "1", OPTION_INTEGER, NULL },
+ { MUIOPTION_WINDOW_PANES, "15", OPTION_INTEGER, NULL }, // which windows are visible: bit 0 = tree, bit 1 = list, bit 2 = sw, bit 3 = images
+ { MUIOPTION_TEXT_COLOR, "-1", OPTION_INTEGER, NULL },
+ { MUIOPTION_CLONE_COLOR, "-1", OPTION_INTEGER, NULL },
+ { MUIOPTION_CUSTOM_COLOR, "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0", OPTION_STRING, NULL }, // colour codes of the 16 custom colours (set in clone font dialog)
+ /* ListMode needs to be before ColumnWidths settings */
+ { MUIOPTION_LIST_MODE, "5", OPTION_INTEGER, NULL },
+ { MUIOPTION_SPLITTERS, MUIDEFAULT_SPLITTERS, OPTION_STRING, NULL },
+ { MUIOPTION_LIST_FONT, "-11,0,0,0,400,0,0,0,0,1,2,1,34,MS Sans Serif", OPTION_STRING, NULL },
+ { MUIOPTION_COLUMN_WIDTHS, "185,78,84,84,64,88,74,108,60,144,84,40,40", OPTION_STRING, NULL },
+ { MUIOPTION_COLUMN_ORDER, "0,1,2,3,4,5,6,7,8,9,10,11,12", OPTION_STRING, NULL },
+ { MUIOPTION_COLUMN_SHOWN, "1,1,1,1,1,1,1,1,1,1,1,1,0", OPTION_STRING, NULL },
+ { MESSUI_SL_COLUMN_WIDTHS, "100,75,223,46,120,120", OPTION_STRING, NULL },
+ { MESSUI_SL_COLUMN_ORDER, "0,1,2,3,4,5", OPTION_STRING, NULL }, // order of columns
+ { MESSUI_SL_COLUMN_SHOWN, "1,1,1,1,1,1", OPTION_STRING, NULL }, // 0=hide,1=show
+ { MESSUI_SL_SORT_COLUMN, "0", OPTION_INTEGER, NULL },
+ { MESSUI_SL_SORT_REVERSED, "0", OPTION_BOOLEAN, NULL },
+ { MESSUI_SW_COLUMN_WIDTHS, "400", OPTION_STRING, NULL },
+ { MESSUI_SW_COLUMN_ORDER, "0", OPTION_STRING, NULL }, // 1= dummy column
+ { MESSUI_SW_COLUMN_SHOWN, "1", OPTION_STRING, NULL }, // 0=don't show it
+ { MESSUI_SW_SORT_COLUMN, "0", OPTION_INTEGER, NULL },
+ { MESSUI_SW_SORT_REVERSED, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_CHECK_GAME, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_JOYSTICK_IN_INTERFACE, "1", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_KEYBOARD_IN_INTERFACE, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_HIDE_MOUSE, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_INHERIT_FILTER, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_OFFSET_CLONES, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_STRETCH_SCREENSHOT_LARGER, "0", OPTION_BOOLEAN, NULL },
+ { MUIOPTION_CYCLE_SCREENSHOT, "0", OPTION_INTEGER, NULL },
+ { MUIOPTION_SCREENSHOT_BORDER_SIZE, "11", OPTION_INTEGER, NULL },
+ { MUIOPTION_SCREENSHOT_BORDER_COLOR, "-1", OPTION_INTEGER, NULL },
+ { MUIOPTION_EXEC_COMMAND, "", OPTION_STRING, NULL },
+ { MUIOPTION_EXEC_WAIT, "0", OPTION_INTEGER, NULL },
+ { MUIOPTION_BACKGROUND_DIRECTORY, "bkground\\bkground.png", OPTION_STRING, NULL },
+ { MUIOPTION_ICONS_DIRECTORY, "icons", OPTION_STRING, NULL },
+ { MUIOPTION_DATS_DIRECTORY, "dats", OPTION_STRING, NULL },
+ { MUIOPTION_VIDEO_DIRECTORY, "video", OPTION_STRING, NULL },
+ { MUIOPTION_MANUALS_DIRECTORY, "manuals", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_UP, "KEYCODE_UP", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_DOWN, "KEYCODE_DOWN", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_LEFT, "KEYCODE_LEFT", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_RIGHT, "KEYCODE_RIGHT", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_START, "KEYCODE_ENTER NOT KEYCODE_LALT", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_PGUP, "KEYCODE_PGUP", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_PGDWN, "KEYCODE_PGDN", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_HOME, "KEYCODE_HOME", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_END, "KEYCODE_END", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_SS_CHANGE, "KEYCODE_INSERT", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_HISTORY_UP, "KEYCODE_DEL", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_HISTORY_DOWN, "KEYCODE_LALT KEYCODE_0", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_CONTEXT_FILTERS, "KEYCODE_LCONTROL KEYCODE_F", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_SELECT_RANDOM, "KEYCODE_LCONTROL KEYCODE_R", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_GAME_AUDIT, "KEYCODE_LALT KEYCODE_A", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_GAME_PROPERTIES, "KEYCODE_LALT KEYCODE_ENTER", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_HELP_CONTENTS, "KEYCODE_F1", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_UPDATE_GAMELIST, "KEYCODE_F5", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_FOLDERS, "KEYCODE_LALT KEYCODE_D", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_FULLSCREEN, "KEYCODE_F11", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_PAGETAB, "KEYCODE_LALT KEYCODE_B", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_PICTURE_AREA, "KEYCODE_LALT KEYCODE_P", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_SOFTWARE_AREA, "KEYCODE_LALT KEYCODE_W", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_STATUS, "KEYCODE_LALT KEYCODE_S", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TOOLBARS, "KEYCODE_LALT KEYCODE_T", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TAB_CABINET, "KEYCODE_LALT KEYCODE_3", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TAB_CPANEL, "KEYCODE_LALT KEYCODE_6", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TAB_FLYER, "KEYCODE_LALT KEYCODE_2", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TAB_HISTORY, "KEYCODE_LALT KEYCODE_8", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TAB_MARQUEE, "KEYCODE_LALT KEYCODE_4", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TAB_SCREENSHOT, "KEYCODE_LALT KEYCODE_1", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TAB_TITLE, "KEYCODE_LALT KEYCODE_5", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_VIEW_TAB_PCB, "KEYCODE_LALT KEYCODE_7", OPTION_STRING, NULL },
+ { MUIOPTION_UI_KEY_QUIT, "KEYCODE_LALT KEYCODE_Q", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_UP, "1,1,1,1", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_DOWN, "1,1,1,2", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_LEFT, "1,1,2,1", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_RIGHT, "1,1,2,2", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_START, "1,0,1,0", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_PGUP, "2,1,2,1", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_PGDWN, "2,1,2,2", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_HOME, "0,0,0,0", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_END, "0,0,0,0", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_SS_CHANGE, "2,0,3,0", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_HISTORY_UP, "2,0,4,0", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_HISTORY_DOWN, "2,0,1,0", OPTION_STRING, NULL },
+ { MUIOPTION_UI_JOY_EXEC, "0,0,0,0", OPTION_STRING, NULL },
+ { "$end" }
+};
+
+class winui_ui_options
+{
+ std::map<std::string, std::string> m_list;
+ const char *m_filename;
+
+ void create_index(std::ifstream &fp)
+ {
+ if (!fp.good())
+ return;
+ bool is_ready = false;
+ std::string file_line;
+ std::getline(fp, file_line);
+ while (fp.good())
+ {
+ if (is_ready)
+ {
+ char s[file_line.length()+1];
+ strcpy(s, file_line.c_str());
+
+ const char* name = strtok(s, "\t"); // get adjustment name
+ char* data = strtok(NULL, "\t"); // get next part (there's no next tab, so just return whatever is left)
+ if (name)
+ m_list[name] = data ? data : "";
+ }
+ else
+ {
+ if (file_line == "$start")
+ is_ready = true;
+ }
+
+ std::getline(fp, file_line);
+ }
+
+ fp.close();
+ return;
+ }
+
+ bool ends_with_filter(const std::string &str)
+ {
+ string ending = "_filters";
+ u8 endl = ending.length();
+ u8 strl = str.length();
+ if (strl < endl)
+ return false;
+ return str.compare(strl - endl, endl, ending) == 0;
+ }
+
+public:
+ // construction/destruction
+ winui_ui_options()
+ {
+ // set up default values
+ for (int i = 0; option_entries[i].name != "$end"; i++)
+ m_list[option_entries[i].name] = option_entries[i].value;
+ //printf("*** START DUMP OF DEFAULT ***\n");
+ //for (auto const &it : m_list)
+ // printf("%s = %s\n", it.first.c_str(), it.second.c_str());
+ //printf("*** END DUMP OF DEFAULT ***\n");
+ }
+
+ void load_file(const char *filename)
+ {
+ if (!m_filename)
+ m_filename = filename;
+ std::ifstream infile (filename);
+ create_index(infile);
+ }
+
+ void save_file(const char *filename)
+ {
+ if (!filename)
+ return;
+ std::string inistring = std::string("\nYOU CAN SAFELY DELETE THIS FILE TO RESET THE EMULATOR BACK TO DEFAULTS.\n\n$start\n");
+ for (auto const &it : m_list)
+ inistring.append(it.first).append("\t").append(it.second).append("\n");
+
+ std::ofstream outfile (filename, std::ios::out | std::ios::trunc);
+ size_t size = inistring.size();
+ char t1[size+1];
+ strcpy(t1, inistring.c_str());
+ outfile.write(t1, size);
+ outfile.close();
+ return;
+ }
+
+ void reset_and_save(const char *filename)
+ {
+ // set up default values
+ for (int i = 0; option_entries[i].name != "$end"; i++)
+ m_list[option_entries[i].name] = option_entries[i].value;
+
+ save_file(filename);
+ }
+
+ void setter(const char* name, std::string value)
+ {
+ m_list[name] = value;
+ save_file(m_filename);
+ }
+
+ // cannot be "setter" otherwise most strings use it, causing "1" to be saved.
+ //void bool_setter(const char* name, bool value)
+ //{
+ // m_list[name] = value ? "1" : "0";
+ // save_file(m_filename);
+ //}
+
+ void setter(const char* name, int value)
+ {
+ u8 s_write = 3;
+ // filters: only want an entry if a filter is applied
+ if (ends_with_filter(name))
+ {
+ if (value == 0)
+ {
+ if (m_list.find(name) == m_list.end())
+ s_write = 0; // there is no entry so do nothing
+ else
+ s_write = 2; // delete the existing entry
+ }
+ }
+ if (s_write)
+ {
+ if (s_write == 2)
+ m_list.erase(m_list.find(name)); // delete
+ else
+ m_list[name] = std::to_string(value); // add or update
+
+ save_file(m_filename);
+ }
+ }
+
+ std::string getter(const char* name)
+ {
+ if (m_list.count(name))
+ return m_list.find(name)->second;
+ else
+ return "";
+ }
+
+ int int_value(const char* name)
+ {
+ string t = getter(name);
+ if (t.empty())
+ return 0;
+ else
+ return std::atoll(t.c_str());
+ }
+
+ bool bool_value(const char* name)
+ {
+ return int_value(name) ? 1 : 0;
+ }
+};
+
+#endif // WINUI_UIOPTS_H
+
diff --git a/docs/release/src/osd/winui/winui.cpp b/docs/release/src/osd/winui/winui.cpp
new file mode 100644
index 00000000000..7d2ba6749ab
--- /dev/null
+++ b/docs/release/src/osd/winui/winui.cpp
@@ -0,0 +1,6685 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+ /***************************************************************************
+
+ winui.cpp
+
+ Win32 GUI code.
+
+ Created 8/12/97 by Christopher Kirmse (ckirmse@ricochet.net)
+ Additional code November 1997 by Jeff Miller (miller@aa.net)
+ More July 1998 by Mike Haaland (mhaaland@hypertech.com)
+ Added Spitters/Property Sheets/Removed Tabs/Added Tree Control in
+ Nov/Dec 1998 - Mike Haaland
+
+***************************************************************************/
+
+// standard windows headers
+#define _WIN32_IE 0x0501
+#include <windows.h>
+#include <windowsx.h>
+#include <shellapi.h>
+#include <commctrl.h>
+#include <wingdi.h>
+
+// standard C headers
+#include <stdio.h>
+#include <ctype.h>
+#include <io.h>
+#include <fcntl.h>
+#include <dlgs.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <tchar.h>
+
+/* Uncomment to add Direct Draw support (has to be added back to the core too) */
+//#define UI_DIRECTDRAW
+
+// MAME/MAMEUI headers
+#include "emu.h"
+#include "mame.h"
+#include "mameopts.h"
+#include "language.h"
+#include "unzip.h"
+#include "winutf8.h"
+#include "strconv.h"
+#include "window.h"
+#include "../osdcore.h"
+#include "zippath.h"
+
+#include "resource.h"
+#include "resource.hm"
+
+#include "winui.h"
+#include "mui_util.h"
+#include "mui_audit.h"
+#include "directories.h"
+#include "mui_opts.h"
+#include "properties.h"
+#include "columnedit.h"
+#include "picker.h"
+#include "tabview.h"
+#include "bitmask.h"
+#include "treeview.h"
+#include "splitters.h"
+#include "dirwatch.h"
+#include "help.h"
+#include "history.h"
+#include "dialogs.h"
+#ifdef UI_DIRECTDRAW
+#include "directdraw.h"
+#endif
+#include "directinput.h"
+#include "dijoystick.h" /* For DIJoystick availability. */
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+#ifndef LVS_EX_LABELTIP
+#define LVS_EX_LABELTIP 0x00004000 // listview unfolds partly hidden labels if it does not have infotip text
+#endif // LVS_EX_LABELTIP
+
+// fix warning: cast does not match function type
+#if defined(__GNUC__) && defined(ListView_CreateDragImage)
+#undef ListView_CreateDragImage
+#endif
+
+#ifndef ListView_CreateDragImage
+#define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \
+ (HIMAGELIST)(LRESULT)(int)SendMessage((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft))
+#endif // ListView_CreateDragImage
+
+#ifndef TreeView_EditLabel
+#define TreeView_EditLabel(w, i) \
+ SNDMSG(w,TVM_EDITLABEL,0,(LPARAM)(i))
+#endif // TreeView_EditLabel
+
+#ifndef HDF_SORTUP
+#define HDF_SORTUP 0x400
+#endif // HDF_SORTUP
+
+#ifndef HDF_SORTDOWN
+#define HDF_SORTDOWN 0x200
+#endif // HDF_SORTDOWN
+
+#ifndef LVM_SETBKIMAGEA
+#define LVM_SETBKIMAGEA (LVM_FIRST + 68)
+#endif // LVM_SETBKIMAGEA
+
+#ifndef LVM_SETBKIMAGEW
+#define LVM_SETBKIMAGEW (LVM_FIRST + 138)
+#endif // LVM_SETBKIMAGEW
+
+#ifndef LVM_GETBKIMAGEA
+#define LVM_GETBKIMAGEA (LVM_FIRST + 69)
+#endif // LVM_GETBKIMAGEA
+
+#ifndef LVM_GETBKIMAGEW
+#define LVM_GETBKIMAGEW (LVM_FIRST + 139)
+#endif // LVM_GETBKIMAGEW
+
+#ifndef LVBKIMAGE
+
+typedef struct tagLVBKIMAGEA
+{
+ ULONG ulFlags;
+ HBITMAP hbm;
+ LPSTR pszImage;
+ UINT cchImageMax;
+ int xOffsetPercent;
+ int yOffsetPercent;
+} LVBKIMAGEA, *LPLVBKIMAGEA;
+
+typedef struct tagLVBKIMAGEW
+{
+ ULONG ulFlags;
+ HBITMAP hbm;
+ LPWSTR pszImage;
+ UINT cchImageMax;
+ int xOffsetPercent;
+ int yOffsetPercent;
+} LVBKIMAGEW, *LPLVBKIMAGEW;
+
+#ifdef UNICODE
+#define LVBKIMAGE LVBKIMAGEW
+#define LPLVBKIMAGE LPLVBKIMAGEW
+#define LVM_SETBKIMAGE LVM_SETBKIMAGEW
+#define LVM_GETBKIMAGE LVM_GETBKIMAGEW
+#else
+#define LVBKIMAGE LVBKIMAGEA
+#define LPLVBKIMAGE LPLVBKIMAGEA
+#define LVM_SETBKIMAGE LVM_SETBKIMAGEA
+#define LVM_GETBKIMAGE LVM_GETBKIMAGEA
+#endif
+#endif
+
+#ifndef LVBKIF_SOURCE_NONE
+#define LVBKIF_SOURCE_NONE 0x00000000
+#endif // LVBKIF_SOURCE_NONE
+
+#ifndef LVBKIF_SOURCE_HBITMAP
+#define LVBKIF_SOURCE_HBITMAP 0x00000001
+#endif
+
+#ifndef LVBKIF_SOURCE_URL
+#define LVBKIF_SOURCE_URL 0x00000002
+#endif // LVBKIF_SOURCE_URL
+
+#ifndef LVBKIF_SOURCE_MASK
+#define LVBKIF_SOURCE_MASK 0x00000003
+#endif // LVBKIF_SOURCE_MASK
+
+#ifndef LVBKIF_STYLE_NORMAL
+#define LVBKIF_STYLE_NORMAL 0x00000000
+#endif // LVBKIF_STYLE_NORMAL
+
+#ifndef LVBKIF_STYLE_TILE
+#define LVBKIF_STYLE_TILE 0x00000010
+#endif // LVBKIF_STYLE_TILE
+
+#ifndef LVBKIF_STYLE_MASK
+#define LVBKIF_STYLE_MASK 0x00000010
+#endif // LVBKIF_STYLE_MASK
+
+#ifndef ListView_SetBkImage
+#define ListView_SetBkImage(hwnd, plvbki) \
+ (BOOL)SNDMSG((hwnd), LVM_SETBKIMAGE, 0, (LPARAM)(plvbki))
+#endif // ListView_SetBkImage
+
+#ifndef ListView_GetBkImage
+#define ListView_GetBkImage(hwnd, plvbki) \
+ (BOOL)SNDMSG((hwnd), LVM_GETBKIMAGE, 0, (LPARAM)(plvbki))
+#endif // ListView_GetBkImage
+
+#define MM_PLAY_GAME (WM_APP + 15000)
+
+#define JOYGUI_MS 100
+
+#define JOYGUI_TIMER 1
+#define SCREENSHOT_TIMER 2
+#define GAMEWND_TIMER 3
+
+/* Max size of a sub-menu */
+#define DBU_MIN_WIDTH 292
+#define DBU_MIN_HEIGHT 190
+
+static int MIN_WIDTH = DBU_MIN_WIDTH;
+static int MIN_HEIGHT = DBU_MIN_HEIGHT;
+
+/* Max number of bkground picture files */
+#define MAX_BGFILES 100
+
+#ifndef LVS_EX_LABELTIP
+#define LVS_EX_LABELTIP 0x00004000 // listview unfolds partly hidden labels if it does not have infotip text
+#endif
+
+#define NO_FOLDER -1
+#define STATESAVE_VERSION 1
+//I could not find a predefined value for this event and docs just say it has 1 for the parameter
+#define TOOLBAR_EDIT_ACCELERATOR_PRESSED 1
+#define SHOW_MISSING_ROMS_ICON
+
+/***************************************************************************
+ externally defined global variables
+ ***************************************************************************/
+extern const ICONDATA g_iconData[];
+extern const TCHAR g_szPlayGameString[];
+extern const char g_szGameCountString[];
+UINT8 playopts_apply = 0;
+
+typedef struct _play_options play_options;
+struct _play_options
+{
+ const char *record; // OPTION_RECORD
+ const char *playback; // OPTION_PLAYBACK
+ const char *state; // OPTION_STATE
+ const char *wavwrite; // OPTION_WAVWRITE
+ const char *mngwrite; // OPTION_MNGWRITE
+ const char *aviwrite; // OPTION_AVIWRITE
+};
+
+/***************************************************************************
+ function prototypes
+ ***************************************************************************/
+
+static BOOL Win32UI_init(HINSTANCE hInstance, LPWSTR lpCmdLine, int nCmdShow);
+static void Win32UI_exit(void);
+
+static BOOL PumpMessage(void);
+static BOOL OnIdle(HWND hWnd);
+static void OnSize(HWND hwnd, UINT state, int width, int height);
+static LRESULT CALLBACK MameWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+static void SetView(int menu_id);
+static void ResetListView(void);
+static void UpdateGameList(BOOL bUpdateRomAudit, BOOL bUpdateSampleAudit);
+static void DestroyIcons(void);
+static void ReloadIcons(void);
+static void PollGUIJoystick(void);
+//static void PressKey(HWND hwnd,UINT vk);
+static BOOL MameCommand(HWND hwnd,int id, HWND hwndCtl, UINT codeNotify);
+static void KeyboardKeyDown(int syskey, int vk_code, int special);
+static void KeyboardKeyUp(int syskey, int vk_code, int special);
+static void KeyboardStateClear(void);
+
+static void UpdateStatusBar(void);
+//static BOOL PickerHitTest(HWND hWnd);
+static BOOL TreeViewNotify(NMHDR *nm);
+
+static void LoadBackgroundBitmap(void);
+static void PaintBackgroundImage(HWND hWnd, HRGN hRgn, int x, int y);
+
+static int GamePicker_Compare(HWND hwndPicker, int index1, int index2, int sort_subitem);
+
+static void DisableSelection(void);
+static void EnableSelection(int nGame);
+
+static HICON GetSelectedPickItemIcon(void);
+static void SetRandomPickItem(void);
+static void PickColor(COLORREF *cDefault);
+
+static LPTREEFOLDER GetSelectedFolder(void);
+static HICON GetSelectedFolderIcon(void);
+
+static LRESULT CALLBACK HistoryWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static LRESULT CALLBACK PictureFrameWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+static LRESULT CALLBACK PictureWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+static void MamePlayRecordGame(void);
+static void MamePlayBackGame(void);
+static void MamePlayRecordWave(void);
+static void MamePlayRecordMNG(void);
+static void MamePlayRecordAVI(void);
+static void MameLoadState(void);
+static void MamePlayGameWithOptions(int nGame, const play_options *playopts);
+static BOOL GameCheck(void);
+static BOOL FolderCheck(void);
+
+static void ToggleScreenShot(void);
+static void AdjustMetrics(void);
+//static void EnablePlayOptions(int nIndex, windows_options *o);
+
+/* Icon routines */
+static DWORD GetShellLargeIconSize(void);
+static DWORD GetShellSmallIconSize(void);
+static void CreateIcons(void);
+static int GetIconForDriver(int nItem);
+static void AddDriverIcon(int nItem,int default_icon_index);
+
+// Context Menu handlers
+static void UpdateMenu(HMENU hMenu);
+static void InitTreeContextMenu(HMENU hTreeMenu);
+static void InitBodyContextMenu(HMENU hBodyContextMenu);
+static void ToggleShowFolder(int folder);
+static BOOL HandleTreeContextMenu( HWND hWnd, WPARAM wParam, LPARAM lParam);
+static BOOL HandleScreenShotContextMenu( HWND hWnd, WPARAM wParam, LPARAM lParam);
+static void GamePicker_OnHeaderContextMenu(POINT pt, int nColumn);
+static void GamePicker_OnBodyContextMenu(POINT pt);
+
+static void InitListView(void);
+/* Re/initialize the ListView header columns */
+static void ResetColumnDisplay(BOOL first_time);
+
+static void CopyToolTipText (LPTOOLTIPTEXT lpttt);
+
+static void ProgressBarShow(void);
+static void ProgressBarHide(void);
+static void ResizeProgressBar(void);
+static void ProgressBarStep(void);
+static void ProgressBarStepParam(int iGameIndex, int nGameCount);
+
+static HWND InitProgressBar(HWND hParent);
+static HWND InitToolbar(HWND hParent);
+static HWND InitStatusBar(HWND hParent);
+
+static LRESULT Statusbar_MenuSelect (HWND hwnd, WPARAM wParam, LPARAM lParam);
+
+static void UpdateHistory(void);
+
+
+static void RemoveCurrentGameCustomFolder(void);
+static void RemoveGameCustomFolder(int driver_index);
+
+static void BeginListViewDrag(NM_LISTVIEW *pnmv);
+static void MouseMoveListViewDrag(POINTS pt);
+static void ButtonUpListViewDrag(POINTS p);
+
+static void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height);
+
+BOOL MouseHasBeenMoved(void);
+static void SwitchFullScreenMode(void);
+
+/***************************************************************************
+ External variables
+ ***************************************************************************/
+
+/***************************************************************************
+ Internal structures
+ ***************************************************************************/
+
+/*
+ * These next two structs represent how the icon information
+ * is stored in an ICO file.
+ */
+typedef struct
+{
+ BYTE bWidth; /* Width of the image */
+ BYTE bHeight; /* Height of the image (times 2) */
+ BYTE bColorCount; /* Number of colors in image (0 if >=8bpp) */
+ BYTE bReserved; /* Reserved */
+ WORD wPlanes; /* Color Planes */
+ WORD wBitCount; /* Bits per pixel */
+ DWORD dwBytesInRes; /* how many bytes in this resource? */
+ DWORD dwImageOffset; /* where in the file is this image */
+} ICONDIRENTRY, *LPICONDIRENTRY;
+
+typedef struct
+{
+ UINT Width, Height, Colors; /* Width, Height and bpp */
+ LPBYTE lpBits; /* ptr to DIB bits */
+ DWORD dwNumBytes; /* how many bytes? */
+ LPBITMAPINFO lpbi; /* ptr to header */
+ LPBYTE lpXOR; /* ptr to XOR image bits */
+ LPBYTE lpAND; /* ptr to AND image bits */
+} ICONIMAGE, *LPICONIMAGE;
+
+/* Which edges of a control are anchored to the corresponding side of the parent window */
+#define RA_LEFT 0x01
+#define RA_RIGHT 0x02
+#define RA_TOP 0x04
+#define RA_BOTTOM 0x08
+#define RA_ALL 0x0F
+
+#define RA_END 0
+#define RA_ID 1
+#define RA_HWND 2
+
+typedef struct
+{
+ int type; /* Either RA_ID or RA_HWND, to indicate which member of u is used; or RA_END
+ to signify last entry */
+ union /* Can identify a child window by control id or by handle */
+ {
+ int id; /* Window control id */
+ HWND hwnd; /* Window handle */
+ } u;
+ BOOL setfont; /* Do we set this item's font? */
+ int action; /* What to do when control is resized */
+ void *subwindow; /* Points to a Resize structure for this subwindow; NULL if none */
+} ResizeItem;
+
+typedef struct
+{
+ RECT rect; /* Client rect of window; must be initialized before first resize */
+ const ResizeItem* items; /* Array of subitems to be resized */
+} Resize;
+
+static void ResizeWindow(HWND hParent, Resize *r);
+static void SetAllWindowsFont(HWND hParent, const Resize *r, HFONT hFont, BOOL bRedraw);
+
+/* List view Icon defines */
+#define LG_ICONMAP_WIDTH GetSystemMetrics(SM_CXICON)
+#define LG_ICONMAP_HEIGHT GetSystemMetrics(SM_CYICON)
+#define ICONMAP_WIDTH GetSystemMetrics(SM_CXSMICON)
+#define ICONMAP_HEIGHT GetSystemMetrics(SM_CYSMICON)
+
+typedef struct tagPOPUPSTRING
+{
+ HMENU hMenu;
+ UINT uiString;
+} POPUPSTRING;
+
+#define MAX_MENUS 3
+
+#define SPLITTER_WIDTH 4
+#define MIN_VIEW_WIDTH 10
+
+// Struct needed for Game Window Communication
+
+typedef struct
+{
+ LPPROCESS_INFORMATION ProcessInfo;
+ HWND hwndFound;
+} FINDWINDOWHANDLE;
+
+/***************************************************************************
+ Internal variables
+ ***************************************************************************/
+
+static HWND hMain = NULL;
+static HACCEL hAccel = NULL;
+
+static HWND hwndList = NULL;
+static HWND hTreeView = NULL;
+static HWND hProgWnd = NULL;
+static HWND hTabCtrl = NULL;
+
+static HINSTANCE hInst = NULL;
+
+static HFONT hFont = NULL; /* Font for list view */
+
+static int optionfolder_count = 0;
+
+/* global data--know where to send messages */
+static BOOL in_emulation;
+
+/* idle work at startup */
+static BOOL idle_work;
+
+/* object pool in use */
+static object_pool *mameui_pool;
+
+static int game_index;
+static int progBarStep;
+
+static BOOL bDoGameCheck = false;
+
+/* Tree control variables */
+static BOOL bShowToolBar = 1;
+static BOOL bShowStatusBar = 1;
+static BOOL bShowTabCtrl = 1;
+static BOOL bProgressShown = false;
+static BOOL bListReady = false;
+
+#define WM_MAME32_FILECHANGED (WM_USER + 0)
+#define WM_MAME32_AUDITGAME (WM_USER + 1)
+
+static PDIRWATCHER s_pWatcher;
+
+/* use a joystick subsystem in the gui? */
+static const struct OSDJoystick* g_pJoyGUI = NULL;
+
+/* store current keyboard state (in bools) here */
+static bool keyboard_state[4096]; /* __code_max #defines the number of internal key_codes */
+
+/* search */
+static char g_SearchText[256];
+/* table copied from windows/inputs.c */
+// table entry indices
+#define MAME_KEY 0
+#define DI_KEY 1
+#define VIRTUAL_KEY 2
+#define ASCII_KEY 3
+
+// master keyboard translation table
+static const int win_key_trans_table[][4] =
+{
+ // MAME key dinput key virtual key ascii
+ { ITEM_ID_ESC, DIK_ESCAPE, VK_ESCAPE, 27 },
+ { ITEM_ID_1, DIK_1, '1', '1' },
+ { ITEM_ID_2, DIK_2, '2', '2' },
+ { ITEM_ID_3, DIK_3, '3', '3' },
+ { ITEM_ID_4, DIK_4, '4', '4' },
+ { ITEM_ID_5, DIK_5, '5', '5' },
+ { ITEM_ID_6, DIK_6, '6', '6' },
+ { ITEM_ID_7, DIK_7, '7', '7' },
+ { ITEM_ID_8, DIK_8, '8', '8' },
+ { ITEM_ID_9, DIK_9, '9', '9' },
+ { ITEM_ID_0, DIK_0, '0', '0' },
+ { ITEM_ID_BACKSPACE, DIK_BACK, VK_BACK, 8 },
+ { ITEM_ID_TAB, DIK_TAB, VK_TAB, 9 },
+ { ITEM_ID_Q, DIK_Q, 'Q', 'Q' },
+ { ITEM_ID_W, DIK_W, 'W', 'W' },
+ { ITEM_ID_E, DIK_E, 'E', 'E' },
+ { ITEM_ID_R, DIK_R, 'R', 'R' },
+ { ITEM_ID_T, DIK_T, 'T', 'T' },
+ { ITEM_ID_Y, DIK_Y, 'Y', 'Y' },
+ { ITEM_ID_U, DIK_U, 'U', 'U' },
+ { ITEM_ID_I, DIK_I, 'I', 'I' },
+ { ITEM_ID_O, DIK_O, 'O', 'O' },
+ { ITEM_ID_P, DIK_P, 'P', 'P' },
+ { ITEM_ID_OPENBRACE, DIK_LBRACKET, VK_OEM_4, '[' },
+ { ITEM_ID_CLOSEBRACE, DIK_RBRACKET, VK_OEM_6, ']' },
+ { ITEM_ID_ENTER, DIK_RETURN, VK_RETURN, 13 },
+ { ITEM_ID_LCONTROL, DIK_LCONTROL, VK_LCONTROL, 0 },
+ { ITEM_ID_A, DIK_A, 'A', 'A' },
+ { ITEM_ID_S, DIK_S, 'S', 'S' },
+ { ITEM_ID_D, DIK_D, 'D', 'D' },
+ { ITEM_ID_F, DIK_F, 'F', 'F' },
+ { ITEM_ID_G, DIK_G, 'G', 'G' },
+ { ITEM_ID_H, DIK_H, 'H', 'H' },
+ { ITEM_ID_J, DIK_J, 'J', 'J' },
+ { ITEM_ID_K, DIK_K, 'K', 'K' },
+ { ITEM_ID_L, DIK_L, 'L', 'L' },
+ { ITEM_ID_COLON, DIK_SEMICOLON, VK_OEM_1, ';' },
+ { ITEM_ID_QUOTE, DIK_APOSTROPHE, VK_OEM_7, '\'' },
+ { ITEM_ID_TILDE, DIK_GRAVE, VK_OEM_3, '`' },
+ { ITEM_ID_LSHIFT, DIK_LSHIFT, VK_LSHIFT, 0 },
+ { ITEM_ID_BACKSLASH, DIK_BACKSLASH, VK_OEM_5, '\\' },
+ { ITEM_ID_Z, DIK_Z, 'Z', 'Z' },
+ { ITEM_ID_X, DIK_X, 'X', 'X' },
+ { ITEM_ID_C, DIK_C, 'C', 'C' },
+ { ITEM_ID_V, DIK_V, 'V', 'V' },
+ { ITEM_ID_B, DIK_B, 'B', 'B' },
+ { ITEM_ID_N, DIK_N, 'N', 'N' },
+ { ITEM_ID_M, DIK_M, 'M', 'M' },
+ { ITEM_ID_SLASH, DIK_SLASH, VK_OEM_2, '/' },
+ { ITEM_ID_RSHIFT, DIK_RSHIFT, VK_RSHIFT, 0 },
+ { ITEM_ID_ASTERISK, DIK_MULTIPLY, VK_MULTIPLY, '*' },
+ { ITEM_ID_LALT, DIK_LMENU, VK_LMENU, 0 },
+ { ITEM_ID_SPACE, DIK_SPACE, VK_SPACE, ' ' },
+ { ITEM_ID_CAPSLOCK, DIK_CAPITAL, VK_CAPITAL, 0 },
+ { ITEM_ID_F1, DIK_F1, VK_F1, 0 },
+ { ITEM_ID_F2, DIK_F2, VK_F2, 0 },
+ { ITEM_ID_F3, DIK_F3, VK_F3, 0 },
+ { ITEM_ID_F4, DIK_F4, VK_F4, 0 },
+ { ITEM_ID_F5, DIK_F5, VK_F5, 0 },
+ { ITEM_ID_F6, DIK_F6, VK_F6, 0 },
+ { ITEM_ID_F7, DIK_F7, VK_F7, 0 },
+ { ITEM_ID_F8, DIK_F8, VK_F8, 0 },
+ { ITEM_ID_F9, DIK_F9, VK_F9, 0 },
+ { ITEM_ID_F10, DIK_F10, VK_F10, 0 },
+ { ITEM_ID_NUMLOCK, DIK_NUMLOCK, VK_NUMLOCK, 0 },
+ { ITEM_ID_SCRLOCK, DIK_SCROLL, VK_SCROLL, 0 },
+ { ITEM_ID_7_PAD, DIK_NUMPAD7, VK_NUMPAD7, 0 },
+ { ITEM_ID_8_PAD, DIK_NUMPAD8, VK_NUMPAD8, 0 },
+ { ITEM_ID_9_PAD, DIK_NUMPAD9, VK_NUMPAD9, 0 },
+ { ITEM_ID_MINUS_PAD, DIK_SUBTRACT, VK_SUBTRACT, 0 },
+ { ITEM_ID_4_PAD, DIK_NUMPAD4, VK_NUMPAD4, 0 },
+ { ITEM_ID_5_PAD, DIK_NUMPAD5, VK_NUMPAD5, 0 },
+ { ITEM_ID_6_PAD, DIK_NUMPAD6, VK_NUMPAD6, 0 },
+ { ITEM_ID_PLUS_PAD, DIK_ADD, VK_ADD, 0 },
+ { ITEM_ID_1_PAD, DIK_NUMPAD1, VK_NUMPAD1, 0 },
+ { ITEM_ID_2_PAD, DIK_NUMPAD2, VK_NUMPAD2, 0 },
+ { ITEM_ID_3_PAD, DIK_NUMPAD3, VK_NUMPAD3, 0 },
+ { ITEM_ID_0_PAD, DIK_NUMPAD0, VK_NUMPAD0, 0 },
+ { ITEM_ID_DEL_PAD, DIK_DECIMAL, VK_DECIMAL, 0 },
+ { ITEM_ID_F11, DIK_F11, VK_F11, 0 },
+ { ITEM_ID_F12, DIK_F12, VK_F12, 0 },
+ { ITEM_ID_F13, DIK_F13, VK_F13, 0 },
+ { ITEM_ID_F14, DIK_F14, VK_F14, 0 },
+ { ITEM_ID_F15, DIK_F15, VK_F15, 0 },
+ { ITEM_ID_ENTER_PAD, DIK_NUMPADENTER, VK_RETURN, 0 },
+ { ITEM_ID_RCONTROL, DIK_RCONTROL, VK_RCONTROL, 0 },
+ { ITEM_ID_SLASH_PAD, DIK_DIVIDE, VK_DIVIDE, 0 },
+ { ITEM_ID_PRTSCR, DIK_SYSRQ, 0, 0 },
+ { ITEM_ID_RALT, DIK_RMENU, VK_RMENU, 0 },
+ { ITEM_ID_HOME, DIK_HOME, VK_HOME, 0 },
+ { ITEM_ID_UP, DIK_UP, VK_UP, 0 },
+ { ITEM_ID_PGUP, DIK_PRIOR, VK_PRIOR, 0 },
+ { ITEM_ID_LEFT, DIK_LEFT, VK_LEFT, 0 },
+ { ITEM_ID_RIGHT, DIK_RIGHT, VK_RIGHT, 0 },
+ { ITEM_ID_END, DIK_END, VK_END, 0 },
+ { ITEM_ID_DOWN, DIK_DOWN, VK_DOWN, 0 },
+ { ITEM_ID_PGDN, DIK_NEXT, VK_NEXT, 0 },
+ { ITEM_ID_INSERT, DIK_INSERT, VK_INSERT, 0 },
+ { ITEM_ID_DEL, DIK_DELETE, VK_DELETE, 0 },
+ { ITEM_ID_LWIN, DIK_LWIN, VK_LWIN, 0 },
+ { ITEM_ID_RWIN, DIK_RWIN, VK_RWIN, 0 },
+ { ITEM_ID_MENU, DIK_APPS, VK_APPS, 0 },
+ { ITEM_ID_PAUSE, DIK_PAUSE, VK_PAUSE, 0 },
+ { ITEM_ID_CANCEL, 0, VK_CANCEL, 0 },
+};
+
+
+
+typedef struct
+{
+ char name[40]; // functionality name (optional)
+ input_seq is; // the input sequence (the keys pressed)
+ UINT func_id; // the identifier
+ input_seq* (*const getiniptr)(void);// pointer to function to get the value from .ini file
+} GUISequence;
+
+static const GUISequence GUISequenceControl[]=
+{
+ {"gui_key_up", input_seq(), ID_UI_UP, Get_ui_key_up },
+ {"gui_key_down", input_seq(), ID_UI_DOWN, Get_ui_key_down },
+ {"gui_key_left", input_seq(), ID_UI_LEFT, Get_ui_key_left },
+ {"gui_key_right", input_seq(), ID_UI_RIGHT, Get_ui_key_right },
+ {"gui_key_start", input_seq(), ID_UI_START, Get_ui_key_start },
+ {"gui_key_pgup", input_seq(), ID_UI_PGUP, Get_ui_key_pgup },
+ {"gui_key_pgdwn", input_seq(), ID_UI_PGDOWN, Get_ui_key_pgdwn },
+ {"gui_key_home", input_seq(), ID_UI_HOME, Get_ui_key_home },
+ {"gui_key_end", input_seq(), ID_UI_END, Get_ui_key_end },
+ {"gui_key_ss_change", input_seq(), IDC_SSFRAME, Get_ui_key_ss_change },
+ {"gui_key_history_up", input_seq(), ID_UI_HISTORY_UP, Get_ui_key_history_up },
+ {"gui_key_history_down", input_seq(), ID_UI_HISTORY_DOWN, Get_ui_key_history_down },
+
+ {"gui_key_context_filters", input_seq(), ID_CONTEXT_FILTERS, Get_ui_key_context_filters },
+ {"gui_key_select_random", input_seq(), ID_CONTEXT_SELECT_RANDOM, Get_ui_key_select_random },
+ {"gui_key_game_audit", input_seq(), ID_GAME_AUDIT, Get_ui_key_game_audit },
+ {"gui_key_game_properties", input_seq(), ID_GAME_PROPERTIES, Get_ui_key_game_properties },
+ {"gui_key_help_contents", input_seq(), ID_HELP_CONTENTS, Get_ui_key_help_contents },
+ {"gui_key_update_gamelist", input_seq(), ID_UPDATE_GAMELIST, Get_ui_key_update_gamelist },
+ {"gui_key_view_folders", input_seq(), ID_VIEW_FOLDERS, Get_ui_key_view_folders },
+ {"gui_key_view_fullscreen", input_seq(), ID_VIEW_FULLSCREEN, Get_ui_key_view_fullscreen },
+ {"gui_key_view_pagetab", input_seq(), ID_VIEW_PAGETAB, Get_ui_key_view_pagetab },
+ {"gui_key_view_picture_area", input_seq(), ID_VIEW_PICTURE_AREA, Get_ui_key_view_picture_area },
+ {"gui_key_view_status", input_seq(), ID_VIEW_STATUS, Get_ui_key_view_status },
+ {"gui_key_view_toolbars", input_seq(), ID_VIEW_TOOLBARS, Get_ui_key_view_toolbars },
+
+ {"gui_key_view_tab_cabinet", input_seq(), ID_VIEW_TAB_CABINET, Get_ui_key_view_tab_cabinet },
+ {"gui_key_view_tab_cpanel", input_seq(), ID_VIEW_TAB_CONTROL_PANEL, Get_ui_key_view_tab_cpanel },
+ {"gui_key_view_tab_flyer", input_seq(), ID_VIEW_TAB_FLYER, Get_ui_key_view_tab_flyer },
+ {"gui_key_view_tab_history", input_seq(), ID_VIEW_TAB_HISTORY, Get_ui_key_view_tab_history },
+ {"gui_key_view_tab_marquee", input_seq(), ID_VIEW_TAB_MARQUEE, Get_ui_key_view_tab_marquee },
+ {"gui_key_view_tab_screenshot", input_seq(), ID_VIEW_TAB_SCREENSHOT, Get_ui_key_view_tab_screenshot },
+ {"gui_key_view_tab_title", input_seq(), ID_VIEW_TAB_TITLE, Get_ui_key_view_tab_title },
+ {"gui_key_view_tab_pcb", input_seq(), ID_VIEW_TAB_PCB, Get_ui_key_view_tab_pcb },
+ {"gui_key_quit", input_seq(), ID_FILE_EXIT, Get_ui_key_quit },
+};
+
+
+#define NUM_GUI_SEQUENCES (sizeof(GUISequenceControl) / sizeof(GUISequenceControl[0]))
+
+
+static UINT lastColumnClick = 0;
+static WNDPROC g_lpHistoryWndProc = NULL;
+static WNDPROC g_lpPictureFrameWndProc = NULL;
+static WNDPROC g_lpPictureWndProc = NULL;
+
+static POPUPSTRING popstr[MAX_MENUS + 1];
+
+/* Tool and Status bar variables */
+static HWND hStatusBar = 0;
+static HWND s_hToolBar = 0;
+
+/* Column Order as Displayed */
+static BOOL oldControl = false;
+static BOOL xpControl = false;
+
+/* Used to recalculate the main window layout */
+static int bottomMargin;
+static int topMargin;
+static int have_history = false;
+
+static BOOL have_selection = false;
+
+static HBITMAP hMissing_bitmap = NULL;
+
+/* Icon variables */
+static HIMAGELIST hLarge = NULL;
+static HIMAGELIST hSmall = NULL;
+static HIMAGELIST hHeaderImages = NULL;
+static int *icon_index = NULL; /* for custom per-game icons */
+
+static const TBBUTTON tbb[] =
+{
+ {0, ID_VIEW_FOLDERS, TBSTATE_ENABLED, TBSTYLE_CHECK, {0, 0}, 0, 0},
+ {1, ID_VIEW_PICTURE_AREA,TBSTATE_ENABLED, TBSTYLE_CHECK, {0, 0}, 0, 1},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0},
+ {2, ID_VIEW_LARGE_ICON, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 2},
+ {3, ID_VIEW_SMALL_ICON, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 3},
+ {4, ID_VIEW_LIST_MENU, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 4},
+ {5, ID_VIEW_DETAIL, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 5},
+ {6, ID_VIEW_GROUPED, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 6},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0},
+ {7, ID_HELP_ABOUT, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 7},
+ {8, ID_HELP_CONTENTS, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 8}
+};
+
+#define NUM_TOOLBUTTONS (sizeof(tbb) / sizeof(tbb[0]))
+
+#define NUM_TOOLTIPS 9
+
+static const TCHAR szTbStrings[NUM_TOOLTIPS + 1][30] =
+{
+ TEXT("Toggle Folder List"),
+ TEXT("Toggle Screen Shot"),
+ TEXT("Large Icons"),
+ TEXT("Small Icons"),
+ TEXT("List"),
+ TEXT("Details"),
+ TEXT("Grouped"),
+ TEXT("About"),
+ TEXT("Help")
+};
+
+static const int CommandToString[] =
+{
+ ID_VIEW_FOLDERS,
+ ID_VIEW_PICTURE_AREA,
+ ID_VIEW_LARGE_ICON,
+ ID_VIEW_SMALL_ICON,
+ ID_VIEW_LIST_MENU,
+ ID_VIEW_DETAIL,
+ ID_VIEW_GROUPED,
+ ID_HELP_ABOUT,
+ ID_HELP_CONTENTS,
+ -1
+};
+
+static const int s_nPickers[] =
+{
+ IDC_LIST
+};
+
+
+/* How to resize toolbar sub window */
+static ResizeItem toolbar_resize_items[] =
+{
+ { RA_ID, { ID_TOOLBAR_EDIT }, true, RA_LEFT | RA_TOP, NULL },
+ { RA_END, { 0 }, false, 0, NULL }
+};
+
+static Resize toolbar_resize = { {0, 0, 0, 0}, toolbar_resize_items };
+
+/* How to resize main window */
+static ResizeItem main_resize_items[] =
+{
+ { RA_HWND, { 0 }, false, RA_LEFT | RA_RIGHT | RA_TOP, &toolbar_resize },
+ { RA_HWND, { 0 }, false, RA_LEFT | RA_RIGHT | RA_BOTTOM, NULL },
+ { RA_ID, { IDC_DIVIDER }, false, RA_LEFT | RA_RIGHT | RA_TOP, NULL },
+ { RA_ID, { IDC_TREE }, true, RA_LEFT | RA_BOTTOM | RA_TOP, NULL },
+ { RA_ID, { IDC_LIST }, true, RA_ALL, NULL },
+ { RA_ID, { IDC_SPLITTER }, false, RA_LEFT | RA_BOTTOM | RA_TOP, NULL },
+ { RA_ID, { IDC_SPLITTER2 },false, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL },
+ { RA_ID, { IDC_SSFRAME }, false, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL },
+ { RA_ID, { IDC_SSPICTURE },false, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL },
+ { RA_ID, { IDC_HISTORY }, true, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL },
+ { RA_ID, { IDC_SSTAB }, false, RA_RIGHT | RA_TOP, NULL },
+ { RA_END, { 0 }, false, 0, NULL }
+};
+
+static Resize main_resize = { {0, 0, 0, 0}, main_resize_items };
+
+/* last directory for common file dialogs */
+TCHAR last_directory[MAX_PATH];
+
+/* system-wide window message sent out with an ATOM of the current game name
+ each time it changes */
+static UINT g_mame32_message = 0;
+
+static BOOL g_listview_dragging = false;
+static HIMAGELIST himl_drag;
+static int game_dragged; /* which game started the drag */
+static HTREEITEM prev_drag_drop_target; /* which tree view item we're currently highlighting */
+
+static BOOL g_in_treeview_edit = false;
+
+/***************************************************************************
+ Global variables
+ ***************************************************************************/
+
+/* Background Image handles also accessed from TreeView.c */
+static HPALETTE hPALbg = 0;
+static HBITMAP hBackground = 0;
+static MYBITMAPINFO bmDesc;
+
+/* List view Column text */
+extern const LPCTSTR column_names[COLUMN_MAX] =
+{
+ TEXT("Machine"),
+ TEXT("Source"),
+ TEXT("Directory"),
+ TEXT("Type"),
+ TEXT("Screen"),
+ TEXT("Manufacturer"),
+ TEXT("Year"),
+ TEXT("Played"),
+ TEXT("Play Time"),
+ TEXT("Clone Of"),
+ TEXT("Trackball"),
+ TEXT("Samples"),
+ TEXT("ROMs"),
+};
+
+/***************************************************************************
+ Message Macros
+ ***************************************************************************/
+
+#ifndef StatusBar_GetItemRect
+#define StatusBar_GetItemRect(hWnd, iPart, lpRect) \
+ SendMessage(hWnd, SB_GETRECT, (WPARAM) iPart, (LPARAM) (LPRECT) lpRect)
+#endif
+
+#ifndef ToolBar_CheckButton
+#define ToolBar_CheckButton(hWnd, idButton, fCheck) \
+ SendMessage(hWnd, TB_CHECKBUTTON, (WPARAM)idButton, (LPARAM)MAKELONG(fCheck, 0))
+#endif
+
+//============================================================
+// winui_output_error
+//============================================================
+
+
+class mameui_output_error : public osd_output
+{
+public:
+ virtual void output_callback(osd_output_channel channel, const char *msg, va_list args)
+ {
+ if (channel == OSD_OUTPUT_CHANNEL_VERBOSE)
+ {
+ FILE *pFile;
+ pFile = fopen("verbose.log", "a");
+ vfprintf(pFile, msg, args);fflush(pFile);
+ fclose (pFile);
+ return;
+ }
+
+ int s_action = 0;
+ char buffer[4096];
+ vsnprintf(buffer, ARRAY_LENGTH(buffer), msg, args);
+
+ if (channel == OSD_OUTPUT_CHANNEL_ERROR)
+ {
+ s_action = 0x80;
+ }
+ else
+ if (channel == OSD_OUTPUT_CHANNEL_WARNING)
+ {
+ if (strstr(buffer, "WRONG"))
+ {
+ s_action = 0x81;
+ }
+ }
+
+ if (s_action)
+ {
+ // if we are in fullscreen mode, go to windowed mode
+ if ((video_config.windowed == 0) && !osd_common_t::s_window_list.empty())
+ winwindow_toggle_full_screen();
+
+ win_message_box_utf8(!osd_common_t::s_window_list.empty() ?
+ std::static_pointer_cast<win_window_info>(osd_common_t::s_window_list.front())->platform_window() :
+ hMain, buffer, MAMEUINAME, (BIT(s_action, 0) ? MB_ICONINFORMATION : MB_ICONERROR) | MB_OK);
+ }
+
+// else
+// chain_output(channel, msg, args); // goes down the black hole
+ // LOG all messages
+ FILE *pFile;
+ pFile = fopen("winui.log", "a");
+ vfprintf(pFile, msg, args);fflush(pFile);
+ fclose (pFile);
+/* List of output types:
+ case OSD_OUTPUT_CHANNEL_ERROR:
+ case OSD_OUTPUT_CHANNEL_WARNING:
+ vfprintf(stderr, msg, args); // send errors and warnings to standard error (=console)
+ break;
+ case OSD_OUTPUT_CHANNEL_INFO:
+ case OSD_OUTPUT_CHANNEL_LOG:
+ vfprintf(stdout, msg, args); // send info and logging to standard output (=console)
+ break;
+ case OSD_OUTPUT_CHANNEL_VERBOSE:
+ if (verbose()) vfprintf(stdout, msg, args); // send verbose (2nd half) to console if enabled (first half lost)
+ break;
+ case OSD_OUTPUT_CHANNEL_DEBUG: // only for debug builds
+ vfprintf(stdout, msg, args);
+*/
+ }
+};
+
+static std::wstring s2ws(const string& s)
+{
+ int slength = (int)s.length() + 1;
+ int len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0);
+ wchar_t* buf = new wchar_t[len];
+ MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len);
+ std::wstring r(buf);
+ delete[] buf;
+ return r;
+}
+
+
+/***************************************************************************
+ External functions
+ ***************************************************************************/
+static DWORD RunMAME(int nGameIndex, const play_options *playopts)
+{
+ time_t start, end;
+ double elapsedtime;
+ int i;
+ //mame_options mame_opts; //seems useless....
+ windows_options global_opts;
+ // set up MAME options
+ // mame_opts = mame_options_init(mame_win_options);
+
+ // Tell mame were to get the INIs
+ SetDirectories(global_opts);
+
+ // set some startup options
+ global_opts.set_value(OPTION_LANGUAGE, GetLanguageUI(), OPTION_PRIORITY_CMDLINE);
+ global_opts.set_value(OPTION_PLUGINS, GetEnablePlugins(), OPTION_PRIORITY_CMDLINE);
+ global_opts.set_value(OPTION_PLUGIN, GetPlugins(), OPTION_PRIORITY_CMDLINE);
+
+ // add image specific device options
+ //mame_opts.set_system_name(global_opts, driver_list::driver(nGameIndex).name);
+ global_opts.set_value(OPTION_SYSTEMNAME, driver_list::driver(nGameIndex).name, OPTION_PRIORITY_CMDLINE);
+
+ // set any specified play options
+ if (playopts_apply == 0x57)
+ {
+ if (playopts->record)
+ global_opts.set_value(OPTION_RECORD, playopts->record, OPTION_PRIORITY_CMDLINE);
+ if (playopts->playback)
+ global_opts.set_value(OPTION_PLAYBACK, playopts->playback, OPTION_PRIORITY_CMDLINE);
+ if (playopts->state)
+ global_opts.set_value(OPTION_STATE, playopts->state, OPTION_PRIORITY_CMDLINE);
+ if (playopts->wavwrite)
+ global_opts.set_value(OPTION_WAVWRITE, playopts->wavwrite, OPTION_PRIORITY_CMDLINE);
+ if (playopts->mngwrite)
+ global_opts.set_value(OPTION_MNGWRITE, playopts->mngwrite, OPTION_PRIORITY_CMDLINE);
+ if (playopts->aviwrite)
+ global_opts.set_value(OPTION_AVIWRITE, playopts->aviwrite, OPTION_PRIORITY_CMDLINE);
+ }
+
+ // Mame will parse all the needed .ini files.
+
+ // prepare MAME32 to run the game
+ ShowWindow(hMain, SW_HIDE);
+
+ for (i = 0; i < ARRAY_LENGTH(s_nPickers); i++)
+ Picker_ClearIdle(GetDlgItem(hMain, s_nPickers[i]));
+
+ // run the emulation
+ // Time the game run.
+ time(&start);
+ windows_osd_interface osd(global_opts);
+ // output errors to message boxes
+ mameui_output_error winerror;
+ osd_output::push(&winerror);
+ osd.register_options();
+ mame_machine_manager *manager = mame_machine_manager::instance(global_opts, osd);
+ load_translation(global_opts);
+ manager->start_http_server();
+ manager->start_luaengine();
+ manager->execute();
+ osd_output::pop(&winerror);
+ global_free(manager);
+ // Calc the duration
+ time(&end);
+ elapsedtime = end - start;
+ // Increment our playtime.
+ IncrementPlayTime(nGameIndex, elapsedtime);
+
+ // clear any specified play options
+ // do it this way to preserve slots and software entries
+ if (playopts_apply == 0x57)
+ {
+ windows_options o;
+ load_options(o, OPTIONS_GAME, nGameIndex, 0);
+ if (playopts->record)
+ o.set_value(OPTION_RECORD, "", OPTION_PRIORITY_CMDLINE);
+ if (playopts->playback)
+ o.set_value(OPTION_PLAYBACK, "", OPTION_PRIORITY_CMDLINE);
+ if (playopts->state)
+ o.set_value(OPTION_STATE, "", OPTION_PRIORITY_CMDLINE);
+ if (playopts->wavwrite)
+ o.set_value(OPTION_WAVWRITE, "", OPTION_PRIORITY_CMDLINE);
+ if (playopts->mngwrite)
+ o.set_value(OPTION_MNGWRITE, "", OPTION_PRIORITY_CMDLINE);
+ if (playopts->aviwrite)
+ o.set_value(OPTION_AVIWRITE, "", OPTION_PRIORITY_CMDLINE);
+ // apply the above to the ini file
+ save_options(o, OPTIONS_GAME, nGameIndex);
+ }
+ playopts_apply = 0;
+
+ // the emulation is complete; continue
+ for (i = 0; i < ARRAY_LENGTH(s_nPickers); i++)
+ Picker_ResetIdle(GetDlgItem(hMain, s_nPickers[i]));
+ ShowWindow(hMain, SW_SHOW);
+ SetForegroundWindow(hMain);
+
+ return (DWORD)0;
+}
+
+int MameUIMain(HINSTANCE hInstance, LPWSTR lpCmdLine, int nCmdShow)
+{
+ // delete old log file, ignore any error
+ unlink("verbose.log");
+ unlink("winui.log");
+
+ if (__argc != 1)
+ {
+ /* Rename main because gcc will use it instead of WinMain even with -mwindows */
+ extern int main_(int argc, char *argv[]);
+ exit(main_(__argc, __argv));
+ }
+
+ // printf's not allowed before here, else they get into mame queries
+
+ printf("HBMAMEUI starting\n");fflush(stdout);
+
+ if (!Win32UI_init(hInstance, lpCmdLine, nCmdShow))
+ return 1;
+
+ // pump message, but quit on WM_QUIT
+ while(PumpMessage())
+ ;
+
+ Win32UI_exit();
+ return 0;
+}
+
+
+HWND GetMainWindow(void)
+{
+ return hMain;
+}
+
+HWND GetTreeView(void)
+{
+ return hTreeView;
+}
+
+object_pool *GetMameUIMemoryPool(void)
+{
+ return mameui_pool;
+}
+
+void GetRealColumnOrder(int order[])
+{
+ int nColumnMax = Picker_GetNumColumns(hwndList);
+
+ /* Get the Column Order and save it */
+ if (!oldControl)
+ {
+ int tmpOrder[COLUMN_MAX];
+ BOOL res = ListView_GetColumnOrderArray(hwndList, nColumnMax, tmpOrder);
+ res++;
+
+ for (int i = 0; i < nColumnMax; i++)
+ order[i] = Picker_GetRealColumnFromViewColumn(hwndList, tmpOrder[i]);
+ }
+}
+
+/*
+ * PURPOSE: Format raw data read from an ICO file to an HICON
+ * PARAMS: PBYTE ptrBuffer - Raw data from an ICO file
+ * UINT nBufferSize - Size of buffer ptrBuffer
+ * RETURNS: HICON - handle to the icon, NULL for failure
+ * History: July '95 - Created
+ * March '00- Seriously butchered from MSDN for mine own
+ * purposes, sayeth H0ek.
+ */
+static HICON FormatICOInMemoryToHICON(PBYTE ptrBuffer, UINT nBufferSize)
+{
+ /* Is there a WORD? */
+ if (nBufferSize < sizeof(WORD))
+ return NULL;
+
+ /* Was it 'reserved' ? (ie 0) */
+ UINT nBufferIndex = 0;
+ if ((WORD)(ptrBuffer[nBufferIndex]) != 0)
+ return NULL;
+
+ nBufferIndex += sizeof(WORD);
+
+ /* Is there a WORD? */
+ if (nBufferSize - nBufferIndex < sizeof(WORD))
+ return NULL;
+
+ /* Was it type 1? */
+ if ((WORD)(ptrBuffer[nBufferIndex]) != 1)
+ return NULL;
+
+ nBufferIndex += sizeof(WORD);
+
+ /* Is there a WORD? */
+ if (nBufferSize - nBufferIndex < sizeof(WORD))
+ return NULL;
+
+ /* Then that's the number of images in the ICO file */
+ UINT nNumImages = (WORD)(ptrBuffer[nBufferIndex]);
+
+ /* Is there at least one icon in the file? */
+ if ( nNumImages < 1 )
+ return NULL;
+
+ nBufferIndex += sizeof(WORD);
+
+ /* Is there enough space for the icon directory entries? */
+ if ((nBufferIndex + nNumImages * sizeof(ICONDIRENTRY)) > nBufferSize)
+ return NULL;
+
+ /* Assign icon directory entries from buffer */
+ LPICONDIRENTRY lpIDE = (LPICONDIRENTRY)(&ptrBuffer[nBufferIndex]);
+ nBufferIndex += nNumImages * sizeof (ICONDIRENTRY);
+
+ ICONIMAGE IconImage;
+ IconImage.dwNumBytes = lpIDE->dwBytesInRes;
+
+ /* Seek to beginning of this image */
+ if ( lpIDE->dwImageOffset > nBufferSize )
+ return NULL;
+
+ nBufferIndex = lpIDE->dwImageOffset;
+
+ /* Read it in */
+ if ((nBufferIndex + lpIDE->dwBytesInRes) > nBufferSize)
+ return NULL;
+
+ IconImage.lpBits = &ptrBuffer[nBufferIndex];
+ nBufferIndex += lpIDE->dwBytesInRes;
+
+ /* It failed, odds are good we're on NT so try the non-Ex way */
+ HICON hIcon = NULL;
+ if (hIcon == NULL)
+ /* We would break on NT if we try with a 16bpp image */
+ if (((LPBITMAPINFO)IconImage.lpBits)->bmiHeader.biBitCount != 16)
+ hIcon = CreateIconFromResourceEx(IconImage.lpBits, IconImage.dwNumBytes, true, 0x00030000,0,0,LR_DEFAULTSIZE);
+
+ return hIcon;
+}
+
+HICON LoadIconFromFile(const char *iconname)
+{
+ HICON hIcon = 0;
+ struct stat file_stat;
+ char tmpStr[MAX_PATH];
+ char tmpIcoName[MAX_PATH];
+ PBYTE bufferPtr = 0;
+ util::archive_file::ptr zip;
+
+ const string t = GetIconsDir();
+ sprintf(tmpStr, "%s/%s.ico", t.c_str(), iconname);
+ if (stat(tmpStr, &file_stat) != 0 || (hIcon = win_extract_icon_utf8(hInst, tmpStr, 0)) == 0)
+ {
+ sprintf(tmpStr, "%s/icons.zip", t.c_str());
+ sprintf(tmpIcoName, "%s.ico", iconname);
+
+ if (util::archive_file::open_zip(tmpStr, zip) == util::archive_file::error::NONE)
+ {
+ if (zip->search(tmpIcoName, false) >= 0)
+ {
+ bufferPtr = (PBYTE)malloc(zip->current_uncompressed_length());
+ if (bufferPtr)
+ {
+ if (zip->decompress(bufferPtr, zip->current_uncompressed_length()) == util::archive_file::error::NONE)
+ hIcon = FormatICOInMemoryToHICON(bufferPtr, zip->current_uncompressed_length());
+
+ free(bufferPtr);
+ }
+ }
+ zip.reset();
+ }
+ else
+ {
+ sprintf(tmpStr, "%s/icons.7z", t.c_str());
+ sprintf(tmpIcoName, "%s.ico", iconname);
+
+ if (util::archive_file::open_7z(tmpStr, zip) == util::archive_file::error::NONE)
+ {
+ if (zip->search(tmpIcoName, false) >= 0)
+ {
+ bufferPtr = (PBYTE)malloc(zip->current_uncompressed_length());
+ if (bufferPtr)
+ {
+ if (zip->decompress(bufferPtr, zip->current_uncompressed_length()) == util::archive_file::error::NONE)
+ hIcon = FormatICOInMemoryToHICON(bufferPtr, zip->current_uncompressed_length());
+
+ free(bufferPtr);
+ }
+ }
+ zip.reset();
+ }
+ }
+ }
+ return hIcon;
+}
+
+
+/* Return the number of folders with options */
+void SetNumOptionFolders(int count)
+{
+ optionfolder_count = count;
+}
+
+/* search */
+const char * GetSearchText(void)
+{
+ return g_SearchText;
+}
+
+
+/* Sets the treeview and listviews sizes in accordance with their visibility and the splitters */
+static void ResizeTreeAndListViews(BOOL bResizeHidden)
+{
+ bool bShowPicture = BIT(GetWindowPanes(), 3);
+ int nLastWidth = 0;
+ int nLastWidth2 = 0;
+ int nLeftWindowWidth = 0;
+ RECT rect;
+ BOOL bVisible;
+ //int nLastOverlap = -1;
+
+ /* Size the List Control in the Picker */
+ GetClientRect(hMain, &rect);
+
+ if (bShowStatusBar)
+ rect.bottom -= bottomMargin;
+ if (bShowToolBar)
+ rect.top += topMargin;
+
+ /* Tree control */
+ ShowWindow(GetDlgItem(hMain, IDC_TREE), BIT(GetWindowPanes(), 0) ? SW_SHOW : SW_HIDE);
+
+ for (int i = 0; g_splitterInfo[i].nSplitterWindow; i++)
+ {
+ bVisible = GetWindowLong(GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow), GWL_STYLE) & WS_VISIBLE ? true : false;
+ if (bResizeHidden || bVisible)
+ {
+ nLeftWindowWidth = nSplitterOffset[i] - SPLITTER_WIDTH/2 - nLastWidth;
+
+ /* special case for the rightmost pane when the screenshot is gone */
+ if (!bShowPicture && !g_splitterInfo[i+1].nSplitterWindow)
+ nLeftWindowWidth = rect.right - nLastWidth;
+
+ /* woah? are we overlapping ourselves? */
+ if (nLeftWindowWidth < MIN_VIEW_WIDTH)
+ {
+ //nLastOverlap = i;
+ nLastWidth = nLastWidth2;
+ nLeftWindowWidth = nSplitterOffset[i] - MIN_VIEW_WIDTH - (SPLITTER_WIDTH*3/2) - nLastWidth;
+ i--;
+ }
+
+ MoveWindow(GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow), nLastWidth, rect.top + 2, nLeftWindowWidth, (rect.bottom - rect.top) - 4 , true);
+
+ MoveWindow(GetDlgItem(hMain, g_splitterInfo[i].nSplitterWindow), nSplitterOffset[i], rect.top + 2, SPLITTER_WIDTH, (rect.bottom - rect.top) - 4, true);
+ }
+
+ if (bVisible)
+ {
+ nLastWidth2 = nLastWidth;
+ nLastWidth += nLeftWindowWidth + SPLITTER_WIDTH;
+ }
+ }
+}
+
+/* Adjust the list view and screenshot button based on GetShowScreenShot() */
+void UpdateScreenShot(void)
+{
+ /* first time through can't do this stuff */
+ if (hwndList == NULL)
+ return;
+
+ RECT rect;
+ //int nWidth;
+ RECT fRect;
+ POINT p = {0, 0};
+
+ /* Size the List Control in the Picker */
+ GetClientRect(hMain, &rect);
+
+ if (bShowStatusBar)
+ rect.bottom -= bottomMargin;
+ if (bShowToolBar)
+ rect.top += topMargin;
+
+ BOOL bShowImage = BIT(GetWindowPanes(), 3); // ss
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_PICTURE_AREA, bShowImage ? MF_CHECKED : MF_UNCHECKED);
+ ToolBar_CheckButton(s_hToolBar, ID_VIEW_PICTURE_AREA, bShowImage ? MF_CHECKED : MF_UNCHECKED);
+
+ ResizeTreeAndListViews(false);
+
+ FreeScreenShot();
+
+ if (have_selection)
+ // load and set image, or empty it if we don't have one
+ LoadScreenShot(Picker_GetSelectedItem(hwndList), NULL, TabView_GetCurrentTab(hTabCtrl));
+
+ // figure out if we have a history or not, to place our other windows properly
+ UpdateHistory();
+
+ // setup the picture area
+
+ if (bShowImage)
+ {
+ DWORD dwStyle;
+ DWORD dwStyleEx;
+ BOOL showing_history;
+
+ ClientToScreen(hMain, &p);
+ GetWindowRect(GetDlgItem(hMain, IDC_SSFRAME), &fRect);
+ OffsetRect(&fRect, -p.x, -p.y);
+
+ // show history on this tab IF
+ // - we have history for the game
+ // - we're on the first tab
+ // - we DON'T have a separate history tab
+ showing_history = (have_history && (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() || GetHistoryTab() == TAB_ALL ) && GetShowTab(TAB_HISTORY) == false);
+ CalculateBestScreenShotRect(GetDlgItem(hMain, IDC_SSFRAME), &rect,showing_history);
+
+ dwStyle = GetWindowLong(GetDlgItem(hMain, IDC_SSPICTURE), GWL_STYLE);
+ dwStyleEx = GetWindowLong(GetDlgItem(hMain, IDC_SSPICTURE), GWL_EXSTYLE);
+
+ AdjustWindowRectEx(&rect, dwStyle, false, dwStyleEx);
+ MoveWindow(GetDlgItem(hMain, IDC_SSPICTURE), fRect.left + rect.left, fRect.top + rect.top, rect.right - rect.left, rect.bottom - rect.top, true);
+
+ ShowWindow(GetDlgItem(hMain,IDC_SSPICTURE), (TabView_GetCurrentTab(hTabCtrl) != TAB_HISTORY) ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hMain,IDC_SSFRAME),SW_SHOW);
+ ShowWindow(GetDlgItem(hMain,IDC_SSTAB),bShowTabCtrl ? SW_SHOW : SW_HIDE);
+
+ InvalidateRect(GetDlgItem(hMain,IDC_SSPICTURE),NULL,false);
+ }
+ else
+ {
+ ShowWindow(GetDlgItem(hMain,IDC_SSPICTURE),SW_HIDE);
+ ShowWindow(GetDlgItem(hMain,IDC_SSFRAME),SW_HIDE);
+ ShowWindow(GetDlgItem(hMain,IDC_SSTAB),SW_HIDE);
+ }
+
+}
+
+void ResizePickerControls(HWND hWnd)
+{
+ RECT frameRect;
+ RECT rect, sRect;
+ static BOOL firstTime = true;
+ int doSSControls = true;
+
+ int nSplitterCount = GetSplitterCount();
+
+ /* Size the List Control in the Picker */
+ GetClientRect(hWnd, &rect);
+
+ /* Calc the display sizes based on g_splitterInfo */
+ if (firstTime)
+ {
+ RECT rWindow;
+
+ for (int i = 0; i < nSplitterCount; i++)
+ nSplitterOffset[i] = rect.right * g_splitterInfo[i].dPosition;
+
+ GetWindowRect(hStatusBar, &rWindow);
+ bottomMargin = rWindow.bottom - rWindow.top;
+ GetWindowRect(s_hToolBar, &rWindow);
+ topMargin = rWindow.bottom - rWindow.top;
+ /*buttonMargin = (sRect.bottom + 4); */
+
+ firstTime = false;
+ }
+ else
+ doSSControls = BIT(GetWindowPanes(), 3);
+
+ if (bShowStatusBar)
+ rect.bottom -= bottomMargin;
+
+ if (bShowToolBar)
+ rect.top += topMargin;
+
+ MoveWindow(GetDlgItem(hWnd, IDC_DIVIDER), rect.left, rect.top - 4, rect.right, 2, true);
+
+ ResizeTreeAndListViews(true);
+
+ int nListWidth = nSplitterOffset[nSplitterCount-1];
+ int nScreenShotWidth = (rect.right - nListWidth) - 4;
+
+ /* Screen shot Page tab control */
+ if (bShowTabCtrl)
+ {
+ MoveWindow(GetDlgItem(hWnd, IDC_SSTAB), nListWidth + 4, rect.top + 2, nScreenShotWidth - 2, rect.top + 20, doSSControls);
+ rect.top += 20;
+ }
+
+ /* resize the Screen shot frame */
+ MoveWindow(GetDlgItem(hWnd, IDC_SSFRAME), nListWidth + 4, rect.top + 2, nScreenShotWidth - 2, (rect.bottom - rect.top) - 4, doSSControls);
+
+ /* The screen shot controls */
+ GetClientRect(GetDlgItem(hWnd, IDC_SSFRAME), &frameRect);
+
+ /* Text control - game history */
+ sRect.left = nListWidth + 14;
+ sRect.right = sRect.left + (nScreenShotWidth - 22);
+
+ if (GetShowTab(TAB_HISTORY))
+ {
+ // We're using the new mode, with the history filling the entire tab (almost)
+ sRect.top = rect.top + 14;
+ sRect.bottom = (rect.bottom - rect.top) - 30;
+ }
+ else
+ {
+ // We're using the original mode, with the history beneath the SS picture
+ sRect.top = rect.top + 264;
+ sRect.bottom = (rect.bottom - rect.top) - 278;
+ }
+
+ MoveWindow(GetDlgItem(hWnd, IDC_HISTORY), sRect.left, sRect.top, sRect.right - sRect.left, sRect.bottom, doSSControls);
+
+ /* the other screen shot controls will be properly placed in UpdateScreenshot() */
+}
+
+
+char *ModifyThe(const char *str)
+{
+ static int bufno = 0;
+ static char buffer[4][255];
+
+ if (strncmp(str, "The ", 4) == 0)
+ {
+ char *s, *p;
+ char temp[255];
+
+ strcpy(temp, &str[4]);
+
+ bufno = (bufno + 1) % 4;
+
+ s = buffer[bufno];
+
+ /* Check for version notes in parens */
+ p = strchr(temp, '(');
+ if (p)
+ {
+ p[-1] = '\0';
+ }
+
+ strcpy(s, temp);
+ strcat(s, ", The");
+
+ if (p)
+ {
+ strcat(s, " ");
+ strcat(s, p);
+ }
+
+ return s;
+ }
+ return (char *)str;
+}
+
+HBITMAP GetBackgroundBitmap(void)
+{
+ return hBackground;
+}
+
+HPALETTE GetBackgroundPalette(void)
+{
+ return hPALbg;
+}
+
+MYBITMAPINFO *GetBackgroundInfo(void)
+{
+ return &bmDesc;
+}
+
+BOOL GetUseOldControl(void)
+{
+ return oldControl;
+}
+
+BOOL GetUseXPControl(void)
+{
+ return xpControl;
+}
+
+int GetMinimumScreenShotWindowWidth(void)
+{
+ BITMAP bmp;
+ GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp);
+
+ return bmp.bmWidth + 6; // 6 is for a little breathing room
+}
+
+
+int GetParentIndex(const game_driver *driver)
+{
+ return GetGameNameIndex(driver->parent);
+}
+
+int GetParentRomSetIndex(const game_driver *driver)
+{
+ int nParentIndex = GetGameNameIndex(driver->parent);
+
+ if( nParentIndex >= 0)
+ if ((driver_list::driver(nParentIndex).flags & MACHINE_IS_BIOS_ROOT) == 0)
+ return nParentIndex;
+
+ return -1;
+}
+
+int GetGameNameIndex(const char *name)
+{
+ return driver_list::find(name);
+}
+
+/***************************************************************************
+ Internal functions
+ ***************************************************************************/
+
+
+static void SetMainTitle(void)
+{
+ char version[50];
+ char buffer[100];
+
+ sscanf(GetVersionString(),"%49s",version);
+ snprintf(buffer, ARRAY_LENGTH(buffer), "%s %s", MAMEUINAME, GetVersionString());
+ win_set_window_text_utf8(hMain,buffer);
+}
+
+static void memory_error(const char *message)
+{
+ win_message_box_utf8(hMain, message, emulator_info::get_appname(), MB_OK);
+ exit(-1);
+}
+
+static BOOL Win32UI_init(HINSTANCE hInstance, LPWSTR lpCmdLine, int nCmdShow)
+{
+ extern int mame_validitychecks(int game);
+ WNDCLASS wndclass;
+ RECT rect;
+ int i, nSplitterCount;
+ extern const FOLDERDATA g_folderData[];
+ extern const FILTER_ITEM g_filterList[];
+ LONG common_control_version = GetCommonControlVersion();
+ int validity_failed = 0;
+ LONG_PTR l;
+
+ if (!OptionsInit())
+ return false;
+
+ srand((unsigned)time(NULL));
+
+ // create the memory pool
+ mameui_pool = pool_alloc_lib(memory_error);
+
+ // custom per-game icons
+ icon_index = (int*)pool_malloc_lib(mameui_pool, sizeof(int) * driver_list::total());
+ memset(icon_index, '\0', sizeof(int) * driver_list::total());
+
+ // set up window class
+ wndclass.style = CS_HREDRAW | CS_VREDRAW;
+ wndclass.lpfnWndProc = MameWindowProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = DLGWINDOWEXTRA;
+ wndclass.hInstance = hInstance;
+ wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAMEUI_ICON));
+ wndclass.hCursor = NULL;
+ wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
+ wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_UI_MENU);
+ wndclass.lpszClassName = TEXT("MainClass");
+
+ RegisterClass(&wndclass);
+
+ InitCommonControls();
+
+ // Are we using an Old comctl32.dll?
+ dprintf("common controlversion %ld %ld\n",common_control_version >> 16, common_control_version & 0xffff);
+
+ oldControl = (common_control_version < PACKVERSION(4,71));
+ xpControl = (common_control_version >= PACKVERSION(6,0));
+ if (oldControl)
+ {
+ char buf[] = MAMEUINAME " has detected an old version of comctl32.dll.\n\n"
+ "Various features are not available without an updated DLL.\n\n";
+
+ win_message_box_utf8(0, buf, MAMEUINAME " Outdated comctl32.dll Error", MB_OK | MB_ICONWARNING);
+ return false;
+ }
+
+ g_mame32_message = RegisterWindowMessage(TEXT("MAME32"));
+
+ HelpInit();
+
+ hMain = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MAIN), 0, NULL);
+ if (hMain == NULL)
+ {
+ dprintf("error creating main dialog, aborting\n");
+ return false;
+ }
+
+ s_pWatcher = DirWatcher_Init(hMain, WM_MAME32_FILECHANGED);
+ if (s_pWatcher)
+ {
+ DirWatcher_Watch(s_pWatcher, 0, GetRomDirs(), true);
+ DirWatcher_Watch(s_pWatcher, 1, GetSampleDirs(), true);
+ }
+
+ SetMainTitle();
+ hTabCtrl = GetDlgItem(hMain, IDC_SSTAB);
+
+ {
+ struct TabViewOptions opts;
+
+ static const struct TabViewCallbacks s_tabviewCallbacks =
+ {
+ GetShowTabCtrl, // pfnGetShowTabCtrl
+ SetCurrentTab, // pfnSetCurrentTab
+ GetCurrentTab, // pfnGetCurrentTab
+ SetShowTab, // pfnSetShowTab
+ GetShowTab, // pfnGetShowTab
+
+ GetImageTabShortName, // pfnGetTabShortName
+ GetImageTabLongName, // pfnGetTabLongName
+ UpdateScreenShot // pfnOnSelectionChanged
+ };
+
+ memset(&opts, 0, sizeof(opts));
+ opts.pCallbacks = &s_tabviewCallbacks;
+ opts.nTabCount = MAX_TAB_TYPES;
+
+ if (!SetupTabView(hTabCtrl, &opts))
+ return false;
+ }
+
+ /* subclass history window */
+ l = GetWindowLongPtr(GetDlgItem(hMain, IDC_HISTORY), GWLP_WNDPROC);
+ g_lpHistoryWndProc = (WNDPROC)l;
+ SetWindowLongPtr(GetDlgItem(hMain, IDC_HISTORY), GWLP_WNDPROC, (LONG_PTR)HistoryWndProc);
+
+ /* subclass picture frame area */
+ l = GetWindowLongPtr(GetDlgItem(hMain, IDC_SSFRAME), GWLP_WNDPROC);
+ g_lpPictureFrameWndProc = (WNDPROC)l;
+ SetWindowLongPtr(GetDlgItem(hMain, IDC_SSFRAME), GWLP_WNDPROC, (LONG_PTR)PictureFrameWndProc);
+
+ /* subclass picture area */
+ l = GetWindowLongPtr(GetDlgItem(hMain, IDC_SSPICTURE), GWLP_WNDPROC);
+ g_lpPictureWndProc = (WNDPROC)l;
+ SetWindowLongPtr(GetDlgItem(hMain, IDC_SSPICTURE), GWLP_WNDPROC, (LONG_PTR)PictureWndProc);
+
+ /* Load the pic for the default screenshot. */
+ hMissing_bitmap = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_ABOUT));
+
+ /* Stash hInstance for later use */
+ hInst = hInstance;
+
+ s_hToolBar = InitToolbar(hMain);
+ hStatusBar = InitStatusBar(hMain);
+ hProgWnd = InitProgressBar(hStatusBar);
+
+ main_resize_items[0].u.hwnd = s_hToolBar;
+ main_resize_items[1].u.hwnd = hStatusBar;
+
+ /* In order to handle 'Large Fonts' as the Windows
+ * default setting, we need to make the dialogs small
+ * enough to fit in our smallest window size with
+ * large fonts, then resize the picker, tab and button
+ * controls to fill the window, no matter which font
+ * is currently set. This will still look like bad
+ * if the user uses a bigger default font than 125%
+ * (Large Fonts) on the Windows display setting tab.
+ *
+ * NOTE: This has to do with Windows default font size
+ * settings, NOT our picker font size.
+ */
+
+ GetClientRect(hMain, &rect);
+
+ hTreeView = GetDlgItem(hMain, IDC_TREE);
+ hwndList = GetDlgItem(hMain, IDC_LIST);
+
+ if (!InitSplitters())
+ return false;
+
+ nSplitterCount = GetSplitterCount();
+ for (i = 0; i < nSplitterCount; i++)
+ {
+ HWND hWnd;
+ HWND hWndLeft;
+ HWND hWndRight;
+
+ hWnd = GetDlgItem(hMain, g_splitterInfo[i].nSplitterWindow);
+ hWndLeft = GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow);
+ hWndRight = GetDlgItem(hMain, g_splitterInfo[i].nRightWindow);
+
+ AddSplitter(hWnd, hWndLeft, hWndRight, g_splitterInfo[i].pfnAdjust);
+ }
+
+ /* Initial adjustment of controls on the Picker window */
+ ResizePickerControls(hMain);
+
+ TabView_UpdateSelection(hTabCtrl);
+
+ bDoGameCheck = GetGameCheck();
+ idle_work = true;
+ game_index = 0;
+
+ BOOL bShowTree = BIT(GetWindowPanes(), 0);
+ bShowToolBar = GetShowToolBar();
+ bShowStatusBar = GetShowStatusBar();
+ bShowTabCtrl = GetShowTabCtrl();
+
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED);
+ ToolBar_CheckButton(s_hToolBar, ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED);
+ ShowWindow(s_hToolBar, (bShowToolBar) ? SW_SHOW : SW_HIDE);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED);
+ ShowWindow(hStatusBar, (bShowStatusBar) ? SW_SHOW : SW_HIDE);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_PAGETAB, (bShowTabCtrl) ? MF_CHECKED : MF_UNCHECKED);
+
+ if (oldControl)
+ {
+ EnableMenuItem(GetMenu(hMain), ID_CUSTOMIZE_FIELDS, MF_GRAYED);
+ EnableMenuItem(GetMenu(hMain), ID_GAME_PROPERTIES, MF_GRAYED);
+ EnableMenuItem(GetMenu(hMain), ID_OPTIONS_DEFAULTS, MF_GRAYED);
+ }
+
+#ifdef UI_DIRECTDRAW
+ /* Init DirectDraw */
+ if (!DirectDraw_Initialize())
+ {
+ DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_DIRECTX), NULL, DirectXDialogProc);
+ return false;
+ }
+#endif
+
+ LoadBackgroundBitmap();
+
+ dprintf("about to init tree\n");
+ InitTree(g_folderData, g_filterList);
+ dprintf("did init tree\n");
+
+ /* Initialize listview columns */
+ InitListView();
+ SetFocus(hwndList);
+
+ /* Reset the font */
+ {
+ LOGFONT logfont;
+
+ GetListFont(&logfont);
+ if (hFont ) {
+ //Clenaup old Font, otherwise we have a GDI handle leak
+ DeleteFont(hFont);
+ }
+ hFont = CreateFontIndirect(&logfont);
+ if (hFont )
+ SetAllWindowsFont(hMain, &main_resize, hFont, false);
+ }
+
+ /* Init DirectInput */
+ if (!DirectInputInitialize())
+ {
+ DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_DIRECTX), NULL, DirectXDialogProc);
+ return false;
+ }
+
+ AdjustMetrics();
+ UpdateScreenShot();
+
+ hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_TAB_KEYS));
+
+ /* clear keyboard state */
+ KeyboardStateClear();
+
+ if (GetJoyGUI() == true)
+ {
+ g_pJoyGUI = &DIJoystick;
+ if (g_pJoyGUI->init() != 0)
+ g_pJoyGUI = NULL;
+ else
+ SetTimer(hMain, JOYGUI_TIMER, JOYGUI_MS, NULL);
+ }
+ else
+ g_pJoyGUI = NULL;
+
+ if (GetHideMouseOnStartup())
+ {
+ /* For some reason the mouse is centered when a game is exited, which of
+ course causes a WM_MOUSEMOVE event that shows the mouse. So we center
+ it now, before the startup coords are initilized, and that way the mouse
+ will still be hidden when exiting from a game (i hope) :)
+ */
+ SetCursorPos(GetSystemMetrics(SM_CXSCREEN)/2,GetSystemMetrics(SM_CYSCREEN)/2);
+
+ // Then hide it
+ ShowCursor(false);
+ }
+
+ nCmdShow = GetWindowState();
+ if (nCmdShow == SW_HIDE || nCmdShow == SW_MINIMIZE || nCmdShow == SW_SHOWMINIMIZED)
+ {
+ nCmdShow = SW_RESTORE;
+ }
+
+ if (GetRunFullScreen())
+ {
+ LONG lMainStyle;
+
+ // Remove menu
+ SetMenu(hMain,NULL);
+
+ // Frameless dialog (fake fullscreen)
+ lMainStyle = GetWindowLong(hMain, GWL_STYLE);
+ lMainStyle = lMainStyle & (WS_BORDER ^ 0xffffffff);
+ SetWindowLong(hMain, GWL_STYLE, lMainStyle);
+
+ nCmdShow = SW_MAXIMIZE;
+ }
+
+ ShowWindow(hMain, nCmdShow);
+
+ switch (GetViewMode())
+ {
+ case VIEW_LARGE_ICONS :
+ SetView(ID_VIEW_LARGE_ICON);
+ break;
+ case VIEW_SMALL_ICONS :
+ SetView(ID_VIEW_SMALL_ICON);
+ break;
+ case VIEW_INLIST :
+ SetView(ID_VIEW_LIST_MENU);
+ break;
+ case VIEW_REPORT :
+ SetView(ID_VIEW_DETAIL);
+ break;
+ case VIEW_GROUPED :
+ default :
+ SetView(ID_VIEW_GROUPED);
+ break;
+ }
+
+ if (GetCycleScreenshot() > 0)
+ {
+ SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL); //scale to Seconds
+ }
+
+ if (validity_failed)
+ {
+ win_message_box_utf8(hMain, MAMEUINAME " has failed its validity checks. The GUI will "
+ "still work, but emulations will fail to execute", MAMEUINAME, MB_OK | MB_ICONERROR);
+ }
+
+ return true;
+}
+
+
+static void Win32UI_exit()
+{
+ if (g_pJoyGUI)
+ g_pJoyGUI->exit();
+
+ /* Free GDI resources */
+ if (hMain) {
+ DeleteObject(hMain);
+ hMain = NULL;
+ }
+
+ if (hMissing_bitmap)
+ {
+ DeleteBitmap(hMissing_bitmap);
+ hMissing_bitmap = NULL;
+ }
+
+ if (hBackground)
+ {
+ DeleteBitmap(hBackground);
+ hBackground = NULL;
+ }
+
+ if (hPALbg)
+ {
+ DeletePalette(hPALbg);
+ hPALbg = NULL;
+ }
+
+ if (hFont)
+ {
+ DeleteFont(hFont);
+ hFont = NULL;
+ }
+
+ DestroyIcons();
+
+ DestroyAcceleratorTable(hAccel);
+
+ DirectInputClose();
+#ifdef UI_DIRECTDRAW
+ DirectDraw_Close();
+#endif
+
+ SetSavedFolderID(GetCurrentFolderID());
+ SaveGameListOptions();
+ //SaveDefaultOptions();
+ SaveOptions();
+
+ FreeFolders();
+
+ /* DestroyTree(hTreeView); */
+
+ FreeScreenShot();
+
+ HelpExit();
+
+ pool_free_lib(mameui_pool);
+ mameui_pool = NULL;
+}
+
+static LRESULT CALLBACK MameWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ MINMAXINFO *mminfo;
+ int i;
+ TCHAR szClass[128];
+ BOOL res;
+
+ switch (message)
+ {
+ case WM_CTLCOLORSTATIC:
+ if (hBackground && (HWND)lParam == GetDlgItem(hMain, IDC_HISTORY))
+ {
+ static HBRUSH hBrush=0;
+ HDC hDC=(HDC)wParam;
+ LOGBRUSH lb;
+
+ if (hBrush)
+ DeleteBrush(hBrush);
+ lb.lbStyle = BS_HOLLOW;
+ hBrush = CreateBrushIndirect(&lb);
+ SetBkMode(hDC, TRANSPARENT);
+ SetTextColor(hDC, GetListFontColor());
+ return (LRESULT) hBrush;
+ }
+ break;
+
+ case WM_INITDIALOG:
+ /* Initialize info for resizing subitems */
+ GetClientRect(hWnd, &main_resize.rect);
+ return true;
+
+ case WM_SETFOCUS:
+ SetFocus(hwndList);
+ break;
+
+ case WM_SETTINGCHANGE:
+ AdjustMetrics();
+ return 0;
+
+ case WM_SIZE:
+ OnSize(hWnd, wParam, LOWORD(lParam), HIWORD(wParam));
+ return true;
+
+ case WM_MENUSELECT:
+ return Statusbar_MenuSelect(hWnd, wParam, lParam);
+
+ case MM_PLAY_GAME:
+ MamePlayGame();
+ return true;
+
+ case WM_INITMENUPOPUP:
+ UpdateMenu(GetMenu(hWnd));
+ break;
+
+ case WM_CONTEXTMENU:
+ if (HandleTreeContextMenu(hWnd, wParam, lParam) || HandleScreenShotContextMenu(hWnd, wParam, lParam))
+ return false;
+ break;
+
+ case WM_COMMAND:
+ return MameCommand(hWnd,(int)(LOWORD(wParam)),(HWND)(lParam),(UINT)HIWORD(wParam));
+
+ case WM_GETMINMAXINFO:
+ /* Don't let the window get too small; it can break resizing */
+ mminfo = (MINMAXINFO *) lParam;
+ mminfo->ptMinTrackSize.x = MIN_WIDTH;
+ mminfo->ptMinTrackSize.y = MIN_HEIGHT;
+ return 0;
+
+ case WM_TIMER:
+ switch (wParam)
+ {
+ case JOYGUI_TIMER:
+ PollGUIJoystick();
+ break;
+ case SCREENSHOT_TIMER:
+ TabView_CalculateNextTab(hTabCtrl);
+ UpdateScreenShot();
+ TabView_UpdateSelection(hTabCtrl);
+ break;
+ default:
+ break;
+ }
+ return true;
+
+ case WM_CLOSE:
+ {
+ /* save current item */
+ RECT rect;
+ AREA area;
+ int nItem;
+ WINDOWPLACEMENT wndpl;
+ UINT state;
+
+ wndpl.length = sizeof(WINDOWPLACEMENT);
+ GetWindowPlacement(hMain, &wndpl);
+ state = wndpl.showCmd;
+
+ /* Restore the window before we attempt to save parameters,
+ * This fixed the lost window on startup problem, among other problems
+ */
+ if (state == SW_MINIMIZE || state == SW_SHOWMINIMIZED || state == SW_MAXIMIZE)
+ {
+ if( wndpl.flags & WPF_RESTORETOMAXIMIZED || state == SW_MAXIMIZE)
+ state = SW_MAXIMIZE;
+ else
+ state = SW_RESTORE;
+
+ ShowWindow(hWnd, SW_RESTORE);
+ }
+
+ /* Restore the window before we attempt to save parameters,
+ * This fixed the lost window on startup problem, among other problems
+ */
+ if (state == SW_MAXIMIZE)
+ ShowWindow(hWnd, SW_RESTORE);
+
+ for (i = 0; i < GetSplitterCount(); i++)
+ SetSplitterPos(i, nSplitterOffset[i]);
+ SetWindowState(state);
+
+ for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++)
+ Picker_SaveColumnWidths(GetDlgItem(hMain, s_nPickers[i]));
+
+ GetWindowRect(hWnd, &rect);
+ area.x = rect.left;
+ area.y = rect.top;
+ area.width = rect.right - rect.left;
+ area.height = rect.bottom - rect.top;
+ SetWindowArea(&area);
+
+ /* Save the users current game options and default game */
+ nItem = Picker_GetSelectedItem(hwndList);
+ if (nItem >= 0)
+ SetDefaultGame(nItem);
+
+ /* hide window to prevent orphan empty rectangles on the taskbar */
+ /* ShowWindow(hWnd,SW_HIDE); */
+ DestroyWindow( hWnd );
+
+ /* PostQuitMessage(0); */
+ break;
+ }
+
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ return 0;
+
+ case WM_LBUTTONDOWN:
+ OnLButtonDown(hWnd, (UINT)wParam, MAKEPOINTS(lParam));
+ break;
+
+ /*
+ Check to see if the mouse has been moved by the user since
+ startup. I'd like this checking to be done only in the
+ main WinProc (here), but somehow the WM_MOUSEDOWN messages
+ are eaten up before they reach MameWindowProc. That's why
+ there is one check for each of the subclassed windows too.
+
+ POSSIBLE BUGS:
+ I've included this check in the subclassed windows, but a
+ mose move in either the title bar, the menu, or the
+ toolbar will not generate a WM_MOUSEOVER message. At least
+ not one that I know how to pick up. A solution could maybe
+ be to subclass those too, but that's too much work :)
+ */
+
+ case WM_MOUSEMOVE:
+ {
+ if (MouseHasBeenMoved())
+ ShowCursor(true);
+
+ if (g_listview_dragging)
+ MouseMoveListViewDrag(MAKEPOINTS(lParam));
+ else
+ /* for splitters */
+ OnMouseMove(hWnd, (UINT)wParam, MAKEPOINTS(lParam));
+ break;
+ }
+
+ case WM_LBUTTONUP:
+ if (g_listview_dragging)
+ ButtonUpListViewDrag(MAKEPOINTS(lParam));
+ else
+ /* for splitters */
+ OnLButtonUp(hWnd, (UINT)wParam, MAKEPOINTS(lParam));
+ break;
+
+ case WM_NOTIFY:
+ /* Where is this message intended to go */
+ {
+ LPNMHDR lpNmHdr = (LPNMHDR)lParam;
+
+ /* Fetch tooltip text */
+ if (lpNmHdr->code == TTN_NEEDTEXT)
+ {
+ LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT)lParam;
+ CopyToolTipText(lpttt);
+ }
+
+ if (lpNmHdr->hwndFrom == hTreeView)
+ return TreeViewNotify(lpNmHdr);
+
+ GetClassName(lpNmHdr->hwndFrom, szClass, sizeof(szClass) / sizeof(szClass[0]));
+ if (!_tcscmp(szClass, TEXT("SysListView32")))
+ return Picker_HandleNotify(lpNmHdr);
+ if (!_tcscmp(szClass, TEXT("SysTabControl32")))
+ return TabView_HandleNotify(lpNmHdr);
+ }
+ break;
+
+ case WM_DRAWITEM:
+ {
+ LPDRAWITEMSTRUCT lpDis = (LPDRAWITEMSTRUCT)lParam;
+
+ GetClassName(lpDis->hwndItem, szClass, sizeof(szClass) / sizeof(szClass[0]));
+ if (!_tcscmp(szClass, TEXT("SysListView32")))
+ Picker_HandleDrawItem(GetDlgItem(hMain, lpDis->CtlID), lpDis);
+ }
+ break;
+
+ case WM_MEASUREITEM :
+ {
+ LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam;
+
+ // tell the list view that each row (item) should be just taller than our font
+
+ //DefWindowProc(hWnd, message, wParam, lParam);
+ //dprintf("default row height calculation gives %u\n",lpmis->itemHeight);
+
+ TEXTMETRIC tm;
+ HDC hDC = GetDC(NULL);
+ HFONT hFontOld = (HFONT)SelectObject(hDC,hFont);
+
+ GetTextMetrics(hDC,&tm);
+
+ lpmis->itemHeight = tm.tmHeight + tm.tmExternalLeading + 1;
+ if (lpmis->itemHeight < 17)
+ lpmis->itemHeight = 17;
+ //dprintf("we would do %u\n",tm.tmHeight + tm.tmExternalLeading + 1);
+ SelectObject(hDC,hFontOld);
+ ReleaseDC(NULL,hDC);
+
+ return true;
+ }
+
+ case WM_MAME32_FILECHANGED:
+ {
+ char szFileName[32];
+ char *s;
+ int nGameIndex;
+ int (*pfnGetAuditResults)(uint32_t driver_index) = NULL;
+ void (*pfnSetAuditResults)(uint32_t driver_index, int audit_results) = NULL;
+
+ switch(HIWORD(wParam))
+ {
+ case 0:
+ pfnGetAuditResults = GetRomAuditResults;
+ pfnSetAuditResults = SetRomAuditResults;
+ break;
+
+ case 1:
+ pfnGetAuditResults = GetSampleAuditResults;
+ pfnSetAuditResults = SetSampleAuditResults;
+ break;
+ }
+
+ if (pfnGetAuditResults && pfnSetAuditResults)
+ {
+ int nParentIndex = -1;
+
+ snprintf(szFileName, sizeof(szFileName), "%s", (LPCSTR) lParam);
+ s = strchr(szFileName, '.');
+ if (s)
+ *s = '\0';
+ s = strchr(szFileName, '\\');
+ if (s)
+ *s = '\0';
+
+ for (nGameIndex = 0; nGameIndex < driver_list::total(); nGameIndex++)
+ {
+ for (nParentIndex = nGameIndex; nGameIndex == -1; nParentIndex = GetParentIndex(&driver_list::driver(nParentIndex)))
+ {
+ if (!core_stricmp(driver_list::driver(nParentIndex).name, szFileName))
+ {
+ if (pfnGetAuditResults(nGameIndex) != UNKNOWN)
+ {
+ pfnSetAuditResults(nGameIndex, UNKNOWN);
+ PostMessage(hMain, WM_MAME32_AUDITGAME, wParam, nGameIndex);
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case WM_MAME32_AUDITGAME:
+ {
+ LV_FINDINFO lvfi;
+ int nGameIndex;
+
+ nGameIndex = lParam;
+
+ switch(HIWORD(wParam))
+ {
+ case 0:
+ MameUIVerifyRomSet(nGameIndex, 0);
+ break;
+ case 1:
+ MameUIVerifySampleSet(nGameIndex);
+ break;
+ }
+
+ memset(&lvfi, 0, sizeof(lvfi));
+ lvfi.flags = LVFI_PARAM;
+ lvfi.lParam = nGameIndex;
+
+ i = ListView_FindItem(hwndList, -1, &lvfi);
+ if (i != -1)
+ {
+ res = ListView_RedrawItems(hwndList, i, i);
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ res++;
+ return DefWindowProc(hWnd, message, wParam, lParam);
+}
+
+static int HandleKeyboardGUIMessage(HWND hWnd, UINT message, UINT wParam, LONG lParam)
+{
+ switch (message)
+ {
+ case WM_CHAR: /* List-View controls use this message for searching the items "as user types" */
+ //MessageBox(NULL,"wm_char message arrived","TitleBox",MB_OK);
+ return true;
+
+ case WM_KEYDOWN:
+ KeyboardKeyDown(0, wParam, lParam);
+ return true;
+
+ case WM_KEYUP:
+ KeyboardKeyUp(0, wParam, lParam);
+ return true;
+
+ case WM_SYSKEYDOWN:
+ KeyboardKeyDown(1, wParam, lParam);
+ return true;
+
+ case WM_SYSKEYUP:
+ KeyboardKeyUp(1, wParam, lParam);
+ return true;
+ }
+
+ return false; /* message not processed */
+}
+
+static BOOL PumpMessage()
+{
+ MSG msg;
+
+ if (!GetMessage(&msg, NULL, 0, 0))
+ return false;
+
+ if (IsWindow(hMain))
+ {
+ BOOL absorbed_key = false;
+ if (GetKeyGUI())
+ absorbed_key = HandleKeyboardGUIMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
+ else
+ absorbed_key = TranslateAccelerator(hMain, hAccel, &msg);
+
+ if (!absorbed_key)
+ {
+ if (!IsDialogMessage(hMain, &msg))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+ }
+
+ return true;
+}
+
+static BOOL FolderCheck(void)
+{
+
+ const char *pDescription = NULL;
+ int nGameIndex = 0;
+ int i=0;
+ int iStep = 0;
+ LV_FINDINFO lvfi;
+ int nCount = ListView_GetItemCount(hwndList);
+ BOOL changed = false;
+ BOOL res;
+
+ MSG msg;
+ for(i=0; i<nCount;i++)
+ {
+ LV_ITEM lvi;
+
+ lvi.iItem = i;
+ lvi.iSubItem = 0;
+ lvi.mask = LVIF_PARAM;
+ res = ListView_GetItem(hwndList, &lvi);
+ nGameIndex = lvi.lParam;
+ SetRomAuditResults(nGameIndex, UNKNOWN);
+ SetSampleAuditResults(nGameIndex, UNKNOWN);
+ }
+ if( nCount > 0)
+ ProgressBarShow();
+ else
+ return false;
+ if( nCount < 100 )
+ iStep = 100 / nCount;
+ else
+ iStep = nCount/100;
+ UpdateListView();
+ UpdateWindow(hMain);
+ for(i=0; i<nCount;i++)
+ {
+ LV_ITEM lvi;
+
+ lvi.iItem = i;
+ lvi.iSubItem = 0;
+ lvi.mask = LVIF_PARAM;
+ res = ListView_GetItem(hwndList, &lvi);
+ nGameIndex = lvi.lParam;
+ if (GetRomAuditResults(nGameIndex) == UNKNOWN)
+ {
+ MameUIVerifyRomSet(nGameIndex, 0);
+ changed = true;
+ }
+
+ if (GetSampleAuditResults(nGameIndex) == UNKNOWN)
+ {
+ MameUIVerifySampleSet(nGameIndex);
+ changed = true;
+ }
+
+ lvfi.flags = LVFI_PARAM;
+ lvfi.lParam = nGameIndex;
+
+ i = ListView_FindItem(hwndList, -1, &lvfi);
+ if (changed && i != -1)
+ {
+ res = ListView_RedrawItems(hwndList, i, i);
+ while( PeekMessage( &msg, hwndList, 0, 0, PM_REMOVE ) != 0)
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+ changed = false;
+ if ((i % iStep) == 0)
+ ProgressBarStepParam(i, nCount);
+ }
+ ProgressBarHide();
+ if (Picker_GetSelectedItem(hwndList) >= 0)
+ pDescription = ModifyThe(driver_list::driver(Picker_GetSelectedItem(hwndList)).type.fullname());
+ else
+ pDescription = "No Selection";
+ SetStatusBarText(0, pDescription);
+ UpdateStatusBar();
+ res++;
+ return true;
+}
+
+static BOOL GameCheck(void)
+{
+ LV_FINDINFO lvfi;
+ int i;
+ BOOL changed = false;
+ BOOL res;
+
+ if (game_index == 0)
+ ProgressBarShow();
+
+ if (game_index >= driver_list::total())
+ {
+ bDoGameCheck = false;
+ ProgressBarHide();
+ ResetWhichGamesInFolders();
+ return false;
+ }
+
+ if (GetRomAuditResults(game_index) == UNKNOWN)
+ {
+ MameUIVerifyRomSet(game_index, 0);
+ changed = true;
+ }
+
+ if (GetSampleAuditResults(game_index) == UNKNOWN)
+ {
+ MameUIVerifySampleSet(game_index);
+ changed = true;
+ }
+
+ lvfi.flags = LVFI_PARAM;
+ lvfi.lParam = game_index;
+
+ i = ListView_FindItem(hwndList, -1, &lvfi);
+ if (changed && i != -1)
+ res = ListView_RedrawItems(hwndList, i, i);
+ if ((game_index % progBarStep) == 0)
+ ProgressBarStep();
+ game_index++;
+ res++;
+ return changed;
+}
+
+static BOOL OnIdle(HWND hWnd)
+{
+ static int bFirstTime = true;
+ static int bResetList = true;
+
+ const char *pDescription;
+ int driver_index;
+
+ if (bFirstTime)
+ {
+ bResetList = false;
+ bFirstTime = false;
+ }
+ if (bDoGameCheck)
+ {
+ bResetList |= GameCheck();
+ return idle_work;
+ }
+ // NPW 17-Jun-2003 - Commenting this out because it is redundant
+ // and it causes the game to reset back to the original game after an F5
+ // refresh
+ //driver_index = GetGameNameIndex(GetDefaultGame());
+ //SetSelectedPickItem(driver_index);
+
+ // in case it's not found, get it back
+ driver_index = Picker_GetSelectedItem(hwndList);
+ if (driver_index >= 0)
+ pDescription = ModifyThe(driver_list::driver(driver_index).type.fullname());
+ else
+ pDescription = "No Selection";
+
+ SetStatusBarText(0, pDescription);
+ idle_work = false;
+ UpdateStatusBar();
+ bFirstTime = true;
+
+ if (!idle_work)
+ PostMessage(GetMainWindow(),WM_COMMAND, MAKEWPARAM(ID_VIEW_LINEUPICONS, true),(LPARAM)NULL);
+ return idle_work;
+}
+
+static void OnSize(HWND hWnd, UINT nState, int nWidth, int nHeight)
+{
+ static BOOL firstTime = true;
+
+ if (nState != SIZE_MAXIMIZED && nState != SIZE_RESTORED)
+ return;
+
+ ResizeWindow(hWnd, &main_resize);
+ ResizeProgressBar();
+ if (firstTime == false)
+ OnSizeSplitter(hMain);
+ //firstTime = false;
+ /* Update the splitters structures as appropriate */
+ RecalcSplitters();
+ if (firstTime == false)
+ ResizePickerControls(hMain);
+ firstTime = false;
+ UpdateScreenShot();
+}
+
+
+
+static HWND GetResizeItemWindow(HWND hParent, const ResizeItem *ri)
+{
+ HWND hControl;
+ if (ri->type == RA_ID)
+ hControl = GetDlgItem(hParent, ri->u.id);
+ else
+ hControl = ri->u.hwnd;
+ return hControl;
+}
+
+
+
+static void SetAllWindowsFont(HWND hParent, const Resize *r, HFONT hTheFont, BOOL bRedraw)
+{
+ int i;
+ HWND hControl;
+
+ for (i = 0; r->items[i].type != RA_END; i++)
+ {
+ hControl = GetResizeItemWindow(hParent, &r->items[i]);
+ if (r->items[i].setfont)
+ {
+ SetWindowFont(hControl, hTheFont, bRedraw);
+ }
+ /* Take care of subcontrols, if appropriate */
+ if (r->items[i].subwindow )
+ SetAllWindowsFont(hControl, (const Resize*)r->items[i].subwindow, hTheFont, bRedraw);
+
+ }
+}
+
+
+
+static void ResizeWindow(HWND hParent, Resize *r)
+{
+ int cmkindex = 0, dx, dy;
+ HWND hControl;
+ RECT parent_rect, rect;
+ const ResizeItem *ri;
+ POINT p = {0, 0};
+
+ if (hParent == NULL)
+ return;
+
+ /* Calculate change in width and height of parent window */
+ GetClientRect(hParent, &parent_rect);
+ dy = parent_rect.bottom - r->rect.bottom;
+ dx = parent_rect.right - r->rect.right;
+ ClientToScreen(hParent, &p);
+
+ while (r->items[cmkindex].type != RA_END)
+ {
+ int width, height;
+ ri = &r->items[cmkindex];
+ if (ri->type == RA_ID)
+ hControl = GetDlgItem(hParent, ri->u.id);
+ else
+ hControl = ri->u.hwnd;
+
+ if (hControl == NULL)
+ {
+ cmkindex++;
+ continue;
+ }
+
+ /* Get control's rectangle relative to parent */
+ GetWindowRect(hControl, &rect);
+ OffsetRect(&rect, -p.x, -p.y);
+ width = rect.right - rect.left;
+ height = rect.bottom - rect.top;
+
+ if (!(ri->action & RA_LEFT))
+ rect.left += dx;
+
+ if (!(ri->action & RA_TOP))
+ rect.top += dy;
+
+ if (ri->action & RA_RIGHT)
+ rect.right += dx;
+
+ if (ri->action & RA_BOTTOM)
+ rect.bottom += dy;
+ //Sanity Check the child rect
+ if (parent_rect.top > rect.top)
+ rect.top = parent_rect.top;
+ if (parent_rect.left > rect.left)
+ rect.left = parent_rect.left;
+ if (parent_rect.bottom < rect.bottom)
+ {
+ rect.bottom = parent_rect.bottom;
+ //ensure we have at least a minimal height
+ rect.top = rect.bottom - height;
+ if (rect.top < parent_rect.top)
+ rect.top = parent_rect.top;
+ }
+ if (parent_rect.right < rect.right)
+ {
+ rect.right = parent_rect.right;
+ //ensure we have at least a minimal width
+ rect.left = rect.right - width;
+ if (rect.left < parent_rect.left)
+ rect.left = parent_rect.left;
+ }
+ MoveWindow(hControl, rect.left, rect.top,
+ (rect.right - rect.left),
+ (rect.bottom - rect.top), true);
+
+ /* Take care of subcontrols, if appropriate */
+ if (ri->subwindow )
+ ResizeWindow(hControl, (Resize*)ri->subwindow);
+
+ cmkindex++;
+ }
+
+ /* Record parent window's new location */
+ memcpy(&r->rect, &parent_rect, sizeof(RECT));
+}
+
+static void ProgressBarShow()
+{
+ RECT rect;
+ int widths[2] = {150, -1};
+
+ if (driver_list::total() < 100)
+ progBarStep = 100 / driver_list::total();
+ else
+ progBarStep = (driver_list::total() / 100);
+
+ SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)2, (LPARAM)(LPINT)widths);
+ SendMessage(hProgWnd, PBM_SETRANGE, 0, (LPARAM)MAKELONG(0, driver_list::total()));
+ SendMessage(hProgWnd, PBM_SETSTEP, (WPARAM)progBarStep, 0);
+ SendMessage(hProgWnd, PBM_SETPOS, 0, 0);
+
+ StatusBar_GetItemRect(hStatusBar, 1, &rect);
+
+ MoveWindow(hProgWnd, rect.left, rect.top,
+ rect.right - rect.left,
+ rect.bottom - rect.top, true);
+
+ bProgressShown = true;
+}
+
+static void ProgressBarHide()
+{
+ RECT rect;
+ int widths[4];
+ HDC hDC;
+ SIZE size;
+ int numParts = 4;
+
+ if (hProgWnd == NULL)
+ return;
+
+ hDC = GetDC(hProgWnd);
+
+ ShowWindow(hProgWnd, SW_HIDE);
+
+ GetTextExtentPoint32(hDC, TEXT("MMX"), 3, &size);
+ widths[3] = size.cx;
+ GetTextExtentPoint32(hDC, TEXT("MMMM games"), 10, &size);
+ widths[2] = size.cx;
+ //Just specify 24 instead of 30, gives us sufficient space to display the message, and saves some space
+ GetTextExtentPoint32(hDC, TEXT("Screen flip support is missing"), 24, &size);
+ widths[1] = size.cx;
+
+ ReleaseDC(hProgWnd, hDC);
+
+ widths[0] = -1;
+ SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)1, (LPARAM)(LPINT)widths);
+ StatusBar_GetItemRect(hStatusBar, 0, &rect);
+
+ widths[0] = (rect.right - rect.left) - (widths[1] + widths[2] + widths[3]);
+ widths[1] += widths[0];
+ widths[2] += widths[1];
+ widths[3] = -1;
+
+ SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)numParts, (LPARAM)(LPINT)widths);
+ UpdateStatusBar();
+
+ bProgressShown = false;
+}
+
+static void ResizeProgressBar()
+{
+ if (bProgressShown)
+ {
+ RECT rect;
+ int widths[2] = {150, -1};
+
+ SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)2, (LPARAM)(LPINT)widths);
+ StatusBar_GetItemRect(hStatusBar, 1, &rect);
+ MoveWindow(hProgWnd, rect.left, rect.top,
+ rect.right - rect.left,
+ rect.bottom - rect.top, true);
+ }
+ else
+ {
+ ProgressBarHide();
+ }
+}
+
+static void ProgressBarStepParam(int iGameIndex, int nGameCount)
+{
+ SetStatusBarTextF(0, "Game search %d%% complete", ((iGameIndex + 1) * 100) / nGameCount);
+ if (iGameIndex == 0)
+ ShowWindow(hProgWnd, SW_SHOW);
+ SendMessage(hProgWnd, PBM_STEPIT, 0, 0);
+}
+
+static void ProgressBarStep()
+{
+ ProgressBarStepParam(game_index, driver_list::total());
+}
+
+static HWND InitProgressBar(HWND hParent)
+{
+ RECT rect;
+
+ StatusBar_GetItemRect(hStatusBar, 0, &rect);
+
+ rect.left += 150;
+
+ return CreateWindowEx(WS_EX_STATICEDGE, PROGRESS_CLASS, TEXT("Progress Bar"),
+ WS_CHILD | PBS_SMOOTH, rect.left, rect.top, rect.right - rect.left,
+ rect.bottom - rect.top, hParent, NULL, hInst, NULL);
+}
+
+static void CopyToolTipText(LPTOOLTIPTEXT lpttt)
+{
+ int i;
+ int iButton = lpttt->hdr.idFrom;
+ static TCHAR String[1024];
+ BOOL bConverted = false;
+ TCHAR* t_gameinfostatus;
+
+ /* Map command ID to string index */
+ for (i = 0; CommandToString[i] != -1; i++)
+ {
+ if (CommandToString[i] == iButton)
+ {
+ iButton = i;
+ bConverted = true;
+ break;
+ }
+ }
+ if( bConverted )
+ {
+ /* Check for valid parameter */
+ if(iButton > NUM_TOOLTIPS)
+ {
+ _tcscpy(String,TEXT("Invalid Button Index"));
+ }
+ else
+ {
+ _tcscpy(String,szTbStrings[iButton]);
+ }
+ }
+ else if ( iButton <= 2 )
+ {
+ //Statusbar
+ SendMessage(lpttt->hdr.hwndFrom, TTM_SETMAXTIPWIDTH, 0, 200);
+ if( iButton != 1)
+ SendMessage(hStatusBar, SB_GETTEXT, (WPARAM)iButton, (LPARAM)&String );
+ else {
+ //for first pane we get the Status directly, to get the line breaks
+ t_gameinfostatus = ui_wstring_from_utf8( GameInfoStatus(Picker_GetSelectedItem(hwndList), false));
+ if( !t_gameinfostatus )
+ return;
+ _tcscpy(String, t_gameinfostatus);
+ free(t_gameinfostatus);
+ }
+ }
+ else
+ _tcscpy(String,TEXT("Invalid Button Index"));
+
+ lpttt->lpszText = String;
+}
+
+static HWND InitToolbar(HWND hParent)
+{
+ HWND hToolBar = CreateToolbarEx(hParent,
+ WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
+ CCS_TOP | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, 1, 8,
+ hInst, IDB_TOOLBAR, tbb, NUM_TOOLBUTTONS, 16, 16, 0, 0, sizeof(TBBUTTON));
+ RECT rect;
+ int idx;
+ int iPosX, iPosY, iHeight;
+
+ // get Edit Control position
+ idx = SendMessage(hToolBar, TB_BUTTONCOUNT, (WPARAM)0, (LPARAM)0) - 1;
+ SendMessage(hToolBar, TB_GETITEMRECT, (WPARAM)idx, (LPARAM)&rect);
+ iPosX = rect.right + 10;
+ iPosY = rect.top + 1;
+ iHeight = rect.bottom - rect.top - 2;
+
+ // create Edit Control
+ win_create_window_ex_utf8( 0L, "Edit", SEARCH_PROMPT, WS_CHILD | WS_BORDER | WS_VISIBLE | ES_LEFT,
+ iPosX, iPosY, 200, iHeight, hToolBar, (HMENU)ID_TOOLBAR_EDIT, hInst, NULL );
+
+ return hToolBar;
+}
+
+static HWND InitStatusBar(HWND hParent)
+{
+ HMENU hMenu = GetMenu(hParent);
+
+ popstr[0].hMenu = 0;
+ popstr[0].uiString = 0;
+ popstr[1].hMenu = hMenu;
+ popstr[1].uiString = IDS_UI_FILE;
+ popstr[2].hMenu = GetSubMenu(hMenu, 1);
+ popstr[2].uiString = IDS_VIEW_TOOLBAR;
+ popstr[3].hMenu = 0;
+ popstr[3].uiString = 0;
+
+ return CreateStatusWindow(WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
+ CCS_BOTTOM | SBARS_SIZEGRIP | SBT_TOOLTIPS,
+ TEXT("Ready"), hParent, 2);
+}
+
+
+static LRESULT Statusbar_MenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam)
+{
+ UINT fuFlags = (UINT)HIWORD(wParam);
+ HMENU hMainMenu = NULL;
+ int iMenu = 0;
+
+ /* Handle non-system popup menu descriptions. */
+ if ( (fuFlags & MF_POPUP)
+ && (!(fuFlags & MF_SYSMENU)))
+ {
+ for (iMenu = 1; iMenu < MAX_MENUS; iMenu++)
+ {
+ if ((HMENU)lParam == popstr[iMenu].hMenu)
+ {
+ hMainMenu = (HMENU)lParam;
+ break;
+ }
+ }
+ }
+
+ if (hMainMenu)
+ {
+ /* Display helpful text in status bar */
+ MenuHelp(WM_MENUSELECT, wParam, lParam, hMainMenu, hInst,
+ hStatusBar, (UINT *)&popstr[iMenu]);
+ }
+ else
+ {
+ UINT nZero = 0;
+ MenuHelp(WM_MENUSELECT, wParam, lParam, NULL, hInst,
+ hStatusBar, &nZero);
+ }
+
+ return 0;
+}
+
+static void UpdateStatusBar()
+{
+ LPTREEFOLDER lpFolder = GetCurrentFolder();
+ int games_shown = 0;
+ int i = -1;
+
+ if (!lpFolder)
+ return;
+
+ while (1)
+ {
+ i = FindGame(lpFolder,i+1);
+ if (i == -1)
+ break;
+
+ if (!GameFiltered(i, lpFolder->m_dwFlags))
+ games_shown++;
+ }
+
+ /* Show number of games in the current 'View' in the status bar */
+ SetStatusBarTextF(2, g_szGameCountString, games_shown);
+
+ i = Picker_GetSelectedItem(hwndList);
+
+ if (games_shown == 0)
+ DisableSelection();
+ else
+ {
+ const char* pStatus = GameInfoStatus(i, false);
+ SetStatusBarText(1, pStatus);
+ }
+}
+
+static void UpdateHistory(void)
+{
+ HDC hDC;
+ RECT rect;
+ TEXTMETRIC tm ;
+ int nLines, nLineHeight;
+ //DWORD dwStyle = GetWindowLong(GetDlgItem(hMain, IDC_HISTORY), GWL_STYLE);
+ have_history = false;
+
+ if (GetSelectedPick() >= 0)
+ {
+ char *histText = GetGameHistory(Picker_GetSelectedItem(hwndList));
+
+ have_history = (histText && histText[0]) ? true : false;
+ win_set_window_text_utf8(GetDlgItem(hMain, IDC_HISTORY), histText);
+ }
+
+ if (have_history && BIT(GetWindowPanes(), 3)
+ && ((TabView_GetCurrentTab(hTabCtrl) == TAB_HISTORY) ||
+ (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() && GetShowTab(TAB_HISTORY) == false) ||
+ (TAB_ALL == GetHistoryTab() && GetShowTab(TAB_HISTORY) == false) ))
+ {
+ Edit_GetRect(GetDlgItem(hMain, IDC_HISTORY),&rect);
+ nLines = Edit_GetLineCount(GetDlgItem(hMain, IDC_HISTORY) );
+ hDC = GetDC(GetDlgItem(hMain, IDC_HISTORY));
+ GetTextMetrics (hDC, &tm);
+ nLineHeight = tm.tmHeight - tm.tmInternalLeading;
+ if( ( (rect.bottom - rect.top) / nLineHeight) < (nLines) )
+ {
+ //more than one Page, so show Scrollbar
+ SetScrollRange(GetDlgItem(hMain, IDC_HISTORY), SB_VERT, 0, nLines, true);
+ }
+ else
+ {
+ //hide Scrollbar
+ SetScrollRange(GetDlgItem(hMain, IDC_HISTORY),SB_VERT, 0, 0, true);
+
+ }
+ ShowWindow(GetDlgItem(hMain, IDC_HISTORY), SW_SHOW);
+ }
+ else
+ ShowWindow(GetDlgItem(hMain, IDC_HISTORY), SW_HIDE);
+
+}
+
+
+static void DisableSelection()
+{
+ MENUITEMINFO mmi;
+ HMENU hMenu = GetMenu(hMain);
+ BOOL prev_have_selection = have_selection;
+
+ mmi.cbSize = sizeof(mmi);
+ mmi.fMask = MIIM_TYPE;
+ mmi.fType = MFT_STRING;
+ mmi.dwTypeData = (TCHAR *) TEXT("&Play");
+ mmi.cch = _tcslen(mmi.dwTypeData);
+ SetMenuItemInfo(hMenu, ID_FILE_PLAY, false, &mmi);
+
+ EnableMenuItem(hMenu, ID_FILE_PLAY, MF_GRAYED);
+ EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_GRAYED);
+ EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED);
+
+ SetStatusBarText(0, "No Selection");
+ SetStatusBarText(1, "");
+ SetStatusBarText(3, "");
+
+ have_selection = false;
+
+ if (prev_have_selection != have_selection)
+ UpdateScreenShot();
+}
+
+static void EnableSelection(int nGame)
+{
+ TCHAR buf[200];
+ const char * pText;
+ MENUITEMINFO mmi;
+ HMENU hMenu = GetMenu(hMain);
+ TCHAR* t_description;
+
+ t_description = ui_wstring_from_utf8(ConvertAmpersandString(ModifyThe(driver_list::driver(nGame).type.fullname())));
+ if( !t_description )
+ return;
+
+ _sntprintf(buf, sizeof(buf) / sizeof(buf[0]), g_szPlayGameString, t_description);
+ mmi.cbSize = sizeof(mmi);
+ mmi.fMask = MIIM_TYPE;
+ mmi.fType = MFT_STRING;
+ mmi.dwTypeData = buf;
+ mmi.cch = _tcslen(mmi.dwTypeData);
+ SetMenuItemInfo(hMenu, ID_FILE_PLAY, false, &mmi);
+
+ pText = ModifyThe(driver_list::driver(nGame).type.fullname());
+ SetStatusBarText(0, pText);
+ /* Add this game's status to the status bar */
+ pText = GameInfoStatus(nGame, false);
+ SetStatusBarText(1, pText);
+ SetStatusBarText(3, "");
+
+ /* If doing updating game status and the game name is NOT pacman.... */
+
+ EnableMenuItem(hMenu, ID_FILE_PLAY, MF_ENABLED);
+ EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_ENABLED);
+
+ if (!oldControl)
+ EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_ENABLED);
+
+ if (bProgressShown && bListReady == true)
+ SetDefaultGame(nGame);
+
+ have_selection = true;
+
+ UpdateScreenShot();
+
+ free(t_description);
+}
+
+static void PaintBackgroundImage(HWND hWnd, HRGN hRgn, int x, int y)
+{
+ RECT rcClient;
+ HRGN rgnBitmap;
+ HPALETTE hPAL;
+ HDC hDC = GetDC(hWnd);
+ int i, j;
+ HDC htempDC;
+ HBITMAP oldBitmap;
+
+ /* x and y are offsets within the background image that should be at 0,0 in hWnd */
+
+ /* So we don't paint over the control's border */
+ GetClientRect(hWnd, &rcClient);
+
+ htempDC = CreateCompatibleDC(hDC);
+ oldBitmap = (HBITMAP)SelectObject(htempDC, hBackground);
+
+ if (hRgn == NULL)
+ {
+ /* create a region of our client area */
+ rgnBitmap = CreateRectRgnIndirect(&rcClient);
+ SelectClipRgn(hDC, rgnBitmap);
+ DeleteBitmap(rgnBitmap);
+ }
+ else
+ {
+ /* use the passed in region */
+ SelectClipRgn(hDC, hRgn);
+ }
+
+ hPAL = GetBackgroundPalette();
+ if (hPAL == NULL)
+ hPAL = CreateHalftonePalette(hDC);
+
+ if (GetDeviceCaps(htempDC, RASTERCAPS) & RC_PALETTE && hPAL)
+ {
+ SelectPalette(htempDC, hPAL, false);
+ RealizePalette(htempDC);
+ }
+
+ for (i = rcClient.left-x; i < rcClient.right; i += bmDesc.bmWidth)
+ for (j = rcClient.top-y; j < rcClient.bottom; j += bmDesc.bmHeight)
+ BitBlt(hDC, i, j, bmDesc.bmWidth, bmDesc.bmHeight, htempDC, 0, 0, SRCCOPY);
+
+ SelectObject(htempDC, oldBitmap);
+ DeleteDC(htempDC);
+
+ if (GetBackgroundPalette() == NULL)
+ {
+ DeletePalette(hPAL);
+ hPAL = NULL;
+ }
+
+ ReleaseDC(hWnd, hDC);
+}
+
+static LPCSTR GetCloneParentName(int nItem)
+{
+ int nParentIndex = -1;
+
+ if (DriverIsClone(nItem) == true)
+ {
+ nParentIndex = GetParentIndex(&driver_list::driver(nItem));
+ if( nParentIndex >= 0)
+ return ModifyThe(driver_list::driver(nParentIndex).type.fullname());
+ }
+ return "";
+}
+
+static BOOL TreeViewNotify(LPNMHDR nm)
+{
+ switch (nm->code)
+ {
+ case TVN_SELCHANGED :
+ {
+ HTREEITEM hti = TreeView_GetSelection(hTreeView);
+ TVITEM tvi;
+
+ tvi.mask = TVIF_PARAM | TVIF_HANDLE;
+ tvi.hItem = hti;
+
+ if (TreeView_GetItem(hTreeView, &tvi))
+ {
+ SetCurrentFolder((LPTREEFOLDER)tvi.lParam);
+ if (bListReady)
+ {
+ ResetListView();
+ UpdateScreenShot();
+ }
+ }
+ return true;
+ }
+ case TVN_BEGINLABELEDIT :
+ {
+ TV_DISPINFO *ptvdi = (TV_DISPINFO *)nm;
+ LPTREEFOLDER folder = (LPTREEFOLDER)ptvdi->item.lParam;
+
+ if (folder->m_dwFlags & F_CUSTOM)
+ {
+ // user can edit custom folder names
+ g_in_treeview_edit = true;
+ return false;
+ }
+ // user can't edit built in folder names
+ return true;
+ }
+ case TVN_ENDLABELEDIT :
+ {
+ TV_DISPINFO *ptvdi = (TV_DISPINFO *)nm;
+ LPTREEFOLDER folder = (LPTREEFOLDER)ptvdi->item.lParam;
+ char* utf8_szText;
+ BOOL result;
+
+ g_in_treeview_edit = false;
+
+ if (ptvdi->item.pszText == NULL || _tcslen(ptvdi->item.pszText) == 0)
+ return false;
+
+ utf8_szText = ui_utf8_from_wstring(ptvdi->item.pszText);
+ if( !utf8_szText )
+ return false;
+
+ result = TryRenameCustomFolder(folder, utf8_szText);
+
+ free(utf8_szText);
+
+ return result;
+ }
+ }
+ return false;
+}
+
+
+
+static void GamePicker_OnHeaderContextMenu(POINT pt, int nColumn)
+{
+ // Right button was clicked on header
+ HMENU hMenuLoad;
+ HMENU hMenu;
+
+ hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_HEADER));
+ hMenu = GetSubMenu(hMenuLoad, 0);
+ lastColumnClick = nColumn;
+ TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hMain,NULL);
+
+ DestroyMenu(hMenuLoad);
+}
+
+
+
+char* ConvertAmpersandString(const char *s)
+{
+ /* takes a string and changes any ampersands to double ampersands,
+ for setting text of window controls that don't allow us to disable
+ the ampersand underlining.
+ */
+ /* returns a static buffer--use before calling again */
+
+ static char buf[200];
+ char *ptr;
+
+ ptr = buf;
+ while (*s)
+ {
+ if (*s == '&')
+ *ptr++ = *s;
+ *ptr++ = *s++;
+ }
+ *ptr = 0;
+
+ return buf;
+}
+
+static int GUI_seq_pressed(const input_seq *seq)
+{
+ int codenum;
+ int res = 1;
+ bool invert = 0;
+ int count = 0;
+
+ for (codenum = 0; (*seq)[codenum] != input_seq::end_code; codenum++)
+ {
+ input_code code = (*seq)[codenum];
+
+ if (code == input_seq::not_code)
+ invert = !invert;
+
+ else if (code == input_seq::or_code)
+ {
+ if (res && count)
+ return 1;
+ res = 1;
+ count = 0;
+ }
+ else
+ {
+ if (res)
+ {
+ if ((keyboard_state[(int)(code.item_id())] != 0) == invert)
+ res = 0;
+ }
+ invert = 0;
+ ++count;
+ }
+ }
+ return res && count;
+}
+
+static void check_for_GUI_action(void)
+{
+ int i;
+
+ for (i = 0; i < NUM_GUI_SEQUENCES; i++)
+ {
+ const input_seq *is = &(GUISequenceControl[i].is);
+
+ if (GUI_seq_pressed(is))
+ {
+ dprintf("seq =%s pressed\n", GUISequenceControl[i].name);
+ switch (GUISequenceControl[i].func_id)
+ {
+ case ID_GAME_AUDIT:
+ case ID_GAME_PROPERTIES:
+ case ID_CONTEXT_FILTERS:
+ case ID_UI_START:
+ KeyboardStateClear(); /* because whe won't receive KeyUp mesage when we lose focus */
+ break;
+ default:
+ break;
+ }
+ SendMessage(hMain, WM_COMMAND, GUISequenceControl[i].func_id, 0);
+ }
+ }
+}
+
+static void KeyboardStateClear(void)
+{
+ memset(keyboard_state, 0, sizeof(keyboard_state));
+ dprintf("keyboard gui state cleared.\n");
+}
+
+
+static void KeyboardKeyDown(int syskey, int vk_code, int special)
+{
+ int i, found = 0;
+ int icode = 0;
+ int special_code = (special >> 24) & 1;
+ int scancode = (special>>16) & 0xff;
+
+ if ((vk_code==VK_MENU) || (vk_code==VK_CONTROL) || (vk_code==VK_SHIFT))
+ {
+ found = 1;
+
+ /* a hack for right shift - it's better to use Direct X for keyboard input it seems......*/
+ if (vk_code==VK_SHIFT)
+ if (scancode>0x30) /* on my keyboard left shift scancode is 0x2a, right shift is 0x36 */
+ special_code = 1;
+
+ if (special_code) /* right hand keys */
+ {
+ switch(vk_code)
+ {
+ case VK_MENU:
+ icode = (int)(KEYCODE_RALT.item_id());
+ break;
+ case VK_CONTROL:
+ icode = (int)(KEYCODE_RCONTROL.item_id());
+ break;
+ case VK_SHIFT:
+ icode = (int)(KEYCODE_RSHIFT.item_id());
+ break;
+ }
+ }
+ else /* left hand keys */
+ {
+ switch(vk_code)
+ {
+ case VK_MENU:
+ icode = (int)(KEYCODE_LALT.item_id());
+ break;
+ case VK_CONTROL:
+ icode = (int)(KEYCODE_LCONTROL.item_id());
+ break;
+ case VK_SHIFT:
+ icode = (int)(KEYCODE_LSHIFT.item_id());
+ break;
+ }
+ }
+ }
+ else
+ {
+ for (i = 0; i < ARRAY_LENGTH(win_key_trans_table); i++)
+ {
+ if ( vk_code == win_key_trans_table[i][VIRTUAL_KEY])
+ {
+ icode = win_key_trans_table[i][MAME_KEY];
+ found = 1;
+ break;
+ }
+ }
+ }
+ if (!found)
+ {
+ dprintf("VK_code pressed not found = %i\n",vk_code);
+ //MessageBox(NULL,"keydown message arrived not processed","TitleBox",MB_OK);
+ return;
+ }
+ dprintf("VK_code pressed found = %i, sys=%i, mame_keycode=%i special=%08x\n", vk_code, syskey, icode, special);
+ keyboard_state[icode] = true;
+ check_for_GUI_action();
+}
+
+static void KeyboardKeyUp(int syskey, int vk_code, int special)
+{
+ int i, found = 0;
+ int icode = 0;
+ int special_code = (special >> 24) & 1;
+ int scancode = (special>>16) & 0xff;
+
+ if ((vk_code==VK_MENU) || (vk_code==VK_CONTROL) || (vk_code==VK_SHIFT))
+ {
+ found = 1;
+
+ /* a hack for right shift - it's better to use Direct X for keyboard input it seems......*/
+ if (vk_code==VK_SHIFT)
+ if (scancode>0x30) /* on my keyboard left shift scancode is 0x2a, right shift is 0x36 */
+ special_code = 1;
+
+ if (special_code) /* right hand keys */
+ {
+ switch(vk_code)
+ {
+ case VK_MENU:
+ icode = (int)(KEYCODE_RALT.item_id());
+ break;
+ case VK_CONTROL:
+ icode = (int)(KEYCODE_RCONTROL.item_id());
+ break;
+ case VK_SHIFT:
+ icode = (int)(KEYCODE_RSHIFT.item_id());
+ break;
+ }
+ }
+ else /* left hand keys */
+ {
+ switch(vk_code)
+ {
+ case VK_MENU:
+ icode = (int)(KEYCODE_LALT.item_id());
+ break;
+ case VK_CONTROL:
+ icode = (int)(KEYCODE_LCONTROL.item_id());
+ break;
+ case VK_SHIFT:
+ icode = (int)(KEYCODE_LSHIFT.item_id());
+ break;
+ }
+ }
+ }
+ else
+ {
+ for (i = 0; i < ARRAY_LENGTH(win_key_trans_table); i++)
+ {
+ if (vk_code == win_key_trans_table[i][VIRTUAL_KEY])
+ {
+ icode = win_key_trans_table[i][MAME_KEY];
+ found = 1;
+ break;
+ }
+ }
+ }
+ if (!found)
+ {
+ dprintf("VK_code released not found = %i\n",vk_code);
+ //MessageBox(NULL,"keyup message arrived not processed","TitleBox",MB_OK);
+ return;
+ }
+ keyboard_state[icode] = false;
+ dprintf("VK_code released found= %i, sys=%i, mame_keycode=%i special=%08x\n", vk_code, syskey, icode, special );
+ check_for_GUI_action();
+}
+
+static void PollGUIJoystick()
+{
+ if (in_emulation)
+ return;
+
+ if (g_pJoyGUI == NULL)
+ return;
+
+ g_pJoyGUI->poll_joysticks();
+
+ // User pressed UP
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyUp(0), GetUIJoyUp(1), GetUIJoyUp(2), GetUIJoyUp(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_UP, 0);
+
+ // User pressed DOWN
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyDown(0), GetUIJoyDown(1), GetUIJoyDown(2), GetUIJoyDown(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_DOWN, 0);
+
+ // User pressed LEFT
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyLeft(0), GetUIJoyLeft(1), GetUIJoyLeft(2), GetUIJoyLeft(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_LEFT, 0);
+
+ // User pressed RIGHT
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyRight(0), GetUIJoyRight(1), GetUIJoyRight(2), GetUIJoyRight(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_RIGHT, 0);
+
+ // User pressed START GAME
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyStart(0), GetUIJoyStart(1), GetUIJoyStart(2), GetUIJoyStart(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_START, 0);
+
+ // User pressed PAGE UP
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyPageUp(0), GetUIJoyPageUp(1), GetUIJoyPageUp(2), GetUIJoyPageUp(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_PGUP, 0);
+
+ // User pressed PAGE DOWN
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyPageDown(0), GetUIJoyPageDown(1), GetUIJoyPageDown(2), GetUIJoyPageDown(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_PGDOWN, 0);
+
+ // User pressed HOME
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHome(0), GetUIJoyHome(1), GetUIJoyHome(2), GetUIJoyHome(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_HOME, 0);
+
+ // User pressed END
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyEnd(0), GetUIJoyEnd(1), GetUIJoyEnd(2), GetUIJoyEnd(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_END, 0);
+
+ // User pressed CHANGE SCREENSHOT
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoySSChange(0), GetUIJoySSChange(1), GetUIJoySSChange(2), GetUIJoySSChange(3))))
+ SendMessage(hMain, WM_COMMAND, IDC_SSFRAME, 0);
+
+ // User pressed SCROLL HISTORY UP
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHistoryUp(0), GetUIJoyHistoryUp(1), GetUIJoyHistoryUp(2), GetUIJoyHistoryUp(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_HISTORY_UP, 0);
+
+ // User pressed SCROLL HISTORY DOWN
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHistoryDown(0), GetUIJoyHistoryDown(1), GetUIJoyHistoryDown(2), GetUIJoyHistoryDown(3))))
+ SendMessage(hMain, WM_COMMAND, ID_UI_HISTORY_DOWN, 0);
+
+ // For the exec timer, will keep track of how long the button has been pressed
+ static int exec_counter = 0;
+
+ // User pressed EXECUTE COMMANDLINE
+ // Note: this option is not documented, nor supported in the GUI.
+ if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyExec(0), GetUIJoyExec(1), GetUIJoyExec(2), GetUIJoyExec(3))))
+ {
+ // validate
+ int execwait = GetExecWait();
+ if (execwait < 1)
+ return;
+ if (++exec_counter >= execwait) // Button has been pressed > exec timeout
+ {
+ // validate
+ string exec_command = GetExecCommand();
+ if (exec_command.empty())
+ return;
+ TCHAR *t_exec_command = ui_wstring_from_utf8(exec_command.c_str());
+ if( !t_exec_command )
+ return;
+
+ // Reset counter
+ exec_counter = 0;
+
+ STARTUPINFO si;
+ ZeroMemory( &si, sizeof(si) );
+ si.dwFlags = STARTF_FORCEONFEEDBACK;
+ si.cb = sizeof(si);
+
+ PROCESS_INFORMATION pi;
+ ZeroMemory( &pi, sizeof(pi) );
+
+ CreateProcess(NULL, t_exec_command, NULL, NULL, false, 0, NULL, NULL, &si, &pi);
+
+ free(t_exec_command);
+
+ // We will not wait for the process to finish cause it might be a background task
+ // The process won't get closed when MAME32 closes either.
+
+ // But close the handles cause we won't need them anymore. Will not close process.
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+ }
+ else
+ {
+ // Button has been released within the timeout period, reset the counter
+ exec_counter = 0;
+ }
+}
+
+static void SetView(int menu_id)
+{
+ BOOL force_reset = false;
+ int i;
+
+ // first uncheck previous menu item, check new one
+ CheckMenuRadioItem(GetMenu(hMain), ID_VIEW_LARGE_ICON, ID_VIEW_GROUPED, menu_id, MF_CHECKED);
+ ToolBar_CheckButton(s_hToolBar, menu_id, MF_CHECKED);
+
+ if (Picker_GetViewID(hwndList) == VIEW_GROUPED || menu_id == ID_VIEW_GROUPED)
+ {
+ // this changes the sort order, so redo everything
+ force_reset = true;
+ }
+
+ for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++)
+ Picker_SetViewID(GetDlgItem(hMain, s_nPickers[i]), menu_id - ID_VIEW_LARGE_ICON);
+
+ if (force_reset)
+ {
+ for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++)
+ Picker_Sort(GetDlgItem(hMain, s_nPickers[i]));
+ }
+}
+
+static void ResetListView()
+{
+ int i;
+ int current_game;
+ LV_ITEM lvi;
+ BOOL no_selection = false;
+ LPTREEFOLDER lpFolder = GetCurrentFolder();
+ HRESULT res;
+ BOOL b_res;
+
+ if (!lpFolder)
+ return;
+
+ /* If the last folder was empty, no_selection is true */
+ if (have_selection == false)
+ no_selection = true;
+
+ current_game = Picker_GetSelectedItem(hwndList);
+ if (current_game < 0)
+ no_selection = true;
+
+ SetWindowRedraw(hwndList,false);
+
+ b_res = ListView_DeleteAllItems(hwndList);
+
+ // hint to have it allocate it all at once
+ ListView_SetItemCount(hwndList,driver_list::total());
+
+ lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
+ lvi.stateMask = 0;
+
+ i = -1;
+
+ do
+ {
+ /* Add the games that are in this folder */
+ if ((i = FindGame(lpFolder, i + 1)) != -1)
+ {
+ if (GameFiltered(i, lpFolder->m_dwFlags))
+ continue;
+
+ lvi.iItem = i;
+ lvi.iSubItem = 0;
+ lvi.lParam = i;
+ lvi.pszText = LPSTR_TEXTCALLBACK;
+ lvi.iImage = I_IMAGECALLBACK;
+ res = ListView_InsertItem(hwndList, &lvi);
+ }
+ } while (i != -1);
+
+ Picker_Sort(hwndList);
+
+ if (bListReady)
+ {
+ /* If last folder was empty, select the first item in this folder */
+ if (no_selection)
+ Picker_SetSelectedPick(hwndList, 0);
+ else
+ Picker_SetSelectedItem(hwndList, current_game);
+ }
+
+ /*RS Instead of the Arrange Call that was here previously on all Views
+ We now need to set the ViewMode for SmallIcon again,
+ for an explanation why, see SetView*/
+ if (GetViewMode() == VIEW_SMALL_ICONS)
+ SetView(ID_VIEW_SMALL_ICON);
+
+ SetWindowRedraw(hwndList, true);
+
+ UpdateStatusBar();
+ res++;
+ b_res++;
+}
+
+static void UpdateGameList(BOOL bUpdateRomAudit, BOOL bUpdateSampleAudit)
+{
+ for (int i = 0; i < driver_list::total(); i++)
+ {
+ if (bUpdateRomAudit && DriverUsesRoms(i))
+ SetRomAuditResults(i, UNKNOWN);
+ if (bUpdateSampleAudit && DriverUsesSamples(i))
+ SetSampleAuditResults(i, UNKNOWN);
+ }
+
+ idle_work = true;
+ bDoGameCheck = true;
+ game_index = 0;
+
+ ReloadIcons();
+
+ // Let REFRESH also load new background if found
+ LoadBackgroundBitmap();
+ InvalidateRect(hMain,NULL,true);
+ Picker_ResetIdle(hwndList);
+}
+
+static void UpdateCache()
+{
+ int current_id = GetCurrentFolderID(); // remember selected folder
+ SetWindowRedraw(hwndList, false); // stop screen updating
+ ForceRebuild(); // tell system that cache needs redoing
+ (void)OptionsInit(); // reload options and fix game cache
+ //extern const FOLDERDATA g_folderData[];
+ //extern const FILTER_ITEM g_filterList[];
+ //InitTree(g_folderData, g_filterList); // redo folders... This crashes, leave out for now
+ ResetTreeViewFolders(); // something with folders
+ SelectTreeViewFolder(current_id); // select previous folder
+ SetWindowRedraw(hwndList, true); // refresh screen
+}
+
+UINT_PTR CALLBACK CFHookProc(
+ HWND hdlg, // handle to dialog box
+ UINT uiMsg, // message identifier
+ WPARAM wParam, // message parameter
+ LPARAM lParam // message parameter
+)
+{
+ int iIndex, i;
+ COLORREF cCombo, cList;
+ switch (uiMsg)
+ {
+ case WM_INITDIALOG:
+ SendDlgItemMessage(hdlg, cmb4, CB_ADDSTRING, 0, (LPARAM)TEXT("Custom"));
+ iIndex = SendDlgItemMessage(hdlg, cmb4, CB_GETCOUNT, 0, 0);
+ cList = GetListFontColor();
+ SendDlgItemMessage(hdlg, cmb4, CB_SETITEMDATA,(WPARAM)iIndex-1,(LPARAM)cList );
+ for( i = 0; i< iIndex; i++)
+ {
+ cCombo = SendDlgItemMessage(hdlg, cmb4, CB_GETITEMDATA,(WPARAM)i,0 );
+ if( cList == cCombo)
+ {
+ SendDlgItemMessage(hdlg, cmb4, CB_SETCURSEL,(WPARAM)i,0 );
+ break;
+ }
+ }
+ break;
+ case WM_COMMAND:
+ if( LOWORD(wParam) == cmb4)
+ {
+ switch (HIWORD(wParam))
+ {
+ case CBN_SELCHANGE: // The color ComboBox changed selection
+ iIndex = (int)SendDlgItemMessage(hdlg, cmb4,
+ CB_GETCURSEL, 0, 0L);
+ if( iIndex == SendDlgItemMessage(hdlg, cmb4, CB_GETCOUNT, 0, 0)-1)
+ {
+ //Custom color selected
+ cList = GetListFontColor();
+ PickColor(&cList);
+ SendDlgItemMessage(hdlg, cmb4, CB_DELETESTRING, iIndex, 0);
+ SendDlgItemMessage(hdlg, cmb4, CB_ADDSTRING, 0, (LPARAM)TEXT("Custom"));
+ SendDlgItemMessage(hdlg, cmb4, CB_SETITEMDATA,(WPARAM)iIndex,(LPARAM)cList);
+ SendDlgItemMessage(hdlg, cmb4, CB_SETCURSEL,(WPARAM)iIndex,0 );
+ return true;
+ }
+ }
+ }
+ break;
+ }
+ return false;
+}
+
+static void PickFont(void)
+{
+ LOGFONT font;
+ CHOOSEFONT cf;
+ TCHAR szClass[128];
+ HWND hWnd;
+ HRESULT res;
+ BOOL b_res;
+
+ GetListFont(&font);
+ font.lfQuality = DEFAULT_QUALITY;
+
+ cf.lStructSize = sizeof(CHOOSEFONT);
+ cf.hwndOwner = hMain;
+ cf.lpLogFont = &font;
+ cf.lpfnHook = &CFHookProc;
+ cf.rgbColors = GetListFontColor();
+ cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_ENABLEHOOK;
+ if (!ChooseFont(&cf))
+ return;
+
+ SetListFont(&font);
+ if (hFont)
+ DeleteFont(hFont);
+ hFont = CreateFontIndirect(&font);
+ if (hFont)
+ {
+ COLORREF textColor = cf.rgbColors;
+
+ if (textColor == RGB(255,255,255))
+ {
+ textColor = RGB(240, 240, 240);
+ }
+
+ SetAllWindowsFont(hMain, &main_resize, hFont, true);
+
+ hWnd = GetWindow(hMain, GW_CHILD);
+ while(hWnd)
+ {
+ if (GetClassName(hWnd, szClass, sizeof(szClass) / sizeof(szClass[0])))
+ {
+ if (!_tcscmp(szClass, TEXT("SysListView32")))
+ {
+ b_res = ListView_SetTextColor(hWnd, textColor);
+ b_res++;
+ }
+ else if (!_tcscmp(szClass, TEXT("SysTreeView32")))
+ {
+ res = TreeView_SetTextColor(hTreeView, textColor);
+ res++;
+ }
+ }
+ hWnd = GetWindow(hWnd, GW_HWNDNEXT);
+ }
+ SetListFontColor(cf.rgbColors);
+ ResetListView();
+ }
+}
+
+static void PickColor(COLORREF *cDefault)
+{
+ CHOOSECOLOR cc;
+ COLORREF choice_colors[16];
+ int i;
+
+ for (i=0;i<16;i++)
+ choice_colors[i] = GetCustomColor(i);
+
+ cc.lStructSize = sizeof(CHOOSECOLOR);
+ cc.hwndOwner = hMain;
+ cc.rgbResult = *cDefault;
+ cc.lpCustColors = choice_colors;
+ cc.Flags = CC_ANYCOLOR | CC_RGBINIT | CC_SOLIDCOLOR | CC_FULLOPEN;
+ if (!ChooseColor(&cc))
+ return;
+ for (i=0;i<16;i++)
+ SetCustomColor(i,choice_colors[i]);
+ *cDefault = cc.rgbResult;
+}
+
+static void PickCloneColor(void)
+{
+ COLORREF cClonecolor;
+ cClonecolor = GetListCloneColor();
+ PickColor( &cClonecolor);
+ SetListCloneColor(cClonecolor);
+ InvalidateRect(hwndList,NULL,false);
+}
+
+static BOOL MameCommand(HWND hwnd,int id, HWND hwndCtl, UINT codeNotify)
+{
+ int i = 0;
+ LPTREEFOLDER folder;
+ char* utf8_szFile;
+ BOOL res = 0;
+ int current_game = Picker_GetSelectedItem(hwndList);
+
+ switch (id)
+ {
+ case ID_FILE_PLAY:
+ MamePlayGame();
+ return true;
+
+ case ID_FILE_PLAY_RECORD:
+ MamePlayRecordGame();
+ return true;
+
+ case ID_FILE_PLAY_BACK:
+ MamePlayBackGame();
+ return true;
+
+ case ID_FILE_PLAY_RECORD_WAVE:
+ MamePlayRecordWave();
+ return true;
+
+ case ID_FILE_PLAY_RECORD_MNG:
+ MamePlayRecordMNG();
+ return true;
+
+ case ID_FILE_PLAY_RECORD_AVI:
+ MamePlayRecordAVI();
+ return true;
+
+ case ID_FILE_LOADSTATE :
+ MameLoadState();
+ return true;
+
+ case ID_FILE_AUDIT:
+ AuditDialog(hMain, 1);
+ ResetWhichGamesInFolders();
+ ResetListView();
+ SetFocus(hwndList);
+ return true;
+
+ case ID_FILE_AUDIT_X:
+ AuditDialog(hMain, 2);
+ ResetWhichGamesInFolders();
+ ResetListView();
+ SetFocus(hwndList);
+ return true;
+
+ case ID_FILE_EXIT:
+ PostMessage(hMain, WM_CLOSE, 0, 0);
+ return true;
+
+ case ID_VIEW_LARGE_ICON:
+ SetView(ID_VIEW_LARGE_ICON);
+ return true;
+
+ case ID_VIEW_SMALL_ICON:
+ SetView(ID_VIEW_SMALL_ICON);
+ ResetListView();
+ return true;
+
+ case ID_VIEW_LIST_MENU:
+ SetView(ID_VIEW_LIST_MENU);
+ return true;
+
+ case ID_VIEW_DETAIL:
+ SetView(ID_VIEW_DETAIL);
+ return true;
+
+ case ID_VIEW_GROUPED:
+ SetView(ID_VIEW_GROUPED);
+ return true;
+
+ /* Arrange Icons submenu */
+ case ID_VIEW_BYGAME:
+ SetSortReverse(false);
+ SetSortColumn(COLUMN_GAMES);
+ Picker_Sort(hwndList);
+ break;
+
+ case ID_VIEW_BYDIRECTORY:
+ SetSortReverse(false);
+ SetSortColumn(COLUMN_DIRECTORY);
+ Picker_Sort(hwndList);
+ break;
+
+ case ID_VIEW_BYMANUFACTURER:
+ SetSortReverse(false);
+ SetSortColumn(COLUMN_MANUFACTURER);
+ Picker_Sort(hwndList);
+ break;
+
+ case ID_VIEW_BYTIMESPLAYED:
+ SetSortReverse(false);
+ SetSortColumn(COLUMN_PLAYED);
+ Picker_Sort(hwndList);
+ break;
+
+ case ID_VIEW_BYTYPE:
+ SetSortReverse(false);
+ SetSortColumn(COLUMN_TYPE);
+ Picker_Sort(hwndList);
+ break;
+
+ case ID_VIEW_BYYEAR:
+ SetSortReverse(false);
+ SetSortColumn(COLUMN_YEAR);
+ Picker_Sort(hwndList);
+ break;
+
+ case ID_VIEW_FOLDERS:
+ {
+ int val = GetWindowPanes() ^ 1;
+ BOOL bShowTree = BIT(val, 0);
+ SetWindowPanes(val);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED);
+ ToolBar_CheckButton(s_hToolBar, ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED);
+ UpdateScreenShot();
+ break;
+ }
+
+ case ID_VIEW_TOOLBARS:
+ bShowToolBar = !bShowToolBar;
+ SetShowToolBar(bShowToolBar);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED);
+ ToolBar_CheckButton(s_hToolBar, ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED);
+ ShowWindow(s_hToolBar, (bShowToolBar) ? SW_SHOW : SW_HIDE);
+ ResizePickerControls(hMain);
+ UpdateScreenShot();
+ break;
+
+ case ID_VIEW_STATUS:
+ bShowStatusBar = !bShowStatusBar;
+ SetShowStatusBar(bShowStatusBar);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED);
+ ToolBar_CheckButton(s_hToolBar, ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED);
+ ShowWindow(hStatusBar, (bShowStatusBar) ? SW_SHOW : SW_HIDE);
+ ResizePickerControls(hMain);
+ UpdateScreenShot();
+ break;
+
+ case ID_VIEW_PAGETAB:
+ bShowTabCtrl = !bShowTabCtrl;
+ SetShowTabCtrl(bShowTabCtrl);
+ ShowWindow(hTabCtrl, (bShowTabCtrl) ? SW_SHOW : SW_HIDE);
+ ResizePickerControls(hMain);
+ UpdateScreenShot();
+ InvalidateRect(hMain,NULL,true);
+ break;
+
+ /*
+ Switches to fullscreen mode. No check mark handling
+ for this item cause in fullscreen mode the menu won't
+ be visible anyways.
+ */
+ case ID_VIEW_FULLSCREEN:
+ SwitchFullScreenMode();
+ break;
+
+ case ID_TOOLBAR_EDIT:
+ {
+ string buf;
+ HWND hToolbarEdit;
+
+ buf = win_get_window_text_utf8(hwndCtl);
+ switch (codeNotify)
+ {
+ case TOOLBAR_EDIT_ACCELERATOR_PRESSED:
+ hToolbarEdit = GetDlgItem( s_hToolBar, ID_TOOLBAR_EDIT);
+ SetFocus(hToolbarEdit);
+ break;
+ case EN_CHANGE:
+ //put search routine here first, add a 200ms timer later.
+ if ((!_stricmp(buf.c_str(), SEARCH_PROMPT) && !_stricmp(g_SearchText, "")))
+ strcpy(g_SearchText, buf.c_str());
+ else
+ {
+ strcpy(g_SearchText, buf.c_str());
+ ResetListView();
+ }
+ break;
+ case EN_SETFOCUS:
+ if (!_stricmp(buf.c_str(), SEARCH_PROMPT))
+ win_set_window_text_utf8(hwndCtl, "");
+ break;
+ case EN_KILLFOCUS:
+ if (*buf.c_str() == 0)
+ win_set_window_text_utf8(hwndCtl, SEARCH_PROMPT);
+ break;
+ }
+ }
+ break;
+
+ case ID_GAME_AUDIT:
+ InitGameAudit(0);
+ if (!oldControl && (current_game >= 0))
+ InitPropertyPageToPage(hInst, hwnd, GetSelectedPickItemIcon(), OPTIONS_GAME, -1, current_game, AUDIT_PAGE);
+
+ /* Just in case the toggle MMX on/off */
+ UpdateStatusBar();
+ break;
+
+ /* ListView Context Menu */
+ case ID_CONTEXT_ADD_CUSTOM:
+ {
+ if (current_game >= 0)
+ DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_CUSTOM_FILE), hMain,AddCustomFileDialogProc, current_game);
+ SetFocus(hwndList);
+ break;
+ }
+
+ case ID_CONTEXT_REMOVE_CUSTOM:
+ {
+ RemoveCurrentGameCustomFolder();
+ break;
+ }
+
+ /* Tree Context Menu */
+ case ID_CONTEXT_FILTERS:
+ if (DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FILTERS), hMain, FilterDialogProc) == true)
+ ResetListView();
+ SetFocus(hwndList);
+ return true;
+
+ // ScreenShot Context Menu
+ // select current tab
+ case ID_VIEW_TAB_SCREENSHOT:
+ case ID_VIEW_TAB_TITLE:
+ case ID_VIEW_TAB_SCORES:
+ case ID_VIEW_TAB_HOWTO:
+ case ID_VIEW_TAB_SELECT:
+ case ID_VIEW_TAB_VERSUS:
+ case ID_VIEW_TAB_BOSSES:
+ case ID_VIEW_TAB_COVER:
+ case ID_VIEW_TAB_ENDS:
+ case ID_VIEW_TAB_GAMEOVER:
+ case ID_VIEW_TAB_LOGO:
+ case ID_VIEW_TAB_ARTWORK:
+ case ID_VIEW_TAB_FLYER:
+ case ID_VIEW_TAB_CABINET:
+ case ID_VIEW_TAB_MARQUEE:
+ case ID_VIEW_TAB_CONTROL_PANEL:
+ case ID_VIEW_TAB_PCB:
+ case ID_VIEW_TAB_HISTORY:
+ if (id == ID_VIEW_TAB_HISTORY && GetShowTab(TAB_HISTORY) == false)
+ break;
+
+ TabView_SetCurrentTab(hTabCtrl, id - ID_VIEW_TAB_ARTWORK);
+ UpdateScreenShot();
+ TabView_UpdateSelection(hTabCtrl);
+ break;
+
+ // toggle tab's existence
+ case ID_TOGGLE_TAB_SCREENSHOT:
+ case ID_TOGGLE_TAB_TITLE:
+ case ID_TOGGLE_TAB_SCORES:
+ case ID_TOGGLE_TAB_HOWTO:
+ case ID_TOGGLE_TAB_SELECT:
+ case ID_TOGGLE_TAB_VERSUS:
+ case ID_TOGGLE_TAB_BOSSES:
+ case ID_TOGGLE_TAB_COVER:
+ case ID_TOGGLE_TAB_ENDS:
+ case ID_TOGGLE_TAB_GAMEOVER:
+ case ID_TOGGLE_TAB_LOGO:
+ case ID_TOGGLE_TAB_ARTWORK:
+ case ID_TOGGLE_TAB_FLYER:
+ case ID_TOGGLE_TAB_CABINET:
+ case ID_TOGGLE_TAB_MARQUEE:
+ case ID_TOGGLE_TAB_CONTROL_PANEL:
+ case ID_TOGGLE_TAB_PCB:
+ case ID_TOGGLE_TAB_HISTORY:
+ {
+ int toggle_flag = id - ID_TOGGLE_TAB_ARTWORK;
+
+ if (AllowedToSetShowTab(toggle_flag,!GetShowTab(toggle_flag)) == false)
+ {
+ // attempt to hide the last tab
+ // should show error dialog? hide picture area? or ignore?
+ break;
+ }
+
+ SetShowTab(toggle_flag,!GetShowTab(toggle_flag));
+
+ TabView_Reset(hTabCtrl);
+
+ if (TabView_GetCurrentTab(hTabCtrl) == toggle_flag && GetShowTab(toggle_flag) == false)
+ {
+ // we're deleting the tab we're on, so go to the next one
+ TabView_CalculateNextTab(hTabCtrl);
+ }
+
+
+ // Resize the controls in case we toggled to another history
+ // mode (and the history control needs resizing).
+
+ ResizePickerControls(hMain);
+ UpdateScreenShot();
+
+ TabView_UpdateSelection(hTabCtrl);
+
+ break;
+ }
+
+ /* Header Context Menu */
+ case ID_SORT_ASCENDING:
+ SetSortReverse(false);
+ SetSortColumn(Picker_GetRealColumnFromViewColumn(hwndList, lastColumnClick));
+ Picker_Sort(hwndList);
+ break;
+
+ case ID_SORT_DESCENDING:
+ SetSortReverse(true);
+ SetSortColumn(Picker_GetRealColumnFromViewColumn(hwndList, lastColumnClick));
+ Picker_Sort(hwndList);
+ break;
+
+ case ID_CUSTOMIZE_FIELDS:
+ if (DialogBox(GetModuleHandle(NULL),
+ MAKEINTRESOURCE(IDD_COLUMNS), hMain, ColumnDialogProc) == true)
+ ResetColumnDisplay(false);
+ SetFocus(hwndList);
+ return true;
+
+ /* View Menu */
+ case ID_VIEW_LINEUPICONS:
+ if( codeNotify == false)
+ ResetListView();
+ else
+ {
+ /*it was sent after a refresh (F5) was done, we only reset the View if "available" is the selected folder
+ as it doesn't affect the others*/
+ folder = GetSelectedFolder();
+ if( folder )
+ if (folder->m_nFolderId == FOLDER_AVAILABLE )
+ ResetListView();
+ }
+ break;
+
+ case ID_GAME_PROPERTIES:
+ if (!oldControl && (current_game >= 0))
+ InitPropertyPageToPage(hInst, hwnd, GetSelectedPickItemIcon(), OPTIONS_GAME, -1, current_game, PROPERTIES_PAGE);
+
+ /* Just in case the toggle MMX on/off */
+ UpdateStatusBar();
+ break;
+
+ // NOT WORKING
+ case ID_FOLDER_PROPERTIES:
+ if (!oldControl && (current_game >= 0))
+ {
+ OPTIONS_TYPE curOptType = OPTIONS_SOURCE;
+ folder = GetSelectedFolder();
+ if (folder)
+ {
+ if(folder->m_nFolderId == FOLDER_VECTOR)
+ curOptType = OPTIONS_VECTOR;
+
+ InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), curOptType, folder->m_nFolderId, current_game);
+ }
+ }
+ /* Just in case the toggle MMX on/off */
+ UpdateStatusBar();
+ break;
+
+ case ID_FOLDER_SOURCEPROPERTIES:
+ if (!oldControl && (current_game >= 0))
+ {
+ //InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), (folder->m_nFolderId == FOLDER_VECTOR) ? OPTIONS_VECTOR : OPTIONS_SOURCE , -1, current_game);
+ InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), OPTIONS_SOURCE, -1, current_game);
+ }
+ /* Just in case the toggle MMX on/off */
+ UpdateStatusBar();
+ break;
+
+ case ID_FOLDER_VECTORPROPERTIES:
+ if (!oldControl && (current_game >= 0))
+ {
+ folder = GetFolderByID( FOLDER_VECTOR );
+ InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), OPTIONS_VECTOR, folder->m_nFolderId, current_game);
+ }
+ /* Just in case the toggle MMX on/off */
+ UpdateStatusBar();
+ break;
+
+ case ID_FOLDER_AUDIT:
+ FolderCheck();
+ /* Just in case the toggle MMX on/off */
+ UpdateStatusBar();
+ break;
+
+ case ID_VIEW_PICTURE_AREA :
+ ToggleScreenShot();
+ break;
+
+ case ID_UPDATE_GAMELIST:
+ UpdateGameList(true, true);
+ break;
+
+ case ID_UPDATE_CACHE:
+ UpdateCache();
+ break;
+
+ case ID_OPTIONS_FONT:
+ PickFont();
+ return true;
+
+ case ID_OPTIONS_CLONE_COLOR:
+ PickCloneColor();
+ return true;
+
+ case ID_OPTIONS_DEFAULTS:
+ /* Check the return value to see if changes were applied */
+ if (!oldControl)
+ {
+ InitDefaultPropertyPage(hInst, hwnd);
+ }
+ SetFocus(hwndList);
+ return true;
+
+ case ID_OPTIONS_DIR:
+ {
+ int nResult = DialogBox(GetModuleHandle(NULL),
+ MAKEINTRESOURCE(IDD_DIRECTORIES),
+ hMain,
+ DirectoriesDialogProc);
+
+ SaveDefaultOptions();
+ SaveOptions();
+
+ BOOL bUpdateRoms = ((nResult & DIRDLG_ROMS) == DIRDLG_ROMS) ? true : false;
+ BOOL bUpdateSamples = ((nResult & DIRDLG_SAMPLES) == DIRDLG_SAMPLES) ? true : false;
+
+ if (s_pWatcher)
+ {
+ if (bUpdateRoms)
+ DirWatcher_Watch(s_pWatcher, 0, GetRomDirs(), true);
+ if (bUpdateSamples)
+ DirWatcher_Watch(s_pWatcher, 1, GetSampleDirs(), true);
+ }
+
+ /* update game list */
+ if (bUpdateRoms == true || bUpdateSamples == true)
+ UpdateGameList(bUpdateRoms, bUpdateSamples);
+
+ SetFocus(hwndList);
+ }
+ return true;
+
+ case ID_OPTIONS_RESET_DEFAULTS:
+ if (DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_RESET), hMain, ResetDialogProc) == true)
+ {
+ // these may have been changed
+ SaveDefaultOptions();
+ SaveOptions();
+ DestroyWindow(hwnd);
+ PostQuitMessage(0);
+ }
+ else
+ {
+ ResetListView();
+ SetFocus(hwndList);
+ }
+ return true;
+
+ case ID_OPTIONS_INTERFACE:
+ DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_INTERFACE_OPTIONS), hMain, InterfaceDialogProc);
+ SaveOptions();
+
+ KillTimer(hMain, SCREENSHOT_TIMER);
+ if( GetCycleScreenshot() > 0)
+ {
+ SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL ); // Scale to seconds
+ }
+
+ return true;
+
+ case ID_VIDEO_SNAP:
+ {
+ int nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame >= 0)
+ {
+ string path = GetVideoDir() + string("\\") + driver_list::driver(nGame).name + string(".mp4");
+ ShellExecuteCommon(hMain, path.c_str());
+ }
+ SetFocus(hwndList);
+ }
+ break;
+
+ case ID_MANUAL:
+ {
+ int nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame >= 0)
+ {
+ string path = GetManualsDir() + string("\\") + driver_list::driver(nGame).name + string(".pdf");
+ ShellExecuteCommon(hMain, path.c_str());
+ }
+ SetFocus(hwndList);
+ }
+ break;
+
+ case ID_OPTIONS_BG:
+ {
+ // Get the path from the existing filename; if no filename go to root
+ TCHAR* t_bgdir = TEXT(".");
+ bool free_bgdir = false;
+ string as, s = GetBgDir();
+ util::zippath_parent(as, s.c_str());
+ size_t t1 = as.length()-1;
+ if (as[t1] == '\\') as.substr(0, t1-1);
+ t1 = as.find(':');
+ if (t1 != string::npos)
+ {
+ t_bgdir = ui_wstring_from_utf8(as.c_str());
+ free_bgdir = true;
+ if( !t_bgdir )
+ return false;
+ }
+
+ OPENFILENAME OFN;
+ TCHAR szFile[MAX_PATH] = TEXT("\0");
+
+ OFN.lStructSize = sizeof(OPENFILENAME);
+ OFN.hwndOwner = hMain;
+ OFN.hInstance = 0;
+ OFN.lpstrFilter = TEXT("Image Files (*.png)\0*.PNG\0");
+ OFN.lpstrCustomFilter = NULL;
+ OFN.nMaxCustFilter = 0;
+ OFN.nFilterIndex = 1;
+ OFN.lpstrFile = szFile;
+ OFN.nMaxFile = sizeof(szFile);
+ OFN.lpstrFileTitle = NULL;
+ OFN.nMaxFileTitle = 0;
+ OFN.lpstrInitialDir = t_bgdir;
+ OFN.lpstrTitle = TEXT("Select a Background Image");
+ OFN.nFileOffset = 0;
+ OFN.nFileExtension = 0;
+ OFN.lpstrDefExt = NULL;
+ OFN.lCustData = 0;
+ OFN.lpfnHook = NULL;
+ OFN.lpTemplateName = NULL;
+ OFN.Flags = OFN_NOCHANGEDIR | OFN_SHOWHELP | OFN_EXPLORER;
+
+ BOOL res = GetOpenFileName(&OFN);
+ if (res)
+ {
+ if (free_bgdir)
+ free(t_bgdir);
+ utf8_szFile = ui_utf8_from_wstring(szFile);
+ if( !utf8_szFile )
+ return false;
+
+ // Make this file as the new default
+ SetBgDir(utf8_szFile);
+
+ // Display new background
+ LoadBackgroundBitmap();
+ InvalidateRect(hMain, NULL, true);
+ free(utf8_szFile);
+ return true;
+ }
+ if (free_bgdir)
+ free(t_bgdir);
+ }
+ break;
+#if 0
+ case ID_OPTIONS_HISTORY:
+ {
+ char filename[MAX_PATH];
+ strcpy(filename, GetHistoryFileName());
+ if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_HISTORY_FILE))
+ {
+ SetHistoryFileName(filename);
+ }
+ return true;
+ }
+ case ID_OPTIONS_MAMEINFO:
+ {
+ char filename[MAX_PATH];
+ strcpy(filename, GetMAMEInfoFileName());
+ if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_MAMEINFO_FILE))
+ {
+ SetMAMEInfoFileName(filename);
+ }
+ return true;
+ }
+#endif
+ case ID_HELP_ABOUT:
+ DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUT), hMain, AboutDialogProc);
+ SetFocus(hwndList);
+ return true;
+
+ case IDOK :
+ /* cmk -- might need to check more codes here, not sure */
+ if (codeNotify != EN_CHANGE && codeNotify != EN_UPDATE)
+ {
+ /* enter key */
+ if (g_in_treeview_edit)
+ {
+ res = TreeView_EndEditLabelNow(hTreeView, false);
+ return true;
+ }
+ else
+ if (have_selection)
+ MamePlayGame();
+ }
+ break;
+
+ case IDCANCEL : /* esc key */
+ if (g_in_treeview_edit)
+ res = TreeView_EndEditLabelNow(hTreeView, true);
+ break;
+
+ case IDC_PLAY_GAME :
+ if (have_selection)
+ MamePlayGame();
+ break;
+
+ case ID_UI_START:
+ SetFocus(hwndList);
+ MamePlayGame();
+ break;
+
+ case ID_UI_UP:
+ Picker_SetSelectedPick(hwndList, GetSelectedPick() - 1);
+ break;
+
+ case ID_UI_DOWN:
+ Picker_SetSelectedPick(hwndList, GetSelectedPick() + 1);
+ break;
+
+ case ID_UI_PGUP:
+ Picker_SetSelectedPick(hwndList, GetSelectedPick() - ListView_GetCountPerPage(hwndList));
+ break;
+
+ case ID_UI_PGDOWN:
+ if ( (GetSelectedPick() + ListView_GetCountPerPage(hwndList)) < ListView_GetItemCount(hwndList) )
+ Picker_SetSelectedPick(hwndList, GetSelectedPick() + ListView_GetCountPerPage(hwndList) );
+ else
+ Picker_SetSelectedPick(hwndList, ListView_GetItemCount(hwndList)-1 );
+ break;
+
+ case ID_UI_HOME:
+ Picker_SetSelectedPick(hwndList, 0);
+ break;
+
+ case ID_UI_END:
+ Picker_SetSelectedPick(hwndList, ListView_GetItemCount(hwndList)-1 );
+ break;
+ case ID_UI_LEFT:
+ /* hmmmmm..... */
+ SendMessage(hwndList,WM_HSCROLL, SB_LINELEFT, 0);
+ break;
+
+ case ID_UI_RIGHT:
+ /* hmmmmm..... */
+ SendMessage(hwndList,WM_HSCROLL, SB_LINERIGHT, 0);
+ break;
+ case ID_UI_HISTORY_UP:
+ /* hmmmmm..... */
+ {
+ HWND hHistory = GetDlgItem(hMain, IDC_HISTORY);
+ SendMessage(hHistory, EM_SCROLL, SB_PAGEUP, 0);
+ }
+ break;
+
+ case ID_UI_HISTORY_DOWN:
+ /* hmmmmm..... */
+ {
+ HWND hHistory = GetDlgItem(hMain, IDC_HISTORY);
+ SendMessage(hHistory, EM_SCROLL, SB_PAGEDOWN, 0);
+ }
+ break;
+
+ case IDC_SSFRAME:
+ TabView_CalculateNextTab(hTabCtrl);
+ UpdateScreenShot();
+ TabView_UpdateSelection(hTabCtrl);
+ break;
+
+ case ID_CONTEXT_SELECT_RANDOM:
+ SetRandomPickItem();
+ break;
+
+ case ID_CONTEXT_RESET_PLAYSTATS:
+ ResetPlayTime(current_game);
+ ResetPlayCount(current_game);
+ res = ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick());
+ break;
+
+ case ID_CONTEXT_RENAME_CUSTOM :
+ TreeView_EditLabel(hTreeView,TreeView_GetSelection(hTreeView));
+ break;
+
+ default:
+ if (id >= ID_CONTEXT_SHOW_FOLDER_START && id < ID_CONTEXT_SHOW_FOLDER_END)
+ {
+ ToggleShowFolder(id - ID_CONTEXT_SHOW_FOLDER_START);
+ break;
+ }
+ for (i = 0; g_helpInfo[i].nMenuItem > 0; i++)
+ {
+ if (g_helpInfo[i].nMenuItem == id)
+ {
+ printf("%X: %ls\n",g_helpInfo[i].bIsHtmlHelp, g_helpInfo[i].lpFile);
+ if (i == 1) // get current whatsnew.txt from mamedev.org
+ {
+ string version = string(GetVersionString()); // turn version string into std
+ version.erase(1,1); // take out the decimal point
+ version.erase(4, string::npos); // take out the date
+ string url = "https://mamedev.org/releases/whatsnew_" + version + ".txt"; // construct url
+ std::wstring stemp = s2ws(url); // convert to wide string (yeah, typical c++ mess)
+ LPCWSTR result = stemp.c_str(); // then convert to const wchar_t*
+ ShellExecute(hMain, TEXT("open"), result, TEXT(""), NULL, SW_SHOWNORMAL); // show web page
+ }
+ else
+ if (g_helpInfo[i].bIsHtmlHelp)
+// HelpFunction(hMain, g_helpInfo[i].lpFile, HH_DISPLAY_TOPIC, 0);
+ ShellExecute(hMain, TEXT("open"), g_helpInfo[i].lpFile, TEXT(""), NULL, SW_SHOWNORMAL);
+// else
+// DisplayTextFile(hMain, g_helpInfo[i].lpFile);
+ return false;
+ }
+ }
+ break;
+ }
+ res++;
+ return false;
+}
+
+static void LoadBackgroundBitmap()
+{
+ HGLOBAL hDIBbg;
+
+ if (hBackground)
+ {
+ DeleteBitmap(hBackground);
+ hBackground = 0;
+ }
+
+ if (hPALbg)
+ {
+ DeletePalette(hPALbg);
+ hPALbg = 0;
+ }
+
+ if (LoadDIBBG(&hDIBbg, &hPALbg))
+ {
+ HDC hDC = GetDC(hwndList);
+ hBackground = DIBToDDB(hDC, hDIBbg, &bmDesc);
+ GlobalFree(hDIBbg);
+ ReleaseDC(hwndList, hDC);
+ }
+}
+
+static void ResetColumnDisplay(BOOL first_time)
+{
+ if (!first_time)
+ Picker_ResetColumnDisplay(hwndList);
+
+ ResetListView();
+
+ Picker_SetSelectedItem(hwndList, GetDefaultGame());
+}
+
+static int GamePicker_GetItemImage(HWND hwndPicker, int nItem)
+{
+ return GetIconForDriver(nItem);
+}
+
+static const TCHAR *GamePicker_GetItemString(HWND hwndPicker, int nItem, int nColumn, TCHAR *pszBuffer, UINT nBufferLength)
+{
+ const TCHAR *s = NULL;
+ const char* utf8_s = NULL;
+ char playtime_buf[256];
+
+ switch(nColumn)
+ {
+ case COLUMN_GAMES:
+ /* Driver description */
+ utf8_s = ModifyThe(driver_list::driver(nItem).type.fullname());
+ break;
+
+ case COLUMN_ORIENTATION:
+ utf8_s = DriverIsVertical(nItem) ? "Vertical" : "Horizontal";
+ break;
+
+ case COLUMN_ROMS:
+ utf8_s = GetAuditString(GetRomAuditResults(nItem));
+ break;
+
+ case COLUMN_SAMPLES:
+ /* Samples */
+ if (DriverUsesSamples(nItem))
+ utf8_s = GetAuditString(GetSampleAuditResults(nItem));
+ else
+ s = TEXT("-");
+ break;
+
+ case COLUMN_DIRECTORY:
+ /* Driver name (directory) */
+ utf8_s = driver_list::driver(nItem).name;
+ break;
+
+ case COLUMN_SRCDRIVERS:
+ /* Source drivers */
+ utf8_s = GetDriverFilename(nItem);
+ break;
+
+ case COLUMN_PLAYTIME:
+ /* Source drivers */
+ GetTextPlayTime(nItem, playtime_buf);
+ utf8_s = playtime_buf;
+ break;
+
+ case COLUMN_TYPE:
+ /* Vector/Raster */
+ {
+ if (DriverIsVector(nItem))
+ s = TEXT("Vector");
+ else
+ s = TEXT("Raster");
+ break;
+ }
+
+ case COLUMN_TRACKBALL:
+ /* Trackball */
+ if (DriverUsesTrackball(nItem))
+ s = TEXT("Yes");
+ else
+ s = TEXT("No");
+ break;
+
+ case COLUMN_PLAYED:
+ /* times played */
+ _sntprintf(pszBuffer, nBufferLength, TEXT("%i"), GetPlayCount(nItem));
+ s = pszBuffer;
+ break;
+
+ case COLUMN_MANUFACTURER:
+ /* Manufacturer */
+ utf8_s = driver_list::driver(nItem).manufacturer;
+ break;
+
+ case COLUMN_YEAR:
+ /* Year */
+ utf8_s = driver_list::driver(nItem).year;
+ break;
+
+ case COLUMN_CLONE:
+ utf8_s = GetCloneParentName(nItem);
+ break;
+ }
+
+ if( utf8_s )
+ {
+ TCHAR* t_s = ui_wstring_from_utf8(utf8_s);
+ if( !t_s )
+ return s;
+
+ _sntprintf(pszBuffer, nBufferLength, TEXT("%s"), t_s);
+ free(t_s);
+
+ s = pszBuffer;
+ }
+
+ return s;
+}
+
+static void GamePicker_LeavingItem(HWND hwndPicker, int nItem)
+{
+ // leaving item
+ // printf("leaving %s\n",driver_list::driver(nItem).name);
+}
+
+static void GamePicker_EnteringItem(HWND hwndPicker, int nItem)
+{
+ EnableSelection(nItem);
+
+ // decide if it is valid to load a savestate
+ if (DriverSupportsSaveState(nItem))
+ EnableMenuItem(GetMenu(hMain), ID_FILE_LOADSTATE, MFS_ENABLED);
+ else
+ EnableMenuItem(GetMenu(hMain), ID_FILE_LOADSTATE, MFS_GRAYED);
+}
+
+static int GamePicker_FindItemParent(HWND hwndPicker, int nItem)
+{
+ return GetParentRomSetIndex(&driver_list::driver(nItem));
+}
+
+/* Initialize the Picker and List controls */
+static void InitListView()
+{
+ LVBKIMAGE bki;
+ //TCHAR path[MAX_PATH];
+ TCHAR* t_bgdir;
+ BOOL res;
+
+ static const struct PickerCallbacks s_gameListCallbacks =
+ {
+ SetSortColumn, /* pfnSetSortColumn */
+ GetSortColumn, /* pfnGetSortColumn */
+ SetSortReverse, /* pfnSetSortReverse */
+ GetSortReverse, /* pfnGetSortReverse */
+ SetViewMode, /* pfnSetViewMode */
+ GetViewMode, /* pfnGetViewMode */
+ SetColumnWidths, /* pfnSetColumnWidths */
+ GetColumnWidths, /* pfnGetColumnWidths */
+ SetColumnOrder, /* pfnSetColumnOrder */
+ GetColumnOrder, /* pfnGetColumnOrder */
+ SetColumnShown, /* pfnSetColumnShown */
+ GetColumnShown, /* pfnGetColumnShown */
+ GetOffsetClones, /* pfnGetOffsetChildren */
+
+ GamePicker_Compare, /* pfnCompare */
+ MamePlayGame, /* pfnDoubleClick */
+ GamePicker_GetItemString, /* pfnGetItemString */
+ GamePicker_GetItemImage, /* pfnGetItemImage */
+ GamePicker_LeavingItem, /* pfnLeavingItem */
+ GamePicker_EnteringItem, /* pfnEnteringItem */
+ BeginListViewDrag, /* pfnBeginListViewDrag */
+ GamePicker_FindItemParent, /* pfnFindItemParent */
+ OnIdle, /* pfnIdle */
+ GamePicker_OnHeaderContextMenu, /* pfnOnHeaderContextMenu */
+ GamePicker_OnBodyContextMenu /* pfnOnBodyContextMenu */
+ };
+
+ struct PickerOptions opts;
+
+ // subclass the list view
+ memset(&opts, 0, sizeof(opts));
+ opts.pCallbacks = &s_gameListCallbacks;
+ opts.nColumnCount = COLUMN_MAX;
+ opts.ppszColumnNames = column_names;
+ SetupPicker(hwndList, &opts);
+
+ res = ListView_SetTextBkColor(hwndList, CLR_NONE);
+ res = ListView_SetBkColor(hwndList, CLR_NONE);
+ t_bgdir = ui_wstring_from_utf8(GetBgDir().c_str());
+ if( !t_bgdir )
+ return;
+
+ bki.ulFlags = LVBKIF_SOURCE_URL | LVBKIF_STYLE_TILE;
+ bki.pszImage = t_bgdir;
+ if( hBackground )
+ res = ListView_SetBkImage(hwndList, &bki);
+
+ CreateIcons();
+
+ ResetColumnDisplay(true);
+
+ // Allow selection to change the default saved game
+ bListReady = true;
+ res++;
+ free(t_bgdir);
+}
+
+
+static void AddDriverIcon(int nItem,int default_icon_index)
+{
+ HICON hIcon = 0;
+ int nParentIndex = -1;
+
+ /* if already set to rom or clone icon, we've been here before */
+ if (icon_index[nItem] == 1 || icon_index[nItem] == 3)
+ return;
+
+ hIcon = LoadIconFromFile((char *)driver_list::driver(nItem).name);
+ if (hIcon == NULL)
+ {
+ nParentIndex = GetParentIndex(&driver_list::driver(nItem));
+ if( nParentIndex >= 0)
+ {
+ hIcon = LoadIconFromFile((char *)driver_list::driver(nParentIndex).name);
+ nParentIndex = GetParentIndex(&driver_list::driver(nParentIndex));
+ if (hIcon == NULL && nParentIndex >= 0)
+ hIcon = LoadIconFromFile((char *)driver_list::driver(nParentIndex).name);
+ }
+ }
+
+ if (hIcon)
+ {
+ int nIconPos = ImageList_AddIcon(hSmall, hIcon);
+ ImageList_AddIcon(hLarge, hIcon);
+ if (nIconPos != -1)
+ icon_index[nItem] = nIconPos;
+ DestroyIcon(hIcon);
+ }
+ if (icon_index[nItem] == 0)
+ icon_index[nItem] = default_icon_index;
+}
+
+static void DestroyIcons(void)
+{
+ if (hSmall)
+ {
+ ImageList_Destroy(hSmall);
+ hSmall = NULL;
+ }
+
+ if (icon_index)
+ {
+ int i;
+ for (i=0;i<driver_list::total();i++)
+ icon_index[i] = 0; // these are indices into hSmall
+ }
+
+ if (hLarge)
+ {
+ ImageList_Destroy(hLarge);
+ hLarge = NULL;
+ }
+
+ if (hHeaderImages)
+ {
+ ImageList_Destroy(hHeaderImages);
+ hHeaderImages = NULL;
+ }
+
+}
+
+static void ReloadIcons(void)
+{
+ HICON hIcon;
+ INT i;
+
+ // clear out all the images
+ ImageList_RemoveAll(hSmall);
+ ImageList_RemoveAll(hLarge);
+
+ if (icon_index)
+ for (i=0; i<driver_list::total(); i++)
+ icon_index[i] = 0; // these are indices into hSmall
+
+ for (i = 0; g_iconData[i].icon_name; i++)
+ {
+ hIcon = LoadIconFromFile((char *) g_iconData[i].icon_name);
+ if (hIcon == NULL)
+ hIcon = LoadIcon(hInst, MAKEINTRESOURCE(g_iconData[i].resource));
+
+ ImageList_AddIcon(hSmall, hIcon);
+ ImageList_AddIcon(hLarge, hIcon);
+ DestroyIcon(hIcon);
+ }
+}
+
+static DWORD GetShellLargeIconSize(void)
+{
+ DWORD dwSize = 32, dwLength = 512, dwType = REG_SZ;
+ TCHAR szBuffer[512];
+ HKEY hKey;
+ LONG lRes;
+ LPTSTR tErrorMessage = NULL;
+
+ /* Get the Key */
+ lRes = RegOpenKey(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop\\WindowMetrics"), &hKey);
+ if( lRes != ERROR_SUCCESS )
+ {
+ GetSystemErrorMessage(lRes, &tErrorMessage);
+ MessageBox(GetMainWindow(), tErrorMessage, TEXT("Large shell icon size registry access"), MB_OK | MB_ICONERROR);
+ LocalFree(tErrorMessage);
+ return dwSize;
+ }
+
+ /* Save the last size */
+ lRes = RegQueryValueEx(hKey, TEXT("Shell Icon Size"), NULL, &dwType, (LPBYTE)szBuffer, &dwLength);
+ if( lRes != ERROR_SUCCESS )
+ {
+ GetSystemErrorMessage(lRes, &tErrorMessage);
+ MessageBox(GetMainWindow(), tErrorMessage, TEXT("Large shell icon size registry query"), MB_OK | MB_ICONERROR);
+ LocalFree(tErrorMessage);
+ RegCloseKey(hKey);
+ return dwSize;
+ }
+
+ dwSize = _ttol(szBuffer);
+ if (dwSize < 32)
+ dwSize = 32;
+
+ if (dwSize > 48)
+ dwSize = 48;
+
+ /* Clean up */
+ RegCloseKey(hKey);
+ return dwSize;
+}
+
+static DWORD GetShellSmallIconSize(void)
+{
+ DWORD dwSize = ICONMAP_WIDTH;
+
+ if (dwSize < 48)
+ {
+ if (dwSize < 32)
+ dwSize = 16;
+ else
+ dwSize = 32;
+ }
+ else
+ {
+ dwSize = 48;
+ }
+ return dwSize;
+}
+
+// create iconlist for Listview control
+static void CreateIcons(void)
+{
+ DWORD dwSmallIconSize = GetShellSmallIconSize();
+ DWORD dwLargeIconSize = GetShellLargeIconSize();
+ HICON hIcon;
+ int icon_count;
+ DWORD dwStyle;
+ int i;
+ int grow = 5000;
+
+ icon_count = 0;
+ while(g_iconData[icon_count].icon_name)
+ icon_count++;
+
+ // the current window style affects the sizing of the rows when changing
+ // between list views, so put it in small icon mode temporarily while we associate
+ // our image list
+ //
+ // using large icon mode instead kills the horizontal scrollbar when doing
+ // full refresh, which seems odd (it should recreate the scrollbar when
+ // set back to report mode, for example, but it doesn't).
+
+ dwStyle = GetWindowLong(hwndList,GWL_STYLE);
+ SetWindowLong(hwndList,GWL_STYLE,(dwStyle & ~LVS_TYPEMASK) | LVS_ICON);
+
+ hSmall = ImageList_Create(dwSmallIconSize, dwSmallIconSize,
+ ILC_COLORDDB | ILC_MASK, icon_count, icon_count + grow);
+
+ if (NULL == hSmall)
+ {
+ win_message_box_utf8(hwndList, "Cannot allocate small icon image list", "Allocation error - Exiting", IDOK);
+ PostQuitMessage(0);
+ }
+
+ hLarge = ImageList_Create(dwLargeIconSize, dwLargeIconSize,
+ ILC_COLORDDB | ILC_MASK, icon_count, icon_count + grow);
+
+ if (NULL == hLarge) {
+ win_message_box_utf8(hwndList, "Cannot allocate large icon image list", "Allocation error - Exiting", IDOK);
+ PostQuitMessage(0);
+ }
+
+ ReloadIcons();
+
+ // Associate the image lists with the list view control.
+ (void)ListView_SetImageList(hwndList, hSmall, LVSIL_SMALL);
+ (void)ListView_SetImageList(hwndList, hLarge, LVSIL_NORMAL);
+
+ // restore our view
+ SetWindowLong(hwndList,GWL_STYLE,dwStyle);
+
+ // Now set up header specific stuff
+ hHeaderImages = ImageList_Create(16,16,ILC_COLORDDB | ILC_MASK,2,2);
+ hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_HEADER_UP));
+ ImageList_AddIcon(hHeaderImages,hIcon);
+ hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_HEADER_DOWN));
+ ImageList_AddIcon(hHeaderImages,hIcon);
+
+ for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++)
+ Picker_SetHeaderImageList(GetDlgItem(hMain, s_nPickers[i]), hHeaderImages);
+}
+
+
+
+static int GamePicker_Compare(HWND hwndPicker, int index1, int index2, int sort_subitem)
+{
+ int value = 0; /* Default to 0, for unknown case */
+ const char *name1 = NULL;
+ const char *name2 = NULL;
+ char file1[20];
+ char file2[20];
+ int nTemp1, nTemp2;
+
+ switch (sort_subitem)
+ {
+ case COLUMN_GAMES:
+ return core_stricmp(ModifyThe(driver_list::driver(index1).type.fullname()), ModifyThe(driver_list::driver(index2).type.fullname()));
+
+ case COLUMN_ORIENTATION:
+ nTemp1 = DriverIsVertical(index1) ? 1 : 0;
+ nTemp2 = DriverIsVertical(index2) ? 1 : 0;
+ value = nTemp1 - nTemp2;
+ break;
+
+ case COLUMN_SAMPLES:
+ nTemp1 = -1;
+ if (DriverUsesSamples(index1))
+ {
+ int audit_result = GetSampleAuditResults(index1);
+ if (IsAuditResultKnown(audit_result))
+ {
+ if (IsAuditResultYes(audit_result))
+ nTemp1 = 1;
+ else
+ nTemp1 = 0;
+ }
+ else
+ nTemp1 = 2;
+ }
+
+ nTemp2 = -1;
+ if (DriverUsesSamples(index2))
+ {
+ int audit_result = GetSampleAuditResults(index1);
+ if (IsAuditResultKnown(audit_result))
+ {
+ if (IsAuditResultYes(audit_result))
+ nTemp2 = 1;
+ else
+ nTemp2 = 0;
+ }
+ else
+ nTemp2 = 2;
+ }
+ value = nTemp2 - nTemp1;
+ break;
+
+ case COLUMN_DIRECTORY:
+ value = core_stricmp(driver_list::driver(index1).name, driver_list::driver(index2).name);
+ break;
+
+ case COLUMN_SRCDRIVERS:
+ strcpy(file1, GetDriverFilename(index1));
+ strcpy(file2, GetDriverFilename(index2));
+ value = core_stricmp(file1, file2);
+ break;
+
+ case COLUMN_PLAYTIME:
+ value = GetPlayTime(index1) - GetPlayTime(index2);
+ break;
+
+ case COLUMN_TYPE:
+ {
+ value = DriverIsVector(index1) - DriverIsVector(index2);
+ break;
+ }
+
+ case COLUMN_TRACKBALL:
+ value = DriverUsesTrackball(index1) - DriverUsesTrackball(index2);
+ break;
+
+ case COLUMN_PLAYED:
+ value = GetPlayCount(index1) - GetPlayCount(index2);
+ break;
+
+ case COLUMN_MANUFACTURER:
+ value = core_stricmp(driver_list::driver(index1).manufacturer, driver_list::driver(index2).manufacturer);
+ break;
+
+ case COLUMN_YEAR:
+ value = core_stricmp(driver_list::driver(index1).year, driver_list::driver(index2).year);
+ break;
+
+ case COLUMN_CLONE:
+ name1 = GetCloneParentName(index1);
+ name2 = GetCloneParentName(index2);
+
+ if (*name1 == '\0')
+ name1 = NULL;
+ if (*name2 == '\0')
+ name2 = NULL;
+
+ if (NULL == name1 && NULL == name2)
+ value = 0;
+ else if (name2 == NULL)
+ value = -1;
+ else if (name1 == NULL)
+ value = 1;
+ else
+ value = core_stricmp(name1, name2);
+ break;
+ }
+
+ // Handle same comparisons here
+ if (0 == value && COLUMN_GAMES != sort_subitem)
+ {
+ value = GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES);
+ }
+
+ return value;
+}
+
+int GetSelectedPick()
+{
+ /* returns index of listview selected item */
+ /* This will return -1 if not found */
+ return ListView_GetNextItem(hwndList, -1, LVIS_SELECTED | LVIS_FOCUSED);
+}
+
+static HICON GetSelectedPickItemIcon()
+{
+ LV_ITEM lvi;
+ lvi.iItem = GetSelectedPick();
+ lvi.iSubItem = 0;
+ lvi.mask = LVIF_IMAGE;
+ BOOL res = ListView_GetItem(hwndList, &lvi);
+ res++;
+ return ImageList_GetIcon(hLarge, lvi.iImage, ILD_TRANSPARENT);
+}
+
+static void SetRandomPickItem()
+{
+ int nListCount = ListView_GetItemCount(hwndList);
+
+ if (nListCount > 0)
+ Picker_SetSelectedPick(hwndList, rand() % nListCount);
+}
+
+BOOL CommonFileDialog(common_file_dialog_proc cfd, char *filename, int filetype)
+{
+ BOOL success;
+ UINT16 i;
+ OPENFILENAME ofn;
+ string dirname;
+ TCHAR* t_filename;
+ TCHAR t_filename_buffer[MAX_PATH] = {0, };
+ char *utf8_filename;
+
+ // convert the filename to UTF-8 and copy into buffer
+ t_filename = ui_wstring_from_utf8(filename);
+ if (t_filename)
+ {
+ _sntprintf(t_filename_buffer, ARRAY_LENGTH(t_filename_buffer), TEXT("%s"), t_filename);
+ free(t_filename);
+ }
+
+ ofn.lStructSize = sizeof(ofn);
+ ofn.hwndOwner = hMain;
+ ofn.hInstance = NULL;
+ switch (filetype)
+ {
+ case FILETYPE_INPUT_FILES :
+ ofn.lpstrFilter = TEXT("input files (*.inp,*.zip,*.7z)\0*.inp;*.zip;*.7z\0All files (*.*)\0*.*\0");
+ ofn.lpstrDefExt = TEXT("inp");
+ dirname = GetInpDir();
+ break;
+ case FILETYPE_SAVESTATE_FILES :
+ ofn.lpstrFilter = TEXT("savestate files (*.sta)\0*.sta;\0All files (*.*)\0*.*\0");
+ ofn.lpstrDefExt = TEXT("sta");
+ dirname = GetStateDir();
+ break;
+ case FILETYPE_WAVE_FILES :
+ ofn.lpstrFilter = TEXT("sounds (*.wav)\0*.wav;\0All files (*.*)\0*.*\0");
+ ofn.lpstrDefExt = TEXT("wav");
+ dirname = GetImgDir();
+ break;
+ case FILETYPE_MNG_FILES :
+ ofn.lpstrFilter = TEXT("videos (*.mng)\0*.mng;\0All files (*.*)\0*.*\0");
+ ofn.lpstrDefExt = TEXT("mng");
+ dirname = GetImgDir();
+ break;
+ case FILETYPE_AVI_FILES :
+ ofn.lpstrFilter = TEXT("videos (*.avi)\0*.avi;\0All files (*.*)\0*.*\0");
+ ofn.lpstrDefExt = TEXT("avi");
+ dirname = GetImgDir();
+ break;
+ case FILETYPE_EFFECT_FILES :
+ ofn.lpstrFilter = TEXT("effects (*.png)\0*.png;\0All files (*.*)\0*.*\0");
+ ofn.lpstrDefExt = TEXT("png");
+ dirname = GetArtDir();
+ break;
+ case FILETYPE_JOYMAP_FILES :
+ ofn.lpstrFilter = TEXT("maps (*.map,*.txt)\0*.map;*.txt;\0All files (*.*)\0*.*\0");
+ ofn.lpstrDefExt = TEXT("map");
+ dirname = GetCtrlrDir();
+ break;
+ case FILETYPE_DEBUGSCRIPT_FILES :
+ ofn.lpstrFilter = TEXT("scripts (*.txt,*.dat)\0*.txt;*.dat;\0All files (*.*)\0*.*\0");
+ ofn.lpstrDefExt = TEXT("txt");
+ dirname = GetInpDir();
+ break;
+ }
+ ofn.lpstrCustomFilter = NULL;
+ ofn.nMaxCustFilter = 0;
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFile = t_filename_buffer;
+ ofn.nMaxFile = ARRAY_LENGTH(t_filename_buffer);
+ ofn.lpstrFileTitle = NULL;
+ ofn.nMaxFileTitle = 0;
+
+ // Only want first directory
+ i = dirname.find(";");
+ if (i > 0)
+ dirname.resize(i);
+ if (dirname.empty())
+ dirname = ".";
+ ofn.lpstrInitialDir = ui_wstring_from_utf8(dirname.c_str());
+
+ ofn.lpstrTitle = NULL;
+ ofn.Flags = OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;
+ ofn.nFileOffset = 0;
+ ofn.nFileExtension = 0;
+ ofn.lCustData = 0;
+ ofn.lpfnHook = NULL;
+ ofn.lpTemplateName = NULL;
+
+ success = cfd(&ofn);
+ if (success)
+ {
+ //dprintf("got filename %s nFileExtension %u\n",filename,ofn.nFileExtension);
+ /*GetDirectory(filename,last_directory,sizeof(last_directory));*/
+ }
+
+ utf8_filename = ui_utf8_from_wstring(t_filename_buffer);
+ if (utf8_filename)
+ {
+ snprintf(filename, MAX_PATH, "%s", utf8_filename);
+ free(utf8_filename);
+ }
+
+ return success;
+}
+
+void SetStatusBarText(int part_index, const char *message)
+{
+ TCHAR* t_message = ui_wstring_from_utf8(message);
+ if( !t_message )
+ return;
+ SendMessage(hStatusBar, SB_SETTEXT, (WPARAM) part_index, (LPARAM)(LPCTSTR) win_tstring_strdup(t_message));
+ free(t_message);
+}
+
+void SetStatusBarTextF(int part_index, const char *fmt, ...)
+{
+ char buf[256];
+ va_list va;
+
+ va_start(va, fmt);
+ vsprintf(buf, fmt, va);
+ va_end(va);
+
+ SetStatusBarText(part_index, buf);
+}
+
+static void CLIB_DECL ATTR_PRINTF(1,2) MameMessageBox(const char *fmt, ...)
+{
+ char buf[2048];
+ va_list va;
+
+ va_start(va, fmt);
+ vsprintf(buf, fmt, va);
+ win_message_box_utf8(GetMainWindow(), buf, MAMEUINAME, MB_OK | MB_ICONERROR);
+ va_end(va);
+}
+
+static void MamePlayBackGame()
+{
+ char filename[MAX_PATH];
+ *filename = 0;
+
+ int nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame != -1)
+ strcpy(filename, driver_list::driver(nGame).name);
+
+ if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_INPUT_FILES))
+ {
+ osd_file::error fileerr;
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ char bare_fname[_MAX_FNAME];
+ char ext[_MAX_EXT];
+ char path[MAX_PATH];
+ char fname[MAX_PATH];
+ play_options playopts;
+
+ _splitpath(filename, drive, dir, bare_fname, ext);
+
+ sprintf(path,"%s%s",drive,dir);
+ sprintf(fname,"%s%s",bare_fname,ext);
+ if (path[strlen(path)-1] == '\\')
+ path[strlen(path)-1] = 0; // take off trailing back slash
+
+ emu_file pPlayBack(MameUIGlobal().input_directory(), OPEN_FLAG_READ);
+ fileerr = pPlayBack.open(fname);
+ if (fileerr != osd_file::error::NONE)
+ {
+ MameMessageBox("Could not open '%s' as a valid input file.", filename);
+ return;
+ }
+
+ // check for game name embedded in .inp header
+ inp_header header;
+
+ /* read the header and verify that it is a modern version; if not, print an error */
+ if (!header.read(pPlayBack))
+ {
+ MameMessageBox("Input file is corrupt or invalid (missing header)");
+ return;
+ }
+ if ((!header.check_magic()) || (header.get_majversion() != inp_header::MAJVERSION))
+ {
+ MameMessageBox("Input file invalid or in an older, unsupported format");
+ return;
+ }
+
+ string const sysname = header.get_sysname();
+ nGame = -1;
+ for (int i = 0; i < driver_list::total(); i++) // find game and play it
+ {
+ if (driver_list::driver(i).name == sysname)
+ {
+ nGame = i;
+ break;
+ }
+ }
+ if (nGame == -1)
+ {
+ MameMessageBox("Game \"%s\" cannot be found", sysname.c_str());
+ return;
+ }
+
+ memset(&playopts, 0, sizeof(playopts));
+ playopts.playback = fname;
+ playopts_apply = 0x57;
+ MamePlayGameWithOptions(nGame, &playopts);
+ }
+}
+
+static void MameLoadState()
+{
+ int nGame;
+ char filename[MAX_PATH];
+ char selected_filename[MAX_PATH];
+ play_options playopts;
+
+ *filename = 0;
+
+ nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame != -1)
+ {
+ strcpy(filename, driver_list::driver(nGame).name);
+ strcpy(selected_filename, driver_list::driver(nGame).name);
+ }
+ if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_SAVESTATE_FILES))
+ {
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ char ext[_MAX_EXT];
+
+ char path[MAX_PATH];
+ char fname[MAX_PATH];
+ char bare_fname[_MAX_FNAME];
+ char *state_fname;
+ //int rc;
+
+ _splitpath(filename, drive, dir, bare_fname, ext);
+
+ // parse path
+ sprintf(path,"%s%s",drive,dir);
+ sprintf(fname,"%s%s",bare_fname,ext);
+ if (path[strlen(path)-1] == '\\')
+ path[strlen(path)-1] = 0; // take off trailing back slash
+
+#ifdef MESS
+ {
+ state_fname = filename;
+ }
+#else // !MESS
+ {
+ char *cPos=0;
+ int iPos=0;
+ char romname[MAX_PATH];
+
+ cPos = strchr(bare_fname, '-' );
+ iPos = cPos ? cPos - bare_fname : strlen(bare_fname);
+ strncpy(romname, bare_fname, iPos );
+ romname[iPos] = '\0';
+ if( strcmp(selected_filename,romname) != 0 )
+ {
+ MameMessageBox("'%s' is not a valid savestate file for game '%s'.", filename, selected_filename);
+ return;
+ }
+ state_fname = fname;
+ }
+#endif // MESS
+ emu_file pSaveState(MameUIGlobal().state_directory(), OPEN_FLAG_READ);
+ osd_file::error fileerr = pSaveState.open(state_fname);
+ if (fileerr != osd_file::error::NONE)
+ {
+ MameMessageBox("Could not open '%s' as a valid savestate file.", filename);
+ return;
+ }
+
+ // call the MAME core function to check the save state file
+ //rc = state_manager::check_file(NULL, pSaveState, selected_filename, MameMessageBox);
+ //if (rc)
+// return;
+
+ memset(&playopts, 0, sizeof(playopts));
+#ifdef MESS
+ playopts.state = state_fname;
+ playopts_apply = 0x57;
+#else
+ {
+ char *cPos;
+ cPos = strrchr(bare_fname, '-' );
+ cPos = cPos+1;
+ if (*cPos != 0)
+ {
+ playopts.state = cPos;
+ }
+ }
+#endif
+
+ MamePlayGameWithOptions(nGame, &playopts);
+ }
+}
+
+static void MamePlayRecordGame()
+{
+ int nGame;
+ char filename[MAX_PATH];
+ *filename = 0;
+
+ nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame != -1)
+ strcpy(filename, driver_list::driver(nGame).name);
+
+ if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_INPUT_FILES))
+ {
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ char fname[_MAX_FNAME];
+ char ext[_MAX_EXT];
+ char path[MAX_PATH];
+ play_options playopts;
+
+ _splitpath(filename, drive, dir, fname, ext);
+
+ sprintf(path,"%s%s",drive,dir);
+ if (path[strlen(path)-1] == '\\')
+ path[strlen(path)-1] = 0; // take off trailing back slash
+
+ memset(&playopts, 0, sizeof(playopts));
+ strcat(fname, ".inp");
+ playopts.record = fname;
+ playopts_apply = 0x57;
+ MamePlayGameWithOptions(nGame, &playopts);
+ }
+}
+
+void MamePlayGame(void)
+{
+ int nGame;
+ play_options playopts;
+
+ nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame != -1)
+ {
+ memset(&playopts, 0, sizeof(playopts));
+ MamePlayGameWithOptions(nGame, &playopts);
+ }
+}
+
+static void MamePlayRecordWave()
+{
+ int nGame;
+ char filename[MAX_PATH];
+ play_options playopts;
+
+ nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame != -1)
+ strcpy(filename, driver_list::driver(nGame).name);
+
+ if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_WAVE_FILES))
+ {
+ memset(&playopts, 0, sizeof(playopts));
+ playopts.wavwrite = filename;
+ playopts_apply = 0x57;
+ MamePlayGameWithOptions(nGame, &playopts);
+ }
+}
+
+static void MamePlayRecordMNG()
+{
+ int nGame;
+ char filename[MAX_PATH] = { 0, };
+
+ nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame != -1)
+ strcpy(filename, driver_list::driver(nGame).name);
+
+ if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_MNG_FILES))
+ {
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ char fname[_MAX_FNAME];
+ char ext[_MAX_EXT];
+ char path[MAX_PATH];
+ play_options playopts;
+
+ _splitpath(filename, drive, dir, fname, ext);
+
+ sprintf(path,"%s%s",drive,dir);
+ if (path[strlen(path)-1] == '\\')
+ path[strlen(path)-1] = 0; // take off trailing back slash
+
+ memset(&playopts, 0, sizeof(playopts));
+ strcat(fname, ".mng");
+ playopts.mngwrite = fname;
+ playopts_apply = 0x57;
+ MamePlayGameWithOptions(nGame, &playopts);
+ }
+}
+
+static void MamePlayRecordAVI()
+{
+ int nGame;
+ char filename[MAX_PATH] = { 0, };
+
+ nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame != -1)
+ strcpy(filename, driver_list::driver(nGame).name);
+
+ if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_AVI_FILES))
+ {
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ char fname[_MAX_FNAME];
+ char ext[_MAX_EXT];
+ char path[MAX_PATH];
+ play_options playopts;
+
+ _splitpath(filename, drive, dir, fname, ext);
+
+ sprintf(path,"%s%s",drive,dir);
+ if (path[strlen(path)-1] == '\\')
+ path[strlen(path)-1] = 0; // take off trailing back slash
+
+ memset(&playopts, 0, sizeof(playopts));
+ strcat(fname, ".avi");
+ playopts.aviwrite = fname;
+ playopts_apply = 0x57;
+ MamePlayGameWithOptions(nGame, &playopts);
+ }
+}
+
+
+static void MamePlayGameWithOptions(int nGame, const play_options *playopts)
+{
+ DWORD dwExitCode;
+ BOOL res;
+
+ if (g_pJoyGUI)
+ KillTimer(hMain, JOYGUI_TIMER);
+ if (GetCycleScreenshot() > 0)
+ KillTimer(hMain, SCREENSHOT_TIMER);
+
+ in_emulation = true;
+
+ dwExitCode = RunMAME(nGame, playopts);
+ if (dwExitCode == 0)
+ {
+ IncrementPlayCount(nGame);
+ res = ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick());
+ }
+ else
+ {
+ ShowWindow(hMain, SW_SHOW);
+ }
+
+ in_emulation = false;
+
+ // re-sort if sorting on # of times played
+ if (GetSortColumn() == COLUMN_PLAYED)
+ Picker_Sort(hwndList);
+
+ UpdateStatusBar();
+
+ ShowWindow(hMain, SW_SHOW);
+ SetFocus(hwndList);
+
+ if (g_pJoyGUI)
+ SetTimer(hMain, JOYGUI_TIMER, JOYGUI_MS, NULL);
+ if (GetCycleScreenshot() > 0)
+ SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL); //scale to seconds
+ res++;
+}
+
+/* Toggle ScreenShot ON/OFF */
+static void ToggleScreenShot(void)
+{
+ UINT val = GetWindowPanes() ^ 8;
+ BOOL show = BIT(val, 3);
+ SetWindowPanes(val);
+ UpdateScreenShot();
+
+ /* Redraw list view */
+ if (hBackground && show)
+ InvalidateRect(hwndList, NULL, false);
+}
+
+static void AdjustMetrics(void)
+{
+ HDC hDC;
+ TEXTMETRIC tm;
+ int xtraX, xtraY;
+ AREA area;
+ int offX, offY;
+ int maxX, maxY;
+ COLORREF textColor;
+ TCHAR szClass[128];
+ HWND hWnd;
+ HRESULT res;
+ BOOL b_res;
+
+ /* WM_SETTINGCHANGE also */
+ xtraX = GetSystemMetrics(SM_CXFIXEDFRAME); /* Dialog frame width */
+ xtraY = GetSystemMetrics(SM_CYFIXEDFRAME); /* Dialog frame height */
+ xtraY += GetSystemMetrics(SM_CYMENUSIZE); /* Menu height */
+ xtraY += GetSystemMetrics(SM_CYCAPTION); /* Caption Height */
+ maxX = GetSystemMetrics(SM_CXSCREEN); /* Screen Width */
+ maxY = GetSystemMetrics(SM_CYSCREEN); /* Screen Height */
+
+ hDC = GetDC(hMain);
+ GetTextMetrics (hDC, &tm);
+
+ /* Convert MIN Width/Height from Dialog Box Units to pixels. */
+ MIN_WIDTH = (int)((tm.tmAveCharWidth / 4.0) * DBU_MIN_WIDTH) + xtraX;
+ MIN_HEIGHT = (int)((tm.tmHeight / 8.0) * DBU_MIN_HEIGHT) + xtraY;
+ ReleaseDC(hMain, hDC);
+
+ if ((textColor = GetListFontColor()) == RGB(255, 255, 255))
+ textColor = RGB(240, 240, 240);
+
+ hWnd = GetWindow(hMain, GW_CHILD);
+ while(hWnd)
+ {
+ if (GetClassName(hWnd, szClass, sizeof(szClass) / sizeof(szClass[0])))
+ {
+ if (!_tcscmp(szClass, TEXT("SysListView32")))
+ {
+ b_res = ListView_SetBkColor(hWnd, GetSysColor(COLOR_WINDOW));
+ b_res = ListView_SetTextColor(hWnd, textColor);
+ }
+ else if (!_tcscmp(szClass, TEXT("SysTreeView32")))
+ {
+ res = TreeView_SetBkColor(hTreeView, GetSysColor(COLOR_WINDOW));
+ res = TreeView_SetTextColor(hTreeView, textColor);
+ }
+ }
+ hWnd = GetWindow(hWnd, GW_HWNDNEXT);
+ }
+
+ GetWindowArea(&area);
+
+ offX = area.x + area.width;
+ offY = area.y + area.height;
+
+ if (offX > maxX)
+ {
+ offX = maxX;
+ area.x = (offX - area.width > 0) ? (offX - area.width) : 0;
+ }
+ if (offY > maxY)
+ {
+ offY = maxY;
+ area.y = (offY - area.height > 0) ? (offY - area.height) : 0;
+ }
+
+ SetWindowArea(&area);
+ SetWindowPos(hMain, 0, area.x, area.y, area.width, area.height, SWP_NOZORDER | SWP_SHOWWINDOW | SWP_NOACTIVATE);
+ res++;
+ b_res++;
+}
+
+int FindIconIndex(int nIconResource)
+{
+ int i;
+ for(i = 0; g_iconData[i].icon_name; i++)
+ {
+ if (g_iconData[i].resource == nIconResource)
+ return i;
+ }
+ return -1;
+}
+
+int FindIconIndexByName(const char *icon_name)
+{
+ int i;
+ for (i = 0; g_iconData[i].icon_name; i++)
+ {
+ if (!strcmp(g_iconData[i].icon_name, icon_name))
+ return i;
+ }
+ return -1;
+}
+
+static int GetIconForDriver(int nItem)
+{
+ int iconRoms = 1;
+
+ if (DriverUsesRoms(nItem))
+ {
+ int audit_result = GetRomAuditResults(nItem);
+ if (audit_result == -1)
+ return 2;
+ else
+ if (IsAuditResultYes(audit_result))
+ iconRoms = 1;
+ else
+ iconRoms = 0;
+ }
+
+ // iconRoms is now either 0 (no roms), 1 (roms), or 2 (unknown)
+
+ /* these are indices into icon_names, which maps into our image list
+ * also must match IDI_WIN_NOROMS + iconRoms
+ */
+
+ if (iconRoms == 1)
+ {
+ // Show Red-X if the ROMs are present and flagged as NOT WORKING
+ if (DriverIsBroken(nItem))
+ iconRoms = FindIconIndex(IDI_WIN_REDX); // iconRoms now = 4
+ else
+ // Show imperfect if the ROMs are present and flagged as imperfect
+ if (DriverIsImperfect(nItem))
+ iconRoms = FindIconIndex(IDI_WIN_IMPERFECT); // iconRoms now = 5
+ else
+ // show clone icon if we have roms and game is working
+ if (DriverIsClone(nItem))
+ iconRoms = FindIconIndex(IDI_WIN_CLONE); // iconRoms now = 3
+ }
+
+ // if we have the roms, then look for a custom per-game icon to override
+ // not 2, because this indicates F5 must be done; not 0, because this indicates roms are missing; only use 4 if user chooses it
+ BOOL redx = GetOverrideRedX() & (iconRoms == 4);
+ if (iconRoms == 1 || iconRoms == 3 || iconRoms == 5 || redx)
+ {
+ if (icon_index[nItem] == 0)
+ AddDriverIcon(nItem,iconRoms);
+ iconRoms = icon_index[nItem];
+ }
+
+ return iconRoms;
+}
+
+static BOOL HandleTreeContextMenu(HWND hWnd, WPARAM wParam, LPARAM lParam)
+{
+ HMENU hTreeMenu;
+ HMENU hMenu;
+ TVHITTESTINFO hti;
+ POINT pt;
+ BOOL res;
+
+ if ((HWND)wParam != GetDlgItem(hWnd, IDC_TREE))
+ return false;
+
+ pt.x = GET_X_LPARAM(lParam);
+ pt.y = GET_Y_LPARAM(lParam);
+ if (pt.x < 0 && pt.y < 0)
+ GetCursorPos(&pt);
+
+ /* select the item that was right clicked or shift-F10'ed */
+ hti.pt = pt;
+ ScreenToClient(hTreeView,&hti.pt);
+ (void)TreeView_HitTest(hTreeView,&hti);
+ if ((hti.flags & TVHT_ONITEM) != 0)
+ res = TreeView_SelectItem(hTreeView,hti.hItem);
+
+ hTreeMenu = LoadMenu(hInst,MAKEINTRESOURCE(IDR_CONTEXT_TREE));
+
+ InitTreeContextMenu(hTreeMenu);
+
+ hMenu = GetSubMenu(hTreeMenu, 0);
+
+ UpdateMenu(hMenu);
+
+ TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hWnd,NULL);
+
+ DestroyMenu(hTreeMenu);
+ res++;
+ return true;
+}
+
+
+
+static void GamePicker_OnBodyContextMenu(POINT pt)
+{
+ HMENU hMenuLoad;
+ HMENU hMenu;
+
+ hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_MENU));
+ hMenu = GetSubMenu(hMenuLoad, 0);
+ InitBodyContextMenu(hMenu);
+
+ UpdateMenu(hMenu);
+
+ TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hMain,NULL);
+
+ DestroyMenu(hMenuLoad);
+}
+
+
+
+static BOOL HandleScreenShotContextMenu(HWND hWnd, WPARAM wParam, LPARAM lParam)
+{
+ HMENU hMenuLoad;
+ HMENU hMenu;
+ POINT pt;
+
+ if ((HWND)wParam != GetDlgItem(hWnd, IDC_SSPICTURE) && (HWND)wParam != GetDlgItem(hWnd, IDC_SSFRAME))
+ return false;
+
+ pt.x = GET_X_LPARAM(lParam);
+ pt.y = GET_Y_LPARAM(lParam);
+ if (pt.x < 0 && pt.y < 0)
+ GetCursorPos(&pt);
+
+ hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_SCREENSHOT));
+ hMenu = GetSubMenu(hMenuLoad, 0);
+
+ UpdateMenu(hMenu);
+
+ TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hWnd,NULL);
+
+ DestroyMenu(hMenuLoad);
+
+ return true;
+}
+
+static void UpdateMenu(HMENU hMenu)
+{
+ TCHAR buf[200];
+ MENUITEMINFO mItem;
+ int nGame = Picker_GetSelectedItem(hwndList);
+ if (nGame < 0)
+ have_selection = 0;
+
+ LPTREEFOLDER lpFolder = GetCurrentFolder();
+ int i;
+ TCHAR* t_description;
+
+ if (have_selection)
+ {
+ t_description = ui_wstring_from_utf8(ConvertAmpersandString(ModifyThe(driver_list::driver(nGame).type.fullname())));
+ if( !t_description )
+ return;
+
+ _sntprintf(buf, ARRAY_LENGTH(buf), g_szPlayGameString, t_description);
+
+ mItem.cbSize = sizeof(mItem);
+ mItem.fMask = MIIM_TYPE;
+ mItem.fType = MFT_STRING;
+ mItem.dwTypeData = buf;
+ mItem.cch = _tcslen(mItem.dwTypeData);
+
+ SetMenuItemInfo(hMenu, ID_FILE_PLAY, false, &mItem);
+
+ EnableMenuItem(hMenu, ID_CONTEXT_SELECT_RANDOM, MF_ENABLED);
+
+ free(t_description);
+ }
+ else
+ {
+ EnableMenuItem(hMenu, ID_FILE_PLAY, MF_GRAYED);
+ EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_GRAYED);
+ EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED);
+ EnableMenuItem(hMenu, ID_CONTEXT_SELECT_RANDOM, MF_GRAYED);
+ }
+
+ if (oldControl)
+ {
+ EnableMenuItem(hMenu, ID_CUSTOMIZE_FIELDS, MF_GRAYED);
+ EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED);
+ EnableMenuItem(hMenu, ID_OPTIONS_DEFAULTS, MF_GRAYED);
+ }
+
+ if (lpFolder->m_dwFlags & F_CUSTOM)
+ {
+ EnableMenuItem(hMenu,ID_CONTEXT_REMOVE_CUSTOM,MF_ENABLED);
+ EnableMenuItem(hMenu,ID_CONTEXT_RENAME_CUSTOM,MF_ENABLED);
+ }
+ else
+ {
+ EnableMenuItem(hMenu,ID_CONTEXT_REMOVE_CUSTOM,MF_GRAYED);
+ EnableMenuItem(hMenu,ID_CONTEXT_RENAME_CUSTOM,MF_GRAYED);
+ }
+ //pParent = GetFolderNameByID(lpFolder->m_nParent+1);
+
+ EnableMenuItem(hMenu, ID_FOLDER_PROPERTIES, (lpFolder->m_dwFlags & F_INIEDIT) ? MF_ENABLED : MF_GRAYED);
+
+ CheckMenuRadioItem(hMenu, ID_VIEW_TAB_ARTWORK, ID_VIEW_TAB_HISTORY, ID_VIEW_TAB_ARTWORK + TabView_GetCurrentTab(hTabCtrl), MF_BYCOMMAND);
+
+ // set whether we're showing the tab control or not
+ if (bShowTabCtrl)
+ CheckMenuItem(hMenu,ID_VIEW_PAGETAB,MF_BYCOMMAND | MF_CHECKED);
+ else
+ CheckMenuItem(hMenu,ID_VIEW_PAGETAB,MF_BYCOMMAND | MF_UNCHECKED);
+
+ for (i=0;i<MAX_TAB_TYPES;i++)
+ {
+ // disable menu items for tabs we're not currently showing
+ if (GetShowTab(i))
+ EnableMenuItem(hMenu,ID_VIEW_TAB_ARTWORK + i,MF_BYCOMMAND | MF_ENABLED);
+ else
+ EnableMenuItem(hMenu,ID_VIEW_TAB_ARTWORK + i,MF_BYCOMMAND | MF_GRAYED);
+
+ // check toggle menu items
+ if (GetShowTab(i))
+ CheckMenuItem(hMenu, ID_TOGGLE_TAB_ARTWORK + i,MF_BYCOMMAND | MF_CHECKED);
+ else
+ CheckMenuItem(hMenu, ID_TOGGLE_TAB_ARTWORK + i,MF_BYCOMMAND | MF_UNCHECKED);
+ }
+
+ for (i=0;i<MAX_FOLDERS;i++)
+ {
+ if (GetShowFolder(i))
+ CheckMenuItem(hMenu,ID_CONTEXT_SHOW_FOLDER_START + i,MF_BYCOMMAND | MF_CHECKED);
+ else
+ CheckMenuItem(hMenu,ID_CONTEXT_SHOW_FOLDER_START + i,MF_BYCOMMAND | MF_UNCHECKED);
+ }
+}
+
+void InitTreeContextMenu(HMENU hTreeMenu)
+{
+ extern const FOLDERDATA g_folderData[];
+
+ MENUITEMINFO mii;
+ ZeroMemory(&mii,sizeof(mii));
+ mii.cbSize = sizeof(mii);
+ mii.wID = -1;
+ mii.fMask = MIIM_SUBMENU | MIIM_ID;
+
+ HMENU hMenu = GetSubMenu(hTreeMenu, 0);
+
+ if (GetMenuItemInfo(hMenu,3,true,&mii) == false)
+ {
+ printf("can't find show folders context menu\n");fflush(stdout);
+ return;
+ }
+
+ if (mii.hSubMenu == NULL)
+ {
+ printf("can't find submenu for show folders context menu\n");fflush(stdout);
+ return;
+ }
+
+ hMenu = mii.hSubMenu;
+
+ for (int i=0; g_folderData[i].m_lpTitle; i++)
+ {
+ if (!g_folderData[i].m_process)
+ {
+ TCHAR* t_title = ui_wstring_from_utf8(g_folderData[i].m_lpTitle);
+ if( !t_title )
+ return;
+
+ mii.fMask = MIIM_TYPE | MIIM_ID;
+ mii.fType = MFT_STRING;
+ mii.dwTypeData = t_title;
+ mii.cch = _tcslen(mii.dwTypeData);
+ mii.wID = ID_CONTEXT_SHOW_FOLDER_START + g_folderData[i].m_nFolderId;
+
+ // menu in resources has one empty item (needed for the submenu to setup properly)
+ // so overwrite this one, append after
+ if (i == 0)
+ SetMenuItemInfo(hMenu,ID_CONTEXT_SHOW_FOLDER_START,false,&mii);
+ else
+ InsertMenuItem(hMenu,i,false,&mii);
+
+ free(t_title);
+ }
+ }
+}
+
+
+void InitBodyContextMenu(HMENU hBodyContextMenu)
+{
+ int current_game = Picker_GetSelectedItem(hwndList);
+ if (current_game < 0)
+ return;
+
+ TCHAR tmp[30];
+ MENUITEMINFO mii;
+ ZeroMemory(&mii,sizeof(mii));
+ mii.cbSize = sizeof(mii);
+
+ if (GetMenuItemInfo(hBodyContextMenu,ID_FOLDER_SOURCEPROPERTIES,false,&mii) == false)
+ {
+ dprintf("can't find show folders context menu\n");
+ return;
+ }
+
+ _sntprintf(tmp,ARRAY_LENGTH(tmp),TEXT("Properties for %s"), ui_wstring_from_utf8(GetDriverFilename(current_game) ));
+ mii.fMask = MIIM_TYPE | MIIM_ID;
+ mii.fType = MFT_STRING;
+ mii.dwTypeData = tmp;
+ mii.cch = _tcslen(mii.dwTypeData);
+ mii.wID = ID_FOLDER_SOURCEPROPERTIES;
+
+
+ // menu in resources has one default item
+ // so overwrite this one
+ SetMenuItemInfo(hBodyContextMenu,ID_FOLDER_SOURCEPROPERTIES,false,&mii);
+ EnableMenuItem(hBodyContextMenu, ID_FOLDER_VECTORPROPERTIES, DriverIsVector(current_game) ? MF_ENABLED : MF_GRAYED);
+}
+
+
+void ToggleShowFolder(int folder)
+{
+ int current_id = GetCurrentFolderID();
+
+ SetWindowRedraw(hwndList,false);
+
+ SetShowFolder(folder,!GetShowFolder(folder));
+
+ ResetTreeViewFolders();
+ SelectTreeViewFolder(current_id);
+
+ SetWindowRedraw(hwndList,true);
+}
+
+static LRESULT CALLBACK HistoryWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ if (hBackground)
+ {
+ switch (uMsg)
+ {
+ case WM_MOUSEMOVE:
+ {
+ if (MouseHasBeenMoved())
+ ShowCursor(true);
+ break;
+ }
+
+ case WM_ERASEBKGND:
+ return true;
+ case WM_PAINT:
+ {
+ POINT p = { 0, 0 };
+
+ /* get base point of background bitmap */
+ MapWindowPoints(hWnd,hTreeView,&p,1);
+ PaintBackgroundImage(hWnd, NULL, p.x, p.y);
+ /* to ensure our parent procedure repaints the whole client area */
+ InvalidateRect(hWnd, NULL, false);
+ break;
+ }
+ }
+ }
+ return CallWindowProc(g_lpHistoryWndProc, hWnd, uMsg, wParam, lParam);
+}
+
+static LRESULT CALLBACK PictureFrameWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ switch (uMsg)
+ {
+ case WM_MOUSEMOVE:
+ {
+ if (MouseHasBeenMoved())
+ ShowCursor(true);
+ break;
+ }
+
+ case WM_NCHITTEST :
+ {
+ POINT pt;
+ RECT rect;
+ HWND hHistory = GetDlgItem(hMain, IDC_HISTORY);
+
+ pt.x = LOWORD(lParam);
+ pt.y = HIWORD(lParam);
+ GetWindowRect(hHistory, &rect);
+ // check if they clicked on the picture area (leave 6 pixel no man's land
+ // by the history window to reduce mistaken clicks)
+ // no more no man's land, the Cursor changes when Edit control is left, should be enough feedback
+ if (have_history &&
+ ( ( (TabView_GetCurrentTab(hTabCtrl) == TAB_HISTORY) ||
+ (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() && GetShowTab(TAB_HISTORY) == false) ||
+ (TAB_ALL == GetHistoryTab() && GetShowTab(TAB_HISTORY) == false) ) &&
+// (rect.top - 6) < pt.y && pt.y < (rect.bottom + 6) ) )
+ PtInRect( &rect, pt ) ) )
+
+ {
+ return HTTRANSPARENT;
+ }
+ else
+ {
+ return HTCLIENT;
+ }
+ }
+ break;
+ case WM_CONTEXTMENU:
+ if ( HandleScreenShotContextMenu(hWnd, wParam, lParam))
+ return false;
+ break;
+ }
+
+ if (hBackground)
+ {
+ switch (uMsg)
+ {
+ case WM_ERASEBKGND :
+ return true;
+ case WM_PAINT :
+ {
+ RECT rect,nodraw_rect;
+ HRGN region,nodraw_region;
+ POINT p = { 0, 0 };
+
+ /* get base point of background bitmap */
+ MapWindowPoints(hWnd,hTreeView,&p,1);
+
+ /* get big region */
+ GetClientRect(hWnd,&rect);
+ region = CreateRectRgnIndirect(&rect);
+
+ if (IsWindowVisible(GetDlgItem(hMain,IDC_HISTORY)))
+ {
+ /* don't draw over this window */
+ GetWindowRect(GetDlgItem(hMain,IDC_HISTORY),&nodraw_rect);
+ MapWindowPoints(HWND_DESKTOP,hWnd,(LPPOINT)&nodraw_rect,2);
+ nodraw_region = CreateRectRgnIndirect(&nodraw_rect);
+ CombineRgn(region,region,nodraw_region,RGN_DIFF);
+ DeleteObject(nodraw_region);
+ }
+ if (IsWindowVisible(GetDlgItem(hMain,IDC_SSPICTURE)))
+ {
+ /* don't draw over this window */
+ GetWindowRect(GetDlgItem(hMain,IDC_SSPICTURE),&nodraw_rect);
+ MapWindowPoints(HWND_DESKTOP,hWnd,(LPPOINT)&nodraw_rect,2);
+ nodraw_region = CreateRectRgnIndirect(&nodraw_rect);
+ CombineRgn(region,region,nodraw_region,RGN_DIFF);
+ DeleteObject(nodraw_region);
+ }
+
+ PaintBackgroundImage(hWnd,region,p.x,p.y);
+
+ DeleteObject(region);
+
+ /* to ensure our parent procedure repaints the whole client area */
+ InvalidateRect(hWnd, NULL, false);
+
+ break;
+ }
+ }
+ }
+ return CallWindowProc(g_lpPictureFrameWndProc, hWnd, uMsg, wParam, lParam);
+}
+
+static LRESULT CALLBACK PictureWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ switch (uMsg)
+ {
+ case WM_ERASEBKGND :
+ return true;
+ case WM_PAINT :
+ {
+ PAINTSTRUCT ps;
+ HDC hdc,hdc_temp;
+ RECT rect;
+ HBITMAP old_bitmap;
+
+ int width,height;
+
+ RECT rect2;
+ HBRUSH hBrush;
+ HBRUSH holdBrush;
+ HRGN region1, region2;
+ int nBordersize;
+ nBordersize = GetScreenshotBorderSize();
+ hBrush = CreateSolidBrush(GetScreenshotBorderColor());
+
+ hdc = BeginPaint(hWnd,&ps);
+
+ hdc_temp = CreateCompatibleDC(hdc);
+ if (ScreenShotLoaded())
+ {
+ width = GetScreenShotWidth();
+ height = GetScreenShotHeight();
+
+ old_bitmap = (HBITMAP)SelectObject(hdc_temp,GetScreenShotHandle());
+ }
+ else
+ {
+ BITMAP bmp;
+
+ GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp);
+ width = bmp.bmWidth;
+ height = bmp.bmHeight;
+
+ old_bitmap = (HBITMAP)SelectObject(hdc_temp,hMissing_bitmap);
+ }
+
+ GetClientRect(hWnd,&rect);
+
+ rect2 = rect;
+ //Configurable Borders around images
+ rect.bottom -= nBordersize;
+ if( rect.bottom < 0)
+ rect.bottom = rect2.bottom;
+ rect.right -= nBordersize;
+ if( rect.right < 0)
+ rect.right = rect2.right;
+ rect.top += nBordersize;
+ if( rect.top > rect.bottom )
+ rect.top = rect2.top;
+ rect.left += nBordersize;
+ if( rect.left > rect.right )
+ rect.left = rect2.left;
+ region1 = CreateRectRgnIndirect(&rect);
+ region2 = CreateRectRgnIndirect(&rect2);
+ CombineRgn(region2,region2,region1,RGN_DIFF);
+ holdBrush = (HBRUSH)SelectObject(hdc, hBrush);
+
+ FillRgn(hdc,region2, hBrush );
+ SelectObject(hdc, holdBrush);
+ DeleteBrush(hBrush);
+
+ SetStretchBltMode(hdc,STRETCH_HALFTONE);
+ StretchBlt(hdc,nBordersize,nBordersize,rect.right-rect.left,rect.bottom-rect.top,
+ hdc_temp,0,0,width,height,SRCCOPY);
+ SelectObject(hdc_temp,old_bitmap);
+ DeleteDC(hdc_temp);
+ DeleteObject(region1);
+ DeleteObject(region2);
+
+ EndPaint(hWnd,&ps);
+
+ return true;
+ }
+ }
+
+ return CallWindowProc(g_lpPictureWndProc, hWnd, uMsg, wParam, lParam);
+}
+
+static void RemoveCurrentGameCustomFolder(void)
+{
+ if (Picker_GetSelectedItem(hwndList) >= 0)
+ RemoveGameCustomFolder(Picker_GetSelectedItem(hwndList));
+}
+
+static void RemoveGameCustomFolder(int driver_index)
+{
+ int i;
+ TREEFOLDER **folders;
+ int num_folders;
+
+ GetFolders(&folders,&num_folders);
+
+ for (i=0; i<num_folders; i++)
+ {
+ if (folders[i]->m_dwFlags & F_CUSTOM && folders[i]->m_nFolderId == GetCurrentFolderID())
+ {
+ int current_pick_index;
+
+ RemoveFromCustomFolder(folders[i],driver_index);
+
+ if (driver_index == Picker_GetSelectedItem(hwndList))
+ {
+ /* if we just removed the current game,
+ move the current selection so that when we rebuild the listview it
+ leaves the cursor on next or previous one */
+
+ current_pick_index = GetSelectedPick();
+ Picker_SetSelectedPick(hwndList, GetSelectedPick() + 1);
+ if (current_pick_index == GetSelectedPick()) /* we must have deleted the last item */
+ Picker_SetSelectedPick(hwndList, GetSelectedPick() - 1);
+ }
+
+ ResetListView();
+ return;
+ }
+ }
+ MessageBox(GetMainWindow(), TEXT("Error searching for custom folder"), (LPCTSTR)MAMEUINAME, MB_OK | MB_ICONERROR);
+}
+
+
+static void BeginListViewDrag(NM_LISTVIEW *pnmv)
+{
+ LV_ITEM lvi;
+ lvi.iItem = pnmv->iItem;
+ lvi.mask = LVIF_PARAM;
+ BOOL res = ListView_GetItem(hwndList, &lvi);
+ res++;
+
+ game_dragged = lvi.lParam;
+
+ POINT pt;
+ pt.x = 0;
+ pt.y = 0;
+
+ /* Tell the list view control to create an image to use for dragging. */
+ himl_drag = ListView_CreateDragImage(hwndList,pnmv->iItem,&pt);
+
+ /* Start the drag operation. */
+ ImageList_BeginDrag(himl_drag, 0, 0, 0);
+
+ pt = pnmv->ptAction;
+ ClientToScreen(hwndList,&pt);
+ ImageList_DragEnter(GetDesktopWindow(),pt.x,pt.y);
+
+ /* Hide the mouse cursor, and direct mouse input to the parent window. */
+ SetCapture(hMain);
+
+ prev_drag_drop_target = NULL;
+
+ g_listview_dragging = true;
+}
+
+static void MouseMoveListViewDrag(POINTS p)
+{
+ HTREEITEM htiTarget;
+ TV_HITTESTINFO tvht;
+ BOOL res;
+
+ POINT pt;
+ pt.x = p.x;
+ pt.y = p.y;
+
+ ClientToScreen(hMain,&pt);
+
+ ImageList_DragMove(pt.x,pt.y);
+
+ MapWindowPoints(GetDesktopWindow(),hTreeView,&pt,1);
+
+ tvht.pt = pt;
+ htiTarget = TreeView_HitTest(hTreeView,&tvht);
+
+ if (htiTarget != prev_drag_drop_target)
+ {
+ ImageList_DragShowNolock(false);
+ if (htiTarget)
+ res = TreeView_SelectDropTarget(hTreeView,htiTarget);
+ else
+ res = TreeView_SelectDropTarget(hTreeView,NULL);
+ ImageList_DragShowNolock(true);
+
+ prev_drag_drop_target = htiTarget;
+ }
+ res++;
+}
+
+static void ButtonUpListViewDrag(POINTS p)
+{
+ POINT pt;
+ HTREEITEM htiTarget;
+ TV_HITTESTINFO tvht;
+ TVITEM tvi;
+
+ ReleaseCapture();
+
+ ImageList_DragLeave(hwndList);
+ ImageList_EndDrag();
+ ImageList_Destroy(himl_drag);
+
+ BOOL res = TreeView_SelectDropTarget(hTreeView,NULL);
+ res++;
+
+ g_listview_dragging = false;
+
+ /* see where the game was dragged */
+
+ pt.x = p.x;
+ pt.y = p.y;
+
+ MapWindowPoints(hMain,hTreeView,&pt,1);
+
+ tvht.pt = pt;
+ htiTarget = TreeView_HitTest(hTreeView,&tvht);
+ if (htiTarget == NULL)
+ {
+ LVHITTESTINFO lvhtti;
+ LPTREEFOLDER folder;
+ RECT rcList;
+
+ /* the user dragged a game onto something other than the treeview */
+ /* try to remove if we're in a custom folder */
+
+ /* see if it was dragged within the list view; if so, ignore */
+
+ MapWindowPoints(hTreeView,hwndList,&pt,1);
+ lvhtti.pt = pt;
+ GetWindowRect(hwndList, &rcList);
+ ClientToScreen(hwndList, &pt);
+ if( PtInRect(&rcList, pt) != 0 )
+ return;
+
+ folder = GetCurrentFolder();
+ if (folder->m_dwFlags & F_CUSTOM)
+ {
+ /* dragged out of a custom folder, so let's remove it */
+ RemoveCurrentGameCustomFolder();
+ }
+ return;
+ }
+
+ tvi.lParam = 0;
+ tvi.mask = TVIF_PARAM | TVIF_HANDLE;
+ tvi.hItem = htiTarget;
+
+ if (TreeView_GetItem(hTreeView, &tvi))
+ {
+ LPTREEFOLDER folder = (LPTREEFOLDER)tvi.lParam;
+ AddToCustomFolder(folder,game_dragged);
+ }
+}
+
+static LPTREEFOLDER GetSelectedFolder(void)
+{
+ HTREEITEM htree = TreeView_GetSelection(hTreeView);
+ if(htree)
+ {
+ TVITEM tvi;
+ tvi.hItem = htree;
+ tvi.mask = TVIF_PARAM;
+ BOOL res = TreeView_GetItem(hTreeView,&tvi);
+ res++;
+ return (LPTREEFOLDER)tvi.lParam;
+ }
+ return NULL;
+}
+
+static HICON GetSelectedFolderIcon(void)
+{
+ HTREEITEM htree = TreeView_GetSelection(hTreeView);
+ if (htree)
+ {
+ TVITEM tvi;
+ tvi.hItem = htree;
+ tvi.mask = TVIF_PARAM;
+ BOOL res = TreeView_GetItem(hTreeView,&tvi);
+ res++;
+ //LPTREEFOLDER folder = (LPTREEFOLDER)tvi.lParam;
+ //hSmall_icon = TreeView_GetImageList(hTreeView,(int)tvi.iImage);
+ HIMAGELIST hSmall_icon = NULL;
+ return ImageList_GetIcon(hSmall_icon, tvi.iImage, ILD_TRANSPARENT);
+ }
+ return NULL;
+}
+
+/* Updates all currently displayed Items in the List with the latest Data*/
+void UpdateListView(void)
+{
+ BOOL res;
+
+ if( (GetViewMode() == VIEW_GROUPED) || (GetViewMode() == VIEW_DETAILS ) )
+ res = ListView_RedrawItems(hwndList,ListView_GetTopIndex(hwndList), ListView_GetTopIndex(hwndList)+ ListView_GetCountPerPage(hwndList) );
+
+ res++;
+}
+
+static void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height)
+{
+ int destX, destY;
+ int destW, destH;
+ int nBorder;
+ RECT rect;
+ /* for scaling */
+ int x, y;
+ int rWidth, rHeight;
+ double scale;
+ BOOL bReduce = false;
+
+ GetClientRect(hWnd, &rect);
+
+ // Scale the bitmap to the frame specified by the passed in hwnd
+ if (ScreenShotLoaded())
+ {
+ x = GetScreenShotWidth();
+ y = GetScreenShotHeight();
+ }
+ else
+ {
+ BITMAP bmp;
+ GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp);
+
+ x = bmp.bmWidth;
+ y = bmp.bmHeight;
+ }
+ rWidth = (rect.right - rect.left);
+ rHeight = (rect.bottom - rect.top);
+
+ /* Limit the screen shot to max height of 264 */
+ if (restrict_height == true && rHeight > 264)
+ {
+ rect.bottom = rect.top + 264;
+ rHeight = 264;
+ }
+
+ /* If the bitmap does NOT fit in the screenshot area */
+ if (x > rWidth - 10 || y > rHeight - 10)
+ {
+ rect.right -= 10;
+ rect.bottom -= 10;
+ rWidth -= 10;
+ rHeight -= 10;
+ bReduce = true;
+ /* Try to scale it properly */
+ /* assumes square pixels, doesn't consider aspect ratio */
+ if (x > y)
+ scale = (double)rWidth / x;
+ else
+ scale = (double)rHeight / y;
+
+ destW = (int)(x * scale);
+ destH = (int)(y * scale);
+
+ /* If it's still too big, scale again */
+ if (destW > rWidth || destH > rHeight)
+ {
+ if (destW > rWidth)
+ scale = (double)rWidth / destW;
+ else
+ scale = (double)rHeight / destH;
+
+ destW = (int)(destW * scale);
+ destH = (int)(destH * scale);
+ }
+ }
+ else
+ {
+ if (GetStretchScreenShotLarger())
+ {
+ rect.right -= 10;
+ rect.bottom -= 10;
+ rWidth -= 10;
+ rHeight -= 10;
+ bReduce = true;
+ // Try to scale it properly
+ // assumes square pixels, doesn't consider aspect ratio
+ if (x < y)
+ scale = (double)rWidth / x;
+ else
+ scale = (double)rHeight / y;
+
+ destW = (int)(x * scale);
+ destH = (int)(y * scale);
+
+ // If it's too big, scale again
+ if (destW > rWidth || destH > rHeight)
+ {
+ if (destW > rWidth)
+ scale = (double)rWidth / destW;
+ else
+ scale = (double)rHeight / destH;
+
+ destW = (int)(destW * scale);
+ destH = (int)(destH * scale);
+ }
+ }
+ else
+ {
+ // Use the bitmaps size if it fits
+ destW = x;
+ destH = y;
+ }
+
+ }
+
+
+ destX = (rWidth - destW) / 2;
+ destY = (rHeight - destH) / 2;
+
+ if (bReduce)
+ {
+ destX += 5;
+ destY += 5;
+ }
+ nBorder = GetScreenshotBorderSize();
+ if( destX > nBorder+1)
+ pRect->left = destX - nBorder;
+ else
+ pRect->left = 2;
+ if( destY > nBorder+1)
+ pRect->top = destY - nBorder;
+ else
+ pRect->top = 2;
+ if( rWidth >= destX + destW + nBorder)
+ pRect->right = destX + destW + nBorder;
+ else
+ pRect->right = rWidth - pRect->left;
+ if( rHeight >= destY + destH + nBorder)
+ pRect->bottom = destY + destH + nBorder;
+ else
+ pRect->bottom = rHeight - pRect->top;
+}
+
+/*
+ Switches to either fullscreen or normal mode, based on the
+ current mode.
+
+ POSSIBLE BUGS:
+ Removing the menu might cause problems later if some
+ function tries to poll info stored in the menu. Don't
+ know if you've done that, but this was the only way I
+ knew to remove the menu dynamically.
+*/
+
+static void SwitchFullScreenMode(void)
+{
+ LONG lMainStyle;
+
+ if (GetRunFullScreen())
+ {
+ // Return to normal
+
+ // Restore the menu
+ SetMenu(hMain, LoadMenu(hInst,MAKEINTRESOURCE(IDR_UI_MENU)));
+
+ // Refresh the checkmarks
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, BIT(GetWindowPanes(), 0) ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, GetShowToolBar() ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, GetShowStatusBar() ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(GetMenu(hMain), ID_VIEW_PAGETAB, GetShowTabCtrl() ? MF_CHECKED : MF_UNCHECKED);
+
+ // Add frame to dialog again
+ lMainStyle = GetWindowLong(hMain, GWL_STYLE);
+ lMainStyle = lMainStyle | WS_BORDER;
+ SetWindowLong(hMain, GWL_STYLE, lMainStyle);
+
+ // Show the window maximized
+ if( GetWindowState() == SW_MAXIMIZE )
+ {
+ ShowWindow(hMain, SW_NORMAL);
+ ShowWindow(hMain, SW_MAXIMIZE);
+ }
+ else
+ ShowWindow(hMain, SW_RESTORE);
+
+ SetRunFullScreen(false);
+ }
+ else
+ {
+ // Set to fullscreen
+
+ // Remove menu
+ SetMenu(hMain,NULL);
+
+ // Frameless dialog (fake fullscreen)
+ lMainStyle = GetWindowLong(hMain, GWL_STYLE);
+ lMainStyle = lMainStyle & (WS_BORDER ^ 0xffffffff);
+ SetWindowLong(hMain, GWL_STYLE, lMainStyle);
+ if( IsMaximized(hMain) )
+ {
+ ShowWindow(hMain, SW_NORMAL);
+ SetWindowState( SW_MAXIMIZE );
+ }
+ else
+ {
+ SetWindowState( SW_NORMAL );
+ }
+
+ ShowWindow(hMain, SW_MAXIMIZE);
+
+ SetRunFullScreen(true);
+ }
+}
+
+/*
+ Checks to see if the mouse has been moved since this func
+ was first called (which is at startup). The reason for
+ storing the startup coordinates of the mouse is that when
+ a window is created it generates WM_MOUSEOVER events, even
+ though the user didn't actually move the mouse. So we need
+ to know when the WM_MOUSEOVER event is user-triggered.
+
+ POSSIBLE BUGS:
+ Gets polled at every WM_MOUSEMOVE so it might cause lag,
+ but there's probably another way to code this that's
+ way better?
+
+*/
+
+BOOL MouseHasBeenMoved(void)
+{
+ static int mouse_x = -1;
+ static int mouse_y = -1;
+ POINT p;
+
+ GetCursorPos(&p);
+
+ if (mouse_x == -1) // First time
+ {
+ mouse_x = p.x;
+ mouse_y = p.y;
+ }
+
+ return (p.x != mouse_x || p.y != mouse_y);
+}
+
+/* End of source file */
diff --git a/docs/release/src/osd/winui/winui.h b/docs/release/src/osd/winui/winui.h
new file mode 100644
index 00000000000..ab009553cbd
--- /dev/null
+++ b/docs/release/src/osd/winui/winui.h
@@ -0,0 +1,108 @@
+// For licensing and usage information, read docs/winui_license.txt
+//****************************************************************************
+
+#ifndef WINUI_H
+#define WINUI_H
+
+#include <commctrl.h>
+#include <commdlg.h>
+#include "emu.h"
+#include "pool.h"
+#include "screenshot.h"
+#include "drivenum.h"
+#include "romload.h"
+
+#define MAMENAME "HBMAME"
+#define UI_INI_FILENAME MAMENAME "UI.ini"
+
+#ifdef PTR64
+#define MAMEUINAME MAMENAME "UI64"
+#else
+#define MAMEUINAME MAMENAME "UI32"
+#endif
+
+#define SEARCH_PROMPT "<search here>"
+
+enum
+{
+ UNKNOWN = -1,
+ TAB_PICKER = 0,
+ TAB_DISPLAY,
+ TAB_MISC,
+ NUM_TABS
+};
+
+enum
+{
+ FILETYPE_INPUT_FILES = 1,
+ FILETYPE_SAVESTATE_FILES,
+ FILETYPE_WAVE_FILES,
+ FILETYPE_AVI_FILES,
+ FILETYPE_MNG_FILES,
+ FILETYPE_EFFECT_FILES,
+ FILETYPE_JOYMAP_FILES,
+ FILETYPE_DEBUGSCRIPT_FILES,
+ FILETYPE_LUASCRIPT_FILES
+};
+
+
+typedef struct
+{
+ INT resource;
+ const char *icon_name;
+} ICONDATA;
+
+extern TCHAR last_directory[MAX_PATH];
+
+typedef BOOL (WINAPI *common_file_dialog_proc)(LPOPENFILENAME lpofn);
+
+typedef std::string string;
+
+BOOL CommonFileDialog(common_file_dialog_proc cfd,char *filename, int filetype);
+
+HWND GetMainWindow(void);
+HWND GetTreeView(void);
+void SetNumOptionFolders(int count);
+void GetRealColumnOrder(int order[]);
+HICON LoadIconFromFile(const char *iconname);
+void UpdateScreenShot(void);
+void ResizePickerControls(HWND hWnd);
+void MamePlayGame(void);
+int FindIconIndex(int nIconResource);
+int FindIconIndexByName(const char *icon_name);
+int GetSelectedPick(void);
+object_pool *GetMameUIMemoryPool(void);
+
+void UpdateListView(void);
+
+// Move The in "The Title (notes)" to "Title, The (notes)"
+char * ModifyThe(const char *str);
+
+// Convert Ampersand so it can display in a static control
+char * ConvertAmpersandString(const char *s);
+
+// globalized for painting tree control
+HBITMAP GetBackgroundBitmap(void);
+HPALETTE GetBackgroundPalette(void);
+MYBITMAPINFO* GetBackgroundInfo(void);
+BOOL GetUseOldControl(void);
+BOOL GetUseXPControl(void);
+
+int GetMinimumScreenShotWindowWidth(void);
+
+// we maintain an array of drivers sorted by name, useful all around
+int GetParentIndex(const game_driver *driver);
+int GetParentRomSetIndex(const game_driver *driver);
+int GetGameNameIndex(const char *name);
+
+// sets text in part of the status bar on the main window
+void SetStatusBarText(int part_index, const char *message);
+void SetStatusBarTextF(int part_index, const char *fmt, ...) ATTR_PRINTF(2,3);
+
+int MameUIMain(HINSTANCE hInstance, LPWSTR lpCmdLine, int nCmdShow);
+
+BOOL MouseHasBeenMoved(void);
+
+const char * GetSearchText(void);
+
+#endif