src/osd/winui/win32ui.c
| r1367 | r1368 | |
| 1 | | /*************************************************************************** |
| 2 | | |
| 3 | | M.A.M.E.32 - Multiple Arcade Machine Emulator for Win32 |
| 4 | | Win32 Portions Copyright (C) 1997-2003 Michael Soderstrom and Chris Kirmse |
| 5 | | |
| 6 | | This file is part of MAME32, and may only be used, modified and |
| 7 | | distributed under the terms of the MAME license, in "readme.txt". |
| 8 | | By continuing to use, modify or distribute this file you indicate |
| 9 | | that you have read the license and understand and accept it fully. |
| 10 | | |
| 11 | | ***************************************************************************/ |
| 12 | | |
| 13 | | /*************************************************************************** |
| 14 | | |
| 15 | | win32ui.c |
| 16 | | |
| 17 | | Win32 GUI code. |
| 18 | | |
| 19 | | Created 8/12/97 by Christopher Kirmse (ckirmse@ricochet.net) |
| 20 | | Additional code November 1997 by Jeff Miller (miller@aa.net) |
| 21 | | More July 1998 by Mike Haaland (mhaaland@hypertech.com) |
| 22 | | Added Spitters/Property Sheets/Removed Tabs/Added Tree Control in |
| 23 | | Nov/Dec 1998 - Mike Haaland |
| 24 | | |
| 25 | | ***************************************************************************/ |
| 26 | | |
| 27 | | #define WIN32_LEAN_AND_MEAN |
| 28 | | #define _WIN32_IE 0x0500 |
| 29 | | #include <windows.h> |
| 30 | | #include <windowsx.h> |
| 31 | | #include <shellapi.h> |
| 32 | | #include <stdio.h> |
| 33 | | #include <ctype.h> |
| 34 | | #include <io.h> |
| 35 | | #include <fcntl.h> |
| 36 | | #include <commctrl.h> |
| 37 | | #include <dlgs.h> |
| 38 | | #include <string.h> |
| 39 | | #include <sys/stat.h> |
| 40 | | #include <wingdi.h> |
| 41 | | #include <time.h> |
| 42 | | #include <tchar.h> |
| 43 | | |
| 44 | | #include <driver.h> |
| 45 | | #include <osdepend.h> |
| 46 | | #include <unzip.h> |
| 47 | | |
| 48 | | #include "resource.h" |
| 49 | | #include "resource.hm" |
| 50 | | |
| 51 | | #include "screenshot.h" |
| 52 | | #include "mame32.h" |
| 53 | | #include "m32util.h" |
| 54 | | #include "file.h" |
| 55 | | #include "audit32.h" |
| 56 | | #include "directories.h" |
| 57 | | #include "m32opts.h" |
| 58 | | #include "properties.h" |
| 59 | | #include "columnedit.h" |
| 60 | | #include "picker.h" |
| 61 | | #include "tabview.h" |
| 62 | | #include "bitmask.h" |
| 63 | | #include "treeview.h" |
| 64 | | #include "splitters.h" |
| 65 | | #include "dirwatch.h" |
| 66 | | #include "help.h" |
| 67 | | #include "history.h" |
| 68 | | #include "dialogs.h" |
| 69 | | #include "state.h" |
| 70 | | #include "winmain.h" |
| 71 | | #include "winutf8.h" |
| 72 | | #include "strconv.h" |
| 73 | | #include "input.h" |
| 74 | | #include "windows/window.h" |
| 75 | | |
| 76 | | #include "directdraw.h" |
| 77 | | #include "directinput.h" |
| 78 | | #include "dijoystick.h" /* For DIJoystick avalibility. */ |
| 79 | | |
| 80 | | #ifdef MESS |
| 81 | | #include "mess32ui.h" |
| 82 | | #include "messopts.h" |
| 83 | | #endif // MESS |
| 84 | | |
| 85 | | #ifdef _MSC_VER |
| 86 | | #define snprintf _snprintf |
| 87 | | #endif |
| 88 | | |
| 89 | | #ifndef LVS_EX_LABELTIP |
| 90 | | #define LVS_EX_LABELTIP 0x00004000 // listview unfolds partly hidden labels if it does not have infotip text |
| 91 | | #endif // LVS_EX_LABELTIP |
| 92 | | |
| 93 | | // fix warning: cast does not match function type |
| 94 | | #if defined(__GNUC__) && defined(ListView_CreateDragImage) |
| 95 | | #undef ListView_CreateDragImage |
| 96 | | #endif |
| 97 | | |
| 98 | | #ifndef ListView_CreateDragImage |
| 99 | | #define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \ |
| 100 | | (HIMAGELIST)(LRESULT)(int)SendMessage((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft)) |
| 101 | | #endif // ListView_CreateDragImage |
| 102 | | |
| 103 | | #ifndef TreeView_EditLabel |
| 104 | | #define TreeView_EditLabel(w, i) \ |
| 105 | | SNDMSG(w,TVM_EDITLABEL,0,(LPARAM)(i)) |
| 106 | | #endif // TreeView_EditLabel |
| 107 | | |
| 108 | | #ifndef HDF_SORTUP |
| 109 | | #define HDF_SORTUP 0x400 |
| 110 | | #endif // HDF_SORTUP |
| 111 | | |
| 112 | | #ifndef HDF_SORTDOWN |
| 113 | | #define HDF_SORTDOWN 0x200 |
| 114 | | #endif // HDF_SORTDOWN |
| 115 | | |
| 116 | | #ifndef LVM_SETBKIMAGEA |
| 117 | | #define LVM_SETBKIMAGEA (LVM_FIRST + 68) |
| 118 | | #endif // LVM_SETBKIMAGEA |
| 119 | | |
| 120 | | #ifndef LVM_SETBKIMAGEW |
| 121 | | #define LVM_SETBKIMAGEW (LVM_FIRST + 138) |
| 122 | | #endif // LVM_SETBKIMAGEW |
| 123 | | |
| 124 | | #ifndef LVM_GETBKIMAGEA |
| 125 | | #define LVM_GETBKIMAGEA (LVM_FIRST + 69) |
| 126 | | #endif // LVM_GETBKIMAGEA |
| 127 | | |
| 128 | | #ifndef LVM_GETBKIMAGEW |
| 129 | | #define LVM_GETBKIMAGEW (LVM_FIRST + 139) |
| 130 | | #endif // LVM_GETBKIMAGEW |
| 131 | | |
| 132 | | #ifndef LVBKIMAGE |
| 133 | | |
| 134 | | typedef struct tagLVBKIMAGEA |
| 135 | | { |
| 136 | | ULONG ulFlags; |
| 137 | | HBITMAP hbm; |
| 138 | | LPSTR pszImage; |
| 139 | | UINT cchImageMax; |
| 140 | | int xOffsetPercent; |
| 141 | | int yOffsetPercent; |
| 142 | | } LVBKIMAGEA, *LPLVBKIMAGEA; |
| 143 | | |
| 144 | | typedef struct tagLVBKIMAGEW |
| 145 | | { |
| 146 | | ULONG ulFlags; |
| 147 | | HBITMAP hbm; |
| 148 | | LPWSTR pszImage; |
| 149 | | UINT cchImageMax; |
| 150 | | int xOffsetPercent; |
| 151 | | int yOffsetPercent; |
| 152 | | } LVBKIMAGEW, *LPLVBKIMAGEW; |
| 153 | | |
| 154 | | #ifdef UNICODE |
| 155 | | #define LVBKIMAGE LVBKIMAGEW |
| 156 | | #define LPLVBKIMAGE LPLVBKIMAGEW |
| 157 | | #define LVM_SETBKIMAGE LVM_SETBKIMAGEW |
| 158 | | #define LVM_GETBKIMAGE LVM_GETBKIMAGEW |
| 159 | | #else |
| 160 | | #define LVBKIMAGE LVBKIMAGEA |
| 161 | | #define LPLVBKIMAGE LPLVBKIMAGEA |
| 162 | | #define LVM_SETBKIMAGE LVM_SETBKIMAGEA |
| 163 | | #define LVM_GETBKIMAGE LVM_GETBKIMAGEA |
| 164 | | #endif |
| 165 | | #endif |
| 166 | | |
| 167 | | #ifndef LVBKIF_SOURCE_NONE |
| 168 | | #define LVBKIF_SOURCE_NONE 0x00000000 |
| 169 | | #endif // LVBKIF_SOURCE_NONE |
| 170 | | |
| 171 | | #ifndef LVBKIF_SOURCE_HBITMAP |
| 172 | | #define LVBKIF_SOURCE_HBITMAP 0x00000001 |
| 173 | | #endif |
| 174 | | |
| 175 | | #ifndef LVBKIF_SOURCE_URL |
| 176 | | #define LVBKIF_SOURCE_URL 0x00000002 |
| 177 | | #endif // LVBKIF_SOURCE_URL |
| 178 | | |
| 179 | | #ifndef LVBKIF_SOURCE_MASK |
| 180 | | #define LVBKIF_SOURCE_MASK 0x00000003 |
| 181 | | #endif // LVBKIF_SOURCE_MASK |
| 182 | | |
| 183 | | #ifndef LVBKIF_STYLE_NORMAL |
| 184 | | #define LVBKIF_STYLE_NORMAL 0x00000000 |
| 185 | | #endif // LVBKIF_STYLE_NORMAL |
| 186 | | |
| 187 | | #ifndef LVBKIF_STYLE_TILE |
| 188 | | #define LVBKIF_STYLE_TILE 0x00000010 |
| 189 | | #endif // LVBKIF_STYLE_TILE |
| 190 | | |
| 191 | | #ifndef LVBKIF_STYLE_MASK |
| 192 | | #define LVBKIF_STYLE_MASK 0x00000010 |
| 193 | | #endif // LVBKIF_STYLE_MASK |
| 194 | | |
| 195 | | #ifndef ListView_SetBkImage |
| 196 | | #define ListView_SetBkImage(hwnd, plvbki) \ |
| 197 | | (BOOL)SNDMSG((hwnd), LVM_SETBKIMAGE, 0, (LPARAM)(plvbki)) |
| 198 | | #endif // ListView_SetBkImage |
| 199 | | |
| 200 | | #ifndef ListView_GetBkImage |
| 201 | | #define ListView_GetBkImage(hwnd, plvbki) \ |
| 202 | | (BOOL)SNDMSG((hwnd), LVM_GETBKIMAGE, 0, (LPARAM)(plvbki)) |
| 203 | | #endif // ListView_GetBkImage |
| 204 | | |
| 205 | | #define MM_PLAY_GAME (WM_APP + 15000) |
| 206 | | |
| 207 | | #define JOYGUI_MS 100 |
| 208 | | |
| 209 | | #define JOYGUI_TIMER 1 |
| 210 | | #define SCREENSHOT_TIMER 2 |
| 211 | | #define GAMEWND_TIMER 3 |
| 212 | | |
| 213 | | /* Max size of a sub-menu */ |
| 214 | | #define DBU_MIN_WIDTH 292 |
| 215 | | #define DBU_MIN_HEIGHT 190 |
| 216 | | |
| 217 | | int MIN_WIDTH = DBU_MIN_WIDTH; |
| 218 | | int MIN_HEIGHT = DBU_MIN_HEIGHT; |
| 219 | | |
| 220 | | /* Max number of bkground picture files */ |
| 221 | | #define MAX_BGFILES 100 |
| 222 | | |
| 223 | | #ifndef LVS_EX_LABELTIP |
| 224 | | #define LVS_EX_LABELTIP 0x00004000 // listview unfolds partly hidden labels if it does not have infotip text |
| 225 | | #endif |
| 226 | | |
| 227 | | #define NO_FOLDER -1 |
| 228 | | #define STATESAVE_VERSION 1 |
| 229 | | |
| 230 | | /*************************************************************************** |
| 231 | | externally defined global variables |
| 232 | | ***************************************************************************/ |
| 233 | | extern const ICONDATA g_iconData[]; |
| 234 | | extern const TCHAR g_szPlayGameString[]; |
| 235 | | extern const char g_szGameCountString[]; |
| 236 | | |
| 237 | | typedef struct _play_options play_options; |
| 238 | | struct _play_options |
| 239 | | { |
| 240 | | const char *record; // OPTION_RECORD |
| 241 | | const char *playback; // OPTION_PLAYBACK |
| 242 | | const char *state; // OPTION_STATE |
| 243 | | const char *wavwrite; // OPTION_WAVWRITE |
| 244 | | const char *mngwrite; // OPTION_MNGWRITE |
| 245 | | }; |
| 246 | | |
| 247 | | /*************************************************************************** |
| 248 | | function prototypes |
| 249 | | ***************************************************************************/ |
| 250 | | |
| 251 | | static BOOL Win32UI_init(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow); |
| 252 | | static void Win32UI_exit(void); |
| 253 | | |
| 254 | | static BOOL PumpMessage(void); |
| 255 | | static BOOL OnIdle(HWND hWnd); |
| 256 | | static void OnSize(HWND hwnd, UINT state, int width, int height); |
| 257 | | static LRESULT CALLBACK MameWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam); |
| 258 | | |
| 259 | | static void SetView(int menu_id); |
| 260 | | static void ResetListView(void); |
| 261 | | static void UpdateGameList(BOOL bUpdateRomAudit, BOOL bUpdateSampleAudit); |
| 262 | | static void DestroyIcons(void); |
| 263 | | static void ReloadIcons(void); |
| 264 | | static void PollGUIJoystick(void); |
| 265 | | //static void PressKey(HWND hwnd,UINT vk); |
| 266 | | static BOOL MameCommand(HWND hwnd,int id, HWND hwndCtl, UINT codeNotify); |
| 267 | | static void KeyboardKeyDown(int syskey, int vk_code, int special); |
| 268 | | static void KeyboardKeyUp(int syskey, int vk_code, int special); |
| 269 | | static void KeyboardStateClear(void); |
| 270 | | |
| 271 | | static void UpdateStatusBar(void); |
| 272 | | //static BOOL PickerHitTest(HWND hWnd); |
| 273 | | static BOOL TreeViewNotify(NMHDR *nm); |
| 274 | | |
| 275 | | static void ResetBackground(char *szFile); |
| 276 | | static void RandomSelectBackground(void); |
| 277 | | static void LoadBackgroundBitmap(void); |
| 278 | | static void PaintBackgroundImage(HWND hWnd, HRGN hRgn, int x, int y); |
| 279 | | |
| 280 | | static int CLIB_DECL DriverDataCompareFunc(const void *arg1,const void *arg2); |
| 281 | | static int GamePicker_Compare(HWND hwndPicker, int index1, int index2, int sort_subitem); |
| 282 | | |
| 283 | | static void DisableSelection(void); |
| 284 | | static void EnableSelection(int nGame); |
| 285 | | |
| 286 | | static HICON GetSelectedPickItemIcon(void); |
| 287 | | static void SetRandomPickItem(void); |
| 288 | | static void PickColor(COLORREF *cDefault); |
| 289 | | |
| 290 | | static LPTREEFOLDER GetSelectedFolder(void); |
| 291 | | static HICON GetSelectedFolderIcon(void); |
| 292 | | |
| 293 | | static LRESULT CALLBACK HistoryWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
| 294 | | static LRESULT CALLBACK PictureFrameWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
| 295 | | static LRESULT CALLBACK PictureWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
| 296 | | static INT_PTR CALLBACK LanguageDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); |
| 297 | | |
| 298 | | static BOOL SelectLanguageFile(HWND hWnd, TCHAR* filename); |
| 299 | | static void MamePlayRecordGame(void); |
| 300 | | static void MamePlayBackGame(void); |
| 301 | | static void MamePlayRecordWave(void); |
| 302 | | static void MamePlayRecordMNG(void); |
| 303 | | static void MameLoadState(void); |
| 304 | | static void MamePlayGameWithOptions(int nGame, const play_options *playopts); |
| 305 | | static BOOL GameCheck(void); |
| 306 | | static BOOL FolderCheck(void); |
| 307 | | |
| 308 | | static void ToggleScreenShot(void); |
| 309 | | static void AdjustMetrics(void); |
| 310 | | //static void EnablePlayOptions(int nIndex, core_options *o); |
| 311 | | |
| 312 | | /* Icon routines */ |
| 313 | | static DWORD GetShellLargeIconSize(void); |
| 314 | | static DWORD GetShellSmallIconSize(void); |
| 315 | | static void CreateIcons(void); |
| 316 | | static int GetIconForDriver(int nItem); |
| 317 | | static void AddDriverIcon(int nItem,int default_icon_index); |
| 318 | | |
| 319 | | // Context Menu handlers |
| 320 | | static void UpdateMenu(HMENU hMenu); |
| 321 | | static void InitTreeContextMenu(HMENU hTreeMenu); |
| 322 | | static void InitBodyContextMenu(HMENU hBodyContextMenu); |
| 323 | | static void ToggleShowFolder(int folder); |
| 324 | | static BOOL HandleTreeContextMenu( HWND hWnd, WPARAM wParam, LPARAM lParam); |
| 325 | | static BOOL HandleScreenShotContextMenu( HWND hWnd, WPARAM wParam, LPARAM lParam); |
| 326 | | static void GamePicker_OnHeaderContextMenu(POINT pt, int nColumn); |
| 327 | | static void GamePicker_OnBodyContextMenu(POINT pt); |
| 328 | | |
| 329 | | static void InitListView(void); |
| 330 | | /* Re/initialize the ListView header columns */ |
| 331 | | static void ResetColumnDisplay(BOOL first_time); |
| 332 | | |
| 333 | | static void CopyToolTipText (LPTOOLTIPTEXT lpttt); |
| 334 | | |
| 335 | | static void ProgressBarShow(void); |
| 336 | | static void ProgressBarHide(void); |
| 337 | | static void ResizeProgressBar(void); |
| 338 | | static void ProgressBarStep(void); |
| 339 | | static void ProgressBarStepParam(int iGameIndex, int nGameCount); |
| 340 | | |
| 341 | | static HWND InitProgressBar(HWND hParent); |
| 342 | | static HWND InitToolbar(HWND hParent); |
| 343 | | static HWND InitStatusBar(HWND hParent); |
| 344 | | |
| 345 | | static LRESULT Statusbar_MenuSelect (HWND hwnd, WPARAM wParam, LPARAM lParam); |
| 346 | | |
| 347 | | static void UpdateHistory(void); |
| 348 | | |
| 349 | | |
| 350 | | void RemoveCurrentGameCustomFolder(void); |
| 351 | | void RemoveGameCustomFolder(int driver_index); |
| 352 | | |
| 353 | | void BeginListViewDrag(NM_LISTVIEW *pnmv); |
| 354 | | void MouseMoveListViewDrag(POINTS pt); |
| 355 | | void ButtonUpListViewDrag(POINTS p); |
| 356 | | |
| 357 | | void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height); |
| 358 | | |
| 359 | | BOOL MouseHasBeenMoved(void); |
| 360 | | void SwitchFullScreenMode(void); |
| 361 | | |
| 362 | | /*************************************************************************** |
| 363 | | External variables |
| 364 | | ***************************************************************************/ |
| 365 | | |
| 366 | | /*************************************************************************** |
| 367 | | Internal structures |
| 368 | | ***************************************************************************/ |
| 369 | | |
| 370 | | /* |
| 371 | | * These next two structs represent how the icon information |
| 372 | | * is stored in an ICO file. |
| 373 | | */ |
| 374 | | typedef struct |
| 375 | | { |
| 376 | | BYTE bWidth; /* Width of the image */ |
| 377 | | BYTE bHeight; /* Height of the image (times 2) */ |
| 378 | | BYTE bColorCount; /* Number of colors in image (0 if >=8bpp) */ |
| 379 | | BYTE bReserved; /* Reserved */ |
| 380 | | WORD wPlanes; /* Color Planes */ |
| 381 | | WORD wBitCount; /* Bits per pixel */ |
| 382 | | DWORD dwBytesInRes; /* how many bytes in this resource? */ |
| 383 | | DWORD dwImageOffset; /* where in the file is this image */ |
| 384 | | } ICONDIRENTRY, *LPICONDIRENTRY; |
| 385 | | |
| 386 | | typedef struct |
| 387 | | { |
| 388 | | UINT Width, Height, Colors; /* Width, Height and bpp */ |
| 389 | | LPBYTE lpBits; /* ptr to DIB bits */ |
| 390 | | DWORD dwNumBytes; /* how many bytes? */ |
| 391 | | LPBITMAPINFO lpbi; /* ptr to header */ |
| 392 | | LPBYTE lpXOR; /* ptr to XOR image bits */ |
| 393 | | LPBYTE lpAND; /* ptr to AND image bits */ |
| 394 | | } ICONIMAGE, *LPICONIMAGE; |
| 395 | | |
| 396 | | /* Which edges of a control are anchored to the corresponding side of the parent window */ |
| 397 | | #define RA_LEFT 0x01 |
| 398 | | #define RA_RIGHT 0x02 |
| 399 | | #define RA_TOP 0x04 |
| 400 | | #define RA_BOTTOM 0x08 |
| 401 | | #define RA_ALL 0x0F |
| 402 | | |
| 403 | | #define RA_END 0 |
| 404 | | #define RA_ID 1 |
| 405 | | #define RA_HWND 2 |
| 406 | | |
| 407 | | typedef struct |
| 408 | | { |
| 409 | | int type; /* Either RA_ID or RA_HWND, to indicate which member of u is used; or RA_END |
| 410 | | to signify last entry */ |
| 411 | | union /* Can identify a child window by control id or by handle */ |
| 412 | | { |
| 413 | | int id; /* Window control id */ |
| 414 | | HWND hwnd; /* Window handle */ |
| 415 | | } u; |
| 416 | | BOOL setfont; /* Do we set this item's font? */ |
| 417 | | int action; /* What to do when control is resized */ |
| 418 | | void *subwindow; /* Points to a Resize structure for this subwindow; NULL if none */ |
| 419 | | } ResizeItem; |
| 420 | | |
| 421 | | typedef struct |
| 422 | | { |
| 423 | | RECT rect; /* Client rect of window; must be initialized before first resize */ |
| 424 | | ResizeItem* items; /* Array of subitems to be resized */ |
| 425 | | } Resize; |
| 426 | | |
| 427 | | static void ResizeWindow(HWND hParent, Resize *r); |
| 428 | | static void SetAllWindowsFont(HWND hParent, const Resize *r, HFONT hFont, BOOL bRedraw); |
| 429 | | |
| 430 | | /* List view Icon defines */ |
| 431 | | #define LG_ICONMAP_WIDTH GetSystemMetrics(SM_CXICON) |
| 432 | | #define LG_ICONMAP_HEIGHT GetSystemMetrics(SM_CYICON) |
| 433 | | #define ICONMAP_WIDTH GetSystemMetrics(SM_CXSMICON) |
| 434 | | #define ICONMAP_HEIGHT GetSystemMetrics(SM_CYSMICON) |
| 435 | | |
| 436 | | typedef struct tagPOPUPSTRING |
| 437 | | { |
| 438 | | HMENU hMenu; |
| 439 | | UINT uiString; |
| 440 | | } POPUPSTRING; |
| 441 | | |
| 442 | | #define MAX_MENUS 3 |
| 443 | | |
| 444 | | #define SPLITTER_WIDTH 4 |
| 445 | | #define MIN_VIEW_WIDTH 10 |
| 446 | | |
| 447 | | // Struct needed for Game Window Communication |
| 448 | | |
| 449 | | typedef struct |
| 450 | | { |
| 451 | | LPPROCESS_INFORMATION ProcessInfo; |
| 452 | | HWND hwndFound; |
| 453 | | } FINDWINDOWHANDLE; |
| 454 | | |
| 455 | | /*************************************************************************** |
| 456 | | Internal variables |
| 457 | | ***************************************************************************/ |
| 458 | | |
| 459 | | static HWND hMain = NULL; |
| 460 | | static HACCEL hAccel = NULL; |
| 461 | | |
| 462 | | static HWND hwndList = NULL; |
| 463 | | static HWND hTreeView = NULL; |
| 464 | | static HWND hProgWnd = NULL; |
| 465 | | static HWND hTabCtrl = NULL; |
| 466 | | |
| 467 | | static HINSTANCE hInst = NULL; |
| 468 | | |
| 469 | | static HFONT hFont = NULL; /* Font for list view */ |
| 470 | | |
| 471 | | static int optionfolder_count = 0; |
| 472 | | |
| 473 | | /* global data--know where to send messages */ |
| 474 | | static BOOL in_emulation; |
| 475 | | |
| 476 | | /* idle work at startup */ |
| 477 | | static BOOL idle_work; |
| 478 | | |
| 479 | | /* object pool in use */ |
| 480 | | static object_pool *mame32_pool; |
| 481 | | |
| 482 | | static int game_index; |
| 483 | | static int progBarStep; |
| 484 | | |
| 485 | | static BOOL bDoGameCheck = FALSE; |
| 486 | | |
| 487 | | /* Tree control variables */ |
| 488 | | static BOOL bShowTree = 1; |
| 489 | | static BOOL bShowToolBar = 1; |
| 490 | | static BOOL bShowStatusBar = 1; |
| 491 | | static BOOL bShowTabCtrl = 1; |
| 492 | | static BOOL bProgressShown = FALSE; |
| 493 | | static BOOL bListReady = FALSE; |
| 494 | | |
| 495 | | #define WM_MAME32_FILECHANGED (WM_USER + 0) |
| 496 | | #define WM_MAME32_AUDITGAME (WM_USER + 1) |
| 497 | | |
| 498 | | static PDIRWATCHER s_pWatcher; |
| 499 | | |
| 500 | | /* use a joystick subsystem in the gui? */ |
| 501 | | static struct OSDJoystick* g_pJoyGUI = NULL; |
| 502 | | |
| 503 | | /* store current keyboard state (in internal codes) here */ |
| 504 | | static input_code keyboard_state[ 2048 ]; /* __code_max #defines the number of internal key_codes */ |
| 505 | | |
| 506 | | /* search */ |
| 507 | | static char g_SearchText[256]; |
| 508 | | /* table copied from windows/inputs.c */ |
| 509 | | // table entry indices |
| 510 | | #define MAME_KEY 0 |
| 511 | | #define DI_KEY 1 |
| 512 | | #define VIRTUAL_KEY 2 |
| 513 | | #define ASCII_KEY 3 |
| 514 | | |
| 515 | | // master keyboard translation table |
| 516 | | static const int win_key_trans_table[][4] = |
| 517 | | { |
| 518 | | // MAME key dinput key virtual key ascii |
| 519 | | { ITEM_ID_ESC, DIK_ESCAPE, VK_ESCAPE, 27 }, |
| 520 | | { ITEM_ID_1, DIK_1, '1', '1' }, |
| 521 | | { ITEM_ID_2, DIK_2, '2', '2' }, |
| 522 | | { ITEM_ID_3, DIK_3, '3', '3' }, |
| 523 | | { ITEM_ID_4, DIK_4, '4', '4' }, |
| 524 | | { ITEM_ID_5, DIK_5, '5', '5' }, |
| 525 | | { ITEM_ID_6, DIK_6, '6', '6' }, |
| 526 | | { ITEM_ID_7, DIK_7, '7', '7' }, |
| 527 | | { ITEM_ID_8, DIK_8, '8', '8' }, |
| 528 | | { ITEM_ID_9, DIK_9, '9', '9' }, |
| 529 | | { ITEM_ID_0, DIK_0, '0', '0' }, |
| 530 | | { ITEM_ID_BACKSPACE, DIK_BACK, VK_BACK, 8 }, |
| 531 | | { ITEM_ID_TAB, DIK_TAB, VK_TAB, 9 }, |
| 532 | | { ITEM_ID_Q, DIK_Q, 'Q', 'Q' }, |
| 533 | | { ITEM_ID_W, DIK_W, 'W', 'W' }, |
| 534 | | { ITEM_ID_E, DIK_E, 'E', 'E' }, |
| 535 | | { ITEM_ID_R, DIK_R, 'R', 'R' }, |
| 536 | | { ITEM_ID_T, DIK_T, 'T', 'T' }, |
| 537 | | { ITEM_ID_Y, DIK_Y, 'Y', 'Y' }, |
| 538 | | { ITEM_ID_U, DIK_U, 'U', 'U' }, |
| 539 | | { ITEM_ID_I, DIK_I, 'I', 'I' }, |
| 540 | | { ITEM_ID_O, DIK_O, 'O', 'O' }, |
| 541 | | { ITEM_ID_P, DIK_P, 'P', 'P' }, |
| 542 | | { ITEM_ID_OPENBRACE, DIK_LBRACKET, VK_OEM_4, '[' }, |
| 543 | | { ITEM_ID_CLOSEBRACE, DIK_RBRACKET, VK_OEM_6, ']' }, |
| 544 | | { ITEM_ID_ENTER, DIK_RETURN, VK_RETURN, 13 }, |
| 545 | | { ITEM_ID_LCONTROL, DIK_LCONTROL, VK_LCONTROL, 0 }, |
| 546 | | { ITEM_ID_A, DIK_A, 'A', 'A' }, |
| 547 | | { ITEM_ID_S, DIK_S, 'S', 'S' }, |
| 548 | | { ITEM_ID_D, DIK_D, 'D', 'D' }, |
| 549 | | { ITEM_ID_F, DIK_F, 'F', 'F' }, |
| 550 | | { ITEM_ID_G, DIK_G, 'G', 'G' }, |
| 551 | | { ITEM_ID_H, DIK_H, 'H', 'H' }, |
| 552 | | { ITEM_ID_J, DIK_J, 'J', 'J' }, |
| 553 | | { ITEM_ID_K, DIK_K, 'K', 'K' }, |
| 554 | | { ITEM_ID_L, DIK_L, 'L', 'L' }, |
| 555 | | { ITEM_ID_COLON, DIK_SEMICOLON, VK_OEM_1, ';' }, |
| 556 | | { ITEM_ID_QUOTE, DIK_APOSTROPHE, VK_OEM_7, '\'' }, |
| 557 | | { ITEM_ID_TILDE, DIK_GRAVE, VK_OEM_3, '`' }, |
| 558 | | { ITEM_ID_LSHIFT, DIK_LSHIFT, VK_LSHIFT, 0 }, |
| 559 | | { ITEM_ID_BACKSLASH, DIK_BACKSLASH, VK_OEM_5, '\\' }, |
| 560 | | { ITEM_ID_Z, DIK_Z, 'Z', 'Z' }, |
| 561 | | { ITEM_ID_X, DIK_X, 'X', 'X' }, |
| 562 | | { ITEM_ID_C, DIK_C, 'C', 'C' }, |
| 563 | | { ITEM_ID_V, DIK_V, 'V', 'V' }, |
| 564 | | { ITEM_ID_B, DIK_B, 'B', 'B' }, |
| 565 | | { ITEM_ID_N, DIK_N, 'N', 'N' }, |
| 566 | | { ITEM_ID_M, DIK_M, 'M', 'M' }, |
| 567 | | { ITEM_ID_SLASH, DIK_SLASH, VK_OEM_2, '/' }, |
| 568 | | { ITEM_ID_RSHIFT, DIK_RSHIFT, VK_RSHIFT, 0 }, |
| 569 | | { ITEM_ID_ASTERISK, DIK_MULTIPLY, VK_MULTIPLY, '*' }, |
| 570 | | { ITEM_ID_LALT, DIK_LMENU, VK_LMENU, 0 }, |
| 571 | | { ITEM_ID_SPACE, DIK_SPACE, VK_SPACE, ' ' }, |
| 572 | | { ITEM_ID_CAPSLOCK, DIK_CAPITAL, VK_CAPITAL, 0 }, |
| 573 | | { ITEM_ID_F1, DIK_F1, VK_F1, 0 }, |
| 574 | | { ITEM_ID_F2, DIK_F2, VK_F2, 0 }, |
| 575 | | { ITEM_ID_F3, DIK_F3, VK_F3, 0 }, |
| 576 | | { ITEM_ID_F4, DIK_F4, VK_F4, 0 }, |
| 577 | | { ITEM_ID_F5, DIK_F5, VK_F5, 0 }, |
| 578 | | { ITEM_ID_F6, DIK_F6, VK_F6, 0 }, |
| 579 | | { ITEM_ID_F7, DIK_F7, VK_F7, 0 }, |
| 580 | | { ITEM_ID_F8, DIK_F8, VK_F8, 0 }, |
| 581 | | { ITEM_ID_F9, DIK_F9, VK_F9, 0 }, |
| 582 | | { ITEM_ID_F10, DIK_F10, VK_F10, 0 }, |
| 583 | | { ITEM_ID_NUMLOCK, DIK_NUMLOCK, VK_NUMLOCK, 0 }, |
| 584 | | { ITEM_ID_SCRLOCK, DIK_SCROLL, VK_SCROLL, 0 }, |
| 585 | | { ITEM_ID_7_PAD, DIK_NUMPAD7, VK_NUMPAD7, 0 }, |
| 586 | | { ITEM_ID_8_PAD, DIK_NUMPAD8, VK_NUMPAD8, 0 }, |
| 587 | | { ITEM_ID_9_PAD, DIK_NUMPAD9, VK_NUMPAD9, 0 }, |
| 588 | | { ITEM_ID_MINUS_PAD, DIK_SUBTRACT, VK_SUBTRACT, 0 }, |
| 589 | | { ITEM_ID_4_PAD, DIK_NUMPAD4, VK_NUMPAD4, 0 }, |
| 590 | | { ITEM_ID_5_PAD, DIK_NUMPAD5, VK_NUMPAD5, 0 }, |
| 591 | | { ITEM_ID_6_PAD, DIK_NUMPAD6, VK_NUMPAD6, 0 }, |
| 592 | | { ITEM_ID_PLUS_PAD, DIK_ADD, VK_ADD, 0 }, |
| 593 | | { ITEM_ID_1_PAD, DIK_NUMPAD1, VK_NUMPAD1, 0 }, |
| 594 | | { ITEM_ID_2_PAD, DIK_NUMPAD2, VK_NUMPAD2, 0 }, |
| 595 | | { ITEM_ID_3_PAD, DIK_NUMPAD3, VK_NUMPAD3, 0 }, |
| 596 | | { ITEM_ID_0_PAD, DIK_NUMPAD0, VK_NUMPAD0, 0 }, |
| 597 | | { ITEM_ID_DEL_PAD, DIK_DECIMAL, VK_DECIMAL, 0 }, |
| 598 | | { ITEM_ID_F11, DIK_F11, VK_F11, 0 }, |
| 599 | | { ITEM_ID_F12, DIK_F12, VK_F12, 0 }, |
| 600 | | { ITEM_ID_F13, DIK_F13, VK_F13, 0 }, |
| 601 | | { ITEM_ID_F14, DIK_F14, VK_F14, 0 }, |
| 602 | | { ITEM_ID_F15, DIK_F15, VK_F15, 0 }, |
| 603 | | { ITEM_ID_ENTER_PAD, DIK_NUMPADENTER, VK_RETURN, 0 }, |
| 604 | | { ITEM_ID_RCONTROL, DIK_RCONTROL, VK_RCONTROL, 0 }, |
| 605 | | { ITEM_ID_SLASH_PAD, DIK_DIVIDE, VK_DIVIDE, 0 }, |
| 606 | | { ITEM_ID_PRTSCR, DIK_SYSRQ, 0, 0 }, |
| 607 | | { ITEM_ID_RALT, DIK_RMENU, VK_RMENU, 0 }, |
| 608 | | { ITEM_ID_HOME, DIK_HOME, VK_HOME, 0 }, |
| 609 | | { ITEM_ID_UP, DIK_UP, VK_UP, 0 }, |
| 610 | | { ITEM_ID_PGUP, DIK_PRIOR, VK_PRIOR, 0 }, |
| 611 | | { ITEM_ID_LEFT, DIK_LEFT, VK_LEFT, 0 }, |
| 612 | | { ITEM_ID_RIGHT, DIK_RIGHT, VK_RIGHT, 0 }, |
| 613 | | { ITEM_ID_END, DIK_END, VK_END, 0 }, |
| 614 | | { ITEM_ID_DOWN, DIK_DOWN, VK_DOWN, 0 }, |
| 615 | | { ITEM_ID_PGDN, DIK_NEXT, VK_NEXT, 0 }, |
| 616 | | { ITEM_ID_INSERT, DIK_INSERT, VK_INSERT, 0 }, |
| 617 | | { ITEM_ID_DEL, DIK_DELETE, VK_DELETE, 0 }, |
| 618 | | { ITEM_ID_LWIN, DIK_LWIN, VK_LWIN, 0 }, |
| 619 | | { ITEM_ID_RWIN, DIK_RWIN, VK_RWIN, 0 }, |
| 620 | | { ITEM_ID_MENU, DIK_APPS, VK_APPS, 0 }, |
| 621 | | { ITEM_ID_PAUSE, DIK_PAUSE, VK_PAUSE, 0 }, |
| 622 | | { ITEM_ID_CANCEL, 0, VK_CANCEL, 0 }, |
| 623 | | }; |
| 624 | | |
| 625 | | |
| 626 | | |
| 627 | | typedef struct |
| 628 | | { |
| 629 | | char name[40]; // functionality name (optional) |
| 630 | | input_seq is; // the input sequence (the keys pressed) |
| 631 | | UINT func_id; // the identifier |
| 632 | | input_seq* (*getiniptr)(void);// pointer to function to get the value from .ini file |
| 633 | | } GUISequence; |
| 634 | | |
| 635 | | static GUISequence GUISequenceControl[]= |
| 636 | | { |
| 637 | | {"gui_key_up", SEQ_DEF_0, ID_UI_UP, Get_ui_key_up }, |
| 638 | | {"gui_key_down", SEQ_DEF_0, ID_UI_DOWN, Get_ui_key_down }, |
| 639 | | {"gui_key_left", SEQ_DEF_0, ID_UI_LEFT, Get_ui_key_left }, |
| 640 | | {"gui_key_right", SEQ_DEF_0, ID_UI_RIGHT, Get_ui_key_right }, |
| 641 | | {"gui_key_start", SEQ_DEF_0, ID_UI_START, Get_ui_key_start }, |
| 642 | | {"gui_key_pgup", SEQ_DEF_0, ID_UI_PGUP, Get_ui_key_pgup }, |
| 643 | | {"gui_key_pgdwn", SEQ_DEF_0, ID_UI_PGDOWN, Get_ui_key_pgdwn }, |
| 644 | | {"gui_key_home", SEQ_DEF_0, ID_UI_HOME, Get_ui_key_home }, |
| 645 | | {"gui_key_end", SEQ_DEF_0, ID_UI_END, Get_ui_key_end }, |
| 646 | | {"gui_key_ss_change", SEQ_DEF_0, IDC_SSFRAME, Get_ui_key_ss_change }, |
| 647 | | {"gui_key_history_up", SEQ_DEF_0, ID_UI_HISTORY_UP, Get_ui_key_history_up }, |
| 648 | | {"gui_key_history_down", SEQ_DEF_0, ID_UI_HISTORY_DOWN, Get_ui_key_history_down }, |
| 649 | | |
| 650 | | {"gui_key_context_filters", SEQ_DEF_0, ID_CONTEXT_FILTERS, Get_ui_key_context_filters }, |
| 651 | | {"gui_key_select_random", SEQ_DEF_0, ID_CONTEXT_SELECT_RANDOM, Get_ui_key_select_random }, |
| 652 | | {"gui_key_game_audit", SEQ_DEF_0, ID_GAME_AUDIT, Get_ui_key_game_audit }, |
| 653 | | {"gui_key_game_properties", SEQ_DEF_0, ID_GAME_PROPERTIES, Get_ui_key_game_properties }, |
| 654 | | {"gui_key_help_contents", SEQ_DEF_0, ID_HELP_CONTENTS, Get_ui_key_help_contents }, |
| 655 | | {"gui_key_update_gamelist", SEQ_DEF_0, ID_UPDATE_GAMELIST, Get_ui_key_update_gamelist }, |
| 656 | | {"gui_key_view_folders", SEQ_DEF_0, ID_VIEW_FOLDERS, Get_ui_key_view_folders }, |
| 657 | | {"gui_key_view_fullscreen", SEQ_DEF_0, ID_VIEW_FULLSCREEN, Get_ui_key_view_fullscreen }, |
| 658 | | {"gui_key_view_pagetab", SEQ_DEF_0, ID_VIEW_PAGETAB, Get_ui_key_view_pagetab }, |
| 659 | | {"gui_key_view_picture_area", SEQ_DEF_0, ID_VIEW_PICTURE_AREA, Get_ui_key_view_picture_area }, |
| 660 | | {"gui_key_view_status", SEQ_DEF_0, ID_VIEW_STATUS, Get_ui_key_view_status }, |
| 661 | | {"gui_key_view_toolbars", SEQ_DEF_0, ID_VIEW_TOOLBARS, Get_ui_key_view_toolbars }, |
| 662 | | |
| 663 | | {"gui_key_view_tab_cabinet", SEQ_DEF_0, ID_VIEW_TAB_CABINET, Get_ui_key_view_tab_cabinet }, |
| 664 | | {"gui_key_view_tab_cpanel", SEQ_DEF_0, ID_VIEW_TAB_CONTROL_PANEL, Get_ui_key_view_tab_cpanel }, |
| 665 | | {"gui_key_view_tab_flyer", SEQ_DEF_0, ID_VIEW_TAB_FLYER, Get_ui_key_view_tab_flyer }, |
| 666 | | {"gui_key_view_tab_history", SEQ_DEF_0, ID_VIEW_TAB_HISTORY, Get_ui_key_view_tab_history }, |
| 667 | | {"gui_key_view_tab_marquee", SEQ_DEF_0, ID_VIEW_TAB_MARQUEE, Get_ui_key_view_tab_marquee }, |
| 668 | | {"gui_key_view_tab_screenshot", SEQ_DEF_0, ID_VIEW_TAB_SCREENSHOT, Get_ui_key_view_tab_screenshot }, |
| 669 | | {"gui_key_view_tab_title", SEQ_DEF_0, ID_VIEW_TAB_TITLE, Get_ui_key_view_tab_title }, |
| 670 | | {"gui_key_view_tab_pcb", SEQ_DEF_0, ID_VIEW_TAB_PCB, Get_ui_key_view_tab_pcb }, |
| 671 | | {"gui_key_quit", SEQ_DEF_0, ID_FILE_EXIT, Get_ui_key_quit }, |
| 672 | | }; |
| 673 | | |
| 674 | | |
| 675 | | #define NUM_GUI_SEQUENCES (sizeof(GUISequenceControl) / sizeof(GUISequenceControl[0])) |
| 676 | | |
| 677 | | |
| 678 | | static UINT lastColumnClick = 0; |
| 679 | | static WNDPROC g_lpHistoryWndProc = NULL; |
| 680 | | static WNDPROC g_lpPictureFrameWndProc = NULL; |
| 681 | | static WNDPROC g_lpPictureWndProc = NULL; |
| 682 | | |
| 683 | | static POPUPSTRING popstr[MAX_MENUS + 1]; |
| 684 | | |
| 685 | | /* Tool and Status bar variables */ |
| 686 | | static HWND hStatusBar = 0; |
| 687 | | static HWND hToolBar = 0; |
| 688 | | |
| 689 | | /* Column Order as Displayed */ |
| 690 | | static BOOL oldControl = FALSE; |
| 691 | | static BOOL xpControl = FALSE; |
| 692 | | |
| 693 | | /* Used to recalculate the main window layout */ |
| 694 | | static int bottomMargin; |
| 695 | | static int topMargin; |
| 696 | | static int have_history = FALSE; |
| 697 | | |
| 698 | | static BOOL have_selection = FALSE; |
| 699 | | |
| 700 | | static HBITMAP hMissing_bitmap; |
| 701 | | |
| 702 | | /* Icon variables */ |
| 703 | | static HIMAGELIST hLarge = NULL; |
| 704 | | static HIMAGELIST hSmall = NULL; |
| 705 | | static HIMAGELIST hHeaderImages = NULL; |
| 706 | | static int *icon_index = NULL; /* for custom per-game icons */ |
| 707 | | |
| 708 | | static TBBUTTON tbb[] = |
| 709 | | { |
| 710 | | {0, ID_VIEW_FOLDERS, TBSTATE_ENABLED, TBSTYLE_CHECK, {0, 0}, 0, 0}, |
| 711 | | {1, ID_VIEW_PICTURE_AREA,TBSTATE_ENABLED, TBSTYLE_CHECK, {0, 0}, 0, 1}, |
| 712 | | {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0}, |
| 713 | | {2, ID_VIEW_LARGE_ICON, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 2}, |
| 714 | | {3, ID_VIEW_SMALL_ICON, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 3}, |
| 715 | | {4, ID_VIEW_LIST_MENU, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 4}, |
| 716 | | {5, ID_VIEW_DETAIL, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 5}, |
| 717 | | {6, ID_VIEW_GROUPED, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 6}, |
| 718 | | {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0}, |
| 719 | | {7, ID_HELP_ABOUT, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 7}, |
| 720 | | {8, ID_HELP_CONTENTS, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 8} |
| 721 | | }; |
| 722 | | |
| 723 | | #define NUM_TOOLBUTTONS (sizeof(tbb) / sizeof(tbb[0])) |
| 724 | | |
| 725 | | #define NUM_TOOLTIPS 8 |
| 726 | | |
| 727 | | static const TCHAR szTbStrings[NUM_TOOLTIPS + 1][30] = |
| 728 | | { |
| 729 | | TEXT("Toggle Folder List"), |
| 730 | | TEXT("Toggle Screen Shot"), |
| 731 | | TEXT("Large Icons"), |
| 732 | | TEXT("Small Icons"), |
| 733 | | TEXT("List"), |
| 734 | | TEXT("Details"), |
| 735 | | TEXT("Grouped"), |
| 736 | | TEXT("About"), |
| 737 | | TEXT("Help") |
| 738 | | }; |
| 739 | | |
| 740 | | static const int CommandToString[] = |
| 741 | | { |
| 742 | | ID_VIEW_FOLDERS, |
| 743 | | ID_VIEW_PICTURE_AREA, |
| 744 | | ID_VIEW_LARGE_ICON, |
| 745 | | ID_VIEW_SMALL_ICON, |
| 746 | | ID_VIEW_LIST_MENU, |
| 747 | | ID_VIEW_DETAIL, |
| 748 | | ID_VIEW_GROUPED, |
| 749 | | ID_HELP_ABOUT, |
| 750 | | ID_HELP_CONTENTS, |
| 751 | | -1 |
| 752 | | }; |
| 753 | | |
| 754 | | static const int s_nPickers[] = |
| 755 | | { |
| 756 | | IDC_LIST |
| 757 | | #ifdef MESS |
| 758 | | ,IDC_SWLIST |
| 759 | | #endif |
| 760 | | }; |
| 761 | | |
| 762 | | /* How to resize main window */ |
| 763 | | static ResizeItem main_resize_items[] = |
| 764 | | { |
| 765 | | { RA_HWND, { 0 }, FALSE, RA_LEFT | RA_RIGHT | RA_TOP, NULL }, |
| 766 | | { RA_HWND, { 0 }, FALSE, RA_LEFT | RA_RIGHT | RA_BOTTOM, NULL }, |
| 767 | | { RA_ID, { IDC_DIVIDER }, FALSE, RA_LEFT | RA_RIGHT | RA_TOP, NULL }, |
| 768 | | { RA_ID, { IDC_TREE }, TRUE, RA_LEFT | RA_BOTTOM | RA_TOP, NULL }, |
| 769 | | { RA_ID, { IDC_LIST }, TRUE, RA_ALL, NULL }, |
| 770 | | { RA_ID, { IDC_SPLITTER }, FALSE, RA_LEFT | RA_BOTTOM | RA_TOP, NULL }, |
| 771 | | { RA_ID, { IDC_SPLITTER2 },FALSE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 772 | | { RA_ID, { IDC_SSFRAME }, FALSE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 773 | | { RA_ID, { IDC_SSPICTURE },FALSE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 774 | | { RA_ID, { IDC_HISTORY }, TRUE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 775 | | { RA_ID, { IDC_SSTAB }, FALSE, RA_RIGHT | RA_TOP, NULL }, |
| 776 | | #ifdef MESS |
| 777 | | { RA_ID, { IDC_SWLIST }, TRUE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 778 | | { RA_ID, { IDC_SPLITTER3 },FALSE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 779 | | #endif /* MESS */ |
| 780 | | { RA_END, { 0 }, FALSE, 0, NULL } |
| 781 | | }; |
| 782 | | |
| 783 | | static Resize main_resize = { {0, 0, 0, 0}, main_resize_items }; |
| 784 | | |
| 785 | | /* last directory for common file dialogs */ |
| 786 | | TCHAR last_directory[MAX_PATH]; |
| 787 | | |
| 788 | | /* system-wide window message sent out with an ATOM of the current game name |
| 789 | | each time it changes */ |
| 790 | | static UINT g_mame32_message = 0; |
| 791 | | static BOOL g_bDoBroadcast = FALSE; |
| 792 | | |
| 793 | | static BOOL use_gui_romloading = FALSE; |
| 794 | | |
| 795 | | static BOOL g_listview_dragging = FALSE; |
| 796 | | HIMAGELIST himl_drag; |
| 797 | | int game_dragged; /* which game started the drag */ |
| 798 | | HTREEITEM prev_drag_drop_target; /* which tree view item we're currently highlighting */ |
| 799 | | |
| 800 | | static BOOL g_in_treeview_edit = FALSE; |
| 801 | | |
| 802 | | typedef struct |
| 803 | | { |
| 804 | | const char *name; |
| 805 | | int index; |
| 806 | | } driver_data_type; |
| 807 | | static driver_data_type *sorted_drivers; |
| 808 | | |
| 809 | | /*************************************************************************** |
| 810 | | Global variables |
| 811 | | ***************************************************************************/ |
| 812 | | |
| 813 | | /* Background Image handles also accessed from TreeView.c */ |
| 814 | | static HPALETTE hPALbg = 0; |
| 815 | | static HBITMAP hBackground = 0; |
| 816 | | static MYBITMAPINFO bmDesc; |
| 817 | | |
| 818 | | /* List view Column text */ |
| 819 | | LPCTSTR column_names[COLUMN_MAX] = |
| 820 | | { |
| 821 | | #ifdef MESS |
| 822 | | TEXT("System"), |
| 823 | | #else |
| 824 | | TEXT("Game"), |
| 825 | | #endif |
| 826 | | TEXT("Screen"), |
| 827 | | //TEXT("ROMs"), |
| 828 | | TEXT("Samples"), |
| 829 | | TEXT("Directory"), |
| 830 | | TEXT("Type"), |
| 831 | | TEXT("Trackball"), |
| 832 | | TEXT("Played"), |
| 833 | | TEXT("Manufacturer"), |
| 834 | | TEXT("Year"), |
| 835 | | TEXT("Clone Of"), |
| 836 | | TEXT("Source"), |
| 837 | | TEXT("Play Time") |
| 838 | | }; |
| 839 | | |
| 840 | | /*************************************************************************** |
| 841 | | Message Macros |
| 842 | | ***************************************************************************/ |
| 843 | | |
| 844 | | #ifndef StatusBar_GetItemRect |
| 845 | | #define StatusBar_GetItemRect(hWnd, iPart, lpRect) \ |
| 846 | | SendMessage(hWnd, SB_GETRECT, (WPARAM) iPart, (LPARAM) (LPRECT) lpRect) |
| 847 | | #endif |
| 848 | | |
| 849 | | #ifndef ToolBar_CheckButton |
| 850 | | #define ToolBar_CheckButton(hWnd, idButton, fCheck) \ |
| 851 | | SendMessage(hWnd, TB_CHECKBUTTON, (WPARAM)idButton, (LPARAM)MAKELONG(fCheck, 0)) |
| 852 | | #endif |
| 853 | | |
| 854 | | /*************************************************************************** |
| 855 | | External functions |
| 856 | | ***************************************************************************/ |
| 857 | | #if 0 |
| 858 | | static void CopyOptions(core_options *pDestOpts, core_options *pSourceOpts) |
| 859 | | { |
| 860 | | options_enumerator *enumerator; |
| 861 | | const char *option_name; |
| 862 | | const char *option_value; |
| 863 | | |
| 864 | | enumerator = options_enumerator_begin(pSourceOpts); |
| 865 | | if (enumerator != NULL) |
| 866 | | { |
| 867 | | while((option_name = options_enumerator_next(enumerator)) != NULL) |
| 868 | | { |
| 869 | | option_value = options_get_string(pSourceOpts, option_name); |
| 870 | | if (option_value != NULL) |
| 871 | | { |
| 872 | | dprintf("CopyOptions(): Copying %s = \"%s\"\n", option_name, option_value); |
| 873 | | options_set_string(pDestOpts, option_name, option_value, OPTION_PRIORITY_CMDLINE); |
| 874 | | } |
| 875 | | } |
| 876 | | options_enumerator_free(enumerator); |
| 877 | | } |
| 878 | | } |
| 879 | | |
| 880 | | static BOOL WaitWithMessageLoop(HANDLE hEvent) |
| 881 | | { |
| 882 | | DWORD dwRet; |
| 883 | | MSG msg; |
| 884 | | |
| 885 | | while (1) |
| 886 | | { |
| 887 | | dwRet = MsgWaitForMultipleObjects(1, &hEvent, FALSE, INFINITE, QS_ALLINPUT); |
| 888 | | |
| 889 | | if (dwRet == WAIT_OBJECT_0) |
| 890 | | return TRUE; |
| 891 | | |
| 892 | | if (dwRet != WAIT_OBJECT_0 + 1) |
| 893 | | break; |
| 894 | | |
| 895 | | while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) |
| 896 | | { |
| 897 | | TranslateMessage(&msg); |
| 898 | | DispatchMessage(&msg); |
| 899 | | if (WaitForSingleObject(hEvent, 0) == WAIT_OBJECT_0) |
| 900 | | return TRUE; |
| 901 | | } |
| 902 | | } |
| 903 | | return FALSE; |
| 904 | | } |
| 905 | | #endif |
| 906 | | |
| 907 | | static DWORD RunMAME(int nGameIndex, const play_options *playopts) |
| 908 | | { |
| 909 | | time_t start, end; |
| 910 | | double elapsedtime; |
| 911 | | DWORD dwExitCode = 0; |
| 912 | | int i; |
| 913 | | core_options *mame_opts; |
| 914 | | |
| 915 | | // set up MAME options |
| 916 | | mame_opts = mame_options_init(mame_win_options); |
| 917 | | |
| 918 | | // Tell mame were to get the INIs |
| 919 | | options_set_string(mame_opts, OPTION_INIPATH, GetIniDir(), OPTION_PRIORITY_CMDLINE); |
| 920 | | |
| 921 | | #ifdef MESS |
| 922 | | // add MESS specific device options |
| 923 | | mess_add_device_options(mame_opts, drivers[nGameIndex]); |
| 924 | | #endif // MESS |
| 925 | | |
| 926 | | // set any specified play options |
| 927 | | if (playopts != NULL) |
| 928 | | { |
| 929 | | if (playopts->record != NULL) |
| 930 | | options_set_string(mame_opts, OPTION_RECORD, playopts->record, OPTION_PRIORITY_CMDLINE); |
| 931 | | if (playopts->playback != NULL) |
| 932 | | options_set_string(mame_opts, OPTION_PLAYBACK, playopts->playback, OPTION_PRIORITY_CMDLINE); |
| 933 | | if (playopts->state != NULL) |
| 934 | | options_set_string(mame_opts, OPTION_STATE, playopts->state, OPTION_PRIORITY_CMDLINE); |
| 935 | | if (playopts->wavwrite != NULL) |
| 936 | | options_set_string(mame_opts, OPTION_WAVWRITE, playopts->wavwrite, OPTION_PRIORITY_CMDLINE); |
| 937 | | if (playopts->mngwrite != NULL) |
| 938 | | options_set_string(mame_opts, OPTION_MNGWRITE, playopts->mngwrite, OPTION_PRIORITY_CMDLINE); |
| 939 | | } |
| 940 | | |
| 941 | | // Mame will parse all the needed .ini files. |
| 942 | | |
| 943 | | // prepare MAME32 to run the game |
| 944 | | ShowWindow(hMain, SW_HIDE); |
| 945 | | |
| 946 | | for (i = 0; i < ARRAY_LENGTH(s_nPickers); i++) |
| 947 | | Picker_ClearIdle(GetDlgItem(hMain, s_nPickers[i])); |
| 948 | | |
| 949 | | // run the emulation |
| 950 | | options_set_string(mame_opts, OPTION_GAMENAME, drivers[nGameIndex]->name, OPTION_PRIORITY_CMDLINE); |
| 951 | | // Time the game run. |
| 952 | | time(&start); |
| 953 | | mame_execute(mame_opts); |
| 954 | | // Calc the duration |
| 955 | | time(&end); |
| 956 | | elapsedtime = end - start; |
| 957 | | // Increment our playtime. |
| 958 | | IncrementPlayTime(nGameIndex, elapsedtime); |
| 959 | | // the emulation is complete; continue |
| 960 | | for (i = 0; i < ARRAY_LENGTH(s_nPickers); i++) |
| 961 | | Picker_ResetIdle(GetDlgItem(hMain, s_nPickers[i])); |
| 962 | | ShowWindow(hMain, SW_SHOW); |
| 963 | | SetForegroundWindow(hMain); |
| 964 | | |
| 965 | | return dwExitCode; |
| 966 | | } |
| 967 | | |
| 968 | | int Mame32Main(HINSTANCE hInstance, |
| 969 | | LPSTR lpCmdLine, |
| 970 | | int nCmdShow) |
| 971 | | { |
| 972 | | dprintf("MAME32 starting\n"); |
| 973 | | |
| 974 | | use_gui_romloading = TRUE; |
| 975 | | |
| 976 | | if (__argc != 1) |
| 977 | | { |
| 978 | | /* Rename main because gcc will use it instead of WinMain even with -mwindows */ |
| 979 | | extern int DECL_SPEC mame_main(int, char**); |
| 980 | | exit(mame_main(__argc, __argv)); |
| 981 | | } |
| 982 | | if (!Win32UI_init(hInstance, lpCmdLine, nCmdShow)) |
| 983 | | return 1; |
| 984 | | |
| 985 | | // pump message, but quit on WM_QUIT |
| 986 | | while(PumpMessage()) |
| 987 | | ; |
| 988 | | |
| 989 | | Win32UI_exit(); |
| 990 | | return 0; |
| 991 | | } |
| 992 | | |
| 993 | | |
| 994 | | HWND GetMainWindow(void) |
| 995 | | { |
| 996 | | return hMain; |
| 997 | | } |
| 998 | | |
| 999 | | HWND GetTreeView(void) |
| 1000 | | { |
| 1001 | | return hTreeView; |
| 1002 | | } |
| 1003 | | |
| 1004 | | HIMAGELIST GetLargeImageList(void) |
| 1005 | | { |
| 1006 | | return hLarge; |
| 1007 | | } |
| 1008 | | |
| 1009 | | HIMAGELIST GetSmallImageList(void) |
| 1010 | | { |
| 1011 | | return hSmall; |
| 1012 | | } |
| 1013 | | |
| 1014 | | object_pool *GetMame32MemoryPool(void) |
| 1015 | | { |
| 1016 | | return mame32_pool; |
| 1017 | | } |
| 1018 | | |
| 1019 | | void GetRealColumnOrder(int order[]) |
| 1020 | | { |
| 1021 | | int tmpOrder[COLUMN_MAX]; |
| 1022 | | int nColumnMax; |
| 1023 | | int i; |
| 1024 | | |
| 1025 | | nColumnMax = Picker_GetNumColumns(hwndList); |
| 1026 | | |
| 1027 | | /* Get the Column Order and save it */ |
| 1028 | | if (!oldControl) |
| 1029 | | { |
| 1030 | | ListView_GetColumnOrderArray(hwndList, nColumnMax, tmpOrder); |
| 1031 | | |
| 1032 | | for (i = 0; i < nColumnMax; i++) |
| 1033 | | { |
| 1034 | | order[i] = Picker_GetRealColumnFromViewColumn(hwndList, tmpOrder[i]); |
| 1035 | | } |
| 1036 | | } |
| 1037 | | } |
| 1038 | | |
| 1039 | | /* |
| 1040 | | * PURPOSE: Format raw data read from an ICO file to an HICON |
| 1041 | | * PARAMS: PBYTE ptrBuffer - Raw data from an ICO file |
| 1042 | | * UINT nBufferSize - Size of buffer ptrBuffer |
| 1043 | | * RETURNS: HICON - handle to the icon, NULL for failure |
| 1044 | | * History: July '95 - Created |
| 1045 | | * March '00- Seriously butchered from MSDN for mine own |
| 1046 | | * purposes, sayeth H0ek. |
| 1047 | | */ |
| 1048 | | HICON FormatICOInMemoryToHICON(PBYTE ptrBuffer, UINT nBufferSize) |
| 1049 | | { |
| 1050 | | ICONIMAGE IconImage; |
| 1051 | | LPICONDIRENTRY lpIDE = NULL; |
| 1052 | | UINT nNumImages; |
| 1053 | | UINT nBufferIndex = 0; |
| 1054 | | HICON hIcon = NULL; |
| 1055 | | |
| 1056 | | /* Is there a WORD? */ |
| 1057 | | if (nBufferSize < sizeof(WORD)) |
| 1058 | | { |
| 1059 | | return NULL; |
| 1060 | | } |
| 1061 | | |
| 1062 | | /* Was it 'reserved' ? (ie 0) */ |
| 1063 | | if ((WORD)(ptrBuffer[nBufferIndex]) != 0) |
| 1064 | | { |
| 1065 | | return NULL; |
| 1066 | | } |
| 1067 | | |
| 1068 | | nBufferIndex += sizeof(WORD); |
| 1069 | | |
| 1070 | | /* Is there a WORD? */ |
| 1071 | | if (nBufferSize - nBufferIndex < sizeof(WORD)) |
| 1072 | | { |
| 1073 | | return NULL; |
| 1074 | | } |
| 1075 | | |
| 1076 | | /* Was it type 1? */ |
| 1077 | | if ((WORD)(ptrBuffer[nBufferIndex]) != 1) |
| 1078 | | { |
| 1079 | | return NULL; |
| 1080 | | } |
| 1081 | | |
| 1082 | | nBufferIndex += sizeof(WORD); |
| 1083 | | |
| 1084 | | /* Is there a WORD? */ |
| 1085 | | if (nBufferSize - nBufferIndex < sizeof(WORD)) |
| 1086 | | { |
| 1087 | | return NULL; |
| 1088 | | } |
| 1089 | | |
| 1090 | | /* Then that's the number of images in the ICO file */ |
| 1091 | | nNumImages = (WORD)(ptrBuffer[nBufferIndex]); |
| 1092 | | |
| 1093 | | /* Is there at least one icon in the file? */ |
| 1094 | | if ( nNumImages < 1 ) |
| 1095 | | { |
| 1096 | | return NULL; |
| 1097 | | } |
| 1098 | | |
| 1099 | | nBufferIndex += sizeof(WORD); |
| 1100 | | |
| 1101 | | /* Is there enough space for the icon directory entries? */ |
| 1102 | | if ((nBufferIndex + nNumImages * sizeof(ICONDIRENTRY)) > nBufferSize) |
| 1103 | | { |
| 1104 | | return NULL; |
| 1105 | | } |
| 1106 | | |
| 1107 | | /* Assign icon directory entries from buffer */ |
| 1108 | | lpIDE = (LPICONDIRENTRY)(&ptrBuffer[nBufferIndex]); |
| 1109 | | nBufferIndex += nNumImages * sizeof (ICONDIRENTRY); |
| 1110 | | |
| 1111 | | IconImage.dwNumBytes = lpIDE->dwBytesInRes; |
| 1112 | | |
| 1113 | | /* Seek to beginning of this image */ |
| 1114 | | if ( lpIDE->dwImageOffset > nBufferSize ) |
| 1115 | | { |
| 1116 | | return NULL; |
| 1117 | | } |
| 1118 | | |
| 1119 | | nBufferIndex = lpIDE->dwImageOffset; |
| 1120 | | |
| 1121 | | /* Read it in */ |
| 1122 | | if ((nBufferIndex + lpIDE->dwBytesInRes) > nBufferSize) |
| 1123 | | { |
| 1124 | | return NULL; |
| 1125 | | } |
| 1126 | | |
| 1127 | | IconImage.lpBits = &ptrBuffer[nBufferIndex]; |
| 1128 | | nBufferIndex += lpIDE->dwBytesInRes; |
| 1129 | | #if 0 // Not sure we want odd sized icons. |
| 1130 | | hIcon = CreateIconFromResourceEx(IconImage.lpBits, IconImage.dwNumBytes, TRUE, 0x00030000, |
| 1131 | | (*(LPBITMAPINFOHEADER)(IconImage.lpBits)).biWidth, (*(LPBITMAPINFOHEADER)(IconImage.lpBits)).biHeight/2, 0 ); |
| 1132 | | #endif |
| 1133 | | /* It failed, odds are good we're on NT so try the non-Ex way */ |
| 1134 | | if (hIcon == NULL) |
| 1135 | | { |
| 1136 | | /* We would break on NT if we try with a 16bpp image */ |
| 1137 | | if (((LPBITMAPINFO)IconImage.lpBits)->bmiHeader.biBitCount != 16) |
| 1138 | | { |
| 1139 | | hIcon = CreateIconFromResource(IconImage.lpBits, IconImage.dwNumBytes, TRUE, 0x00030000); |
| 1140 | | } |
| 1141 | | } |
| 1142 | | return hIcon; |
| 1143 | | } |
| 1144 | | |
| 1145 | | HICON LoadIconFromFile(const char *iconname) |
| 1146 | | { |
| 1147 | | HICON hIcon = 0; |
| 1148 | | struct stat file_stat; |
| 1149 | | char tmpStr[MAX_PATH]; |
| 1150 | | char tmpIcoName[MAX_PATH]; |
| 1151 | | const char* sDirName = GetImgDir(); |
| 1152 | | PBYTE bufferPtr; |
| 1153 | | zip_error ziperr; |
| 1154 | | zip_file *zip; |
| 1155 | | const zip_file_header *entry; |
| 1156 | | |
| 1157 | | sprintf(tmpStr, "%s/%s.ico", GetIconsDir(), iconname); |
| 1158 | | if (stat(tmpStr, &file_stat) != 0 |
| 1159 | | || (hIcon = win_extract_icon_utf8(hInst, tmpStr, 0)) == 0) |
| 1160 | | { |
| 1161 | | sprintf(tmpStr, "%s/%s.ico", sDirName, iconname); |
| 1162 | | if (stat(tmpStr, &file_stat) != 0 |
| 1163 | | || (hIcon = win_extract_icon_utf8(hInst, tmpStr, 0)) == 0) |
| 1164 | | { |
| 1165 | | sprintf(tmpStr, "%s/icons.zip", GetIconsDir()); |
| 1166 | | sprintf(tmpIcoName, "%s.ico", iconname); |
| 1167 | | |
| 1168 | | ziperr = zip_file_open(tmpStr, &zip); |
| 1169 | | if (ziperr == ZIPERR_NONE) |
| 1170 | | { |
| 1171 | | entry = zip_file_first_file(zip); |
| 1172 | | while(!hIcon && entry) |
| 1173 | | { |
| 1174 | | if (!mame_stricmp(entry->filename, tmpIcoName)) |
| 1175 | | { |
| 1176 | | bufferPtr = malloc(entry->uncompressed_length); |
| 1177 | | if (bufferPtr) |
| 1178 | | { |
| 1179 | | ziperr = zip_file_decompress(zip, bufferPtr, entry->uncompressed_length); |
| 1180 | | if (ziperr == ZIPERR_NONE) |
| 1181 | | { |
| 1182 | | hIcon = FormatICOInMemoryToHICON(bufferPtr, entry->uncompressed_length); |
| 1183 | | } |
| 1184 | | free(bufferPtr); |
| 1185 | | } |
| 1186 | | } |
| 1187 | | entry = zip_file_next_file(zip); |
| 1188 | | } |
| 1189 | | zip_file_close(zip); |
| 1190 | | } |
| 1191 | | } |
| 1192 | | } |
| 1193 | | return hIcon; |
| 1194 | | } |
| 1195 | | |
| 1196 | | /* Return the number of folders with options */ |
| 1197 | | int GetNumOptionFolders() |
| 1198 | | { |
| 1199 | | return optionfolder_count; |
| 1200 | | } |
| 1201 | | |
| 1202 | | /* Return the number of folders with options */ |
| 1203 | | void SetNumOptionFolders(int count) |
| 1204 | | { |
| 1205 | | optionfolder_count = count; |
| 1206 | | } |
| 1207 | | |
| 1208 | | /* search */ |
| 1209 | | const char * GetSearchText(void) |
| 1210 | | { |
| 1211 | | return g_SearchText; |
| 1212 | | } |
| 1213 | | |
| 1214 | | |
| 1215 | | /* Sets the treeview and listviews sizes in accordance with their visibility and the splitters */ |
| 1216 | | static void ResizeTreeAndListViews(BOOL bResizeHidden) |
| 1217 | | { |
| 1218 | | int i; |
| 1219 | | int nLastWidth = 0; |
| 1220 | | int nLastWidth2 = 0; |
| 1221 | | int nLeftWindowWidth = 0; |
| 1222 | | RECT rect; |
| 1223 | | BOOL bVisible; |
| 1224 | | int nLastOverlap = -1; |
| 1225 | | |
| 1226 | | /* Size the List Control in the Picker */ |
| 1227 | | GetClientRect(hMain, &rect); |
| 1228 | | |
| 1229 | | if (bShowStatusBar) |
| 1230 | | rect.bottom -= bottomMargin; |
| 1231 | | if (bShowToolBar) |
| 1232 | | rect.top += topMargin; |
| 1233 | | |
| 1234 | | /* Tree control */ |
| 1235 | | ShowWindow(GetDlgItem(hMain, IDC_TREE), bShowTree ? SW_SHOW : SW_HIDE); |
| 1236 | | |
| 1237 | | for (i = 0; g_splitterInfo[i].nSplitterWindow; i++) |
| 1238 | | { |
| 1239 | | bVisible = GetWindowLong(GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow), GWL_STYLE) & WS_VISIBLE ? TRUE : FALSE; |
| 1240 | | if (bResizeHidden || bVisible) |
| 1241 | | { |
| 1242 | | nLeftWindowWidth = nSplitterOffset[i] - SPLITTER_WIDTH/2 - nLastWidth; |
| 1243 | | |
| 1244 | | /* special case for the rightmost pane when the screenshot is gone */ |
| 1245 | | if (!GetShowScreenShot() && !g_splitterInfo[i+1].nSplitterWindow) |
| 1246 | | nLeftWindowWidth = rect.right - nLastWidth; |
| 1247 | | |
| 1248 | | /* woah? are we overlapping ourselves? */ |
| 1249 | | if ((nLeftWindowWidth < MIN_VIEW_WIDTH) && (i != nLastOverlap)) |
| 1250 | | { |
| 1251 | | nLastOverlap = i; |
| 1252 | | nLastWidth = nLastWidth2; |
| 1253 | | nLeftWindowWidth = nSplitterOffset[i] - MIN_VIEW_WIDTH - (SPLITTER_WIDTH*3/2) - nLastWidth; |
| 1254 | | i--; |
| 1255 | | } |
| 1256 | | |
| 1257 | | MoveWindow(GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow), nLastWidth, rect.top + 2, |
| 1258 | | nLeftWindowWidth, (rect.bottom - rect.top) - 4 , TRUE); |
| 1259 | | |
| 1260 | | MoveWindow(GetDlgItem(hMain, g_splitterInfo[i].nSplitterWindow), nSplitterOffset[i], rect.top + 2, |
| 1261 | | SPLITTER_WIDTH, (rect.bottom - rect.top) - 4, TRUE); |
| 1262 | | } |
| 1263 | | |
| 1264 | | if (bVisible) |
| 1265 | | { |
| 1266 | | nLastWidth2 = nLastWidth; |
| 1267 | | nLastWidth += nLeftWindowWidth + SPLITTER_WIDTH; |
| 1268 | | } |
| 1269 | | } |
| 1270 | | } |
| 1271 | | |
| 1272 | | /* Adjust the list view and screenshot button based on GetShowScreenShot() */ |
| 1273 | | void UpdateScreenShot(void) |
| 1274 | | { |
| 1275 | | RECT rect; |
| 1276 | | int nWidth; |
| 1277 | | RECT fRect; |
| 1278 | | POINT p = {0, 0}; |
| 1279 | | |
| 1280 | | /* first time through can't do this stuff */ |
| 1281 | | if (hwndList == NULL) |
| 1282 | | return; |
| 1283 | | |
| 1284 | | /* Size the List Control in the Picker */ |
| 1285 | | GetClientRect(hMain, &rect); |
| 1286 | | |
| 1287 | | if (bShowStatusBar) |
| 1288 | | rect.bottom -= bottomMargin; |
| 1289 | | if (bShowToolBar) |
| 1290 | | rect.top += topMargin; |
| 1291 | | |
| 1292 | | if (GetShowScreenShot()) |
| 1293 | | { |
| 1294 | | nWidth = nSplitterOffset[GetSplitterCount() - 1]; |
| 1295 | | CheckMenuItem(GetMenu(hMain),ID_VIEW_PICTURE_AREA, MF_CHECKED); |
| 1296 | | ToolBar_CheckButton(hToolBar, ID_VIEW_PICTURE_AREA, MF_CHECKED); |
| 1297 | | } |
| 1298 | | else |
| 1299 | | { |
| 1300 | | nWidth = rect.right; |
| 1301 | | CheckMenuItem(GetMenu(hMain),ID_VIEW_PICTURE_AREA, MF_UNCHECKED); |
| 1302 | | ToolBar_CheckButton(hToolBar, ID_VIEW_PICTURE_AREA, MF_UNCHECKED); |
| 1303 | | } |
| 1304 | | |
| 1305 | | ResizeTreeAndListViews(FALSE); |
| 1306 | | |
| 1307 | | FreeScreenShot(); |
| 1308 | | |
| 1309 | | if (have_selection) |
| 1310 | | { |
| 1311 | | #ifdef MESS |
| 1312 | | if (!g_szSelectedItem[0] || !LoadScreenShotEx(Picker_GetSelectedItem(hwndList), g_szSelectedItem, |
| 1313 | | TabView_GetCurrentTab(hTabCtrl))) |
| 1314 | | #endif |
| 1315 | | { |
| 1316 | | // load and set image, or empty it if we don't have one |
| 1317 | | LoadScreenShot(Picker_GetSelectedItem(hwndList), TabView_GetCurrentTab(hTabCtrl)); |
| 1318 | | } |
| 1319 | | } |
| 1320 | | |
| 1321 | | // figure out if we have a history or not, to place our other windows properly |
| 1322 | | UpdateHistory(); |
| 1323 | | |
| 1324 | | // setup the picture area |
| 1325 | | |
| 1326 | | if (GetShowScreenShot()) |
| 1327 | | { |
| 1328 | | DWORD dwStyle; |
| 1329 | | DWORD dwStyleEx; |
| 1330 | | BOOL showing_history; |
| 1331 | | |
| 1332 | | ClientToScreen(hMain, &p); |
| 1333 | | GetWindowRect(GetDlgItem(hMain, IDC_SSFRAME), &fRect); |
| 1334 | | OffsetRect(&fRect, -p.x, -p.y); |
| 1335 | | |
| 1336 | | // show history on this tab IFF |
| 1337 | | // - we have history for the game |
| 1338 | | // - we're on the first tab |
| 1339 | | // - we DON'T have a separate history tab |
| 1340 | | showing_history = (have_history && (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() || GetHistoryTab() == TAB_ALL ) && |
| 1341 | | GetShowTab(TAB_HISTORY) == FALSE); |
| 1342 | | CalculateBestScreenShotRect(GetDlgItem(hMain, IDC_SSFRAME), &rect,showing_history); |
| 1343 | | |
| 1344 | | dwStyle = GetWindowLong(GetDlgItem(hMain, IDC_SSPICTURE), GWL_STYLE); |
| 1345 | | dwStyleEx = GetWindowLong(GetDlgItem(hMain, IDC_SSPICTURE), GWL_EXSTYLE); |
| 1346 | | |
| 1347 | | AdjustWindowRectEx(&rect, dwStyle, FALSE, dwStyleEx); |
| 1348 | | MoveWindow(GetDlgItem(hMain, IDC_SSPICTURE), |
| 1349 | | fRect.left + rect.left, |
| 1350 | | fRect.top + rect.top, |
| 1351 | | rect.right - rect.left, |
| 1352 | | rect.bottom - rect.top, |
| 1353 | | TRUE); |
| 1354 | | |
| 1355 | | ShowWindow(GetDlgItem(hMain,IDC_SSPICTURE), |
| 1356 | | (TabView_GetCurrentTab(hTabCtrl) != TAB_HISTORY) ? SW_SHOW : SW_HIDE); |
| 1357 | | ShowWindow(GetDlgItem(hMain,IDC_SSFRAME),SW_SHOW); |
| 1358 | | ShowWindow(GetDlgItem(hMain,IDC_SSTAB),bShowTabCtrl ? SW_SHOW : SW_HIDE); |
| 1359 | | |
| 1360 | | InvalidateRect(GetDlgItem(hMain,IDC_SSPICTURE),NULL,FALSE); |
| 1361 | | } |
| 1362 | | else |
| 1363 | | { |
| 1364 | | ShowWindow(GetDlgItem(hMain,IDC_SSPICTURE),SW_HIDE); |
| 1365 | | ShowWindow(GetDlgItem(hMain,IDC_SSFRAME),SW_HIDE); |
| 1366 | | ShowWindow(GetDlgItem(hMain,IDC_SSTAB),SW_HIDE); |
| 1367 | | } |
| 1368 | | |
| 1369 | | } |
| 1370 | | |
| 1371 | | void ResizePickerControls(HWND hWnd) |
| 1372 | | { |
| 1373 | | RECT frameRect; |
| 1374 | | RECT rect, sRect; |
| 1375 | | int nListWidth, nScreenShotWidth; |
| 1376 | | static BOOL firstTime = TRUE; |
| 1377 | | int doSSControls = TRUE; |
| 1378 | | int i, nSplitterCount; |
| 1379 | | |
| 1380 | | nSplitterCount = GetSplitterCount(); |
| 1381 | | |
| 1382 | | /* Size the List Control in the Picker */ |
| 1383 | | GetClientRect(hWnd, &rect); |
| 1384 | | |
| 1385 | | /* Calc the display sizes based on g_splitterInfo */ |
| 1386 | | if (firstTime) |
| 1387 | | { |
| 1388 | | RECT rWindow; |
| 1389 | | |
| 1390 | | for (i = 0; i < nSplitterCount; i++) |
| 1391 | | nSplitterOffset[i] = rect.right * g_splitterInfo[i].dPosition; |
| 1392 | | |
| 1393 | | GetWindowRect(hStatusBar, &rWindow); |
| 1394 | | bottomMargin = rWindow.bottom - rWindow.top; |
| 1395 | | GetWindowRect(hToolBar, &rWindow); |
| 1396 | | topMargin = rWindow.bottom - rWindow.top; |
| 1397 | | /*buttonMargin = (sRect.bottom + 4); */ |
| 1398 | | |
| 1399 | | firstTime = FALSE; |
| 1400 | | } |
| 1401 | | else |
| 1402 | | { |
| 1403 | | doSSControls = GetShowScreenShot(); |
| 1404 | | } |
| 1405 | | |
| 1406 | | if (bShowStatusBar) |
| 1407 | | rect.bottom -= bottomMargin; |
| 1408 | | |
| 1409 | | if (bShowToolBar) |
| 1410 | | rect.top += topMargin; |
| 1411 | | |
| 1412 | | MoveWindow(GetDlgItem(hWnd, IDC_DIVIDER), rect.left, rect.top - 4, rect.right, 2, TRUE); |
| 1413 | | |
| 1414 | | ResizeTreeAndListViews(TRUE); |
| 1415 | | |
| 1416 | | nListWidth = nSplitterOffset[nSplitterCount-1]; |
| 1417 | | nScreenShotWidth = (rect.right - nListWidth) - 4; |
| 1418 | | |
| 1419 | | /* Screen shot Page tab control */ |
| 1420 | | if (bShowTabCtrl) |
| 1421 | | { |
| 1422 | | MoveWindow(GetDlgItem(hWnd, IDC_SSTAB), nListWidth + 4, rect.top + 2, |
| 1423 | | nScreenShotWidth - 2, rect.top + 20, doSSControls); |
| 1424 | | rect.top += 20; |
| 1425 | | } |
| 1426 | | |
| 1427 | | /* resize the Screen shot frame */ |
| 1428 | | MoveWindow(GetDlgItem(hWnd, IDC_SSFRAME), nListWidth + 4, rect.top + 2, |
| 1429 | | nScreenShotWidth - 2, (rect.bottom - rect.top) - 4, doSSControls); |
| 1430 | | |
| 1431 | | /* The screen shot controls */ |
| 1432 | | GetClientRect(GetDlgItem(hWnd, IDC_SSFRAME), &frameRect); |
| 1433 | | |
| 1434 | | /* Text control - game history */ |
| 1435 | | sRect.left = nListWidth + 14; |
| 1436 | | sRect.right = sRect.left + (nScreenShotWidth - 22); |
| 1437 | | |
| 1438 | | |
| 1439 | | if (GetShowTab(TAB_HISTORY)) |
| 1440 | | { |
| 1441 | | // We're using the new mode, with the history filling the entire tab (almost) |
| 1442 | | sRect.top = rect.top + 14; |
| 1443 | | sRect.bottom = (rect.bottom - rect.top) - 30; |
| 1444 | | } |
| 1445 | | else |
| 1446 | | { |
| 1447 | | // We're using the original mode, with the history beneath the SS picture |
| 1448 | | sRect.top = rect.top + 264; |
| 1449 | | sRect.bottom = (rect.bottom - rect.top) - 278; |
| 1450 | | } |
| 1451 | | |
| 1452 | | MoveWindow(GetDlgItem(hWnd, IDC_HISTORY), |
| 1453 | | sRect.left, sRect.top, |
| 1454 | | sRect.right - sRect.left, sRect.bottom, doSSControls); |
| 1455 | | |
| 1456 | | /* the other screen shot controls will be properly placed in UpdateScreenshot() */ |
| 1457 | | |
| 1458 | | } |
| 1459 | | |
| 1460 | | char *ModifyThe(const char *str) |
| 1461 | | { |
| 1462 | | static int bufno = 0; |
| 1463 | | static char buffer[4][255]; |
| 1464 | | |
| 1465 | | if (strncmp(str, "The ", 4) == 0) |
| 1466 | | { |
| 1467 | | char *s, *p; |
| 1468 | | char temp[255]; |
| 1469 | | |
| 1470 | | strcpy(temp, &str[4]); |
| 1471 | | |
| 1472 | | bufno = (bufno + 1) % 4; |
| 1473 | | |
| 1474 | | s = buffer[bufno]; |
| 1475 | | |
| 1476 | | /* Check for version notes in parens */ |
| 1477 | | p = strchr(temp, '('); |
| 1478 | | if (p) |
| 1479 | | { |
| 1480 | | p[-1] = '\0'; |
| 1481 | | } |
| 1482 | | |
| 1483 | | strcpy(s, temp); |
| 1484 | | strcat(s, ", The"); |
| 1485 | | |
| 1486 | | if (p) |
| 1487 | | { |
| 1488 | | strcat(s, " "); |
| 1489 | | strcat(s, p); |
| 1490 | | } |
| 1491 | | |
| 1492 | | return s; |
| 1493 | | } |
| 1494 | | return (char *)str; |
| 1495 | | } |
| 1496 | | |
| 1497 | | HBITMAP GetBackgroundBitmap(void) |
| 1498 | | { |
| 1499 | | return hBackground; |
| 1500 | | } |
| 1501 | | |
| 1502 | | HPALETTE GetBackgroundPalette(void) |
| 1503 | | { |
| 1504 | | return hPALbg; |
| 1505 | | } |
| 1506 | | |
| 1507 | | MYBITMAPINFO * GetBackgroundInfo(void) |
| 1508 | | { |
| 1509 | | return &bmDesc; |
| 1510 | | } |
| 1511 | | |
| 1512 | | BOOL GetUseOldControl(void) |
| 1513 | | { |
| 1514 | | return oldControl; |
| 1515 | | } |
| 1516 | | |
| 1517 | | BOOL GetUseXPControl(void) |
| 1518 | | { |
| 1519 | | return xpControl; |
| 1520 | | } |
| 1521 | | |
| 1522 | | int GetMinimumScreenShotWindowWidth(void) |
| 1523 | | { |
| 1524 | | BITMAP bmp; |
| 1525 | | GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp); |
| 1526 | | |
| 1527 | | return bmp.bmWidth + 6; // 6 is for a little breathing room |
| 1528 | | } |
| 1529 | | |
| 1530 | | |
| 1531 | | int GetDriverIndex(const game_driver *driver) |
| 1532 | | { |
| 1533 | | return GetGameNameIndex(driver->name); |
| 1534 | | } |
| 1535 | | |
| 1536 | | int GetParentIndex(const game_driver *driver) |
| 1537 | | { |
| 1538 | | return GetGameNameIndex(driver->parent); |
| 1539 | | } |
| 1540 | | |
| 1541 | | int GetParentRomSetIndex(const game_driver *driver) |
| 1542 | | { |
| 1543 | | int nParentIndex = GetGameNameIndex(driver->parent); |
| 1544 | | |
| 1545 | | if( nParentIndex >= 0) |
| 1546 | | { |
| 1547 | | if ((drivers[nParentIndex]->flags & GAME_IS_BIOS_ROOT) == 0) |
| 1548 | | return nParentIndex; |
| 1549 | | } |
| 1550 | | |
| 1551 | | return -1; |
| 1552 | | } |
| 1553 | | |
| 1554 | | int GetGameNameIndex(const char *name) |
| 1555 | | { |
| 1556 | | driver_data_type *driver_index_info; |
| 1557 | | driver_data_type key; |
| 1558 | | key.name = name; |
| 1559 | | |
| 1560 | | // uses our sorted array of driver names to get the index in log time |
| 1561 | | driver_index_info = bsearch(&key,sorted_drivers,driver_list_get_count(drivers),sizeof(driver_data_type), |
| 1562 | | DriverDataCompareFunc); |
| 1563 | | |
| 1564 | | if (driver_index_info == NULL) |
| 1565 | | return -1; |
| 1566 | | |
| 1567 | | return driver_index_info->index; |
| 1568 | | |
| 1569 | | } |
| 1570 | | |
| 1571 | | int GetIndexFromSortedIndex(int sorted_index) |
| 1572 | | { |
| 1573 | | return sorted_drivers[sorted_index].index; |
| 1574 | | } |
| 1575 | | |
| 1576 | | /*************************************************************************** |
| 1577 | | Internal functions |
| 1578 | | ***************************************************************************/ |
| 1579 | | |
| 1580 | | // used for our sorted array of game names |
| 1581 | | int CLIB_DECL DriverDataCompareFunc(const void *arg1,const void *arg2) |
| 1582 | | { |
| 1583 | | return strcmp( ((driver_data_type *)arg1)->name, ((driver_data_type *)arg2)->name ); |
| 1584 | | } |
| 1585 | | |
| 1586 | | static void ResetBackground(char *szFile) |
| 1587 | | { |
| 1588 | | char szDestFile[MAX_PATH]; |
| 1589 | | |
| 1590 | | /* The MAME core load the .png file first, so we only need replace this file */ |
| 1591 | | sprintf(szDestFile, "%s\\bkground.png", GetBgDir()); |
| 1592 | | win_set_file_attributes_utf8(szDestFile, FILE_ATTRIBUTE_NORMAL); |
| 1593 | | win_copy_file_utf8(szFile, szDestFile, FALSE); |
| 1594 | | } |
| 1595 | | |
| 1596 | | static void RandomSelectBackground(void) |
| 1597 | | { |
| 1598 | | struct _finddata_t c_file; |
| 1599 | | long hFile; |
| 1600 | | char szFile[MAX_PATH]; |
| 1601 | | int count=0; |
| 1602 | | const char *szDir=GetBgDir(); |
| 1603 | | char *buf=malloc(_MAX_FNAME * MAX_BGFILES); |
| 1604 | | |
| 1605 | | if (buf == NULL) |
| 1606 | | return; |
| 1607 | | |
| 1608 | | sprintf(szFile, "%s\\*.bmp", szDir); |
| 1609 | | hFile = _findfirst(szFile, &c_file); |
| 1610 | | if (hFile != -1L) |
| 1611 | | { |
| 1612 | | int Done = 0; |
| 1613 | | while (!Done && count < MAX_BGFILES) |
| 1614 | | { |
| 1615 | | memcpy(buf + count * _MAX_FNAME, c_file.name, _MAX_FNAME); |
| 1616 | | count++; |
| 1617 | | Done = _findnext(hFile, &c_file); |
| 1618 | | } |
| 1619 | | _findclose(hFile); |
| 1620 | | } |
| 1621 | | sprintf(szFile, "%s\\*.png", szDir); |
| 1622 | | hFile = _findfirst(szFile, &c_file); |
| 1623 | | if (hFile != -1L) |
| 1624 | | { |
| 1625 | | int Done = 0; |
| 1626 | | while (!Done && count < MAX_BGFILES) |
| 1627 | | { |
| 1628 | | memcpy(buf + count * _MAX_FNAME, c_file.name, _MAX_FNAME); |
| 1629 | | count++; |
| 1630 | | Done = _findnext(hFile, &c_file); |
| 1631 | | } |
| 1632 | | _findclose(hFile); |
| 1633 | | } |
| 1634 | | |
| 1635 | | if (count) |
| 1636 | | { |
| 1637 | | #ifdef rand |
| 1638 | | #undef rand |
| 1639 | | #endif |
| 1640 | | |
| 1641 | | srand( (unsigned)time( NULL ) ); |
| 1642 | | sprintf(szFile, "%s\\%s", szDir, buf + (rand() % count) * _MAX_FNAME); |
| 1643 | | ResetBackground(szFile); |
| 1644 | | } |
| 1645 | | |
| 1646 | | free(buf); |
| 1647 | | } |
| 1648 | | |
| 1649 | | void SetMainTitle(void) |
| 1650 | | { |
| 1651 | | char version[50]; |
| 1652 | | char buffer[100]; |
| 1653 | | |
| 1654 | | sscanf(build_version,"%s",version); |
| 1655 | | snprintf(buffer, ARRAY_LENGTH(buffer), "%s %s", MAME32NAME, version); |
| 1656 | | win_set_window_text_utf8(hMain,buffer); |
| 1657 | | } |
| 1658 | | |
| 1659 | | static void winui_output_error(void *param, const char *format, va_list argptr) |
| 1660 | | { |
| 1661 | | char buffer[1024]; |
| 1662 | | |
| 1663 | | // if we are in fullscreen mode, go to windowed mode |
| 1664 | | if ((video_config.windowed == 0) && (win_window_list != NULL)) |
| 1665 | | winwindow_toggle_full_screen(); |
| 1666 | | |
| 1667 | | vsnprintf(buffer, ARRAY_LENGTH(buffer), format, argptr); |
| 1668 | | win_message_box_utf8(win_window_list ? win_window_list->hwnd : NULL, buffer, APPNAME, MB_OK); |
| 1669 | | } |
| 1670 | | |
| 1671 | | static void memory_error(const char *message) |
| 1672 | | { |
| 1673 | | win_message_box_utf8(hMain, message, APPNAME, MB_OK); |
| 1674 | | exit(-1); |
| 1675 | | } |
| 1676 | | |
| 1677 | | static BOOL Win32UI_init(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) |
| 1678 | | { |
| 1679 | | extern int mame_validitychecks(int game); |
| 1680 | | WNDCLASS wndclass; |
| 1681 | | RECT rect; |
| 1682 | | int i, nSplitterCount; |
| 1683 | | extern FOLDERDATA g_folderData[]; |
| 1684 | | extern FILTER_ITEM g_filterList[]; |
| 1685 | | extern const char *history_filename; |
| 1686 | | extern const char *mameinfo_filename; |
| 1687 | | LONG common_control_version = GetCommonControlVersion(); |
| 1688 | | int validity_failed = 0; |
| 1689 | | TCHAR* t_inpdir; |
| 1690 | | LONG_PTR l; |
| 1691 | | |
| 1692 | | dprintf("about to init options\n"); |
| 1693 | | if (!OptionsInit()) |
| 1694 | | return FALSE; |
| 1695 | | dprintf("options loaded\n"); |
| 1696 | | |
| 1697 | | srand((unsigned)time(NULL)); |
| 1698 | | |
| 1699 | | // output errors to message boxes |
| 1700 | | mame_set_output_channel(OUTPUT_CHANNEL_ERROR, winui_output_error, NULL, NULL, NULL); |
| 1701 | | |
| 1702 | | // create the memory pool |
| 1703 | | mame32_pool = pool_alloc(memory_error); |
| 1704 | | |
| 1705 | | // custom per-game icons |
| 1706 | | icon_index = pool_malloc(mame32_pool, sizeof(int) * driver_list_get_count(drivers)); |
| 1707 | | memset(icon_index, '\0', sizeof(int) * driver_list_get_count(drivers)); |
| 1708 | | |
| 1709 | | // sorted list of drivers by name |
| 1710 | | sorted_drivers = (driver_data_type *) pool_malloc(mame32_pool, sizeof(driver_data_type) * driver_list_get_count(drivers)); |
| 1711 | | memset(sorted_drivers, '\0', sizeof(driver_data_type) * driver_list_get_count(drivers)); |
| 1712 | | for (i = 0; i < driver_list_get_count(drivers); i++) |
| 1713 | | { |
| 1714 | | sorted_drivers[i].name = drivers[i]->name; |
| 1715 | | sorted_drivers[i].index = i; |
| 1716 | | } |
| 1717 | | qsort(sorted_drivers, driver_list_get_count(drivers), sizeof(driver_data_type), DriverDataCompareFunc); |
| 1718 | | |
| 1719 | | // set up window class |
| 1720 | | wndclass.style = CS_HREDRAW | CS_VREDRAW; |
| 1721 | | wndclass.lpfnWndProc = MameWindowProc; |
| 1722 | | wndclass.cbClsExtra = 0; |
| 1723 | | wndclass.cbWndExtra = DLGWINDOWEXTRA; |
| 1724 | | wndclass.hInstance = hInstance; |
| 1725 | | wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAME32_ICON)); |
| 1726 | | wndclass.hCursor = NULL; |
| 1727 | | wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); |
| 1728 | | wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_UI_MENU); |
| 1729 | | wndclass.lpszClassName = TEXT("MainClass"); |
| 1730 | | |
| 1731 | | RegisterClass(&wndclass); |
| 1732 | | |
| 1733 | | #ifdef MESS |
| 1734 | | DevView_RegisterClass(); |
| 1735 | | #endif //MESS |
| 1736 | | |
| 1737 | | InitCommonControls(); |
| 1738 | | |
| 1739 | | // Are we using an Old comctl32.dll? |
| 1740 | | dprintf("common controlversion %i %i",common_control_version >> 16, |
| 1741 | | common_control_version & 0xffff); |
| 1742 | | |
| 1743 | | oldControl = (common_control_version < PACKVERSION(4,71)); |
| 1744 | | xpControl = (common_control_version >= PACKVERSION(6,0)); |
| 1745 | | if (oldControl) |
| 1746 | | { |
| 1747 | | char buf[] = MAME32NAME " has detected an old version of comctl32.dll\n\n" |
| 1748 | | "Game Properties, many configuration options and\n" |
| 1749 | | "features are not available without an updated DLL\n\n" |
| 1750 | | "Please install the common control update found at:\n\n" |
| 1751 | | "http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp\n\n" |
| 1752 | | "Would you like to continue without using the new features?\n"; |
| 1753 | | |
| 1754 | | if (IDNO == win_message_box_utf8(0, buf, MAME32NAME " Outdated comctl32.dll Warning", MB_YESNO | MB_ICONWARNING)) |
| 1755 | | return FALSE; |
| 1756 | | } |
| 1757 | | |
| 1758 | | g_mame32_message = RegisterWindowMessage(TEXT("MAME32")); |
| 1759 | | g_bDoBroadcast = GetBroadcast(); |
| 1760 | | |
| 1761 | | HelpInit(); |
| 1762 | | |
| 1763 | | t_inpdir = tstring_from_utf8(GetInpDir()); |
| 1764 | | if( ! t_inpdir ) |
| 1765 | | return FALSE; |
| 1766 | | |
| 1767 | | _tcscpy(last_directory,t_inpdir); |
| 1768 | | free(t_inpdir); |
| 1769 | | hMain = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MAIN), 0, NULL); |
| 1770 | | if (hMain == NULL) |
| 1771 | | { |
| 1772 | | dprintf("error creating main dialog, aborting"); |
| 1773 | | return FALSE; |
| 1774 | | } |
| 1775 | | |
| 1776 | | s_pWatcher = DirWatcher_Init(hMain, WM_MAME32_FILECHANGED); |
| 1777 | | if (s_pWatcher) |
| 1778 | | { |
| 1779 | | DirWatcher_Watch(s_pWatcher, 0, GetRomDirs(), TRUE); |
| 1780 | | DirWatcher_Watch(s_pWatcher, 1, GetSampleDirs(), TRUE); |
| 1781 | | } |
| 1782 | | |
| 1783 | | SetMainTitle(); |
| 1784 | | hTabCtrl = GetDlgItem(hMain, IDC_SSTAB); |
| 1785 | | |
| 1786 | | { |
| 1787 | | struct TabViewOptions opts; |
| 1788 | | |
| 1789 | | static struct TabViewCallbacks s_tabviewCallbacks = |
| 1790 | | { |
| 1791 | | GetShowTabCtrl, // pfnGetShowTabCtrl |
| 1792 | | SetCurrentTab, // pfnSetCurrentTab |
| 1793 | | GetCurrentTab, // pfnGetCurrentTab |
| 1794 | | SetShowTab, // pfnSetShowTab |
| 1795 | | GetShowTab, // pfnGetShowTab |
| 1796 | | |
| 1797 | | GetImageTabShortName, // pfnGetTabShortName |
| 1798 | | GetImageTabLongName, // pfnGetTabLongName |
| 1799 | | UpdateScreenShot // pfnOnSelectionChanged |
| 1800 | | }; |
| 1801 | | |
| 1802 | | memset(&opts, 0, sizeof(opts)); |
| 1803 | | opts.pCallbacks = &s_tabviewCallbacks; |
| 1804 | | opts.nTabCount = MAX_TAB_TYPES; |
| 1805 | | |
| 1806 | | if (!SetupTabView(hTabCtrl, &opts)) |
| 1807 | | return FALSE; |
| 1808 | | } |
| 1809 | | |
| 1810 | | /* subclass history window */ |
| 1811 | | l = GetWindowLongPtr(GetDlgItem(hMain, IDC_HISTORY), GWLP_WNDPROC); |
| 1812 | | g_lpHistoryWndProc = (WNDPROC)l; |
| 1813 | | SetWindowLongPtr(GetDlgItem(hMain, IDC_HISTORY), GWLP_WNDPROC, (LONG_PTR)HistoryWndProc); |
| 1814 | | |
| 1815 | | /* subclass picture frame area */ |
| 1816 | | l = GetWindowLongPtr(GetDlgItem(hMain, IDC_SSFRAME), GWLP_WNDPROC); |
| 1817 | | g_lpPictureFrameWndProc = (WNDPROC)l; |
| 1818 | | SetWindowLongPtr(GetDlgItem(hMain, IDC_SSFRAME), GWLP_WNDPROC, (LONG_PTR)PictureFrameWndProc); |
| 1819 | | |
| 1820 | | /* subclass picture area */ |
| 1821 | | l = GetWindowLongPtr(GetDlgItem(hMain, IDC_SSPICTURE), GWLP_WNDPROC); |
| 1822 | | g_lpPictureWndProc = (WNDPROC)l; |
| 1823 | | SetWindowLongPtr(GetDlgItem(hMain, IDC_SSPICTURE), GWLP_WNDPROC, (LONG_PTR)PictureWndProc); |
| 1824 | | |
| 1825 | | /* Load the pic for the default screenshot. */ |
| 1826 | | hMissing_bitmap = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_ABOUT)); |
| 1827 | | |
| 1828 | | /* Stash hInstance for later use */ |
| 1829 | | hInst = hInstance; |
| 1830 | | |
| 1831 | | hToolBar = InitToolbar(hMain); |
| 1832 | | hStatusBar = InitStatusBar(hMain); |
| 1833 | | hProgWnd = InitProgressBar(hStatusBar); |
| 1834 | | |
| 1835 | | main_resize_items[0].u.hwnd = hToolBar; |
| 1836 | | main_resize_items[1].u.hwnd = hStatusBar; |
| 1837 | | |
| 1838 | | /* In order to handle 'Large Fonts' as the Windows |
| 1839 | | * default setting, we need to make the dialogs small |
| 1840 | | * enough to fit in our smallest window size with |
| 1841 | | * large fonts, then resize the picker, tab and button |
| 1842 | | * controls to fill the window, no matter which font |
| 1843 | | * is currently set. This will still look like bad |
| 1844 | | * if the user uses a bigger default font than 125% |
| 1845 | | * (Large Fonts) on the Windows display setting tab. |
| 1846 | | * |
| 1847 | | * NOTE: This has to do with Windows default font size |
| 1848 | | * settings, NOT our picker font size. |
| 1849 | | */ |
| 1850 | | |
| 1851 | | GetClientRect(hMain, &rect); |
| 1852 | | |
| 1853 | | hTreeView = GetDlgItem(hMain, IDC_TREE); |
| 1854 | | hwndList = GetDlgItem(hMain, IDC_LIST); |
| 1855 | | |
| 1856 | | history_filename = mame_strdup(GetHistoryFileName()); |
| 1857 | | mameinfo_filename = mame_strdup(GetMAMEInfoFileName()); |
| 1858 | | |
| 1859 | | if (!InitSplitters()) |
| 1860 | | return FALSE; |
| 1861 | | |
| 1862 | | nSplitterCount = GetSplitterCount(); |
| 1863 | | for (i = 0; i < nSplitterCount; i++) |
| 1864 | | { |
| 1865 | | HWND hWnd; |
| 1866 | | HWND hWndLeft; |
| 1867 | | HWND hWndRight; |
| 1868 | | |
| 1869 | | hWnd = GetDlgItem(hMain, g_splitterInfo[i].nSplitterWindow); |
| 1870 | | hWndLeft = GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow); |
| 1871 | | hWndRight = GetDlgItem(hMain, g_splitterInfo[i].nRightWindow); |
| 1872 | | |
| 1873 | | AddSplitter(hWnd, hWndLeft, hWndRight, g_splitterInfo[i].pfnAdjust); |
| 1874 | | } |
| 1875 | | |
| 1876 | | /* Initial adjustment of controls on the Picker window */ |
| 1877 | | ResizePickerControls(hMain); |
| 1878 | | |
| 1879 | | TabView_UpdateSelection(hTabCtrl); |
| 1880 | | |
| 1881 | | bDoGameCheck = GetGameCheck(); |
| 1882 | | idle_work = TRUE; |
| 1883 | | game_index = 0; |
| 1884 | | |
| 1885 | | bShowTree = GetShowFolderList(); |
| 1886 | | bShowToolBar = GetShowToolBar(); |
| 1887 | | bShowStatusBar = GetShowStatusBar(); |
| 1888 | | bShowTabCtrl = GetShowTabCtrl(); |
| 1889 | | |
| 1890 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED); |
| 1891 | | ToolBar_CheckButton(hToolBar, ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED); |
| 1892 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED); |
| 1893 | | ShowWindow(hToolBar, (bShowToolBar) ? SW_SHOW : SW_HIDE); |
| 1894 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED); |
| 1895 | | ShowWindow(hStatusBar, (bShowStatusBar) ? SW_SHOW : SW_HIDE); |
| 1896 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_PAGETAB, (bShowTabCtrl) ? MF_CHECKED : MF_UNCHECKED); |
| 1897 | | |
| 1898 | | if (oldControl) |
| 1899 | | { |
| 1900 | | EnableMenuItem(GetMenu(hMain), ID_CUSTOMIZE_FIELDS, MF_GRAYED); |
| 1901 | | EnableMenuItem(GetMenu(hMain), ID_GAME_PROPERTIES, MF_GRAYED); |
| 1902 | | EnableMenuItem(GetMenu(hMain), ID_OPTIONS_DEFAULTS, MF_GRAYED); |
| 1903 | | } |
| 1904 | | |
| 1905 | | /* Init DirectDraw */ |
| 1906 | | if (!DirectDraw_Initialize()) |
| 1907 | | { |
| 1908 | | DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_DIRECTX), NULL, DirectXDialogProc); |
| 1909 | | return FALSE; |
| 1910 | | } |
| 1911 | | |
| 1912 | | if (GetRandomBackground()) |
| 1913 | | RandomSelectBackground(); |
| 1914 | | |
| 1915 | | LoadBackgroundBitmap(); |
| 1916 | | |
| 1917 | | dprintf("about to init tree"); |
| 1918 | | InitTree(g_folderData, g_filterList); |
| 1919 | | dprintf("did init tree"); |
| 1920 | | |
| 1921 | | /* Initialize listview columns */ |
| 1922 | | #ifdef MESS |
| 1923 | | InitMessPicker(); |
| 1924 | | #endif |
| 1925 | | InitListView(); |
| 1926 | | SetFocus(hwndList); |
| 1927 | | |
| 1928 | | /* Reset the font */ |
| 1929 | | { |
| 1930 | | LOGFONT logfont; |
| 1931 | | |
| 1932 | | GetListFont(&logfont); |
| 1933 | | hFont = CreateFontIndirect(&logfont); |
| 1934 | | if (hFont != NULL) |
| 1935 | | SetAllWindowsFont(hMain, &main_resize, hFont, FALSE); |
| 1936 | | } |
| 1937 | | |
| 1938 | | /* Init DirectInput */ |
| 1939 | | if (!DirectInputInitialize()) |
| 1940 | | { |
| 1941 | | DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_DIRECTX), NULL, DirectXDialogProc); |
| 1942 | | return FALSE; |
| 1943 | | } |
| 1944 | | |
| 1945 | | AdjustMetrics(); |
| 1946 | | UpdateScreenShot(); |
| 1947 | | |
| 1948 | | hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_TAB_KEYS)); |
| 1949 | | |
| 1950 | | /* clear keyboard state */ |
| 1951 | | KeyboardStateClear(); |
| 1952 | | |
| 1953 | | for (i = 0; i < NUM_GUI_SEQUENCES; i++) |
| 1954 | | { |
| 1955 | | input_seq *is1; |
| 1956 | | input_seq *is2; |
| 1957 | | is1 = &(GUISequenceControl[i].is); |
| 1958 | | is2 = GUISequenceControl[i].getiniptr(); |
| 1959 | | // FIXME |
| 1960 | | //input_seq_copy(is1, is2); |
| 1961 | | //dprintf("seq =%s is: %4i %4i %4i %4i\n",GUISequenceControl[i].name, (*is1)[0], (*is1)[1], (*is1)[2], (*is1)[3]); |
| 1962 | | } |
| 1963 | | |
| 1964 | | if (GetJoyGUI() == TRUE) |
| 1965 | | { |
| 1966 | | g_pJoyGUI = &DIJoystick; |
| 1967 | | if (g_pJoyGUI->init() != 0) |
| 1968 | | g_pJoyGUI = NULL; |
| 1969 | | else |
| 1970 | | SetTimer(hMain, JOYGUI_TIMER, JOYGUI_MS, NULL); |
| 1971 | | } |
| 1972 | | else |
| 1973 | | g_pJoyGUI = NULL; |
| 1974 | | |
| 1975 | | if (GetHideMouseOnStartup()) |
| 1976 | | { |
| 1977 | | /* For some reason the mouse is centered when a game is exited, which of |
| 1978 | | course causes a WM_MOUSEMOVE event that shows the mouse. So we center |
| 1979 | | it now, before the startup coords are initilized, and that way the mouse |
| 1980 | | will still be hidden when exiting from a game (i hope) :) |
| 1981 | | */ |
| 1982 | | SetCursorPos(GetSystemMetrics(SM_CXSCREEN)/2,GetSystemMetrics(SM_CYSCREEN)/2); |
| 1983 | | |
| 1984 | | // Then hide it |
| 1985 | | ShowCursor(FALSE); |
| 1986 | | } |
| 1987 | | |
| 1988 | | dprintf("about to show window\n"); |
| 1989 | | |
| 1990 | | nCmdShow = GetWindowState(); |
| 1991 | | if (nCmdShow == SW_HIDE || nCmdShow == SW_MINIMIZE || nCmdShow == SW_SHOWMINIMIZED) |
| 1992 | | { |
| 1993 | | nCmdShow = SW_RESTORE; |
| 1994 | | } |
| 1995 | | |
| 1996 | | if (GetRunFullScreen()) |
| 1997 | | { |
| 1998 | | LONG lMainStyle; |
| 1999 | | |
| 2000 | | // Remove menu |
| 2001 | | SetMenu(hMain,NULL); |
| 2002 | | |
| 2003 | | // Frameless dialog (fake fullscreen) |
| 2004 | | lMainStyle = GetWindowLong(hMain, GWL_STYLE); |
| 2005 | | lMainStyle = lMainStyle & (WS_BORDER ^ 0xffffffff); |
| 2006 | | SetWindowLong(hMain, GWL_STYLE, lMainStyle); |
| 2007 | | |
| 2008 | | nCmdShow = SW_MAXIMIZE; |
| 2009 | | } |
| 2010 | | |
| 2011 | | ShowWindow(hMain, nCmdShow); |
| 2012 | | |
| 2013 | | |
| 2014 | | switch (GetViewMode()) |
| 2015 | | { |
| 2016 | | case VIEW_LARGE_ICONS : |
| 2017 | | SetView(ID_VIEW_LARGE_ICON); |
| 2018 | | break; |
| 2019 | | case VIEW_SMALL_ICONS : |
| 2020 | | SetView(ID_VIEW_SMALL_ICON); |
| 2021 | | break; |
| 2022 | | case VIEW_INLIST : |
| 2023 | | SetView(ID_VIEW_LIST_MENU); |
| 2024 | | break; |
| 2025 | | case VIEW_REPORT : |
| 2026 | | SetView(ID_VIEW_DETAIL); |
| 2027 | | break; |
| 2028 | | case VIEW_GROUPED : |
| 2029 | | default : |
| 2030 | | SetView(ID_VIEW_GROUPED); |
| 2031 | | break; |
| 2032 | | } |
| 2033 | | |
| 2034 | | if (GetCycleScreenshot() > 0) |
| 2035 | | { |
| 2036 | | SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL); //scale to Seconds |
| 2037 | | } |
| 2038 | | |
| 2039 | | if (validity_failed) |
| 2040 | | { |
| 2041 | | win_message_box_utf8(hMain, MAMENAME " has failed its validity checks. The GUI will " |
| 2042 | | "still work, but emulations will fail to execute", MAMENAME, MB_OK); |
| 2043 | | } |
| 2044 | | |
| 2045 | | return TRUE; |
| 2046 | | } |
| 2047 | | |
| 2048 | | |
| 2049 | | static void Win32UI_exit() |
| 2050 | | { |
| 2051 | | if (g_bDoBroadcast == TRUE) |
| 2052 | | { |
| 2053 | | ATOM a = GlobalAddAtom(TEXT("")); |
| 2054 | | SendMessage(HWND_BROADCAST, g_mame32_message, a, a); |
| 2055 | | GlobalDeleteAtom(a); |
| 2056 | | } |
| 2057 | | |
| 2058 | | if (g_pJoyGUI != NULL) |
| 2059 | | g_pJoyGUI->exit(); |
| 2060 | | |
| 2061 | | /* Free GDI resources */ |
| 2062 | | |
| 2063 | | if (hMissing_bitmap) |
| 2064 | | { |
| 2065 | | DeleteObject(hMissing_bitmap); |
| 2066 | | hMissing_bitmap = NULL; |
| 2067 | | } |
| 2068 | | |
| 2069 | | if (hBackground) |
| 2070 | | { |
| 2071 | | DeleteObject(hBackground); |
| 2072 | | hBackground = NULL; |
| 2073 | | } |
| 2074 | | |
| 2075 | | if (hPALbg) |
| 2076 | | { |
| 2077 | | DeleteObject(hPALbg); |
| 2078 | | hPALbg = NULL; |
| 2079 | | } |
| 2080 | | |
| 2081 | | if (hFont) |
| 2082 | | { |
| 2083 | | DeleteObject(hFont); |
| 2084 | | hFont = NULL; |
| 2085 | | } |
| 2086 | | |
| 2087 | | DestroyIcons(); |
| 2088 | | |
| 2089 | | DestroyAcceleratorTable(hAccel); |
| 2090 | | |
| 2091 | | DirectInputClose(); |
| 2092 | | DirectDraw_Close(); |
| 2093 | | |
| 2094 | | SetSavedFolderID(GetCurrentFolderID()); |
| 2095 | | |
| 2096 | | SaveOptions(); |
| 2097 | | |
| 2098 | | FreeFolders(); |
| 2099 | | |
| 2100 | | /* DestroyTree(hTreeView); */ |
| 2101 | | |
| 2102 | | FreeScreenShot(); |
| 2103 | | |
| 2104 | | OptionsExit(); |
| 2105 | | |
| 2106 | | HelpExit(); |
| 2107 | | |
| 2108 | | pool_free(mame32_pool); |
| 2109 | | mame32_pool = NULL; |
| 2110 | | } |
| 2111 | | |
| 2112 | | static LRESULT CALLBACK MameWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
| 2113 | | { |
| 2114 | | MINMAXINFO *mminfo; |
| 2115 | | int i; |
| 2116 | | TCHAR szClass[128]; |
| 2117 | | |
| 2118 | | switch (message) |
| 2119 | | { |
| 2120 | | case WM_CTLCOLORSTATIC: |
| 2121 | | if (hBackground && (HWND)lParam == GetDlgItem(hMain, IDC_HISTORY)) |
| 2122 | | { |
| 2123 | | static HBRUSH hBrush=0; |
| 2124 | | HDC hDC=(HDC)wParam; |
| 2125 | | LOGBRUSH lb; |
| 2126 | | |
| 2127 | | if (hBrush) |
| 2128 | | DeleteObject(hBrush); |
| 2129 | | lb.lbStyle = BS_HOLLOW; |
| 2130 | | hBrush = CreateBrushIndirect(&lb); |
| 2131 | | SetBkMode(hDC, TRANSPARENT); |
| 2132 | | SetTextColor(hDC, GetListFontColor()); |
| 2133 | | return (LRESULT) hBrush; |
| 2134 | | } |
| 2135 | | break; |
| 2136 | | |
| 2137 | | case WM_INITDIALOG: |
| 2138 | | /* Initialize info for resizing subitems */ |
| 2139 | | GetClientRect(hWnd, &main_resize.rect); |
| 2140 | | return TRUE; |
| 2141 | | |
| 2142 | | case WM_SETFOCUS: |
| 2143 | | SetFocus(hwndList); |
| 2144 | | break; |
| 2145 | | |
| 2146 | | case WM_SETTINGCHANGE: |
| 2147 | | AdjustMetrics(); |
| 2148 | | return 0; |
| 2149 | | |
| 2150 | | case WM_SIZE: |
| 2151 | | OnSize(hWnd, wParam, LOWORD(lParam), HIWORD(wParam)); |
| 2152 | | return TRUE; |
| 2153 | | |
| 2154 | | case WM_MENUSELECT: |
| 2155 | | return Statusbar_MenuSelect(hWnd, wParam, lParam); |
| 2156 | | |
| 2157 | | case MM_PLAY_GAME: |
| 2158 | | MamePlayGame(); |
| 2159 | | return TRUE; |
| 2160 | | |
| 2161 | | case WM_INITMENUPOPUP: |
| 2162 | | UpdateMenu(GetMenu(hWnd)); |
| 2163 | | break; |
| 2164 | | |
| 2165 | | case WM_CONTEXTMENU: |
| 2166 | | if (HandleTreeContextMenu(hWnd, wParam, lParam) |
| 2167 | | || HandleScreenShotContextMenu(hWnd, wParam, lParam)) |
| 2168 | | return FALSE; |
| 2169 | | break; |
| 2170 | | |
| 2171 | | case WM_COMMAND: |
| 2172 | | return MameCommand(hWnd,(int)(LOWORD(wParam)),(HWND)(lParam),(UINT)HIWORD(wParam)); |
| 2173 | | |
| 2174 | | case WM_GETMINMAXINFO: |
| 2175 | | /* Don't let the window get too small; it can break resizing */ |
| 2176 | | mminfo = (MINMAXINFO *) lParam; |
| 2177 | | mminfo->ptMinTrackSize.x = MIN_WIDTH; |
| 2178 | | mminfo->ptMinTrackSize.y = MIN_HEIGHT; |
| 2179 | | return 0; |
| 2180 | | |
| 2181 | | case WM_TIMER: |
| 2182 | | switch (wParam) |
| 2183 | | { |
| 2184 | | case JOYGUI_TIMER: |
| 2185 | | PollGUIJoystick(); |
| 2186 | | break; |
| 2187 | | case SCREENSHOT_TIMER: |
| 2188 | | TabView_CalculateNextTab(hTabCtrl); |
| 2189 | | UpdateScreenShot(); |
| 2190 | | TabView_UpdateSelection(hTabCtrl); |
| 2191 | | break; |
| 2192 | | default: |
| 2193 | | break; |
| 2194 | | } |
| 2195 | | return TRUE; |
| 2196 | | |
| 2197 | | case WM_CLOSE: |
| 2198 | | { |
| 2199 | | /* save current item */ |
| 2200 | | RECT rect; |
| 2201 | | AREA area; |
| 2202 | | int nItem; |
| 2203 | | WINDOWPLACEMENT wndpl; |
| 2204 | | UINT state; |
| 2205 | | |
| 2206 | | wndpl.length = sizeof(WINDOWPLACEMENT); |
| 2207 | | GetWindowPlacement(hMain, &wndpl); |
| 2208 | | state = wndpl.showCmd; |
| 2209 | | |
| 2210 | | /* Restore the window before we attempt to save parameters, |
| 2211 | | * This fixed the lost window on startup problem, among other problems |
| 2212 | | */ |
| 2213 | | if (state == SW_MINIMIZE || state == SW_SHOWMINIMIZED || state == SW_MAXIMIZE) |
| 2214 | | { |
| 2215 | | if( wndpl.flags & WPF_RESTORETOMAXIMIZED || state == SW_MAXIMIZE) |
| 2216 | | state = SW_MAXIMIZE; |
| 2217 | | else |
| 2218 | | { |
| 2219 | | state = SW_RESTORE; |
| 2220 | | ShowWindow(hWnd, SW_RESTORE); |
| 2221 | | } |
| 2222 | | } |
| 2223 | | for (i = 0; i < GetSplitterCount(); i++) |
| 2224 | | SetSplitterPos(i, nSplitterOffset[i]); |
| 2225 | | SetWindowState(state); |
| 2226 | | |
| 2227 | | for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++) |
| 2228 | | Picker_SaveColumnWidths(GetDlgItem(hMain, s_nPickers[i])); |
| 2229 | | |
| 2230 | | GetWindowRect(hWnd, &rect); |
| 2231 | | area.x = rect.left; |
| 2232 | | area.y = rect.top; |
| 2233 | | area.width = rect.right - rect.left; |
| 2234 | | area.height = rect.bottom - rect.top; |
| 2235 | | SetWindowArea(&area); |
| 2236 | | |
| 2237 | | /* Save the users current game options and default game */ |
| 2238 | | nItem = Picker_GetSelectedItem(hwndList); |
| 2239 | | SetDefaultGame(ModifyThe(drivers[nItem]->name)); |
| 2240 | | |
| 2241 | | /* hide window to prevent orphan empty rectangles on the taskbar */ |
| 2242 | | /* ShowWindow(hWnd,SW_HIDE); */ |
| 2243 | | DestroyWindow( hWnd ); |
| 2244 | | |
| 2245 | | /* PostQuitMessage(0); */ |
| 2246 | | break; |
| 2247 | | } |
| 2248 | | |
| 2249 | | case WM_DESTROY: |
| 2250 | | PostQuitMessage(0); |
| 2251 | | return 0; |
| 2252 | | |
| 2253 | | case WM_LBUTTONDOWN: |
| 2254 | | OnLButtonDown(hWnd, (UINT)wParam, MAKEPOINTS(lParam)); |
| 2255 | | break; |
| 2256 | | |
| 2257 | | /* |
| 2258 | | Check to see if the mouse has been moved by the user since |
| 2259 | | startup. I'd like this checking to be done only in the |
| 2260 | | main WinProc (here), but somehow the WM_MOUSEDOWN messages |
| 2261 | | are eaten up before they reach MameWindowProc. That's why |
| 2262 | | there is one check for each of the subclassed windows too. |
| 2263 | | |
| 2264 | | POSSIBLE BUGS: |
| 2265 | | I've included this check in the subclassed windows, but a |
| 2266 | | mose move in either the title bar, the menu, or the |
| 2267 | | toolbar will not generate a WM_MOUSEOVER message. At least |
| 2268 | | not one that I know how to pick up. A solution could maybe |
| 2269 | | be to subclass those too, but that's too much work :) |
| 2270 | | */ |
| 2271 | | |
| 2272 | | case WM_MOUSEMOVE: |
| 2273 | | { |
| 2274 | | if (MouseHasBeenMoved()) |
| 2275 | | ShowCursor(TRUE); |
| 2276 | | |
| 2277 | | if (g_listview_dragging) |
| 2278 | | MouseMoveListViewDrag(MAKEPOINTS(lParam)); |
| 2279 | | else |
| 2280 | | /* for splitters */ |
| 2281 | | OnMouseMove(hWnd, (UINT)wParam, MAKEPOINTS(lParam)); |
| 2282 | | break; |
| 2283 | | } |
| 2284 | | |
| 2285 | | case WM_LBUTTONUP: |
| 2286 | | if (g_listview_dragging) |
| 2287 | | ButtonUpListViewDrag(MAKEPOINTS(lParam)); |
| 2288 | | else |
| 2289 | | /* for splitters */ |
| 2290 | | OnLButtonUp(hWnd, (UINT)wParam, MAKEPOINTS(lParam)); |
| 2291 | | break; |
| 2292 | | |
| 2293 | | case WM_NOTIFY: |
| 2294 | | /* Where is this message intended to go */ |
| 2295 | | { |
| 2296 | | LPNMHDR lpNmHdr = (LPNMHDR)lParam; |
| 2297 | | |
| 2298 | | /* Fetch tooltip text */ |
| 2299 | | if (lpNmHdr->code == TTN_NEEDTEXT) |
| 2300 | | { |
| 2301 | | LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT)lParam; |
| 2302 | | CopyToolTipText(lpttt); |
| 2303 | | } |
| 2304 | | |
| 2305 | | if (lpNmHdr->hwndFrom == hTreeView) |
| 2306 | | return TreeViewNotify(lpNmHdr); |
| 2307 | | |
| 2308 | | GetClassName(lpNmHdr->hwndFrom, szClass, sizeof(szClass) / sizeof(szClass[0])); |
| 2309 | | if (!_tcscmp(szClass, TEXT("SysListView32"))) |
| 2310 | | return Picker_HandleNotify(lpNmHdr); |
| 2311 | | if (!_tcscmp(szClass, TEXT("SysTabControl32"))) |
| 2312 | | return TabView_HandleNotify(lpNmHdr); |
| 2313 | | } |
| 2314 | | break; |
| 2315 | | |
| 2316 | | case WM_DRAWITEM: |
| 2317 | | { |
| 2318 | | LPDRAWITEMSTRUCT lpDis = (LPDRAWITEMSTRUCT)lParam; |
| 2319 | | |
| 2320 | | GetClassName(lpDis->hwndItem, szClass, sizeof(szClass) / sizeof(szClass[0])); |
| 2321 | | if (!_tcscmp(szClass, TEXT("SysListView32"))) |
| 2322 | | Picker_HandleDrawItem(GetDlgItem(hMain, lpDis->CtlID), lpDis); |
| 2323 | | } |
| 2324 | | break; |
| 2325 | | |
| 2326 | | case WM_MEASUREITEM : |
| 2327 | | { |
| 2328 | | LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam; |
| 2329 | | |
| 2330 | | // tell the list view that each row (item) should be just taller than our font |
| 2331 | | |
| 2332 | | //DefWindowProc(hWnd, message, wParam, lParam); |
| 2333 | | //dprintf("default row height calculation gives %u\n",lpmis->itemHeight); |
| 2334 | | |
| 2335 | | TEXTMETRIC tm; |
| 2336 | | HDC hDC = GetDC(NULL); |
| 2337 | | HFONT hFontOld = (HFONT)SelectObject(hDC,hFont); |
| 2338 | | |
| 2339 | | GetTextMetrics(hDC,&tm); |
| 2340 | | |
| 2341 | | lpmis->itemHeight = tm.tmHeight + tm.tmExternalLeading + 1; |
| 2342 | | if (lpmis->itemHeight < 17) |
| 2343 | | lpmis->itemHeight = 17; |
| 2344 | | //dprintf("we would do %u\n",tm.tmHeight + tm.tmExternalLeading + 1); |
| 2345 | | SelectObject(hDC,hFontOld); |
| 2346 | | ReleaseDC(NULL,hDC); |
| 2347 | | |
| 2348 | | return TRUE; |
| 2349 | | } |
| 2350 | | |
| 2351 | | case WM_MAME32_FILECHANGED: |
| 2352 | | { |
| 2353 | | char szFileName[32]; |
| 2354 | | char *s; |
| 2355 | | int nGameIndex; |
| 2356 | | int (*pfnGetAuditResults)(int driver_index) = NULL; |
| 2357 | | void (*pfnSetAuditResults)(int driver_index, int audit_results) = NULL; |
| 2358 | | |
| 2359 | | switch(HIWORD(wParam)) |
| 2360 | | { |
| 2361 | | case 0: |
| 2362 | | pfnGetAuditResults = GetRomAuditResults; |
| 2363 | | pfnSetAuditResults = SetRomAuditResults; |
| 2364 | | break; |
| 2365 | | |
| 2366 | | case 1: |
| 2367 | | pfnGetAuditResults = GetSampleAuditResults; |
| 2368 | | pfnSetAuditResults = SetSampleAuditResults; |
| 2369 | | break; |
| 2370 | | } |
| 2371 | | |
| 2372 | | if (pfnGetAuditResults && pfnSetAuditResults) |
| 2373 | | { |
| 2374 | | int nParentIndex = -1; |
| 2375 | | |
| 2376 | | snprintf(szFileName, sizeof(szFileName), "%s", (LPCSTR) lParam); |
| 2377 | | s = strchr(szFileName, '.'); |
| 2378 | | if (s) |
| 2379 | | *s = '\0'; |
| 2380 | | s = strchr(szFileName, '\\'); |
| 2381 | | if (s) |
| 2382 | | *s = '\0'; |
| 2383 | | |
| 2384 | | for (nGameIndex = 0; drivers[nGameIndex]; nGameIndex++) |
| 2385 | | { |
| 2386 | | for (nParentIndex = nGameIndex; nGameIndex == -1; nParentIndex = GetParentIndex(drivers[nParentIndex])) |
| 2387 | | { |
| 2388 | | if (!mame_stricmp(drivers[nParentIndex]->name, szFileName)) |
| 2389 | | { |
| 2390 | | if (pfnGetAuditResults(nGameIndex) != UNKNOWN) |
| 2391 | | { |
| 2392 | | pfnSetAuditResults(nGameIndex, UNKNOWN); |
| 2393 | | PostMessage(hMain, WM_MAME32_AUDITGAME, wParam, nGameIndex); |
| 2394 | | } |
| 2395 | | break; |
| 2396 | | } |
| 2397 | | } |
| 2398 | | } |
| 2399 | | } |
| 2400 | | } |
| 2401 | | break; |
| 2402 | | |
| 2403 | | case WM_MAME32_AUDITGAME: |
| 2404 | | { |
| 2405 | | LV_FINDINFO lvfi; |
| 2406 | | int nGameIndex; |
| 2407 | | |
| 2408 | | nGameIndex = lParam; |
| 2409 | | |
| 2410 | | switch(HIWORD(wParam)) |
| 2411 | | { |
| 2412 | | case 0: |
| 2413 | | Mame32VerifyRomSet(nGameIndex); |
| 2414 | | break; |
| 2415 | | case 1: |
| 2416 | | Mame32VerifySampleSet(nGameIndex); |
| 2417 | | break; |
| 2418 | | } |
| 2419 | | |
| 2420 | | memset(&lvfi, 0, sizeof(lvfi)); |
| 2421 | | lvfi.flags = LVFI_PARAM; |
| 2422 | | lvfi.lParam = nGameIndex; |
| 2423 | | |
| 2424 | | i = ListView_FindItem(hwndList, -1, &lvfi); |
| 2425 | | if (i != -1) |
| 2426 | | { |
| 2427 | | ListView_RedrawItems(hwndList, i, i); |
| 2428 | | } |
| 2429 | | } |
| 2430 | | break; |
| 2431 | | |
| 2432 | | default: |
| 2433 | | |
| 2434 | | break; |
| 2435 | | } |
| 2436 | | |
| 2437 | | return DefWindowProc(hWnd, message, wParam, lParam); |
| 2438 | | } |
| 2439 | | |
| 2440 | | static int HandleKeyboardGUIMessage(HWND hWnd, UINT message, UINT wParam, LONG lParam) |
| 2441 | | { |
| 2442 | | switch (message) |
| 2443 | | { |
| 2444 | | case WM_CHAR: /* List-View controls use this message for searching the items "as user types" */ |
| 2445 | | //MessageBox(NULL,"wm_char message arrived","TitleBox",MB_OK); |
| 2446 | | return TRUE; |
| 2447 | | |
| 2448 | | case WM_KEYDOWN: |
| 2449 | | KeyboardKeyDown(0, wParam, lParam); |
| 2450 | | return TRUE; |
| 2451 | | |
| 2452 | | case WM_KEYUP: |
| 2453 | | KeyboardKeyUp(0, wParam, lParam); |
| 2454 | | return TRUE; |
| 2455 | | |
| 2456 | | case WM_SYSKEYDOWN: |
| 2457 | | KeyboardKeyDown(1, wParam, lParam); |
| 2458 | | return TRUE; |
| 2459 | | |
| 2460 | | case WM_SYSKEYUP: |
| 2461 | | KeyboardKeyUp(1, wParam, lParam); |
| 2462 | | return TRUE; |
| 2463 | | } |
| 2464 | | |
| 2465 | | return FALSE; /* message not processed */ |
| 2466 | | } |
| 2467 | | |
| 2468 | | static BOOL PumpMessage() |
| 2469 | | { |
| 2470 | | MSG msg; |
| 2471 | | |
| 2472 | | if (!GetMessage(&msg, NULL, 0, 0)) |
| 2473 | | { |
| 2474 | | return FALSE; |
| 2475 | | } |
| 2476 | | |
| 2477 | | if (IsWindow(hMain)) |
| 2478 | | { |
| 2479 | | BOOL absorbed_key = FALSE; |
| 2480 | | if (GetKeyGUI()) |
| 2481 | | absorbed_key = HandleKeyboardGUIMessage(msg.hwnd, msg.message, |
| 2482 | | msg.wParam, msg.lParam); |
| 2483 | | else |
| 2484 | | absorbed_key = TranslateAccelerator(hMain, hAccel, &msg); |
| 2485 | | |
| 2486 | | if (!absorbed_key) |
| 2487 | | { |
| 2488 | | if (!IsDialogMessage(hMain, &msg)) |
| 2489 | | { |
| 2490 | | TranslateMessage(&msg); |
| 2491 | | DispatchMessage(&msg); |
| 2492 | | } |
| 2493 | | } |
| 2494 | | } |
| 2495 | | |
| 2496 | | return TRUE; |
| 2497 | | } |
| 2498 | | |
| 2499 | | static BOOL FolderCheck(void) |
| 2500 | | { |
| 2501 | | |
| 2502 | | char *pDescription = NULL; |
| 2503 | | int nGameIndex = 0; |
| 2504 | | int i=0; |
| 2505 | | int iStep = 0; |
| 2506 | | LV_FINDINFO lvfi; |
| 2507 | | int nCount = ListView_GetItemCount(hwndList); |
| 2508 | | BOOL changed = FALSE; |
| 2509 | | |
| 2510 | | MSG msg; |
| 2511 | | for(i=0; i<nCount;i++) |
| 2512 | | { |
| 2513 | | LV_ITEM lvi; |
| 2514 | | |
| 2515 | | lvi.iItem = i; |
| 2516 | | lvi.iSubItem = 0; |
| 2517 | | lvi.mask = LVIF_PARAM; |
| 2518 | | ListView_GetItem(hwndList, &lvi); |
| 2519 | | nGameIndex = lvi.lParam; |
| 2520 | | SetRomAuditResults(nGameIndex, UNKNOWN); |
| 2521 | | SetSampleAuditResults(nGameIndex, UNKNOWN); |
| 2522 | | } |
| 2523 | | if( nCount > 0) |
| 2524 | | ProgressBarShow(); |
| 2525 | | else |
| 2526 | | return FALSE; |
| 2527 | | if( nCount < 100 ) |
| 2528 | | iStep = 100 / nCount; |
| 2529 | | else |
| 2530 | | iStep = nCount/100; |
| 2531 | | UpdateListView(); |
| 2532 | | UpdateWindow(hMain); |
| 2533 | | for(i=0; i<nCount;i++) |
| 2534 | | { |
| 2535 | | LV_ITEM lvi; |
| 2536 | | |
| 2537 | | lvi.iItem = i; |
| 2538 | | lvi.iSubItem = 0; |
| 2539 | | lvi.mask = LVIF_PARAM; |
| 2540 | | ListView_GetItem(hwndList, &lvi); |
| 2541 | | nGameIndex = lvi.lParam; |
| 2542 | | if (GetRomAuditResults(nGameIndex) == UNKNOWN) |
| 2543 | | { |
| 2544 | | Mame32VerifyRomSet(nGameIndex); |
| 2545 | | changed = TRUE; |
| 2546 | | } |
| 2547 | | |
| 2548 | | if (GetSampleAuditResults(nGameIndex) == UNKNOWN) |
| 2549 | | { |
| 2550 | | Mame32VerifySampleSet(nGameIndex); |
| 2551 | | changed = TRUE; |
| 2552 | | } |
| 2553 | | |
| 2554 | | lvfi.flags = LVFI_PARAM; |
| 2555 | | lvfi.lParam = nGameIndex; |
| 2556 | | |
| 2557 | | i = ListView_FindItem(hwndList, -1, &lvfi); |
| 2558 | | if (changed && i != -1); |
| 2559 | | { |
| 2560 | | ListView_RedrawItems(hwndList, i, i); |
| 2561 | | while( PeekMessage( &msg, hwndList, 0, 0, PM_REMOVE ) != 0) |
| 2562 | | { |
| 2563 | | TranslateMessage(&msg); |
| 2564 | | DispatchMessage(&msg); |
| 2565 | | } |
| 2566 | | } |
| 2567 | | changed = FALSE; |
| 2568 | | if ((i % iStep) == 0) |
| 2569 | | ProgressBarStepParam(i, nCount); |
| 2570 | | } |
| 2571 | | ProgressBarHide(); |
| 2572 | | pDescription = ModifyThe(drivers[Picker_GetSelectedItem(hwndList)]->description); |
| 2573 | | SetStatusBarText(0, pDescription); |
| 2574 | | UpdateStatusBar(); |
| 2575 | | return TRUE; |
| 2576 | | } |
| 2577 | | |
| 2578 | | static BOOL GameCheck(void) |
| 2579 | | { |
| 2580 | | LV_FINDINFO lvfi; |
| 2581 | | int i; |
| 2582 | | BOOL changed = FALSE; |
| 2583 | | |
| 2584 | | if (game_index == 0) |
| 2585 | | ProgressBarShow(); |
| 2586 | | |
| 2587 | | if (game_index >= driver_list_get_count(drivers)) |
| 2588 | | { |
| 2589 | | bDoGameCheck = FALSE; |
| 2590 | | ProgressBarHide(); |
| 2591 | | ResetWhichGamesInFolders(); |
| 2592 | | return FALSE; |
| 2593 | | } |
| 2594 | | |
| 2595 | | if (GetRomAuditResults(game_index) == UNKNOWN) |
| 2596 | | { |
| 2597 | | Mame32VerifyRomSet(game_index); |
| 2598 | | changed = TRUE; |
| 2599 | | } |
| 2600 | | |
| 2601 | | if (GetSampleAuditResults(game_index) == UNKNOWN) |
| 2602 | | { |
| 2603 | | Mame32VerifySampleSet(game_index); |
| 2604 | | changed = TRUE; |
| 2605 | | } |
| 2606 | | |
| 2607 | | lvfi.flags = LVFI_PARAM; |
| 2608 | | lvfi.lParam = game_index; |
| 2609 | | |
| 2610 | | i = ListView_FindItem(hwndList, -1, &lvfi); |
| 2611 | | if (changed && i != -1); |
| 2612 | | ListView_RedrawItems(hwndList, i, i); |
| 2613 | | if ((game_index % progBarStep) == 0) |
| 2614 | | ProgressBarStep(); |
| 2615 | | game_index++; |
| 2616 | | |
| 2617 | | return changed; |
| 2618 | | } |
| 2619 | | |
| 2620 | | static BOOL OnIdle(HWND hWnd) |
| 2621 | | { |
| 2622 | | static int bFirstTime = TRUE; |
| 2623 | | static int bResetList = TRUE; |
| 2624 | | |
| 2625 | | char *pDescription; |
| 2626 | | int driver_index; |
| 2627 | | |
| 2628 | | if (bFirstTime) |
| 2629 | | { |
| 2630 | | bResetList = FALSE; |
| 2631 | | bFirstTime = FALSE; |
| 2632 | | } |
| 2633 | | if (bDoGameCheck) |
| 2634 | | { |
| 2635 | | bResetList |= GameCheck(); |
| 2636 | | return idle_work; |
| 2637 | | } |
| 2638 | | // NPW 17-Jun-2003 - Commenting this out because it is redundant |
| 2639 | | // and it causes the game to reset back to the original game after an F5 |
| 2640 | | // refresh |
| 2641 | | //driver_index = GetGameNameIndex(GetDefaultGame()); |
| 2642 | | //SetSelectedPickItem(driver_index); |
| 2643 | | |
| 2644 | | // in case it's not found, get it back |
| 2645 | | driver_index = Picker_GetSelectedItem(hwndList); |
| 2646 | | |
| 2647 | | pDescription = ModifyThe(drivers[driver_index]->description); |
| 2648 | | SetStatusBarText(0, pDescription); |
| 2649 | | idle_work = FALSE; |
| 2650 | | UpdateStatusBar(); |
| 2651 | | bFirstTime = TRUE; |
| 2652 | | |
| 2653 | | if (!idle_work) |
| 2654 | | PostMessage(GetMainWindow(),WM_COMMAND, MAKEWPARAM(ID_VIEW_LINEUPICONS, TRUE),(LPARAM)NULL); |
| 2655 | | return idle_work; |
| 2656 | | } |
| 2657 | | |
| 2658 | | static void OnSize(HWND hWnd, UINT nState, int nWidth, int nHeight) |
| 2659 | | { |
| 2660 | | static BOOL firstTime = TRUE; |
| 2661 | | |
| 2662 | | if (nState != SIZE_MAXIMIZED && nState != SIZE_RESTORED) |
| 2663 | | return; |
| 2664 | | |
| 2665 | | ResizeWindow(hWnd, &main_resize); |
| 2666 | | ResizeProgressBar(); |
| 2667 | | if (firstTime == FALSE) |
| 2668 | | OnSizeSplitter(hMain); |
| 2669 | | //firstTime = FALSE; |
| 2670 | | /* Update the splitters structures as appropriate */ |
| 2671 | | RecalcSplitters(); |
| 2672 | | if (firstTime == FALSE) |
| 2673 | | ResizePickerControls(hMain); |
| 2674 | | firstTime = FALSE; |
| 2675 | | UpdateScreenShot(); |
| 2676 | | } |
| 2677 | | |
| 2678 | | |
| 2679 | | |
| 2680 | | static HWND GetResizeItemWindow(HWND hParent, const ResizeItem *ri) |
| 2681 | | { |
| 2682 | | HWND hControl; |
| 2683 | | if (ri->type == RA_ID) |
| 2684 | | hControl = GetDlgItem(hParent, ri->u.id); |
| 2685 | | else |
| 2686 | | hControl = ri->u.hwnd; |
| 2687 | | return hControl; |
| 2688 | | } |
| 2689 | | |
| 2690 | | |
| 2691 | | |
| 2692 | | static void SetAllWindowsFont(HWND hParent, const Resize *r, HFONT hTheFont, BOOL bRedraw) |
| 2693 | | { |
| 2694 | | int i; |
| 2695 | | HWND hControl; |
| 2696 | | |
| 2697 | | for (i = 0; r->items[i].type != RA_END; i++) |
| 2698 | | { |
| 2699 | | if (r->items[i].setfont) |
| 2700 | | { |
| 2701 | | hControl = GetResizeItemWindow(hParent, &r->items[i]); |
| 2702 | | SetWindowFont(hControl, hTheFont, bRedraw); |
| 2703 | | } |
| 2704 | | } |
| 2705 | | } |
| 2706 | | |
| 2707 | | |
| 2708 | | |
| 2709 | | static void ResizeWindow(HWND hParent, Resize *r) |
| 2710 | | { |
| 2711 | | int cmkindex = 0, dx, dy, dx1, dtempx; |
| 2712 | | HWND hControl; |
| 2713 | | RECT parent_rect, rect; |
| 2714 | | ResizeItem *ri; |
| 2715 | | POINT p = {0, 0}; |
| 2716 | | |
| 2717 | | if (hParent == NULL) |
| 2718 | | return; |
| 2719 | | |
| 2720 | | /* Calculate change in width and height of parent window */ |
| 2721 | | GetClientRect(hParent, &parent_rect); |
| 2722 | | //dx = parent_rect.right - r->rect.right; |
| 2723 | | dtempx = parent_rect.right - r->rect.right; |
| 2724 | | dy = parent_rect.bottom - r->rect.bottom; |
| 2725 | | dx = dtempx/2; |
| 2726 | | dx1 = dtempx - dx; |
| 2727 | | ClientToScreen(hParent, &p); |
| 2728 | | |
| 2729 | | while (r->items[cmkindex].type != RA_END) |
| 2730 | | { |
| 2731 | | ri = &r->items[cmkindex]; |
| 2732 | | if (ri->type == RA_ID) |
| 2733 | | hControl = GetDlgItem(hParent, ri->u.id); |
| 2734 | | else |
| 2735 | | hControl = ri->u.hwnd; |
| 2736 | | |
| 2737 | | if (hControl == NULL) |
| 2738 | | { |
| 2739 | | cmkindex++; |
| 2740 | | continue; |
| 2741 | | } |
| 2742 | | |
| 2743 | | /* Get control's rectangle relative to parent */ |
| 2744 | | GetWindowRect(hControl, &rect); |
| 2745 | | OffsetRect(&rect, -p.x, -p.y); |
| 2746 | | |
| 2747 | | if (!(ri->action & RA_LEFT)) |
| 2748 | | rect.left += dx; |
| 2749 | | |
| 2750 | | if (!(ri->action & RA_TOP)) |
| 2751 | | rect.top += dy; |
| 2752 | | |
| 2753 | | if (ri->action & RA_RIGHT) |
| 2754 | | rect.right += dx; |
| 2755 | | |
| 2756 | | if (ri->action & RA_BOTTOM) |
| 2757 | | rect.bottom += dy; |
| 2758 | | |
| 2759 | | MoveWindow(hControl, rect.left, rect.top, |
| 2760 | | (rect.right - rect.left), |
| 2761 | | (rect.bottom - rect.top), TRUE); |
| 2762 | | |
| 2763 | | /* Take care of subcontrols, if appropriate */ |
| 2764 | | if (ri->subwindow != NULL) |
| 2765 | | ResizeWindow(hControl, ri->subwindow); |
| 2766 | | |
| 2767 | | cmkindex++; |
| 2768 | | } |
| 2769 | | |
| 2770 | | /* Record parent window's new location */ |
| 2771 | | memcpy(&r->rect, &parent_rect, sizeof(RECT)); |
| 2772 | | } |
| 2773 | | |
| 2774 | | static void ProgressBarShow() |
| 2775 | | { |
| 2776 | | RECT rect; |
| 2777 | | int widths[2] = {150, -1}; |
| 2778 | | |
| 2779 | | if (driver_list_get_count(drivers) < 100) |
| 2780 | | progBarStep = 100 / driver_list_get_count(drivers); |
| 2781 | | else |
| 2782 | | progBarStep = (driver_list_get_count(drivers) / 100); |
| 2783 | | |
| 2784 | | SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)2, (LPARAM)(LPINT)widths); |
| 2785 | | SendMessage(hProgWnd, PBM_SETRANGE, 0, (LPARAM)MAKELONG(0, driver_list_get_count(drivers))); |
| 2786 | | SendMessage(hProgWnd, PBM_SETSTEP, (WPARAM)progBarStep, 0); |
| 2787 | | SendMessage(hProgWnd, PBM_SETPOS, 0, 0); |
| 2788 | | |
| 2789 | | StatusBar_GetItemRect(hStatusBar, 1, &rect); |
| 2790 | | |
| 2791 | | MoveWindow(hProgWnd, rect.left, rect.top, |
| 2792 | | rect.right - rect.left, |
| 2793 | | rect.bottom - rect.top, TRUE); |
| 2794 | | |
| 2795 | | bProgressShown = TRUE; |
| 2796 | | } |
| 2797 | | |
| 2798 | | static void ProgressBarHide() |
| 2799 | | { |
| 2800 | | RECT rect; |
| 2801 | | int widths[4]; |
| 2802 | | HDC hDC; |
| 2803 | | SIZE size; |
| 2804 | | int numParts = 4; |
| 2805 | | |
| 2806 | | if (hProgWnd == NULL) |
| 2807 | | { |
| 2808 | | return; |
| 2809 | | } |
| 2810 | | |
| 2811 | | hDC = GetDC(hProgWnd); |
| 2812 | | |
| 2813 | | ShowWindow(hProgWnd, SW_HIDE); |
| 2814 | | |
| 2815 | | GetTextExtentPoint32(hDC, TEXT("MMX"), 3, &size); |
| 2816 | | widths[3] = size.cx; |
| 2817 | | GetTextExtentPoint32(hDC, TEXT("MMMM games"), 10, &size); |
| 2818 | | widths[2] = size.cx; |
| 2819 | | //Just specify 24 instead of 30, gives us sufficient space to display the message, and saves some space |
| 2820 | | GetTextExtentPoint32(hDC, TEXT("Screen flip support is missing"), 24, &size); |
| 2821 | | widths[1] = size.cx; |
| 2822 | | |
| 2823 | | ReleaseDC(hProgWnd, hDC); |
| 2824 | | |
| 2825 | | widths[0] = -1; |
| 2826 | | SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)1, (LPARAM)(LPINT)widths); |
| 2827 | | StatusBar_GetItemRect(hStatusBar, 0, &rect); |
| 2828 | | |
| 2829 | | widths[0] = (rect.right - rect.left) - (widths[1] + widths[2] + widths[3]); |
| 2830 | | widths[1] += widths[0]; |
| 2831 | | widths[2] += widths[1]; |
| 2832 | | widths[3] = -1; |
| 2833 | | |
| 2834 | | SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)numParts, (LPARAM)(LPINT)widths); |
| 2835 | | UpdateStatusBar(); |
| 2836 | | |
| 2837 | | bProgressShown = FALSE; |
| 2838 | | } |
| 2839 | | |
| 2840 | | static void ResizeProgressBar() |
| 2841 | | { |
| 2842 | | if (bProgressShown) |
| 2843 | | { |
| 2844 | | RECT rect; |
| 2845 | | int widths[2] = {150, -1}; |
| 2846 | | |
| 2847 | | SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)2, (LPARAM)(LPINT)widths); |
| 2848 | | StatusBar_GetItemRect(hStatusBar, 1, &rect); |
| 2849 | | MoveWindow(hProgWnd, rect.left, rect.top, |
| 2850 | | rect.right - rect.left, |
| 2851 | | rect.bottom - rect.top, TRUE); |
| 2852 | | } |
| 2853 | | else |
| 2854 | | { |
| 2855 | | ProgressBarHide(); |
| 2856 | | } |
| 2857 | | } |
| 2858 | | |
| 2859 | | static void ProgressBarStepParam(int iGameIndex, int nGameCount) |
| 2860 | | { |
| 2861 | | SetStatusBarTextF(0, "Game search %d%% complete", |
| 2862 | | ((iGameIndex + 1) * 100) / nGameCount); |
| 2863 | | if (iGameIndex == 0) |
| 2864 | | ShowWindow(hProgWnd, SW_SHOW); |
| 2865 | | SendMessage(hProgWnd, PBM_STEPIT, 0, 0); |
| 2866 | | } |
| 2867 | | |
| 2868 | | static void ProgressBarStep() |
| 2869 | | { |
| 2870 | | ProgressBarStepParam(game_index, driver_list_get_count(drivers)); |
| 2871 | | } |
| 2872 | | |
| 2873 | | static HWND InitProgressBar(HWND hParent) |
| 2874 | | { |
| 2875 | | RECT rect; |
| 2876 | | |
| 2877 | | StatusBar_GetItemRect(hStatusBar, 0, &rect); |
| 2878 | | |
| 2879 | | rect.left += 150; |
| 2880 | | |
| 2881 | | return CreateWindowEx(WS_EX_STATICEDGE, |
| 2882 | | PROGRESS_CLASS, |
| 2883 | | TEXT("Progress Bar"), |
| 2884 | | WS_CHILD | PBS_SMOOTH, |
| 2885 | | rect.left, |
| 2886 | | rect.top, |
| 2887 | | rect.right - rect.left, |
| 2888 | | rect.bottom - rect.top, |
| 2889 | | hParent, |
| 2890 | | NULL, |
| 2891 | | hInst, |
| 2892 | | NULL); |
| 2893 | | } |
| 2894 | | |
| 2895 | | static void CopyToolTipText(LPTOOLTIPTEXT lpttt) |
| 2896 | | { |
| 2897 | | int i; |
| 2898 | | int iButton = lpttt->hdr.idFrom; |
| 2899 | | static TCHAR String[1024]; |
| 2900 | | BOOL bConverted = FALSE; |
| 2901 | | TCHAR* t_gameinfostatus; |
| 2902 | | |
| 2903 | | /* Map command ID to string index */ |
| 2904 | | for (i = 0; CommandToString[i] != -1; i++) |
| 2905 | | { |
| 2906 | | if (CommandToString[i] == iButton) |
| 2907 | | { |
| 2908 | | iButton = i; |
| 2909 | | bConverted = TRUE; |
| 2910 | | break; |
| 2911 | | } |
| 2912 | | } |
| 2913 | | if( bConverted ) |
| 2914 | | { |
| 2915 | | /* Check for valid parameter */ |
| 2916 | | if(iButton > NUM_TOOLTIPS) |
| 2917 | | { |
| 2918 | | _tcscpy(String,TEXT("Invalid Button Index")); |
| 2919 | | } |
| 2920 | | else |
| 2921 | | { |
| 2922 | | _tcscpy(String,szTbStrings[iButton]); |
| 2923 | | } |
| 2924 | | } |
| 2925 | | else if ( iButton <= 2 ) |
| 2926 | | { |
| 2927 | | //Statusbar |
| 2928 | | SendMessage(lpttt->hdr.hwndFrom, TTM_SETMAXTIPWIDTH, 0, 200); |
| 2929 | | if( iButton != 1) |
| 2930 | | SendMessage(hStatusBar, SB_GETTEXT, (WPARAM)iButton, (LPARAM)&String ); |
| 2931 | | else { |
| 2932 | | //for first pane we get the Status directly, to get the line breaks |
| 2933 | | t_gameinfostatus = tstring_from_utf8( GameInfoStatus(Picker_GetSelectedItem(hwndList), FALSE)); |
| 2934 | | if( !t_gameinfostatus ) |
| 2935 | | return; |
| 2936 | | _tcscpy(String, t_gameinfostatus); |
| 2937 | | free(t_gameinfostatus); |
| 2938 | | } |
| 2939 | | } |
| 2940 | | else |
| 2941 | | _tcscpy(String,TEXT("Invalid Button Index")); |
| 2942 | | |
| 2943 | | lpttt->lpszText = String; |
| 2944 | | } |
| 2945 | | |
| 2946 | | static HWND InitToolbar(HWND hParent) |
| 2947 | | { |
| 2948 | | HWND hToolBar = CreateToolbarEx(hParent, |
| 2949 | | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | |
| 2950 | | CCS_TOP | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, |
| 2951 | | 1, |
| 2952 | | 8, |
| 2953 | | hInst, |
| 2954 | | IDB_TOOLBAR, |
| 2955 | | tbb, |
| 2956 | | NUM_TOOLBUTTONS, |
| 2957 | | 16, |
| 2958 | | 16, |
| 2959 | | 0, |
| 2960 | | 0, |
| 2961 | | sizeof(TBBUTTON)); |
| 2962 | | RECT rect; |
| 2963 | | int idx; |
| 2964 | | int iPosX, iPosY, iHeight; |
| 2965 | | |
| 2966 | | // get Edit Control position |
| 2967 | | idx = SendMessage(hToolBar, TB_BUTTONCOUNT, (WPARAM)0, (LPARAM)0) - 1; |
| 2968 | | SendMessage(hToolBar, TB_GETITEMRECT, (WPARAM)idx, (LPARAM)&rect); |
| 2969 | | iPosX = rect.right + 10; |
| 2970 | | iPosY = rect.top + 1; |
| 2971 | | iHeight = rect.bottom - rect.top - 2; |
| 2972 | | |
| 2973 | | // create Edit Control |
| 2974 | | win_create_window_ex_utf8( 0L, "Edit", SEARCH_PROMPT, WS_CHILD | WS_BORDER | WS_VISIBLE | ES_LEFT, |
| 2975 | | iPosX, iPosY, 200, iHeight, hToolBar, (HMENU)ID_TOOLBAR_EDIT, hInst, NULL ); |
| 2976 | | |
| 2977 | | return hToolBar; |
| 2978 | | } |
| 2979 | | |
| 2980 | | static HWND InitStatusBar(HWND hParent) |
| 2981 | | { |
| 2982 | | HMENU hMenu = GetMenu(hParent); |
| 2983 | | |
| 2984 | | popstr[0].hMenu = 0; |
| 2985 | | popstr[0].uiString = 0; |
| 2986 | | popstr[1].hMenu = hMenu; |
| 2987 | | popstr[1].uiString = IDS_UI_FILE; |
| 2988 | | popstr[2].hMenu = GetSubMenu(hMenu, 1); |
| 2989 | | popstr[2].uiString = IDS_VIEW_TOOLBAR; |
| 2990 | | popstr[3].hMenu = 0; |
| 2991 | | popstr[3].uiString = 0; |
| 2992 | | |
| 2993 | | return CreateStatusWindow(WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | |
| 2994 | | CCS_BOTTOM | SBARS_SIZEGRIP | SBT_TOOLTIPS, |
| 2995 | | TEXT("Ready"), |
| 2996 | | hParent, |
| 2997 | | 2); |
| 2998 | | } |
| 2999 | | |
| 3000 | | |
| 3001 | | static LRESULT Statusbar_MenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) |
| 3002 | | { |
| 3003 | | UINT fuFlags = (UINT)HIWORD(wParam); |
| 3004 | | HMENU hMainMenu = NULL; |
| 3005 | | int iMenu = 0; |
| 3006 | | |
| 3007 | | /* Handle non-system popup menu descriptions. */ |
| 3008 | | if ( (fuFlags & MF_POPUP) |
| 3009 | | && (!(fuFlags & MF_SYSMENU))) |
| 3010 | | { |
| 3011 | | for (iMenu = 1; iMenu < MAX_MENUS; iMenu++) |
| 3012 | | { |
| 3013 | | if ((HMENU)lParam == popstr[iMenu].hMenu) |
| 3014 | | { |
| 3015 | | hMainMenu = (HMENU)lParam; |
| 3016 | | break ; |
| 3017 | | } |
| 3018 | | } |
| 3019 | | } |
| 3020 | | |
| 3021 | | if (hMainMenu) |
| 3022 | | { |
| 3023 | | /* Display helpful text in status bar */ |
| 3024 | | MenuHelp(WM_MENUSELECT, wParam, lParam, hMainMenu, hInst, |
| 3025 | | hStatusBar, (UINT *)&popstr[iMenu]); |
| 3026 | | } |
| 3027 | | else |
| 3028 | | { |
| 3029 | | UINT nZero = 0; |
| 3030 | | MenuHelp(WM_MENUSELECT, wParam, lParam, NULL, hInst, |
| 3031 | | hStatusBar, &nZero); |
| 3032 | | } |
| 3033 | | |
| 3034 | | return 0; |
| 3035 | | } |
| 3036 | | |
| 3037 | | static void UpdateStatusBar() |
| 3038 | | { |
| 3039 | | LPTREEFOLDER lpFolder = GetCurrentFolder(); |
| 3040 | | int games_shown = 0; |
| 3041 | | int i = -1; |
| 3042 | | |
| 3043 | | if (!lpFolder) |
| 3044 | | return; |
| 3045 | | |
| 3046 | | while (1) |
| 3047 | | { |
| 3048 | | i = FindGame(lpFolder,i+1); |
| 3049 | | if (i == -1) |
| 3050 | | break; |
| 3051 | | |
| 3052 | | if (!GameFiltered(i, lpFolder->m_dwFlags)) |
| 3053 | | games_shown++; |
| 3054 | | } |
| 3055 | | |
| 3056 | | /* Show number of games in the current 'View' in the status bar */ |
| 3057 | | SetStatusBarTextF(2, g_szGameCountString, games_shown); |
| 3058 | | |
| 3059 | | i = Picker_GetSelectedItem(hwndList); |
| 3060 | | |
| 3061 | | if (games_shown == 0) |
| 3062 | | DisableSelection(); |
| 3063 | | else |
| 3064 | | { |
| 3065 | | const char* pStatus = GameInfoStatus(i, FALSE); |
| 3066 | | SetStatusBarText(1, pStatus); |
| 3067 | | } |
| 3068 | | } |
| 3069 | | |
| 3070 | | static void UpdateHistory(void) |
| 3071 | | { |
| 3072 | | HDC hDC; |
| 3073 | | RECT rect; |
| 3074 | | TEXTMETRIC tm ; |
| 3075 | | int nLines, nLineHeight; |
| 3076 | | //DWORD dwStyle = GetWindowLong(GetDlgItem(hMain, IDC_HISTORY), GWL_STYLE); |
| 3077 | | have_history = FALSE; |
| 3078 | | |
| 3079 | | if (GetSelectedPick() >= 0) |
| 3080 | | { |
| 3081 | | char *histText = GetGameHistory(Picker_GetSelectedItem(hwndList)); |
| 3082 | | |
| 3083 | | have_history = (histText && histText[0]) ? TRUE : FALSE; |
| 3084 | | win_set_window_text_utf8(GetDlgItem(hMain, IDC_HISTORY), histText); |
| 3085 | | } |
| 3086 | | |
| 3087 | | if (have_history && GetShowScreenShot() |
| 3088 | | && ((TabView_GetCurrentTab(hTabCtrl) == TAB_HISTORY) || |
| 3089 | | (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() && GetShowTab(TAB_HISTORY) == FALSE) || |
| 3090 | | (TAB_ALL == GetHistoryTab() && GetShowTab(TAB_HISTORY) == FALSE) )) |
| 3091 | | { |
| 3092 | | Edit_GetRect(GetDlgItem(hMain, IDC_HISTORY),&rect); |
| 3093 | | nLines = Edit_GetLineCount(GetDlgItem(hMain, IDC_HISTORY) ); |
| 3094 | | hDC = GetDC(GetDlgItem(hMain, IDC_HISTORY)); |
| 3095 | | GetTextMetrics (hDC, &tm); |
| 3096 | | nLineHeight = tm.tmHeight - tm.tmInternalLeading; |
| 3097 | | if( ( (rect.bottom - rect.top) / nLineHeight) < (nLines) ) |
| 3098 | | { |
| 3099 | | //more than one Page, so show Scrollbar |
| 3100 | | SetScrollRange(GetDlgItem(hMain, IDC_HISTORY), SB_VERT, 0, nLines, TRUE); |
| 3101 | | } |
| 3102 | | else |
| 3103 | | { |
| 3104 | | //hide Scrollbar |
| 3105 | | SetScrollRange(GetDlgItem(hMain, IDC_HISTORY),SB_VERT, 0, 0, TRUE); |
| 3106 | | |
| 3107 | | } |
| 3108 | | ShowWindow(GetDlgItem(hMain, IDC_HISTORY), SW_SHOW); |
| 3109 | | } |
| 3110 | | else |
| 3111 | | ShowWindow(GetDlgItem(hMain, IDC_HISTORY), SW_HIDE); |
| 3112 | | |
| 3113 | | } |
| 3114 | | |
| 3115 | | |
| 3116 | | static void DisableSelection() |
| 3117 | | { |
| 3118 | | MENUITEMINFO mmi; |
| 3119 | | HMENU hMenu = GetMenu(hMain); |
| 3120 | | BOOL prev_have_selection = have_selection; |
| 3121 | | |
| 3122 | | mmi.cbSize = sizeof(mmi); |
| 3123 | | mmi.fMask = MIIM_TYPE; |
| 3124 | | mmi.fType = MFT_STRING; |
| 3125 | | mmi.dwTypeData = (TCHAR *) TEXT("&Play"); |
| 3126 | | mmi.cch = _tcslen(mmi.dwTypeData); |
| 3127 | | SetMenuItemInfo(hMenu, ID_FILE_PLAY, FALSE, &mmi); |
| 3128 | | |
| 3129 | | EnableMenuItem(hMenu, ID_FILE_PLAY, MF_GRAYED); |
| 3130 | | EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_GRAYED); |
| 3131 | | EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED); |
| 3132 | | |
| 3133 | | SetStatusBarText(0, "No Selection"); |
| 3134 | | SetStatusBarText(1, ""); |
| 3135 | | SetStatusBarText(3, ""); |
| 3136 | | |
| 3137 | | have_selection = FALSE; |
| 3138 | | |
| 3139 | | if (prev_have_selection != have_selection) |
| 3140 | | UpdateScreenShot(); |
| 3141 | | } |
| 3142 | | |
| 3143 | | static void EnableSelection(int nGame) |
| 3144 | | { |
| 3145 | | TCHAR buf[200]; |
| 3146 | | const char * pText; |
| 3147 | | MENUITEMINFO mmi; |
| 3148 | | HMENU hMenu = GetMenu(hMain); |
| 3149 | | TCHAR* t_description; |
| 3150 | | |
| 3151 | | #ifdef MESS |
| 3152 | | MyFillSoftwareList(nGame, FALSE); |
| 3153 | | #endif |
| 3154 | | |
| 3155 | | t_description = tstring_from_utf8(ConvertAmpersandString(ModifyThe(drivers[nGame]->description))); |
| 3156 | | if( !t_description ) |
| 3157 | | return; |
| 3158 | | |
| 3159 | | _sntprintf(buf, sizeof(buf) / sizeof(buf[0]), g_szPlayGameString, t_description); |
| 3160 | | mmi.cbSize = sizeof(mmi); |
| 3161 | | mmi.fMask = MIIM_TYPE; |
| 3162 | | mmi.fType = MFT_STRING; |
| 3163 | | mmi.dwTypeData = buf; |
| 3164 | | mmi.cch = _tcslen(mmi.dwTypeData); |
| 3165 | | SetMenuItemInfo(hMenu, ID_FILE_PLAY, FALSE, &mmi); |
| 3166 | | |
| 3167 | | pText = ModifyThe(drivers[nGame]->description); |
| 3168 | | SetStatusBarText(0, pText); |
| 3169 | | /* Add this game's status to the status bar */ |
| 3170 | | pText = GameInfoStatus(nGame, FALSE); |
| 3171 | | SetStatusBarText(1, pText); |
| 3172 | | SetStatusBarText(3, ""); |
| 3173 | | |
| 3174 | | /* If doing updating game status and the game name is NOT pacman.... */ |
| 3175 | | |
| 3176 | | EnableMenuItem(hMenu, ID_FILE_PLAY, MF_ENABLED); |
| 3177 | | EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_ENABLED); |
| 3178 | | |
| 3179 | | if (!oldControl) |
| 3180 | | EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_ENABLED); |
| 3181 | | |
| 3182 | | if (bProgressShown && bListReady == TRUE) |
| 3183 | | { |
| 3184 | | SetDefaultGame(ModifyThe(drivers[nGame]->name)); |
| 3185 | | } |
| 3186 | | have_selection = TRUE; |
| 3187 | | |
| 3188 | | UpdateScreenShot(); |
| 3189 | | |
| 3190 | | free(t_description); |
| 3191 | | } |
| 3192 | | |
| 3193 | | static void PaintBackgroundImage(HWND hWnd, HRGN hRgn, int x, int y) |
| 3194 | | { |
| 3195 | | RECT rcClient; |
| 3196 | | HRGN rgnBitmap; |
| 3197 | | HPALETTE hPAL; |
| 3198 | | HDC hDC = GetDC(hWnd); |
| 3199 | | int i, j; |
| 3200 | | HDC htempDC; |
| 3201 | | HBITMAP oldBitmap; |
| 3202 | | |
| 3203 | | /* x and y are offsets within the background image that should be at 0,0 in hWnd */ |
| 3204 | | |
| 3205 | | /* So we don't paint over the control's border */ |
| 3206 | | GetClientRect(hWnd, &rcClient); |
| 3207 | | |
| 3208 | | htempDC = CreateCompatibleDC(hDC); |
| 3209 | | oldBitmap = SelectObject(htempDC, hBackground); |
| 3210 | | |
| 3211 | | if (hRgn == NULL) |
| 3212 | | { |
| 3213 | | /* create a region of our client area */ |
| 3214 | | rgnBitmap = CreateRectRgnIndirect(&rcClient); |
| 3215 | | SelectClipRgn(hDC, rgnBitmap); |
| 3216 | | DeleteObject(rgnBitmap); |
| 3217 | | } |
| 3218 | | else |
| 3219 | | { |
| 3220 | | /* use the passed in region */ |
| 3221 | | SelectClipRgn(hDC, hRgn); |
| 3222 | | } |
| 3223 | | |
| 3224 | | hPAL = GetBackgroundPalette(); |
| 3225 | | if (hPAL == NULL) |
| 3226 | | hPAL = CreateHalftonePalette(hDC); |
| 3227 | | |
| 3228 | | if (GetDeviceCaps(htempDC, RASTERCAPS) & RC_PALETTE && hPAL != NULL) |
| 3229 | | { |
| 3230 | | SelectPalette(htempDC, hPAL, FALSE); |
| 3231 | | RealizePalette(htempDC); |
| 3232 | | } |
| 3233 | | |
| 3234 | | for (i = rcClient.left-x; i < rcClient.right; i += bmDesc.bmWidth) |
| 3235 | | for (j = rcClient.top-y; j < rcClient.bottom; j += bmDesc.bmHeight) |
| 3236 | | BitBlt(hDC, i, j, bmDesc.bmWidth, bmDesc.bmHeight, htempDC, 0, 0, SRCCOPY); |
| 3237 | | |
| 3238 | | SelectObject(htempDC, oldBitmap); |
| 3239 | | DeleteDC(htempDC); |
| 3240 | | |
| 3241 | | if (GetBackgroundPalette() == NULL) |
| 3242 | | { |
| 3243 | | DeleteObject(hPAL); |
| 3244 | | hPAL = NULL; |
| 3245 | | } |
| 3246 | | |
| 3247 | | ReleaseDC(hWnd, hDC); |
| 3248 | | } |
| 3249 | | |
| 3250 | | static LPCSTR GetCloneParentName(int nItem) |
| 3251 | | { |
| 3252 | | int nParentIndex = -1; |
| 3253 | | |
| 3254 | | if (DriverIsClone(nItem) == TRUE) |
| 3255 | | { |
| 3256 | | nParentIndex = GetParentIndex(drivers[nItem]); |
| 3257 | | if( nParentIndex >= 0) |
| 3258 | | return ModifyThe(drivers[nParentIndex]->description); |
| 3259 | | } |
| 3260 | | return ""; |
| 3261 | | } |
| 3262 | | |
| 3263 | | #if 0 |
| 3264 | | static BOOL PickerHitTest(HWND hWnd) |
| 3265 | | { |
| 3266 | | RECT rect; |
| 3267 | | POINTS p; |
| 3268 | | DWORD res = GetMessagePos(); |
| 3269 | | LVHITTESTINFO htInfo; |
| 3270 | | |
| 3271 | | ZeroMemory(&htInfo,sizeof(LVHITTESTINFO)); |
| 3272 | | p = MAKEPOINTS(res); |
| 3273 | | GetWindowRect(hWnd, &rect); |
| 3274 | | htInfo.pt.x = p.x - rect.left; |
| 3275 | | htInfo.pt.y = p.y - rect.top; |
| 3276 | | ListView_HitTest(hWnd, &htInfo); |
| 3277 | | |
| 3278 | | return (! (htInfo.flags & LVHT_NOWHERE)); |
| 3279 | | } |
| 3280 | | #endif |
| 3281 | | |
| 3282 | | static BOOL TreeViewNotify(LPNMHDR nm) |
| 3283 | | { |
| 3284 | | switch (nm->code) |
| 3285 | | { |
| 3286 | | case TVN_SELCHANGED : |
| 3287 | | { |
| 3288 | | HTREEITEM hti = TreeView_GetSelection(hTreeView); |
| 3289 | | TVITEM tvi; |
| 3290 | | |
| 3291 | | tvi.mask = TVIF_PARAM | TVIF_HANDLE; |
| 3292 | | tvi.hItem = hti; |
| 3293 | | |
| 3294 | | if (TreeView_GetItem(hTreeView, &tvi)) |
| 3295 | | { |
| 3296 | | SetCurrentFolder((LPTREEFOLDER)tvi.lParam); |
| 3297 | | if (bListReady) |
| 3298 | | { |
| 3299 | | ResetListView(); |
| 3300 | | UpdateScreenShot(); |
| 3301 | | } |
| 3302 | | } |
| 3303 | | return TRUE; |
| 3304 | | } |
| 3305 | | case TVN_BEGINLABELEDIT : |
| 3306 | | { |
| 3307 | | TV_DISPINFO *ptvdi = (TV_DISPINFO *)nm; |
| 3308 | | LPTREEFOLDER folder = (LPTREEFOLDER)ptvdi->item.lParam; |
| 3309 | | |
| 3310 | | if (folder->m_dwFlags & F_CUSTOM) |
| 3311 | | { |
| 3312 | | // user can edit custom folder names |
| 3313 | | g_in_treeview_edit = TRUE; |
| 3314 | | return FALSE; |
| 3315 | | } |
| 3316 | | // user can't edit built in folder names |
| 3317 | | return TRUE; |
| 3318 | | } |
| 3319 | | case TVN_ENDLABELEDIT : |
| 3320 | | { |
| 3321 | | TV_DISPINFO *ptvdi = (TV_DISPINFO *)nm; |
| 3322 | | LPTREEFOLDER folder = (LPTREEFOLDER)ptvdi->item.lParam; |
| 3323 | | char* szText; |
| 3324 | | BOOL result; |
| 3325 | | |
| 3326 | | g_in_treeview_edit = FALSE; |
| 3327 | | |
| 3328 | | if (ptvdi->item.pszText == NULL || _tcslen(ptvdi->item.pszText) == 0) |
| 3329 | | return FALSE; |
| 3330 | | |
| 3331 | | szText = utf8_from_tstring(ptvdi->item.pszText); |
| 3332 | | if( !szText ) |
| 3333 | | return FALSE; |
| 3334 | | |
| 3335 | | result = TryRenameCustomFolder(folder,szText); |
| 3336 | | |
| 3337 | | free(szText); |
| 3338 | | |
| 3339 | | return result; |
| 3340 | | } |
| 3341 | | } |
| 3342 | | return FALSE; |
| 3343 | | } |
| 3344 | | |
| 3345 | | |
| 3346 | | |
| 3347 | | static void GamePicker_OnHeaderContextMenu(POINT pt, int nColumn) |
| 3348 | | { |
| 3349 | | // Right button was clicked on header |
| 3350 | | HMENU hMenuLoad; |
| 3351 | | HMENU hMenu; |
| 3352 | | |
| 3353 | | hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_HEADER)); |
| 3354 | | hMenu = GetSubMenu(hMenuLoad, 0); |
| 3355 | | lastColumnClick = nColumn; |
| 3356 | | TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hMain,NULL); |
| 3357 | | |
| 3358 | | DestroyMenu(hMenuLoad); |
| 3359 | | } |
| 3360 | | |
| 3361 | | |
| 3362 | | |
| 3363 | | char* ConvertAmpersandString(const char *s) |
| 3364 | | { |
| 3365 | | /* takes a string and changes any ampersands to double ampersands, |
| 3366 | | for setting text of window controls that don't allow us to disable |
| 3367 | | the ampersand underlining. |
| 3368 | | */ |
| 3369 | | /* returns a static buffer--use before calling again */ |
| 3370 | | |
| 3371 | | static char buf[200]; |
| 3372 | | char *ptr; |
| 3373 | | |
| 3374 | | ptr = buf; |
| 3375 | | while (*s) |
| 3376 | | { |
| 3377 | | if (*s == '&') |
| 3378 | | *ptr++ = *s; |
| 3379 | | *ptr++ = *s++; |
| 3380 | | } |
| 3381 | | *ptr = 0; |
| 3382 | | |
| 3383 | | return buf; |
| 3384 | | } |
| 3385 | | |
| 3386 | | static int GUI_seq_pressed(const input_seq *seq) |
| 3387 | | { |
| 3388 | | int codenum; |
| 3389 | | int res = 1; |
| 3390 | | int invert = 0; |
| 3391 | | int count = 0; |
| 3392 | | |
| 3393 | | for (codenum = 0; codenum < ARRAY_LENGTH(seq->code); codenum++) |
| 3394 | | { |
| 3395 | | input_code code = seq->code[codenum]; |
| 3396 | | |
| 3397 | | switch (code) |
| 3398 | | { |
| 3399 | | case SEQCODE_OR : |
| 3400 | | if (res && count) |
| 3401 | | return 1; |
| 3402 | | res = 1; |
| 3403 | | count = 0; |
| 3404 | | break; |
| 3405 | | case SEQCODE_NOT : |
| 3406 | | invert = !invert; |
| 3407 | | break; |
| 3408 | | default: |
| 3409 | | if (res) |
| 3410 | | { |
| 3411 | | int pressed = keyboard_state[code]; |
| 3412 | | if ((pressed != 0) == invert) |
| 3413 | | res = 0; |
| 3414 | | } |
| 3415 | | invert = 0; |
| 3416 | | ++count; |
| 3417 | | } |
| 3418 | | } |
| 3419 | | return res && count; |
| 3420 | | } |
| 3421 | | |
| 3422 | | static void check_for_GUI_action(void) |
| 3423 | | { |
| 3424 | | int i; |
| 3425 | | |
| 3426 | | for (i = 0; i < NUM_GUI_SEQUENCES; i++) |
| 3427 | | { |
| 3428 | | input_seq *is = &(GUISequenceControl[i].is); |
| 3429 | | |
| 3430 | | if (GUI_seq_pressed(is)) |
| 3431 | | { |
| 3432 | | dprintf("seq =%s pressed\n", GUISequenceControl[i].name); |
| 3433 | | switch (GUISequenceControl[i].func_id) |
| 3434 | | { |
| 3435 | | case ID_GAME_AUDIT: |
| 3436 | | case ID_GAME_PROPERTIES: |
| 3437 | | case ID_CONTEXT_FILTERS: |
| 3438 | | case ID_UI_START: |
| 3439 | | KeyboardStateClear(); /* beacuse whe won't receive KeyUp mesage when we loose focus */ |
| 3440 | | break; |
| 3441 | | default: |
| 3442 | | break; |
| 3443 | | } |
| 3444 | | SendMessage(hMain, WM_COMMAND, GUISequenceControl[i].func_id, 0); |
| 3445 | | } |
| 3446 | | } |
| 3447 | | } |
| 3448 | | |
| 3449 | | static void KeyboardStateClear(void) |
| 3450 | | { |
| 3451 | | memset(keyboard_state, 0, sizeof(keyboard_state)); |
| 3452 | | dprintf("keyboard gui state cleared.\n"); |
| 3453 | | } |
| 3454 | | |
| 3455 | | |
| 3456 | | static void KeyboardKeyDown(int syskey, int vk_code, int special) |
| 3457 | | { |
| 3458 | | int i, found = 0; |
| 3459 | | input_code icode = 0; |
| 3460 | | int special_code = (special >> 24) & 1; |
| 3461 | | int scancode = (special>>16) & 0xff; |
| 3462 | | |
| 3463 | | if ((vk_code==VK_MENU) || (vk_code==VK_CONTROL) || (vk_code==VK_SHIFT)) |
| 3464 | | { |
| 3465 | | found = 1; |
| 3466 | | |
| 3467 | | /* a hack for right shift - it's better to use Direct X for keyboard input it seems......*/ |
| 3468 | | if (vk_code==VK_SHIFT) |
| 3469 | | if (scancode>0x30) /* on my keyboard left shift scancode is 0x2a, right shift is 0x36 */ |
| 3470 | | special_code = 1; |
| 3471 | | |
| 3472 | | if (special_code) /* right hand keys */ |
| 3473 | | { |
| 3474 | | switch(vk_code) |
| 3475 | | { |
| 3476 | | case VK_MENU: |
| 3477 | | icode = KEYCODE_RALT; |
| 3478 | | break; |
| 3479 | | case VK_CONTROL: |
| 3480 | | icode = KEYCODE_RCONTROL; |
| 3481 | | break; |
| 3482 | | case VK_SHIFT: |
| 3483 | | icode = KEYCODE_RSHIFT; |
| 3484 | | break; |
| 3485 | | } |
| 3486 | | } |
| 3487 | | else /* left hand keys */ |
| 3488 | | { |
| 3489 | | switch(vk_code) |
| 3490 | | { |
| 3491 | | case VK_MENU: |
| 3492 | | icode = KEYCODE_LALT; |
| 3493 | | break; |
| 3494 | | case VK_CONTROL: |
| 3495 | | icode = KEYCODE_LCONTROL; |
| 3496 | | break; |
| 3497 | | case VK_SHIFT: |
| 3498 | | icode = KEYCODE_LSHIFT; |
| 3499 | | break; |
| 3500 | | } |
| 3501 | | } |
| 3502 | | } |
| 3503 | | else |
| 3504 | | { |
| 3505 | | for (i = 0; i < ARRAY_LENGTH(win_key_trans_table); i++) |
| 3506 | | { |
| 3507 | | if ( vk_code == win_key_trans_table[i][VIRTUAL_KEY]) |
| 3508 | | { |
| 3509 | | icode = win_key_trans_table[i][MAME_KEY]; |
| 3510 | | found = 1; |
| 3511 | | break; |
| 3512 | | } |
| 3513 | | } |
| 3514 | | } |
| 3515 | | if (!found) |
| 3516 | | { |
| 3517 | | dprintf("VK_code pressed not found = %i\n",vk_code); |
| 3518 | | //MessageBox(NULL,"keydown message arrived not processed","TitleBox",MB_OK); |
| 3519 | | return; |
| 3520 | | } |
| 3521 | | dprintf("VK_code pressed found = %i, sys=%i, mame_keycode=%i special=%08x\n", vk_code, syskey, icode, special); |
| 3522 | | keyboard_state[icode] = 1; |
| 3523 | | check_for_GUI_action(); |
| 3524 | | } |
| 3525 | | |
| 3526 | | static void KeyboardKeyUp(int syskey, int vk_code, int special) |
| 3527 | | { |
| 3528 | | int i, found = 0; |
| 3529 | | input_code icode = 0; |
| 3530 | | int special_code = (special >> 24) & 1; |
| 3531 | | int scancode = (special>>16) & 0xff; |
| 3532 | | |
| 3533 | | if ((vk_code==VK_MENU) || (vk_code==VK_CONTROL) || (vk_code==VK_SHIFT)) |
| 3534 | | { |
| 3535 | | found = 1; |
| 3536 | | |
| 3537 | | /* a hack for right shift - it's better to use Direct X for keyboard input it seems......*/ |
| 3538 | | if (vk_code==VK_SHIFT) |
| 3539 | | if (scancode>0x30) /* on my keyboard left shift scancode is 0x2a, right shift is 0x36 */ |
| 3540 | | special_code = 1; |
| 3541 | | |
| 3542 | | if (special_code) /* right hand keys */ |
| 3543 | | { |
| 3544 | | switch(vk_code) |
| 3545 | | { |
| 3546 | | case VK_MENU: |
| 3547 | | icode = KEYCODE_RALT; |
| 3548 | | break; |
| 3549 | | case VK_CONTROL: |
| 3550 | | icode = KEYCODE_RCONTROL; |
| 3551 | | break; |
| 3552 | | case VK_SHIFT: |
| 3553 | | icode = KEYCODE_RSHIFT; |
| 3554 | | break; |
| 3555 | | } |
| 3556 | | } |
| 3557 | | else /* left hand keys */ |
| 3558 | | { |
| 3559 | | switch(vk_code) |
| 3560 | | { |
| 3561 | | case VK_MENU: |
| 3562 | | icode = KEYCODE_LALT; |
| 3563 | | break; |
| 3564 | | case VK_CONTROL: |
| 3565 | | icode = KEYCODE_LCONTROL; |
| 3566 | | break; |
| 3567 | | case VK_SHIFT: |
| 3568 | | icode = KEYCODE_LSHIFT; |
| 3569 | | break; |
| 3570 | | } |
| 3571 | | } |
| 3572 | | } |
| 3573 | | else |
| 3574 | | { |
| 3575 | | for (i = 0; i < ARRAY_LENGTH(win_key_trans_table); i++) |
| 3576 | | { |
| 3577 | | if (vk_code == win_key_trans_table[i][VIRTUAL_KEY]) |
| 3578 | | { |
| 3579 | | icode = win_key_trans_table[i][MAME_KEY]; |
| 3580 | | found = 1; |
| 3581 | | break; |
| 3582 | | } |
| 3583 | | } |
| 3584 | | } |
| 3585 | | if (!found) |
| 3586 | | { |
| 3587 | | dprintf("VK_code released not found = %i",vk_code); |
| 3588 | | //MessageBox(NULL,"keyup message arrived not processed","TitleBox",MB_OK); |
| 3589 | | return; |
| 3590 | | } |
| 3591 | | keyboard_state[icode] = 0; |
| 3592 | | dprintf("VK_code released found= %i, sys=%i, mame_keycode=%i special=%08x\n", vk_code, syskey, icode, special ); |
| 3593 | | check_for_GUI_action(); |
| 3594 | | } |
| 3595 | | |
| 3596 | | static void PollGUIJoystick() |
| 3597 | | { |
| 3598 | | // For the exec timer, will keep track of how long the button has been pressed |
| 3599 | | static int exec_counter = 0; |
| 3600 | | const char* exec_command; |
| 3601 | | TCHAR* t_exec_command; |
| 3602 | | |
| 3603 | | if (in_emulation) |
| 3604 | | return; |
| 3605 | | |
| 3606 | | if (g_pJoyGUI == NULL) |
| 3607 | | return; |
| 3608 | | |
| 3609 | | g_pJoyGUI->poll_joysticks(); |
| 3610 | | |
| 3611 | | |
| 3612 | | // User pressed UP |
| 3613 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyUp(0), GetUIJoyUp(1), GetUIJoyUp(2),GetUIJoyUp(3)))) |
| 3614 | | { |
| 3615 | | SendMessage(hMain, WM_COMMAND, ID_UI_UP, 0); |
| 3616 | | } |
| 3617 | | |
| 3618 | | // User pressed DOWN |
| 3619 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyDown(0), GetUIJoyDown(1), GetUIJoyDown(2),GetUIJoyDown(3)))) |
| 3620 | | { |
| 3621 | | SendMessage(hMain, WM_COMMAND, ID_UI_DOWN, 0); |
| 3622 | | } |
| 3623 | | |
| 3624 | | // User pressed LEFT |
| 3625 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyLeft(0), GetUIJoyLeft(1), GetUIJoyLeft(2),GetUIJoyLeft(3)))) |
| 3626 | | { |
| 3627 | | SendMessage(hMain, WM_COMMAND, ID_UI_LEFT, 0); |
| 3628 | | } |
| 3629 | | |
| 3630 | | // User pressed RIGHT |
| 3631 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyRight(0), GetUIJoyRight(1), GetUIJoyRight(2),GetUIJoyRight(3)))) |
| 3632 | | { |
| 3633 | | SendMessage(hMain, WM_COMMAND, ID_UI_RIGHT, 0); |
| 3634 | | } |
| 3635 | | |
| 3636 | | // User pressed START GAME |
| 3637 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyStart(0), GetUIJoyStart(1), GetUIJoyStart(2),GetUIJoyStart(3)))) |
| 3638 | | { |
| 3639 | | SendMessage(hMain, WM_COMMAND, ID_UI_START, 0); |
| 3640 | | } |
| 3641 | | |
| 3642 | | // User pressed PAGE UP |
| 3643 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyPageUp(0), GetUIJoyPageUp(1), GetUIJoyPageUp(2),GetUIJoyPageUp(3)))) |
| 3644 | | { |
| 3645 | | SendMessage(hMain, WM_COMMAND, ID_UI_PGUP, 0); |
| 3646 | | } |
| 3647 | | |
| 3648 | | // User pressed PAGE DOWN |
| 3649 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyPageDown(0), GetUIJoyPageDown(1), GetUIJoyPageDown(2),GetUIJoyPageDown(3)))) |
| 3650 | | { |
| 3651 | | SendMessage(hMain, WM_COMMAND, ID_UI_PGDOWN, 0); |
| 3652 | | } |
| 3653 | | |
| 3654 | | // User pressed HOME |
| 3655 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHome(0), GetUIJoyHome(1), GetUIJoyHome(2),GetUIJoyHome(3)))) |
| 3656 | | { |
| 3657 | | SendMessage(hMain, WM_COMMAND, ID_UI_HOME, 0); |
| 3658 | | } |
| 3659 | | |
| 3660 | | // User pressed END |
| 3661 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyEnd(0), GetUIJoyEnd(1), GetUIJoyEnd(2),GetUIJoyEnd(3)))) |
| 3662 | | { |
| 3663 | | SendMessage(hMain, WM_COMMAND, ID_UI_END, 0); |
| 3664 | | } |
| 3665 | | |
| 3666 | | // User pressed CHANGE SCREENSHOT |
| 3667 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoySSChange(0), GetUIJoySSChange(1), GetUIJoySSChange(2),GetUIJoySSChange(3)))) |
| 3668 | | { |
| 3669 | | SendMessage(hMain, WM_COMMAND, IDC_SSFRAME, 0); |
| 3670 | | } |
| 3671 | | |
| 3672 | | // User pressed SCROLL HISTORY UP |
| 3673 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHistoryUp(0), GetUIJoyHistoryUp(1), GetUIJoyHistoryUp(2),GetUIJoyHistoryUp(3)))) |
| 3674 | | { |
| 3675 | | SendMessage(hMain, WM_COMMAND, ID_UI_HISTORY_UP, 0); |
| 3676 | | } |
| 3677 | | |
| 3678 | | // User pressed SCROLL HISTORY DOWN |
| 3679 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHistoryDown(0), GetUIJoyHistoryDown(1), GetUIJoyHistoryDown(2),GetUIJoyHistoryDown(3)))) |
| 3680 | | { |
| 3681 | | SendMessage(hMain, WM_COMMAND, ID_UI_HISTORY_DOWN, 0); |
| 3682 | | } |
| 3683 | | |
| 3684 | | // User pressed EXECUTE COMMANDLINE |
| 3685 | | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyExec(0), GetUIJoyExec(1), GetUIJoyExec(2),GetUIJoyExec(3)))) |
| 3686 | | { |
| 3687 | | if (++exec_counter >= GetExecWait()) // Button has been pressed > exec timeout |
| 3688 | | { |
| 3689 | | PROCESS_INFORMATION pi; |
| 3690 | | STARTUPINFO si; |
| 3691 | | |
| 3692 | | // Reset counter |
| 3693 | | exec_counter = 0; |
| 3694 | | |
| 3695 | | ZeroMemory( &si, sizeof(si) ); |
| 3696 | | ZeroMemory( &pi, sizeof(pi) ); |
| 3697 | | si.dwFlags = STARTF_FORCEONFEEDBACK; |
| 3698 | | si.cb = sizeof(si); |
| 3699 | | |
| 3700 | | exec_command = GetExecCommand(); |
| 3701 | | t_exec_command = tstring_from_utf8(exec_command); |
| 3702 | | if( !t_exec_command ) |
| 3703 | | return; |
| 3704 | | CreateProcess(NULL, t_exec_command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); |
| 3705 | | |
| 3706 | | free(t_exec_command); |
| 3707 | | |
| 3708 | | // We will not wait for the process to finish cause it might be a background task |
| 3709 | | // The process won't get closed when MAME32 closes either. |
| 3710 | | |
| 3711 | | // But close the handles cause we won't need them anymore. Will not close process. |
| 3712 | | CloseHandle(pi.hProcess); |
| 3713 | | CloseHandle(pi.hThread); |
| 3714 | | } |
| 3715 | | } |
| 3716 | | else |
| 3717 | | { |
| 3718 | | // Button has been released within the timeout period, reset the counter |
| 3719 | | exec_counter = 0; |
| 3720 | | } |
| 3721 | | } |
| 3722 | | |
| 3723 | | #if 0 |
| 3724 | | static void PressKey(HWND hwnd, UINT vk) |
| 3725 | | { |
| 3726 | | SendMessage(hwnd, WM_KEYDOWN, vk, 0); |
| 3727 | | SendMessage(hwnd, WM_KEYUP, vk, 0xc0000000); |
| 3728 | | } |
| 3729 | | #endif |
| 3730 | | |
| 3731 | | static void SetView(int menu_id) |
| 3732 | | { |
| 3733 | | BOOL force_reset = FALSE; |
| 3734 | | int i; |
| 3735 | | |
| 3736 | | // first uncheck previous menu item, check new one |
| 3737 | | CheckMenuRadioItem(GetMenu(hMain), ID_VIEW_LARGE_ICON, ID_VIEW_GROUPED, menu_id, MF_CHECKED); |
| 3738 | | ToolBar_CheckButton(hToolBar, menu_id, MF_CHECKED); |
| 3739 | | |
| 3740 | | if (Picker_GetViewID(hwndList) == VIEW_GROUPED || menu_id == ID_VIEW_GROUPED) |
| 3741 | | { |
| 3742 | | // this changes the sort order, so redo everything |
| 3743 | | force_reset = TRUE; |
| 3744 | | } |
| 3745 | | |
| 3746 | | for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++) |
| 3747 | | Picker_SetViewID(GetDlgItem(hMain, s_nPickers[i]), menu_id - ID_VIEW_LARGE_ICON); |
| 3748 | | |
| 3749 | | if (force_reset) |
| 3750 | | { |
| 3751 | | for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++) |
| 3752 | | Picker_Sort(GetDlgItem(hMain, s_nPickers[i])); |
| 3753 | | } |
| 3754 | | } |
| 3755 | | |
| 3756 | | static void ResetListView() |
| 3757 | | { |
| 3758 | | int i; |
| 3759 | | int current_game; |
| 3760 | | LV_ITEM lvi; |
| 3761 | | BOOL no_selection = FALSE; |
| 3762 | | LPTREEFOLDER lpFolder = GetCurrentFolder(); |
| 3763 | | |
| 3764 | | if (!lpFolder) |
| 3765 | | { |
| 3766 | | return; |
| 3767 | | } |
| 3768 | | |
| 3769 | | /* If the last folder was empty, no_selection is TRUE */ |
| 3770 | | if (have_selection == FALSE) |
| 3771 | | { |
| 3772 | | no_selection = TRUE; |
| 3773 | | } |
| 3774 | | |
| 3775 | | current_game = Picker_GetSelectedItem(hwndList); |
| 3776 | | |
| 3777 | | SetWindowRedraw(hwndList,FALSE); |
| 3778 | | |
| 3779 | | ListView_DeleteAllItems(hwndList); |
| 3780 | | |
| 3781 | | // hint to have it allocate it all at once |
| 3782 | | ListView_SetItemCount(hwndList,driver_list_get_count(drivers)); |
| 3783 | | |
| 3784 | | lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; |
| 3785 | | lvi.stateMask = 0; |
| 3786 | | |
| 3787 | | i = -1; |
| 3788 | | |
| 3789 | | do |
| 3790 | | { |
| 3791 | | /* Add the games that are in this folder */ |
| 3792 | | if ((i = FindGame(lpFolder, i + 1)) != -1) |
| 3793 | | { |
| 3794 | | if (GameFiltered(i, lpFolder->m_dwFlags)) |
| 3795 | | continue; |
| 3796 | | |
| 3797 | | lvi.iItem = i; |
| 3798 | | lvi.iSubItem = 0; |
| 3799 | | lvi.lParam = i; |
| 3800 | | lvi.pszText = LPSTR_TEXTCALLBACK; |
| 3801 | | lvi.iImage = I_IMAGECALLBACK; |
| 3802 | | ListView_InsertItem(hwndList, &lvi); |
| 3803 | | } |
| 3804 | | } while (i != -1); |
| 3805 | | |
| 3806 | | Picker_Sort(hwndList); |
| 3807 | | |
| 3808 | | if (bListReady) |
| 3809 | | { |
| 3810 | | /* If last folder was empty, select the first item in this folder */ |
| 3811 | | if (no_selection) |
| 3812 | | Picker_SetSelectedPick(hwndList, 0); |
| 3813 | | else |
| 3814 | | Picker_SetSelectedItem(hwndList, current_game); |
| 3815 | | } |
| 3816 | | |
| 3817 | | /*RS Instead of the Arrange Call that was here previously on all Views |
| 3818 | | We now need to set the ViewMode for SmallIcon again, |
| 3819 | | for an explanation why, see SetView*/ |
| 3820 | | if (GetViewMode() == VIEW_SMALL_ICONS) |
| 3821 | | SetView(ID_VIEW_SMALL_ICON); |
| 3822 | | |
| 3823 | | SetWindowRedraw(hwndList, TRUE); |
| 3824 | | |
| 3825 | | UpdateStatusBar(); |
| 3826 | | |
| 3827 | | } |
| 3828 | | |
| 3829 | | static void UpdateGameList(BOOL bUpdateRomAudit, BOOL bUpdateSampleAudit) |
| 3830 | | { |
| 3831 | | int i; |
| 3832 | | |
| 3833 | | for (i = 0; i < driver_list_get_count(drivers); i++) |
| 3834 | | { |
| 3835 | | if (bUpdateRomAudit && DriverUsesRoms(i)) |
| 3836 | | SetRomAuditResults(i, UNKNOWN); |
| 3837 | | if (bUpdateSampleAudit && DriverUsesSamples(i)) |
| 3838 | | SetSampleAuditResults(i, UNKNOWN); |
| 3839 | | } |
| 3840 | | |
| 3841 | | idle_work = TRUE; |
| 3842 | | bDoGameCheck = TRUE; |
| 3843 | | game_index = 0; |
| 3844 | | |
| 3845 | | ReloadIcons(); |
| 3846 | | |
| 3847 | | // Let REFRESH also load new background if found |
| 3848 | | LoadBackgroundBitmap(); |
| 3849 | | InvalidateRect(hMain,NULL,TRUE); |
| 3850 | | Picker_ResetIdle(hwndList); |
| 3851 | | } |
| 3852 | | |
| 3853 | | UINT_PTR CALLBACK CFHookProc( |
| 3854 | | HWND hdlg, // handle to dialog box |
| 3855 | | UINT uiMsg, // message identifier |
| 3856 | | WPARAM wParam, // message parameter |
| 3857 | | LPARAM lParam // message parameter |
| 3858 | | ) |
| 3859 | | { |
| 3860 | | int iIndex, i; |
| 3861 | | COLORREF cCombo, cList; |
| 3862 | | switch (uiMsg) |
| 3863 | | { |
| 3864 | | case WM_INITDIALOG: |
| 3865 | | SendDlgItemMessage(hdlg, cmb4, CB_ADDSTRING, 0, (LPARAM)TEXT("Custom")); |
| 3866 | | iIndex = SendDlgItemMessage(hdlg, cmb4, CB_GETCOUNT, 0, 0); |
| 3867 | | cList = GetListFontColor(); |
| 3868 | | SendDlgItemMessage(hdlg, cmb4, CB_SETITEMDATA,(WPARAM)iIndex-1,(LPARAM)cList ); |
| 3869 | | for( i = 0; i< iIndex; i++) |
| 3870 | | { |
| 3871 | | cCombo = SendDlgItemMessage(hdlg, cmb4, CB_GETITEMDATA,(WPARAM)i,0 ); |
| 3872 | | if( cList == cCombo) |
| 3873 | | { |
| 3874 | | SendDlgItemMessage(hdlg, cmb4, CB_SETCURSEL,(WPARAM)i,0 ); |
| 3875 | | break; |
| 3876 | | } |
| 3877 | | } |
| 3878 | | break; |
| 3879 | | case WM_COMMAND: |
| 3880 | | if( LOWORD(wParam) == cmb4) |
| 3881 | | { |
| 3882 | | switch (HIWORD(wParam)) |
| 3883 | | { |
| 3884 | | case CBN_SELCHANGE: // The color ComboBox changed selection |
| 3885 | | iIndex = (int)SendDlgItemMessage(hdlg, cmb4, |
| 3886 | | CB_GETCURSEL, 0, 0L); |
| 3887 | | if( iIndex == SendDlgItemMessage(hdlg, cmb4, CB_GETCOUNT, 0, 0)-1) |
| 3888 | | { |
| 3889 | | //Custom color selected |
| 3890 | | cList = GetListFontColor(); |
| 3891 | | PickColor(&cList); |
| 3892 | | SendDlgItemMessage(hdlg, cmb4, CB_DELETESTRING, iIndex, 0); |
| 3893 | | SendDlgItemMessage(hdlg, cmb4, CB_ADDSTRING, 0, (LPARAM)TEXT("Custom")); |
| 3894 | | SendDlgItemMessage(hdlg, cmb4, CB_SETITEMDATA,(WPARAM)iIndex,(LPARAM)cList); |
| 3895 | | SendDlgItemMessage(hdlg, cmb4, CB_SETCURSEL,(WPARAM)iIndex,0 ); |
| 3896 | | return TRUE; |
| 3897 | | } |
| 3898 | | } |
| 3899 | | } |
| 3900 | | break; |
| 3901 | | } |
| 3902 | | return FALSE; |
| 3903 | | } |
| 3904 | | |
| 3905 | | static void PickFont(void) |
| 3906 | | { |
| 3907 | | LOGFONT font; |
| 3908 | | CHOOSEFONT cf; |
| 3909 | | TCHAR szClass[128]; |
| 3910 | | HWND hWnd; |
| 3911 | | |
| 3912 | | GetListFont(&font); |
| 3913 | | font.lfQuality = DEFAULT_QUALITY; |
| 3914 | | |
| 3915 | | cf.lStructSize = sizeof(CHOOSEFONT); |
| 3916 | | cf.hwndOwner = hMain; |
| 3917 | | cf.lpLogFont = &font; |
| 3918 | | cf.lpfnHook = &CFHookProc; |
| 3919 | | cf.rgbColors = GetListFontColor(); |
| 3920 | | cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_ENABLEHOOK; |
| 3921 | | if (!ChooseFont(&cf)) |
| 3922 | | return; |
| 3923 | | |
| 3924 | | SetListFont(&font); |
| 3925 | | if (hFont != NULL) |
| 3926 | | DeleteObject(hFont); |
| 3927 | | hFont = CreateFontIndirect(&font); |
| 3928 | | if (hFont != NULL) |
| 3929 | | { |
| 3930 | | COLORREF textColor = cf.rgbColors; |
| 3931 | | |
| 3932 | | if (textColor == RGB(255,255,255)) |
| 3933 | | { |
| 3934 | | textColor = RGB(240, 240, 240); |
| 3935 | | } |
| 3936 | | |
| 3937 | | SetAllWindowsFont(hMain, &main_resize, hFont, TRUE); |
| 3938 | | |
| 3939 | | hWnd = GetWindow(hMain, GW_CHILD); |
| 3940 | | while(hWnd) |
| 3941 | | { |
| 3942 | | if (GetClassName(hWnd, szClass, sizeof(szClass) / sizeof(szClass[0]))) |
| 3943 | | { |
| 3944 | | if (!_tcscmp(szClass, TEXT("SysListView32"))) |
| 3945 | | { |
| 3946 | | ListView_SetTextColor(hWnd, textColor); |
| 3947 | | } |
| 3948 | | else if (!_tcscmp(szClass, TEXT("SysTreeView32"))) |
| 3949 | | { |
| 3950 | | TreeView_SetTextColor(hTreeView, textColor); |
| 3951 | | } |
| 3952 | | } |
| 3953 | | hWnd = GetWindow(hWnd, GW_HWNDNEXT); |
| 3954 | | } |
| 3955 | | SetListFontColor(cf.rgbColors); |
| 3956 | | ResetListView(); |
| 3957 | | } |
| 3958 | | } |
| 3959 | | |
| 3960 | | static void PickColor(COLORREF *cDefault) |
| 3961 | | { |
| 3962 | | CHOOSECOLOR cc; |
| 3963 | | COLORREF choice_colors[16]; |
| 3964 | | int i; |
| 3965 | | |
| 3966 | | for (i=0;i<16;i++) |
| 3967 | | choice_colors[i] = GetCustomColor(i); |
| 3968 | | |
| 3969 | | cc.lStructSize = sizeof(CHOOSECOLOR); |
| 3970 | | cc.hwndOwner = hMain; |
| 3971 | | cc.rgbResult = *cDefault; |
| 3972 | | cc.lpCustColors = choice_colors; |
| 3973 | | cc.Flags = CC_ANYCOLOR | CC_RGBINIT | CC_SOLIDCOLOR; |
| 3974 | | if (!ChooseColor(&cc)) |
| 3975 | | return; |
| 3976 | | for (i=0;i<16;i++) |
| 3977 | | SetCustomColor(i,choice_colors[i]); |
| 3978 | | *cDefault = cc.rgbResult; |
| 3979 | | } |
| 3980 | | |
| 3981 | | static void PickCloneColor(void) |
| 3982 | | { |
| 3983 | | COLORREF cClonecolor; |
| 3984 | | cClonecolor = GetListCloneColor(); |
| 3985 | | PickColor( &cClonecolor); |
| 3986 | | SetListCloneColor(cClonecolor); |
| 3987 | | InvalidateRect(hwndList,NULL,FALSE); |
| 3988 | | } |
| 3989 | | |
| 3990 | | static BOOL MameCommand(HWND hwnd,int id, HWND hwndCtl, UINT codeNotify) |
| 3991 | | { |
| 3992 | | int i; |
| 3993 | | LPTREEFOLDER folder; |
| 3994 | | char* t_szFile; |
| 3995 | | |
| 3996 | | switch (id) |
| 3997 | | { |
| 3998 | | case ID_FILE_PLAY: |
| 3999 | | MamePlayGame(); |
| 4000 | | return TRUE; |
| 4001 | | |
| 4002 | | case ID_FILE_PLAY_RECORD: |
| 4003 | | MamePlayRecordGame(); |
| 4004 | | return TRUE; |
| 4005 | | |
| 4006 | | case ID_FILE_PLAY_BACK: |
| 4007 | | MamePlayBackGame(); |
| 4008 | | return TRUE; |
| 4009 | | |
| 4010 | | case ID_FILE_PLAY_RECORD_WAVE: |
| 4011 | | MamePlayRecordWave(); |
| 4012 | | return TRUE; |
| 4013 | | |
| 4014 | | case ID_FILE_PLAY_RECORD_MNG: |
| 4015 | | MamePlayRecordMNG(); |
| 4016 | | return TRUE; |
| 4017 | | |
| 4018 | | case ID_FILE_LOADSTATE : |
| 4019 | | MameLoadState(); |
| 4020 | | return TRUE; |
| 4021 | | |
| 4022 | | case ID_FILE_AUDIT: |
| 4023 | | AuditDialog(hMain); |
| 4024 | | ResetWhichGamesInFolders(); |
| 4025 | | ResetListView(); |
| 4026 | | SetFocus(hwndList); |
| 4027 | | return TRUE; |
| 4028 | | |
| 4029 | | case ID_FILE_EXIT: |
| 4030 | | PostMessage(hMain, WM_CLOSE, 0, 0); |
| 4031 | | return TRUE; |
| 4032 | | |
| 4033 | | case ID_VIEW_LARGE_ICON: |
| 4034 | | SetView(ID_VIEW_LARGE_ICON); |
| 4035 | | return TRUE; |
| 4036 | | |
| 4037 | | case ID_VIEW_SMALL_ICON: |
| 4038 | | SetView(ID_VIEW_SMALL_ICON); |
| 4039 | | ResetListView(); |
| 4040 | | return TRUE; |
| 4041 | | |
| 4042 | | case ID_VIEW_LIST_MENU: |
| 4043 | | SetView(ID_VIEW_LIST_MENU); |
| 4044 | | return TRUE; |
| 4045 | | |
| 4046 | | case ID_VIEW_DETAIL: |
| 4047 | | SetView(ID_VIEW_DETAIL); |
| 4048 | | return TRUE; |
| 4049 | | |
| 4050 | | case ID_VIEW_GROUPED: |
| 4051 | | SetView(ID_VIEW_GROUPED); |
| 4052 | | return TRUE; |
| 4053 | | |
| 4054 | | /* Arrange Icons submenu */ |
| 4055 | | case ID_VIEW_BYGAME: |
| 4056 | | SetSortReverse(FALSE); |
| 4057 | | SetSortColumn(COLUMN_GAMES); |
| 4058 | | Picker_Sort(hwndList); |
| 4059 | | break; |
| 4060 | | |
| 4061 | | case ID_VIEW_BYDIRECTORY: |
| 4062 | | SetSortReverse(FALSE); |
| 4063 | | SetSortColumn(COLUMN_DIRECTORY); |
| 4064 | | Picker_Sort(hwndList); |
| 4065 | | break; |
| 4066 | | |
| 4067 | | case ID_VIEW_BYMANUFACTURER: |
| 4068 | | SetSortReverse(FALSE); |
| 4069 | | SetSortColumn(COLUMN_MANUFACTURER); |
| 4070 | | Picker_Sort(hwndList); |
| 4071 | | break; |
| 4072 | | |
| 4073 | | case ID_VIEW_BYTIMESPLAYED: |
| 4074 | | SetSortReverse(FALSE); |
| 4075 | | SetSortColumn(COLUMN_PLAYED); |
| 4076 | | Picker_Sort(hwndList); |
| 4077 | | break; |
| 4078 | | |
| 4079 | | case ID_VIEW_BYTYPE: |
| 4080 | | SetSortReverse(FALSE); |
| 4081 | | SetSortColumn(COLUMN_TYPE); |
| 4082 | | Picker_Sort(hwndList); |
| 4083 | | break; |
| 4084 | | |
| 4085 | | case ID_VIEW_BYYEAR: |
| 4086 | | SetSortReverse(FALSE); |
| 4087 | | SetSortColumn(COLUMN_YEAR); |
| 4088 | | Picker_Sort(hwndList); |
| 4089 | | break; |
| 4090 | | |
| 4091 | | case ID_VIEW_FOLDERS: |
| 4092 | | bShowTree = !bShowTree; |
| 4093 | | SetShowFolderList(bShowTree); |
| 4094 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED); |
| 4095 | | ToolBar_CheckButton(hToolBar, ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED); |
| 4096 | | UpdateScreenShot(); |
| 4097 | | break; |
| 4098 | | |
| 4099 | | case ID_VIEW_TOOLBARS: |
| 4100 | | bShowToolBar = !bShowToolBar; |
| 4101 | | SetShowToolBar(bShowToolBar); |
| 4102 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED); |
| 4103 | | ToolBar_CheckButton(hToolBar, ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED); |
| 4104 | | ShowWindow(hToolBar, (bShowToolBar) ? SW_SHOW : SW_HIDE); |
| 4105 | | ResizePickerControls(hMain); |
| 4106 | | UpdateScreenShot(); |
| 4107 | | break; |
| 4108 | | |
| 4109 | | case ID_VIEW_STATUS: |
| 4110 | | bShowStatusBar = !bShowStatusBar; |
| 4111 | | SetShowStatusBar(bShowStatusBar); |
| 4112 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED); |
| 4113 | | ToolBar_CheckButton(hToolBar, ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED); |
| 4114 | | ShowWindow(hStatusBar, (bShowStatusBar) ? SW_SHOW : SW_HIDE); |
| 4115 | | ResizePickerControls(hMain); |
| 4116 | | UpdateScreenShot(); |
| 4117 | | break; |
| 4118 | | |
| 4119 | | case ID_VIEW_PAGETAB: |
| 4120 | | bShowTabCtrl = !bShowTabCtrl; |
| 4121 | | SetShowTabCtrl(bShowTabCtrl); |
| 4122 | | ShowWindow(hTabCtrl, (bShowTabCtrl) ? SW_SHOW : SW_HIDE); |
| 4123 | | ResizePickerControls(hMain); |
| 4124 | | UpdateScreenShot(); |
| 4125 | | InvalidateRect(hMain,NULL,TRUE); |
| 4126 | | break; |
| 4127 | | |
| 4128 | | /* |
| 4129 | | Switches to fullscreen mode. No check mark handeling |
| 4130 | | for this item cause in fullscreen mode the menu won't |
| 4131 | | be visible anyways. |
| 4132 | | */ |
| 4133 | | case ID_VIEW_FULLSCREEN: |
| 4134 | | SwitchFullScreenMode(); |
| 4135 | | break; |
| 4136 | | |
| 4137 | | case ID_TOOLBAR_EDIT: |
| 4138 | | { |
| 4139 | | char buf[256]; |
| 4140 | | |
| 4141 | | win_get_window_text_utf8(hwndCtl, buf, sizeof(buf)); |
| 4142 | | switch (codeNotify) |
| 4143 | | { |
| 4144 | | case EN_CHANGE: |
| 4145 | | //put search routine here first, add a 200ms timer later. |
| 4146 | | if ((!_stricmp(buf, SEARCH_PROMPT) && !_stricmp(g_SearchText, "")) || |
| 4147 | | (!_stricmp(g_SearchText, SEARCH_PROMPT) && !_stricmp(buf, ""))) |
| 4148 | | { |
| 4149 | | strcpy(g_SearchText, buf); |
| 4150 | | } |
| 4151 | | else |
| 4152 | | { |
| 4153 | | strcpy(g_SearchText, buf); |
| 4154 | | ResetListView(); |
| 4155 | | } |
| 4156 | | break; |
| 4157 | | case EN_SETFOCUS: |
| 4158 | | if (!_stricmp(buf, SEARCH_PROMPT)) |
| 4159 | | win_set_window_text_utf8(hwndCtl, ""); |
| 4160 | | break; |
| 4161 | | case EN_KILLFOCUS: |
| 4162 | | if (strlen(buf) == 0) |
| 4163 | | win_set_window_text_utf8(hwndCtl, SEARCH_PROMPT); |
| 4164 | | break; |
| 4165 | | } |
| 4166 | | } |
| 4167 | | break; |
| 4168 | | |
| 4169 | | case ID_GAME_AUDIT: |
| 4170 | | InitGameAudit(0); |
| 4171 | | if (!oldControl) |
| 4172 | | { |
| 4173 | | InitPropertyPageToPage(hInst, hwnd, GetSelectedPickItemIcon(), OPTIONS_GAME, -1, Picker_GetSelectedItem(hwndList), AUDIT_PAGE); |
| 4174 | | } |
| 4175 | | /* Just in case the toggle MMX on/off */ |
| 4176 | | UpdateStatusBar(); |
| 4177 | | break; |
| 4178 | | |
| 4179 | | /* ListView Context Menu */ |
| 4180 | | case ID_CONTEXT_ADD_CUSTOM: |
| 4181 | | { |
| 4182 | | int nResult; |
| 4183 | | |
| 4184 | | nResult = DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_CUSTOM_FILE), |
| 4185 | | hMain,AddCustomFileDialogProc,Picker_GetSelectedItem(hwndList)); |
| 4186 | | SetFocus(hwndList); |
| 4187 | | break; |
| 4188 | | } |
| 4189 | | |
| 4190 | | case ID_CONTEXT_REMOVE_CUSTOM: |
| 4191 | | { |
| 4192 | | RemoveCurrentGameCustomFolder(); |
| 4193 | | break; |
| 4194 | | } |
| 4195 | | |
| 4196 | | /* Tree Context Menu */ |
| 4197 | | case ID_CONTEXT_FILTERS: |
| 4198 | | if (DialogBox(GetModuleHandle(NULL), |
| 4199 | | MAKEINTRESOURCE(IDD_FILTERS), hMain, FilterDialogProc) == TRUE) |
| 4200 | | ResetListView(); |
| 4201 | | SetFocus(hwndList); |
| 4202 | | return TRUE; |
| 4203 | | |
| 4204 | | // ScreenShot Context Menu |
| 4205 | | // select current tab |
| 4206 | | case ID_VIEW_TAB_SCREENSHOT : |
| 4207 | | case ID_VIEW_TAB_FLYER : |
| 4208 | | case ID_VIEW_TAB_CABINET : |
| 4209 | | case ID_VIEW_TAB_MARQUEE : |
| 4210 | | case ID_VIEW_TAB_TITLE : |
| 4211 | | case ID_VIEW_TAB_CONTROL_PANEL : |
| 4212 | | case ID_VIEW_TAB_PCB : |
| 4213 | | case ID_VIEW_TAB_HISTORY: |
| 4214 | | if (id == ID_VIEW_TAB_HISTORY && GetShowTab(TAB_HISTORY) == FALSE) |
| 4215 | | break; |
| 4216 | | |
| 4217 | | TabView_SetCurrentTab(hTabCtrl, id - ID_VIEW_TAB_SCREENSHOT); |
| 4218 | | UpdateScreenShot(); |
| 4219 | | TabView_UpdateSelection(hTabCtrl); |
| 4220 | | break; |
| 4221 | | |
| 4222 | | // toggle tab's existence |
| 4223 | | case ID_TOGGLE_TAB_SCREENSHOT : |
| 4224 | | case ID_TOGGLE_TAB_FLYER : |
| 4225 | | case ID_TOGGLE_TAB_CABINET : |
| 4226 | | case ID_TOGGLE_TAB_MARQUEE : |
| 4227 | | case ID_TOGGLE_TAB_TITLE : |
| 4228 | | case ID_TOGGLE_TAB_CONTROL_PANEL : |
| 4229 | | case ID_TOGGLE_TAB_PCB : |
| 4230 | | case ID_TOGGLE_TAB_HISTORY : |
| 4231 | | { |
| 4232 | | int toggle_flag = id - ID_TOGGLE_TAB_SCREENSHOT; |
| 4233 | | |
| 4234 | | if (AllowedToSetShowTab(toggle_flag,!GetShowTab(toggle_flag)) == FALSE) |
| 4235 | | { |
| 4236 | | // attempt to hide the last tab |
| 4237 | | // should show error dialog? hide picture area? or ignore? |
| 4238 | | break; |
| 4239 | | } |
| 4240 | | |
| 4241 | | SetShowTab(toggle_flag,!GetShowTab(toggle_flag)); |
| 4242 | | |
| 4243 | | TabView_Reset(hTabCtrl); |
| 4244 | | |
| 4245 | | if (TabView_GetCurrentTab(hTabCtrl) == toggle_flag && GetShowTab(toggle_flag) == FALSE) |
| 4246 | | { |
| 4247 | | // we're deleting the tab we're on, so go to the next one |
| 4248 | | TabView_CalculateNextTab(hTabCtrl); |
| 4249 | | } |
| 4250 | | |
| 4251 | | |
| 4252 | | // Resize the controls in case we toggled to another history |
| 4253 | | // mode (and the history control needs resizing). |
| 4254 | | |
| 4255 | | ResizePickerControls(hMain); |
| 4256 | | UpdateScreenShot(); |
| 4257 | | |
| 4258 | | TabView_UpdateSelection(hTabCtrl); |
| 4259 | | |
| 4260 | | break; |
| 4261 | | } |
| 4262 | | |
| 4263 | | /* Header Context Menu */ |
| 4264 | | case ID_SORT_ASCENDING: |
| 4265 | | SetSortReverse(FALSE); |
| 4266 | | SetSortColumn(Picker_GetRealColumnFromViewColumn(hwndList, lastColumnClick)); |
| 4267 | | Picker_Sort(hwndList); |
| 4268 | | break; |
| 4269 | | |
| 4270 | | case ID_SORT_DESCENDING: |
| 4271 | | SetSortReverse(TRUE); |
| 4272 | | SetSortColumn(Picker_GetRealColumnFromViewColumn(hwndList, lastColumnClick)); |
| 4273 | | Picker_Sort(hwndList); |
| 4274 | | break; |
| 4275 | | |
| 4276 | | case ID_CUSTOMIZE_FIELDS: |
| 4277 | | if (DialogBox(GetModuleHandle(NULL), |
| 4278 | | MAKEINTRESOURCE(IDD_COLUMNS), hMain, ColumnDialogProc) == TRUE) |
| 4279 | | ResetColumnDisplay(FALSE); |
| 4280 | | SetFocus(hwndList); |
| 4281 | | return TRUE; |
| 4282 | | |
| 4283 | | /* View Menu */ |
| 4284 | | case ID_VIEW_LINEUPICONS: |
| 4285 | | if( codeNotify == FALSE) |
| 4286 | | ResetListView(); |
| 4287 | | else |
| 4288 | | { |
| 4289 | | /*it was sent after a refresh (F5) was done, we only reset the View if "available" is the selected folder |
| 4290 | | as it doesn't affect the others*/ |
| 4291 | | folder = GetSelectedFolder(); |
| 4292 | | if( folder ) |
| 4293 | | { |
| 4294 | | if (folder->m_nFolderId == FOLDER_AVAILABLE ) |
| 4295 | | ResetListView(); |
| 4296 | | |
| 4297 | | } |
| 4298 | | } |
| 4299 | | break; |
| 4300 | | |
| 4301 | | case ID_GAME_PROPERTIES: |
| 4302 | | if (!oldControl) |
| 4303 | | { |
| 4304 | | folder = GetFolderByName(FOLDER_SOURCE, GetDriverFilename(Picker_GetSelectedItem(hwndList)) ); |
| 4305 | | InitPropertyPage(hInst, hwnd, GetSelectedPickItemIcon(), OPTIONS_GAME, folder->m_nFolderId, Picker_GetSelectedItem(hwndList)); |
| 4306 | | #ifdef MESS |
| 4307 | | { |
| 4308 | | extern BOOL g_bModifiedSoftwarePaths; |
| 4309 | | if (g_bModifiedSoftwarePaths) { |
| 4310 | | g_bModifiedSoftwarePaths = FALSE; |
| 4311 | | MessUpdateSoftwareList(); |
| 4312 | | } |
| 4313 | | } |
| 4314 | | #endif |
| 4315 | | } |
| 4316 | | /* Just in case the toggle MMX on/off */ |
| 4317 | | UpdateStatusBar(); |
| 4318 | | break; |
| 4319 | | |
| 4320 | | case ID_FOLDER_PROPERTIES: |
| 4321 | | if (!oldControl) |
| 4322 | | { |
| 4323 | | folder = GetSelectedFolder(); |
| 4324 | | InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), (folder->m_nFolderId == FOLDER_VECTOR) ? OPTIONS_VECTOR : OPTIONS_SOURCE, folder->m_nFolderId, Picker_GetSelectedItem(hwndList)); |
| 4325 | | //SaveFolderOptions(folder->m_nFolderId, Picker_GetSelectedItem(hwndList) ); |
| 4326 | | } |
| 4327 | | /* Just in case the toggle MMX on/off */ |
| 4328 | | UpdateStatusBar(); |
| 4329 | | break; |
| 4330 | | |
| 4331 | | case ID_FOLDER_SOURCEPROPERTIES: |
| 4332 | | if (!oldControl) |
| 4333 | | { |
| 4334 | | folder = GetFolderByName(FOLDER_SOURCE, GetDriverFilename(Picker_GetSelectedItem(hwndList)) ); |
| 4335 | | InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), (folder->m_nFolderId == FOLDER_VECTOR) ? OPTIONS_VECTOR : OPTIONS_SOURCE , folder->m_nFolderId, Picker_GetSelectedItem(hwndList)); |
| 4336 | | //SaveFolderOptions(folder->m_nFolderId, Picker_GetSelectedItem(hwndList) ); |
| 4337 | | } |
| 4338 | | /* Just in case the toggle MMX on/off */ |
| 4339 | | UpdateStatusBar(); |
| 4340 | | break; |
| 4341 | | |
| 4342 | | case ID_FOLDER_VECTORPROPERTIES: |
| 4343 | | if (!oldControl) |
| 4344 | | { |
| 4345 | | folder = GetFolderByID( FOLDER_VECTOR ); |
| 4346 | | InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), OPTIONS_VECTOR, folder->m_nFolderId, Picker_GetSelectedItem(hwndList)); |
| 4347 | | //SaveFolderOptions(folder->m_nFolderId, Picker_GetSelectedItem(hwndList) ); |
| 4348 | | } |
| 4349 | | /* Just in case the toggle MMX on/off */ |
| 4350 | | UpdateStatusBar(); |
| 4351 | | break; |
| 4352 | | |
| 4353 | | case ID_FOLDER_AUDIT: |
| 4354 | | FolderCheck(); |
| 4355 | | /* Just in case the toggle MMX on/off */ |
| 4356 | | UpdateStatusBar(); |
| 4357 | | break; |
| 4358 | | |
| 4359 | | case ID_VIEW_PICTURE_AREA : |
| 4360 | | ToggleScreenShot(); |
| 4361 | | break; |
| 4362 | | |
| 4363 | | case ID_UPDATE_GAMELIST: |
| 4364 | | UpdateGameList(TRUE, TRUE); |
| 4365 | | break; |
| 4366 | | |
| 4367 | | case ID_OPTIONS_FONT: |
| 4368 | | PickFont(); |
| 4369 | | return TRUE; |
| 4370 | | |
| 4371 | | case ID_OPTIONS_CLONE_COLOR: |
| 4372 | | PickCloneColor(); |
| 4373 | | return TRUE; |
| 4374 | | |
| 4375 | | case ID_OPTIONS_DEFAULTS: |
| 4376 | | /* Check the return value to see if changes were applied */ |
| 4377 | | if (!oldControl) |
| 4378 | | { |
| 4379 | | InitDefaultPropertyPage(hInst, hwnd); |
| 4380 | | SaveDefaultOptions(); |
| 4381 | | } |
| 4382 | | SetFocus(hwndList); |
| 4383 | | return TRUE; |
| 4384 | | |
| 4385 | | case ID_OPTIONS_DIR: |
| 4386 | | { |
| 4387 | | int nResult; |
| 4388 | | BOOL bUpdateRoms; |
| 4389 | | BOOL bUpdateSamples; |
| 4390 | | #ifdef MESS |
| 4391 | | BOOL bUpdateSoftware; |
| 4392 | | #endif |
| 4393 | | |
| 4394 | | nResult = DialogBox(GetModuleHandle(NULL), |
| 4395 | | MAKEINTRESOURCE(IDD_DIRECTORIES), |
| 4396 | | hMain, |
| 4397 | | DirectoriesDialogProc); |
| 4398 | | |
| 4399 | | SaveDefaultOptions(); |
| 4400 | | |
| 4401 | | bUpdateRoms = ((nResult & DIRDLG_ROMS) == DIRDLG_ROMS) ? TRUE : FALSE; |
| 4402 | | bUpdateSamples = ((nResult & DIRDLG_SAMPLES) == DIRDLG_SAMPLES) ? TRUE : FALSE; |
| 4403 | | #ifdef MESS |
| 4404 | | bUpdateSoftware = ((nResult & DIRDLG_SOFTWARE) == DIRDLG_SOFTWARE) ? TRUE : FALSE; |
| 4405 | | |
| 4406 | | if (bUpdateSoftware) |
| 4407 | | MessUpdateSoftwareList(); |
| 4408 | | #endif /* MESS */ |
| 4409 | | |
| 4410 | | if (s_pWatcher) |
| 4411 | | { |
| 4412 | | if (bUpdateRoms) |
| 4413 | | DirWatcher_Watch(s_pWatcher, 0, GetRomDirs(), TRUE); |
| 4414 | | if (bUpdateSamples) |
| 4415 | | DirWatcher_Watch(s_pWatcher, 1, GetSampleDirs(), TRUE); |
| 4416 | | } |
| 4417 | | |
| 4418 | | /* update game list */ |
| 4419 | | if (bUpdateRoms == TRUE || bUpdateSamples == TRUE) |
| 4420 | | UpdateGameList(bUpdateRoms, bUpdateSamples); |
| 4421 | | |
| 4422 | | SetFocus(hwndList); |
| 4423 | | } |
| 4424 | | return TRUE; |
| 4425 | | |
| 4426 | | case ID_OPTIONS_RESET_DEFAULTS: |
| 4427 | | if (DialogBox(GetModuleHandle(NULL), |
| 4428 | | MAKEINTRESOURCE(IDD_RESET), hMain, ResetDialogProc) == TRUE) |
| 4429 | | { |
| 4430 | | // these may have been changed |
| 4431 | | SaveDefaultOptions(); |
| 4432 | | DestroyWindow(hwnd); |
| 4433 | | PostQuitMessage(0); |
| 4434 | | } else { |
| 4435 | | ResetListView(); |
| 4436 | | SetFocus(hwndList); |
| 4437 | | } |
| 4438 | | return TRUE; |
| 4439 | | |
| 4440 | | case ID_OPTIONS_INTERFACE: |
| 4441 | | DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_INTERFACE_OPTIONS), |
| 4442 | | hMain, InterfaceDialogProc); |
| 4443 | | SaveDefaultOptions(); |
| 4444 | | |
| 4445 | | KillTimer(hMain, SCREENSHOT_TIMER); |
| 4446 | | if( GetCycleScreenshot() > 0) |
| 4447 | | { |
| 4448 | | SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL ); // Scale to seconds |
| 4449 | | } |
| 4450 | | |
| 4451 | | return TRUE; |
| 4452 | | |
| 4453 | | case ID_OPTIONS_BG: |
| 4454 | | { |
| 4455 | | OPENFILENAME OpenFileName; |
| 4456 | | static TCHAR szFile[MAX_PATH] = TEXT("\0"); |
| 4457 | | TCHAR* t_bgdir = tstring_from_utf8(GetBgDir()); |
| 4458 | | if( !t_bgdir ) |
| 4459 | | return FALSE; |
| 4460 | | |
| 4461 | | OpenFileName.lStructSize = sizeof(OPENFILENAME); |
| 4462 | | OpenFileName.hwndOwner = hMain; |
| 4463 | | OpenFileName.hInstance = 0; |
| 4464 | | OpenFileName.lpstrFilter = TEXT("Image Files (*.png, *.bmp)\0*.PNG;*.BMP\0"); |
| 4465 | | OpenFileName.lpstrCustomFilter = NULL; |
| 4466 | | OpenFileName.nMaxCustFilter = 0; |
| 4467 | | OpenFileName.nFilterIndex = 1; |
| 4468 | | OpenFileName.lpstrFile = szFile; |
| 4469 | | OpenFileName.nMaxFile = sizeof(szFile); |
| 4470 | | OpenFileName.lpstrFileTitle = NULL; |
| 4471 | | OpenFileName.nMaxFileTitle = 0; |
| 4472 | | OpenFileName.lpstrInitialDir = t_bgdir; |
| 4473 | | OpenFileName.lpstrTitle = TEXT("Select a Background Image"); |
| 4474 | | OpenFileName.nFileOffset = 0; |
| 4475 | | OpenFileName.nFileExtension = 0; |
| 4476 | | OpenFileName.lpstrDefExt = NULL; |
| 4477 | | OpenFileName.lCustData = 0; |
| 4478 | | OpenFileName.lpfnHook = NULL; |
| 4479 | | OpenFileName.lpTemplateName = NULL; |
| 4480 | | OpenFileName.Flags = OFN_NOCHANGEDIR | OFN_SHOWHELP | OFN_EXPLORER; |
| 4481 | | |
| 4482 | | if (GetOpenFileName(&OpenFileName)) |
| 4483 | | { |
| 4484 | | t_szFile = utf8_from_tstring(szFile); |
| 4485 | | if( !t_szFile ) |
| 4486 | | return FALSE; |
| 4487 | | ResetBackground(t_szFile); |
| 4488 | | LoadBackgroundBitmap(); |
| 4489 | | InvalidateRect(hMain, NULL, TRUE); |
| 4490 | | free(t_bgdir); |
| 4491 | | free(t_szFile); |
| 4492 | | return TRUE; |
| 4493 | | } |
| 4494 | | free(t_bgdir); |
| 4495 | | } |
| 4496 | | break; |
| 4497 | | |
| 4498 | | case ID_OPTIONS_LANGUAGE: |
| 4499 | | DialogBox(GetModuleHandle(NULL), |
| 4500 | | MAKEINTRESOURCE(IDD_LANGUAGE), |
| 4501 | | hMain, |
| 4502 | | LanguageDialogProc); |
| 4503 | | return TRUE; |
| 4504 | | |
| 4505 | | case ID_HELP_ABOUT: |
| 4506 | | DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUT), |
| 4507 | | hMain, AboutDialogProc); |
| 4508 | | SetFocus(hwndList); |
| 4509 | | return TRUE; |
| 4510 | | |
| 4511 | | case IDOK : |
| 4512 | | /* cmk -- might need to check more codes here, not sure */ |
| 4513 | | if (codeNotify != EN_CHANGE && codeNotify != EN_UPDATE) |
| 4514 | | { |
| 4515 | | /* enter key */ |
| 4516 | | if (g_in_treeview_edit) |
| 4517 | | { |
| 4518 | | TreeView_EndEditLabelNow(hTreeView, FALSE); |
| 4519 | | return TRUE; |
| 4520 | | } |
| 4521 | | else |
| 4522 | | if (have_selection) |
| 4523 | | MamePlayGame(); |
| 4524 | | } |
| 4525 | | break; |
| 4526 | | |
| 4527 | | case IDCANCEL : /* esc key */ |
| 4528 | | if (g_in_treeview_edit) |
| 4529 | | TreeView_EndEditLabelNow(hTreeView, TRUE); |
| 4530 | | break; |
| 4531 | | |
| 4532 | | case IDC_PLAY_GAME : |
| 4533 | | if (have_selection) |
| 4534 | | MamePlayGame(); |
| 4535 | | break; |
| 4536 | | |
| 4537 | | case ID_UI_START: |
| 4538 | | SetFocus(hwndList); |
| 4539 | | MamePlayGame(); |
| 4540 | | break; |
| 4541 | | |
| 4542 | | case ID_UI_UP: |
| 4543 | | Picker_SetSelectedPick(hwndList, GetSelectedPick() - 1); |
| 4544 | | break; |
| 4545 | | |
| 4546 | | case ID_UI_DOWN: |
| 4547 | | Picker_SetSelectedPick(hwndList, GetSelectedPick() + 1); |
| 4548 | | break; |
| 4549 | | |
| 4550 | | case ID_UI_PGUP: |
| 4551 | | Picker_SetSelectedPick(hwndList, GetSelectedPick() - ListView_GetCountPerPage(hwndList)); |
| 4552 | | break; |
| 4553 | | |
| 4554 | | case ID_UI_PGDOWN: |
| 4555 | | if ( (GetSelectedPick() + ListView_GetCountPerPage(hwndList)) < ListView_GetItemCount(hwndList) ) |
| 4556 | | Picker_SetSelectedPick(hwndList, GetSelectedPick() + ListView_GetCountPerPage(hwndList) ); |
| 4557 | | else |
| 4558 | | Picker_SetSelectedPick(hwndList, ListView_GetItemCount(hwndList)-1 ); |
| 4559 | | break; |
| 4560 | | |
| 4561 | | case ID_UI_HOME: |
| 4562 | | Picker_SetSelectedPick(hwndList, 0); |
| 4563 | | break; |
| 4564 | | |
| 4565 | | case ID_UI_END: |
| 4566 | | Picker_SetSelectedPick(hwndList, ListView_GetItemCount(hwndList)-1 ); |
| 4567 | | break; |
| 4568 | | case ID_UI_LEFT: |
| 4569 | | /* hmmmmm..... */ |
| 4570 | | SendMessage(hwndList,WM_HSCROLL, SB_LINELEFT, 0); |
| 4571 | | break; |
| 4572 | | |
| 4573 | | case ID_UI_RIGHT: |
| 4574 | | /* hmmmmm..... */ |
| 4575 | | SendMessage(hwndList,WM_HSCROLL, SB_LINERIGHT, 0); |
| 4576 | | break; |
| 4577 | | case ID_UI_HISTORY_UP: |
| 4578 | | /* hmmmmm..... */ |
| 4579 | | { |
| 4580 | | HWND hHistory = GetDlgItem(hMain, IDC_HISTORY); |
| 4581 | | SendMessage(hHistory, EM_SCROLL, SB_PAGEUP, 0); |
| 4582 | | } |
| 4583 | | break; |
| 4584 | | |
| 4585 | | case ID_UI_HISTORY_DOWN: |
| 4586 | | /* hmmmmm..... */ |
| 4587 | | { |
| 4588 | | HWND hHistory = GetDlgItem(hMain, IDC_HISTORY); |
| 4589 | | SendMessage(hHistory, EM_SCROLL, SB_PAGEDOWN, 0); |
| 4590 | | } |
| 4591 | | break; |
| 4592 | | |
| 4593 | | case IDC_SSFRAME: |
| 4594 | | TabView_CalculateNextTab(hTabCtrl); |
| 4595 | | UpdateScreenShot(); |
| 4596 | | TabView_UpdateSelection(hTabCtrl); |
| 4597 | | break; |
| 4598 | | |
| 4599 | | case ID_CONTEXT_SELECT_RANDOM: |
| 4600 | | SetRandomPickItem(); |
| 4601 | | break; |
| 4602 | | |
| 4603 | | case ID_CONTEXT_RESET_PLAYTIME: |
| 4604 | | ResetPlayTime( Picker_GetSelectedItem(hwndList) ); |
| 4605 | | ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick()); |
| 4606 | | break; |
| 4607 | | |
| 4608 | | case ID_CONTEXT_RESET_PLAYCOUNT: |
| 4609 | | ResetPlayCount( Picker_GetSelectedItem(hwndList) ); |
| 4610 | | ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick()); |
| 4611 | | break; |
| 4612 | | |
| 4613 | | case ID_CONTEXT_RENAME_CUSTOM : |
| 4614 | | TreeView_EditLabel(hTreeView,TreeView_GetSelection(hTreeView)); |
| 4615 | | break; |
| 4616 | | |
| 4617 | | default: |
| 4618 | | if (id >= ID_CONTEXT_SHOW_FOLDER_START && id < ID_CONTEXT_SHOW_FOLDER_END) |
| 4619 | | { |
| 4620 | | ToggleShowFolder(id - ID_CONTEXT_SHOW_FOLDER_START); |
| 4621 | | break; |
| 4622 | | } |
| 4623 | | for (i = 0; g_helpInfo[i].nMenuItem > 0; i++) |
| 4624 | | { |
| 4625 | | if (g_helpInfo[i].nMenuItem == id) |
| 4626 | | { |
| 4627 | | if (g_helpInfo[i].bIsHtmlHelp) |
| 4628 | | HelpFunction(hMain, g_helpInfo[i].lpFile, HH_DISPLAY_TOPIC, 0); |
| 4629 | | else |
| 4630 | | DisplayTextFile(hMain, g_helpInfo[i].lpFile); |
| 4631 | | return FALSE; |
| 4632 | | } |
| 4633 | | } |
| 4634 | | #ifdef MESS |
| 4635 | | return MessCommand(hwnd, id, hwndCtl, codeNotify); |
| 4636 | | #else |
| 4637 | | break; |
| 4638 | | #endif |
| 4639 | | } |
| 4640 | | |
| 4641 | | return FALSE; |
| 4642 | | } |
| 4643 | | |
| 4644 | | static void LoadBackgroundBitmap() |
| 4645 | | { |
| 4646 | | HGLOBAL hDIBbg; |
| 4647 | | char* pFileName = 0; |
| 4648 | | |
| 4649 | | if (hBackground) |
| 4650 | | { |
| 4651 | | DeleteObject(hBackground); |
| 4652 | | hBackground = 0; |
| 4653 | | } |
| 4654 | | |
| 4655 | | if (hPALbg) |
| 4656 | | { |
| 4657 | | DeleteObject(hPALbg); |
| 4658 | | hPALbg = 0; |
| 4659 | | } |
| 4660 | | |
| 4661 | | /* Pick images based on number of colors avaliable. */ |
| 4662 | | if (GetDepth(hwndList) <= 8) |
| 4663 | | { |
| 4664 | | pFileName = (char *)"bkgnd16"; |
| 4665 | | /*nResource = IDB_BKGROUND16;*/ |
| 4666 | | } |
| 4667 | | else |
| 4668 | | { |
| 4669 | | pFileName = (char *)"bkground"; |
| 4670 | | /*nResource = IDB_BKGROUND;*/ |
| 4671 | | } |
| 4672 | | |
| 4673 | | if (LoadDIB(pFileName, &hDIBbg, &hPALbg, BACKGROUND)) |
| 4674 | | { |
| 4675 | | HDC hDC = GetDC(hwndList); |
| 4676 | | hBackground = DIBToDDB(hDC, hDIBbg, &bmDesc); |
| 4677 | | GlobalFree(hDIBbg); |
| 4678 | | ReleaseDC(hwndList, hDC); |
| 4679 | | } |
| 4680 | | } |
| 4681 | | |
| 4682 | | static void ResetColumnDisplay(BOOL first_time) |
| 4683 | | { |
| 4684 | | int driver_index; |
| 4685 | | |
| 4686 | | if (!first_time) |
| 4687 | | Picker_ResetColumnDisplay(hwndList); |
| 4688 | | |
| 4689 | | ResetListView(); |
| 4690 | | |
| 4691 | | driver_index = GetGameNameIndex(GetDefaultGame()); |
| 4692 | | Picker_SetSelectedItem(hwndList, driver_index); |
| 4693 | | } |
| 4694 | | |
| 4695 | | int GamePicker_GetItemImage(HWND hwndPicker, int nItem) |
| 4696 | | { |
| 4697 | | return GetIconForDriver(nItem); |
| 4698 | | } |
| 4699 | | |
| 4700 | | const TCHAR *GamePicker_GetItemString(HWND hwndPicker, int nItem, int nColumn, |
| 4701 | | TCHAR *pszBuffer, UINT nBufferLength) |
| 4702 | | { |
| 4703 | | const TCHAR *s = NULL; |
| 4704 | | const char* utf8_s = NULL; |
| 4705 | | char playtime_buf[256]; |
| 4706 | | |
| 4707 | | switch(nColumn) |
| 4708 | | { |
| 4709 | | case COLUMN_GAMES: |
| 4710 | | /* Driver description */ |
| 4711 | | utf8_s = ModifyThe(drivers[nItem]->description); |
| 4712 | | break; |
| 4713 | | case COLUMN_ORIENTATION: |
| 4714 | | utf8_s = DriverIsVertical(nItem) ? "Vertical" : "Horizontal"; |
| 4715 | | break; |
| 4716 | | #if 0 |
| 4717 | | case COLUMN_ROMS: |
| 4718 | | /* Has Roms */ |
| 4719 | | utf8_s = GetAuditString(GetRomAuditResults(nItem)); |
| 4720 | | break; |
| 4721 | | #endif |
| 4722 | | case COLUMN_SAMPLES: |
| 4723 | | /* Samples */ |
| 4724 | | if (DriverUsesSamples(nItem)) |
| 4725 | | utf8_s = GetAuditString(GetSampleAuditResults(nItem)); |
| 4726 | | break; |
| 4727 | | |
| 4728 | | case COLUMN_DIRECTORY: |
| 4729 | | /* Driver name (directory) */ |
| 4730 | | utf8_s = drivers[nItem]->name; |
| 4731 | | break; |
| 4732 | | |
| 4733 | | case COLUMN_SRCDRIVERS: |
| 4734 | | /* Source drivers */ |
| 4735 | | utf8_s = GetDriverFilename(nItem); |
| 4736 | | break; |
| 4737 | | |
| 4738 | | case COLUMN_PLAYTIME: |
| 4739 | | /* Source drivers */ |
| 4740 | | GetTextPlayTime(nItem, playtime_buf); |
| 4741 | | utf8_s = playtime_buf; |
| 4742 | | break; |
| 4743 | | |
| 4744 | | case COLUMN_TYPE: |
| 4745 | | { |
| 4746 | | machine_config drv; |
| 4747 | | expand_machine_driver(drivers[nItem]->drv,&drv); |
| 4748 | | |
| 4749 | | /* Vector/Raster */ |
| 4750 | | if (drv.video_attributes & VIDEO_TYPE_VECTOR) |
| 4751 | | s = TEXT("Vector"); |
| 4752 | | else |
| 4753 | | s = TEXT("Raster"); |
| 4754 | | break; |
| 4755 | | } |
| 4756 | | case COLUMN_TRACKBALL: |
| 4757 | | /* Trackball */ |
| 4758 | | if (DriverUsesTrackball(nItem)) |
| 4759 | | s = TEXT("Yes"); |
| 4760 | | else |
| 4761 | | s = TEXT("No"); |
| 4762 | | break; |
| 4763 | | |
| 4764 | | case COLUMN_PLAYED: |
| 4765 | | /* times played */ |
| 4766 | | _sntprintf(pszBuffer, nBufferLength, TEXT("%i"), GetPlayCount(nItem)); |
| 4767 | | s = pszBuffer; |
| 4768 | | break; |
| 4769 | | |
| 4770 | | case COLUMN_MANUFACTURER: |
| 4771 | | /* Manufacturer */ |
| 4772 | | utf8_s = drivers[nItem]->manufacturer; |
| 4773 | | break; |
| 4774 | | |
| 4775 | | case COLUMN_YEAR: |
| 4776 | | /* Year */ |
| 4777 | | utf8_s = drivers[nItem]->year; |
| 4778 | | break; |
| 4779 | | |
| 4780 | | case COLUMN_CLONE: |
| 4781 | | utf8_s = GetCloneParentName(nItem); |
| 4782 | | break; |
| 4783 | | } |
| 4784 | | |
| 4785 | | if( utf8_s ) |
| 4786 | | { |
| 4787 | | TCHAR* t_s = tstring_from_utf8(utf8_s); |
| 4788 | | if( !t_s ) |
| 4789 | | return s; |
| 4790 | | |
| 4791 | | _sntprintf(pszBuffer, nBufferLength, TEXT("%s"), t_s); |
| 4792 | | free(t_s); |
| 4793 | | |
| 4794 | | s = pszBuffer; |
| 4795 | | } |
| 4796 | | |
| 4797 | | return s; |
| 4798 | | } |
| 4799 | | |
| 4800 | | static void GamePicker_LeavingItem(HWND hwndPicker, int nItem) |
| 4801 | | { |
| 4802 | | // leaving item |
| 4803 | | // printf("leaving %s\n",drivers[nItem]->name); |
| 4804 | | } |
| 4805 | | |
| 4806 | | static void GamePicker_EnteringItem(HWND hwndPicker, int nItem) |
| 4807 | | { |
| 4808 | | TCHAR* t_description; |
| 4809 | | ATOM a; |
| 4810 | | // printf("entering %s\n",drivers[nItem]->name); |
| 4811 | | if (g_bDoBroadcast == TRUE) |
| 4812 | | { |
| 4813 | | t_description = tstring_from_utf8(drivers[nItem]->description); |
| 4814 | | if( !t_description ) |
| 4815 | | return; |
| 4816 | | a = GlobalAddAtom(t_description); |
| 4817 | | SendMessage(HWND_BROADCAST, g_mame32_message, a, a); |
| 4818 | | GlobalDeleteAtom(a); |
| 4819 | | free(t_description); |
| 4820 | | } |
| 4821 | | |
| 4822 | | EnableSelection(nItem); |
| 4823 | | #ifdef MESS |
| 4824 | | MessReadMountedSoftware(nItem); |
| 4825 | | #endif |
| 4826 | | } |
| 4827 | | |
| 4828 | | static int GamePicker_FindItemParent(HWND hwndPicker, int nItem) |
| 4829 | | { |
| 4830 | | return GetParentRomSetIndex(drivers[nItem]); |
| 4831 | | } |
| 4832 | | |
| 4833 | | /* Initialize the Picker and List controls */ |
| 4834 | | static void InitListView() |
| 4835 | | { |
| 4836 | | LVBKIMAGE bki; |
| 4837 | | TCHAR path[MAX_PATH]; |
| 4838 | | TCHAR* t_bgdir; |
| 4839 | | |
| 4840 | | static const struct PickerCallbacks s_gameListCallbacks = |
| 4841 | | { |
| 4842 | | SetSortColumn, /* pfnSetSortColumn */ |
| 4843 | | GetSortColumn, /* pfnGetSortColumn */ |
| 4844 | | SetSortReverse, /* pfnSetSortReverse */ |
| 4845 | | GetSortReverse, /* pfnGetSortReverse */ |
| 4846 | | SetViewMode, /* pfnSetViewMode */ |
| 4847 | | GetViewMode, /* pfnGetViewMode */ |
| 4848 | | SetColumnWidths, /* pfnSetColumnWidths */ |
| 4849 | | GetColumnWidths, /* pfnGetColumnWidths */ |
| 4850 | | SetColumnOrder, /* pfnSetColumnOrder */ |
| 4851 | | GetColumnOrder, /* pfnGetColumnOrder */ |
| 4852 | | SetColumnShown, /* pfnSetColumnShown */ |
| 4853 | | GetColumnShown, /* pfnGetColumnShown */ |
| 4854 | | GetOffsetClones, /* pfnGetOffsetChildren */ |
| 4855 | | |
| 4856 | | GamePicker_Compare, /* pfnCompare */ |
| 4857 | | MamePlayGame, /* pfnDoubleClick */ |
| 4858 | | GamePicker_GetItemString, /* pfnGetItemString */ |
| 4859 | | GamePicker_GetItemImage, /* pfnGetItemImage */ |
| 4860 | | GamePicker_LeavingItem, /* pfnLeavingItem */ |
| 4861 | | GamePicker_EnteringItem, /* pfnEnteringItem */ |
| 4862 | | BeginListViewDrag, /* pfnBeginListViewDrag */ |
| 4863 | | GamePicker_FindItemParent, /* pfnFindItemParent */ |
| 4864 | | OnIdle, /* pfnIdle */ |
| 4865 | | GamePicker_OnHeaderContextMenu, /* pfnOnHeaderContextMenu */ |
| 4866 | | GamePicker_OnBodyContextMenu /* pfnOnBodyContextMenu */ |
| 4867 | | }; |
| 4868 | | |
| 4869 | | struct PickerOptions opts; |
| 4870 | | |
| 4871 | | // subclass the list view |
| 4872 | | memset(&opts, 0, sizeof(opts)); |
| 4873 | | opts.pCallbacks = &s_gameListCallbacks; |
| 4874 | | opts.nColumnCount = COLUMN_MAX; |
| 4875 | | opts.ppszColumnNames = column_names; |
| 4876 | | SetupPicker(hwndList, &opts); |
| 4877 | | |
| 4878 | | ListView_SetTextBkColor(hwndList, CLR_NONE); |
| 4879 | | ListView_SetBkColor(hwndList, CLR_NONE); |
| 4880 | | t_bgdir = tstring_from_utf8(GetBgDir()); |
| 4881 | | if( !t_bgdir ) |
| 4882 | | return; |
| 4883 | | _stprintf(path, TEXT("%s\\bkground.png"), t_bgdir); |
| 4884 | | bki.ulFlags = LVBKIF_SOURCE_URL | LVBKIF_STYLE_TILE; |
| 4885 | | bki.pszImage = path; |
| 4886 | | if( hBackground ) |
| 4887 | | ListView_SetBkImage(hwndList, &bki); |
| 4888 | | |
| 4889 | | CreateIcons(); |
| 4890 | | |
| 4891 | | ResetColumnDisplay(TRUE); |
| 4892 | | |
| 4893 | | // Allow selection to change the default saved game |
| 4894 | | bListReady = TRUE; |
| 4895 | | free(t_bgdir); |
| 4896 | | } |
| 4897 | | |
| 4898 | | static void AddDriverIcon(int nItem,int default_icon_index) |
| 4899 | | { |
| 4900 | | HICON hIcon = 0; |
| 4901 | | int nParentIndex = -1; |
| 4902 | | |
| 4903 | | /* if already set to rom or clone icon, we've been here before */ |
| 4904 | | if (icon_index[nItem] == 1 || icon_index[nItem] == 3) |
| 4905 | | return; |
| 4906 | | |
| 4907 | | hIcon = LoadIconFromFile((char *)drivers[nItem]->name); |
| 4908 | | if (hIcon == NULL) |
| 4909 | | { |
| 4910 | | nParentIndex = GetParentIndex(drivers[nItem]); |
| 4911 | | if( nParentIndex >= 0) |
| 4912 | | { |
| 4913 | | hIcon = LoadIconFromFile((char *)drivers[nParentIndex]->name); |
| 4914 | | nParentIndex = GetParentIndex(drivers[nParentIndex]); |
| 4915 | | if (hIcon == NULL && nParentIndex >= 0) |
| 4916 | | hIcon = LoadIconFromFile((char *)drivers[nParentIndex]->name); |
| 4917 | | } |
| 4918 | | } |
| 4919 | | |
| 4920 | | if (hIcon != NULL) |
| 4921 | | { |
| 4922 | | int nIconPos = ImageList_AddIcon(hSmall, hIcon); |
| 4923 | | ImageList_AddIcon(hLarge, hIcon); |
| 4924 | | if (nIconPos != -1) |
| 4925 | | icon_index[nItem] = nIconPos; |
| 4926 | | } |
| 4927 | | if (icon_index[nItem] == 0) |
| 4928 | | icon_index[nItem] = default_icon_index; |
| 4929 | | } |
| 4930 | | |
| 4931 | | static void DestroyIcons(void) |
| 4932 | | { |
| 4933 | | if (hSmall != NULL) |
| 4934 | | { |
| 4935 | | ImageList_Destroy(hSmall); |
| 4936 | | hSmall = NULL; |
| 4937 | | } |
| 4938 | | |
| 4939 | | if (icon_index != NULL) |
| 4940 | | { |
| 4941 | | int i; |
| 4942 | | for (i=0;i<driver_list_get_count(drivers);i++) |
| 4943 | | icon_index[i] = 0; // these are indices into hSmall |
| 4944 | | } |
| 4945 | | |
| 4946 | | if (hLarge != NULL) |
| 4947 | | { |
| 4948 | | ImageList_Destroy(hLarge); |
| 4949 | | hLarge = NULL; |
| 4950 | | } |
| 4951 | | |
| 4952 | | if (hHeaderImages != NULL) |
| 4953 | | { |
| 4954 | | ImageList_Destroy(hHeaderImages); |
| 4955 | | hHeaderImages = NULL; |
| 4956 | | } |
| 4957 | | |
| 4958 | | } |
| 4959 | | |
| 4960 | | static void ReloadIcons(void) |
| 4961 | | { |
| 4962 | | HICON hIcon; |
| 4963 | | INT i; |
| 4964 | | |
| 4965 | | // clear out all the images |
| 4966 | | ImageList_RemoveAll(hSmall); |
| 4967 | | ImageList_RemoveAll(hLarge); |
| 4968 | | |
| 4969 | | if (icon_index != NULL) |
| 4970 | | { |
| 4971 | | for (i=0;i<driver_list_get_count(drivers);i++) |
| 4972 | | icon_index[i] = 0; // these are indices into hSmall |
| 4973 | | } |
| 4974 | | |
| 4975 | | for (i = 0; g_iconData[i].icon_name; i++) |
| 4976 | | { |
| 4977 | | hIcon = LoadIconFromFile((char *) g_iconData[i].icon_name); |
| 4978 | | if (hIcon == NULL) |
| 4979 | | hIcon = LoadIcon(hInst, MAKEINTRESOURCE(g_iconData[i].resource)); |
| 4980 | | |
| 4981 | | ImageList_AddIcon(hSmall, hIcon); |
| 4982 | | ImageList_AddIcon(hLarge, hIcon); |
| 4983 | | } |
| 4984 | | } |
| 4985 | | |
| 4986 | | static DWORD GetShellLargeIconSize(void) |
| 4987 | | { |
| 4988 | | DWORD dwSize, dwLength = 512, dwType = REG_SZ; |
| 4989 | | TCHAR szBuffer[512]; |
| 4990 | | HKEY hKey; |
| 4991 | | |
| 4992 | | /* Get the Key */ |
| 4993 | | RegOpenKey(HKEY_CURRENT_USER, TEXT("Control Panel\\desktop\\WindowMetrics"), &hKey); |
| 4994 | | /* Save the last size */ |
| 4995 | | RegQueryValueEx(hKey, TEXT("Shell Icon Size"), NULL, &dwType, (LPBYTE)szBuffer, &dwLength); |
| 4996 | | dwSize = _ttol(szBuffer); |
| 4997 | | if (dwSize < 32) |
| 4998 | | dwSize = 32; |
| 4999 | | |
| 5000 | | if (dwSize > 48) |
| 5001 | | dwSize = 48; |
| 5002 | | |
| 5003 | | /* Clean up */ |
| 5004 | | RegCloseKey(hKey); |
| 5005 | | return dwSize; |
| 5006 | | } |
| 5007 | | |
| 5008 | | static DWORD GetShellSmallIconSize(void) |
| 5009 | | { |
| 5010 | | DWORD dwSize = ICONMAP_WIDTH; |
| 5011 | | |
| 5012 | | if (dwSize < 48) |
| 5013 | | { |
| 5014 | | if (dwSize < 32) |
| 5015 | | dwSize = 16; |
| 5016 | | else |
| 5017 | | dwSize = 32; |
| 5018 | | } |
| 5019 | | else |
| 5020 | | { |
| 5021 | | dwSize = 48; |
| 5022 | | } |
| 5023 | | return dwSize; |
| 5024 | | } |
| 5025 | | |
| 5026 | | // create iconlist for Listview control |
| 5027 | | static void CreateIcons(void) |
| 5028 | | { |
| 5029 | | DWORD dwLargeIconSize = GetShellLargeIconSize(); |
| 5030 | | HICON hIcon; |
| 5031 | | int icon_count; |
| 5032 | | DWORD dwStyle; |
| 5033 | | int i; |
| 5034 | | |
| 5035 | | icon_count = 0; |
| 5036 | | while(g_iconData[icon_count].icon_name) |
| 5037 | | icon_count++; |
| 5038 | | |
| 5039 | | // the current window style affects the sizing of the rows when changing |
| 5040 | | // between list views, so put it in small icon mode temporarily while we associate |
| 5041 | | // our image list |
| 5042 | | // |
| 5043 | | // using large icon mode instead kills the horizontal scrollbar when doing |
| 5044 | | // full refresh, which seems odd (it should recreate the scrollbar when |
| 5045 | | // set back to report mode, for example, but it doesn't). |
| 5046 | | |
| 5047 | | dwStyle = GetWindowLong(hwndList,GWL_STYLE); |
| 5048 | | SetWindowLong(hwndList,GWL_STYLE,(dwStyle & ~LVS_TYPEMASK) | LVS_ICON); |
| 5049 | | |
| 5050 | | hSmall = ImageList_Create(GetShellSmallIconSize(),GetShellSmallIconSize(), |
| 5051 | | ILC_COLORDDB | ILC_MASK, icon_count, icon_count + 5000); |
| 5052 | | hLarge = ImageList_Create(dwLargeIconSize, dwLargeIconSize, |
| 5053 | | ILC_COLORDDB | ILC_MASK, icon_count, icon_count + 5000); |
| 5054 | | |
| 5055 | | if (NULL == hSmall || NULL == hLarge) { |
| 5056 | | win_message_box_utf8(hwndList, "Cannot allocate Icon lists", "Allocation error - Exiting", IDOK); |
| 5057 | | PostQuitMessage(0); |
| 5058 | | } |
| 5059 | | |
| 5060 | | ReloadIcons(); |
| 5061 | | |
| 5062 | | // Associate the image lists with the list view control. |
| 5063 | | (void)ListView_SetImageList(hwndList, hSmall, LVSIL_SMALL); |
| 5064 | | (void)ListView_SetImageList(hwndList, hLarge, LVSIL_NORMAL); |
| 5065 | | |
| 5066 | | // restore our view |
| 5067 | | SetWindowLong(hwndList,GWL_STYLE,dwStyle); |
| 5068 | | |
| 5069 | | #ifdef MESS |
| 5070 | | CreateMessIcons(); |
| 5071 | | #endif |
| 5072 | | |
| 5073 | | // Now set up header specific stuff |
| 5074 | | hHeaderImages = ImageList_Create(8,8,ILC_COLORDDB | ILC_MASK,2,2); |
| 5075 | | hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_HEADER_UP)); |
| 5076 | | ImageList_AddIcon(hHeaderImages,hIcon); |
| 5077 | | hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_HEADER_DOWN)); |
| 5078 | | ImageList_AddIcon(hHeaderImages,hIcon); |
| 5079 | | |
| 5080 | | for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++) |
| 5081 | | Picker_SetHeaderImageList(GetDlgItem(hMain, s_nPickers[i]), hHeaderImages); |
| 5082 | | } |
| 5083 | | |
| 5084 | | |
| 5085 | | |
| 5086 | | static int GamePicker_Compare(HWND hwndPicker, int index1, int index2, int sort_subitem) |
| 5087 | | { |
| 5088 | | int value = 0; /* Default to 0, for unknown case */ |
| 5089 | | const char *name1 = NULL; |
| 5090 | | const char *name2 = NULL; |
| 5091 | | int nTemp1, nTemp2; |
| 5092 | | |
| 5093 | | #ifdef DEBUG |
| 5094 | | if (strcmp(drivers[index1]->name,"1941") == 0 && strcmp(drivers[index2]->name,"1942") == 0) |
| 5095 | | { |
| 5096 | | dprintf("comparing 1941, 1942"); |
| 5097 | | } |
| 5098 | | |
| 5099 | | if (strcmp(drivers[index1]->name,"1942") == 0 && strcmp(drivers[index2]->name,"1941") == 0) |
| 5100 | | { |
| 5101 | | dprintf("comparing 1942, 1941"); |
| 5102 | | } |
| 5103 | | #endif |
| 5104 | | |
| 5105 | | switch (sort_subitem) |
| 5106 | | { |
| 5107 | | case COLUMN_GAMES: |
| 5108 | | return mame_stricmp(ModifyThe(drivers[index1]->description), |
| 5109 | | ModifyThe(drivers[index2]->description)); |
| 5110 | | break; |
| 5111 | | |
| 5112 | | case COLUMN_ORIENTATION: |
| 5113 | | nTemp1 = DriverIsVertical(index1) ? 1 : 0; |
| 5114 | | nTemp2 = DriverIsVertical(index2) ? 1 : 0; |
| 5115 | | value = nTemp1 - nTemp2; |
| 5116 | | break; |
| 5117 | | #if 0 |
| 5118 | | case COLUMN_ROMS: |
| 5119 | | nTemp1 = GetRomAuditResults(index1); |
| 5120 | | nTemp2 = GetRomAuditResults(index2); |
| 5121 | | |
| 5122 | | if (IsAuditResultKnown(nTemp1) == FALSE && IsAuditResultKnown(nTemp2) == FALSE) |
| 5123 | | return GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES); |
| 5124 | | |
| 5125 | | if (IsAuditResultKnown(nTemp1) == FALSE) |
| 5126 | | { |
| 5127 | | value = 1; |
| 5128 | | break; |
| 5129 | | } |
| 5130 | | |
| 5131 | | if (IsAuditResultKnown(nTemp2) == FALSE) |
| 5132 | | { |
| 5133 | | value = -1; |
| 5134 | | break; |
| 5135 | | } |
| 5136 | | |
| 5137 | | // ok, both are known |
| 5138 | | if (IsAuditResultYes(nTemp1) && IsAuditResultYes(nTemp2)) |
| 5139 | | return GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES); |
| 5140 | | |
| 5141 | | if (IsAuditResultNo(nTemp1) && IsAuditResultNo(nTemp2)) |
| 5142 | | return GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES); |
| 5143 | | |
| 5144 | | if (IsAuditResultYes(nTemp1) && IsAuditResultNo(nTemp2)) |
| 5145 | | value = -1; |
| 5146 | | else |
| 5147 | | value = 1; |
| 5148 | | break; |
| 5149 | | #endif |
| 5150 | | case COLUMN_SAMPLES: |
| 5151 | | nTemp1 = -1; |
| 5152 | | if (DriverUsesSamples(index1)) |
| 5153 | | { |
| 5154 | | int audit_result = GetSampleAuditResults(index1); |
| 5155 | | if (IsAuditResultKnown(audit_result)) |
| 5156 | | { |
| 5157 | | if (IsAuditResultYes(audit_result)) |
| 5158 | | nTemp1 = 1; |
| 5159 | | else |
| 5160 | | nTemp1 = 0; |
| 5161 | | } |
| 5162 | | else |
| 5163 | | nTemp1 = 2; |
| 5164 | | } |
| 5165 | | |
| 5166 | | nTemp2 = -1; |
| 5167 | | if (DriverUsesSamples(index2)) |
| 5168 | | { |
| 5169 | | int audit_result = GetSampleAuditResults(index1); |
| 5170 | | if (IsAuditResultKnown(audit_result)) |
| 5171 | | { |
| 5172 | | if (IsAuditResultYes(audit_result)) |
| 5173 | | nTemp2 = 1; |
| 5174 | | else |
| 5175 | | nTemp2 = 0; |
| 5176 | | } |
| 5177 | | else |
| 5178 | | nTemp2 = 2; |
| 5179 | | } |
| 5180 | | value = nTemp2 - nTemp1; |
| 5181 | | break; |
| 5182 | | |
| 5183 | | case COLUMN_DIRECTORY: |
| 5184 | | value = mame_stricmp(drivers[index1]->name, drivers[index2]->name); |
| 5185 | | break; |
| 5186 | | |
| 5187 | | case COLUMN_SRCDRIVERS: |
| 5188 | | value = mame_stricmp(drivers[index1]->source_file, drivers[index2]->source_file); |
| 5189 | | break; |
| 5190 | | |
| 5191 | | case COLUMN_PLAYTIME: |
| 5192 | | value = GetPlayTime(index1) - GetPlayTime(index2); |
| 5193 | | break; |
| 5194 | | |
| 5195 | | case COLUMN_TYPE: |
| 5196 | | { |
| 5197 | | machine_config drv1,drv2; |
| 5198 | | expand_machine_driver(drivers[index1]->drv,&drv1); |
| 5199 | | expand_machine_driver(drivers[index2]->drv,&drv2); |
| 5200 | | |
| 5201 | | value = (drv1.video_attributes & VIDEO_TYPE_VECTOR) - |
| 5202 | | (drv2.video_attributes & VIDEO_TYPE_VECTOR); |
| 5203 | | break; |
| 5204 | | } |
| 5205 | | case COLUMN_TRACKBALL: |
| 5206 | | value = DriverUsesTrackball(index1) - DriverUsesTrackball(index2); |
| 5207 | | break; |
| 5208 | | |
| 5209 | | case COLUMN_PLAYED: |
| 5210 | | value = GetPlayCount(index1) - GetPlayCount(index2); |
| 5211 | | break; |
| 5212 | | |
| 5213 | | case COLUMN_MANUFACTURER: |
| 5214 | | value = mame_stricmp(drivers[index1]->manufacturer, drivers[index2]->manufacturer); |
| 5215 | | break; |
| 5216 | | |
| 5217 | | case COLUMN_YEAR: |
| 5218 | | value = mame_stricmp(drivers[index1]->year, drivers[index2]->year); |
| 5219 | | break; |
| 5220 | | |
| 5221 | | case COLUMN_CLONE: |
| 5222 | | name1 = GetCloneParentName(index1); |
| 5223 | | name2 = GetCloneParentName(index2); |
| 5224 | | |
| 5225 | | if (*name1 == '\0') |
| 5226 | | name1 = NULL; |
| 5227 | | if (*name2 == '\0') |
| 5228 | | name2 = NULL; |
| 5229 | | |
| 5230 | | if (NULL == name1 && NULL == name2) |
| 5231 | | value = 0; |
| 5232 | | else if (name2 == NULL) |
| 5233 | | value = -1; |
| 5234 | | else if (name1 == NULL) |
| 5235 | | value = 1; |
| 5236 | | else |
| 5237 | | value = mame_stricmp(name1, name2); |
| 5238 | | break; |
| 5239 | | } |
| 5240 | | |
| 5241 | | // Handle same comparisons here |
| 5242 | | if (0 == value && COLUMN_GAMES != sort_subitem) |
| 5243 | | { |
| 5244 | | value = GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES); |
| 5245 | | } |
| 5246 | | #ifdef DEBUG |
| 5247 | | if ((strcmp(drivers[index1]->name,"1941") == 0 && strcmp(drivers[index2]->name,"1942") == 0) || |
| 5248 | | (strcmp(drivers[index1]->name,"1942") == 0 && strcmp(drivers[index2]->name,"1941") == 0)) |
| 5249 | | dprintf("result: %i",value); |
| 5250 | | #endif |
| 5251 | | |
| 5252 | | return value; |
| 5253 | | } |
| 5254 | | |
| 5255 | | int GetSelectedPick() |
| 5256 | | { |
| 5257 | | /* returns index of listview selected item */ |
| 5258 | | /* This will return -1 if not found */ |
| 5259 | | return ListView_GetNextItem(hwndList, -1, LVIS_SELECTED | LVIS_FOCUSED); |
| 5260 | | } |
| 5261 | | |
| 5262 | | static HICON GetSelectedPickItemIcon() |
| 5263 | | { |
| 5264 | | LV_ITEM lvi; |
| 5265 | | |
| 5266 | | lvi.iItem = GetSelectedPick(); |
| 5267 | | lvi.iSubItem = 0; |
| 5268 | | lvi.mask = LVIF_IMAGE; |
| 5269 | | ListView_GetItem(hwndList, &lvi); |
| 5270 | | |
| 5271 | | return ImageList_GetIcon(hLarge, lvi.iImage, ILD_TRANSPARENT); |
| 5272 | | } |
| 5273 | | |
| 5274 | | static void SetRandomPickItem() |
| 5275 | | { |
| 5276 | | int nListCount; |
| 5277 | | |
| 5278 | | nListCount = ListView_GetItemCount(hwndList); |
| 5279 | | |
| 5280 | | if (nListCount > 0) |
| 5281 | | { |
| 5282 | | Picker_SetSelectedPick(hwndList, rand() % nListCount); |
| 5283 | | } |
| 5284 | | } |
| 5285 | | |
| 5286 | | BOOL CommonFileDialog(common_file_dialog_proc cfd, char *filename, int filetype) |
| 5287 | | { |
| 5288 | | BOOL success; |
| 5289 | | OPENFILENAME of; |
| 5290 | | TCHAR* t_filename; |
| 5291 | | TCHAR* t_statedir = 0; |
| 5292 | | TCHAR* t_artdir = 0; |
| 5293 | | TCHAR t_filename_buffer[MAX_PATH] = {0, }; |
| 5294 | | char *utf8_filename; |
| 5295 | | |
| 5296 | | // convert the filename to UTF-8 and copy into buffer |
| 5297 | | t_filename = tstring_from_utf8(filename); |
| 5298 | | if (t_filename != NULL) |
| 5299 | | { |
| 5300 | | _sntprintf(t_filename_buffer, ARRAY_LENGTH(t_filename_buffer), TEXT("%s"), t_filename); |
| 5301 | | free(t_filename); |
| 5302 | | } |
| 5303 | | |
| 5304 | | of.lStructSize = sizeof(of); |
| 5305 | | of.hwndOwner = hMain; |
| 5306 | | of.hInstance = NULL; |
| 5307 | | switch (filetype) |
| 5308 | | { |
| 5309 | | case FILETYPE_INPUT_FILES : |
| 5310 | | of.lpstrFilter = TEXT(MAMENAME " input files (*.inp,*.zip)\0*.inp;*.zip\0All files (*.*)\0*.*\0"); |
| 5311 | | break; |
| 5312 | | case FILETYPE_SAVESTATE_FILES : |
| 5313 | | of.lpstrFilter = TEXT(MAMENAME " savestate files (*.sta)\0*.sta;\0All files (*.*)\0*.*\0"); |
| 5314 | | break; |
| 5315 | | case FILETYPE_WAVE_FILES : |
| 5316 | | of.lpstrFilter = TEXT("sounds (*.wav)\0*.wav;\0All files (*.*)\0*.*\0"); |
| 5317 | | break; |
| 5318 | | case FILETYPE_MNG_FILES : |
| 5319 | | of.lpstrFilter = TEXT("videos (*.mng)\0*.mng;\0All files (*.*)\0*.*\0"); |
| 5320 | | break; |
| 5321 | | case FILETYPE_EFFECT_FILES : |
| 5322 | | of.lpstrFilter = TEXT("effects (*.png)\0*.png;\0All files (*.*)\0*.*\0"); |
| 5323 | | break; |
| 5324 | | } |
| 5325 | | of.lpstrCustomFilter = NULL; |
| 5326 | | of.nMaxCustFilter = 0; |
| 5327 | | of.nFilterIndex = 1; |
| 5328 | | of.lpstrFile = t_filename_buffer; |
| 5329 | | of.nMaxFile = ARRAY_LENGTH(t_filename_buffer); |
| 5330 | | of.lpstrFileTitle = NULL; |
| 5331 | | of.nMaxFileTitle = 0; |
| 5332 | | if (filetype == FILETYPE_SAVESTATE_FILES) |
| 5333 | | { |
| 5334 | | t_statedir = tstring_from_utf8(GetStateDir()); |
| 5335 | | if( !t_statedir ) |
| 5336 | | return FALSE; |
| 5337 | | |
| 5338 | | of.lpstrInitialDir = t_statedir; |
| 5339 | | } |
| 5340 | | else |
| 5341 | | { |
| 5342 | | if (filetype == FILETYPE_EFFECT_FILES) |
| 5343 | | { |
| 5344 | | t_artdir = tstring_from_utf8(GetArtDir()); |
| 5345 | | if( !t_artdir ) |
| 5346 | | return FALSE; |
| 5347 | | |
| 5348 | | of.lpstrInitialDir = t_artdir; |
| 5349 | | } |
| 5350 | | else |
| 5351 | | of.lpstrInitialDir = last_directory; |
| 5352 | | } |
| 5353 | | of.lpstrTitle = NULL; |
| 5354 | | of.Flags = OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY; |
| 5355 | | of.nFileOffset = 0; |
| 5356 | | of.nFileExtension = 0; |
| 5357 | | switch (filetype) |
| 5358 | | { |
| 5359 | | case FILETYPE_INPUT_FILES : |
| 5360 | | of.lpstrDefExt = TEXT("inp"); |
| 5361 | | break; |
| 5362 | | case FILETYPE_SAVESTATE_FILES : |
| 5363 | | of.lpstrDefExt = TEXT("sta"); |
| 5364 | | break; |
| 5365 | | case FILETYPE_WAVE_FILES : |
| 5366 | | of.lpstrDefExt = TEXT("wav"); |
| 5367 | | break; |
| 5368 | | case FILETYPE_MNG_FILES : |
| 5369 | | of.lpstrDefExt = TEXT("mng"); |
| 5370 | | break; |
| 5371 | | case FILETYPE_EFFECT_FILES : |
| 5372 | | of.lpstrDefExt = TEXT("png"); |
| 5373 | | break; |
| 5374 | | } |
| 5375 | | of.lCustData = 0; |
| 5376 | | of.lpfnHook = NULL; |
| 5377 | | of.lpTemplateName = NULL; |
| 5378 | | |
| 5379 | | success = cfd(&of); |
| 5380 | | if (success) |
| 5381 | | { |
| 5382 | | //dprintf("got filename %s nFileExtension %u\n",filename,of.nFileExtension); |
| 5383 | | /*GetDirectory(filename,last_directory,sizeof(last_directory));*/ |
| 5384 | | } |
| 5385 | | |
| 5386 | | if( t_artdir ) |
| 5387 | | free(t_artdir); |
| 5388 | | if( t_statedir ) |
| 5389 | | free(t_statedir); |
| 5390 | | |
| 5391 | | utf8_filename = utf8_from_tstring(t_filename_buffer); |
| 5392 | | if (utf8_filename != NULL) |
| 5393 | | { |
| 5394 | | snprintf(filename, MAX_PATH, "%s", utf8_filename); |
| 5395 | | } |
| 5396 | | |
| 5397 | | return success; |
| 5398 | | } |
| 5399 | | |
| 5400 | | static BOOL SelectLanguageFile(HWND hWnd, TCHAR* filename) |
| 5401 | | { |
| 5402 | | OPENFILENAME of; |
| 5403 | | |
| 5404 | | of.lStructSize = sizeof(of); |
| 5405 | | of.hwndOwner = hWnd; |
| 5406 | | of.hInstance = NULL; |
| 5407 | | of.lpstrFilter = TEXT(MAMENAME " Language files (*.lng)\0*.lng\0"); |
| 5408 | | of.lpstrCustomFilter = NULL; |
| 5409 | | of.nMaxCustFilter = 0; |
| 5410 | | of.nFilterIndex = 1; |
| 5411 | | of.lpstrFile = filename; |
| 5412 | | of.nMaxFile = MAX_PATH; |
| 5413 | | of.lpstrFileTitle = NULL; |
| 5414 | | of.nMaxFileTitle = 0; |
| 5415 | | of.lpstrInitialDir = NULL; |
| 5416 | | of.lpstrTitle = NULL; |
| 5417 | | of.Flags = OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST; |
| 5418 | | of.nFileOffset = 0; |
| 5419 | | of.nFileExtension = 0; |
| 5420 | | of.lpstrDefExt = TEXT("lng"); |
| 5421 | | of.lCustData = 0; |
| 5422 | | of.lpfnHook = NULL; |
| 5423 | | of.lpTemplateName = NULL; |
| 5424 | | |
| 5425 | | return GetOpenFileName(&of); |
| 5426 | | } |
| 5427 | | |
| 5428 | | static INT_PTR CALLBACK LanguageDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) |
| 5429 | | { |
| 5430 | | TCHAR pLangFile[MAX_PATH]; |
| 5431 | | DWORD dwHelpIDs[] = { IDC_LANGUAGECHECK, HIDC_LANGUAGECHECK, |
| 5432 | | IDC_LANGUAGEEDIT, HIDC_LANGUAGEEDIT, |
| 5433 | | 0, 0}; |
| 5434 | | char* utf8_LangFile; |
| 5435 | | |
| 5436 | | switch (Msg) |
| 5437 | | { |
| 5438 | | case WM_INITDIALOG: |
| 5439 | | { |
| 5440 | | const char* pLang = GetLanguage(); |
| 5441 | | if (pLang == NULL || *pLang == '\0') |
| 5442 | | { |
| 5443 | | win_set_window_text_utf8(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), ""); |
| 5444 | | Button_SetCheck(GetDlgItem(hDlg, IDC_LANGUAGECHECK), FALSE); |
| 5445 | | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), FALSE); |
| 5446 | | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEBROWSE), FALSE); |
| 5447 | | } |
| 5448 | | else |
| 5449 | | { |
| 5450 | | win_set_window_text_utf8(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), pLang); |
| 5451 | | Button_SetCheck(GetDlgItem(hDlg, IDC_LANGUAGECHECK), TRUE); |
| 5452 | | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), TRUE); |
| 5453 | | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEBROWSE), TRUE); |
| 5454 | | } |
| 5455 | | |
| 5456 | | return TRUE; |
| 5457 | | } |
| 5458 | | |
| 5459 | | case WM_HELP: |
| 5460 | | HelpFunction(((LPHELPINFO)lParam)->hItemHandle, MAME32CONTEXTHELP, HH_TP_HELP_WM_HELP, (DWORD_PTR)dwHelpIDs); |
| 5461 | | break; |
| 5462 | | |
| 5463 | | case WM_CONTEXTMENU: |
| 5464 | | HelpFunction((HWND)wParam, MAME32CONTEXTHELP, HH_TP_HELP_CONTEXTMENU, (DWORD_PTR)dwHelpIDs); |
| 5465 | | break; |
| 5466 | | |
| 5467 | | case WM_COMMAND: |
| 5468 | | switch (GET_WM_COMMAND_ID(wParam, lParam)) |
| 5469 | | { |
| 5470 | | case IDOK: |
| 5471 | | Edit_GetText(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), pLangFile, MAX_PATH); |
| 5472 | | utf8_LangFile = utf8_from_tstring(pLangFile); |
| 5473 | | if( !utf8_LangFile ) |
| 5474 | | return FALSE; |
| 5475 | | SetLanguage(utf8_LangFile); |
| 5476 | | free(utf8_LangFile); |
| 5477 | | |
| 5478 | | case IDCANCEL: |
| 5479 | | EndDialog(hDlg, 0); |
| 5480 | | return TRUE; |
| 5481 | | |
| 5482 | | case IDC_LANGUAGECHECK: |
| 5483 | | { |
| 5484 | | BOOL bCheck = Button_GetCheck(GetDlgItem(hDlg, IDC_LANGUAGECHECK)); |
| 5485 | | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), bCheck); |
| 5486 | | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEBROWSE), bCheck); |
| 5487 | | if (bCheck == FALSE) |
| 5488 | | Edit_SetText(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), TEXT("")); |
| 5489 | | return TRUE; |
| 5490 | | } |
| 5491 | | |
| 5492 | | case IDC_LANGUAGEBROWSE: |
| 5493 | | Edit_GetText(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), pLangFile, MAX_PATH); |
| 5494 | | if (SelectLanguageFile(hDlg, pLangFile) == TRUE) |
| 5495 | | Edit_SetText(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), pLangFile); |
| 5496 | | break; |
| 5497 | | } |
| 5498 | | break; |
| 5499 | | } |
| 5500 | | return 0; |
| 5501 | | } |
| 5502 | | |
| 5503 | | void SetStatusBarText(int part_index, const char *message) |
| 5504 | | { |
| 5505 | | TCHAR* t_message = tstring_from_utf8(message); |
| 5506 | | if( !t_message ) |
| 5507 | | return; |
| 5508 | | SendMessage(hStatusBar, SB_SETTEXT, (WPARAM) part_index, (LPARAM)(LPCTSTR) win_tstring_strdup(t_message)); |
| 5509 | | free(t_message); |
| 5510 | | } |
| 5511 | | |
| 5512 | | void SetStatusBarTextF(int part_index, const char *fmt, ...) |
| 5513 | | { |
| 5514 | | char buf[256]; |
| 5515 | | va_list va; |
| 5516 | | |
| 5517 | | va_start(va, fmt); |
| 5518 | | vsprintf(buf, fmt, va); |
| 5519 | | va_end(va); |
| 5520 | | |
| 5521 | | SetStatusBarText(part_index, buf); |
| 5522 | | } |
| 5523 | | |
| 5524 | | static void CLIB_DECL MameMessageBox(const char *fmt, ...) |
| 5525 | | { |
| 5526 | | char buf[2048]; |
| 5527 | | va_list va; |
| 5528 | | |
| 5529 | | va_start(va, fmt); |
| 5530 | | vsprintf(buf, fmt, va); |
| 5531 | | win_message_box_utf8(GetMainWindow(), buf, MAME32NAME, MB_OK | MB_ICONERROR); |
| 5532 | | va_end(va); |
| 5533 | | } |
| 5534 | | |
| 5535 | | static void MamePlayBackGame() |
| 5536 | | { |
| 5537 | | int nGame; |
| 5538 | | char filename[MAX_PATH]; |
| 5539 | | |
| 5540 | | *filename = 0; |
| 5541 | | |
| 5542 | | nGame = Picker_GetSelectedItem(hwndList); |
| 5543 | | if (nGame != -1) |
| 5544 | | strcpy(filename, drivers[nGame]->name); |
| 5545 | | |
| 5546 | | if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_INPUT_FILES)) |
| 5547 | | { |
| 5548 | | file_error fileerr; |
| 5549 | | mame_file* pPlayBack; |
| 5550 | | char drive[_MAX_DRIVE]; |
| 5551 | | char dir[_MAX_DIR]; |
| 5552 | | char bare_fname[_MAX_FNAME]; |
| 5553 | | char ext[_MAX_EXT]; |
| 5554 | | |
| 5555 | | char path[MAX_PATH]; |
| 5556 | | char fname[MAX_PATH]; |
| 5557 | | play_options playopts; |
| 5558 | | |
| 5559 | | _splitpath(filename, drive, dir, bare_fname, ext); |
| 5560 | | |
| 5561 | | sprintf(path,"%s%s",drive,dir); |
| 5562 | | sprintf(fname,"%s%s",bare_fname,ext); |
| 5563 | | if (path[strlen(path)-1] == '\\') |
| 5564 | | path[strlen(path)-1] = 0; // take off trailing back slash |
| 5565 | | |
| 5566 | | fileerr = mame_fopen_options(Mame32Global(), SEARCHPATH_INPUTLOG, fname, OPEN_FLAG_READ, &pPlayBack); |
| 5567 | | if (fileerr != FILERR_NONE) |
| 5568 | | { |
| 5569 | | MameMessageBox("Could not open '%s' as a valid input file.", filename); |
| 5570 | | return; |
| 5571 | | } |
| 5572 | | |
| 5573 | | // check for game name embedded in .inp header |
| 5574 | | if (pPlayBack) |
| 5575 | | { |
| 5576 | | inp_header input_header; |
| 5577 | | |
| 5578 | | // read playback header |
| 5579 | | mame_fread(pPlayBack, &input_header, sizeof(inp_header)); |
| 5580 | | |
| 5581 | | if (!isalnum(input_header.name[0])) // If first byte is not alpha-numeric |
| 5582 | | mame_fseek(pPlayBack, 0, SEEK_SET); // old .inp file - no header |
| 5583 | | else |
| 5584 | | { |
| 5585 | | int i; |
| 5586 | | for (i = 0; drivers[i] != 0; i++) // find game and play it |
| 5587 | | { |
| 5588 | | if (strcmp(drivers[i]->name, input_header.name) == 0) |
| 5589 | | { |
| 5590 | | nGame = i; |
| 5591 | | break; |
| 5592 | | } |
| 5593 | | } |
| 5594 | | } |
| 5595 | | } |
| 5596 | | mame_fclose(pPlayBack); |
| 5597 | | |
| 5598 | | memset(&playopts, 0, sizeof(playopts)); |
| 5599 | | playopts.playback = fname; |
| 5600 | | MamePlayGameWithOptions(nGame, &playopts); |
| 5601 | | } |
| 5602 | | } |
| 5603 | | |
| 5604 | | static void MameLoadState() |
| 5605 | | { |
| 5606 | | int nGame; |
| 5607 | | char filename[MAX_PATH]; |
| 5608 | | char selected_filename[MAX_PATH]; |
| 5609 | | play_options playopts; |
| 5610 | | |
| 5611 | | *filename = 0; |
| 5612 | | |
| 5613 | | nGame = Picker_GetSelectedItem(hwndList); |
| 5614 | | if (nGame != -1) |
| 5615 | | { |
| 5616 | | strcpy(filename, drivers[nGame]->name); |
| 5617 | | strcpy(selected_filename, drivers[nGame]->name); |
| 5618 | | } |
| 5619 | | if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_SAVESTATE_FILES)) |
| 5620 | | { |
| 5621 | | mame_file* pSaveState; |
| 5622 | | char drive[_MAX_DRIVE]; |
| 5623 | | char dir[_MAX_DIR]; |
| 5624 | | char ext[_MAX_EXT]; |
| 5625 | | |
| 5626 | | char path[MAX_PATH]; |
| 5627 | | char fname[MAX_PATH]; |
| 5628 | | char bare_fname[_MAX_FNAME]; |
| 5629 | | char *state_fname; |
| 5630 | | int rc; |
| 5631 | | |
| 5632 | | _splitpath(filename, drive, dir, bare_fname, ext); |
| 5633 | | |
| 5634 | | // parse path |
| 5635 | | sprintf(path,"%s%s",drive,dir); |
| 5636 | | sprintf(fname,"%s%s",bare_fname,ext); |
| 5637 | | if (path[strlen(path)-1] == '\\') |
| 5638 | | path[strlen(path)-1] = 0; // take off trailing back slash |
| 5639 | | |
| 5640 | | #ifdef MESS |
| 5641 | | { |
| 5642 | | state_fname = filename; |
| 5643 | | } |
| 5644 | | #else // !MESS |
| 5645 | | { |
| 5646 | | char *cPos=0; |
| 5647 | | int iPos=0; |
| 5648 | | char romname[MAX_PATH]; |
| 5649 | | |
| 5650 | | cPos = strchr(bare_fname, '-' ); |
| 5651 | | iPos = cPos ? cPos - bare_fname : strlen(bare_fname); |
| 5652 | | strncpy(romname, bare_fname, iPos ); |
| 5653 | | romname[iPos] = '\0'; |
| 5654 | | if( strcmp(selected_filename,romname) != 0 ) |
| 5655 | | { |
| 5656 | | MameMessageBox("'%s' is not a valid savestate file for game '%s'.", filename, selected_filename); |
| 5657 | | return; |
| 5658 | | } |
| 5659 | | state_fname = fname; |
| 5660 | | } |
| 5661 | | #endif // MESS |
| 5662 | | |
| 5663 | | mame_fopen_options(Mame32Global(), SEARCHPATH_STATE, state_fname, OPEN_FLAG_READ, &pSaveState); |
| 5664 | | if (pSaveState == NULL) |
| 5665 | | { |
| 5666 | | MameMessageBox("Could not open '%s' as a valid savestate file.", filename); |
| 5667 | | return; |
| 5668 | | } |
| 5669 | | |
| 5670 | | // call the MAME core function to check the save state file |
| 5671 | | rc = state_save_check_file(pSaveState, selected_filename, TRUE, MameMessageBox); |
| 5672 | | mame_fclose(pSaveState); |
| 5673 | | if (rc) |
| 5674 | | return; |
| 5675 | | |
| 5676 | | memset(&playopts, 0, sizeof(playopts)); |
| 5677 | | #ifdef MESS |
| 5678 | | playopts.state = state_fname; |
| 5679 | | #else |
| 5680 | | { |
| 5681 | | char *cPos; |
| 5682 | | cPos = strrchr(bare_fname, '-' ); |
| 5683 | | cPos = cPos+1; |
| 5684 | | if( strlen(cPos) >0) |
| 5685 | | { |
| 5686 | | playopts.state = cPos; |
| 5687 | | } |
| 5688 | | } |
| 5689 | | #endif |
| 5690 | | |
| 5691 | | MamePlayGameWithOptions(nGame, &playopts); |
| 5692 | | } |
| 5693 | | } |
| 5694 | | |
| 5695 | | static void MamePlayRecordGame() |
| 5696 | | { |
| 5697 | | int nGame; |
| 5698 | | char filename[MAX_PATH]; |
| 5699 | | *filename = 0; |
| 5700 | | |
| 5701 | | nGame = Picker_GetSelectedItem(hwndList); |
| 5702 | | strcpy(filename, drivers[nGame]->name); |
| 5703 | | |
| 5704 | | if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_INPUT_FILES)) |
| 5705 | | { |
| 5706 | | char drive[_MAX_DRIVE]; |
| 5707 | | char dir[_MAX_DIR]; |
| 5708 | | char fname[_MAX_FNAME]; |
| 5709 | | char ext[_MAX_EXT]; |
| 5710 | | char path[MAX_PATH]; |
| 5711 | | play_options playopts; |
| 5712 | | |
| 5713 | | _splitpath(filename, drive, dir, fname, ext); |
| 5714 | | |
| 5715 | | sprintf(path,"%s%s",drive,dir); |
| 5716 | | if (path[strlen(path)-1] == '\\') |
| 5717 | | path[strlen(path)-1] = 0; // take off trailing back slash |
| 5718 | | |
| 5719 | | memset(&playopts, 0, sizeof(playopts)); |
| 5720 | | playopts.record = fname; |
| 5721 | | MamePlayGameWithOptions(nGame, &playopts); |
| 5722 | | } |
| 5723 | | } |
| 5724 | | |
| 5725 | | void MamePlayGame(void) |
| 5726 | | { |
| 5727 | | int nGame; |
| 5728 | | play_options playopts; |
| 5729 | | |
| 5730 | | nGame = Picker_GetSelectedItem(hwndList); |
| 5731 | | |
| 5732 | | memset(&playopts, 0, sizeof(playopts)); |
| 5733 | | MamePlayGameWithOptions(nGame, &playopts); |
| 5734 | | } |
| 5735 | | |
| 5736 | | static void MamePlayRecordWave() |
| 5737 | | { |
| 5738 | | int nGame; |
| 5739 | | char filename[MAX_PATH]; |
| 5740 | | play_options playopts; |
| 5741 | | |
| 5742 | | nGame = Picker_GetSelectedItem(hwndList); |
| 5743 | | strcpy(filename, drivers[nGame]->name); |
| 5744 | | |
| 5745 | | if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_WAVE_FILES)) |
| 5746 | | { |
| 5747 | | memset(&playopts, 0, sizeof(playopts)); |
| 5748 | | playopts.wavwrite = filename; |
| 5749 | | MamePlayGameWithOptions(nGame, &playopts); |
| 5750 | | } |
| 5751 | | } |
| 5752 | | |
| 5753 | | static void MamePlayRecordMNG() |
| 5754 | | { |
| 5755 | | int nGame; |
| 5756 | | char filename[MAX_PATH] = { 0, }; |
| 5757 | | play_options playopts; |
| 5758 | | |
| 5759 | | nGame = Picker_GetSelectedItem(hwndList); |
| 5760 | | strcpy(filename, drivers[nGame]->name); |
| 5761 | | |
| 5762 | | if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_MNG_FILES)) |
| 5763 | | { |
| 5764 | | memset(&playopts, 0, sizeof(playopts)); |
| 5765 | | playopts.mngwrite = filename; |
| 5766 | | MamePlayGameWithOptions(nGame, &playopts); |
| 5767 | | } |
| 5768 | | } |
| 5769 | | |
| 5770 | | static void MamePlayGameWithOptions(int nGame, const play_options *playopts) |
| 5771 | | { |
| 5772 | | DWORD dwExitCode; |
| 5773 | | |
| 5774 | | #ifdef MESS |
| 5775 | | if (!MessApproveImageList(hMain, nGame)) |
| 5776 | | return; |
| 5777 | | #endif |
| 5778 | | |
| 5779 | | if (g_pJoyGUI != NULL) |
| 5780 | | KillTimer(hMain, JOYGUI_TIMER); |
| 5781 | | if (GetCycleScreenshot() > 0) |
| 5782 | | KillTimer(hMain, SCREENSHOT_TIMER); |
| 5783 | | |
| 5784 | | in_emulation = TRUE; |
| 5785 | | |
| 5786 | | dwExitCode = RunMAME(nGame, playopts); |
| 5787 | | if (dwExitCode == 0) |
| 5788 | | { |
| 5789 | | IncrementPlayCount(nGame); |
| 5790 | | ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick()); |
| 5791 | | } |
| 5792 | | else |
| 5793 | | { |
| 5794 | | ShowWindow(hMain, SW_SHOW); |
| 5795 | | } |
| 5796 | | |
| 5797 | | in_emulation = FALSE; |
| 5798 | | |
| 5799 | | // re-sort if sorting on # of times played |
| 5800 | | if (GetSortColumn() == COLUMN_PLAYED) |
| 5801 | | Picker_Sort(hwndList); |
| 5802 | | |
| 5803 | | UpdateStatusBar(); |
| 5804 | | |
| 5805 | | ShowWindow(hMain, SW_SHOW); |
| 5806 | | SetFocus(hwndList); |
| 5807 | | |
| 5808 | | if (g_pJoyGUI != NULL) |
| 5809 | | SetTimer(hMain, JOYGUI_TIMER, JOYGUI_MS, NULL); |
| 5810 | | if (GetCycleScreenshot() > 0) |
| 5811 | | SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL); //scale to seconds |
| 5812 | | } |
| 5813 | | |
| 5814 | | /* Toggle ScreenShot ON/OFF */ |
| 5815 | | static void ToggleScreenShot(void) |
| 5816 | | { |
| 5817 | | BOOL showScreenShot = GetShowScreenShot(); |
| 5818 | | |
| 5819 | | SetShowScreenShot((showScreenShot) ? FALSE : TRUE); |
| 5820 | | UpdateScreenShot(); |
| 5821 | | |
| 5822 | | /* Redraw list view */ |
| 5823 | | if (hBackground != NULL && showScreenShot) |
| 5824 | | InvalidateRect(hwndList, NULL, FALSE); |
| 5825 | | } |
| 5826 | | |
| 5827 | | static void AdjustMetrics(void) |
| 5828 | | { |
| 5829 | | HDC hDC; |
| 5830 | | TEXTMETRIC tm; |
| 5831 | | int xtraX, xtraY; |
| 5832 | | AREA area; |
| 5833 | | int offX, offY; |
| 5834 | | int maxX, maxY; |
| 5835 | | COLORREF textColor; |
| 5836 | | TCHAR szClass[128]; |
| 5837 | | HWND hWnd; |
| 5838 | | |
| 5839 | | /* WM_SETTINGCHANGE also */ |
| 5840 | | xtraX = GetSystemMetrics(SM_CXFIXEDFRAME); /* Dialog frame width */ |
| 5841 | | xtraY = GetSystemMetrics(SM_CYFIXEDFRAME); /* Dialog frame height */ |
| 5842 | | xtraY += GetSystemMetrics(SM_CYMENUSIZE); /* Menu height */ |
| 5843 | | xtraY += GetSystemMetrics(SM_CYCAPTION); /* Caption Height */ |
| 5844 | | maxX = GetSystemMetrics(SM_CXSCREEN); /* Screen Width */ |
| 5845 | | maxY = GetSystemMetrics(SM_CYSCREEN); /* Screen Height */ |
| 5846 | | |
| 5847 | | hDC = GetDC(hMain); |
| 5848 | | GetTextMetrics (hDC, &tm); |
| 5849 | | |
| 5850 | | /* Convert MIN Width/Height from Dialog Box Units to pixels. */ |
| 5851 | | MIN_WIDTH = (int)((tm.tmAveCharWidth / 4.0) * DBU_MIN_WIDTH) + xtraX; |
| 5852 | | MIN_HEIGHT = (int)((tm.tmHeight / 8.0) * DBU_MIN_HEIGHT) + xtraY; |
| 5853 | | ReleaseDC(hMain, hDC); |
| 5854 | | |
| 5855 | | if ((textColor = GetListFontColor()) == RGB(255, 255, 255)) |
| 5856 | | textColor = RGB(240, 240, 240); |
| 5857 | | |
| 5858 | | hWnd = GetWindow(hMain, GW_CHILD); |
| 5859 | | while(hWnd) |
| 5860 | | { |
| 5861 | | if (GetClassName(hWnd, szClass, sizeof(szClass) / sizeof(szClass[0]))) |
| 5862 | | { |
| 5863 | | if (!_tcscmp(szClass, TEXT("SysListView32"))) |
| 5864 | | { |
| 5865 | | ListView_SetBkColor(hWnd, GetSysColor(COLOR_WINDOW)); |
| 5866 | | ListView_SetTextColor(hWnd, textColor); |
| 5867 | | } |
| 5868 | | else if (!_tcscmp(szClass, TEXT("SysTreeView32"))) |
| 5869 | | { |
| 5870 | | TreeView_SetBkColor(hTreeView, GetSysColor(COLOR_WINDOW)); |
| 5871 | | TreeView_SetTextColor(hTreeView, textColor); |
| 5872 | | } |
| 5873 | | } |
| 5874 | | hWnd = GetWindow(hWnd, GW_HWNDNEXT); |
| 5875 | | } |
| 5876 | | |
| 5877 | | GetWindowArea(&area); |
| 5878 | | |
| 5879 | | offX = area.x + area.width; |
| 5880 | | offY = area.y + area.height; |
| 5881 | | |
| 5882 | | if (offX > maxX) |
| 5883 | | { |
| 5884 | | offX = maxX; |
| 5885 | | area.x = (offX - area.width > 0) ? (offX - area.width) : 0; |
| 5886 | | } |
| 5887 | | if (offY > maxY) |
| 5888 | | { |
| 5889 | | offY = maxY; |
| 5890 | | area.y = (offY - area.height > 0) ? (offY - area.height) : 0; |
| 5891 | | } |
| 5892 | | |
| 5893 | | SetWindowArea(&area); |
| 5894 | | SetWindowPos(hMain, 0, area.x, area.y, area.width, area.height, SWP_NOZORDER | SWP_SHOWWINDOW | SWP_NOACTIVATE); |
| 5895 | | } |
| 5896 | | |
| 5897 | | #if 0 |
| 5898 | | /* Adjust options - tune them to the currently selected game */ |
| 5899 | | static void EnablePlayOptions(int nIndex, core_options *o) |
| 5900 | | { |
| 5901 | | } |
| 5902 | | #endif |
| 5903 | | |
| 5904 | | int FindIconIndex(int nIconResource) |
| 5905 | | { |
| 5906 | | int i; |
| 5907 | | for(i = 0; g_iconData[i].icon_name; i++) |
| 5908 | | { |
| 5909 | | if (g_iconData[i].resource == nIconResource) |
| 5910 | | return i; |
| 5911 | | } |
| 5912 | | return -1; |
| 5913 | | } |
| 5914 | | |
| 5915 | | int FindIconIndexByName(const char *icon_name) |
| 5916 | | { |
| 5917 | | int i; |
| 5918 | | for (i = 0; g_iconData[i].icon_name; i++) |
| 5919 | | { |
| 5920 | | if (!strcmp(g_iconData[i].icon_name, icon_name)) |
| 5921 | | return i; |
| 5922 | | } |
| 5923 | | return -1; |
| 5924 | | } |
| 5925 | | |
| 5926 | | static int GetIconForDriver(int nItem) |
| 5927 | | { |
| 5928 | | int iconRoms = 1; |
| 5929 | | |
| 5930 | | if (DriverUsesRoms(nItem)) |
| 5931 | | { |
| 5932 | | int audit_result = GetRomAuditResults(nItem); |
| 5933 | | if (IsAuditResultKnown(audit_result) == FALSE) |
| 5934 | | return 2; |
| 5935 | | #ifdef SHOW_MISSING_ROMS_ICON |
| 5936 | | if (IsAuditResultYes(audit_result)) |
| 5937 | | iconRoms = 1; |
| 5938 | | else |
| 5939 | | iconRoms = 0; |
| 5940 | | #endif |
| 5941 | | } |
| 5942 | | |
| 5943 | | // iconRoms is now either 0 (no roms), 1 (roms), or 2 (unknown) |
| 5944 | | |
| 5945 | | /* these are indices into icon_names, which maps into our image list |
| 5946 | | * also must match IDI_WIN_NOROMS + iconRoms |
| 5947 | | */ |
| 5948 | | |
| 5949 | | // Show Red-X if the ROMs are present and flagged as NOT WORKING |
| 5950 | | if (iconRoms == 1 && DriverIsBroken(nItem)) |
| 5951 | | iconRoms = FindIconIndex(IDI_WIN_REDX); |
| 5952 | | |
| 5953 | | // show clone icon if we have roms and game is working |
| 5954 | | if (iconRoms == 1 && DriverIsClone(nItem)) |
| 5955 | | iconRoms = FindIconIndex(IDI_WIN_CLONE); |
| 5956 | | |
| 5957 | | // if we have the roms, then look for a custom per-game icon to override |
| 5958 | | if (iconRoms == 1 || iconRoms == 3) |
| 5959 | | { |
| 5960 | | if (icon_index[nItem] == 0) |
| 5961 | | AddDriverIcon(nItem,iconRoms); |
| 5962 | | iconRoms = icon_index[nItem]; |
| 5963 | | } |
| 5964 | | |
| 5965 | | return iconRoms; |
| 5966 | | } |
| 5967 | | |
| 5968 | | static BOOL HandleTreeContextMenu(HWND hWnd, WPARAM wParam, LPARAM lParam) |
| 5969 | | { |
| 5970 | | HMENU hTreeMenu; |
| 5971 | | HMENU hMenu; |
| 5972 | | TVHITTESTINFO hti; |
| 5973 | | POINT pt; |
| 5974 | | |
| 5975 | | if ((HWND)wParam != GetDlgItem(hWnd, IDC_TREE)) |
| 5976 | | return FALSE; |
| 5977 | | |
| 5978 | | pt.x = GET_X_LPARAM(lParam); |
| 5979 | | pt.y = GET_Y_LPARAM(lParam); |
| 5980 | | if (pt.x < 0 && pt.y < 0) |
| 5981 | | GetCursorPos(&pt); |
| 5982 | | |
| 5983 | | /* select the item that was right clicked or shift-F10'ed */ |
| 5984 | | hti.pt = pt; |
| 5985 | | ScreenToClient(hTreeView,&hti.pt); |
| 5986 | | (void)TreeView_HitTest(hTreeView,&hti); |
| 5987 | | if ((hti.flags & TVHT_ONITEM) != 0) |
| 5988 | | TreeView_SelectItem(hTreeView,hti.hItem); |
| 5989 | | |
| 5990 | | hTreeMenu = LoadMenu(hInst,MAKEINTRESOURCE(IDR_CONTEXT_TREE)); |
| 5991 | | |
| 5992 | | InitTreeContextMenu(hTreeMenu); |
| 5993 | | |
| 5994 | | hMenu = GetSubMenu(hTreeMenu, 0); |
| 5995 | | |
| 5996 | | UpdateMenu(hMenu); |
| 5997 | | |
| 5998 | | TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hWnd,NULL); |
| 5999 | | |
| 6000 | | DestroyMenu(hTreeMenu); |
| 6001 | | |
| 6002 | | return TRUE; |
| 6003 | | } |
| 6004 | | |
| 6005 | | |
| 6006 | | |
| 6007 | | static void GamePicker_OnBodyContextMenu(POINT pt) |
| 6008 | | { |
| 6009 | | HMENU hMenuLoad; |
| 6010 | | HMENU hMenu; |
| 6011 | | |
| 6012 | | hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_MENU)); |
| 6013 | | hMenu = GetSubMenu(hMenuLoad, 0); |
| 6014 | | InitBodyContextMenu(hMenu); |
| 6015 | | |
| 6016 | | UpdateMenu(hMenu); |
| 6017 | | |
| 6018 | | TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hMain,NULL); |
| 6019 | | |
| 6020 | | DestroyMenu(hMenuLoad); |
| 6021 | | } |
| 6022 | | |
| 6023 | | |
| 6024 | | |
| 6025 | | static BOOL HandleScreenShotContextMenu(HWND hWnd, WPARAM wParam, LPARAM lParam) |
| 6026 | | { |
| 6027 | | HMENU hMenuLoad; |
| 6028 | | HMENU hMenu; |
| 6029 | | POINT pt; |
| 6030 | | |
| 6031 | | if ((HWND)wParam != GetDlgItem(hWnd, IDC_SSPICTURE) && (HWND)wParam != GetDlgItem(hWnd, IDC_SSFRAME)) |
| 6032 | | return FALSE; |
| 6033 | | |
| 6034 | | pt.x = GET_X_LPARAM(lParam); |
| 6035 | | pt.y = GET_Y_LPARAM(lParam); |
| 6036 | | if (pt.x < 0 && pt.y < 0) |
| 6037 | | GetCursorPos(&pt); |
| 6038 | | |
| 6039 | | hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_SCREENSHOT)); |
| 6040 | | hMenu = GetSubMenu(hMenuLoad, 0); |
| 6041 | | |
| 6042 | | UpdateMenu(hMenu); |
| 6043 | | |
| 6044 | | TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hWnd,NULL); |
| 6045 | | |
| 6046 | | DestroyMenu(hMenuLoad); |
| 6047 | | |
| 6048 | | return TRUE; |
| 6049 | | } |
| 6050 | | |
| 6051 | | static void UpdateMenu(HMENU hMenu) |
| 6052 | | { |
| 6053 | | TCHAR buf[200]; |
| 6054 | | MENUITEMINFO mItem; |
| 6055 | | int nGame = Picker_GetSelectedItem(hwndList); |
| 6056 | | LPTREEFOLDER lpFolder = GetCurrentFolder(); |
| 6057 | | int i; |
| 6058 | | const char *pParent; |
| 6059 | | TCHAR* t_description; |
| 6060 | | |
| 6061 | | if (have_selection) |
| 6062 | | { |
| 6063 | | t_description = tstring_from_utf8(ConvertAmpersandString(ModifyThe(drivers[nGame]->description))); |
| 6064 | | if( !t_description ) |
| 6065 | | return; |
| 6066 | | |
| 6067 | | _sntprintf(buf, ARRAY_LENGTH(buf), g_szPlayGameString, t_description); |
| 6068 | | |
| 6069 | | mItem.cbSize = sizeof(mItem); |
| 6070 | | mItem.fMask = MIIM_TYPE; |
| 6071 | | mItem.fType = MFT_STRING; |
| 6072 | | mItem.dwTypeData = buf; |
| 6073 | | mItem.cch = _tcslen(mItem.dwTypeData); |
| 6074 | | |
| 6075 | | SetMenuItemInfo(hMenu, ID_FILE_PLAY, FALSE, &mItem); |
| 6076 | | |
| 6077 | | EnableMenuItem(hMenu, ID_CONTEXT_SELECT_RANDOM, MF_ENABLED); |
| 6078 | | |
| 6079 | | free(t_description); |
| 6080 | | } |
| 6081 | | else |
| 6082 | | { |
| 6083 | | EnableMenuItem(hMenu, ID_FILE_PLAY, MF_GRAYED); |
| 6084 | | EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_GRAYED); |
| 6085 | | EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED); |
| 6086 | | EnableMenuItem(hMenu, ID_CONTEXT_SELECT_RANDOM, MF_GRAYED); |
| 6087 | | } |
| 6088 | | |
| 6089 | | if (oldControl) |
| 6090 | | { |
| 6091 | | EnableMenuItem(hMenu, ID_CUSTOMIZE_FIELDS, MF_GRAYED); |
| 6092 | | EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED); |
| 6093 | | EnableMenuItem(hMenu, ID_OPTIONS_DEFAULTS, MF_GRAYED); |
| 6094 | | } |
| 6095 | | |
| 6096 | | if (lpFolder->m_dwFlags & F_CUSTOM) |
| 6097 | | { |
| 6098 | | EnableMenuItem(hMenu,ID_CONTEXT_REMOVE_CUSTOM,MF_ENABLED); |
| 6099 | | EnableMenuItem(hMenu,ID_CONTEXT_RENAME_CUSTOM,MF_ENABLED); |
| 6100 | | } |
| 6101 | | else |
| 6102 | | { |
| 6103 | | EnableMenuItem(hMenu,ID_CONTEXT_REMOVE_CUSTOM,MF_GRAYED); |
| 6104 | | EnableMenuItem(hMenu,ID_CONTEXT_RENAME_CUSTOM,MF_GRAYED); |
| 6105 | | } |
| 6106 | | pParent = GetFolderNameByID(lpFolder->m_nParent+1); |
| 6107 | | |
| 6108 | | if (lpFolder->m_dwFlags & F_INIEDIT) |
| 6109 | | EnableMenuItem(hMenu,ID_FOLDER_PROPERTIES,MF_ENABLED); |
| 6110 | | else |
| 6111 | | EnableMenuItem(hMenu,ID_FOLDER_PROPERTIES,MF_GRAYED); |
| 6112 | | |
| 6113 | | CheckMenuRadioItem(hMenu, ID_VIEW_TAB_SCREENSHOT, ID_VIEW_TAB_HISTORY, |
| 6114 | | ID_VIEW_TAB_SCREENSHOT + TabView_GetCurrentTab(hTabCtrl), MF_BYCOMMAND); |
| 6115 | | |
| 6116 | | // set whether we're showing the tab control or not |
| 6117 | | if (bShowTabCtrl) |
| 6118 | | CheckMenuItem(hMenu,ID_VIEW_PAGETAB,MF_BYCOMMAND | MF_CHECKED); |
| 6119 | | else |
| 6120 | | CheckMenuItem(hMenu,ID_VIEW_PAGETAB,MF_BYCOMMAND | MF_UNCHECKED); |
| 6121 | | |
| 6122 | | |
| 6123 | | for (i=0;i<MAX_TAB_TYPES;i++) |
| 6124 | | { |
| 6125 | | // disable menu items for tabs we're not currently showing |
| 6126 | | if (GetShowTab(i)) |
| 6127 | | EnableMenuItem(hMenu,ID_VIEW_TAB_SCREENSHOT + i,MF_BYCOMMAND | MF_ENABLED); |
| 6128 | | else |
| 6129 | | EnableMenuItem(hMenu,ID_VIEW_TAB_SCREENSHOT + i,MF_BYCOMMAND | MF_GRAYED); |
| 6130 | | |
| 6131 | | // check toggle menu items |
| 6132 | | if (GetShowTab(i)) |
| 6133 | | CheckMenuItem(hMenu, ID_TOGGLE_TAB_SCREENSHOT + i,MF_BYCOMMAND | MF_CHECKED); |
| 6134 | | else |
| 6135 | | CheckMenuItem(hMenu, ID_TOGGLE_TAB_SCREENSHOT + i,MF_BYCOMMAND | MF_UNCHECKED); |
| 6136 | | } |
| 6137 | | |
| 6138 | | for (i=0;i<MAX_FOLDERS;i++) |
| 6139 | | { |
| 6140 | | if (GetShowFolder(i)) |
| 6141 | | CheckMenuItem(hMenu,ID_CONTEXT_SHOW_FOLDER_START + i,MF_BYCOMMAND | MF_CHECKED); |
| 6142 | | else |
| 6143 | | CheckMenuItem(hMenu,ID_CONTEXT_SHOW_FOLDER_START + i,MF_BYCOMMAND | MF_UNCHECKED); |
| 6144 | | } |
| 6145 | | |
| 6146 | | } |
| 6147 | | |
| 6148 | | void InitTreeContextMenu(HMENU hTreeMenu) |
| 6149 | | { |
| 6150 | | MENUITEMINFO mii; |
| 6151 | | HMENU hMenu; |
| 6152 | | int i; |
| 6153 | | extern FOLDERDATA g_folderData[]; |
| 6154 | | |
| 6155 | | ZeroMemory(&mii,sizeof(mii)); |
| 6156 | | mii.cbSize = sizeof(mii); |
| 6157 | | |
| 6158 | | mii.wID = -1; |
| 6159 | | mii.fMask = MIIM_SUBMENU | MIIM_ID; |
| 6160 | | |
| 6161 | | hMenu = GetSubMenu(hTreeMenu, 0); |
| 6162 | | |
| 6163 | | if (GetMenuItemInfo(hMenu,3,TRUE,&mii) == FALSE) |
| 6164 | | { |
| 6165 | | dprintf("can't find show folders context menu"); |
| 6166 | | return; |
| 6167 | | } |
| 6168 | | |
| 6169 | | if (mii.hSubMenu == NULL) |
| 6170 | | { |
| 6171 | | dprintf("can't find submenu for show folders context menu"); |
| 6172 | | return; |
| 6173 | | } |
| 6174 | | |
| 6175 | | hMenu = mii.hSubMenu; |
| 6176 | | |
| 6177 | | for (i=0;g_folderData[i].m_lpTitle != NULL;i++) |
| 6178 | | { |
| 6179 | | TCHAR* t_title = tstring_from_utf8(g_folderData[i].m_lpTitle); |
| 6180 | | if( !t_title ) |
| 6181 | | return; |
| 6182 | | |
| 6183 | | mii.fMask = MIIM_TYPE | MIIM_ID; |
| 6184 | | mii.fType = MFT_STRING; |
| 6185 | | mii.dwTypeData = t_title; |
| 6186 | | mii.cch = _tcslen(mii.dwTypeData); |
| 6187 | | mii.wID = ID_CONTEXT_SHOW_FOLDER_START + g_folderData[i].m_nFolderId; |
| 6188 | | |
| 6189 | | |
| 6190 | | // menu in resources has one empty item (needed for the submenu to setup properly) |
| 6191 | | // so overwrite this one, append after |
| 6192 | | if (i == 0) |
| 6193 | | SetMenuItemInfo(hMenu,ID_CONTEXT_SHOW_FOLDER_START,FALSE,&mii); |
| 6194 | | else |
| 6195 | | InsertMenuItem(hMenu,i,FALSE,&mii); |
| 6196 | | |
| 6197 | | free(t_title); |
| 6198 | | } |
| 6199 | | |
| 6200 | | } |
| 6201 | | |
| 6202 | | void InitBodyContextMenu(HMENU hBodyContextMenu) |
| 6203 | | { |
| 6204 | | LPTREEFOLDER lpFolder; |
| 6205 | | TCHAR tmp[30]; |
| 6206 | | MENUITEMINFO mii; |
| 6207 | | ZeroMemory(&mii,sizeof(mii)); |
| 6208 | | mii.cbSize = sizeof(mii); |
| 6209 | | |
| 6210 | | if (GetMenuItemInfo(hBodyContextMenu,ID_FOLDER_SOURCEPROPERTIES,FALSE,&mii) == FALSE) |
| 6211 | | { |
| 6212 | | dprintf("can't find show folders context menu"); |
| 6213 | | return; |
| 6214 | | } |
| 6215 | | lpFolder = GetFolderByName(FOLDER_SOURCE, GetDriverFilename(Picker_GetSelectedItem(hwndList)) ); |
| 6216 | | _sntprintf(tmp,ARRAY_LENGTH(tmp),TEXT("Properties for %s"),lpFolder->m_lptTitle ); |
| 6217 | | mii.fMask = MIIM_TYPE | MIIM_ID; |
| 6218 | | mii.fType = MFT_STRING; |
| 6219 | | mii.dwTypeData = tmp; |
| 6220 | | mii.cch = _tcslen(mii.dwTypeData); |
| 6221 | | mii.wID = ID_FOLDER_SOURCEPROPERTIES; |
| 6222 | | |
| 6223 | | |
| 6224 | | // menu in resources has one default item |
| 6225 | | // so overwrite this one |
| 6226 | | SetMenuItemInfo(hBodyContextMenu,ID_FOLDER_SOURCEPROPERTIES,FALSE,&mii); |
| 6227 | | if( ! DriverIsVector(Picker_GetSelectedItem(hwndList) ) ) |
| 6228 | | EnableMenuItem(hBodyContextMenu, ID_FOLDER_VECTORPROPERTIES, MF_GRAYED); |
| 6229 | | } |
| 6230 | | |
| 6231 | | |
| 6232 | | void ToggleShowFolder(int folder) |
| 6233 | | { |
| 6234 | | int current_id = GetCurrentFolderID(); |
| 6235 | | |
| 6236 | | SetWindowRedraw(hwndList,FALSE); |
| 6237 | | |
| 6238 | | SetShowFolder(folder,!GetShowFolder(folder)); |
| 6239 | | |
| 6240 | | ResetTreeViewFolders(); |
| 6241 | | SelectTreeViewFolder(current_id); |
| 6242 | | |
| 6243 | | SetWindowRedraw(hwndList,TRUE); |
| 6244 | | } |
| 6245 | | |
| 6246 | | static LRESULT CALLBACK HistoryWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 6247 | | { |
| 6248 | | if (hBackground) |
| 6249 | | { |
| 6250 | | switch (uMsg) |
| 6251 | | { |
| 6252 | | case WM_MOUSEMOVE: |
| 6253 | | { |
| 6254 | | if (MouseHasBeenMoved()) |
| 6255 | | ShowCursor(TRUE); |
| 6256 | | break; |
| 6257 | | } |
| 6258 | | |
| 6259 | | case WM_ERASEBKGND: |
| 6260 | | return TRUE; |
| 6261 | | case WM_PAINT: |
| 6262 | | { |
| 6263 | | POINT p = { 0, 0 }; |
| 6264 | | |
| 6265 | | /* get base point of background bitmap */ |
| 6266 | | MapWindowPoints(hWnd,hTreeView,&p,1); |
| 6267 | | PaintBackgroundImage(hWnd, NULL, p.x, p.y); |
| 6268 | | /* to ensure our parent procedure repaints the whole client area */ |
| 6269 | | InvalidateRect(hWnd, NULL, FALSE); |
| 6270 | | break; |
| 6271 | | } |
| 6272 | | } |
| 6273 | | } |
| 6274 | | return CallWindowProc(g_lpHistoryWndProc, hWnd, uMsg, wParam, lParam); |
| 6275 | | } |
| 6276 | | |
| 6277 | | static LRESULT CALLBACK PictureFrameWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 6278 | | { |
| 6279 | | switch (uMsg) |
| 6280 | | { |
| 6281 | | case WM_MOUSEMOVE: |
| 6282 | | { |
| 6283 | | if (MouseHasBeenMoved()) |
| 6284 | | ShowCursor(TRUE); |
| 6285 | | break; |
| 6286 | | } |
| 6287 | | |
| 6288 | | case WM_NCHITTEST : |
| 6289 | | { |
| 6290 | | POINT pt; |
| 6291 | | RECT rect; |
| 6292 | | HWND hHistory = GetDlgItem(hMain, IDC_HISTORY); |
| 6293 | | |
| 6294 | | pt.x = LOWORD(lParam); |
| 6295 | | pt.y = HIWORD(lParam); |
| 6296 | | GetWindowRect(hHistory, &rect); |
| 6297 | | // check if they clicked on the picture area (leave 6 pixel no man's land |
| 6298 | | // by the history window to reduce mistaken clicks) |
| 6299 | | // no more no man's land, the Cursor changes when Edit control is left, should be enough feedback |
| 6300 | | if (have_history && |
| 6301 | | ( ( (TabView_GetCurrentTab(hTabCtrl) == TAB_HISTORY) || |
| 6302 | | (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() && GetShowTab(TAB_HISTORY) == FALSE) || |
| 6303 | | (TAB_ALL == GetHistoryTab() && GetShowTab(TAB_HISTORY) == FALSE) ) && |
| 6304 | | // (rect.top - 6) < pt.y && pt.y < (rect.bottom + 6) ) ) |
| 6305 | | PtInRect( &rect, pt ) ) ) |
| 6306 | | |
| 6307 | | { |
| 6308 | | return HTTRANSPARENT; |
| 6309 | | } |
| 6310 | | else |
| 6311 | | { |
| 6312 | | return HTCLIENT; |
| 6313 | | } |
| 6314 | | } |
| 6315 | | break; |
| 6316 | | case WM_CONTEXTMENU: |
| 6317 | | if ( HandleScreenShotContextMenu(hWnd, wParam, lParam)) |
| 6318 | | return FALSE; |
| 6319 | | break; |
| 6320 | | } |
| 6321 | | |
| 6322 | | if (hBackground) |
| 6323 | | { |
| 6324 | | switch (uMsg) |
| 6325 | | { |
| 6326 | | case WM_ERASEBKGND : |
| 6327 | | return TRUE; |
| 6328 | | case WM_PAINT : |
| 6329 | | { |
| 6330 | | RECT rect,nodraw_rect; |
| 6331 | | HRGN region,nodraw_region; |
| 6332 | | POINT p = { 0, 0 }; |
| 6333 | | |
| 6334 | | /* get base point of background bitmap */ |
| 6335 | | MapWindowPoints(hWnd,hTreeView,&p,1); |
| 6336 | | |
| 6337 | | /* get big region */ |
| 6338 | | GetClientRect(hWnd,&rect); |
| 6339 | | region = CreateRectRgnIndirect(&rect); |
| 6340 | | |
| 6341 | | if (IsWindowVisible(GetDlgItem(hMain,IDC_HISTORY))) |
| 6342 | | { |
| 6343 | | /* don't draw over this window */ |
| 6344 | | GetWindowRect(GetDlgItem(hMain,IDC_HISTORY),&nodraw_rect); |
| 6345 | | MapWindowPoints(HWND_DESKTOP,hWnd,(LPPOINT)&nodraw_rect,2); |
| 6346 | | nodraw_region = CreateRectRgnIndirect(&nodraw_rect); |
| 6347 | | CombineRgn(region,region,nodraw_region,RGN_DIFF); |
| 6348 | | DeleteObject(nodraw_region); |
| 6349 | | } |
| 6350 | | if (IsWindowVisible(GetDlgItem(hMain,IDC_SSPICTURE))) |
| 6351 | | { |
| 6352 | | /* don't draw over this window */ |
| 6353 | | GetWindowRect(GetDlgItem(hMain,IDC_SSPICTURE),&nodraw_rect); |
| 6354 | | MapWindowPoints(HWND_DESKTOP,hWnd,(LPPOINT)&nodraw_rect,2); |
| 6355 | | nodraw_region = CreateRectRgnIndirect(&nodraw_rect); |
| 6356 | | CombineRgn(region,region,nodraw_region,RGN_DIFF); |
| 6357 | | DeleteObject(nodraw_region); |
| 6358 | | } |
| 6359 | | |
| 6360 | | PaintBackgroundImage(hWnd,region,p.x,p.y); |
| 6361 | | |
| 6362 | | DeleteObject(region); |
| 6363 | | |
| 6364 | | /* to ensure our parent procedure repaints the whole client area */ |
| 6365 | | InvalidateRect(hWnd, NULL, FALSE); |
| 6366 | | |
| 6367 | | break; |
| 6368 | | } |
| 6369 | | } |
| 6370 | | } |
| 6371 | | return CallWindowProc(g_lpPictureFrameWndProc, hWnd, uMsg, wParam, lParam); |
| 6372 | | } |
| 6373 | | |
| 6374 | | static LRESULT CALLBACK PictureWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 6375 | | { |
| 6376 | | switch (uMsg) |
| 6377 | | { |
| 6378 | | case WM_ERASEBKGND : |
| 6379 | | return TRUE; |
| 6380 | | case WM_PAINT : |
| 6381 | | { |
| 6382 | | PAINTSTRUCT ps; |
| 6383 | | HDC hdc,hdc_temp; |
| 6384 | | RECT rect; |
| 6385 | | HBITMAP old_bitmap; |
| 6386 | | |
| 6387 | | int width,height; |
| 6388 | | |
| 6389 | | RECT rect2; |
| 6390 | | HBRUSH hBrush; |
| 6391 | | HBRUSH holdBrush; |
| 6392 | | HRGN region1, region2; |
| 6393 | | int nBordersize; |
| 6394 | | nBordersize = GetScreenshotBorderSize(); |
| 6395 | | hBrush = CreateSolidBrush(GetScreenshotBorderColor()); |
| 6396 | | |
| 6397 | | hdc = BeginPaint(hWnd,&ps); |
| 6398 | | |
| 6399 | | hdc_temp = CreateCompatibleDC(hdc); |
| 6400 | | if (ScreenShotLoaded()) |
| 6401 | | { |
| 6402 | | width = GetScreenShotWidth(); |
| 6403 | | height = GetScreenShotHeight(); |
| 6404 | | |
| 6405 | | old_bitmap = SelectObject(hdc_temp,GetScreenShotHandle()); |
| 6406 | | } |
| 6407 | | else |
| 6408 | | { |
| 6409 | | BITMAP bmp; |
| 6410 | | |
| 6411 | | GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp); |
| 6412 | | width = bmp.bmWidth; |
| 6413 | | height = bmp.bmHeight; |
| 6414 | | |
| 6415 | | old_bitmap = SelectObject(hdc_temp,hMissing_bitmap); |
| 6416 | | } |
| 6417 | | |
| 6418 | | GetClientRect(hWnd,&rect); |
| 6419 | | |
| 6420 | | rect2 = rect; |
| 6421 | | //Configurable Borders around images |
| 6422 | | rect.bottom -= nBordersize; |
| 6423 | | if( rect.bottom < 0) |
| 6424 | | rect.bottom = rect2.bottom; |
| 6425 | | rect.right -= nBordersize; |
| 6426 | | if( rect.right < 0) |
| 6427 | | rect.right = rect2.right; |
| 6428 | | rect.top += nBordersize; |
| 6429 | | if( rect.top > rect.bottom ) |
| 6430 | | rect.top = rect2.top; |
| 6431 | | rect.left += nBordersize; |
| 6432 | | if( rect.left > rect.right ) |
| 6433 | | rect.left = rect2.left; |
| 6434 | | region1 = CreateRectRgnIndirect(&rect); |
| 6435 | | region2 = CreateRectRgnIndirect(&rect2); |
| 6436 | | CombineRgn(region2,region2,region1,RGN_DIFF); |
| 6437 | | holdBrush = SelectObject(hdc, hBrush); |
| 6438 | | |
| 6439 | | FillRgn(hdc,region2, hBrush ); |
| 6440 | | SelectObject(hdc, holdBrush); |
| 6441 | | DeleteObject(hBrush); |
| 6442 | | |
| 6443 | | SetStretchBltMode(hdc,STRETCH_HALFTONE); |
| 6444 | | StretchBlt(hdc,nBordersize,nBordersize,rect.right-rect.left,rect.bottom-rect.top, |
| 6445 | | hdc_temp,0,0,width,height,SRCCOPY); |
| 6446 | | SelectObject(hdc_temp,old_bitmap); |
| 6447 | | DeleteDC(hdc_temp); |
| 6448 | | |
| 6449 | | EndPaint(hWnd,&ps); |
| 6450 | | |
| 6451 | | return TRUE; |
| 6452 | | } |
| 6453 | | } |
| 6454 | | |
| 6455 | | return CallWindowProc(g_lpPictureWndProc, hWnd, uMsg, wParam, lParam); |
| 6456 | | } |
| 6457 | | |
| 6458 | | void RemoveCurrentGameCustomFolder(void) |
| 6459 | | { |
| 6460 | | RemoveGameCustomFolder(Picker_GetSelectedItem(hwndList)); |
| 6461 | | } |
| 6462 | | |
| 6463 | | void RemoveGameCustomFolder(int driver_index) |
| 6464 | | { |
| 6465 | | int i; |
| 6466 | | TREEFOLDER **folders; |
| 6467 | | int num_folders; |
| 6468 | | |
| 6469 | | GetFolders(&folders,&num_folders); |
| 6470 | | |
| 6471 | | for (i=0;i<num_folders;i++) |
| 6472 | | { |
| 6473 | | if (folders[i]->m_dwFlags & F_CUSTOM && folders[i]->m_nFolderId == GetCurrentFolderID()) |
| 6474 | | { |
| 6475 | | int current_pick_index; |
| 6476 | | |
| 6477 | | RemoveFromCustomFolder(folders[i],driver_index); |
| 6478 | | |
| 6479 | | if (driver_index == Picker_GetSelectedItem(hwndList)) |
| 6480 | | { |
| 6481 | | /* if we just removed the current game, |
| 6482 | | move the current selection so that when we rebuild the listview it |
| 6483 | | leaves the cursor on next or previous one */ |
| 6484 | | |
| 6485 | | current_pick_index = GetSelectedPick(); |
| 6486 | | Picker_SetSelectedPick(hwndList, GetSelectedPick() + 1); |
| 6487 | | if (current_pick_index == GetSelectedPick()) /* we must have deleted the last item */ |
| 6488 | | Picker_SetSelectedPick(hwndList, GetSelectedPick() - 1); |
| 6489 | | } |
| 6490 | | |
| 6491 | | ResetListView(); |
| 6492 | | return; |
| 6493 | | } |
| 6494 | | } |
| 6495 | | MessageBox(GetMainWindow(), TEXT("Error searching for custom folder"), TEXT(MAME32NAME), MB_OK | MB_ICONERROR); |
| 6496 | | |
| 6497 | | } |
| 6498 | | |
| 6499 | | |
| 6500 | | void BeginListViewDrag(NM_LISTVIEW *pnmv) |
| 6501 | | { |
| 6502 | | LV_ITEM lvi; |
| 6503 | | POINT pt; |
| 6504 | | |
| 6505 | | lvi.iItem = pnmv->iItem; |
| 6506 | | lvi.mask = LVIF_PARAM; |
| 6507 | | ListView_GetItem(hwndList, &lvi); |
| 6508 | | |
| 6509 | | game_dragged = lvi.lParam; |
| 6510 | | |
| 6511 | | pt.x = 0; |
| 6512 | | pt.y = 0; |
| 6513 | | |
| 6514 | | /* Tell the list view control to create an image to use |
| 6515 | | for dragging. */ |
| 6516 | | himl_drag = ListView_CreateDragImage(hwndList,pnmv->iItem,&pt); |
| 6517 | | |
| 6518 | | /* Start the drag operation. */ |
| 6519 | | ImageList_BeginDrag(himl_drag, 0, 0, 0); |
| 6520 | | |
| 6521 | | pt = pnmv->ptAction; |
| 6522 | | ClientToScreen(hwndList,&pt); |
| 6523 | | ImageList_DragEnter(GetDesktopWindow(),pt.x,pt.y); |
| 6524 | | |
| 6525 | | /* Hide the mouse cursor, and direct mouse input to the |
| 6526 | | parent window. */ |
| 6527 | | SetCapture(hMain); |
| 6528 | | |
| 6529 | | prev_drag_drop_target = NULL; |
| 6530 | | |
| 6531 | | g_listview_dragging = TRUE; |
| 6532 | | |
| 6533 | | } |
| 6534 | | |
| 6535 | | void MouseMoveListViewDrag(POINTS p) |
| 6536 | | { |
| 6537 | | HTREEITEM htiTarget; |
| 6538 | | TV_HITTESTINFO tvht; |
| 6539 | | |
| 6540 | | POINT pt; |
| 6541 | | pt.x = p.x; |
| 6542 | | pt.y = p.y; |
| 6543 | | |
| 6544 | | ClientToScreen(hMain,&pt); |
| 6545 | | |
| 6546 | | ImageList_DragMove(pt.x,pt.y); |
| 6547 | | |
| 6548 | | MapWindowPoints(GetDesktopWindow(),hTreeView,&pt,1); |
| 6549 | | |
| 6550 | | tvht.pt = pt; |
| 6551 | | htiTarget = TreeView_HitTest(hTreeView,&tvht); |
| 6552 | | |
| 6553 | | if (htiTarget != prev_drag_drop_target) |
| 6554 | | { |
| 6555 | | ImageList_DragShowNolock(FALSE); |
| 6556 | | if (htiTarget != NULL) |
| 6557 | | TreeView_SelectDropTarget(hTreeView,htiTarget); |
| 6558 | | else |
| 6559 | | TreeView_SelectDropTarget(hTreeView,NULL); |
| 6560 | | ImageList_DragShowNolock(TRUE); |
| 6561 | | |
| 6562 | | prev_drag_drop_target = htiTarget; |
| 6563 | | } |
| 6564 | | } |
| 6565 | | |
| 6566 | | void ButtonUpListViewDrag(POINTS p) |
| 6567 | | { |
| 6568 | | POINT pt; |
| 6569 | | HTREEITEM htiTarget; |
| 6570 | | TV_HITTESTINFO tvht; |
| 6571 | | TVITEM tvi; |
| 6572 | | |
| 6573 | | ReleaseCapture(); |
| 6574 | | |
| 6575 | | ImageList_DragLeave(hwndList); |
| 6576 | | ImageList_EndDrag(); |
| 6577 | | ImageList_Destroy(himl_drag); |
| 6578 | | |
| 6579 | | TreeView_SelectDropTarget(hTreeView,NULL); |
| 6580 | | |
| 6581 | | g_listview_dragging = FALSE; |
| 6582 | | |
| 6583 | | /* see where the game was dragged */ |
| 6584 | | |
| 6585 | | pt.x = p.x; |
| 6586 | | pt.y = p.y; |
| 6587 | | |
| 6588 | | MapWindowPoints(hMain,hTreeView,&pt,1); |
| 6589 | | |
| 6590 | | tvht.pt = pt; |
| 6591 | | htiTarget = TreeView_HitTest(hTreeView,&tvht); |
| 6592 | | if (htiTarget == NULL) |
| 6593 | | { |
| 6594 | | LVHITTESTINFO lvhtti; |
| 6595 | | LPTREEFOLDER folder; |
| 6596 | | RECT rcList; |
| 6597 | | |
| 6598 | | /* the user dragged a game onto something other than the treeview */ |
| 6599 | | /* try to remove if we're in a custom folder */ |
| 6600 | | |
| 6601 | | /* see if it was dragged within the list view; if so, ignore */ |
| 6602 | | |
| 6603 | | MapWindowPoints(hTreeView,hwndList,&pt,1); |
| 6604 | | lvhtti.pt = pt; |
| 6605 | | GetWindowRect(hwndList, &rcList); |
| 6606 | | ClientToScreen(hwndList, &pt); |
| 6607 | | if( PtInRect(&rcList, pt) != 0 ) |
| 6608 | | return; |
| 6609 | | |
| 6610 | | folder = GetCurrentFolder(); |
| 6611 | | if (folder->m_dwFlags & F_CUSTOM) |
| 6612 | | { |
| 6613 | | /* dragged out of a custom folder, so let's remove it */ |
| 6614 | | RemoveCurrentGameCustomFolder(); |
| 6615 | | } |
| 6616 | | return; |
| 6617 | | } |
| 6618 | | |
| 6619 | | |
| 6620 | | tvi.lParam = 0; |
| 6621 | | tvi.mask = TVIF_PARAM | TVIF_HANDLE; |
| 6622 | | tvi.hItem = htiTarget; |
| 6623 | | |
| 6624 | | if (TreeView_GetItem(hTreeView, &tvi)) |
| 6625 | | { |
| 6626 | | LPTREEFOLDER folder = (LPTREEFOLDER)tvi.lParam; |
| 6627 | | AddToCustomFolder(folder,game_dragged); |
| 6628 | | } |
| 6629 | | |
| 6630 | | } |
| 6631 | | |
| 6632 | | static LPTREEFOLDER GetSelectedFolder(void) |
| 6633 | | { |
| 6634 | | HTREEITEM htree; |
| 6635 | | TVITEM tvi; |
| 6636 | | htree = TreeView_GetSelection(hTreeView); |
| 6637 | | if(htree != NULL) |
| 6638 | | { |
| 6639 | | tvi.hItem = htree; |
| 6640 | | tvi.mask = TVIF_PARAM; |
| 6641 | | TreeView_GetItem(hTreeView,&tvi); |
| 6642 | | return (LPTREEFOLDER)tvi.lParam; |
| 6643 | | } |
| 6644 | | return NULL; |
| 6645 | | } |
| 6646 | | |
| 6647 | | static HICON GetSelectedFolderIcon(void) |
| 6648 | | { |
| 6649 | | HTREEITEM htree; |
| 6650 | | TVITEM tvi; |
| 6651 | | HIMAGELIST hSmall_icon; |
| 6652 | | LPTREEFOLDER folder; |
| 6653 | | htree = TreeView_GetSelection(hTreeView); |
| 6654 | | |
| 6655 | | if (htree != NULL) |
| 6656 | | { |
| 6657 | | tvi.hItem = htree; |
| 6658 | | tvi.mask = TVIF_PARAM; |
| 6659 | | TreeView_GetItem(hTreeView,&tvi); |
| 6660 | | |
| 6661 | | folder = (LPTREEFOLDER)tvi.lParam; |
| 6662 | | //hSmall_icon = TreeView_GetImageList(hTreeView,(int)tvi.iImage); |
| 6663 | | hSmall_icon = NULL; |
| 6664 | | return ImageList_GetIcon(hSmall_icon, tvi.iImage, ILD_TRANSPARENT); |
| 6665 | | } |
| 6666 | | return NULL; |
| 6667 | | } |
| 6668 | | |
| 6669 | | /* Updates all currently displayed Items in the List with the latest Data*/ |
| 6670 | | void UpdateListView(void) |
| 6671 | | { |
| 6672 | | if( (GetViewMode() == VIEW_GROUPED) || (GetViewMode() == VIEW_DETAILS ) ) |
| 6673 | | ListView_RedrawItems(hwndList,ListView_GetTopIndex(hwndList), |
| 6674 | | ListView_GetTopIndex(hwndList)+ ListView_GetCountPerPage(hwndList) ); |
| 6675 | | } |
| 6676 | | |
| 6677 | | void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height) |
| 6678 | | { |
| 6679 | | int destX, destY; |
| 6680 | | int destW, destH; |
| 6681 | | int nBorder; |
| 6682 | | RECT rect; |
| 6683 | | /* for scaling */ |
| 6684 | | int x, y; |
| 6685 | | int rWidth, rHeight; |
| 6686 | | double scale; |
| 6687 | | BOOL bReduce = FALSE; |
| 6688 | | |
| 6689 | | GetClientRect(hWnd, &rect); |
| 6690 | | |
| 6691 | | // Scale the bitmap to the frame specified by the passed in hwnd |
| 6692 | | if (ScreenShotLoaded()) |
| 6693 | | { |
| 6694 | | x = GetScreenShotWidth(); |
| 6695 | | y = GetScreenShotHeight(); |
| 6696 | | } |
| 6697 | | else |
| 6698 | | { |
| 6699 | | BITMAP bmp; |
| 6700 | | GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp); |
| 6701 | | |
| 6702 | | x = bmp.bmWidth; |
| 6703 | | y = bmp.bmHeight; |
| 6704 | | } |
| 6705 | | rWidth = (rect.right - rect.left); |
| 6706 | | rHeight = (rect.bottom - rect.top); |
| 6707 | | |
| 6708 | | /* Limit the screen shot to max height of 264 */ |
| 6709 | | if (restrict_height == TRUE && rHeight > 264) |
| 6710 | | { |
| 6711 | | rect.bottom = rect.top + 264; |
| 6712 | | rHeight = 264; |
| 6713 | | } |
| 6714 | | |
| 6715 | | /* If the bitmap does NOT fit in the screenshot area */ |
| 6716 | | if (x > rWidth - 10 || y > rHeight - 10) |
| 6717 | | { |
| 6718 | | rect.right -= 10; |
| 6719 | | rect.bottom -= 10; |
| 6720 | | rWidth -= 10; |
| 6721 | | rHeight -= 10; |
| 6722 | | bReduce = TRUE; |
| 6723 | | /* Try to scale it properly */ |
| 6724 | | /* assumes square pixels, doesn't consider aspect ratio */ |
| 6725 | | if (x > y) |
| 6726 | | scale = (double)rWidth / x; |
| 6727 | | else |
| 6728 | | scale = (double)rHeight / y; |
| 6729 | | |
| 6730 | | destW = (int)(x * scale); |
| 6731 | | destH = (int)(y * scale); |
| 6732 | | |
| 6733 | | /* If it's still too big, scale again */ |
| 6734 | | if (destW > rWidth || destH > rHeight) |
| 6735 | | { |
| 6736 | | if (destW > rWidth) |
| 6737 | | scale = (double)rWidth / destW; |
| 6738 | | else |
| 6739 | | scale = (double)rHeight / destH; |
| 6740 | | |
| 6741 | | destW = (int)(destW * scale); |
| 6742 | | destH = (int)(destH * scale); |
| 6743 | | } |
| 6744 | | } |
| 6745 | | else |
| 6746 | | { |
| 6747 | | if (GetStretchScreenShotLarger()) |
| 6748 | | { |
| 6749 | | rect.right -= 10; |
| 6750 | | rect.bottom -= 10; |
| 6751 | | rWidth -= 10; |
| 6752 | | rHeight -= 10; |
| 6753 | | bReduce = TRUE; |
| 6754 | | // Try to scale it properly |
| 6755 | | // assumes square pixels, doesn't consider aspect ratio |
| 6756 | | if (x < y) |
| 6757 | | scale = (double)rWidth / x; |
| 6758 | | else |
| 6759 | | scale = (double)rHeight / y; |
| 6760 | | |
| 6761 | | destW = (int)(x * scale); |
| 6762 | | destH = (int)(y * scale); |
| 6763 | | |
| 6764 | | // If it's too big, scale again |
| 6765 | | if (destW > rWidth || destH > rHeight) |
| 6766 | | { |
| 6767 | | if (destW > rWidth) |
| 6768 | | scale = (double)rWidth / destW; |
| 6769 | | else |
| 6770 | | scale = (double)rHeight / destH; |
| 6771 | | |
| 6772 | | destW = (int)(destW * scale); |
| 6773 | | destH = (int)(destH * scale); |
| 6774 | | } |
| 6775 | | } |
| 6776 | | else |
| 6777 | | { |
| 6778 | | // Use the bitmaps size if it fits |
| 6779 | | destW = x; |
| 6780 | | destH = y; |
| 6781 | | } |
| 6782 | | |
| 6783 | | } |
| 6784 | | |
| 6785 | | |
| 6786 | | destX = ((rWidth - destW) / 2); |
| 6787 | | destY = ((rHeight - destH) / 2); |
| 6788 | | |
| 6789 | | if (bReduce) |
| 6790 | | { |
| 6791 | | destX += 5; |
| 6792 | | destY += 5; |
| 6793 | | } |
| 6794 | | nBorder = GetScreenshotBorderSize(); |
| 6795 | | if( destX > nBorder+1) |
| 6796 | | pRect->left = destX - nBorder; |
| 6797 | | else |
| 6798 | | pRect->left = 2; |
| 6799 | | if( destY > nBorder+1) |
| 6800 | | pRect->top = destY - nBorder; |
| 6801 | | else |
| 6802 | | pRect->top = 2; |
| 6803 | | if( rWidth >= destX + destW + nBorder) |
| 6804 | | pRect->right = destX + destW + nBorder; |
| 6805 | | else |
| 6806 | | pRect->right = rWidth - pRect->left; |
| 6807 | | if( rHeight >= destY + destH + nBorder) |
| 6808 | | pRect->bottom = destY + destH + nBorder; |
| 6809 | | else |
| 6810 | | pRect->bottom = rHeight - pRect->top; |
| 6811 | | } |
| 6812 | | |
| 6813 | | /* |
| 6814 | | Switches to either fullscreen or normal mode, based on the |
| 6815 | | current mode. |
| 6816 | | |
| 6817 | | POSSIBLE BUGS: |
| 6818 | | Removing the menu might cause problems later if some |
| 6819 | | function tries to poll info stored in the menu. Don't |
| 6820 | | know if you've done that, but this was the only way I |
| 6821 | | knew to remove the menu dynamically. |
| 6822 | | */ |
| 6823 | | |
| 6824 | | void SwitchFullScreenMode(void) |
| 6825 | | { |
| 6826 | | LONG lMainStyle; |
| 6827 | | |
| 6828 | | if (GetRunFullScreen()) |
| 6829 | | { |
| 6830 | | // Return to normal |
| 6831 | | |
| 6832 | | // Restore the menu |
| 6833 | | SetMenu(hMain, LoadMenu(hInst,MAKEINTRESOURCE(IDR_UI_MENU))); |
| 6834 | | |
| 6835 | | // Refresh the checkmarks |
| 6836 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, GetShowFolderList() ? MF_CHECKED : MF_UNCHECKED); |
| 6837 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, GetShowToolBar() ? MF_CHECKED : MF_UNCHECKED); |
| 6838 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, GetShowStatusBar() ? MF_CHECKED : MF_UNCHECKED); |
| 6839 | | CheckMenuItem(GetMenu(hMain), ID_VIEW_PAGETAB, GetShowTabCtrl() ? MF_CHECKED : MF_UNCHECKED); |
| 6840 | | |
| 6841 | | // Add frame to dialog again |
| 6842 | | lMainStyle = GetWindowLong(hMain, GWL_STYLE); |
| 6843 | | lMainStyle = lMainStyle | WS_BORDER; |
| 6844 | | SetWindowLong(hMain, GWL_STYLE, lMainStyle); |
| 6845 | | |
| 6846 | | // Show the window maximized |
| 6847 | | if( GetWindowState() == SW_MAXIMIZE ) |
| 6848 | | { |
| 6849 | | ShowWindow(hMain, SW_NORMAL); |
| 6850 | | ShowWindow(hMain, SW_MAXIMIZE); |
| 6851 | | } |
| 6852 | | else |
| 6853 | | ShowWindow(hMain, SW_RESTORE); |
| 6854 | | |
| 6855 | | SetRunFullScreen(FALSE); |
| 6856 | | } |
| 6857 | | else |
| 6858 | | { |
| 6859 | | // Set to fullscreen |
| 6860 | | |
| 6861 | | // Remove menu |
| 6862 | | SetMenu(hMain,NULL); |
| 6863 | | |
| 6864 | | // Frameless dialog (fake fullscreen) |
| 6865 | | lMainStyle = GetWindowLong(hMain, GWL_STYLE); |
| 6866 | | lMainStyle = lMainStyle & (WS_BORDER ^ 0xffffffff); |
| 6867 | | SetWindowLong(hMain, GWL_STYLE, lMainStyle); |
| 6868 | | if( IsMaximized(hMain) ) |
| 6869 | | { |
| 6870 | | ShowWindow(hMain, SW_NORMAL); |
| 6871 | | SetWindowState( SW_MAXIMIZE ); |
| 6872 | | } |
| 6873 | | ShowWindow(hMain, SW_MAXIMIZE); |
| 6874 | | |
| 6875 | | SetRunFullScreen(TRUE); |
| 6876 | | } |
| 6877 | | } |
| 6878 | | |
| 6879 | | /* |
| 6880 | | Checks to see if the mouse has been moved since this func |
| 6881 | | was first called (which is at startup). The reason for |
| 6882 | | storing the startup coordinates of the mouse is that when |
| 6883 | | a window is created it generates WM_MOUSEOVER events, even |
| 6884 | | though the user didn't actually move the mouse. So we need |
| 6885 | | to know when the WM_MOUSEOVER event is user-triggered. |
| 6886 | | |
| 6887 | | POSSIBLE BUGS: |
| 6888 | | Gets polled at every WM_MOUSEMOVE so it might cause lag, |
| 6889 | | but there's probably another way to code this that's |
| 6890 | | way better? |
| 6891 | | |
| 6892 | | */ |
| 6893 | | |
| 6894 | | BOOL MouseHasBeenMoved(void) |
| 6895 | | { |
| 6896 | | static int mouse_x = -1; |
| 6897 | | static int mouse_y = -1; |
| 6898 | | POINT p; |
| 6899 | | |
| 6900 | | GetCursorPos(&p); |
| 6901 | | |
| 6902 | | if (mouse_x == -1) // First time |
| 6903 | | { |
| 6904 | | mouse_x = p.x; |
| 6905 | | mouse_y = p.y; |
| 6906 | | } |
| 6907 | | |
| 6908 | | return (p.x != mouse_x || p.y != mouse_y); |
| 6909 | | } |
| 6910 | | |
| 6911 | | /* End of source file */ |
src/osd/winui/mame32.rc
| r1367 | r1368 | |
| 1 | | // Microsoft Visual C++ generated resource script. |
| 2 | | // |
| 3 | | #include "resource.h" |
| 4 | | |
| 5 | | #ifdef MESS |
| 6 | | #include "resourcems.h" |
| 7 | | #endif |
| 8 | | |
| 9 | | // Generated Help ID header file |
| 10 | | #define APSTUDIO_HIDDEN_SYMBOLS |
| 11 | | #include "resource.hm" |
| 12 | | #undef APSTUDIO_HIDDEN_SYMBOLS |
| 13 | | |
| 14 | | #define APSTUDIO_READONLY_SYMBOLS |
| 15 | | ///////////////////////////////////////////////////////////////////////////// |
| 16 | | // |
| 17 | | // Generated from the TEXTINCLUDE 2 resource. |
| 18 | | // |
| 19 | | #define NOWINRES |
| 20 | | #include "windows.h" |
| 21 | | #include "commctrl.h" |
| 22 | | |
| 23 | | ///////////////////////////////////////////////////////////////////////////// |
| 24 | | #undef APSTUDIO_READONLY_SYMBOLS |
| 25 | | |
| 26 | | ///////////////////////////////////////////////////////////////////////////// |
| 27 | | // English (U.S.) resources |
| 28 | | |
| 29 | | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
| 30 | | #ifdef _WIN32 |
| 31 | | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US |
| 32 | | #pragma code_page(1252) |
| 33 | | #endif //_WIN32 |
| 34 | | |
| 35 | | ///////////////////////////////////////////////////////////////////////////// |
| 36 | | // |
| 37 | | // Menu |
| 38 | | // |
| 39 | | |
| 40 | | IDR_MAIN_MENU MENU |
| 41 | | BEGIN |
| 42 | | POPUP "&File" |
| 43 | | BEGIN |
| 44 | | MENUITEM "&Exit", ID_FILE_EXIT |
| 45 | | END |
| 46 | | POPUP "&Help" |
| 47 | | BEGIN |
| 48 | | #ifdef MESS |
| 49 | | MENUITEM "&About MESS", ID_ABOUT |
| 50 | | #else |
| 51 | | MENUITEM "&About MAME32", ID_ABOUT |
| 52 | | #endif |
| 53 | | END |
| 54 | | END |
| 55 | | |
| 56 | | IDR_UI_MENU MENU |
| 57 | | BEGIN |
| 58 | | POPUP "&File" |
| 59 | | BEGIN |
| 60 | | MENUITEM "&Play", ID_FILE_PLAY |
| 61 | | MENUITEM SEPARATOR |
| 62 | | MENUITEM "Play and &Record Input...", ID_FILE_PLAY_RECORD |
| 63 | | MENUITEM "P&layback Input...", ID_FILE_PLAY_BACK |
| 64 | | MENUITEM SEPARATOR |
| 65 | | MENUITEM "Play and Record &Wave Output...", ID_FILE_PLAY_RECORD_WAVE |
| 66 | | MENUITEM SEPARATOR |
| 67 | | MENUITEM "Play and Record &MNG Output...", ID_FILE_PLAY_RECORD_MNG |
| 68 | | MENUITEM SEPARATOR |
| 69 | | MENUITEM "Loa&d Savestate...", ID_FILE_LOADSTATE |
| 70 | | MENUITEM SEPARATOR |
| 71 | | #ifdef MESS |
| 72 | | MENUITEM "&Select Random System", ID_CONTEXT_SELECT_RANDOM |
| 73 | | MENUITEM SEPARATOR |
| 74 | | MENUITEM "Op&en Other Software...", ID_MESS_OPEN_SOFTWARE |
| 75 | | MENUITEM "&Create Image...", ID_MESS_CREATE_SOFTWARE |
| 76 | | #ifdef MAME_DEBUG |
| 77 | | MENUITEM SEPARATOR |
| 78 | | MENUITEM "Run Tests", ID_MESS_RUN_TESTS |
| 79 | | #endif |
| 80 | | #else /* !MESS */ |
| 81 | | MENUITEM "&Select Random Game", ID_CONTEXT_SELECT_RANDOM |
| 82 | | #endif /* MESS */ |
| 83 | | MENUITEM SEPARATOR |
| 84 | | MENUITEM "Pr&operties", ID_GAME_PROPERTIES |
| 85 | | MENUITEM SEPARATOR |
| 86 | | #ifdef MESS |
| 87 | | MENUITEM "&Audit all systems", ID_FILE_AUDIT |
| 88 | | #else |
| 89 | | MENUITEM "&Audit all games", ID_FILE_AUDIT |
| 90 | | #endif /* MESS */ |
| 91 | | MENUITEM SEPARATOR |
| 92 | | MENUITEM "E&xit", ID_FILE_EXIT |
| 93 | | END |
| 94 | | POPUP "&View" |
| 95 | | BEGIN |
| 96 | | MENUITEM "&Toolbar\tAlt+T", ID_VIEW_TOOLBARS |
| 97 | | MENUITEM "&Status bar\tAlt+S", ID_VIEW_STATUS |
| 98 | | MENUITEM "Fold&er List\tAlt+D", ID_VIEW_FOLDERS |
| 99 | | MENUITEM "&Picture Area\tAlt+P", ID_VIEW_PICTURE_AREA |
| 100 | | MENUITEM "Screenshot Ta&b\tAlt+B", ID_VIEW_PAGETAB |
| 101 | | MENUITEM SEPARATOR |
| 102 | | MENUITEM "&Fullscreen\tF11", ID_VIEW_FULLSCREEN |
| 103 | | MENUITEM SEPARATOR |
| 104 | | POPUP "S&how Pictures" |
| 105 | | BEGIN |
| 106 | | MENUITEM "&Snapshot", ID_TOGGLE_TAB_SCREENSHOT |
| 107 | | MENUITEM "&Flyer", ID_TOGGLE_TAB_FLYER |
| 108 | | MENUITEM "&Cabinet", ID_TOGGLE_TAB_CABINET |
| 109 | | MENUITEM "&Marquee", ID_TOGGLE_TAB_MARQUEE |
| 110 | | MENUITEM "&Title", ID_TOGGLE_TAB_TITLE |
| 111 | | MENUITEM "Control &Panel", ID_TOGGLE_TAB_CONTROL_PANEL |
| 112 | | MENUITEM "PC&B", ID_TOGGLE_TAB_PCB |
| 113 | | |
| 114 | | MENUITEM "&History", ID_TOGGLE_TAB_HISTORY |
| 115 | | END |
| 116 | | MENUITEM SEPARATOR |
| 117 | | MENUITEM "L&arge Icons", ID_VIEW_LARGE_ICON |
| 118 | | MENUITEM "S&mall Icons", ID_VIEW_SMALL_ICON |
| 119 | | MENUITEM "&List", ID_VIEW_LIST_MENU |
| 120 | | MENUITEM "&Details", ID_VIEW_DETAIL |
| 121 | | MENUITEM "&Grouped", ID_VIEW_GROUPED |
| 122 | | MENUITEM SEPARATOR |
| 123 | | POPUP "Arrange &Icons" |
| 124 | | BEGIN |
| 125 | | MENUITEM "by &Name", ID_VIEW_BYGAME |
| 126 | | MENUITEM "by D&irectory", ID_VIEW_BYDIRECTORY |
| 127 | | MENUITEM "by &Manufacturer", ID_VIEW_BYMANUFACTURER |
| 128 | | MENUITEM "by Times &Played", ID_VIEW_BYTIMESPLAYED |
| 129 | | MENUITEM "by &Type", ID_VIEW_BYTYPE |
| 130 | | MENUITEM "by &Date", ID_VIEW_BYYEAR |
| 131 | | END |
| 132 | | MENUITEM "Line &Up Icons", ID_VIEW_LINEUPICONS |
| 133 | | MENUITEM SEPARATOR |
| 134 | | MENUITEM "&Refresh\tF5", ID_UPDATE_GAMELIST |
| 135 | | MENUITEM "&Custom Filters...\tCtrl+F", ID_CONTEXT_FILTERS |
| 136 | | MENUITEM "Customi&ze Fields...", ID_CUSTOMIZE_FIELDS |
| 137 | | END |
| 138 | | POPUP "&Options" |
| 139 | | BEGIN |
| 140 | | #ifdef MESS |
| 141 | | MENUITEM "System List &Font...", ID_OPTIONS_FONT |
| 142 | | MENUITEM "System List &Clone Color...", ID_OPTIONS_CLONE_COLOR |
| 143 | | MENUITEM "&Directories...", ID_OPTIONS_DIR |
| 144 | | MENUITEM "Default System &Options...", ID_OPTIONS_DEFAULTS |
| 145 | | #else |
| 146 | | MENUITEM "Game List &Font...", ID_OPTIONS_FONT |
| 147 | | MENUITEM "Game List &Clone Color...", ID_OPTIONS_CLONE_COLOR |
| 148 | | MENUITEM "&Directories...", ID_OPTIONS_DIR |
| 149 | | MENUITEM "Default Game &Options...", ID_OPTIONS_DEFAULTS |
| 150 | | #endif |
| 151 | | MENUITEM "&Reset to Default...", ID_OPTIONS_RESET_DEFAULTS |
| 152 | | MENUITEM "&Interface Options...", ID_OPTIONS_INTERFACE |
| 153 | | MENUITEM "&Background Image...", ID_OPTIONS_BG |
| 154 | | END |
| 155 | | POPUP "&Help" |
| 156 | | BEGIN |
| 157 | | #ifdef MESS |
| 158 | | MENUITEM "&Mess Release Notes", ID_HELP_RELEASE |
| 159 | | MENUITEM "&New Mess Features", ID_HELP_WHATS_NEW |
| 160 | | #else |
| 161 | | MENUITEM "&Contents\tF1", ID_HELP_CONTENTS |
| 162 | | MENUITEM "&Troubleshooting", ID_HELP_TROUBLE |
| 163 | | MENUITEM SEPARATOR |
| 164 | | MENUITEM "&New Game Changes", ID_HELP_WHATS_NEW32 |
| 165 | | MENUITEM "&Mame Release Notes", ID_HELP_WHATS_NEW |
| 166 | | #endif |
| 167 | | MENUITEM SEPARATOR |
| 168 | | MENUITEM "&About", ID_HELP_ABOUT |
| 169 | | END |
| 170 | | END |
| 171 | | |
| 172 | | IDR_CONTEXT_MENU MENU |
| 173 | | BEGIN |
| 174 | | POPUP "Context Menu" |
| 175 | | BEGIN |
| 176 | | MENUITEM "&Play", ID_FILE_PLAY |
| 177 | | MENUITEM SEPARATOR |
| 178 | | MENUITEM "Play and &Record Input...", ID_FILE_PLAY_RECORD |
| 179 | | MENUITEM SEPARATOR |
| 180 | | MENUITEM "&Add to Custom Folder...", ID_CONTEXT_ADD_CUSTOM |
| 181 | | MENUITEM "R&emove From This Folder", ID_CONTEXT_REMOVE_CUSTOM |
| 182 | | MENUITEM "&Custom Filters...", ID_CONTEXT_FILTERS |
| 183 | | MENUITEM SEPARATOR |
| 184 | | #ifdef MESS |
| 185 | | MENUITEM "&Select Random System", ID_CONTEXT_SELECT_RANDOM |
| 186 | | #else |
| 187 | | MENUITEM "&Select Random Game", ID_CONTEXT_SELECT_RANDOM |
| 188 | | #endif |
| 189 | | MENUITEM SEPARATOR |
| 190 | | MENUITEM "Rese&t Playcount", ID_CONTEXT_RESET_PLAYCOUNT |
| 191 | | MENUITEM "Reset Pla&y Time", ID_CONTEXT_RESET_PLAYTIME |
| 192 | | MENUITEM SEPARATOR |
| 193 | | MENUITEM "A&udit", ID_GAME_AUDIT |
| 194 | | MENUITEM SEPARATOR |
| 195 | | MENUITEM "Pr&operties", ID_GAME_PROPERTIES |
| 196 | | MENUITEM "Source propert&ies", ID_FOLDER_SOURCEPROPERTIES |
| 197 | | MENUITEM "&Vector properties", ID_FOLDER_VECTORPROPERTIES |
| 198 | | END |
| 199 | | END |
| 200 | | |
| 201 | | IDR_CONTEXT_HEADER MENU |
| 202 | | BEGIN |
| 203 | | POPUP "Header Context Menu" |
| 204 | | BEGIN |
| 205 | | MENUITEM "Sort &Ascending", ID_SORT_ASCENDING |
| 206 | | MENUITEM "Sort &Descending", ID_SORT_DESCENDING |
| 207 | | MENUITEM SEPARATOR |
| 208 | | MENUITEM "Customi&ze Fields...", ID_CUSTOMIZE_FIELDS |
| 209 | | END |
| 210 | | END |
| 211 | | |
| 212 | | IDR_CONTEXT_TREE MENU |
| 213 | | BEGIN |
| 214 | | POPUP "Context Menu Tree" |
| 215 | | BEGIN |
| 216 | | MENUITEM "&Rename", ID_CONTEXT_RENAME_CUSTOM |
| 217 | | MENUITEM "&Custom Filters...", ID_CONTEXT_FILTERS |
| 218 | | MENUITEM SEPARATOR |
| 219 | | POPUP "&Show Folders" |
| 220 | | BEGIN |
| 221 | | MENUITEM "overridden by code", ID_CONTEXT_SHOW_FOLDER_START |
| 222 | | |
| 223 | | END |
| 224 | | MENUITEM SEPARATOR |
| 225 | | MENUITEM "&Audit", ID_FOLDER_AUDIT |
| 226 | | MENUITEM SEPARATOR |
| 227 | | MENUITEM "&Properties", ID_FOLDER_PROPERTIES |
| 228 | | END |
| 229 | | END |
| 230 | | |
| 231 | | IDR_CONTEXT_SCREENSHOT MENU |
| 232 | | BEGIN |
| 233 | | POPUP "Context Screen Shot" |
| 234 | | BEGIN |
| 235 | | MENUITEM "Show Tab &Control", ID_VIEW_PAGETAB |
| 236 | | MENUITEM SEPARATOR |
| 237 | | POPUP "S&how Pictures" |
| 238 | | BEGIN |
| 239 | | MENUITEM "&Snapshot", ID_TOGGLE_TAB_SCREENSHOT |
| 240 | | MENUITEM "&Flyer", ID_TOGGLE_TAB_FLYER |
| 241 | | MENUITEM "&Cabinet", ID_TOGGLE_TAB_CABINET |
| 242 | | MENUITEM "&Marquee", ID_TOGGLE_TAB_MARQUEE |
| 243 | | MENUITEM "&Title", ID_TOGGLE_TAB_TITLE |
| 244 | | MENUITEM "Control &Panel", ID_TOGGLE_TAB_CONTROL_PANEL |
| 245 | | MENUITEM "PC&B", ID_TOGGLE_TAB_PCB |
| 246 | | |
| 247 | | MENUITEM "&History", ID_TOGGLE_TAB_HISTORY |
| 248 | | END |
| 249 | | MENUITEM SEPARATOR |
| 250 | | MENUITEM "&Snapshot", ID_VIEW_TAB_SCREENSHOT |
| 251 | | MENUITEM "&Flyer", ID_VIEW_TAB_FLYER |
| 252 | | MENUITEM "&Cabinet", ID_VIEW_TAB_CABINET |
| 253 | | MENUITEM "&Marquee", ID_VIEW_TAB_MARQUEE |
| 254 | | MENUITEM "&Title", ID_VIEW_TAB_TITLE |
| 255 | | MENUITEM "Control &Panel", ID_VIEW_TAB_CONTROL_PANEL |
| 256 | | MENUITEM "PC&B", ID_VIEW_TAB_PCB |
| 257 | | MENUITEM "&History", ID_VIEW_TAB_HISTORY |
| 258 | | END |
| 259 | | END |
| 260 | | |
| 261 | | |
| 262 | | #ifdef APSTUDIO_INVOKED |
| 263 | | ///////////////////////////////////////////////////////////////////////////// |
| 264 | | // |
| 265 | | // TEXTINCLUDE |
| 266 | | // |
| 267 | | |
| 268 | | 1 TEXTINCLUDE |
| 269 | | BEGIN |
| 270 | | "resource.h\0" |
| 271 | | END |
| 272 | | |
| 273 | | 2 TEXTINCLUDE |
| 274 | | BEGIN |
| 275 | | "#define NOWINRES\r\n" |
| 276 | | "#include ""windows.h""\r\n" |
| 277 | | "#include ""commctrl.h""\r\n" |
| 278 | | "\0" |
| 279 | | END |
| 280 | | |
| 281 | | 3 TEXTINCLUDE |
| 282 | | BEGIN |
| 283 | | "#include ""mamevers.rc"" // Version block\r\n" |
| 284 | | "\r\n" |
| 285 | | "\0" |
| 286 | | END |
| 287 | | |
| 288 | | #endif // APSTUDIO_INVOKED |
| 289 | | |
| 290 | | |
| 291 | | ///////////////////////////////////////////////////////////////////////////// |
| 292 | | // |
| 293 | | // Icon |
| 294 | | // |
| 295 | | |
| 296 | | // Icon with lowest ID value placed first to ensure application icon |
| 297 | | // remains consistent on all systems. |
| 298 | | #ifdef MESS |
| 299 | | IDI_MAME32_ICON ICON "res/mess.ico" |
| 300 | | #else |
| 301 | | IDI_MAME32_ICON ICON "res\\mame32.ico" |
| 302 | | #endif |
| 303 | | IDI_WIN_ROMS ICON "res\\win_roms.ico" |
| 304 | | IDI_WIN_NOROMS ICON "res\\win_noro.ico" |
| 305 | | IDI_WIN_UNKNOWN ICON "res\\win_unkn.ico" |
| 306 | | IDI_WIN_CLONE ICON "res\\win_clone.ico" |
| 307 | | IDI_WIN_REDX ICON "res\\win_redx.ico" |
| 308 | | IDI_FOLDER_AVAILABLE ICON "res\\foldavail.ico" |
| 309 | | IDI_FOLDER ICON "res\\folder.ico" |
| 310 | | IDI_FOLDER_MANUFACTURER ICON "res\\foldmanu.ico" |
| 311 | | IDI_FOLDER_OPEN ICON "res\\foldopen.ico" |
| 312 | | IDI_FOLDER_UNAVAILABLE ICON "res\\foldunav.ico" |
| 313 | | IDI_FOLDER_HORIZONTAL ICON "res\\horz.ico" |
| 314 | | IDI_FOLDER_VERTICAL ICON "res\\vert.ico" |
| 315 | | IDI_MANUFACTURER ICON "res\\manufact.ico" |
| 316 | | IDI_FOLDER_YEAR ICON "res\\foldyear.ico" |
| 317 | | IDI_FOLDER_SOURCE ICON "res\\foldsrc.ico" |
| 318 | | IDI_WORKING ICON "res\\working.ico" |
| 319 | | IDI_NONWORKING ICON "res\\nonwork.ico" |
| 320 | | IDI_YEAR ICON "res\\year.ico" |
| 321 | | IDI_KEYBOARD ICON "res\\keyboard.ico" |
| 322 | | IDI_JOYSTICK ICON "res\\joystick.ico" |
| 323 | | IDI_CPU ICON "res\\cpu.ico" |
| 324 | | IDI_SOUND ICON "res\\samples.ico" |
| 325 | | IDI_SOUNDTAB ICON "res\\sound.ico" |
| 326 | | IDI_SOURCE ICON "res\\source.ico" |
| 327 | | IDI_HARDDISK ICON "res\\harddisk.ico" |
| 328 | | IDI_DISPLAY ICON "res\\display.ico" |
| 329 | | IDI_CHECKMARK ICON "res\\checkmark.ico" |
| 330 | | IDI_HEADER_UP ICON "res\\header_up.ico" |
| 331 | | IDI_HEADER_DOWN ICON "res\\header_down.ico" |
| 332 | | |
| 333 | | #ifdef MESS |
| 334 | | IDI_WIN_NOROMSNEEDED ICON "res/win_nrnd.ico" |
| 335 | | IDI_WIN_MISSINGOPTROM ICON "res/win_noor.ico" |
| 336 | | IDI_WIN_FLOP ICON "res/win_flop.ico" |
| 337 | | IDI_WIN_CASS ICON "res/win_cass.ico" |
| 338 | | IDI_WIN_SERL ICON "res/win_serl.ico" |
| 339 | | IDI_WIN_SNAP ICON "res/win_snap.ico" |
| 340 | | IDI_WIN_PRIN ICON "res/win_prin.ico" |
| 341 | | IDI_WIN_HARD ICON "res/win_hard.ico" |
| 342 | | IDI_WIN_CYLN ICON "res/win_cyln.ico" |
| 343 | | IDI_WIN_PTAP ICON "res/win_ptap.ico" |
| 344 | | IDI_WIN_PCRD ICON "res/win_pcrd.ico" |
| 345 | | |
| 346 | | #endif |
| 347 | | |
| 348 | | ///////////////////////////////////////////////////////////////////////////// |
| 349 | | // |
| 350 | | // Dialog |
| 351 | | // |
| 352 | | |
| 353 | | IDD_ABOUT DIALOG 0, 0, 296, 129 |
| 354 | | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 355 | | #ifdef MESS |
| 356 | | CAPTION "About MESS" |
| 357 | | #else |
| 358 | | CAPTION "About MAME32" |
| 359 | | #endif |
| 360 | | FONT 8, "MS Shell Dlg" |
| 361 | | BEGIN |
| 362 | | DEFPUSHBUTTON "&OK",IDOK,200,109,50,14,WS_GROUP |
| 363 | | #ifdef MESS |
| 364 | | CTEXT "Multi Emulator Super System",IDC_STATIC,147,7,142, |
| 365 | | 11,NOT WS_GROUP |
| 366 | | CTEXT "Version 0",IDC_VERSION,147,18,142,11,NOT WS_GROUP |
| 367 | | CTEXT "Copyright (C) 1998-2005 The MESS Team",IDC_STATIC,147, |
| 368 | | 29,142,10,NOT WS_GROUP |
| 369 | | CTEXT "MESS GUI based on MAME32 version by",IDC_STATIC,147,51,142,10,NOT |
| 370 | | WS_GROUP |
| 371 | | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,147,44,142,1 |
| 372 | | CTEXT "Additional MAME32 code by",IDC_STATIC,147,74,142,9 |
| 373 | | CTEXT "Robert Schlabbach, Dan Miller (Help file)",IDC_STATIC, |
| 374 | | 147,96,142,9 |
| 375 | | CTEXT "Michael Soderstrom and Christopher Kirmse",IDC_STATIC, |
| 376 | | 147,62,142,9,NOT WS_GROUP |
| 377 | | CTEXT "Mike Haaland, Andrew Kirmse, Jeff Miller",IDC_STATIC, |
| 378 | | 147,85,142,9 |
| 379 | | #else |
| 380 | | CTEXT "Multiple Arcade Machine Emulator",IDC_STATIC,147,7,142, |
| 381 | | 11,NOT WS_GROUP |
| 382 | | CTEXT "Version 0",IDC_VERSION,147,18,142,11,NOT WS_GROUP |
| 383 | | CTEXT "Copyright (C) 1997-2007 The MAME Team",IDC_STATIC,147, |
| 384 | | 29,142,10,NOT WS_GROUP |
| 385 | | CTEXT "MAME32 version by",IDC_STATIC,147,51,142,10,NOT |
| 386 | | WS_GROUP |
| 387 | | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,147,44,142,1 |
| 388 | | CTEXT "Additional MAME32 code by",IDC_STATIC,147,74,142,9 |
| 389 | | CTEXT "Christopher Kirmse and Michael Soderstrom",IDC_STATIC, |
| 390 | | 147,62,142,9,NOT WS_GROUP |
| 391 | | CTEXT "Mike Haaland, Andrew Kirmse, Jeff Miller",IDC_STATIC, |
| 392 | | 147,85,142,9 |
| 393 | | CTEXT "and John Hardy IV",IDC_STATIC,147,96,142,9 |
| 394 | | #endif |
| 395 | | CONTROL "",IDC_ABOUT,"Static",SS_BITMAP | SS_SUNKEN,7,7,16,14 |
| 396 | | END |
| 397 | | |
| 398 | | IDD_DIRECTX DIALOG 0, 0, 236, 69 |
| 399 | | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 400 | | #ifdef MESS |
| 401 | | CAPTION "MESS" |
| 402 | | #else |
| 403 | | CAPTION "MAME32" |
| 404 | | #endif |
| 405 | | FONT 8, "MS Shell Dlg" |
| 406 | | BEGIN |
| 407 | | DEFPUSHBUTTON "Go to Microsoft's DirectX Web Page",IDB_WEB_PAGE,48,52, |
| 408 | | 140,14 |
| 409 | | EDITTEXT IDC_DIRECTX_HELP,7,0,222,48,ES_MULTILINE | |
| 410 | | ES_AUTOHSCROLL | ES_READONLY |
| 411 | | END |
| 412 | | |
| 413 | | IDD_AUDIT DIALOG 0, 0, 283, 188 |
| 414 | | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 415 | | CAPTION "File Audit" |
| 416 | | FONT 8, "MS Shell Dlg" |
| 417 | | BEGIN |
| 418 | | PUSHBUTTON "&Pause",IDPAUSE,98,168,40,14 |
| 419 | | PUSHBUTTON "&Cancel",IDCANCEL,144,168,40,14 |
| 420 | | GROUPBOX "ROMs",IDC_STATIC,6,4,132,65 |
| 421 | | LTEXT "Correct:",IDC_STATIC,51,28,32,8 |
| 422 | | CONTROL "Progress1",IDC_ROMS_PROGRESS,"msctls_progress32", |
| 423 | | WS_BORDER | 0x1,14,16,116,8 |
| 424 | | LTEXT "Incorrect:",IDC_STATIC,51,42,32,8 |
| 425 | | LTEXT "Total:",IDC_STATIC,51,56,32,8 |
| 426 | | LTEXT "0",IDC_ROMS_CORRECT,87,28,20,8 |
| 427 | | LTEXT "0",IDC_ROMS_INCORRECT,87,42,20,8 |
| 428 | | LTEXT "0",IDC_ROMS_TOTAL,87,56,20,8 |
| 429 | | GROUPBOX "Samples",IDC_STATIC,145,4,132,65 |
| 430 | | CONTROL "Progress1",IDC_SAMPLES_PROGRESS,"msctls_progress32", |
| 431 | | WS_BORDER | 0x1,153,16,116,8 |
| 432 | | LTEXT "Correct:",IDC_STATIC,191,28,33,8 |
| 433 | | LTEXT "Incorrect:",IDC_STATIC,191,42,33,8 |
| 434 | | LTEXT "Total:",IDC_STATIC,191,56,33,8 |
| 435 | | LTEXT "0",IDC_SAMPLES_CORRECT,227,28,20,8 |
| 436 | | LTEXT "0",IDC_SAMPLES_INCORRECT,227,42,20,8 |
| 437 | | LTEXT "0",IDC_SAMPLES_TOTAL,227,56,20,8 |
| 438 | | GROUPBOX "Details",IDC_STATIC,6,72,271,90 |
| 439 | | EDITTEXT IDC_AUDIT_DETAILS,12,82,259,74,ES_MULTILINE | |
| 440 | | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL | |
| 441 | | NOT WS_TABSTOP |
| 442 | | END |
| 443 | | |
| 444 | | IDD_DIRECTORIES DIALOG 0, 0, 230, 107 |
| 445 | | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 446 | | CAPTION "Directories" |
| 447 | | FONT 8, "MS Shell Dlg" |
| 448 | | BEGIN |
| 449 | | LTEXT "Show directories for:",IDC_STATIC,6,6,67,10 |
| 450 | | COMBOBOX IDC_DIR_COMBO,6,18,160,79,CBS_DROPDOWNLIST | CBS_SORT | |
| 451 | | WS_VSCROLL | WS_TABSTOP |
| 452 | | LTEXT "Directories:",IDC_STATIC,6,38,38,10 |
| 453 | | CONTROL "List1",IDC_DIR_LIST,"SysListView32",LVS_REPORT | |
| 454 | | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_EDITLABELS | |
| 455 | | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | |
| 456 | | WS_TABSTOP,6,50,160,51 |
| 457 | | DEFPUSHBUTTON "OK",IDOK,173,8,50,14 |
| 458 | | PUSHBUTTON "Cancel",IDCANCEL,173,26,50,14 |
| 459 | | PUSHBUTTON "Browse...",IDC_DIR_BROWSE,173,50,50,14 |
| 460 | | PUSHBUTTON "Insert",IDC_DIR_INSERT,173,68,50,14 |
| 461 | | PUSHBUTTON "Delete",IDC_DIR_DELETE,173,87,50,14 |
| 462 | | END |
| 463 | | |
| 464 | | IDD_COLUMNS DIALOG 0, 0, 302, 145 |
| 465 | | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 466 | | CAPTION "Customize Fields" |
| 467 | | FONT 8, "MS Shell Dlg" |
| 468 | | BEGIN |
| 469 | | LTEXT "Available fields:",IDC_STATIC,6,6,80,10,SS_CENTERIMAGE |
| 470 | | CONTROL "List1",IDC_LISTAVAILABLECOLUMNS,"SysListView32", |
| 471 | | LVS_LIST | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | |
| 472 | | LVS_NOSORTHEADER | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6, |
| 473 | | 18,90,100 |
| 474 | | PUSHBUTTON "Add ->",IDC_BUTTONADD,102,18,46,14,WS_DISABLED |
| 475 | | PUSHBUTTON "<- Remove",IDC_BUTTONREMOVE,102,36,46,14,WS_DISABLED |
| 476 | | LTEXT "Show these fields in this order:",IDC_STATIC,154,6,96, |
| 477 | | 10,SS_CENTERIMAGE |
| 478 | | CONTROL "List1",IDC_LISTSHOWCOLUMNS,"SysListView32",LVS_LIST | |
| 479 | | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | |
| 480 | | WS_BORDER | WS_HSCROLL | WS_TABSTOP,154,18,90,100 |
| 481 | | PUSHBUTTON "Move Up",IDC_BUTTONMOVEUP,250,18,46,14,WS_DISABLED |
| 482 | | PUSHBUTTON "Move Down",IDC_BUTTONMOVEDOWN,250,36,46,14,WS_DISABLED |
| 483 | | DEFPUSHBUTTON "OK",IDOK,105,124,44,14 |
| 484 | | PUSHBUTTON "Cancel",IDCANCEL,155,124,44,14 |
| 485 | | END |
| 486 | | |
| 487 | | IDD_PROP_CONTROLLER DIALOGEX 0, 0, 220, 240 |
| 488 | | STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION |
| 489 | | CAPTION "Controller Mapping" |
| 490 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 491 | | BEGIN |
| 492 | | ICON IDI_JOYSTICK,IDC_STATIC,20,10,20,20 |
| 493 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 494 | | SS_NOPREFIX |
| 495 | | GROUPBOX "Paddle device",IDC_STATIC,4,40,102,28 |
| 496 | | COMBOBOX IDC_PADDLE,10,50,91,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 497 | | WS_TABSTOP,0,HIDC_PADDLE |
| 498 | | GROUPBOX "ADStick device",IDC_STATIC,4,71,102,28 |
| 499 | | COMBOBOX IDC_ADSTICK,10,80,91,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 500 | | WS_TABSTOP,0,HIDC_ADSTICK |
| 501 | | GROUPBOX "Pedal device",IDC_STATIC,4,102,102,28 |
| 502 | | COMBOBOX IDC_PEDAL,10,112,91,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 503 | | WS_TABSTOP,0,HIDC_PEDAL |
| 504 | | GROUPBOX "Mouse device",IDC_STATIC,4,133,102,28 |
| 505 | | COMBOBOX IDC_MOUSE,10,142,90,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 506 | | WS_TABSTOP,0,HIDC_MOUSE |
| 507 | | GROUPBOX "Dial device",IDC_STATIC,113,40,102,28 |
| 508 | | COMBOBOX IDC_DIAL,119,50,90,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 509 | | WS_TABSTOP,0,HIDC_DIAL |
| 510 | | GROUPBOX "Trackball device",IDC_STATIC,113,71,102,28 |
| 511 | | COMBOBOX IDC_TRACKBALL,119,80,90,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 512 | | WS_TABSTOP,0,HIDC_TRACKBALL |
| 513 | | GROUPBOX "Lightgun device",IDC_STATIC,113,102,102,28 |
| 514 | | COMBOBOX IDC_LIGHTGUNDEVICE,119,112,90,62,CBS_DROPDOWNLIST | |
| 515 | | WS_VSCROLL | WS_TABSTOP,0,HIDC_LIGHTGUNDEVICE |
| 516 | | GROUPBOX "Positional device",IDC_STATIC,113,133,102,28 |
| 517 | | COMBOBOX IDC_POSITIONAL,119,142,90,62,CBS_DROPDOWNLIST | |
| 518 | | WS_VSCROLL | WS_TABSTOP,0,HIDC_POSITIONAL |
| 519 | | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 520 | | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 521 | | 0,0,HIDC_USE_DEFAULT |
| 522 | | END |
| 523 | | |
| 524 | | IDD_PROP_SCREEN DIALOGEX 0, 0, 220, 240 |
| 525 | | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 526 | | CAPTION "Screen" |
| 527 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 528 | | BEGIN |
| 529 | | ICON IDI_DISPLAY,IDC_STATIC,20,10,21,20 |
| 530 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 531 | | SS_NOPREFIX |
| 532 | | GROUPBOX "Number of screens",IDC_STATIC,4,40,103,24 |
| 533 | | CONTROL "GammaSlider",IDC_NUMSCREENS,"msctls_trackbar32", |
| 534 | | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,50,75,10,0, |
| 535 | | HIDC_NUMSCREENS |
| 536 | | RTEXT "1",IDC_NUMSCREENSDISP,84,49,14,10,SS_CENTERIMAGE | NOT |
| 537 | | WS_GROUP |
| 538 | | GROUPBOX "Screen",IDC_STATIC,4,66,103,29 |
| 539 | | COMBOBOX IDC_SCREEN,10,76,91,64,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 540 | | WS_TABSTOP,0,HIDC_SCREEN |
| 541 | | GROUPBOX "",IDC_STATIC,4,97,103,28 |
| 542 | | CONTROL "Autoselect aspect",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | |
| 543 | | WS_TABSTOP,10,97,73,10,0,HIDC_ASPECT |
| 544 | | LTEXT "Aspect ratio",IDC_ASPECTRATIOTEXT,17,108,40,11, |
| 545 | | SS_CENTERIMAGE | NOT WS_GROUP |
| 546 | | EDITTEXT IDC_ASPECTRATION,60,108,14,12,ES_RIGHT | ES_AUTOHSCROLL | |
| 547 | | ES_NUMBER,0,HIDC_ASPECTRATION |
| 548 | | LTEXT ":",IDC_STATIC,76,108,8,10,SS_CENTERIMAGE | NOT WS_GROUP |
| 549 | | EDITTEXT IDC_ASPECTRATIOD,80,108,14,12,ES_RIGHT | ES_AUTOHSCROLL | |
| 550 | | ES_NUMBER,0,HIDC_ASPECTRATIOD |
| 551 | | GROUPBOX "View",IDC_STATIC,4,128,103,28 |
| 552 | | COMBOBOX IDC_VIEW,10,137,91,64,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 553 | | WS_TABSTOP,0,HIDC_VIEW |
| 554 | | GROUPBOX "Screennumber",IDC_SCREENSELECTTEXT,113,40,102,28 |
| 555 | | COMBOBOX IDC_SCREENSELECT,119,50,90,64,CBS_DROPDOWNLIST | |
| 556 | | WS_VSCROLL | WS_TABSTOP,0,HIDC_SCREENSELECT |
| 557 | | GROUPBOX "Resolution",IDC_STATIC,113,71,102,76,WS_GROUP |
| 558 | | GROUPBOX "Size",IDC_STATIC,119,81,90,28,WS_GROUP |
| 559 | | COMBOBOX IDC_SIZES,126,91,77,70,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 560 | | WS_TABSTOP,0,HIDC_SIZES |
| 561 | | GROUPBOX "Refresh",IDC_REFRESHTEXT,119,112,90,28,WS_GROUP |
| 562 | | COMBOBOX IDC_REFRESH,126,121,77,76,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 563 | | WS_TABSTOP,0,HIDC_REFRESH |
| 564 | | CONTROL "Switch resolutions to fit",IDC_SWITCHRES,"Button", |
| 565 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,151,93,10,0, |
| 566 | | HIDC_SWITCHRES |
| 567 | | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 568 | | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 569 | | 0,0,HIDC_USE_DEFAULT |
| 570 | | END |
| 571 | | |
| 572 | | IDD_PROP_GAME DIALOG 0, 0, 220, 240 |
| 573 | | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 574 | | CAPTION "General" |
| 575 | | FONT 8, "MS Shell Dlg" |
| 576 | | BEGIN |
| 577 | | ICON IDI_MAME32_ICON,IDC_GAME_ICON,20,10,20,20 |
| 578 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 579 | | SS_NOPREFIX |
| 580 | | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,20,38,178,1 |
| 581 | | LTEXT "Manufactured:",IDC_STATIC,18,45,47,8 |
| 582 | | LTEXT "Static",IDC_PROP_MANUFACTURED,75,45,139,9,SS_NOPREFIX |
| 583 | | LTEXT "Status:",IDC_STATIC,18,55,47,8 |
| 584 | | LTEXT "Static",IDC_PROP_STATUS,75,55,139,30 |
| 585 | | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,85,178,1 |
| 586 | | LTEXT "CPU:",IDC_STATIC,18,90,47,8 |
| 587 | | LTEXT "Static\nStatic\nStatic\nStatic\nStatic",IDC_PROP_CPU,75, |
| 588 | | 90,139,40 |
| 589 | | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,130,178,1 |
| 590 | | LTEXT "Sound:",IDC_STATIC,18,135,47,8 |
| 591 | | LTEXT "Static\nStatic\nStatic\nStatic\nStatic",IDC_PROP_SOUND, |
| 592 | | 75,135,139,45 |
| 593 | | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,181,178,1 |
| 594 | | LTEXT "Screen:",IDC_STATIC,18,188,47,8 |
| 595 | | LTEXT "Static",IDC_PROP_SCREEN,75,188,139,8 |
| 596 | | LTEXT "Colors:",IDC_STATIC,18,198,47,8 |
| 597 | | LTEXT "Static",IDC_PROP_COLORS,75,198,139,8 |
| 598 | | LTEXT "Clone of:",IDC_PROP_CLONEOF_TEXT,18,218,50,8 |
| 599 | | LTEXT "Static",IDC_PROP_CLONEOF,75,218,130,18 |
| 600 | | LTEXT "Source:",IDC_STATIC,18,208,47,8 |
| 601 | | LTEXT "Static",IDC_PROP_SOURCE,75,208,139,8 |
| 602 | | END |
| 603 | | |
| 604 | | IDD_PROP_AUDIT DIALOG 0, 0, 220, 240 |
| 605 | | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 606 | | CAPTION "Audit" |
| 607 | | FONT 8, "MS Shell Dlg" |
| 608 | | BEGIN |
| 609 | | ICON IDI_CHECKMARK,IDC_STATIC,20,10,20,20 |
| 610 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 611 | | SS_NOPREFIX |
| 612 | | LTEXT "ROM check:",IDC_STATIC,10,40,50,8 |
| 613 | | LTEXT "Checking...",IDC_PROP_ROMS,66,40,139,8 |
| 614 | | LTEXT "Sample check:",IDC_STATIC,10,52,50,8 |
| 615 | | LTEXT "Checking...",IDC_PROP_SAMPLES,66,52,139,8 |
| 616 | | GROUPBOX "Details",IDC_STATIC,4,64,211,171 |
| 617 | | EDITTEXT IDC_AUDIT_DETAILS_PROP,10,74,199,155,ES_MULTILINE | |
| 618 | | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL | |
| 619 | | NOT WS_TABSTOP |
| 620 | | END |
| 621 | | |
| 622 | | IDD_PROP_DISPLAY DIALOGEX 0, 0, 220, 240 |
| 623 | | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 624 | | CAPTION "Display" |
| 625 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 626 | | BEGIN |
| 627 | | ICON IDI_DISPLAY,IDC_STATIC,20,10,20,20 |
| 628 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,169,25, |
| 629 | | SS_NOPREFIX |
| 630 | | CONTROL "Run in a window",IDC_WINDOWED,"Button",BS_AUTOCHECKBOX | |
| 631 | | WS_TABSTOP,10,40,69,10,0,HIDC_WINDOWED |
| 632 | | CONTROL "Start out maximized",IDC_MAXIMIZE,"Button", |
| 633 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,52,74,10,0,HIDC_MAXIMIZE |
| 634 | | CONTROL "Enforce aspect ratio",IDC_KEEPASPECT,"Button", |
| 635 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,64,77,10,0, |
| 636 | | HIDC_KEEPASPECT |
| 637 | | CONTROL "Throttle",IDC_THROTTLE,"Button",BS_AUTOCHECKBOX | |
| 638 | | WS_TABSTOP,10,76,39,10,0,HIDC_THROTTLE |
| 639 | | GROUPBOX "Bitmap prescaling",IDC_STATIC,4,89,103,24 |
| 640 | | CONTROL "GammaSlider",IDC_PRESCALE,"msctls_trackbar32",TBS_BOTH | |
| 641 | | TBS_NOTICKS | WS_TABSTOP,10,99,71,10,0,HIDC_PRESCALE |
| 642 | | RTEXT "1.00",IDC_PRESCALEDISP,84,98,14,11,SS_CENTERIMAGE | NOT |
| 643 | | WS_GROUP |
| 644 | | GROUPBOX "Gamma Correction",IDC_STATIC,4,115,103,24 |
| 645 | | CONTROL "GammaSlider",IDC_GAMMA,"msctls_trackbar32",TBS_BOTH | |
| 646 | | TBS_NOTICKS | WS_TABSTOP,10,125,71,10,0,HIDC_GAMMA |
| 647 | | RTEXT "2.00",IDC_GAMMADISP,84,124,14,10,SS_CENTERIMAGE | NOT |
| 648 | | WS_GROUP |
| 649 | | GROUPBOX "Brightness Correction",IDC_STATIC,4,141,103,24 |
| 650 | | CONTROL "GammaSlider",IDC_BRIGHTCORRECT,"msctls_trackbar32", |
| 651 | | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,151,71,10,0, |
| 652 | | HIDC_BRIGHTCORRECT |
| 653 | | RTEXT "1.00",IDC_BRIGHTCORRECTDISP,84,150,14,10,SS_CENTERIMAGE | |
| 654 | | NOT WS_GROUP |
| 655 | | GROUPBOX "Contrast Correction",IDC_STATIC,4,167,103,24 |
| 656 | | CONTROL "GammaSlider",IDC_CONTRAST,"msctls_trackbar32",TBS_BOTH | |
| 657 | | TBS_NOTICKS | WS_TABSTOP,10,176,71,10,0,HIDC_CONTRAST |
| 658 | | RTEXT "1.00",IDC_CONTRASTDISP,84,175,14,11,SS_CENTERIMAGE | |
| 659 | | NOT WS_GROUP |
| 660 | | GROUPBOX "Pause Brightness",IDC_STATIC,4,193,103,24 |
| 661 | | CONTROL "Slider1",IDC_PAUSEBRIGHT,"msctls_trackbar32",TBS_BOTH | |
| 662 | | TBS_NOTICKS | WS_TABSTOP,10,203,71,10,0,HIDC_PAUSEBRIGHT |
| 663 | | RTEXT "0.65",IDC_PAUSEBRIGHTDISP,84,202,14,11,SS_CENTERIMAGE | |
| 664 | | NOT WS_GROUP |
| 665 | | GROUPBOX "Videomode",IDC_STATIC,113,40,102,28 |
| 666 | | COMBOBOX IDC_VIDEO_MODE,119,50,90,50,CBS_DROPDOWNLIST | CBS_SORT | |
| 667 | | WS_VSCROLL | WS_TABSTOP,0,HIDC_VIDEO_MODE |
| 668 | | GROUPBOX "Rotation",IDC_STATIC,113,71,102,55 |
| 669 | | COMBOBOX IDC_ROTATE,119,81,90,57,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 670 | | WS_TABSTOP,0,HIDC_ROTATE |
| 671 | | CONTROL "Flip screen upside-down",IDC_FLIPY,"Button", |
| 672 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,98,91,10,0,HIDC_FLIPY |
| 673 | | CONTROL "Flip screen left-right",IDC_FLIPX,"Button", |
| 674 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,110,77,10,0,HIDC_FLIPX |
| 675 | | GROUPBOX "Direct3D",IDC_STATIC,113,128,102,57 |
| 676 | | CONTROL "Use Bilinear filtering",IDC_D3D_FILTER,"Button", |
| 677 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,138,85,10,0, |
| 678 | | HIDC_D3D_FILTER |
| 679 | | GROUPBOX "Version",IDC_STATIC,119,150,90,28 |
| 680 | | COMBOBOX IDC_D3D_VERSION,125,160,78,95,CBS_DROPDOWNLIST | |
| 681 | | WS_VSCROLL | WS_TABSTOP,0,HIDC_D3D_VERSION |
| 682 | | GROUPBOX "DirectDraw",IDC_STATIC,113,187,102,26 |
| 683 | | CONTROL "Stretch using hardware",IDC_HWSTRETCH,"Button", |
| 684 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,197,85,10,0, |
| 685 | | HIDC_HWSTRETCH |
| 686 | | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 687 | | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 688 | | 0,0,HIDC_USE_DEFAULT |
| 689 | | END |
| 690 | | |
| 691 | | IDD_PROP_SOUND DIALOGEX 0, 0, 220, 240 |
| 692 | | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 693 | | CAPTION "Sound" |
| 694 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 695 | | BEGIN |
| 696 | | ICON IDI_SOUNDTAB,IDC_STATIC,20,10,20,20 |
| 697 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 698 | | SS_NOPREFIX |
| 699 | | GROUPBOX "",IDC_STATIC,4,40,211,122 |
| 700 | | CONTROL "Enable sound and sound CPUs",IDC_USE_SOUND,"Button", |
| 701 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,40,112,10,0, |
| 702 | | HIDC_USE_SOUND |
| 703 | | CONTROL "Use samples",IDC_SAMPLES,"Button",BS_AUTOCHECKBOX | |
| 704 | | WS_TABSTOP,10,52,55,10,0,HIDC_SAMPLES |
| 705 | | GROUPBOX "Sample rate",IDC_RATETEXT,60,65,100,28 |
| 706 | | COMBOBOX IDC_SAMPLERATE,66,75,88,60,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 707 | | WS_TABSTOP,0,HIDC_SAMPLERATE |
| 708 | | GROUPBOX "Volume attenuation",IDC_STATIC,60,96,100,28 |
| 709 | | CONTROL "Slider1",IDC_VOLUME,"msctls_trackbar32",TBS_BOTH | |
| 710 | | TBS_NOTICKS | WS_TABSTOP,66,108,68,10,0,HIDC_VOLUME |
| 711 | | RTEXT "0dB",IDC_VOLUMEDISP,132,107,20,11,SS_CENTERIMAGE |
| 712 | | GROUPBOX "Audio latency",IDC_AUDIO_LATENCY_TEXT,60,127,100,28 |
| 713 | | CONTROL "Slider1",IDC_AUDIO_LATENCY,"msctls_trackbar32",TBS_BOTH | |
| 714 | | TBS_NOTICKS | WS_TABSTOP,66,139,68,10,0, |
| 715 | | HIDC_AUDIO_LATENCY |
| 716 | | RTEXT "1/5",IDC_AUDIO_LATENCY_DISP,132,138,20,11, |
| 717 | | SS_CENTERIMAGE |
| 718 | | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 719 | | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 720 | | 0,0,HIDC_USE_DEFAULT |
| 721 | | END |
| 722 | | |
| 723 | | IDD_PROP_ADVANCED DIALOGEX 0, 0, 220, 240 |
| 724 | | STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION |
| 725 | | CAPTION "Advanced" |
| 726 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 727 | | BEGIN |
| 728 | | ICON IDI_DISPLAY,IDC_STATIC,20,10,20,20 |
| 729 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 730 | | SS_NOPREFIX |
| 731 | | CONTROL "Triple buffering",IDC_TRIPLE_BUFFER,"Button", |
| 732 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,40,93,10,0, |
| 733 | | HIDC_TRIPLE_BUFFER |
| 734 | | CONTROL "Sync to monitor refresh",IDC_SYNCREFRESH,"Button", |
| 735 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,52,93,10,0, |
| 736 | | HIDC_SYNCREFRESH |
| 737 | | CONTROL "Wait for vertical sync",IDC_WAITVSYNC,"Button", |
| 738 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,64,93,10,0, |
| 739 | | HIDC_WAITVSYNC |
| 740 | | CONTROL "Refresh speed",IDC_REFRESHSPEED,"Button", |
| 741 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,76,93,10,0, |
| 742 | | HIDC_REFRESHSPEED |
| 743 | | GROUPBOX "Frame skipping",IDC_STATIC,4,88,103,42 |
| 744 | | CONTROL "Automatic",IDC_AUTOFRAMESKIP,"Button",BS_AUTOCHECKBOX | |
| 745 | | WS_TABSTOP,10,98,77,10,0,HIDC_AUTOFRAMESKIP |
| 746 | | COMBOBOX IDC_FRAMESKIP,10,111,91,88,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 747 | | WS_TABSTOP,0,HIDC_FRAMESKIP |
| 748 | | GROUPBOX "Full screen gamma",IDC_FSGAMMATEXT,113,40,102,24 |
| 749 | | CONTROL "Slider1",IDC_FSGAMMA,"msctls_trackbar32",TBS_BOTH | |
| 750 | | TBS_NOTICKS | WS_TABSTOP,119,50,71,10,0,HIDC_FSGAMMA |
| 751 | | RTEXT "2.00",IDC_FSGAMMADISP,193,49,16,10,SS_CENTERIMAGE | NOT |
| 752 | | WS_GROUP |
| 753 | | GROUPBOX "Full screen brightness",IDC_FSBRIGHTNESSTEXT,113,67,102, |
| 754 | | 24 |
| 755 | | CONTROL "Slider1",IDC_FSBRIGHTNESS,"msctls_trackbar32",TBS_BOTH | |
| 756 | | TBS_NOTICKS | WS_TABSTOP,119,77,71,10,0, |
| 757 | | HIDC_FSBRIGHTNESS |
| 758 | | RTEXT "2.00",IDC_FSBRIGHTNESSDISP,193,76,16,10,SS_CENTERIMAGE | |
| 759 | | NOT WS_GROUP |
| 760 | | GROUPBOX "Full screen contrast",IDC_FSCONTRASTTEXT,113,94,102,24 |
| 761 | | CONTROL "Slider1",IDC_FSCONTRAST,"msctls_trackbar32",TBS_BOTH | |
| 762 | | TBS_NOTICKS | WS_TABSTOP,119,104,71,10,0,HIDC_FSCONTRAST |
| 763 | | RTEXT "2.00",IDC_FSCONTRASTDISP,193,103,16,11,SS_CENTERIMAGE | |
| 764 | | NOT WS_GROUP |
| 765 | | GROUPBOX "Emulation speed",IDC_SPEEDTEXT,4,133,211,24 |
| 766 | | CONTROL "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_BOTH | |
| 767 | | TBS_NOTICKS | WS_TABSTOP,10,143,180,10,0,HIDC_SPEED |
| 768 | | RTEXT "1.00",IDC_SPEEDDISP,189,142,20,11,SS_CENTERIMAGE | NOT |
| 769 | | WS_GROUP |
| 770 | | GROUPBOX "Effect",IDC_STATIC,4,160,211,50 |
| 771 | | EDITTEXT IDC_EFFECT,10,170,200,14,ES_AUTOHSCROLL | WS_DISABLED |
| 772 | | PUSHBUTTON "Select Effect",IDC_SELECT_EFFECT,10,189,60,14,0,0, |
| 773 | | HIDC_SELECT_EFFECT |
| 774 | | PUSHBUTTON "Reset Effect",IDC_RESET_EFFECT,150,189,60,14,0,0, |
| 775 | | HIDC_RESET_EFFECT |
| 776 | | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 777 | | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 778 | | 0,0,HIDC_USE_DEFAULT |
| 779 | | END |
| 780 | | |
| 781 | | IDD_PROP_INPUT DIALOGEX 0, 0, 220, 240 |
| 782 | | STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION |
| 783 | | CAPTION "Controllers" |
| 784 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 785 | | BEGIN |
| 786 | | ICON IDI_JOYSTICK,IDC_STATIC,20,10,20,20 |
| 787 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 788 | | SS_NOPREFIX |
| 789 | | CONTROL "Enable mouse input",IDC_USE_MOUSE,"Button", |
| 790 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,40,86,10,0, |
| 791 | | HIDC_USE_MOUSE |
| 792 | | CONTROL "Enable steadykey support",IDC_STEADYKEY,"Button", |
| 793 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,52,95,10,0, |
| 794 | | HIDC_STEADYKEY |
| 795 | | GROUPBOX "",IDC_STATIC,4,64,103,74 |
| 796 | | CONTROL "Enable joystick input",IDC_JOYSTICK,"Button", |
| 797 | | BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,10,64,78,10,0, |
| 798 | | HIDC_JOYSTICK |
| 799 | | GROUPBOX "Joystick deadzone",IDC_JDZTEXT,10,76,91,28 |
| 800 | | CONTROL "IntensitySlider",IDC_JDZ,"msctls_trackbar32",TBS_BOTH | |
| 801 | | TBS_NOTICKS | WS_TABSTOP,15,88,60,10,0,HIDC_JDZ |
| 802 | | RTEXT "0.3",IDC_JDZDISP,76,87,16,11,SS_CENTERIMAGE | NOT |
| 803 | | WS_GROUP |
| 804 | | GROUPBOX "Default input layout",IDC_STATIC,113,40,102,28 |
| 805 | | COMBOBOX IDC_DEFAULT_INPUT,119,50,90,53,CBS_DROPDOWNLIST | |
| 806 | | WS_VSCROLL | WS_TABSTOP,0,HIDC_DEFAULT_INPUT |
| 807 | | GROUPBOX "",IDC_STATIC,113,71,102,66 |
| 808 | | CONTROL "Enable lightgun input",IDC_LIGHTGUN,"Button", |
| 809 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,71,80,10,0, |
| 810 | | HIDC_LIGHTGUN |
| 811 | | CONTROL "Offscreen shots reload",IDC_RELOAD,"Button", |
| 812 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,83,86,10,0,HIDC_RELOAD |
| 813 | | CONTROL "Dual lightguns",IDC_DUAL_LIGHTGUN,"Button", |
| 814 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,96,86,10,0, |
| 815 | | HIDC_DUAL_LIGHTGUN |
| 816 | | CONTROL "Multiple keyboards",IDC_MULTIKEYBOARD,"Button", |
| 817 | | BS_AUTOCHECKBOX | WS_TABSTOP,119,109,75,10,0, |
| 818 | | HIDC_MULTIKEYBOARD |
| 819 | | CONTROL "Multiple mice",IDC_MULTIMOUSE,"Button",BS_AUTOCHECKBOX | |
| 820 | | WS_TABSTOP,119,122,56,10,0,HIDC_MULTIMOUSE |
| 821 | | GROUPBOX "Joystick saturation",IDC_JSATTEXT,10,106,91,28 |
| 822 | | CONTROL "IntensitySlider",IDC_JSAT,"msctls_trackbar32",TBS_BOTH | |
| 823 | | TBS_NOTICKS | WS_TABSTOP,16,118,60,10,0,HIDC_JSAT |
| 824 | | RTEXT "0.85",IDC_JSATDISP,76,116,16,11,SS_CENTERIMAGE | NOT |
| 825 | | WS_GROUP |
| 826 | | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 827 | | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 828 | | 0,0,HIDC_USE_DEFAULT |
| 829 | | END |
| 830 | | |
| 831 | | IDD_PROP_MISC DIALOGEX 0, 0, 220, 240 |
| 832 | | STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION |
| 833 | | CAPTION "Miscellaneous" |
| 834 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 835 | | BEGIN |
| 836 | | ICON IDI_MAME32_ICON,IDC_STATIC,20,10,20,20 |
| 837 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 838 | | SS_NOPREFIX |
| 839 | | #ifdef MESS |
| 840 | | CONTROL "Enable system cheats",IDC_CHEAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,86,10,0,HIDC_CHEAT |
| 841 | | #else |
| 842 | | CONTROL "Enable game cheats",IDC_CHEAT,"Button",BS_AUTOCHECKBOX | |
| 843 | | WS_TABSTOP,10,40,86,10,0,HIDC_CHEAT |
| 844 | | #endif |
| 845 | | CONTROL "Error log (for developers)",IDC_LOG,"Button", |
| 846 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,52,96,10,0,HIDC_LOG |
| 847 | | CONTROL "Sleep when possible",IDC_SLEEP,"Button",BS_AUTOCHECKBOX | |
| 848 | | WS_TABSTOP,10,64,86,10,0,HIDC_SLEEP |
| 849 | | CONTROL "Enable game debugger",IDC_DEBUG,"Button", |
| 850 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,76,86,10,0,HIDC_DEBUG |
| 851 | | #ifdef MESS |
| 852 | | CONTROL "Skip system info",IDC_SKIP_GAME_INFO,"Button", |
| 853 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,88,96,10,0, |
| 854 | | HIDC_SKIP_GAME_INFO |
| 855 | | #else |
| 856 | | CONTROL "Skip game info",IDC_SKIP_GAME_INFO,"Button", |
| 857 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,88,96,10,0, |
| 858 | | HIDC_SKIP_GAME_INFO |
| 859 | | #endif |
| 860 | | CONTROL "Save game state on exit",IDC_ENABLE_AUTOSAVE,"Button", |
| 861 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,100,96,10,0, |
| 862 | | HIDC_ENABLE_AUTOSAVE |
| 863 | | CONTROL "Multi-threaded rendering",IDC_MULTITHREAD_RENDERING, |
| 864 | | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,112,96,10,0, |
| 865 | | HIDC_MULTITHREAD_RENDERING |
| 866 | | GROUPBOX "Thread Priority",IDC_HIGH_PRIORITY_TEXT,4,124,103,34 |
| 867 | | CONTROL "Slider1",IDC_HIGH_PRIORITY,"msctls_trackbar32",TBS_BOTH | |
| 868 | | TBS_NOTICKS | WS_TABSTOP,10,135,75,10,0, |
| 869 | | HIDC_HIGH_PRIORITY |
| 870 | | LTEXT "idle",IDC_STATIC,13,144,12,8 |
| 871 | | RTEXT "-15",IDC_HIGH_PRIORITYTXT,84,134,14,10,SS_CENTERIMAGE |
| 872 | | RTEXT "real-time",IDC_STATIC,53,144,28,8 |
| 873 | | GROUPBOX "Artwork options",IDC_STATIC,113,40,102,61 |
| 874 | | CONTROL "Backdrops",IDC_BACKDROPS,"Button",BS_AUTOCHECKBOX | |
| 875 | | WS_TABSTOP,119,50,86,10,0,HIDC_BACKDROPS |
| 876 | | CONTROL "Bezels",IDC_BEZELS,"Button",BS_AUTOCHECKBOX | |
| 877 | | WS_TABSTOP,119,62,86,10,0,HIDC_BEZELS |
| 878 | | CONTROL "Overlays",IDC_OVERLAYS,"Button",BS_AUTOCHECKBOX | |
| 879 | | WS_TABSTOP,119,74,84,10,0,HIDC_OVERLAYS |
| 880 | | CONTROL "Crop artwork",IDC_ARTWORK_CROP,"Button",BS_AUTOCHECKBOX | |
| 881 | | WS_TABSTOP,119,86,53,10,0,HIDC_ARTWORK_CROP |
| 882 | | GROUPBOX "BIOS",IDC_STATIC,113,104,102,28 |
| 883 | | COMBOBOX IDC_BIOS,119,114,90,60,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 884 | | WS_TABSTOP,0,HIDC_BIOS |
| 885 | | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 886 | | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 887 | | 0,0,HIDC_USE_DEFAULT |
| 888 | | #ifdef MESS |
| 889 | | CONTROL "Skip warnings",IDC_SKIP_WARNINGS,"Button", |
| 890 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,180,86,10,0 |
| 891 | | CONTROL "Use New UI",IDC_USE_NEW_UI,"Button", |
| 892 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,192,86,10,0 |
| 893 | | #endif |
| 894 | | END |
| 895 | | |
| 896 | | IDD_PROP_VECTOR DIALOGEX 0, 0, 220, 240 |
| 897 | | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 898 | | CAPTION "Vector" |
| 899 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 900 | | BEGIN |
| 901 | | ICON IDI_MAME32_ICON,IDC_STATIC,20,10,20,20 |
| 902 | | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 903 | | SS_NOPREFIX |
| 904 | | CONTROL "Draw antialiased vectors",IDC_ANTIALIAS,"Button", |
| 905 | | BS_AUTOCHECKBOX | WS_TABSTOP,10,40,92,10,0, |
| 906 | | HIDC_ANTIALIAS |
| 907 | | GROUPBOX "Beam width",IDC_BEAMTEXT,60,53,100,28 |
| 908 | | CONTROL "BeamSlider",IDC_BEAM,"msctls_trackbar32",TBS_BOTH | |
| 909 | | TBS_NOTICKS | WS_TABSTOP,66,65,64,10,0,HIDC_BEAM |
| 910 | | RTEXT "16.00",IDC_BEAMDISP,132,64,20,11,SS_CENTERIMAGE |
| 911 | | GROUPBOX "Flicker",IDC_FLICKERTEXT,60,84,100,28 |
| 912 | | CONTROL "FlickerSlider",IDC_FLICKER,"msctls_trackbar32",TBS_BOTH | |
| 913 | | TBS_NOTICKS | WS_TABSTOP,66,96,64,10,0,HIDC_FLICKER |
| 914 | | RTEXT "100.00",IDC_FLICKERDISP,128,95,24,11,SS_CENTERIMAGE | |
| 915 | | NOT WS_GROUP |
| 916 | | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 917 | | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 918 | | 0,0,HIDC_USE_DEFAULT |
| 919 | | END |
| 920 | | |
| 921 | | |
| 922 | | #ifdef MESS |
| 923 | | IDD_MAIN DIALOGEX 0, 0, 364, 206 |
| 924 | | #else |
| 925 | | IDD_MAIN DIALOGEX 0, 0, 304, 206 |
| 926 | | #endif |
| 927 | | STYLE DS_SETFONT | DS_3DLOOK | DS_NOFAILCREATE | WS_MINIMIZEBOX | |
| 928 | | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME |
| 929 | | EXSTYLE WS_EX_CONTROLPARENT |
| 930 | | CAPTION "MAME32 - overwritten at runtime" |
| 931 | | CLASS "MainClass" |
| 932 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 933 | | BEGIN |
| 934 | | CONTROL "",IDC_DIVIDER,"Static",SS_ETCHEDHORZ,0,5,304,1 |
| 935 | | CONTROL "Tree1",IDC_TREE,"SysTreeView32",TVS_HASBUTTONS | |
| 936 | | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS | |
| 937 | | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | |
| 938 | | WS_TABSTOP,5,28,48,172 |
| 939 | | CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | |
| 940 | | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | |
| 941 | | LVS_OWNERDRAWFIXED | WS_BORDER | WS_TABSTOP,65,28,42,172 |
| 942 | | GROUPBOX "",IDC_SPLITTER,55,28,8,172,BS_NOTIFY | NOT WS_VISIBLE |
| 943 | | GROUPBOX "",IDC_SPLITTER2,109,28,8,172,BS_NOTIFY | NOT WS_VISIBLE |
| 944 | | #ifdef MESS |
| 945 | | CONTROL "",IDC_SSTAB,"SysTabControl32",TCS_HOTTRACK,121,0,181,18 |
| 946 | | CONTROL "",IDC_SWTAB,"SysTabControl32",TCS_HOTTRACK,119,0,200,100 |
| 947 | | CONTROL "List2",IDC_SWLIST,"SysListView32",LVS_REPORT | |
| 948 | | LVS_SHOWSELALWAYS | LVS_OWNERDRAWFIXED | WS_BORDER | |
| 949 | | WS_TABSTOP,119,60,42,140 |
| 950 | | CONTROL "",IDC_SWDEVVIEW,"MessSoftwareDevView",WS_VISIBLE,119,0,200,100 |
| 951 | | GROUPBOX "",IDC_SPLITTER3,163,28,8,172,BS_NOTIFY | NOT WS_VISIBLE |
| 952 | | CONTROL "",IDC_SSFRAME,"Static",SS_ETCHEDFRAME,175,11,181,194 |
| 953 | | CONTROL "",IDC_SSPICTURE,"Static",SS_BITMAP | SS_NOTIFY | |
| 954 | | SS_CENTERIMAGE | NOT WS_VISIBLE,195,18,141,127 |
| 955 | | EDITTEXT IDC_HISTORY,183,150,167,49,ES_MULTILINE | ES_READONLY | |
| 956 | | WS_VSCROLL,WS_EX_STATICEDGE,HIDC_HISTORY |
| 957 | | #else |
| 958 | | CONTROL "",IDC_SSFRAME,"Static",SS_ETCHEDFRAME | SS_NOTIFY,121, |
| 959 | | 11,181,194 |
| 960 | | CONTROL "",IDC_SSTAB,"SysTabControl32",TCS_HOTTRACK,121,0,181,18 |
| 961 | | CONTROL "",IDC_SSPICTURE,"Static",SS_BITMAP | NOT WS_VISIBLE,141, |
| 962 | | 18,141,127 |
| 963 | | EDITTEXT IDC_HISTORY,129,150,167,49,ES_MULTILINE | ES_READONLY | |
| 964 | | NOT WS_BORDER | WS_VSCROLL | NOT WS_TABSTOP,0, |
| 965 | | HIDC_HISTORY |
| 966 | | #endif |
| 967 | | END |
| 968 | | |
| 969 | | IDD_FILTERS DIALOGEX 0, 0, 190, 182 |
| 970 | | STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | |
| 971 | | WS_SYSMENU |
| 972 | | EXSTYLE WS_EX_CONTEXTHELP |
| 973 | | #ifdef MESS |
| 974 | | CAPTION "System Filters" |
| 975 | | #else |
| 976 | | CAPTION "Game Filters" |
| 977 | | #endif |
| 978 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 979 | | BEGIN |
| 980 | | #ifdef MESS |
| 981 | | GROUPBOX "System filters",IDC_STATIC,6,4,178,85 |
| 982 | | #else |
| 983 | | GROUPBOX "Game filters",IDC_STATIC,6,4,178,85 |
| 984 | | #endif |
| 985 | | CONTROL "&Vector Graphics",IDC_FILTER_VECTOR,"Button", |
| 986 | | BS_AUTOCHECKBOX | WS_TABSTOP,14,16,70,10,0, |
| 987 | | HIDC_FILTER_VECTOR |
| 988 | | CONTROL "C&lones",IDC_FILTER_CLONES,"Button",BS_AUTOCHECKBOX | |
| 989 | | WS_TABSTOP,14,30,41,10,0,HIDC_FILTER_CLONES |
| 990 | | CONTROL "Non-Wor&king",IDC_FILTER_NONWORKING,"Button", |
| 991 | | BS_AUTOCHECKBOX | WS_TABSTOP,14,44,61,10,0, |
| 992 | | HIDC_FILTER_NONWORKING |
| 993 | | CONTROL "&Horizontal",IDC_FILTER_HORIZONTAL,"Button", |
| 994 | | BS_AUTOCHECKBOX | WS_TABSTOP,14,58,57,10,0, |
| 995 | | HIDC_FILTER_HORIZONTAL |
| 996 | | CONTROL "&Unavailable",IDC_FILTER_UNAVAILABLE,"Button", |
| 997 | | BS_AUTOCHECKBOX | WS_TABSTOP,14,72,57,10,0, |
| 998 | | HIDC_FILTER_UNAVAILABLE |
| 999 | | #ifdef MESS |
| 1000 | | CONTROL "&Computers",IDC_FILTER_COMPUTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,57,10,0,HIDC_FILTER_UNAVAILABLE |
| 1001 | | CONTROL "C&onsoles",IDC_FILTER_CONSOLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,58,57,10,0,HIDC_FILTER_UNAVAILABLE |
| 1002 | | #endif |
| 1003 | | CONTROL "&Raster Graphics",IDC_FILTER_RASTER,"Button", |
| 1004 | | BS_AUTOCHECKBOX | WS_TABSTOP,100,16,70,10,0, |
| 1005 | | HIDC_FILTER_RASTER |
| 1006 | | CONTROL "Ori&ginals",IDC_FILTER_ORIGINALS,"Button", |
| 1007 | | BS_AUTOCHECKBOX | WS_TABSTOP,100,30,47,10,0, |
| 1008 | | HIDC_FILTER_ORIGINALS |
| 1009 | | CONTROL "&Working",IDC_FILTER_WORKING,"Button",BS_AUTOCHECKBOX | |
| 1010 | | WS_TABSTOP,100,44,47,10,0,HIDC_FILTER_WORKING |
| 1011 | | CONTROL "&Vertical",IDC_FILTER_VERTICAL,"Button",BS_AUTOCHECKBOX | |
| 1012 | | WS_TABSTOP,100,58,47,10,0,HIDC_FILTER_VERTICAL |
| 1013 | | LTEXT "(*) = inherited from parent folder",IDC_INHERITED,14,72, |
| 1014 | | 99,10 |
| 1015 | | #ifdef MESS |
| 1016 | | CTEXT "System filters allow customizing the systems that are displayed in each folder by hiding games that match the filters applied.",IDC_STATIC,6,94,178,27 |
| 1017 | | #else |
| 1018 | | CTEXT "Game filters allow customizing the games that are displayed in each folder by hiding games that match the filters applied.", |
| 1019 | | IDC_STATIC,6,94,178,27 |
| 1020 | | #endif |
| 1021 | | GROUPBOX "&Description filter",IDC_STATIC,6,122,178,33 |
| 1022 | | EDITTEXT IDC_FILTER_EDIT,14,134,162,13,ES_AUTOHSCROLL,0, |
| 1023 | | HIDC_FILTER_EDIT |
| 1024 | | DEFPUSHBUTTON "&OK",IDOK,42,161,50,14 |
| 1025 | | PUSHBUTTON "&Cancel",IDCANCEL,98,161,50,14 |
| 1026 | | END |
| 1027 | | |
| 1028 | | IDD_RESET DIALOGEX 0, 0, 190, 122 |
| 1029 | | STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | |
| 1030 | | WS_SYSMENU |
| 1031 | | EXSTYLE WS_EX_CONTEXTHELP |
| 1032 | | CAPTION "Reset Options" |
| 1033 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 1034 | | BEGIN |
| 1035 | | GROUPBOX "Categories",IDC_STATIC,6,4,178,70 |
| 1036 | | CONTROL "&User Interface (Fonts, Colors, Sizes)",IDC_RESET_UI, |
| 1037 | | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,146,10,0, |
| 1038 | | HIDC_RESET_UI |
| 1039 | | #ifdef MESS |
| 1040 | | CONTROL "&Default system options",IDC_RESET_DEFAULT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30,146,10,0,HIDC_RESET_DEFAULT |
| 1041 | | CONTROL "&All systems to use default options",IDC_RESET_GAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,146,10,0,HIDC_RESET_GAMES |
| 1042 | | #else |
| 1043 | | CONTROL "&Default game options",IDC_RESET_DEFAULT,"Button", |
| 1044 | | BS_AUTOCHECKBOX | WS_TABSTOP,14,30,146,10,0, |
| 1045 | | HIDC_RESET_DEFAULT |
| 1046 | | CONTROL "&All games to use default options",IDC_RESET_GAMES, |
| 1047 | | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,146,10,0, |
| 1048 | | HIDC_RESET_GAMES |
| 1049 | | #endif |
| 1050 | | CONTROL "&Folder 'filters'",IDC_RESET_FILTERS,"Button", |
| 1051 | | BS_AUTOCHECKBOX | WS_TABSTOP,14,58,146,10,0, |
| 1052 | | HIDC_RESET_FILTERS |
| 1053 | | CTEXT "Select the options to be restored to the default settings.", |
| 1054 | | IDC_STATIC,6,79,178,20 |
| 1055 | | DEFPUSHBUTTON "&OK",IDOK,42,101,50,14 |
| 1056 | | PUSHBUTTON "&Cancel",IDCANCEL,98,101,50,14 |
| 1057 | | END |
| 1058 | | |
| 1059 | | IDD_LOAD_PROGRESS DIALOGEX 0, 0, 260, 187 |
| 1060 | | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | |
| 1061 | | WS_SYSMENU |
| 1062 | | EXSTYLE WS_EX_CONTROLPARENT |
| 1063 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 1064 | | BEGIN |
| 1065 | | CONTROL "Progress1",IDC_LOAD_PROGRESS,"msctls_progress32", |
| 1066 | | WS_BORDER | 0x1,6,7,248,12 |
| 1067 | | CTEXT "",IDC_LOAD_ROMNAME,6,21,248,10,SS_CENTERIMAGE | NOT |
| 1068 | | WS_GROUP |
| 1069 | | EDITTEXT IDC_LOAD_STATUS,6,32,248,116,ES_MULTILINE | ES_READONLY | |
| 1070 | | WS_VSCROLL |
| 1071 | | CTEXT "",IDC_ERROR_TEXT,6,150,248,13,SS_NOPREFIX | |
| 1072 | | SS_CENTERIMAGE |
| 1073 | | PUSHBUTTON "&OK",IDOK,77,166,50,14,WS_DISABLED |
| 1074 | | PUSHBUTTON "&Cancel",IDCANCEL,133,166,50,14 |
| 1075 | | END |
| 1076 | | |
| 1077 | | IDD_INTERFACE_OPTIONS DIALOGEX 0, 0, 378, 225 |
| 1078 | | STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | |
| 1079 | | WS_SYSMENU |
| 1080 | | EXSTYLE WS_EX_CONTEXTHELP |
| 1081 | | CAPTION "Interface Options" |
| 1082 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 1083 | | BEGIN |
| 1084 | | #ifdef MESS |
| 1085 | | GROUPBOX "System Selection",IDC_STATIC,6,4,189,194 |
| 1086 | | CONTROL "&Search for new systems on start",IDC_START_GAME_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,112,10,0,HIDC_START_GAME_CHECK |
| 1087 | | CONTROL "Allow system selection by a &joystick (requires restart)",IDC_JOY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30,178,10,0,HIDC_JOY_GUI |
| 1088 | | CONTROL "Allow system selection by custom &key sequences",IDC_KEY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,166,10 |
| 1089 | | #else |
| 1090 | | GROUPBOX "Game Selection",IDC_STATIC,6,4,189,194 |
| 1091 | | CONTROL "&Search for new games on start",IDC_START_GAME_CHECK, |
| 1092 | | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,111,10,0, |
| 1093 | | HIDC_START_GAME_CHECK |
| 1094 | | CONTROL "Allow game selection by a &joystick (requires restart)", |
| 1095 | | IDC_JOY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30, |
| 1096 | | 174,10,0,HIDC_JOY_GUI |
| 1097 | | CONTROL "Allow game selection by custom &key sequences", |
| 1098 | | IDC_KEY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44, |
| 1099 | | 166,10 |
| 1100 | | #endif |
| 1101 | | CONTROL "Select &random background image",IDC_RANDOM_BG,"Button", |
| 1102 | | BS_AUTOCHECKBOX | WS_TABSTOP,14,58,122,10,0, |
| 1103 | | HIDC_RANDOM_BG |
| 1104 | | CONTROL "&Broadcast selected game to all windows",IDC_BROADCAST, |
| 1105 | | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,141,10,0, |
| 1106 | | HIDC_BROADCAST |
| 1107 | | CONTROL "Hide &mouse cursor (requires restart)",IDC_HIDE_MOUSE, |
| 1108 | | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,86,126,10,0, |
| 1109 | | HIDC_HIDE_MOUSE |
| 1110 | | CONTROL "Inheritable Filters",IDC_FILTER_INHERIT,"Button", |
| 1111 | | BS_AUTOCHECKBOX | WS_TABSTOP,14,100,68,10 |
| 1112 | | CONTROL "No offset for clones missing parent in view", |
| 1113 | | IDC_NOOFFSET_CLONES,"Button",BS_AUTOCHECKBOX | |
| 1114 | | WS_TABSTOP,14,114,148,10 |
| 1115 | | GROUPBOX "Show History on Tab",IDC_STATIC,14,128,173,28 |
| 1116 | | COMBOBOX IDC_HISTORY_TAB,57,138,88,50,CBS_DROPDOWNLIST | |
| 1117 | | WS_VSCROLL | WS_TABSTOP |
| 1118 | | GROUPBOX "Emulation",IDC_STATIC,202,4,170,28 |
| 1119 | | #ifdef MESS |
| 1120 | | CONTROL "Show System Ca&ption",IDC_GAME_CAPTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,16,81,10 |
| 1121 | | #else |
| 1122 | | CONTROL "Show Game Ca&ption",IDC_GAME_CAPTION,"Button", |
| 1123 | | BS_AUTOCHECKBOX | WS_TABSTOP,210,16,80,10,0, |
| 1124 | | HIDC_GAME_CAPTION |
| 1125 | | #endif |
| 1126 | | GROUPBOX "Bookkeeping",IDC_STATIC,202,36,170,43 |
| 1127 | | CONTROL "Reset all Playcounts",IDC_RESET_PLAYCOUNT,"Button", |
| 1128 | | BS_AUTOCHECKBOX | WS_TABSTOP,210,48,80,10 |
| 1129 | | CONTROL "Reset all Play Times",IDC_RESET_PLAYTIME,"Button", |
| 1130 | | BS_AUTOCHECKBOX | WS_TABSTOP,210,62,79,10 |
| 1131 | | GROUPBOX "Screenshot Area",IDC_STATIC,202,83,170,115 |
| 1132 | | CONTROL "S&tretch screenshot larger than natural size", |
| 1133 | | IDC_STRETCH_SCREENSHOT_LARGER,"Button",BS_AUTOCHECKBOX | |
| 1134 | | WS_TABSTOP,210,95,148,10,0, |
| 1135 | | HIDC_STRETCH_SCREENSHOT_LARGER |
| 1136 | | GROUPBOX "Screenshot Cycletime in Seconds",IDC_STATIC,210,109,154, |
| 1137 | | 28 |
| 1138 | | CONTROL "Slider1",IDC_CYCLETIMESEC,"msctls_trackbar32",TBS_BOTH | |
| 1139 | | TBS_NOTICKS | WS_TABSTOP,218,121,120,10,0, |
| 1140 | | HIDC_CYCLETIMESEC |
| 1141 | | RTEXT "60",IDC_CYCLETIMESECTXT,340,120,13,10,SS_CENTERIMAGE |
| 1142 | | GROUPBOX "Screenshot Bordersize",IDC_STATIC,210,141,154,28 |
| 1143 | | CONTROL "Slider1",IDC_SCREENSHOT_BORDERSIZE,"msctls_trackbar32", |
| 1144 | | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,218,153,120,10 |
| 1145 | | RTEXT "100",IDC_SCREENSHOT_BORDERSIZETXT,340,152,13,10, |
| 1146 | | SS_CENTERIMAGE |
| 1147 | | PUSHBUTTON "Set Screenshot Border Color",IDC_SCREENSHOT_BORDERCOLOR, |
| 1148 | | 210,176,154,14 |
| 1149 | | DEFPUSHBUTTON "&OK",IDOK,136,204,50,14 |
| 1150 | | PUSHBUTTON "&Cancel",IDCANCEL,192,204,50,14 |
| 1151 | | END |
| 1152 | | |
| 1153 | | IDD_LANGUAGE DIALOGEX 0, 0, 190, 66 |
| 1154 | | STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | |
| 1155 | | WS_SYSMENU |
| 1156 | | EXSTYLE WS_EX_CONTEXTHELP |
| 1157 | | CAPTION "Language" |
| 1158 | | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 1159 | | BEGIN |
| 1160 | | GROUPBOX "",IDC_STATIC,6,4,178,34 |
| 1161 | | CONTROL "Use language file",IDC_LANGUAGECHECK,"Button", |
| 1162 | | BS_AUTOCHECKBOX | WS_TABSTOP,12,4,66,10,0, |
| 1163 | | HIDC_LANGUAGECHECK |
| 1164 | | EDITTEXT IDC_LANGUAGEEDIT,14,17,142,13,ES_AUTOHSCROLL,0, |
| 1165 | | HIDC_LANGUAGEEDIT |
| 1166 | | PUSHBUTTON "...",IDC_LANGUAGEBROWSE,162,17,14,13 |
| 1167 | | DEFPUSHBUTTON "OK",IDOK,42,45,50,14 |
| 1168 | | PUSHBUTTON "Cancel",IDCANCEL,98,45,50,14 |
| 1169 | | END |
| 1170 | | |
| 1171 | | IDD_CUSTOM_FILE DIALOG 0, 0, 190, 135 |
| 1172 | | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 1173 | | CAPTION "Add Game To Custom Folder" |
| 1174 | | FONT 8, "MS Shell Dlg" |
| 1175 | | BEGIN |
| 1176 | | LTEXT "",IDC_CUSTOMFILE_GAME,6,6,175,10,SS_NOPREFIX | |
| 1177 | | SS_CENTERIMAGE |
| 1178 | | CONTROL "CustomTree",IDC_CUSTOM_TREE,"SysTreeView32", |
| 1179 | | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | |
| 1180 | | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | |
| 1181 | | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,6,18,178,90 |
| 1182 | | DEFPUSHBUTTON "OK",IDOK,42,114,50,14 |
| 1183 | | PUSHBUTTON "Cancel",IDCANCEL,98,114,50,14 |
| 1184 | | END |
| 1185 | | |
| 1186 | | |
| 1187 | | ///////////////////////////////////////////////////////////////////////////// |
| 1188 | | // |
| 1189 | | // Accelerator |
| 1190 | | // |
| 1191 | | |
| 1192 | | IDA_TAB_KEYS ACCELERATORS |
| 1193 | | BEGIN |
| 1194 | | "1", ID_VIEW_TAB_SCREENSHOT, VIRTKEY, ALT, NOINVERT |
| 1195 | | "2", ID_VIEW_TAB_FLYER, VIRTKEY, ALT, NOINVERT |
| 1196 | | "3", ID_VIEW_TAB_CABINET, VIRTKEY, ALT, NOINVERT |
| 1197 | | "4", ID_VIEW_TAB_MARQUEE, VIRTKEY, ALT, NOINVERT |
| 1198 | | "5", ID_VIEW_TAB_TITLE, VIRTKEY, ALT, NOINVERT |
| 1199 | | "6", ID_VIEW_TAB_CONTROL_PANEL, VIRTKEY, ALT, NOINVERT |
| 1200 | | "7", ID_VIEW_TAB_PCB, VIRTKEY, ALT, NOINVERT |
| 1201 | | "8", ID_VIEW_TAB_HISTORY, VIRTKEY, ALT, NOINVERT |
| 1202 | | "A", ID_GAME_AUDIT, VIRTKEY, ALT, NOINVERT |
| 1203 | | "B", ID_VIEW_PAGETAB, VIRTKEY, ALT, NOINVERT |
| 1204 | | "D", ID_VIEW_FOLDERS, VIRTKEY, ALT, NOINVERT |
| 1205 | | "F", ID_CONTEXT_FILTERS, VIRTKEY, CONTROL, NOINVERT |
| 1206 | | "U", ID_FOLDER_AUDIT, VIRTKEY, ALT, NOINVERT |
| 1207 | | "P", ID_VIEW_PICTURE_AREA, VIRTKEY, ALT, NOINVERT |
| 1208 | | "R", ID_CONTEXT_SELECT_RANDOM, VIRTKEY, CONTROL, NOINVERT |
| 1209 | | "S", ID_VIEW_STATUS, VIRTKEY, ALT, NOINVERT |
| 1210 | | "T", ID_VIEW_TOOLBARS, VIRTKEY, ALT, NOINVERT |
| 1211 | | VK_F1, ID_HELP_CONTENTS, VIRTKEY, NOINVERT |
| 1212 | | VK_F11, ID_VIEW_FULLSCREEN, VIRTKEY, NOINVERT |
| 1213 | | VK_F5, ID_UPDATE_GAMELIST, VIRTKEY, NOINVERT |
| 1214 | | VK_NEXT, ID_UI_HISTORY_DOWN, VIRTKEY, CONTROL, NOINVERT |
| 1215 | | VK_PRIOR, ID_UI_HISTORY_UP, VIRTKEY, CONTROL, NOINVERT |
| 1216 | | VK_RETURN, ID_GAME_PROPERTIES, VIRTKEY, ALT, NOINVERT |
| 1217 | | END |
| 1218 | | |
| 1219 | | |
| 1220 | | ///////////////////////////////////////////////////////////////////////////// |
| 1221 | | // |
| 1222 | | // DESIGNINFO |
| 1223 | | // |
| 1224 | | |
| 1225 | | #ifdef APSTUDIO_INVOKED |
| 1226 | | GUIDELINES DESIGNINFO |
| 1227 | | BEGIN |
| 1228 | | IDD_ABOUT, DIALOG |
| 1229 | | BEGIN |
| 1230 | | LEFTMARGIN, 7 |
| 1231 | | RIGHTMARGIN, 289 |
| 1232 | | TOPMARGIN, 7 |
| 1233 | | BOTTOMMARGIN, 123 |
| 1234 | | END |
| 1235 | | |
| 1236 | | IDD_DIRECTX, DIALOG |
| 1237 | | BEGIN |
| 1238 | | LEFTMARGIN, 7 |
| 1239 | | RIGHTMARGIN, 229 |
| 1240 | | TOPMARGIN, 7 |
| 1241 | | BOTTOMMARGIN, 62 |
| 1242 | | END |
| 1243 | | |
| 1244 | | IDD_AUDIT, DIALOG |
| 1245 | | BEGIN |
| 1246 | | LEFTMARGIN, 7 |
| 1247 | | RIGHTMARGIN, 280 |
| 1248 | | TOPMARGIN, 7 |
| 1249 | | BOTTOMMARGIN, 187 |
| 1250 | | HORZGUIDE, 19 |
| 1251 | | END |
| 1252 | | |
| 1253 | | IDD_DIRECTORIES, DIALOG |
| 1254 | | BEGIN |
| 1255 | | LEFTMARGIN, 7 |
| 1256 | | RIGHTMARGIN, 224 |
| 1257 | | TOPMARGIN, 7 |
| 1258 | | BOTTOMMARGIN, 98 |
| 1259 | | END |
| 1260 | | |
| 1261 | | IDD_COLUMNS, DIALOG |
| 1262 | | BEGIN |
| 1263 | | LEFTMARGIN, 7 |
| 1264 | | RIGHTMARGIN, 301 |
| 1265 | | TOPMARGIN, 7 |
| 1266 | | BOTTOMMARGIN, 143 |
| 1267 | | END |
| 1268 | | |
| 1269 | | IDD_PROP_CONTROLLER, DIALOG |
| 1270 | | BEGIN |
| 1271 | | RIGHTMARGIN, 210 |
| 1272 | | BOTTOMMARGIN, 154 |
| 1273 | | END |
| 1274 | | |
| 1275 | | IDD_PROP_SCREEN, DIALOG |
| 1276 | | BEGIN |
| 1277 | | LEFTMARGIN, 4 |
| 1278 | | VERTGUIDE, 7 |
| 1279 | | VERTGUIDE, 123 |
| 1280 | | BOTTOMMARGIN, 199 |
| 1281 | | HORZGUIDE, 179 |
| 1282 | | END |
| 1283 | | |
| 1284 | | IDD_PROP_GAME, DIALOG |
| 1285 | | BEGIN |
| 1286 | | LEFTMARGIN, 7 |
| 1287 | | RIGHTMARGIN, 213 |
| 1288 | | VERTGUIDE, 19 |
| 1289 | | VERTGUIDE, 66 |
| 1290 | | VERTGUIDE, 74 |
| 1291 | | VERTGUIDE, 201 |
| 1292 | | BOTTOMMARGIN, 232 |
| 1293 | | END |
| 1294 | | |
| 1295 | | IDD_PROP_AUDIT, DIALOG |
| 1296 | | BEGIN |
| 1297 | | LEFTMARGIN, 7 |
| 1298 | | RIGHTMARGIN, 213 |
| 1299 | | VERTGUIDE, 12 |
| 1300 | | VERTGUIDE, 208 |
| 1301 | | BOTTOMMARGIN, 198 |
| 1302 | | HORZGUIDE, 38 |
| 1303 | | END |
| 1304 | | |
| 1305 | | IDD_PROP_DISPLAY, DIALOG |
| 1306 | | BEGIN |
| 1307 | | LEFTMARGIN, 4 |
| 1308 | | VERTGUIDE, 7 |
| 1309 | | VERTGUIDE, 123 |
| 1310 | | HORZGUIDE, 179 |
| 1311 | | END |
| 1312 | | |
| 1313 | | IDD_PROP_SOUND, DIALOG |
| 1314 | | BEGIN |
| 1315 | | LEFTMARGIN, 7 |
| 1316 | | RIGHTMARGIN, 213 |
| 1317 | | VERTGUIDE, 50 |
| 1318 | | BOTTOMMARGIN, 198 |
| 1319 | | END |
| 1320 | | |
| 1321 | | IDD_PROP_ADVANCED, DIALOG |
| 1322 | | BEGIN |
| 1323 | | LEFTMARGIN, 10 |
| 1324 | | BOTTOMMARGIN, 211 |
| 1325 | | END |
| 1326 | | |
| 1327 | | IDD_PROP_INPUT, DIALOG |
| 1328 | | BEGIN |
| 1329 | | LEFTMARGIN, 4 |
| 1330 | | RIGHTMARGIN, 215 |
| 1331 | | VERTGUIDE, 50 |
| 1332 | | VERTGUIDE, 170 |
| 1333 | | END |
| 1334 | | |
| 1335 | | IDD_PROP_MISC, DIALOG |
| 1336 | | BEGIN |
| 1337 | | LEFTMARGIN, 7 |
| 1338 | | RIGHTMARGIN, 213 |
| 1339 | | VERTGUIDE, 25 |
| 1340 | | VERTGUIDE, 40 |
| 1341 | | VERTGUIDE, 104 |
| 1342 | | VERTGUIDE, 114 |
| 1343 | | VERTGUIDE, 204 |
| 1344 | | BOTTOMMARGIN, 183 |
| 1345 | | END |
| 1346 | | |
| 1347 | | IDD_PROP_VECTOR, DIALOG |
| 1348 | | BEGIN |
| 1349 | | LEFTMARGIN, 7 |
| 1350 | | RIGHTMARGIN, 213 |
| 1351 | | VERTGUIDE, 50 |
| 1352 | | BOTTOMMARGIN, 198 |
| 1353 | | END |
| 1354 | | |
| 1355 | | IDD_FILTERS, DIALOG |
| 1356 | | BEGIN |
| 1357 | | LEFTMARGIN, 7 |
| 1358 | | TOPMARGIN, 7 |
| 1359 | | BOTTOMMARGIN, 178 |
| 1360 | | END |
| 1361 | | |
| 1362 | | IDD_RESET, DIALOG |
| 1363 | | BEGIN |
| 1364 | | LEFTMARGIN, 7 |
| 1365 | | RIGHTMARGIN, 175 |
| 1366 | | VERTGUIDE, 18 |
| 1367 | | VERTGUIDE, 164 |
| 1368 | | TOPMARGIN, 7 |
| 1369 | | END |
| 1370 | | |
| 1371 | | IDD_LANGUAGE, DIALOG |
| 1372 | | BEGIN |
| 1373 | | LEFTMARGIN, 7 |
| 1374 | | RIGHTMARGIN, 179 |
| 1375 | | TOPMARGIN, 7 |
| 1376 | | BOTTOMMARGIN, 59 |
| 1377 | | END |
| 1378 | | END |
| 1379 | | #endif // APSTUDIO_INVOKED |
| 1380 | | |
| 1381 | | |
| 1382 | | ///////////////////////////////////////////////////////////////////////////// |
| 1383 | | // |
| 1384 | | // Bitmap |
| 1385 | | // |
| 1386 | | |
| 1387 | | #ifdef MESS |
| 1388 | | IDB_ABOUT BITMAP "res\\about_mess.bmp" |
| 1389 | | #else |
| 1390 | | IDB_ABOUT BITMAP "res\\about.bmp" |
| 1391 | | #endif |
| 1392 | | IDB_TOOLBAR BITMAP "res\\toolbar.bmp" |
| 1393 | | |
| 1394 | | ///////////////////////////////////////////////////////////////////////////// |
| 1395 | | // |
| 1396 | | // Cursor |
| 1397 | | // |
| 1398 | | |
| 1399 | | IDC_CURSOR_HSPLIT CURSOR "Res\\Splith.cur" |
| 1400 | | |
| 1401 | | ///////////////////////////////////////////////////////////////////////////// |
| 1402 | | // |
| 1403 | | // RT_MANIFEST |
| 1404 | | // |
| 1405 | | |
| 1406 | | 1 RT_MANIFEST "res\\mame32.manifest" |
| 1407 | | |
| 1408 | | ///////////////////////////////////////////////////////////////////////////// |
| 1409 | | // |
| 1410 | | // String Table |
| 1411 | | // |
| 1412 | | |
| 1413 | | STRINGTABLE |
| 1414 | | BEGIN |
| 1415 | | IDS_UI_FILE "Contains commands for working with the selected items" |
| 1416 | | IDS_UI_VIEW "Contains commands for manupulating the view" |
| 1417 | | IDS_UI_OPTIONS "Contains commands for user interface options" |
| 1418 | | END |
| 1419 | | |
| 1420 | | STRINGTABLE |
| 1421 | | BEGIN |
| 1422 | | IDS_UI_HELP "Contains commands for displaying help" |
| 1423 | | IDS_VIEW_TOOLBAR "Show or hide the toolbar" |
| 1424 | | IDS_VIEW_STATUSBAR "Show or hide the status bar" |
| 1425 | | IDS_VIEW_FOLDERLIST "Show or hide the folder list" |
| 1426 | | IDS_VIEW_SCREENSHOT "Show or hide the screen shot" |
| 1427 | | IDS_VIEW_PICTURETABS "Show or hide tabs in the picture area" |
| 1428 | | IDS_VIEW_SPACER1 "Spacer" |
| 1429 | | IDS_VIEW_FULLSCREEN "Toggle full screen mode" |
| 1430 | | IDS_VIEW_SPACER2 "Spacer" |
| 1431 | | IDS_VIEW_SHOWPICTURES "Contains commands to select tabs shown in the picture area" |
| 1432 | | IDS_VIEW_SPACER3 "Spacer" |
| 1433 | | END |
| 1434 | | |
| 1435 | | STRINGTABLE |
| 1436 | | BEGIN |
| 1437 | | IDS_VIEW_LARGEICONS "Display items by using large icons." |
| 1438 | | IDS_VIEW_SMALLICONS "Display items by using small icons." |
| 1439 | | IDS_VIEW_LIST "Displays items in a list." |
| 1440 | | IDS_VIEW_DETAILS "Displays detailed information about each item in the window." |
| 1441 | | IDS_VIEW_GROUPED "Displays items grouped by parent game" |
| 1442 | | IDS_VIEW_SPACER4 "Spacer" |
| 1443 | | IDS_VIEW_ARRANGE "Contains commands for sorting by various columns" |
| 1444 | | IDS_VIEW_LINEUPICONS "Arranges icons in a grid" |
| 1445 | | IDS_VIEW_SPACER5 "Spacer" |
| 1446 | | IDS_VIEW_REFRESH "Refresh game list" |
| 1447 | | IDS_VIEW_CONTEXTFILTERS "Allows filtering out games from a folder" |
| 1448 | | IDS_VIEW_CUSTOMIZEFIELDS |
| 1449 | | "Customize which columns are used in the game list" |
| 1450 | | END |
| 1451 | | |
| 1452 | | STRINGTABLE |
| 1453 | | BEGIN |
| 1454 | | ID_FILE_EXIT "Exit the application" |
| 1455 | | #ifdef MESS |
| 1456 | | ID_FILE_PLAY "Play currently selected system" |
| 1457 | | #else |
| 1458 | | ID_FILE_PLAY "Play currently selected game" |
| 1459 | | #endif |
| 1460 | | ID_HELP_ABOUT "Displays program and copyright information" |
| 1461 | | ID_VIEW_LARGE_ICON "Display items by using large icons." |
| 1462 | | ID_VIEW_SMALL_ICON "Display items by using small icons." |
| 1463 | | ID_VIEW_LIST_MENU "Displays items in a list." |
| 1464 | | ID_VIEW_DETAIL "Displays detailed information about each item in the window." |
| 1465 | | #ifdef MESS |
| 1466 | | ID_OPTIONS_FONT "Set system list and folder list font" |
| 1467 | | ID_OPTIONS_DIR "Set directory configuration" |
| 1468 | | ID_OPTIONS_DEFAULTS "Set default system options" |
| 1469 | | #else |
| 1470 | | ID_VIEW_GROUPED "Show items grouped by parent game" |
| 1471 | | ID_OPTIONS_FONT "Set game list and folder list font" |
| 1472 | | ID_OPTIONS_CLONE_COLOR "Set the clone font color" |
| 1473 | | ID_OPTIONS_DIR "Set directory configuration" |
| 1474 | | ID_OPTIONS_DEFAULTS "Set default game options" |
| 1475 | | #endif |
| 1476 | | END |
| 1477 | | |
| 1478 | | STRINGTABLE |
| 1479 | | BEGIN |
| 1480 | | ID_OPTIONS_RESET_DEFAULTS "Allow restoring options to 'sane' values." |
| 1481 | | ID_OPTIONS_INTERFACE "Customize interface options." |
| 1482 | | ID_FILE_AUDIT "Audit ROM and samples sets" |
| 1483 | | #ifdef MESS |
| 1484 | | ID_FILE_PLAY_RECORD "Record a system for later playback" |
| 1485 | | ID_FILE_PLAY_BACK "Playback a recorded system" |
| 1486 | | ID_FILE_PLAY_RECORD_WAVE "Record the sound output of a system" |
| 1487 | | #else |
| 1488 | | ID_FILE_PLAY_RECORD "Record a game for later playback" |
| 1489 | | ID_FILE_PLAY_BACK "Playback a recorded game" |
| 1490 | | ID_FILE_PLAY_RECORD_WAVE "Record the audio output of a game" |
| 1491 | | ID_FILE_PLAY_RECORD_MNG "Record the video output of a game" |
| 1492 | | #endif |
| 1493 | | ID_VIEW_PICTURE_AREA "Show or hide the picture area" |
| 1494 | | ID_HELP_CONTENTS "Display help contents" |
| 1495 | | #ifdef MESS |
| 1496 | | ID_HELP_WHATS_NEW32 "Recent changes" |
| 1497 | | ID_HELP_TROUBLE "Troubleshooting Documentation" |
| 1498 | | ID_HELP_RELEASE "MESS release notes" |
| 1499 | | ID_HELP_WHATS_NEW "What's new in MESS" |
| 1500 | | ID_HELP_CHEATS "How cheats work" |
| 1501 | | #else |
| 1502 | | ID_HELP_WHATS_NEW32 "New game changes" |
| 1503 | | ID_HELP_TROUBLE "Troubleshooting Documentation" |
| 1504 | | ID_HELP_RELEASE "MAME release notes" |
| 1505 | | ID_HELP_WHATS_NEW "What's new in MAME" |
| 1506 | | ID_HELP_CHEATS "How cheats work" |
| 1507 | | #endif |
| 1508 | | END |
| 1509 | | |
| 1510 | | STRINGTABLE |
| 1511 | | BEGIN |
| 1512 | | ID_CONTEXT_RESET_PLAYTIME "Reset time played for selected item" |
| 1513 | | ID_CONTEXT_RESET_PLAYCOUNT "Reset number of plays for selected item" |
| 1514 | | ID_FOLDER_PROPERTIES "Display folder properties" |
| 1515 | | ID_FOLDER_AUDIT "Audit itmes in this folder" |
| 1516 | | #ifdef MESS |
| 1517 | | ID_FILE_LOADSTATE "Run a system starting with the given savestate" |
| 1518 | | #else |
| 1519 | | ID_FILE_LOADSTATE "Play a game starting with the given savestate" |
| 1520 | | #endif |
| 1521 | | END |
| 1522 | | |
| 1523 | | STRINGTABLE |
| 1524 | | BEGIN |
| 1525 | | ID_VIEW_TAB_CABINET "Select Cabinet tab" |
| 1526 | | ID_VIEW_TAB_MARQUEE "Select Marquee tab" |
| 1527 | | ID_VIEW_TAB_TITLE "Select Title tab" |
| 1528 | | ID_VIEW_TAB_CONTROL_PANEL "Select Control panel tab" |
| 1529 | | ID_VIEW_TAB_HISTORY "Select History tab" |
| 1530 | | ID_OPTIONS_BG "Set the bacground image" |
| 1531 | | ID_TOGGLE_TAB_SCREENSHOT "Enable the screenshot tab" |
| 1532 | | ID_TOGGLE_TAB_FLYER "Enable the flyer tab" |
| 1533 | | ID_TOGGLE_TAB_CABINET "Enable the cabinet tab" |
| 1534 | | ID_TOGGLE_TAB_MARQUEE "Enable the marquee tab" |
| 1535 | | ID_TOGGLE_TAB_TITLE "Enable the title tab" |
| 1536 | | ID_TOGGLE_TAB_CONTROL_PANEL "Enable the control panel tab" |
| 1537 | | ID_TOGGLE_TAB_PCB "Enable the PCB tab" |
| 1538 | | ID_TOGGLE_TAB_HISTORY "Enable the history tab" |
| 1539 | | ID_VIEW_FULLSCREEN "Toggle Fullscreen mode" |
| 1540 | | END |
| 1541 | | |
| 1542 | | STRINGTABLE |
| 1543 | | BEGIN |
| 1544 | | #ifdef MESS |
| 1545 | | ID_CUSTOMIZE_FIELDS "Customize which columns are used in the system list" |
| 1546 | | #else |
| 1547 | | ID_CUSTOMIZE_FIELDS "Customize which columns are used in the game list" |
| 1548 | | #endif |
| 1549 | | ID_GAME_PROPERTIES "Display the properties of the selected item" |
| 1550 | | ID_VIEW_PAGETAB "Show or hide the tabs in the picture area" |
| 1551 | | ID_VIEW_FOLDERS "Show or hide the folder list" |
| 1552 | | ID_VIEW_TOOLBARS "Show or hide the toolbar" |
| 1553 | | ID_VIEW_STATUS "Show or hide the status bar" |
| 1554 | | #ifdef MESS |
| 1555 | | ID_CONTEXT_FILTERS "Allows filtering out systems from a folder" |
| 1556 | | ID_CONTEXT_RENAME_CUSTOM "Rename this folder" |
| 1557 | | ID_CONTEXT_ADD_CUSTOM "Add selected item to custom folder" |
| 1558 | | ID_CONTEXT_REMOVE_CUSTOM "Remove selected item from this folder" |
| 1559 | | ID_GAME_AUDIT "Audit the selected item" |
| 1560 | | ID_CONTEXT_SELECT_RANDOM "Randomly select a system." |
| 1561 | | #else |
| 1562 | | ID_CONTEXT_FILTERS "Allows filtering out games from a folder" |
| 1563 | | ID_CONTEXT_RENAME_CUSTOM "Rename this folder" |
| 1564 | | ID_CONTEXT_ADD_CUSTOM "Add selected item to custom folder" |
| 1565 | | ID_CONTEXT_REMOVE_CUSTOM "Remove selected item from this folder" |
| 1566 | | ID_GAME_AUDIT "Audit the selected item" |
| 1567 | | ID_CONTEXT_SELECT_RANDOM "Randomly select a game." |
| 1568 | | #endif |
| 1569 | | ID_VIEW_TAB_SCREENSHOT "Select Screenshot tab" |
| 1570 | | ID_VIEW_TAB_FLYER "Select Flyer tab" |
| 1571 | | END |
| 1572 | | |
| 1573 | | STRINGTABLE |
| 1574 | | BEGIN |
| 1575 | | #ifdef MESS |
| 1576 | | ID_VIEW_BYGAME "Sort items by system" |
| 1577 | | #else |
| 1578 | | ID_VIEW_BYGAME "Sort items by game" |
| 1579 | | #endif |
| 1580 | | ID_VIEW_BYDIRECTORY "Sort items by directories" |
| 1581 | | ID_VIEW_BYMANUFACTURER "Sort items by manufacturer" |
| 1582 | | ID_VIEW_BYYEAR "Sort items by year" |
| 1583 | | ID_VIEW_BYTYPE "Sort items by type" |
| 1584 | | ID_VIEW_BYTIMESPLAYED "Sort by number of plays" |
| 1585 | | ID_VIEW_LINEUPICONS "Arranges icons in a grid" |
| 1586 | | #ifdef MESS |
| 1587 | | ID_UPDATE_GAMELIST "Refresh system list" |
| 1588 | | #else |
| 1589 | | ID_UPDATE_GAMELIST "Refresh game list" |
| 1590 | | #endif |
| 1591 | | ID_SORT_ASCENDING "Sort column in ascending (A-Z) order" |
| 1592 | | ID_SORT_DESCENDING "Sort column in descending (Z-A) order" |
| 1593 | | END |
| 1594 | | |
| 1595 | | STRINGTABLE |
| 1596 | | BEGIN |
| 1597 | | ID_FOLDER_SOURCEPROPERTIES |
| 1598 | | "Display properties for all games in this source file" |
| 1599 | | ID_FOLDER_VECTORPROPERTIES "Display properties for all vector based games" |
| 1600 | | END |
| 1601 | | |
| 1602 | | #endif // English (U.S.) resources |
| 1603 | | ///////////////////////////////////////////////////////////////////////////// |
| 1604 | | |
| 1605 | | |
| 1606 | | |
| 1607 | | #ifndef APSTUDIO_INVOKED |
| 1608 | | ///////////////////////////////////////////////////////////////////////////// |
| 1609 | | // |
| 1610 | | // Generated from the TEXTINCLUDE 3 resource. |
| 1611 | | // |
| 1612 | | #include "mamevers.rc" // Version block |
| 1613 | | |
| 1614 | | |
| 1615 | | ///////////////////////////////////////////////////////////////////////////// |
| 1616 | | #endif // not APSTUDIO_INVOKED |
| 1617 | | |
src/osd/winui/m32opts.c
| r1367 | r1368 | |
| 1 | | /*************************************************************************** |
| 2 | | |
| 3 | | M.A.M.E.32 - Multiple Arcade Machine Emulator for Win32 |
| 4 | | Win32 Portions Copyright (C) 1997-2003 Michael Soderstrom and Chris Kirmse |
| 5 | | |
| 6 | | This file is part of MAME32, and may only be used, modified and |
| 7 | | distributed under the terms of the MAME license, in "readme.txt". |
| 8 | | By continuing to use, modify or distribute this file you indicate |
| 9 | | that you have read the license and understand and accept it fully. |
| 10 | | |
| 11 | | ***************************************************************************/ |
| 12 | | |
| 13 | | /*************************************************************************** |
| 14 | | |
| 15 | | m32opts.c |
| 16 | | |
| 17 | | Stores global options and per-game options; |
| 18 | | |
| 19 | | ***************************************************************************/ |
| 20 | | |
| 21 | | #define WIN32_LEAN_AND_MEAN |
| 22 | | |
| 23 | | #include <windows.h> |
| 24 | | #include <windowsx.h> |
| 25 | | #include <winreg.h> |
| 26 | | #include <commctrl.h> |
| 27 | | #include <assert.h> |
| 28 | | #include <stdio.h> |
| 29 | | #include <sys/stat.h> |
| 30 | | #include <math.h> |
| 31 | | #include <direct.h> |
| 32 | | #include <driver.h> |
| 33 | | #include <stddef.h> |
| 34 | | #include <tchar.h> |
| 35 | | |
| 36 | | #include "screenshot.h" |
| 37 | | #include "bitmask.h" |
| 38 | | #include "mame32.h" |
| 39 | | #include "m32util.h" |
| 40 | | #include "resource.h" |
| 41 | | #include "treeview.h" |
| 42 | | #include "file.h" |
| 43 | | #include "splitters.h" |
| 44 | | #include "dijoystick.h" |
| 45 | | #include "audit.h" |
| 46 | | #include "m32opts.h" |
| 47 | | #include "picker.h" |
| 48 | | #include "winmain.h" |
| 49 | | #include "windows/winutf8.h" |
| 50 | | #include "windows/strconv.h" |
| 51 | | #include "astring.h" |
| 52 | | |
| 53 | | #ifdef MESS |
| 54 | | #include "optionsms.h" |
| 55 | | #endif // MESS |
| 56 | | |
| 57 | | #ifdef _MSC_VER |
| 58 | | #define snprintf _snprintf |
| 59 | | #endif |
| 60 | | |
| 61 | | /*************************************************************************** |
| 62 | | Internal function prototypes |
| 63 | | ***************************************************************************/ |
| 64 | | |
| 65 | | // static void LoadFolderFilter(int folder_index,int filters); |
| 66 | | |
| 67 | | static file_error LoadSettingsFile(core_options *opts, const char *filename); |
| 68 | | static file_error SaveSettingsFile(core_options *opts, core_options *baseopts, const char *filename); |
| 69 | | |
| 70 | | static void LoadOptionsAndSettings(void); |
| 71 | | |
| 72 | | static void CusColorEncodeString(const COLORREF *value, char* str); |
| 73 | | static void CusColorDecodeString(const char* str, COLORREF *value); |
| 74 | | |
| 75 | | static void SplitterEncodeString(const int *value, char* str); |
| 76 | | static void SplitterDecodeString(const char *str, int *value); |
| 77 | | |
| 78 | | static void FontEncodeString(const LOGFONT *f, char *str); |
| 79 | | static void FontDecodeString(const char* str, LOGFONT *f); |
| 80 | | |
| 81 | | static void TabFlagsEncodeString(int data, char *str); |
| 82 | | static void TabFlagsDecodeString(const char *str, int *data); |
| 83 | | |
| 84 | | static DWORD DecodeFolderFlags(const char *buf); |
| 85 | | static const char * EncodeFolderFlags(DWORD value); |
| 86 | | |
| 87 | | static void ResetToDefaults(core_options *opts, int priority); |
| 88 | | |
| 89 | | static void ui_parse_ini_file(core_options *opts, const char *name); |
| 90 | | static void remove_all_source_options(void); |
| 91 | | |
| 92 | | |
| 93 | | #ifdef _MSC_VER |
| 94 | | #define snprintf _snprintf |
| 95 | | #endif |
| 96 | | |
| 97 | | /*************************************************************************** |
| 98 | | Internal defines |
| 99 | | ***************************************************************************/ |
| 100 | | |
| 101 | | #define UI_INI_FILENAME MAME32NAME "ui.ini" |
| 102 | | #define DEFAULT_OPTIONS_INI_FILENAME CONFIGNAME ".ini" |
| 103 | | |
| 104 | | #define M32OPTION_LIST_MODE "list_mode" |
| 105 | | #define M32OPTION_CHECK_GAME "check_game" |
| 106 | | #define M32OPTION_JOYSTICK_IN_INTERFACE "joystick_in_interface" |
| 107 | | #define M32OPTION_KEYBOARD_IN_INTERFACE "keyboard_in_interface" |
| 108 | | #define M32OPTION_CYCLE_SCREENSHOT "cycle_screenshot" |
| 109 | | #define M32OPTION_STRETCH_SCREENSHOT_LARGER "stretch_screenshot_larger" |
| 110 | | #define M32OPTION_SCREENSHOT_BORDER_SIZE "screenshot_bordersize" |
| 111 | | #define M32OPTION_SCREENSHOT_BORDER_COLOR "screenshot_bordercolor" |
| 112 | | #define M32OPTION_INHERIT_FILTER "inherit_filter" |
| 113 | | #define M32OPTION_OFFSET_CLONES "offset_clones" |
| 114 | | #define M32OPTION_GAME_CAPTION "game_caption" |
| 115 | | #define M32OPTION_BROADCAST_GAME_NAME "broadcast_game_name" |
| 116 | | #define M32OPTION_RANDOM_BACKGROUND "random_background" |
| 117 | | #define M32OPTION_DEFAULT_FOLDER_ID "default_folder_id" |
| 118 | | #define M32OPTION_SHOW_IMAGE_SECTION "show_image_section" |
| 119 | | #define M32OPTION_SHOW_FOLDER_SECTION "show_folder_section" |
| 120 | | #define M32OPTION_HIDE_FOLDERS "hide_folders" |
| 121 | | #define M32OPTION_SHOW_STATUS_BAR "show_status_bar" |
| 122 | | #define M32OPTION_SHOW_TABS "show_tabs" |
| 123 | | #define M32OPTION_SHOW_TOOLBAR "show_tool_bar" |
| 124 | | #define M32OPTION_CURRENT_TAB "current_tab" |
| 125 | | #define M32OPTION_WINDOW_X "window_x" |
| 126 | | #define M32OPTION_WINDOW_Y "window_y" |
| 127 | | #define M32OPTION_WINDOW_WIDTH "window_width" |
| 128 | | #define M32OPTION_WINDOW_HEIGHT "window_height" |
| 129 | | #define M32OPTION_WINDOW_STATE "window_state" |
| 130 | | #define M32OPTION_CUSTOM_COLOR "custom_color" |
| 131 | | #define M32OPTION_LIST_FONT "list_font" |
| 132 | | #define M32OPTION_TEXT_COLOR "text_color" |
| 133 | | #define M32OPTION_CLONE_COLOR "clone_color" |
| 134 | | #define M32OPTION_HIDE_TABS "hide_tabs" |
| 135 | | #define M32OPTION_HISTORY_TAB "history_tab" |
| 136 | | #define M32OPTION_COLUMN_WIDTHS "column_widths" |
| 137 | | #define M32OPTION_COLUMN_ORDER "column_order" |
| 138 | | #define M32OPTION_COLUMN_SHOWN "column_shown" |
| 139 | | #define M32OPTION_SPLITTERS "splitters" |
| 140 | | #define M32OPTION_SORT_COLUMN "sort_column" |
| 141 | | #define M32OPTION_SORT_REVERSED "sort_reversed" |
| 142 | | #define M32OPTION_LANGUAGE "language" |
| 143 | | #define M32OPTION_FLYER_DIRECTORY "flyer_directory" |
| 144 | | #define M32OPTION_CABINET_DIRECTORY "cabinet_directory" |
| 145 | | #define M32OPTION_MARQUEE_DIRECTORY "marquee_directory" |
| 146 | | #define M32OPTION_TITLE_DIRECTORY "title_directory" |
| 147 | | #define M32OPTION_CPANEL_DIRECTORY "cpanel_directory" |
| 148 | | #define M32OPTION_PCB_DIRECTORY "pcb_directory" |
| 149 | | #define M32OPTION_ICONS_DIRECTORY "icons_directory" |
| 150 | | #define M32OPTION_BACKGROUND_DIRECTORY "background_directory" |
| 151 | | #define M32OPTION_FOLDER_DIRECTORY "folder_directory" |
| 152 | | #define M32OPTION_UI_KEY_UP "ui_key_up" |
| 153 | | #define M32OPTION_UI_KEY_DOWN "ui_key_down" |
| 154 | | #define M32OPTION_UI_KEY_LEFT "ui_key_left" |
| 155 | | #define M32OPTION_UI_KEY_RIGHT "ui_key_right" |
| 156 | | #define M32OPTION_UI_KEY_START "ui_key_start" |
| 157 | | #define M32OPTION_UI_KEY_PGUP "ui_key_pgup" |
| 158 | | #define M32OPTION_UI_KEY_PGDWN "ui_key_pgdwn" |
| 159 | | #define M32OPTION_UI_KEY_HOME "ui_key_home" |
| 160 | | #define M32OPTION_UI_KEY_END "ui_key_end" |
| 161 | | #define M32OPTION_UI_KEY_SS_CHANGE "ui_key_ss_change" |
| 162 | | #define M32OPTION_UI_KEY_HISTORY_UP "ui_key_history_up" |
| 163 | | #define M32OPTION_UI_KEY_HISTORY_DOWN "ui_key_history_down" |
| 164 | | #define M32OPTION_UI_KEY_CONTEXT_FILTERS "ui_key_context_filters" |
| 165 | | #define M32OPTION_UI_KEY_SELECT_RANDOM "ui_key_select_random" |
| 166 | | #define M32OPTION_UI_KEY_GAME_AUDIT "ui_key_game_audit" |
| 167 | | #define M32OPTION_UI_KEY_GAME_PROPERTIES "ui_key_game_properties" |
| 168 | | #define M32OPTION_UI_KEY_HELP_CONTENTS "ui_key_help_contents" |
| 169 | | #define M32OPTION_UI_KEY_UPDATE_GAMELIST "ui_key_update_gamelist" |
| 170 | | #define M32OPTION_UI_KEY_VIEW_FOLDERS "ui_key_view_folders" |
| 171 | | #define M32OPTION_UI_KEY_VIEW_FULLSCREEN "ui_key_view_fullscreen" |
| 172 | | #define M32OPTION_UI_KEY_VIEW_PAGETAB "ui_key_view_pagetab" |
| 173 | | #define M32OPTION_UI_KEY_VIEW_PICTURE_AREA "ui_key_view_picture_area" |
| 174 | | #define M32OPTION_UI_KEY_VIEW_STATUS "ui_key_view_status" |
| 175 | | #define M32OPTION_UI_KEY_VIEW_TOOLBARS "ui_key_view_toolbars" |
| 176 | | #define M32OPTION_UI_KEY_VIEW_TAB_CABINET "ui_key_view_tab_cabinet" |
| 177 | | #define M32OPTION_UI_KEY_VIEW_TAB_CPANEL "ui_key_view_tab_cpanel" |
| 178 | | #define M32OPTION_UI_KEY_VIEW_TAB_FLYER "ui_key_view_tab_flyer" |
| 179 | | #define M32OPTION_UI_KEY_VIEW_TAB_HISTORY "ui_key_view_tab_history" |
| 180 | | #define M32OPTION_UI_KEY_VIEW_TAB_MARQUEE "ui_key_view_tab_marquee" |
| 181 | | #define M32OPTION_UI_KEY_VIEW_TAB_SCREENSHOT "ui_key_view_tab_screenshot" |
| 182 | | #define M32OPTION_UI_KEY_VIEW_TAB_TITLE "ui_key_view_tab_title" |
| 183 | | #define M32OPTION_UI_KEY_VIEW_TAB_PCB "ui_key_view_tab_pcb" |
| 184 | | #define M32OPTION_UI_KEY_QUIT "ui_key_quit" |
| 185 | | #define M32OPTION_UI_JOY_UP "ui_joy_up" |
| 186 | | #define M32OPTION_UI_JOY_DOWN "ui_joy_down" |
| 187 | | #define M32OPTION_UI_JOY_LEFT "ui_joy_left" |
| 188 | | #define M32OPTION_UI_JOY_RIGHT "ui_joy_right" |
| 189 | | #define M32OPTION_UI_JOY_START "ui_joy_start" |
| 190 | | #define M32OPTION_UI_JOY_PGUP "ui_joy_pgup" |
| 191 | | #define M32OPTION_UI_JOY_PGDWN "ui_joy_pgdwn" |
| 192 | | #define M32OPTION_UI_JOY_HOME "ui_joy_home" |
| 193 | | #define M32OPTION_UI_JOY_END "ui_joy_end" |
| 194 | | #define M32OPTION_UI_JOY_SS_CHANGE "ui_joy_ss_change" |
| 195 | | #define M32OPTION_UI_JOY_HISTORY_UP "ui_joy_history_up" |
| 196 | | #define M32OPTION_UI_JOY_HISTORY_DOWN "ui_joy_history_down" |
| 197 | | #define M32OPTION_UI_JOY_EXEC "ui_joy_exec" |
| 198 | | #define M32OPTION_EXEC_COMMAND "exec_command" |
| 199 | | #define M32OPTION_EXEC_WAIT "exec_wait" |
| 200 | | #define M32OPTION_HIDE_MOUSE "hide_mouse" |
| 201 | | #define M32OPTION_FULL_SCREEN "full_screen" |
| 202 | | |
| 203 | | #ifdef MESS |
| 204 | | // Options names |
| 205 | | #define M32OPTION_DEFAULT_GAME "default_system" |
| 206 | | #define M32OPTION_HISTORY_FILE "sysinfo_file" |
| 207 | | #define M32OPTION_MAMEINFO_FILE "messinfo_file" |
| 208 | | // Option values |
| 209 | | #define M32DEFAULT_SELECTION "nes" |
| 210 | | #define M32DEFAULT_SPLITTERS "152,310,468" |
| 211 | | #define M32HISTORY_FILE "sysinfo.dat" |
| 212 | | #define M32MAMEINFO_FILE "messinfo.dat" |
| 213 | | #else |
| 214 | | // Options names |
| 215 | | #define M32OPTION_DEFAULT_GAME "default_game" |
| 216 | | #define M32OPTION_HISTORY_FILE "history_file" |
| 217 | | #define M32OPTION_MAMEINFO_FILE "mameinfo_file" |
| 218 | | // Options values |
| 219 | | #define M32DEFAULT_SELECTION "puckman" |
| 220 | | #define M32DEFAULT_SPLITTERS "152,362" |
| 221 | | #define M32HISTORY_FILE "history.dat" |
| 222 | | #define M32MAMEINFO_FILE "mameinfo.dat" |
| 223 | | #endif |
| 224 | | |
| 225 | | |
| 226 | | |
| 227 | | /*************************************************************************** |
| 228 | | Internal structures |
| 229 | | ***************************************************************************/ |
| 230 | | |
| 231 | | #if 0 |
| 232 | | typedef struct |
| 233 | | { |
| 234 | | int folder_index; |
| 235 | | int filters; |
| 236 | | } folder_filter_type; |
| 237 | | #endif |
| 238 | | |
| 239 | | /*************************************************************************** |
| 240 | | Internal variables |
| 241 | | ***************************************************************************/ |
| 242 | | |
| 243 | | static object_pool *options_memory_pool; |
| 244 | | |
| 245 | | static core_options *settings; |
| 246 | | |
| 247 | | static core_options *global = NULL; // Global 'default' options |
| 248 | | |
| 249 | | // UI options in mame32ui.ini |
| 250 | | static const options_entry regSettings[] = |
| 251 | | { |
| 252 | | // UI options |
| 253 | | { NULL, NULL, OPTION_HEADER, "DISPLAY STATE OPTIONS" }, |
| 254 | | { M32OPTION_DEFAULT_GAME, M32DEFAULT_SELECTION, 0, NULL }, |
| 255 | | { M32OPTION_DEFAULT_GAME, "puckman", 0, NULL }, |
| 256 | | { M32OPTION_DEFAULT_FOLDER_ID, "0", 0, NULL }, |
| 257 | | { M32OPTION_SHOW_IMAGE_SECTION, "1", OPTION_BOOLEAN, NULL }, |
| 258 | | { M32OPTION_FULL_SCREEN, "0", OPTION_BOOLEAN, NULL }, |
| 259 | | { M32OPTION_CURRENT_TAB, "0", 0, NULL }, |
| 260 | | { M32OPTION_SHOW_TOOLBAR, "1", OPTION_BOOLEAN, NULL }, |
| 261 | | { M32OPTION_SHOW_STATUS_BAR, "1", OPTION_BOOLEAN, NULL }, |
| 262 | | { M32OPTION_HIDE_FOLDERS, "", 0, NULL }, |
| 263 | | #ifdef MESS |
| 264 | | { M32OPTION_SHOW_FOLDER_SECTION, "0", OPTION_BOOLEAN, NULL }, |
| 265 | | { M32OPTION_SHOW_TABS, "0", OPTION_BOOLEAN, NULL }, |
| 266 | | { M32OPTION_HIDE_TABS, "flyer, cabinet, marquee, title, cpanel, pcb", 0, NULL }, |
| 267 | | { M32OPTION_HISTORY_TAB, "1", 0, NULL }, |
| 268 | | #else |
| 269 | | { M32OPTION_SHOW_FOLDER_SECTION, "1", OPTION_BOOLEAN, NULL }, |
| 270 | | { M32OPTION_SHOW_TABS, "1", OPTION_BOOLEAN, NULL }, |
| 271 | | { M32OPTION_HIDE_TABS, "marquee, title, cpanel, pcb, history", 0, NULL }, |
| 272 | | { M32OPTION_HISTORY_TAB, "0", 0, NULL }, |
| 273 | | #endif |
| 274 | | |
| 275 | | { M32OPTION_SORT_COLUMN, "0", 0, NULL }, |
| 276 | | { M32OPTION_SORT_REVERSED, "0", OPTION_BOOLEAN, NULL }, |
| 277 | | { M32OPTION_WINDOW_X, "0", 0, NULL }, |
| 278 | | { M32OPTION_WINDOW_Y, "0", 0, NULL }, |
| 279 | | { M32OPTION_WINDOW_WIDTH, "640", 0, NULL }, |
| 280 | | { M32OPTION_WINDOW_HEIGHT, "400", 0, NULL }, |
| 281 | | { M32OPTION_WINDOW_STATE, "1", 0, NULL }, |
| 282 | | |
| 283 | | { M32OPTION_TEXT_COLOR, "-1", 0, NULL }, |
| 284 | | { M32OPTION_CLONE_COLOR, "-1", 0, NULL }, |
| 285 | | { M32OPTION_CUSTOM_COLOR, "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0", 0, NULL }, |
| 286 | | /* ListMode needs to be before ColumnWidths settings */ |
| 287 | | { M32OPTION_LIST_MODE, "5", 0, NULL }, |
| 288 | | { M32OPTION_SPLITTERS, M32DEFAULT_SPLITTERS, 0, NULL }, |
| 289 | | { M32OPTION_LIST_FONT, "-8,0,0,0,400,0,0,0,0,0,0,0,0,MS Sans Serif", 0, NULL }, |
| 290 | | { M32OPTION_COLUMN_WIDTHS, "185,78,84,84,64,88,74,108,60,144,84,60", 0, NULL }, |
| 291 | | { M32OPTION_COLUMN_ORDER, "0,2,3,4,5,6,7,8,9,1,10,11", 0, NULL }, |
| 292 | | { M32OPTION_COLUMN_SHOWN, "1,0,1,1,1,1,1,1,1,1,0,0", 0, NULL }, |
| 293 | | |
| 294 | | { NULL, NULL, OPTION_HEADER, "INTERFACE OPTIONS" }, |
| 295 | | { M32OPTION_LANGUAGE, "english", 0, NULL }, |
| 296 | | { M32OPTION_CHECK_GAME, "1", OPTION_BOOLEAN, NULL }, |
| 297 | | { M32OPTION_JOYSTICK_IN_INTERFACE, "0", OPTION_BOOLEAN, NULL }, |
| 298 | | { M32OPTION_KEYBOARD_IN_INTERFACE, "0", OPTION_BOOLEAN, NULL }, |
| 299 | | { M32OPTION_RANDOM_BACKGROUND, "0", OPTION_BOOLEAN, NULL }, |
| 300 | | { M32OPTION_BROADCAST_GAME_NAME, "0", OPTION_BOOLEAN, NULL }, |
| 301 | | { M32OPTION_HIDE_MOUSE, "0", OPTION_BOOLEAN, NULL }, |
| 302 | | { M32OPTION_INHERIT_FILTER, "0", OPTION_BOOLEAN, NULL }, |
| 303 | | { M32OPTION_OFFSET_CLONES, "0", OPTION_BOOLEAN, NULL }, |
| 304 | | { M32OPTION_GAME_CAPTION, "1", OPTION_BOOLEAN, NULL }, |
| 305 | | { M32OPTION_STRETCH_SCREENSHOT_LARGER, "0", OPTION_BOOLEAN, NULL }, |
| 306 | | { M32OPTION_CYCLE_SCREENSHOT, "0", 0, NULL }, |
| 307 | | { M32OPTION_SCREENSHOT_BORDER_SIZE, "11", 0, NULL }, |
| 308 | | { M32OPTION_SCREENSHOT_BORDER_COLOR, "-1", 0, NULL }, |
| 309 | | { M32OPTION_EXEC_COMMAND, "", 0, NULL }, |
| 310 | | { M32OPTION_EXEC_WAIT, "0", 0, NULL }, |
| 311 | | |
| 312 | | { NULL, NULL, OPTION_HEADER, "SEARCH PATH OPTIONS" }, |
| 313 | | { M32OPTION_FLYER_DIRECTORY, "flyers", 0, NULL }, |
| 314 | | { M32OPTION_CABINET_DIRECTORY, "cabinets", 0, NULL }, |
| 315 | | { M32OPTION_MARQUEE_DIRECTORY, "marquees", 0, NULL }, |
| 316 | | { M32OPTION_TITLE_DIRECTORY, "titles", 0, NULL }, |
| 317 | | { M32OPTION_CPANEL_DIRECTORY, "cpanel", 0, NULL }, |
| 318 | | { M32OPTION_PCB_DIRECTORY, "pcb", 0, NULL }, |
| 319 | | { M32OPTION_BACKGROUND_DIRECTORY, "bkground", 0, NULL }, |
| 320 | | { M32OPTION_FOLDER_DIRECTORY, "folders", 0, NULL }, |
| 321 | | { M32OPTION_ICONS_DIRECTORY, "icons", 0, NULL }, |
| 322 | | |
| 323 | | |
| 324 | | { NULL, NULL, OPTION_HEADER, "FILENAME OPTIONS" }, |
| 325 | | { M32OPTION_HISTORY_FILE, M32HISTORY_FILE, 0, NULL }, |
| 326 | | { M32OPTION_MAMEINFO_FILE, M32MAMEINFO_FILE, 0, NULL }, |
| 327 | | |
| 328 | | { NULL, NULL, OPTION_HEADER, "NAVIGATION KEY CODES" }, |
| 329 | | { M32OPTION_UI_KEY_UP, "KEYCODE_UP", 0, NULL }, |
| 330 | | { M32OPTION_UI_KEY_DOWN, "KEYCODE_DOWN", 0, NULL }, |
| 331 | | { M32OPTION_UI_KEY_LEFT, "KEYCODE_LEFT", 0, NULL }, |
| 332 | | { M32OPTION_UI_KEY_RIGHT, "KEYCODE_RIGHT", 0, NULL }, |
| 333 | | { M32OPTION_UI_KEY_START, "KEYCODE_ENTER NOT KEYCODE_LALT", 0, NULL }, |
| 334 | | { M32OPTION_UI_KEY_PGUP, "KEYCODE_PGUP", 0, NULL }, |
| 335 | | { M32OPTION_UI_KEY_PGDWN, "KEYCODE_PGDN", 0, NULL }, |
| 336 | | { M32OPTION_UI_KEY_HOME, "KEYCODE_HOME", 0, NULL }, |
| 337 | | { M32OPTION_UI_KEY_END, "KEYCODE_END", 0, NULL }, |
| 338 | | { M32OPTION_UI_KEY_SS_CHANGE, "KEYCODE_INSERT", 0, NULL }, |
| 339 | | { M32OPTION_UI_KEY_HISTORY_UP, "KEYCODE_DEL", 0, NULL }, |
| 340 | | { M32OPTION_UI_KEY_HISTORY_DOWN, "KEYCODE_LALT KEYCODE_0", 0, NULL }, |
| 341 | | |
| 342 | | { M32OPTION_UI_KEY_CONTEXT_FILTERS, "KEYCODE_LCONTROL KEYCODE_F", 0, NULL }, |
| 343 | | { M32OPTION_UI_KEY_SELECT_RANDOM, "KEYCODE_LCONTROL KEYCODE_R", 0, NULL }, |
| 344 | | { M32OPTION_UI_KEY_GAME_AUDIT, "KEYCODE_LALT KEYCODE_A", 0, NULL }, |
| 345 | | { M32OPTION_UI_KEY_GAME_PROPERTIES, "KEYCODE_LALT KEYCODE_ENTER", 0, NULL }, |
| 346 | | { M32OPTION_UI_KEY_HELP_CONTENTS, "KEYCODE_F1", 0, NULL }, |
| 347 | | { M32OPTION_UI_KEY_UPDATE_GAMELIST, "KEYCODE_F5", 0, NULL }, |
| 348 | | { M32OPTION_UI_KEY_VIEW_FOLDERS, "KEYCODE_LALT KEYCODE_D", 0, NULL }, |
| 349 | | { M32OPTION_UI_KEY_VIEW_FULLSCREEN, "KEYCODE_F11", 0, NULL }, |
| 350 | | { M32OPTION_UI_KEY_VIEW_PAGETAB, "KEYCODE_LALT KEYCODE_B", 0, NULL }, |
| 351 | | { M32OPTION_UI_KEY_VIEW_PICTURE_AREA, "KEYCODE_LALT KEYCODE_P", 0, NULL }, |
| 352 | | { M32OPTION_UI_KEY_VIEW_STATUS, "KEYCODE_LALT KEYCODE_S", 0, NULL }, |
| 353 | | { M32OPTION_UI_KEY_VIEW_TOOLBARS, "KEYCODE_LALT KEYCODE_T", 0, NULL }, |
| 354 | | |
| 355 | | { M32OPTION_UI_KEY_VIEW_TAB_CABINET, "KEYCODE_LALT KEYCODE_3", 0, NULL }, |
| 356 | | { M32OPTION_UI_KEY_VIEW_TAB_CPANEL, "KEYCODE_LALT KEYCODE_6", 0, NULL }, |
| 357 | | { M32OPTION_UI_KEY_VIEW_TAB_FLYER, "KEYCODE_LALT KEYCODE_2", 0, NULL }, |
| 358 | | { M32OPTION_UI_KEY_VIEW_TAB_HISTORY, "KEYCODE_LALT KEYCODE_8", 0, NULL }, |
| 359 | | { M32OPTION_UI_KEY_VIEW_TAB_MARQUEE, "KEYCODE_LALT KEYCODE_4", 0, NULL }, |
| 360 | | { M32OPTION_UI_KEY_VIEW_TAB_SCREENSHOT, "KEYCODE_LALT KEYCODE_1", 0, NULL }, |
| 361 | | { M32OPTION_UI_KEY_VIEW_TAB_TITLE, "KEYCODE_LALT KEYCODE_5", 0, NULL }, |
| 362 | | { M32OPTION_UI_KEY_VIEW_TAB_PCB, "KEYCODE_LALT KEYCODE_7", 0, NULL }, |
| 363 | | { M32OPTION_UI_KEY_QUIT, "KEYCODE_LALT KEYCODE_Q", 0, NULL }, |
| 364 | | |
| 365 | | { NULL, NULL, OPTION_HEADER, "NAVIGATION JOYSTICK CODES" }, |
| 366 | | { M32OPTION_UI_JOY_UP, "", 0, NULL }, |
| 367 | | { M32OPTION_UI_JOY_DOWN, "", 0, NULL }, |
| 368 | | { M32OPTION_UI_JOY_LEFT, "", 0, NULL }, |
| 369 | | { M32OPTION_UI_JOY_RIGHT, "", 0, NULL }, |
| 370 | | { M32OPTION_UI_JOY_START, "", 0, NULL }, |
| 371 | | { M32OPTION_UI_JOY_PGUP, "", 0, NULL }, |
| 372 | | { M32OPTION_UI_JOY_PGDWN, "", 0, NULL }, |
| 373 | | { M32OPTION_UI_JOY_HOME, "0,0,0,0", 0, NULL }, |
| 374 | | { M32OPTION_UI_JOY_END, "0,0,0,0", 0, NULL }, |
| 375 | | { M32OPTION_UI_JOY_SS_CHANGE, "", 0, NULL }, |
| 376 | | { M32OPTION_UI_JOY_HISTORY_UP, "", 0, NULL }, |
| 377 | | { M32OPTION_UI_JOY_HISTORY_DOWN, "", 0, NULL }, |
| 378 | | { M32OPTION_UI_JOY_EXEC, "0,0,0,0", 0, NULL }, |
| 379 | | |
| 380 | | #ifndef MESS |
| 381 | | { NULL, NULL, OPTION_HEADER, "GAME STATISTICS" }, |
| 382 | | #endif |
| 383 | | { NULL } |
| 384 | | }; |
| 385 | | |
| 386 | | static const options_entry perGameOptions[] = |
| 387 | | { |
| 388 | | // per game options |
| 389 | | { "_play_count", "0", 0, NULL }, |
| 390 | | { "_play_time", "0", 0, NULL }, |
| 391 | | { "_rom_audit", "-1", 0, NULL }, |
| 392 | | { "_samples_audit", "-1", 0, NULL }, |
| 393 | | #ifdef MESS |
| 394 | | { "_extra_software", "", 0, NULL }, |
| 395 | | #endif |
| 396 | | { NULL } |
| 397 | | }; |
| 398 | | |
| 399 | | static const options_entry filterOptions[] = |
| 400 | | { |
| 401 | | // filters |
| 402 | | { "_filters", "0", 0, NULL }, |
| 403 | | { NULL } |
| 404 | | }; |
| 405 | | |
| 406 | | |
| 407 | | |
| 408 | | // Screen shot Page tab control text |
| 409 | | // these must match the order of the options flags in options.h |
| 410 | | // (TAB_...) |
| 411 | | const char* image_tabs_long_name[MAX_TAB_TYPES] = |
| 412 | | { |
| 413 | | "Snapshot ", |
| 414 | | "Flyer ", |
| 415 | | "Cabinet ", |
| 416 | | "Marquee", |
| 417 | | "Title", |
| 418 | | "Control Panel", |
| 419 | | "PCB", |
| 420 | | "History ", |
| 421 | | }; |
| 422 | | |
| 423 | | const char* image_tabs_short_name[MAX_TAB_TYPES] = |
| 424 | | { |
| 425 | | "snapshot", |
| 426 | | "flyer", |
| 427 | | "cabinet", |
| 428 | | "marquee", |
| 429 | | "title", |
| 430 | | "cpanel", |
| 431 | | "pcb", |
| 432 | | "history" |
| 433 | | }; |
| 434 | | |
| 435 | | |
| 436 | | static BOOL save_gui_settings = TRUE; |
| 437 | | static BOOL save_default_options = TRUE; |
| 438 | | |
| 439 | | #if 0 |
| 440 | | folder_filter_type *folder_filters; |
| 441 | | int size_folder_filters; |
| 442 | | int num_folder_filters; |
| 443 | | #endif |
| 444 | | |
| 445 | | /*************************************************************************** |
| 446 | | External functions |
| 447 | | ***************************************************************************/ |
| 448 | | |
| 449 | | static void memory_error(const char *message) |
| 450 | | { |
| 451 | | win_message_box_utf8(NULL, message, NULL, MB_OK); |
| 452 | | exit(-1); |
| 453 | | } |
| 454 | | |
| 455 | | |
| 456 | | |
| 457 | | void AddOptions(core_options *opts, const options_entry *entrylist, BOOL is_global) |
| 458 | | { |
| 459 | | static const char *blacklist[] = |
| 460 | | { |
| 461 | | WINOPTION_SCREEN, |
| 462 | | WINOPTION_ASPECT, |
| 463 | | WINOPTION_RESOLUTION, |
| 464 | | WINOPTION_VIEW |
| 465 | | }; |
| 466 | | options_entry entries[2]; |
| 467 | | BOOL good_option; |
| 468 | | int i; |
| 469 | | |
| 470 | | for ( ; entrylist->name != NULL || (entrylist->flags & OPTION_HEADER); entrylist++) |
| 471 | | { |
| 472 | | good_option = TRUE; |
| 473 | | |
| 474 | | // check blacklist |
| 475 | | if (entrylist->name != NULL) |
| 476 | | { |
| 477 | | for (i = 0; i < ARRAY_LENGTH(blacklist); i++) |
| 478 | | { |
| 479 | | if (!strcmp(entrylist->name, blacklist[i])) |
| 480 | | { |
| 481 | | good_option = FALSE; |
| 482 | | break; |
| 483 | | } |
| 484 | | } |
| 485 | | } |
| 486 | | |
| 487 | | // if is_global is FALSE, blacklist global options |
| 488 | | if (entrylist->name && !is_global && IsGlobalOption(entrylist->name)) |
| 489 | | good_option = FALSE; |
| 490 | | |
| 491 | | if (good_option) |
| 492 | | { |
| 493 | | memcpy(entries, entrylist, sizeof(options_entry)); |
| 494 | | memset(&entries[1], 0, sizeof(entries[1])); |
| 495 | | options_add_entries(opts, entries); |
| 496 | | } |
| 497 | | } |
| 498 | | } |
| 499 | | |
| 500 | | |
| 501 | | |
| 502 | | core_options *CreateGameOptions(int driver_index) |
| 503 | | { |
| 504 | | core_options *opts; |
| 505 | | BOOL is_global = (driver_index == OPTIONS_TYPE_GLOBAL); |
| 506 | | extern const options_entry mame_win_options[]; |
| 507 | | |
| 508 | | // create the options |
| 509 | | opts = options_create(memory_error); |
| 510 | | |
| 511 | | // add the options |
| 512 | | AddOptions(opts, mame_core_options, is_global); |
| 513 | | AddOptions(opts, mame_win_options, is_global); |
| 514 | | |
| 515 | | // customize certain options |
| 516 | | if (is_global) |
| 517 | | options_set_option_default_value(opts, OPTION_INIPATH, "ini"); |
| 518 | | |
| 519 | | #ifdef MESS |
| 520 | | MessSetupGameOptions(opts, driver_index); |
| 521 | | #endif // MESS |
| 522 | | |
| 523 | | return opts; |
| 524 | | } |
| 525 | | |
| 526 | | |
| 527 | | |
| 528 | | BOOL OptionsInit() |
| 529 | | { |
| 530 | | // create a memory pool for our data |
| 531 | | options_memory_pool = pool_alloc(memory_error); |
| 532 | | if (!options_memory_pool) |
| 533 | | return FALSE; |
| 534 | | |
| 535 | | // set up the MAME32 settings (these get placed in MAME32ui.ini |
| 536 | | settings = options_create(memory_error); |
| 537 | | options_add_entries(settings, regSettings); |
| 538 | | #ifdef MESS |
| 539 | | MessSetupSettings(settings); |
| 540 | | #endif |
| 541 | | |
| 542 | | // set up per game options |
| 543 | | { |
| 544 | | char buffer[128]; |
| 545 | | int i, j; |
| 546 | | int game_option_count = 0; |
| 547 | | options_entry *driver_per_game_options; |
| 548 | | options_entry *ent; |
| 549 | | |
| 550 | | while(perGameOptions[game_option_count].name) |
| 551 | | game_option_count++; |
| 552 | | |
| 553 | | driver_per_game_options = (options_entry *) pool_malloc(options_memory_pool, |
| 554 | | (game_option_count * driver_list_get_count(drivers) + 1) * sizeof(*driver_per_game_options)); |
| 555 | | |
| 556 | | for (i = 0; i < driver_list_get_count(drivers); i++) |
| 557 | | { |
| 558 | | for (j = 0; j < game_option_count; j++) |
| 559 | | { |
| 560 | | ent = &driver_per_game_options[i * game_option_count + j]; |
| 561 | | |
| 562 | | snprintf(buffer, ARRAY_LENGTH(buffer), "%s%s", drivers[i]->name, perGameOptions[j].name); |
| 563 | | |
| 564 | | memset(ent, 0, sizeof(*ent)); |
| 565 | | ent->name = pool_strdup(options_memory_pool, buffer); |
| 566 | | ent->defvalue = perGameOptions[j].defvalue; |
| 567 | | ent->flags = perGameOptions[j].flags; |
| 568 | | ent->description = perGameOptions[j].description; |
| 569 | | } |
| 570 | | } |
| 571 | | ent = &driver_per_game_options[driver_list_get_count(drivers) * game_option_count]; |
| 572 | | memset(ent, 0, sizeof(*ent)); |
| 573 | | options_add_entries(settings, driver_per_game_options); |
| 574 | | } |
| 575 | | |
| 576 | | // set up global options |
| 577 | | global = CreateGameOptions(OPTIONS_TYPE_GLOBAL); |
| 578 | | #if 0 |
| 579 | | // set up folders |
| 580 | | size_folder_filters = 1; |
| 581 | | num_folder_filters = 0; |
| 582 | | folder_filters = (folder_filter_type *) pool_malloc(options_memory_pool, size_folder_filters * sizeof(*folder_filters)); |
| 583 | | #endif |
| 584 | | // now load the options and settings |
| 585 | | LoadOptionsAndSettings(); |
| 586 | | |
| 587 | | return TRUE; |
| 588 | | |
| 589 | | } |
| 590 | | |
| 591 | | void OptionsExit(void) |
| 592 | | { |
| 593 | | // free global options |
| 594 | | options_free(global); |
| 595 | | global = NULL; |
| 596 | | |
| 597 | | // free settings |
| 598 | | options_free(settings); |
| 599 | | settings = NULL; |
| 600 | | |
| 601 | | // free the memory pool |
| 602 | | pool_free(options_memory_pool); |
| 603 | | options_memory_pool = NULL; |
| 604 | | } |
| 605 | | |
| 606 | | core_options * Mame32Settings(void) |
| 607 | | { |
| 608 | | return settings; |
| 609 | | } |
| 610 | | |
| 611 | | core_options * Mame32Global(void) |
| 612 | | { |
| 613 | | return global; |
| 614 | | } |
| 615 | | |
| 616 | | #if 0 |
| 617 | | static void LoadFolderFilter(int folder_index,int filters) |
| 618 | | { |
| 619 | | //dprintf("loaded folder filter %i %i",folder_index,filters); |
| 620 | | |
| 621 | | if (num_folder_filters == size_folder_filters) |
| 622 | | { |
| 623 | | size_folder_filters *= 2; |
| 624 | | folder_filters = (folder_filter_type *)realloc( |
| 625 | | folder_filters,size_folder_filters * sizeof(folder_filter_type)); |
| 626 | | } |
| 627 | | folder_filters[num_folder_filters].folder_index = folder_index; |
| 628 | | folder_filters[num_folder_filters].filters = filters; |
| 629 | | |
| 630 | | num_folder_filters++; |
| 631 | | } |
| 632 | | #endif |
| 633 | | |
| 634 | | // Restore ui settings to factory |
| 635 | | void ResetGUI(void) |
| 636 | | { |
| 637 | | ResetToDefaults(settings, OPTION_PRIORITY_NORMAL); |
| 638 | | // Save the new MAME32ui.ini |
| 639 | | SaveOptions(); |
| 640 | | save_gui_settings = FALSE; |
| 641 | | } |
| 642 | | |
| 643 | | const char * GetImageTabLongName(int tab_index) |
| 644 | | { |
| 645 | | assert(tab_index >= 0); |
| 646 | | assert(tab_index < ARRAY_LENGTH(image_tabs_long_name)); |
| 647 | | return image_tabs_long_name[tab_index]; |
| 648 | | } |
| 649 | | |
| 650 | | const char * GetImageTabShortName(int tab_index) |
| 651 | | { |
| 652 | | assert(tab_index >= 0); |
| 653 | | assert(tab_index < ARRAY_LENGTH(image_tabs_short_name)); |
| 654 | | return image_tabs_short_name[tab_index]; |
| 655 | | } |
| 656 | | |
| 657 | | //============================================================ |
| 658 | | // OPTIONS WRAPPERS |
| 659 | | //============================================================ |
| 660 | | |
| 661 | | static COLORREF options_get_color(core_options *opts, const char *name) |
| 662 | | { |
| 663 | | const char *value_str; |
| 664 | | unsigned int r, g, b; |
| 665 | | COLORREF value; |
| 666 | | |
| 667 | | value_str = options_get_string(opts, name); |
| 668 | | |
| 669 | | if (sscanf(value_str, "%u,%u,%u", &r, &g, &b) == 3) |
| 670 | | value = RGB(r,g,b); |
| 671 | | else |
| 672 | | value = (COLORREF) - 1; |
| 673 | | return value; |
| 674 | | } |
| 675 | | |
| 676 | | static void options_set_color(core_options *opts, const char *name, COLORREF value) |
| 677 | | { |
| 678 | | char value_str[32]; |
| 679 | | |
| 680 | | if (value == (COLORREF) -1) |
| 681 | | { |
| 682 | | snprintf(value_str, ARRAY_LENGTH(value_str), "%d", (int) value); |
| 683 | | } |
| 684 | | else |
| 685 | | { |
| 686 | | snprintf(value_str, ARRAY_LENGTH(value_str), "%d,%d,%d", |
| 687 | | (((int) value) >> 0) & 0xFF, |
| 688 | | (((int) value) >> 8) & 0xFF, |
| 689 | | (((int) value) >> 16) & 0xFF); |
| 690 | | } |
| 691 | | options_set_string(opts, name, value_str, OPTION_PRIORITY_CMDLINE); |
| 692 | | } |
| 693 | | |
| 694 | | static COLORREF options_get_color_default(core_options *opts, const char *name, int default_color) |
| 695 | | { |
| 696 | | COLORREF value = options_get_color(opts, name); |
| 697 | | if (value == (COLORREF) -1) |
| 698 | | value = GetSysColor(default_color); |
| 699 | | return value; |
| 700 | | } |
| 701 | | |
| 702 | | static void options_set_color_default(core_options *opts, const char *name, COLORREF value, int default_color) |
| 703 | | { |
| 704 | | if (value == GetSysColor(default_color)) |
| 705 | | options_set_color(settings, name, (COLORREF) -1); |
| 706 | | else |
| 707 | | options_set_color(settings, name, value); |
| 708 | | } |
| 709 | | |
| 710 | | static input_seq *options_get_input_seq(core_options *opts, const char *name) |
| 711 | | { |
| 712 | | static input_seq seq; |
| 713 | | const char *seq_string; |
| 714 | | |
| 715 | | seq_string = options_get_string(opts, name); |
| 716 | | input_seq_from_tokens(seq_string, &seq); |
| 717 | | return &seq; |
| 718 | | } |
| 719 | | |
| 720 | | |
| 721 | | |
| 722 | | //============================================================ |
| 723 | | // OPTIONS CALLS |
| 724 | | //============================================================ |
| 725 | | |
| 726 | | void SetViewMode(int val) |
| 727 | | { |
| 728 | | options_set_int(settings, M32OPTION_LIST_MODE, val, OPTION_PRIORITY_CMDLINE); |
| 729 | | } |
| 730 | | |
| 731 | | int GetViewMode(void) |
| 732 | | { |
| 733 | | return options_get_int(settings, M32OPTION_LIST_MODE); |
| 734 | | } |
| 735 | | |
| 736 | | void SetGameCheck(BOOL game_check) |
| 737 | | { |
| 738 | | options_set_bool(settings, M32OPTION_CHECK_GAME, game_check, OPTION_PRIORITY_CMDLINE); |
| 739 | | } |
| 740 | | |
| 741 | | BOOL GetGameCheck(void) |
| 742 | | { |
| 743 | | return options_get_bool(settings,M32OPTION_CHECK_GAME); |
| 744 | | } |
| 745 | | |
| 746 | | void SetJoyGUI(BOOL use_joygui) |
| 747 | | { |
| 748 | | options_set_bool(settings, M32OPTION_JOYSTICK_IN_INTERFACE, use_joygui, OPTION_PRIORITY_CMDLINE); |
| 749 | | } |
| 750 | | |
| 751 | | BOOL GetJoyGUI(void) |
| 752 | | { |
| 753 | | return options_get_bool(settings, M32OPTION_JOYSTICK_IN_INTERFACE); |
| 754 | | } |
| 755 | | |
| 756 | | void SetKeyGUI(BOOL use_keygui) |
| 757 | | { |
| 758 | | options_set_bool(settings, M32OPTION_KEYBOARD_IN_INTERFACE, use_keygui, OPTION_PRIORITY_CMDLINE); |
| 759 | | } |
| 760 | | |
| 761 | | BOOL GetKeyGUI(void) |
| 762 | | { |
| 763 | | return options_get_bool(settings, M32OPTION_KEYBOARD_IN_INTERFACE); |
| 764 | | } |
| 765 | | |
| 766 | | void SetCycleScreenshot(int cycle_screenshot) |
| 767 | | { |
| 768 | | options_set_int(settings, M32OPTION_CYCLE_SCREENSHOT, cycle_screenshot, OPTION_PRIORITY_CMDLINE); |
| 769 | | } |
| 770 | | |
| 771 | | int GetCycleScreenshot(void) |
| 772 | | { |
| 773 | | return options_get_int(settings, M32OPTION_CYCLE_SCREENSHOT); |
| 774 | | } |
| 775 | | |
| 776 | | void SetStretchScreenShotLarger(BOOL stretch) |
| 777 | | { |
| 778 | | options_set_bool(settings, M32OPTION_STRETCH_SCREENSHOT_LARGER, stretch, OPTION_PRIORITY_CMDLINE); |
| 779 | | } |
| 780 | | |
| 781 | | BOOL GetStretchScreenShotLarger(void) |
| 782 | | { |
| 783 | | return options_get_bool(settings, M32OPTION_STRETCH_SCREENSHOT_LARGER); |
| 784 | | } |
| 785 | | |
| 786 | | void SetScreenshotBorderSize(int size) |
| 787 | | { |
| 788 | | options_set_int(settings, M32OPTION_SCREENSHOT_BORDER_SIZE, size, OPTION_PRIORITY_CMDLINE); |
| 789 | | } |
| 790 | | |
| 791 | | int GetScreenshotBorderSize(void) |
| 792 | | { |
| 793 | | return options_get_int(settings, M32OPTION_SCREENSHOT_BORDER_SIZE); |
| 794 | | } |
| 795 | | |
| 796 | | void SetScreenshotBorderColor(COLORREF uColor) |
| 797 | | { |
| 798 | | options_set_color_default(settings, M32OPTION_SCREENSHOT_BORDER_COLOR, uColor, COLOR_3DFACE); |
| 799 | | } |
| 800 | | |
| 801 | | COLORREF GetScreenshotBorderColor(void) |
| 802 | | { |
| 803 | | return options_get_color_default(settings, M32OPTION_SCREENSHOT_BORDER_COLOR, COLOR_3DFACE); |
| 804 | | } |
| 805 | | |
| 806 | | void SetFilterInherit(BOOL inherit) |
| 807 | | { |
| 808 | | options_set_bool(settings, M32OPTION_INHERIT_FILTER, inherit, OPTION_PRIORITY_CMDLINE); |
| 809 | | } |
| 810 | | |
| 811 | | BOOL GetFilterInherit(void) |
| 812 | | { |
| 813 | | return options_get_bool(settings, M32OPTION_INHERIT_FILTER); |
| 814 | | } |
| 815 | | |
| 816 | | void SetOffsetClones(BOOL offset) |
| 817 | | { |
| 818 | | options_set_bool(settings, M32OPTION_OFFSET_CLONES, offset, OPTION_PRIORITY_CMDLINE); |
| 819 | | } |
| 820 | | |
| 821 | | BOOL GetOffsetClones(void) |
| 822 | | { |
| 823 | | return options_get_bool(settings, M32OPTION_OFFSET_CLONES); |
| 824 | | } |
| 825 | | |
| 826 | | void SetGameCaption(BOOL caption) |
| 827 | | { |
| 828 | | options_set_bool(settings, M32OPTION_GAME_CAPTION, caption, OPTION_PRIORITY_CMDLINE); |
| 829 | | } |
| 830 | | |
| 831 | | BOOL GetGameCaption(void) |
| 832 | | { |
| 833 | | return options_get_bool(settings, M32OPTION_GAME_CAPTION); |
| 834 | | } |
| 835 | | |
| 836 | | void SetBroadcast(BOOL broadcast) |
| 837 | | { |
| 838 | | options_set_bool(settings, M32OPTION_BROADCAST_GAME_NAME, broadcast, OPTION_PRIORITY_CMDLINE); |
| 839 | | } |
| 840 | | |
| 841 | | BOOL GetBroadcast(void) |
| 842 | | { |
| 843 | | return options_get_bool(settings, M32OPTION_BROADCAST_GAME_NAME); |
| 844 | | } |
| 845 | | |
| 846 | | void SetRandomBackground(BOOL random_bg) |
| 847 | | { |
| 848 | | options_set_bool(settings, M32OPTION_RANDOM_BACKGROUND, random_bg, OPTION_PRIORITY_CMDLINE); |
| 849 | | } |
| 850 | | |
| 851 | | BOOL GetRandomBackground(void) |
| 852 | | { |
| 853 | | return options_get_bool(settings, M32OPTION_RANDOM_BACKGROUND); |
| 854 | | } |
| 855 | | |
| 856 | | void SetSavedFolderID(UINT val) |
| 857 | | { |
| 858 | | options_set_int(settings, M32OPTION_DEFAULT_FOLDER_ID, (int) val, OPTION_PRIORITY_CMDLINE); |
| 859 | | } |
| 860 | | |
| 861 | | UINT GetSavedFolderID(void) |
| 862 | | { |
| 863 | | return (UINT) options_get_int(settings, M32OPTION_DEFAULT_FOLDER_ID); |
| 864 | | } |
| 865 | | |
| 866 | | void SetShowScreenShot(BOOL val) |
| 867 | | { |
| 868 | | options_set_bool(settings, M32OPTION_SHOW_IMAGE_SECTION, val, OPTION_PRIORITY_CMDLINE); |
| 869 | | } |
| 870 | | |
| 871 | | BOOL GetShowScreenShot(void) |
| 872 | | { |
| 873 | | return options_get_bool(settings, M32OPTION_SHOW_IMAGE_SECTION); |
| 874 | | } |
| 875 | | |
| 876 | | void SetShowFolderList(BOOL val) |
| 877 | | { |
| 878 | | options_set_bool(settings, M32OPTION_SHOW_FOLDER_SECTION, val, OPTION_PRIORITY_CMDLINE); |
| 879 | | } |
| 880 | | |
| 881 | | BOOL GetShowFolderList(void) |
| 882 | | { |
| 883 | | return options_get_bool(settings, M32OPTION_SHOW_FOLDER_SECTION); |
| 884 | | } |
| 885 | | |
| 886 | | static void GetsShowFolderFlags(LPBITS bits) |
| 887 | | { |
| 888 | | char s[2000]; |
| 889 | | extern FOLDERDATA g_folderData[]; |
| 890 | | char *token; |
| 891 | | |
| 892 | | snprintf(s, ARRAY_LENGTH(s), "%s", options_get_string(settings, M32OPTION_HIDE_FOLDERS)); |
| 893 | | |
| 894 | | SetAllBits(bits, TRUE); |
| 895 | | |
| 896 | | token = strtok(s,", \t"); |
| 897 | | while (token != NULL) |
| 898 | | { |
| 899 | | int j; |
| 900 | | |
| 901 | | for (j=0;g_folderData[j].m_lpTitle != NULL;j++) |
| 902 | | { |
| 903 | | if (strcmp(g_folderData[j].short_name,token) == 0) |
| 904 | | { |
| 905 | | ClearBit(bits, g_folderData[j].m_nFolderId); |
| 906 | | break; |
| 907 | | } |
| 908 | | } |
| 909 | | token = strtok(NULL,", \t"); |
| 910 | | } |
| 911 | | } |
| 912 | | |
| 913 | | BOOL GetShowFolder(int folder) |
| 914 | | { |
| 915 | | BOOL result; |
| 916 | | LPBITS show_folder_flags = NewBits(MAX_FOLDERS); |
| 917 | | GetsShowFolderFlags(show_folder_flags); |
| 918 | | result = TestBit(show_folder_flags, folder); |
| 919 | | DeleteBits(show_folder_flags); |
| 920 | | return result; |
| 921 | | } |
| 922 | | |
| 923 | | void SetShowFolder(int folder,BOOL show) |
| 924 | | { |
| 925 | | LPBITS show_folder_flags = NewBits(MAX_FOLDERS); |
| 926 | | int i; |
| 927 | | int num_saved = 0; |
| 928 | | char str[10000]; |
| 929 | | extern FOLDERDATA g_folderData[]; |
| 930 | | |
| 931 | | GetsShowFolderFlags(show_folder_flags); |
| 932 | | |
| 933 | | if (show) |
| 934 | | SetBit(show_folder_flags, folder); |
| 935 | | else |
| 936 | | ClearBit(show_folder_flags, folder); |
| 937 | | |
| 938 | | strcpy(str, ""); |
| 939 | | |
| 940 | | // we save the ones that are NOT displayed, so we can add new ones |
| 941 | | // and upgraders will see them |
| 942 | | for (i=0;i<MAX_FOLDERS;i++) |
| 943 | | { |
| 944 | | if (TestBit(show_folder_flags, i) == FALSE) |
| 945 | | { |
| 946 | | int j; |
| 947 | | |
| 948 | | if (num_saved != 0) |
| 949 | | strcat(str,", "); |
| 950 | | |
| 951 | | for (j=0;g_folderData[j].m_lpTitle != NULL;j++) |
| 952 | | { |
| 953 | | if (g_folderData[j].m_nFolderId == i) |
| 954 | | { |
| 955 | | strcat(str,g_folderData[j].short_name); |
| 956 | | num_saved++; |
| 957 | | break; |
| 958 | | } |
| 959 | | } |
| 960 | | } |
| 961 | | } |
| 962 | | options_set_string(settings, M32OPTION_HIDE_FOLDERS, str, OPTION_PRIORITY_CMDLINE); |
| 963 | | DeleteBits(show_folder_flags); |
| 964 | | } |
| 965 | | |
| 966 | | void SetShowStatusBar(BOOL val) |
| 967 | | { |
| 968 | | options_set_bool(settings, M32OPTION_SHOW_STATUS_BAR, val, OPTION_PRIORITY_CMDLINE); |
| 969 | | } |
| 970 | | |
| 971 | | BOOL GetShowStatusBar(void) |
| 972 | | { |
| 973 | | return options_get_bool(settings, M32OPTION_SHOW_STATUS_BAR); |
| 974 | | } |
| 975 | | |
| 976 | | void SetShowTabCtrl (BOOL val) |
| 977 | | { |
| 978 | | options_set_bool(settings, M32OPTION_SHOW_TABS, val, OPTION_PRIORITY_CMDLINE); |
| 979 | | } |
| 980 | | |
| 981 | | BOOL GetShowTabCtrl (void) |
| 982 | | { |
| 983 | | return options_get_bool(settings, M32OPTION_SHOW_TABS); |
| 984 | | } |
| 985 | | |
| 986 | | void SetShowToolBar(BOOL val) |
| 987 | | { |
| 988 | | options_set_bool(settings, M32OPTION_SHOW_TOOLBAR, val, OPTION_PRIORITY_CMDLINE); |
| 989 | | } |
| 990 | | |
| 991 | | BOOL GetShowToolBar(void) |
| 992 | | { |
| 993 | | return options_get_bool(settings, M32OPTION_SHOW_TOOLBAR); |
| 994 | | } |
| 995 | | |
| 996 | | void SetCurrentTab(const char *shortname) |
| 997 | | { |
| 998 | | options_set_string(settings, M32OPTION_CURRENT_TAB, shortname, OPTION_PRIORITY_CMDLINE); |
| 999 | | } |
| 1000 | | |
| 1001 | | const char *GetCurrentTab(void) |
| 1002 | | { |
| 1003 | | return options_get_string(settings, M32OPTION_CURRENT_TAB); |
| 1004 | | } |
| 1005 | | |
| 1006 | | void SetDefaultGame(const char *name) |
| 1007 | | { |
| 1008 | | options_set_string(settings, M32OPTION_DEFAULT_GAME, name, OPTION_PRIORITY_CMDLINE); |
| 1009 | | } |
| 1010 | | |
| 1011 | | const char *GetDefaultGame(void) |
| 1012 | | { |
| 1013 | | return options_get_string(settings, M32OPTION_DEFAULT_GAME); |
| 1014 | | } |
| 1015 | | |
| 1016 | | void SetWindowArea(const AREA *area) |
| 1017 | | { |
| 1018 | | options_set_int(settings, M32OPTION_WINDOW_X, area->x, OPTION_PRIORITY_CMDLINE); |
| 1019 | | options_set_int(settings, M32OPTION_WINDOW_Y, area->y, OPTION_PRIORITY_CMDLINE); |
| 1020 | | options_set_int(settings, M32OPTION_WINDOW_WIDTH, area->width, OPTION_PRIORITY_CMDLINE); |
| 1021 | | options_set_int(settings, M32OPTION_WINDOW_HEIGHT, area->height, OPTION_PRIORITY_CMDLINE); |
| 1022 | | } |
| 1023 | | |
| 1024 | | void GetWindowArea(AREA *area) |
| 1025 | | { |
| 1026 | | area->x = options_get_int(settings, M32OPTION_WINDOW_X); |
| 1027 | | area->y = options_get_int(settings, M32OPTION_WINDOW_Y); |
| 1028 | | area->width = options_get_int(settings, M32OPTION_WINDOW_WIDTH); |
| 1029 | | area->height = options_get_int(settings, M32OPTION_WINDOW_HEIGHT); |
| 1030 | | } |
| 1031 | | |
| 1032 | | void SetWindowState(UINT state) |
| 1033 | | { |
| 1034 | | options_set_int(settings, M32OPTION_WINDOW_STATE, state, OPTION_PRIORITY_CMDLINE); |
| 1035 | | } |
| 1036 | | |
| 1037 | | UINT GetWindowState(void) |
| 1038 | | { |
| 1039 | | return options_get_int(settings, M32OPTION_WINDOW_STATE); |
| 1040 | | } |
| 1041 | | |
| 1042 | | void SetCustomColor(int iIndex, COLORREF uColor) |
| 1043 | | { |
| 1044 | | const char *custom_color_string; |
| 1045 | | COLORREF custom_color[256]; |
| 1046 | | char buffer[10000]; |
| 1047 | | |
| 1048 | | custom_color_string = options_get_string(settings, M32OPTION_CUSTOM_COLOR); |
| 1049 | | CusColorDecodeString(custom_color_string, custom_color); |
| 1050 | | |
| 1051 | | custom_color[iIndex] = uColor; |
| 1052 | | |
| 1053 | | CusColorEncodeString(custom_color, buffer); |
| 1054 | | options_set_string(settings, M32OPTION_CUSTOM_COLOR, buffer, OPTION_PRIORITY_CMDLINE); |
| 1055 | | } |
| 1056 | | |
| 1057 | | COLORREF GetCustomColor(int iIndex) |
| 1058 | | { |
| 1059 | | const char *custom_color_string; |
| 1060 | | COLORREF custom_color[256]; |
| 1061 | | |
| 1062 | | custom_color_string = options_get_string(settings, M32OPTION_CUSTOM_COLOR); |
| 1063 | | CusColorDecodeString(custom_color_string, custom_color); |
| 1064 | | |
| 1065 | | if (custom_color[iIndex] == (COLORREF)-1) |
| 1066 | | return (COLORREF)RGB(0,0,0); |
| 1067 | | |
| 1068 | | return custom_color[iIndex]; |
| 1069 | | } |
| 1070 | | |
| 1071 | | void SetListFont(const LOGFONT *font) |
| 1072 | | { |
| 1073 | | char font_string[10000]; |
| 1074 | | FontEncodeString(font, font_string); |
| 1075 | | options_set_string(settings, M32OPTION_LIST_FONT, font_string, OPTION_PRIORITY_CMDLINE); |
| 1076 | | } |
| 1077 | | |
| 1078 | | void GetListFont(LOGFONT *font) |
| 1079 | | { |
| 1080 | | const char *font_string = options_get_string(settings, M32OPTION_LIST_FONT); |
| 1081 | | FontDecodeString(font_string, font); |
| 1082 | | } |
| 1083 | | |
| 1084 | | void SetListFontColor(COLORREF uColor) |
| 1085 | | { |
| 1086 | | options_set_color_default(settings, M32OPTION_TEXT_COLOR, uColor, COLOR_WINDOWTEXT); |
| 1087 | | } |
| 1088 | | |
| 1089 | | COLORREF GetListFontColor(void) |
| 1090 | | { |
| 1091 | | return options_get_color_default(settings, M32OPTION_TEXT_COLOR, COLOR_WINDOWTEXT); |
| 1092 | | } |
| 1093 | | |
| 1094 | | void SetListCloneColor(COLORREF uColor) |
| 1095 | | { |
| 1096 | | options_set_color_default(settings, M32OPTION_CLONE_COLOR, uColor, COLOR_WINDOWTEXT); |
| 1097 | | } |
| 1098 | | |
| 1099 | | COLORREF GetListCloneColor(void) |
| 1100 | | { |
| 1101 | | return options_get_color_default(settings, M32OPTION_CLONE_COLOR, COLOR_WINDOWTEXT); |
| 1102 | | } |
| 1103 | | |
| 1104 | | int GetShowTab(int tab) |
| 1105 | | { |
| 1106 | | const char *show_tabs_string; |
| 1107 | | int show_tab_flags; |
| 1108 | | |
| 1109 | | show_tabs_string = options_get_string(settings, M32OPTION_HIDE_TABS); |
| 1110 | | TabFlagsDecodeString(show_tabs_string, &show_tab_flags); |
| 1111 | | return (show_tab_flags & (1 << tab)) != 0; |
| 1112 | | } |
| 1113 | | |
| 1114 | | void SetShowTab(int tab,BOOL show) |
| 1115 | | { |
| 1116 | | const char *show_tabs_string; |
| 1117 | | int show_tab_flags; |
| 1118 | | char buffer[10000]; |
| 1119 | | |
| 1120 | | show_tabs_string = options_get_string(settings, M32OPTION_HIDE_TABS); |
| 1121 | | TabFlagsDecodeString(show_tabs_string, &show_tab_flags); |
| 1122 | | |
| 1123 | | if (show) |
| 1124 | | show_tab_flags |= 1 << tab; |
| 1125 | | else |
| 1126 | | show_tab_flags &= ~(1 << tab); |
| 1127 | | |
| 1128 | | TabFlagsEncodeString(show_tab_flags, buffer); |
| 1129 | | options_set_string(settings, M32OPTION_HIDE_TABS, buffer, OPTION_PRIORITY_CMDLINE); |
| 1130 | | } |
| 1131 | | |
| 1132 | | // don't delete the last one |
| 1133 | | BOOL AllowedToSetShowTab(int tab,BOOL show) |
| 1134 | | { |
| 1135 | | const char *show_tabs_string; |
| 1136 | | int show_tab_flags; |
| 1137 | | |
| 1138 | | if (show == TRUE) |
| 1139 | | return TRUE; |
| 1140 | | |
| 1141 | | show_tabs_string = options_get_string(settings, M32OPTION_HIDE_TABS); |
| 1142 | | TabFlagsDecodeString(show_tabs_string, &show_tab_flags); |
| 1143 | | |
| 1144 | | show_tab_flags &= ~(1 << tab); |
| 1145 | | return show_tab_flags != 0; |
| 1146 | | } |
| 1147 | | |
| 1148 | | int GetHistoryTab(void) |
| 1149 | | { |
| 1150 | | return options_get_int(settings, M32OPTION_HISTORY_TAB); |
| 1151 | | } |
| 1152 | | |
| 1153 | | void SetHistoryTab(int tab, BOOL show) |
| 1154 | | { |
| 1155 | | if (show) |
| 1156 | | options_set_int(settings, M32OPTION_HISTORY_TAB, tab, OPTION_PRIORITY_CMDLINE); |
| 1157 | | else |
| 1158 | | options_set_int(settings, M32OPTION_HISTORY_TAB, TAB_NONE, OPTION_PRIORITY_CMDLINE); |
| 1159 | | } |
| 1160 | | |
| 1161 | | void SetColumnWidths(int width[]) |
| 1162 | | { |
| 1163 | | char column_width_string[10000]; |
| 1164 | | ColumnEncodeStringWithCount(width, column_width_string, COLUMN_MAX); |
| 1165 | | options_set_string(settings, M32OPTION_COLUMN_WIDTHS, column_width_string, OPTION_PRIORITY_CMDLINE); |
| 1166 | | } |
| 1167 | | |
| 1168 | | void GetColumnWidths(int width[]) |
| 1169 | | { |
| 1170 | | const char *column_width_string; |
| 1171 | | column_width_string = options_get_string(settings, M32OPTION_COLUMN_WIDTHS); |
| 1172 | | ColumnDecodeStringWithCount(column_width_string, width, COLUMN_MAX); |
| 1173 | | } |
| 1174 | | |
| 1175 | | void SetSplitterPos(int splitterId, int pos) |
| 1176 | | { |
| 1177 | | const char *splitter_string; |
| 1178 | | int *splitter; |
| 1179 | | char buffer[10000]; |
| 1180 | | |
| 1181 | | if (splitterId < GetSplitterCount()) |
| 1182 | | { |
| 1183 | | splitter_string = options_get_string(settings, M32OPTION_SPLITTERS); |
| 1184 | | splitter = (int *) alloca(GetSplitterCount() * sizeof(*splitter)); |
| 1185 | | SplitterDecodeString(splitter_string, splitter); |
| 1186 | | |
| 1187 | | splitter[splitterId] = pos; |
| 1188 | | |
| 1189 | | SplitterEncodeString(splitter, buffer); |
| 1190 | | options_set_string(settings, M32OPTION_SPLITTERS, buffer, OPTION_PRIORITY_CMDLINE); |
| 1191 | | } |
| 1192 | | } |
| 1193 | | |
| 1194 | | int GetSplitterPos(int splitterId) |
| 1195 | | { |
| 1196 | | const char *splitter_string; |
| 1197 | | int *splitter; |
| 1198 | | |
| 1199 | | splitter_string = options_get_string(settings, M32OPTION_SPLITTERS); |
| 1200 | | splitter = (int *) alloca(GetSplitterCount() * sizeof(*splitter)); |
| 1201 | | SplitterDecodeString(splitter_string, splitter); |
| 1202 | | |
| 1203 | | if (splitterId < GetSplitterCount()) |
| 1204 | | return splitter[splitterId]; |
| 1205 | | |
| 1206 | | return -1; /* Error */ |
| 1207 | | } |
| 1208 | | |
| 1209 | | void SetColumnOrder(int order[]) |
| 1210 | | { |
| 1211 | | char column_order_string[10000]; |
| 1212 | | ColumnEncodeStringWithCount(order, column_order_string, COLUMN_MAX); |
| 1213 | | options_set_string(settings, M32OPTION_COLUMN_ORDER, column_order_string, OPTION_PRIORITY_CMDLINE); |
| 1214 | | } |
| 1215 | | |
| 1216 | | void GetColumnOrder(int order[]) |
| 1217 | | { |
| 1218 | | const char *column_order_string; |
| 1219 | | column_order_string = options_get_string(settings, M32OPTION_COLUMN_ORDER); |
| 1220 | | ColumnDecodeStringWithCount(column_order_string, order, COLUMN_MAX); |
| 1221 | | } |
| 1222 | | |
| 1223 | | void SetColumnShown(int shown[]) |
| 1224 | | { |
| 1225 | | char column_shown_string[10000]; |
| 1226 | | ColumnEncodeStringWithCount(shown, column_shown_string, COLUMN_MAX); |
| 1227 | | options_set_string(settings, M32OPTION_COLUMN_SHOWN, column_shown_string, OPTION_PRIORITY_CMDLINE); |
| 1228 | | } |
| 1229 | | |
| 1230 | | void GetColumnShown(int shown[]) |
| 1231 | | { |
| 1232 | | const char *column_shown_string; |
| 1233 | | column_shown_string = options_get_string(settings, M32OPTION_COLUMN_SHOWN); |
| 1234 | | ColumnDecodeStringWithCount(column_shown_string, shown, COLUMN_MAX); |
| 1235 | | } |
| 1236 | | |
| 1237 | | void SetSortColumn(int column) |
| 1238 | | { |
| 1239 | | options_set_int(settings, M32OPTION_SORT_COLUMN, column, OPTION_PRIORITY_CMDLINE); |
| 1240 | | } |
| 1241 | | |
| 1242 | | int GetSortColumn(void) |
| 1243 | | { |
| 1244 | | return options_get_int(settings, M32OPTION_SORT_COLUMN); |
| 1245 | | } |
| 1246 | | |
| 1247 | | void SetSortReverse(BOOL reverse) |
| 1248 | | { |
| 1249 | | options_set_bool(settings, M32OPTION_SORT_REVERSED, reverse, OPTION_PRIORITY_CMDLINE); |
| 1250 | | } |
| 1251 | | |
| 1252 | | BOOL GetSortReverse(void) |
| 1253 | | { |
| 1254 | | return options_get_bool(settings, M32OPTION_SORT_REVERSED); |
| 1255 | | } |
| 1256 | | |
| 1257 | | const char* GetLanguage(void) |
| 1258 | | { |
| 1259 | | return options_get_string(settings, M32OPTION_LANGUAGE); |
| 1260 | | } |
| 1261 | | |
| 1262 | | void SetLanguage(const char* lang) |
| 1263 | | { |
| 1264 | | options_set_string(settings, M32OPTION_LANGUAGE, lang, OPTION_PRIORITY_CMDLINE); |
| 1265 | | } |
| 1266 | | |
| 1267 | | const char* GetRomDirs(void) |
| 1268 | | { |
| 1269 | | return options_get_string(global, OPTION_ROMPATH); |
| 1270 | | } |
| 1271 | | |
| 1272 | | void SetRomDirs(const char* paths) |
| 1273 | | { |
| 1274 | | options_set_string(global, OPTION_ROMPATH, paths, OPTION_PRIORITY_CMDLINE); |
| 1275 | | } |
| 1276 | | |
| 1277 | | const char* GetSampleDirs(void) |
| 1278 | | { |
| 1279 | | return options_get_string(global, OPTION_SAMPLEPATH); |
| 1280 | | } |
| 1281 | | |
| 1282 | | void SetSampleDirs(const char* paths) |
| 1283 | | { |
| 1284 | | options_set_string(global, OPTION_SAMPLEPATH, paths, OPTION_PRIORITY_CMDLINE); |
| 1285 | | } |
| 1286 | | |
| 1287 | | const char * GetIniDir(void) |
| 1288 | | { |
| 1289 | | const char *ini_dir; |
| 1290 | | const char *s; |
| 1291 | | |
| 1292 | | ini_dir = options_get_string(global, OPTION_INIPATH); |
| 1293 | | while((s = strchr(ini_dir, ';')) != NULL) |
| 1294 | | { |
| 1295 | | ini_dir = s + 1; |
| 1296 | | } |
| 1297 | | return ini_dir; |
| 1298 | | |
| 1299 | | } |
| 1300 | | |
| 1301 | | void SetIniDir(const char *path) |
| 1302 | | { |
| 1303 | | options_set_string(global, OPTION_INIPATH, path, OPTION_PRIORITY_CMDLINE); |
| 1304 | | } |
| 1305 | | |
| 1306 | | const char* GetCtrlrDir(void) |
| 1307 | | { |
| 1308 | | return options_get_string(global, OPTION_CTRLRPATH); |
| 1309 | | } |
| 1310 | | |
| 1311 | | void SetCtrlrDir(const char* path) |
| 1312 | | { |
| 1313 | | options_set_string(global, OPTION_CTRLRPATH, path, OPTION_PRIORITY_CMDLINE); |
| 1314 | | } |
| 1315 | | |
| 1316 | | const char* GetCommentDir(void) |
| 1317 | | { |
| 1318 | | return options_get_string(global, OPTION_COMMENT_DIRECTORY); |
| 1319 | | } |
| 1320 | | |
| 1321 | | void SetCommentDir(const char* path) |
| 1322 | | { |
| 1323 | | options_set_string(global, OPTION_COMMENT_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1324 | | } |
| 1325 | | |
| 1326 | | const char* GetCfgDir(void) |
| 1327 | | { |
| 1328 | | return options_get_string(global, OPTION_CFG_DIRECTORY); |
| 1329 | | } |
| 1330 | | |
| 1331 | | void SetCfgDir(const char* path) |
| 1332 | | { |
| 1333 | | options_set_string(global, OPTION_CFG_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1334 | | } |
| 1335 | | |
| 1336 | | const char* GetNvramDir(void) |
| 1337 | | { |
| 1338 | | return options_get_string(global, OPTION_NVRAM_DIRECTORY); |
| 1339 | | } |
| 1340 | | |
| 1341 | | void SetNvramDir(const char* path) |
| 1342 | | { |
| 1343 | | options_set_string(global, OPTION_NVRAM_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1344 | | } |
| 1345 | | |
| 1346 | | const char* GetInpDir(void) |
| 1347 | | { |
| 1348 | | return options_get_string(global, OPTION_INPUT_DIRECTORY); |
| 1349 | | } |
| 1350 | | |
| 1351 | | void SetInpDir(const char* path) |
| 1352 | | { |
| 1353 | | options_set_string(global, OPTION_INPUT_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1354 | | } |
| 1355 | | |
| 1356 | | const char* GetImgDir(void) |
| 1357 | | { |
| 1358 | | return options_get_string(global, OPTION_SNAPSHOT_DIRECTORY); |
| 1359 | | } |
| 1360 | | |
| 1361 | | void SetImgDir(const char* path) |
| 1362 | | { |
| 1363 | | options_set_string(global, OPTION_SNAPSHOT_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1364 | | } |
| 1365 | | |
| 1366 | | const char* GetStateDir(void) |
| 1367 | | { |
| 1368 | | return options_get_string(global, OPTION_STATE_DIRECTORY); |
| 1369 | | } |
| 1370 | | |
| 1371 | | void SetStateDir(const char* path) |
| 1372 | | { |
| 1373 | | options_set_string(global, OPTION_STATE_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1374 | | } |
| 1375 | | |
| 1376 | | const char* GetArtDir(void) |
| 1377 | | { |
| 1378 | | return options_get_string(global, OPTION_ARTPATH); |
| 1379 | | } |
| 1380 | | |
| 1381 | | void SetArtDir(const char* path) |
| 1382 | | { |
| 1383 | | options_set_string(global, OPTION_ARTPATH, path, OPTION_PRIORITY_CMDLINE); |
| 1384 | | } |
| 1385 | | |
| 1386 | | const char* GetMemcardDir(void) |
| 1387 | | { |
| 1388 | | return options_get_string(global, OPTION_MEMCARD_DIRECTORY); |
| 1389 | | } |
| 1390 | | |
| 1391 | | void SetMemcardDir(const char* path) |
| 1392 | | { |
| 1393 | | options_set_string(global, OPTION_MEMCARD_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1394 | | } |
| 1395 | | |
| 1396 | | const char* GetFlyerDir(void) |
| 1397 | | { |
| 1398 | | return options_get_string(settings, M32OPTION_FLYER_DIRECTORY); |
| 1399 | | } |
| 1400 | | |
| 1401 | | void SetFlyerDir(const char* path) |
| 1402 | | { |
| 1403 | | options_set_string(settings, M32OPTION_FLYER_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1404 | | } |
| 1405 | | |
| 1406 | | const char* GetCabinetDir(void) |
| 1407 | | { |
| 1408 | | return options_get_string(settings, M32OPTION_CABINET_DIRECTORY); |
| 1409 | | } |
| 1410 | | |
| 1411 | | void SetCabinetDir(const char* path) |
| 1412 | | { |
| 1413 | | options_set_string(settings, M32OPTION_CABINET_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1414 | | } |
| 1415 | | |
| 1416 | | const char* GetMarqueeDir(void) |
| 1417 | | { |
| 1418 | | return options_get_string(settings, M32OPTION_MARQUEE_DIRECTORY); |
| 1419 | | } |
| 1420 | | |
| 1421 | | void SetMarqueeDir(const char* path) |
| 1422 | | { |
| 1423 | | options_set_string(settings, M32OPTION_MARQUEE_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1424 | | } |
| 1425 | | |
| 1426 | | const char* GetTitlesDir(void) |
| 1427 | | { |
| 1428 | | return options_get_string(settings, M32OPTION_TITLE_DIRECTORY); |
| 1429 | | } |
| 1430 | | |
| 1431 | | void SetTitlesDir(const char* path) |
| 1432 | | { |
| 1433 | | options_set_string(settings, M32OPTION_TITLE_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1434 | | } |
| 1435 | | |
| 1436 | | const char * GetControlPanelDir(void) |
| 1437 | | { |
| 1438 | | return options_get_string(settings, M32OPTION_CPANEL_DIRECTORY); |
| 1439 | | } |
| 1440 | | |
| 1441 | | void SetControlPanelDir(const char *path) |
| 1442 | | { |
| 1443 | | options_set_string(settings, M32OPTION_CPANEL_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1444 | | } |
| 1445 | | |
| 1446 | | const char * GetPcbDir(void) |
| 1447 | | { |
| 1448 | | return options_get_string(settings, M32OPTION_PCB_DIRECTORY); |
| 1449 | | } |
| 1450 | | |
| 1451 | | void SetPcbDir(const char *path) |
| 1452 | | { |
| 1453 | | options_set_string(settings, M32OPTION_PCB_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1454 | | } |
| 1455 | | |
| 1456 | | const char * GetDiffDir(void) |
| 1457 | | { |
| 1458 | | return options_get_string(global, OPTION_DIFF_DIRECTORY); |
| 1459 | | } |
| 1460 | | |
| 1461 | | void SetDiffDir(const char* path) |
| 1462 | | { |
| 1463 | | options_set_string(global, OPTION_DIFF_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1464 | | } |
| 1465 | | |
| 1466 | | const char* GetIconsDir(void) |
| 1467 | | { |
| 1468 | | return options_get_string(settings, M32OPTION_ICONS_DIRECTORY); |
| 1469 | | } |
| 1470 | | |
| 1471 | | void SetIconsDir(const char* path) |
| 1472 | | { |
| 1473 | | options_set_string(settings, M32OPTION_ICONS_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1474 | | } |
| 1475 | | |
| 1476 | | const char* GetBgDir (void) |
| 1477 | | { |
| 1478 | | return options_get_string(settings, M32OPTION_BACKGROUND_DIRECTORY); |
| 1479 | | } |
| 1480 | | |
| 1481 | | void SetBgDir (const char* path) |
| 1482 | | { |
| 1483 | | options_set_string(settings, M32OPTION_BACKGROUND_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1484 | | } |
| 1485 | | |
| 1486 | | const char* GetFolderDir(void) |
| 1487 | | { |
| 1488 | | return options_get_string(settings, M32OPTION_FOLDER_DIRECTORY); |
| 1489 | | } |
| 1490 | | |
| 1491 | | void SetFolderDir(const char* path) |
| 1492 | | { |
| 1493 | | options_set_string(settings, M32OPTION_FOLDER_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1494 | | } |
| 1495 | | |
| 1496 | | const char* GetCheatFileName(void) |
| 1497 | | { |
| 1498 | | return options_get_string(global, OPTION_CHEAT_FILE); |
| 1499 | | } |
| 1500 | | |
| 1501 | | void SetCheatFileName(const char* path) |
| 1502 | | { |
| 1503 | | options_set_string(global, OPTION_CHEAT_FILE, path, OPTION_PRIORITY_CMDLINE); |
| 1504 | | } |
| 1505 | | |
| 1506 | | const char* GetHistoryFileName(void) |
| 1507 | | { |
| 1508 | | return options_get_string(settings, M32OPTION_HISTORY_FILE); |
| 1509 | | } |
| 1510 | | |
| 1511 | | void SetHistoryFileName(const char* path) |
| 1512 | | { |
| 1513 | | options_set_string(settings, M32OPTION_HISTORY_FILE, path, OPTION_PRIORITY_CMDLINE); |
| 1514 | | } |
| 1515 | | |
| 1516 | | |
| 1517 | | const char* GetMAMEInfoFileName(void) |
| 1518 | | { |
| 1519 | | return options_get_string(settings, M32OPTION_MAMEINFO_FILE); |
| 1520 | | } |
| 1521 | | |
| 1522 | | void SetMAMEInfoFileName(const char* path) |
| 1523 | | { |
| 1524 | | options_set_string(settings, M32OPTION_MAMEINFO_FILE, path, OPTION_PRIORITY_CMDLINE); |
| 1525 | | } |
| 1526 | | |
| 1527 | | void ResetGameOptions(int driver_index) |
| 1528 | | { |
| 1529 | | assert(0 <= driver_index && driver_index < driver_list_get_count(drivers)); |
| 1530 | | |
| 1531 | | save_options(OPTIONS_GAME, NULL, driver_index); |
| 1532 | | } |
| 1533 | | |
| 1534 | | void ResetGameDefaults(void) |
| 1535 | | { |
| 1536 | | // Walk the global settings and reset everything to defaults; |
| 1537 | | ResetToDefaults(global, OPTION_PRIORITY_CMDLINE); |
| 1538 | | save_options(OPTIONS_GLOBAL, global, 1); |
| 1539 | | save_default_options = FALSE; |
| 1540 | | } |
| 1541 | | |
| 1542 | | /* |
| 1543 | | * Reset all game, vector and source options to defaults. |
| 1544 | | * No reason to reboot if this is done. |
| 1545 | | */ |
| 1546 | | void ResetAllGameOptions(void) |
| 1547 | | { |
| 1548 | | int i; |
| 1549 | | |
| 1550 | | for (i = 0; i < driver_list_get_count(drivers); i++) |
| 1551 | | { |
| 1552 | | ResetGameOptions(i); |
| 1553 | | } |
| 1554 | | |
| 1555 | | /* Walk the ini/source folder deleting all ini's. */ |
| 1556 | | remove_all_source_options(); |
| 1557 | | |
| 1558 | | /* finally vector.ini */ |
| 1559 | | save_options(OPTIONS_VECTOR, NULL, 0); |
| 1560 | | } |
| 1561 | | |
| 1562 | | static void GetDriverOptionName(int driver_index, const char *option_name, char *buffer, size_t buffer_len) |
| 1563 | | { |
| 1564 | | assert(0 <= driver_index && driver_index < driver_list_get_count(drivers)); |
| 1565 | | snprintf(buffer, buffer_len, "%s_%s", drivers[driver_index]->name, option_name); |
| 1566 | | } |
| 1567 | | |
| 1568 | | int GetRomAuditResults(int driver_index) |
| 1569 | | { |
| 1570 | | char buffer[128]; |
| 1571 | | GetDriverOptionName(driver_index, "rom_audit", buffer, ARRAY_LENGTH(buffer)); |
| 1572 | | return options_get_int(settings, buffer); |
| 1573 | | } |
| 1574 | | |
| 1575 | | void SetRomAuditResults(int driver_index, int audit_results) |
| 1576 | | { |
| 1577 | | char buffer[128]; |
| 1578 | | GetDriverOptionName(driver_index, "rom_audit", buffer, ARRAY_LENGTH(buffer)); |
| 1579 | | options_set_int(settings, buffer, audit_results, OPTION_PRIORITY_CMDLINE); |
| 1580 | | } |
| 1581 | | |
| 1582 | | int GetSampleAuditResults(int driver_index) |
| 1583 | | { |
| 1584 | | char buffer[128]; |
| 1585 | | GetDriverOptionName(driver_index, "samples_audit", buffer, ARRAY_LENGTH(buffer)); |
| 1586 | | return options_get_int(settings, buffer); |
| 1587 | | } |
| 1588 | | |
| 1589 | | void SetSampleAuditResults(int driver_index, int audit_results) |
| 1590 | | { |
| 1591 | | char buffer[128]; |
| 1592 | | GetDriverOptionName(driver_index, "samples_audit", buffer, ARRAY_LENGTH(buffer)); |
| 1593 | | options_set_int(settings, buffer, audit_results, OPTION_PRIORITY_CMDLINE); |
| 1594 | | } |
| 1595 | | |
| 1596 | | static void IncrementPlayVariable(int driver_index, const char *play_variable, int increment) |
| 1597 | | { |
| 1598 | | char buffer[128]; |
| 1599 | | int count; |
| 1600 | | |
| 1601 | | GetDriverOptionName(driver_index, play_variable, buffer, ARRAY_LENGTH(buffer)); |
| 1602 | | count = options_get_int(settings, buffer); |
| 1603 | | options_set_int(settings, buffer, count + increment, OPTION_PRIORITY_CMDLINE); |
| 1604 | | } |
| 1605 | | |
| 1606 | | void IncrementPlayCount(int driver_index) |
| 1607 | | { |
| 1608 | | IncrementPlayVariable(driver_index, "play_count", 1); |
| 1609 | | } |
| 1610 | | |
| 1611 | | int GetPlayCount(int driver_index) |
| 1612 | | { |
| 1613 | | char buffer[128]; |
| 1614 | | GetDriverOptionName(driver_index, "play_count", buffer, ARRAY_LENGTH(buffer)); |
| 1615 | | return options_get_int(settings, buffer); |
| 1616 | | } |
| 1617 | | |
| 1618 | | static void ResetPlayVariable(int driver_index, const char *play_variable) |
| 1619 | | { |
| 1620 | | int i; |
| 1621 | | if (driver_index < 0) |
| 1622 | | { |
| 1623 | | /* all games */ |
| 1624 | | for (i = 0; i< driver_list_get_count(drivers); i++) |
| 1625 | | { |
| 1626 | | /* 20070808 MSH - Was passing in driver_index instead of i. Doh! */ |
| 1627 | | ResetPlayVariable(i, play_variable); |
| 1628 | | } |
| 1629 | | } |
| 1630 | | else |
| 1631 | | { |
| 1632 | | char buffer[128]; |
| 1633 | | GetDriverOptionName(driver_index, play_variable, buffer, ARRAY_LENGTH(buffer)); |
| 1634 | | options_set_int(settings, buffer, 0, OPTION_PRIORITY_CMDLINE); |
| 1635 | | } |
| 1636 | | } |
| 1637 | | |
| 1638 | | void ResetPlayCount(int driver_index) |
| 1639 | | { |
| 1640 | | ResetPlayVariable(driver_index, "play_count"); |
| 1641 | | } |
| 1642 | | |
| 1643 | | void ResetPlayTime(int driver_index) |
| 1644 | | { |
| 1645 | | ResetPlayVariable(driver_index, "play_time"); |
| 1646 | | } |
| 1647 | | |
| 1648 | | int GetPlayTime(int driver_index) |
| 1649 | | { |
| 1650 | | char buffer[128]; |
| 1651 | | GetDriverOptionName(driver_index, "play_time", buffer, ARRAY_LENGTH(buffer)); |
| 1652 | | return options_get_int(settings, buffer); |
| 1653 | | } |
| 1654 | | |
| 1655 | | void IncrementPlayTime(int driver_index,int playtime) |
| 1656 | | { |
| 1657 | | IncrementPlayVariable(driver_index, "play_time", playtime); |
| 1658 | | } |
| 1659 | | |
| 1660 | | void GetTextPlayTime(int driver_index,char *buf) |
| 1661 | | { |
| 1662 | | int hour, minute, second; |
| 1663 | | int temp = GetPlayTime(driver_index); |
| 1664 | | |
| 1665 | | assert(0 <= driver_index && driver_index < driver_list_get_count(drivers)); |
| 1666 | | |
| 1667 | | hour = temp / 3600; |
| 1668 | | temp = temp - 3600*hour; |
| 1669 | | minute = temp / 60; //Calc Minutes |
| 1670 | | second = temp - 60*minute; |
| 1671 | | |
| 1672 | | if (hour == 0) |
| 1673 | | sprintf(buf, "%d:%02d", minute, second ); |
| 1674 | | else |
| 1675 | | sprintf(buf, "%d:%02d:%02d", hour, minute, second ); |
| 1676 | | } |
| 1677 | | |
| 1678 | | input_seq* Get_ui_key_up(void) |
| 1679 | | { |
| 1680 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_UP); |
| 1681 | | } |
| 1682 | | input_seq* Get_ui_key_down(void) |
| 1683 | | { |
| 1684 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_DOWN); |
| 1685 | | } |
| 1686 | | input_seq* Get_ui_key_left(void) |
| 1687 | | { |
| 1688 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_LEFT); |
| 1689 | | } |
| 1690 | | input_seq* Get_ui_key_right(void) |
| 1691 | | { |
| 1692 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_RIGHT); |
| 1693 | | } |
| 1694 | | input_seq* Get_ui_key_start(void) |
| 1695 | | { |
| 1696 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_START); |
| 1697 | | } |
| 1698 | | input_seq* Get_ui_key_pgup(void) |
| 1699 | | { |
| 1700 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_PGUP); |
| 1701 | | } |
| 1702 | | input_seq* Get_ui_key_pgdwn(void) |
| 1703 | | { |
| 1704 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_PGDWN); |
| 1705 | | } |
| 1706 | | input_seq* Get_ui_key_home(void) |
| 1707 | | { |
| 1708 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_HOME); |
| 1709 | | } |
| 1710 | | input_seq* Get_ui_key_end(void) |
| 1711 | | { |
| 1712 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_END); |
| 1713 | | } |
| 1714 | | input_seq* Get_ui_key_ss_change(void) |
| 1715 | | { |
| 1716 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_SS_CHANGE); |
| 1717 | | } |
| 1718 | | input_seq* Get_ui_key_history_up(void) |
| 1719 | | { |
| 1720 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_HISTORY_UP); |
| 1721 | | } |
| 1722 | | input_seq* Get_ui_key_history_down(void) |
| 1723 | | { |
| 1724 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_HISTORY_DOWN); |
| 1725 | | } |
| 1726 | | |
| 1727 | | |
| 1728 | | input_seq* Get_ui_key_context_filters(void) |
| 1729 | | { |
| 1730 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_CONTEXT_FILTERS); |
| 1731 | | } |
| 1732 | | input_seq* Get_ui_key_select_random(void) |
| 1733 | | { |
| 1734 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_SELECT_RANDOM); |
| 1735 | | } |
| 1736 | | input_seq* Get_ui_key_game_audit(void) |
| 1737 | | { |
| 1738 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_GAME_AUDIT); |
| 1739 | | } |
| 1740 | | input_seq* Get_ui_key_game_properties(void) |
| 1741 | | { |
| 1742 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_GAME_PROPERTIES); |
| 1743 | | } |
| 1744 | | input_seq* Get_ui_key_help_contents(void) |
| 1745 | | { |
| 1746 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_HELP_CONTENTS); |
| 1747 | | } |
| 1748 | | input_seq* Get_ui_key_update_gamelist(void) |
| 1749 | | { |
| 1750 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_UPDATE_GAMELIST); |
| 1751 | | } |
| 1752 | | input_seq* Get_ui_key_view_folders(void) |
| 1753 | | { |
| 1754 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_FOLDERS); |
| 1755 | | } |
| 1756 | | input_seq* Get_ui_key_view_fullscreen(void) |
| 1757 | | { |
| 1758 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_FULLSCREEN); |
| 1759 | | } |
| 1760 | | input_seq* Get_ui_key_view_pagetab(void) |
| 1761 | | { |
| 1762 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_PAGETAB); |
| 1763 | | } |
| 1764 | | input_seq* Get_ui_key_view_picture_area(void) |
| 1765 | | { |
| 1766 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_PICTURE_AREA); |
| 1767 | | } |
| 1768 | | input_seq* Get_ui_key_view_status(void) |
| 1769 | | { |
| 1770 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_STATUS); |
| 1771 | | } |
| 1772 | | input_seq* Get_ui_key_view_toolbars(void) |
| 1773 | | { |
| 1774 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TOOLBARS); |
| 1775 | | } |
| 1776 | | |
| 1777 | | input_seq* Get_ui_key_view_tab_cabinet(void) |
| 1778 | | { |
| 1779 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TAB_CABINET); |
| 1780 | | } |
| 1781 | | input_seq* Get_ui_key_view_tab_cpanel(void) |
| 1782 | | { |
| 1783 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TAB_CPANEL); |
| 1784 | | } |
| 1785 | | input_seq* Get_ui_key_view_tab_flyer(void) |
| 1786 | | { |
| 1787 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TAB_FLYER); |
| 1788 | | } |
| 1789 | | input_seq* Get_ui_key_view_tab_history(void) |
| 1790 | | { |
| 1791 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TAB_HISTORY); |
| 1792 | | } |
| 1793 | | input_seq* Get_ui_key_view_tab_marquee(void) |
| 1794 | | { |
| 1795 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TAB_MARQUEE); |
| 1796 | | } |
| 1797 | | input_seq* Get_ui_key_view_tab_screenshot(void) |
| 1798 | | { |
| 1799 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TAB_SCREENSHOT); |
| 1800 | | } |
| 1801 | | input_seq* Get_ui_key_view_tab_title(void) |
| 1802 | | { |
| 1803 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TAB_TITLE); |
| 1804 | | } |
| 1805 | | input_seq* Get_ui_key_view_tab_pcb(void) |
| 1806 | | { |
| 1807 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_VIEW_TAB_PCB); |
| 1808 | | } |
| 1809 | | input_seq* Get_ui_key_quit(void) |
| 1810 | | { |
| 1811 | | return options_get_input_seq(settings, M32OPTION_UI_KEY_QUIT); |
| 1812 | | } |
| 1813 | | |
| 1814 | | |
| 1815 | | |
| 1816 | | static int GetUIJoy(const char *option_name, int joycodeIndex) |
| 1817 | | { |
| 1818 | | const char *joycodes_string; |
| 1819 | | int joycodes[4]; |
| 1820 | | |
| 1821 | | assert(0 <= joycodeIndex && joycodeIndex < 4); |
| 1822 | | joycodes_string = options_get_string(settings, option_name); |
| 1823 | | ColumnDecodeStringWithCount(joycodes_string, joycodes, ARRAY_LENGTH(joycodes)); |
| 1824 | | return joycodes[joycodeIndex]; |
| 1825 | | } |
| 1826 | | |
| 1827 | | static void SetUIJoy(const char *option_name, int joycodeIndex, int val) |
| 1828 | | { |
| 1829 | | const char *joycodes_string; |
| 1830 | | int joycodes[4]; |
| 1831 | | char buffer[1024]; |
| 1832 | | |
| 1833 | | assert(0 <= joycodeIndex && joycodeIndex < 4); |
| 1834 | | joycodes_string = options_get_string(settings, option_name); |
| 1835 | | ColumnDecodeStringWithCount(joycodes_string, joycodes, ARRAY_LENGTH(joycodes)); |
| 1836 | | |
| 1837 | | joycodes[joycodeIndex] = val; |
| 1838 | | ColumnEncodeStringWithCount(joycodes, buffer, ARRAY_LENGTH(joycodes)); |
| 1839 | | options_set_string(settings, option_name, buffer, OPTION_PRIORITY_CMDLINE); |
| 1840 | | |
| 1841 | | |
| 1842 | | } |
| 1843 | | |
| 1844 | | int GetUIJoyUp(int joycodeIndex) |
| 1845 | | { |
| 1846 | | return GetUIJoy(M32OPTION_UI_JOY_UP, joycodeIndex); |
| 1847 | | } |
| 1848 | | |
| 1849 | | void SetUIJoyUp(int joycodeIndex, int val) |
| 1850 | | { |
| 1851 | | SetUIJoy(M32OPTION_UI_JOY_UP, joycodeIndex, val); |
| 1852 | | } |
| 1853 | | |
| 1854 | | int GetUIJoyDown(int joycodeIndex) |
| 1855 | | { |
| 1856 | | return GetUIJoy(M32OPTION_UI_JOY_DOWN, joycodeIndex); |
| 1857 | | } |
| 1858 | | |
| 1859 | | void SetUIJoyDown(int joycodeIndex, int val) |
| 1860 | | { |
| 1861 | | SetUIJoy(M32OPTION_UI_JOY_DOWN, joycodeIndex, val); |
| 1862 | | } |
| 1863 | | |
| 1864 | | int GetUIJoyLeft(int joycodeIndex) |
| 1865 | | { |
| 1866 | | return GetUIJoy(M32OPTION_UI_JOY_LEFT, joycodeIndex); |
| 1867 | | } |
| 1868 | | |
| 1869 | | void SetUIJoyLeft(int joycodeIndex, int val) |
| 1870 | | { |
| 1871 | | SetUIJoy(M32OPTION_UI_JOY_LEFT, joycodeIndex, val); |
| 1872 | | } |
| 1873 | | |
| 1874 | | int GetUIJoyRight(int joycodeIndex) |
| 1875 | | { |
| 1876 | | return GetUIJoy(M32OPTION_UI_JOY_RIGHT, joycodeIndex); |
| 1877 | | } |
| 1878 | | |
| 1879 | | void SetUIJoyRight(int joycodeIndex, int val) |
| 1880 | | { |
| 1881 | | SetUIJoy(M32OPTION_UI_JOY_RIGHT, joycodeIndex, val); |
| 1882 | | } |
| 1883 | | |
| 1884 | | int GetUIJoyStart(int joycodeIndex) |
| 1885 | | { |
| 1886 | | return GetUIJoy(M32OPTION_UI_JOY_START, joycodeIndex); |
| 1887 | | } |
| 1888 | | |
| 1889 | | void SetUIJoyStart(int joycodeIndex, int val) |
| 1890 | | { |
| 1891 | | SetUIJoy(M32OPTION_UI_JOY_START, joycodeIndex, val); |
| 1892 | | } |
| 1893 | | |
| 1894 | | int GetUIJoyPageUp(int joycodeIndex) |
| 1895 | | { |
| 1896 | | return GetUIJoy(M32OPTION_UI_JOY_PGUP, joycodeIndex); |
| 1897 | | } |
| 1898 | | |
| 1899 | | void SetUIJoyPageUp(int joycodeIndex, int val) |
| 1900 | | { |
| 1901 | | SetUIJoy(M32OPTION_UI_JOY_PGUP, joycodeIndex, val); |
| 1902 | | } |
| 1903 | | |
| 1904 | | int GetUIJoyPageDown(int joycodeIndex) |
| 1905 | | { |
| 1906 | | return GetUIJoy(M32OPTION_UI_JOY_PGDWN, joycodeIndex); |
| 1907 | | } |
| 1908 | | |
| 1909 | | void SetUIJoyPageDown(int joycodeIndex, int val) |
| 1910 | | { |
| 1911 | | SetUIJoy(M32OPTION_UI_JOY_PGDWN, joycodeIndex, val); |
| 1912 | | } |
| 1913 | | |
| 1914 | | int GetUIJoyHome(int joycodeIndex) |
| 1915 | | { |
| 1916 | | return GetUIJoy(M32OPTION_UI_JOY_HOME, joycodeIndex); |
| 1917 | | } |
| 1918 | | |
| 1919 | | void SetUIJoyHome(int joycodeIndex, int val) |
| 1920 | | { |
| 1921 | | SetUIJoy(M32OPTION_UI_JOY_HOME, joycodeIndex, val); |
| 1922 | | } |
| 1923 | | |
| 1924 | | int GetUIJoyEnd(int joycodeIndex) |
| 1925 | | { |
| 1926 | | return GetUIJoy(M32OPTION_UI_JOY_END, joycodeIndex); |
| 1927 | | } |
| 1928 | | |
| 1929 | | void SetUIJoyEnd(int joycodeIndex, int val) |
| 1930 | | { |
| 1931 | | SetUIJoy(M32OPTION_UI_JOY_END, joycodeIndex, val); |
| 1932 | | } |
| 1933 | | |
| 1934 | | int GetUIJoySSChange(int joycodeIndex) |
| 1935 | | { |
| 1936 | | return GetUIJoy(M32OPTION_UI_JOY_SS_CHANGE, joycodeIndex); |
| 1937 | | } |
| 1938 | | |
| 1939 | | void SetUIJoySSChange(int joycodeIndex, int val) |
| 1940 | | { |
| 1941 | | SetUIJoy(M32OPTION_UI_JOY_SS_CHANGE, joycodeIndex, val); |
| 1942 | | } |
| 1943 | | |
| 1944 | | int GetUIJoyHistoryUp(int joycodeIndex) |
| 1945 | | { |
| 1946 | | return GetUIJoy(M32OPTION_UI_JOY_HISTORY_UP, joycodeIndex); |
| 1947 | | } |
| 1948 | | |
| 1949 | | void SetUIJoyHistoryUp(int joycodeIndex, int val) |
| 1950 | | { |
| 1951 | | SetUIJoy(M32OPTION_UI_JOY_HISTORY_UP, joycodeIndex, val); |
| 1952 | | } |
| 1953 | | |
| 1954 | | int GetUIJoyHistoryDown(int joycodeIndex) |
| 1955 | | { |
| 1956 | | return GetUIJoy(M32OPTION_UI_JOY_HISTORY_DOWN, joycodeIndex); |
| 1957 | | } |
| 1958 | | |
| 1959 | | void SetUIJoyHistoryDown(int joycodeIndex, int val) |
| 1960 | | { |
| 1961 | | SetUIJoy(M32OPTION_UI_JOY_HISTORY_DOWN, joycodeIndex, val); |
| 1962 | | } |
| 1963 | | |
| 1964 | | void SetUIJoyExec(int joycodeIndex, int val) |
| 1965 | | { |
| 1966 | | SetUIJoy(M32OPTION_UI_JOY_EXEC, joycodeIndex, val); |
| 1967 | | } |
| 1968 | | |
| 1969 | | int GetUIJoyExec(int joycodeIndex) |
| 1970 | | { |
| 1971 | | return GetUIJoy(M32OPTION_UI_JOY_EXEC, joycodeIndex); |
| 1972 | | } |
| 1973 | | |
| 1974 | | const char * GetExecCommand(void) |
| 1975 | | { |
| 1976 | | return options_get_string(settings, M32OPTION_EXEC_COMMAND); |
| 1977 | | } |
| 1978 | | |
| 1979 | | void SetExecCommand(char *cmd) |
| 1980 | | { |
| 1981 | | options_set_string(settings, M32OPTION_EXEC_COMMAND, cmd, OPTION_PRIORITY_CMDLINE); |
| 1982 | | } |
| 1983 | | |
| 1984 | | int GetExecWait(void) |
| 1985 | | { |
| 1986 | | return options_get_int(settings, M32OPTION_EXEC_WAIT); |
| 1987 | | } |
| 1988 | | |
| 1989 | | void SetExecWait(int wait) |
| 1990 | | { |
| 1991 | | options_set_int(settings, M32OPTION_EXEC_WAIT, wait, OPTION_PRIORITY_CMDLINE); |
| 1992 | | } |
| 1993 | | |
| 1994 | | BOOL GetHideMouseOnStartup(void) |
| 1995 | | { |
| 1996 | | return options_get_bool(settings, M32OPTION_HIDE_MOUSE); |
| 1997 | | } |
| 1998 | | |
| 1999 | | void SetHideMouseOnStartup(BOOL hide) |
| 2000 | | { |
| 2001 | | options_set_bool(settings, M32OPTION_HIDE_MOUSE, hide, OPTION_PRIORITY_CMDLINE); |
| 2002 | | } |
| 2003 | | |
| 2004 | | BOOL GetRunFullScreen(void) |
| 2005 | | { |
| 2006 | | return options_get_bool(settings, M32OPTION_FULL_SCREEN); |
| 2007 | | } |
| 2008 | | |
| 2009 | | void SetRunFullScreen(BOOL fullScreen) |
| 2010 | | { |
| 2011 | | options_set_bool(settings, M32OPTION_FULL_SCREEN, fullScreen, OPTION_PRIORITY_CMDLINE); |
| 2012 | | } |
| 2013 | | |
| 2014 | | /*************************************************************************** |
| 2015 | | Internal functions |
| 2016 | | ***************************************************************************/ |
| 2017 | | |
| 2018 | | static void CusColorEncodeString(const COLORREF *value, char* str) |
| 2019 | | { |
| 2020 | | int i; |
| 2021 | | char tmpStr[256]; |
| 2022 | | |
| 2023 | | sprintf(tmpStr, "%u", (int) value[0]); |
| 2024 | | |
| 2025 | | strcpy(str, tmpStr); |
| 2026 | | |
| 2027 | | for (i = 1; i < 16; i++) |
| 2028 | | { |
| 2029 | | sprintf(tmpStr, ",%u", (unsigned) value[i]); |
| 2030 | | strcat(str, tmpStr); |
| 2031 | | } |
| 2032 | | } |
| 2033 | | |
| 2034 | | static void CusColorDecodeString(const char* str, COLORREF *value) |
| 2035 | | { |
| 2036 | | int i; |
| 2037 | | char *s, *p; |
| 2038 | | char tmpStr[256]; |
| 2039 | | |
| 2040 | | strcpy(tmpStr, str); |
| 2041 | | p = tmpStr; |
| 2042 | | |
| 2043 | | for (i = 0; p && i < 16; i++) |
| 2044 | | { |
| 2045 | | s = p; |
| 2046 | | |
| 2047 | | if ((p = strchr(s,',')) != NULL && *p == ',') |
| 2048 | | { |
| 2049 | | *p = '\0'; |
| 2050 | | p++; |
| 2051 | | } |
| 2052 | | value[i] = atoi(s); |
| 2053 | | } |
| 2054 | | } |
| 2055 | | |
| 2056 | | |
| 2057 | | void ColumnEncodeStringWithCount(const int *value, char *str, int count) |
| 2058 | | { |
| 2059 | | int i; |
| 2060 | | char buffer[100]; |
| 2061 | | |
| 2062 | | snprintf(buffer,sizeof(buffer),"%d",value[0]); |
| 2063 | | |
| 2064 | | strcpy(str,buffer); |
| 2065 | | |
| 2066 | | for (i = 1; i < count; i++) |
| 2067 | | { |
| 2068 | | snprintf(buffer,sizeof(buffer),",%d",value[i]); |
| 2069 | | strcat(str,buffer); |
| 2070 | | } |
| 2071 | | } |
| 2072 | | |
| 2073 | | void ColumnDecodeStringWithCount(const char* str, int *value, int count) |
| 2074 | | { |
| 2075 | | int i; |
| 2076 | | char *s, *p; |
| 2077 | | char tmpStr[100]; |
| 2078 | | |
| 2079 | | if (str == NULL) |
| 2080 | | return; |
| 2081 | | |
| 2082 | | strcpy(tmpStr, str); |
| 2083 | | p = tmpStr; |
| 2084 | | |
| 2085 | | for (i = 0; p && i < count; i++) |
| 2086 | | { |
| 2087 | | s = p; |
| 2088 | | |
| 2089 | | if ((p = strchr(s,',')) != NULL && *p == ',') |
| 2090 | | { |
| 2091 | | *p = '\0'; |
| 2092 | | p++; |
| 2093 | | } |
| 2094 | | value[i] = atoi(s); |
| 2095 | | } |
| 2096 | | } |
| 2097 | | |
| 2098 | | static void SplitterEncodeString(const int *value, char* str) |
| 2099 | | { |
| 2100 | | int i; |
| 2101 | | char tmpStr[100]; |
| 2102 | | |
| 2103 | | sprintf(tmpStr, "%d", value[0]); |
| 2104 | | |
| 2105 | | strcpy(str, tmpStr); |
| 2106 | | |
| 2107 | | for (i = 1; i < GetSplitterCount(); i++) |
| 2108 | | { |
| 2109 | | sprintf(tmpStr, ",%d", value[i]); |
| 2110 | | strcat(str, tmpStr); |
| 2111 | | } |
| 2112 | | } |
| 2113 | | |
| 2114 | | static void SplitterDecodeString(const char *str, int *value) |
| 2115 | | { |
| 2116 | | int i; |
| 2117 | | char *s, *p; |
| 2118 | | char tmpStr[100]; |
| 2119 | | |
| 2120 | | strcpy(tmpStr, str); |
| 2121 | | p = tmpStr; |
| 2122 | | |
| 2123 | | for (i = 0; p && i < GetSplitterCount(); i++) |
| 2124 | | { |
| 2125 | | s = p; |
| 2126 | | |
| 2127 | | if ((p = strchr(s,',')) != NULL && *p == ',') |
| 2128 | | { |
| 2129 | | *p = '\0'; |
| 2130 | | p++; |
| 2131 | | } |
| 2132 | | value[i] = atoi(s); |
| 2133 | | } |
| 2134 | | } |
| 2135 | | |
| 2136 | | /* Parse the given comma-delimited string into a LOGFONT structure */ |
| 2137 | | static void FontDecodeString(const char* str, LOGFONT *f) |
| 2138 | | { |
| 2139 | | char* ptr; |
| 2140 | | TCHAR* t_ptr; |
| 2141 | | |
| 2142 | | sscanf(str, "%li,%li,%li,%li,%li,%i,%i,%i,%i,%i,%i,%i,%i", |
| 2143 | | &f->lfHeight, |
| 2144 | | &f->lfWidth, |
| 2145 | | &f->lfEscapement, |
| 2146 | | &f->lfOrientation, |
| 2147 | | &f->lfWeight, |
| 2148 | | (int*)&f->lfItalic, |
| 2149 | | (int*)&f->lfUnderline, |
| 2150 | | (int*)&f->lfStrikeOut, |
| 2151 | | (int*)&f->lfCharSet, |
| 2152 | | (int*)&f->lfOutPrecision, |
| 2153 | | (int*)&f->lfClipPrecision, |
| 2154 | | (int*)&f->lfQuality, |
| 2155 | | (int*)&f->lfPitchAndFamily); |
| 2156 | | ptr = strrchr(str, ','); |
| 2157 | | if (ptr != NULL) { |
| 2158 | | t_ptr = tstring_from_utf8(ptr + 1); |
| 2159 | | if( !t_ptr ) |
| 2160 | | return; |
| 2161 | | _tcscpy(f->lfFaceName, t_ptr); |
| 2162 | | free(t_ptr); |
| 2163 | | } |
| 2164 | | } |
| 2165 | | |
| 2166 | | /* Encode the given LOGFONT structure into a comma-delimited string */ |
| 2167 | | static void FontEncodeString(const LOGFONT *f, char *str) |
| 2168 | | { |
| 2169 | | char* utf8_FaceName = utf8_from_tstring(f->lfFaceName); |
| 2170 | | if( !utf8_FaceName ) |
| 2171 | | return; |
| 2172 | | |
| 2173 | | sprintf(str, "%li,%li,%li,%li,%li,%i,%i,%i,%i,%i,%i,%i,%i,%s", |
| 2174 | | f->lfHeight, |
| 2175 | | f->lfWidth, |
| 2176 | | f->lfEscapement, |
| 2177 | | f->lfOrientation, |
| 2178 | | f->lfWeight, |
| 2179 | | f->lfItalic, |
| 2180 | | f->lfUnderline, |
| 2181 | | f->lfStrikeOut, |
| 2182 | | f->lfCharSet, |
| 2183 | | f->lfOutPrecision, |
| 2184 | | f->lfClipPrecision, |
| 2185 | | f->lfQuality, |
| 2186 | | f->lfPitchAndFamily, |
| 2187 | | utf8_FaceName); |
| 2188 | | |
| 2189 | | free(utf8_FaceName); |
| 2190 | | } |
| 2191 | | |
| 2192 | | static void TabFlagsEncodeString(int data, char *str) |
| 2193 | | { |
| 2194 | | int i; |
| 2195 | | int num_saved = 0; |
| 2196 | | |
| 2197 | | strcpy(str,""); |
| 2198 | | |
| 2199 | | // we save the ones that are NOT displayed, so we can add new ones |
| 2200 | | // and upgraders will see them |
| 2201 | | for (i=0;i<MAX_TAB_TYPES;i++) |
| 2202 | | { |
| 2203 | | if (((data & (1 << i)) == 0) && GetImageTabShortName(i)) |
| 2204 | | { |
| 2205 | | if (num_saved != 0) |
| 2206 | | strcat(str, ", "); |
| 2207 | | |
| 2208 | | strcat(str,GetImageTabShortName(i)); |
| 2209 | | num_saved++; |
| 2210 | | } |
| 2211 | | } |
| 2212 | | } |
| 2213 | | |
| 2214 | | static void TabFlagsDecodeString(const char *str, int *data) |
| 2215 | | { |
| 2216 | | char s[2000]; |
| 2217 | | char *token; |
| 2218 | | |
| 2219 | | snprintf(s, ARRAY_LENGTH(s), "%s", str); |
| 2220 | | |
| 2221 | | // simple way to set all tab bits "on" |
| 2222 | | *data = (1 << MAX_TAB_TYPES) - 1; |
| 2223 | | |
| 2224 | | token = strtok(s,", \t"); |
| 2225 | | while (token != NULL) |
| 2226 | | { |
| 2227 | | int j; |
| 2228 | | |
| 2229 | | for (j=0;j<MAX_TAB_TYPES;j++) |
| 2230 | | { |
| 2231 | | if (!GetImageTabShortName(j) || (strcmp(GetImageTabShortName(j), token) == 0)) |
| 2232 | | { |
| 2233 | | // turn off this bit |
| 2234 | | *data &= ~(1 << j); |
| 2235 | | break; |
| 2236 | | } |
| 2237 | | } |
| 2238 | | token = strtok(NULL,", \t"); |
| 2239 | | } |
| 2240 | | |
| 2241 | | if (*data == 0) |
| 2242 | | { |
| 2243 | | // not allowed to hide all tabs, because then why even show the area? |
| 2244 | | *data = (1 << TAB_SCREENSHOT); |
| 2245 | | } |
| 2246 | | } |
| 2247 | | |
| 2248 | | static file_error LoadSettingsFile(core_options *opts, const char *filename) |
| 2249 | | { |
| 2250 | | core_file *file; |
| 2251 | | file_error filerr; |
| 2252 | | |
| 2253 | | filerr = core_fopen(filename, OPEN_FLAG_READ, &file); |
| 2254 | | if (filerr == FILERR_NONE) |
| 2255 | | { |
| 2256 | | options_parse_ini_file(opts, file, OPTION_PRIORITY_CMDLINE); |
| 2257 | | core_fclose(file); |
| 2258 | | } |
| 2259 | | return filerr; |
| 2260 | | } |
| 2261 | | |
| 2262 | | |
| 2263 | | static file_error SaveSettingsFile(core_options *opts, core_options *baseopts, const char *filename) |
| 2264 | | { |
| 2265 | | core_file *file; |
| 2266 | | file_error filerr; |
| 2267 | | |
| 2268 | | if ((opts != NULL) && ((baseopts == NULL) || !options_equal(opts, baseopts))) |
| 2269 | | { |
| 2270 | | filerr = core_fopen(filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file); |
| 2271 | | if (filerr == FILERR_NONE) |
| 2272 | | { |
| 2273 | | options_output_diff_ini_file(opts, baseopts, file); |
| 2274 | | core_fclose(file); |
| 2275 | | } |
| 2276 | | } |
| 2277 | | else |
| 2278 | | { |
| 2279 | | filerr = osd_rmfile(filename); |
| 2280 | | } |
| 2281 | | |
| 2282 | | return filerr; |
| 2283 | | } |
| 2284 | | |
| 2285 | | |
| 2286 | | |
| 2287 | | static void GetGlobalOptionsFileName(char *filename, size_t filename_size) |
| 2288 | | { |
| 2289 | | // copy INI directory |
| 2290 | | snprintf(filename, filename_size, "%s\\%s.ini", GetIniDir(), CONFIGNAME); |
| 2291 | | } |
| 2292 | | |
| 2293 | | /* Register access functions below */ |
| 2294 | | static void LoadOptionsAndSettings(void) |
| 2295 | | { |
| 2296 | | char buffer[MAX_PATH]; |
| 2297 | | |
| 2298 | | // parse MAME32ui.ini - always in the current directory. |
| 2299 | | LoadSettingsFile(settings, UI_INI_FILENAME); |
| 2300 | | |
| 2301 | | // parse global options ini/mame32.ini |
| 2302 | | GetGlobalOptionsFileName(buffer, ARRAY_LENGTH(buffer)); |
| 2303 | | LoadSettingsFile(global, buffer); |
| 2304 | | } |
| 2305 | | |
| 2306 | | const char * GetFolderNameByID(UINT nID) |
| 2307 | | { |
| 2308 | | UINT i; |
| 2309 | | extern FOLDERDATA g_folderData[]; |
| 2310 | | extern LPEXFOLDERDATA ExtraFolderData[]; |
| 2311 | | |
| 2312 | | for (i = 0; i < MAX_EXTRA_FOLDERS * MAX_EXTRA_SUBFOLDERS; i++) |
| 2313 | | { |
| 2314 | | if( ExtraFolderData[i] ) |
| 2315 | | { |
| 2316 | | if (ExtraFolderData[i]->m_nFolderId == nID) |
| 2317 | | { |
| 2318 | | return ExtraFolderData[i]->m_szTitle; |
| 2319 | | } |
| 2320 | | } |
| 2321 | | } |
| 2322 | | for( i = 0; i < MAX_FOLDERS; i++) |
| 2323 | | { |
| 2324 | | if (g_folderData[i].m_nFolderId == nID) |
| 2325 | | { |
| 2326 | | |
| 2327 | | return g_folderData[i].m_lpTitle; |
| 2328 | | } |
| 2329 | | } |
| 2330 | | return NULL; |
| 2331 | | } |
| 2332 | | |
| 2333 | | |
| 2334 | | DWORD GetFolderFlags(int folder_index) |
| 2335 | | { |
| 2336 | | LPTREEFOLDER lpFolder = GetFolder(folder_index); |
| 2337 | | |
| 2338 | | if (lpFolder) |
| 2339 | | return lpFolder->m_dwFlags & F_MASK; |
| 2340 | | |
| 2341 | | return 0; |
| 2342 | | #if 0 |
| 2343 | | int i; |
| 2344 | | |
| 2345 | | for (i=0;i<num_folder_filters;i++) |
| 2346 | | { |
| 2347 | | if (folder_filters[i].folder_index == folder_index) |
| 2348 | | { |
| 2349 | | //dprintf("found folder filter %i %i",folder_index,folder_filters[i].filters); |
| 2350 | | return folder_filters[i].filters; |
| 2351 | | } |
| 2352 | | } |
| 2353 | | return 0; |
| 2354 | | #endif |
| 2355 | | } |
| 2356 | | |
| 2357 | | |
| 2358 | | /* Decode the flags into a DWORD */ |
| 2359 | | static DWORD DecodeFolderFlags(const char *buf) |
| 2360 | | { |
| 2361 | | DWORD flags = 0; |
| 2362 | | int shift = 0; |
| 2363 | | const char *ptr = buf; |
| 2364 | | |
| 2365 | | while (*ptr && (1 << shift) & F_MASK) |
| 2366 | | { |
| 2367 | | if (*ptr++ == '1') |
| 2368 | | { |
| 2369 | | flags |= (1 << shift); |
| 2370 | | } |
| 2371 | | shift++; |
| 2372 | | } |
| 2373 | | return flags; |
| 2374 | | } |
| 2375 | | |
| 2376 | | /* Encode the flags into a string */ |
| 2377 | | static const char * EncodeFolderFlags(DWORD value) |
| 2378 | | { |
| 2379 | | static char buf[40]; |
| 2380 | | int shift = 0; |
| 2381 | | |
| 2382 | | memset(buf,'\0', sizeof(buf)); |
| 2383 | | |
| 2384 | | while ((1 << shift) & F_MASK) { |
| 2385 | | buf[shift] = (value & (1 << shift)) ? '1' : '0'; |
| 2386 | | shift++; |
| 2387 | | } |
| 2388 | | |
| 2389 | | return buf; |
| 2390 | | } |
| 2391 | | |
| 2392 | | /* MSH 20080813 |
| 2393 | | * Read the folder filters from MAME32ui.ini. This must only |
| 2394 | | * be called AFTER the folders have all been created. |
| 2395 | | */ |
| 2396 | | void LoadFolderFlags(void) |
| 2397 | | { |
| 2398 | | core_options *opts; |
| 2399 | | int numFolders; |
| 2400 | | LPTREEFOLDER lpFolder; |
| 2401 | | int i; |
| 2402 | | options_entry entries[2]; |
| 2403 | | |
| 2404 | | memcpy(entries, filterOptions, sizeof(filterOptions)); |
| 2405 | | |
| 2406 | | opts = options_create(memory_error); |
| 2407 | | |
| 2408 | | if (NULL == opts) |
| 2409 | | { |
| 2410 | | return; |
| 2411 | | } |
| 2412 | | |
| 2413 | | numFolders = GetNumFolders(); |
| 2414 | | |
| 2415 | | for (i = 0; i < numFolders; i++) |
| 2416 | | { |
| 2417 | | lpFolder = GetFolder(i); |
| 2418 | | |
| 2419 | | if (lpFolder) |
| 2420 | | { |
| 2421 | | char folder_name[80]; |
| 2422 | | char *ptr; |
| 2423 | | astring *option_name; |
| 2424 | | |
| 2425 | | // Convert spaces to underscores |
| 2426 | | strcpy(folder_name, lpFolder->m_lpTitle); |
| 2427 | | ptr = folder_name; |
| 2428 | | while (*ptr && *ptr != '\0') |
| 2429 | | { |
| 2430 | | if (*ptr == ' ') |
| 2431 | | { |
| 2432 | | *ptr = '_'; |
| 2433 | | } |
| 2434 | | ptr++; |
| 2435 | | } |
| 2436 | | |
| 2437 | | option_name = astring_assemble_2(astring_alloc(), folder_name, "_filters"); |
| 2438 | | // create entry |
| 2439 | | entries[0].name = astring_c(option_name); |
| 2440 | | options_add_entries(opts, entries); |
| 2441 | | astring_free(option_name); |
| 2442 | | } |
| 2443 | | } |
| 2444 | | |
| 2445 | | // These are overlayed at the end of our UI ini |
| 2446 | | // The normal read will skip them. |
| 2447 | | LoadSettingsFile(opts, UI_INI_FILENAME); |
| 2448 | | |
| 2449 | | // retrive the stored values |
| 2450 | | for (i = 0; i < numFolders; i++) |
| 2451 | | { |
| 2452 | | lpFolder = GetFolder(i); |
| 2453 | | |
| 2454 | | if (lpFolder) |
| 2455 | | { |
| 2456 | | char folder_name[80]; |
| 2457 | | char *ptr; |
| 2458 | | astring *option_name; |
| 2459 | | const char *value; |
| 2460 | | |
| 2461 | | // Convert spaces to underscores |
| 2462 | | strcpy(folder_name, lpFolder->m_lpTitle); |
| 2463 | | ptr = folder_name; |
| 2464 | | while (*ptr && *ptr != '\0') |
| 2465 | | { |
| 2466 | | if (*ptr == ' ') |
| 2467 | | { |
| 2468 | | *ptr = '_'; |
| 2469 | | } |
| 2470 | | ptr++; |
| 2471 | | } |
| 2472 | | option_name = astring_assemble_2(astring_alloc(), folder_name, "_filters" ); |
| 2473 | | // get entry and decode it |
| 2474 | | value = options_get_string(opts, astring_c(option_name)); |
| 2475 | | astring_free(option_name); |
| 2476 | | |
| 2477 | | if (value) |
| 2478 | | { |
| 2479 | | lpFolder->m_dwFlags |= DecodeFolderFlags(value) & F_MASK; |
| 2480 | | } |
| 2481 | | } |
| 2482 | | } |
| 2483 | | // fee the options |
| 2484 | | options_free(opts); |
| 2485 | | } |
| 2486 | | |
| 2487 | | |
| 2488 | | |
| 2489 | | // Copy options, if entry doesn't exist in the dest, create it. |
| 2490 | | static void copy_options_ex(core_options *pDestOpts, core_options *pSourceOpts) |
| 2491 | | { |
| 2492 | | options_enumerator *enumerator; |
| 2493 | | const char *option_name; |
| 2494 | | const char *option_value; |
| 2495 | | options_entry entries[2]; |
| 2496 | | |
| 2497 | | memcpy(entries, filterOptions, sizeof(filterOptions)); |
| 2498 | | |
| 2499 | | enumerator = options_enumerator_begin(pSourceOpts); |
| 2500 | | |
| 2501 | | if (enumerator != NULL) |
| 2502 | | { |
| 2503 | | while((option_name = options_enumerator_next(enumerator)) != NULL) |
| 2504 | | { |
| 2505 | | option_value = options_get_string(pSourceOpts, option_name); |
| 2506 | | { |
| 2507 | | const char *existing = options_get_string(pDestOpts, option_name); |
| 2508 | | if (NULL == existing || *existing == '\0') |
| 2509 | | { |
| 2510 | | entries[0].name = option_name; |
| 2511 | | // create entry |
| 2512 | | options_add_entries(pDestOpts, entries); |
| 2513 | | } |
| 2514 | | if (strcmp(option_value, existing) != 0) |
| 2515 | | options_set_string(pDestOpts, option_name, option_value, OPTION_PRIORITY_CMDLINE); |
| 2516 | | } |
| 2517 | | } |
| 2518 | | options_enumerator_free(enumerator); |
| 2519 | | } |
| 2520 | | } |
| 2521 | | |
| 2522 | | // Adds our folder flags to a temporarty core_options, for saving. |
| 2523 | | static core_options * AddFolderFlags(core_options *settings) |
| 2524 | | { |
| 2525 | | core_options *opts; |
| 2526 | | int numFolders; |
| 2527 | | int i; |
| 2528 | | LPTREEFOLDER lpFolder; |
| 2529 | | int num_entries = 0; |
| 2530 | | options_entry entries[2]; |
| 2531 | | |
| 2532 | | opts = options_create(memory_error); |
| 2533 | | |
| 2534 | | if (NULL == opts) |
| 2535 | | { |
| 2536 | | return NULL; |
| 2537 | | } |
| 2538 | | |
| 2539 | | options_add_entries(opts, regSettings); |
| 2540 | | copy_options_ex(opts, settings); |
| 2541 | | |
| 2542 | | memcpy(entries, filterOptions, sizeof(filterOptions)); |
| 2543 | | entries[0].name = NULL; |
| 2544 | | entries[0].defvalue = NULL; |
| 2545 | | entries[0].flags = OPTION_HEADER; |
| 2546 | | entries[0].description = "FOLDER FILTERS"; |
| 2547 | | options_add_entries(opts, entries); |
| 2548 | | |
| 2549 | | memcpy(entries, filterOptions, sizeof(filterOptions)); |
| 2550 | | |
| 2551 | | numFolders = GetNumFolders(); |
| 2552 | | |
| 2553 | | for (i = 0; i < numFolders; i++) |
| 2554 | | { |
| 2555 | | lpFolder = GetFolder(i); |
| 2556 | | if (lpFolder && (lpFolder->m_dwFlags & F_MASK) != 0) |
| 2557 | | { |
| 2558 | | char folder_name[80]; |
| 2559 | | char *ptr; |
| 2560 | | astring *option_name; |
| 2561 | | |
| 2562 | | // Convert spaces to underscores |
| 2563 | | strcpy(folder_name, lpFolder->m_lpTitle); |
| 2564 | | ptr = folder_name; |
| 2565 | | while (*ptr && *ptr != '\0') |
| 2566 | | { |
| 2567 | | if (*ptr == ' ') |
| 2568 | | { |
| 2569 | | *ptr = '_'; |
| 2570 | | } |
| 2571 | | ptr++; |
| 2572 | | } |
| 2573 | | |
| 2574 | | option_name = astring_assemble_2(astring_alloc(), folder_name, "_filters" ); |
| 2575 | | |
| 2576 | | // create entry |
| 2577 | | entries[0].name = astring_c(option_name); |
| 2578 | | options_add_entries(opts, entries); |
| 2579 | | |
| 2580 | | // store entry |
| 2581 | | options_set_string(opts, astring_c(option_name), EncodeFolderFlags(lpFolder->m_dwFlags), OPTION_PRIORITY_CMDLINE); |
| 2582 | | astring_free(option_name); |
| 2583 | | |
| 2584 | | // increment counter |
| 2585 | | num_entries++; |
| 2586 | | } |
| 2587 | | } |
| 2588 | | if (num_entries == 0) { |
| 2589 | | options_free(opts); |
| 2590 | | opts = NULL; |
| 2591 | | } |
| 2592 | | return opts; |
| 2593 | | } |
| 2594 | | |
| 2595 | | // Save the UI ini |
| 2596 | | void SaveOptions(void) |
| 2597 | | { |
| 2598 | | if (save_gui_settings) |
| 2599 | | { |
| 2600 | | // Add the folder flag to settings. |
| 2601 | | core_options *opts = AddFolderFlags(settings); |
| 2602 | | // Save opts if it is non-null, else save settings. |
| 2603 | | // It will be null if there are no filters set. |
| 2604 | | SaveSettingsFile((opts == NULL) ? settings : opts, NULL, UI_INI_FILENAME); |
| 2605 | | // Free up the opts allocated by AddFolderFlags. |
| 2606 | | if (opts) |
| 2607 | | { |
| 2608 | | options_free(opts); |
| 2609 | | } |
| 2610 | | } |
| 2611 | | } |
| 2612 | | |
| 2613 | | |
| 2614 | | void SaveDefaultOptions(void) |
| 2615 | | { |
| 2616 | | char buffer[MAX_PATH]; |
| 2617 | | GetGlobalOptionsFileName(buffer, ARRAY_LENGTH(buffer)); |
| 2618 | | SaveSettingsFile(global, NULL, buffer); |
| 2619 | | } |
| 2620 | | |
| 2621 | | char * GetVersionString(void) |
| 2622 | | { |
| 2623 | | return build_version; |
| 2624 | | } |
| 2625 | | |
| 2626 | | |
| 2627 | | BOOL IsGlobalOption(const char *option_name) |
| 2628 | | { |
| 2629 | | static const char *global_options[] = |
| 2630 | | { |
| 2631 | | OPTION_ROMPATH, |
| 2632 | | #ifdef MESS |
| 2633 | | OPTION_HASHPATH, |
| 2634 | | #endif // MESS |
| 2635 | | OPTION_SAMPLEPATH, |
| 2636 | | OPTION_ARTPATH, |
| 2637 | | OPTION_CTRLRPATH, |
| 2638 | | OPTION_INIPATH, |
| 2639 | | OPTION_FONTPATH, |
| 2640 | | OPTION_CFG_DIRECTORY, |
| 2641 | | OPTION_NVRAM_DIRECTORY, |
| 2642 | | OPTION_MEMCARD_DIRECTORY, |
| 2643 | | OPTION_INPUT_DIRECTORY, |
| 2644 | | OPTION_STATE_DIRECTORY, |
| 2645 | | OPTION_SNAPSHOT_DIRECTORY, |
| 2646 | | OPTION_DIFF_DIRECTORY, |
| 2647 | | OPTION_COMMENT_DIRECTORY |
| 2648 | | }; |
| 2649 | | int i; |
| 2650 | | char command_name[128]; |
| 2651 | | char *s; |
| 2652 | | |
| 2653 | | // determine command name |
| 2654 | | snprintf(command_name, ARRAY_LENGTH(command_name), "%s", option_name); |
| 2655 | | s = strchr(command_name, ';'); |
| 2656 | | if (s) |
| 2657 | | *s = '\0'; |
| 2658 | | |
| 2659 | | for (i = 0; i < ARRAY_LENGTH(global_options); i++) |
| 2660 | | { |
| 2661 | | if (!strcmp(command_name, global_options[i])) |
| 2662 | | return TRUE; |
| 2663 | | } |
| 2664 | | return FALSE; |
| 2665 | | } |
| 2666 | | |
| 2667 | | |
| 2668 | | /* ui_parse_ini_file - parse a single INI file */ |
| 2669 | | static void ui_parse_ini_file(core_options *opts, const char *name) |
| 2670 | | { |
| 2671 | | astring *fname; |
| 2672 | | |
| 2673 | | /* open the file; if we fail, that's ok */ |
| 2674 | | fname = astring_assemble_4(astring_alloc(), GetIniDir(), PATH_SEPARATOR, name, ".ini"); |
| 2675 | | LoadSettingsFile(opts, astring_c(fname)); |
| 2676 | | astring_free(fname); |
| 2677 | | } |
| 2678 | | |
| 2679 | | |
| 2680 | | /* get options, based on passed in option level. */ |
| 2681 | | core_options * load_options(OPTIONS_TYPE opt_type, int game_num) |
| 2682 | | { |
| 2683 | | core_options *opts; |
| 2684 | | const game_driver *driver = NULL; |
| 2685 | | |
| 2686 | | opts = CreateGameOptions(game_num); |
| 2687 | | |
| 2688 | | if (opts == NULL) |
| 2689 | | { |
| 2690 | | return NULL; |
| 2691 | | } |
| 2692 | | |
| 2693 | | /* Copy over the defaults */ |
| 2694 | | options_copy(opts, global); |
| 2695 | | |
| 2696 | | if (opt_type == OPTIONS_GLOBAL) |
| 2697 | | { |
| 2698 | | return opts; |
| 2699 | | } |
| 2700 | | |
| 2701 | | /* debug builds: parse "debug.ini" as well */ |
| 2702 | | #ifdef MAME_DEBUG |
| 2703 | | ui_parse_ini_file(opts, "debug"); |
| 2704 | | #endif |
| 2705 | | if (game_num >= 0) |
| 2706 | | { |
| 2707 | | driver = drivers[game_num]; |
| 2708 | | } |
| 2709 | | |
| 2710 | | /* if we have a valid game driver, parse game-specific INI files */ |
| 2711 | | if (driver != NULL) |
| 2712 | | { |
| 2713 | | const game_driver *parent = driver_get_clone(driver); |
| 2714 | | const game_driver *gparent = (parent != NULL) ? driver_get_clone(parent) : NULL; |
| 2715 | | astring *basename; |
| 2716 | | astring *srcname; |
| 2717 | | machine_config drv; |
| 2718 | | |
| 2719 | | /* expand the machine driver to look at the info */ |
| 2720 | | expand_machine_driver(driver->drv, &drv); |
| 2721 | | |
| 2722 | | /* parse "vector.ini" for vector games */ |
| 2723 | | if (drv.video_attributes & VIDEO_TYPE_VECTOR) |
| 2724 | | ui_parse_ini_file(opts, "vector"); |
| 2725 | | |
| 2726 | | if (opt_type == OPTIONS_VECTOR) |
| 2727 | | { |
| 2728 | | return opts; |
| 2729 | | } |
| 2730 | | |
| 2731 | | /* then parse "<sourcefile>.ini" */ |
| 2732 | | basename = core_filename_extract_base(astring_alloc(), driver->source_file, TRUE); |
| 2733 | | srcname = astring_assemble_3(astring_alloc(), "source", PATH_SEPARATOR, astring_c(basename)); |
| 2734 | | ui_parse_ini_file(opts, astring_c(srcname)); |
| 2735 | | astring_free(srcname); |
| 2736 | | astring_free(basename); |
| 2737 | | |
| 2738 | | if (opt_type == OPTIONS_SOURCE) |
| 2739 | | { |
| 2740 | | return opts; |
| 2741 | | } |
| 2742 | | |
| 2743 | | /* then parent the grandparent, parent, and game-specific INIs */ |
| 2744 | | if (gparent != NULL) |
| 2745 | | ui_parse_ini_file(opts, gparent->name); |
| 2746 | | if (parent != NULL) |
| 2747 | | ui_parse_ini_file(opts, parent->name); |
| 2748 | | |
| 2749 | | if (opt_type == OPTIONS_PARENT) |
| 2750 | | { |
| 2751 | | return opts; |
| 2752 | | } |
| 2753 | | |
| 2754 | | ui_parse_ini_file(opts, driver->name); |
| 2755 | | |
| 2756 | | if (opt_type == OPTIONS_GAME) |
| 2757 | | { |
| 2758 | | return opts; |
| 2759 | | } |
| 2760 | | } |
| 2761 | | options_free(opts); |
| 2762 | | return NULL; |
| 2763 | | } |
| 2764 | | |
| 2765 | | |
| 2766 | | |
| 2767 | | /* |
| 2768 | | * Save ini file based on game_num and passed in opt_type. If opts are |
| 2769 | | * NULL, the ini wiil be removed. |
| 2770 | | * |
| 2771 | | * game_num must be valid or the driver cannot be expanded and anything |
| 2772 | | * with a higher priority than OPTIONS_VECTOR will not be saved. |
| 2773 | | */ |
| 2774 | | void save_options(OPTIONS_TYPE opt_type, core_options *opts, int game_num) |
| 2775 | | { |
| 2776 | | core_options *baseopts = NULL; |
| 2777 | | const game_driver *driver = NULL; |
| 2778 | | astring *filename = NULL; |
| 2779 | | |
| 2780 | | if (OPTIONS_GLOBAL != opt_type && NULL != opts && !options_equal(opts, global)) |
| 2781 | | { |
| 2782 | | baseopts = load_options(opt_type - 1, game_num); |
| 2783 | | } |
| 2784 | | |
| 2785 | | if (game_num >= 0) |
| 2786 | | { |
| 2787 | | driver = drivers[game_num]; |
| 2788 | | } |
| 2789 | | |
| 2790 | | if (opt_type == OPTIONS_GLOBAL) |
| 2791 | | { |
| 2792 | | /* Don't try to save a null global options file, or it will be erased. */ |
| 2793 | | if (NULL == opts) |
| 2794 | | return; |
| 2795 | | options_copy(global, opts); |
| 2796 | | filename = astring_cpyc(astring_alloc(), CONFIGNAME); |
| 2797 | | } else if (opt_type == OPTIONS_VECTOR) |
| 2798 | | { |
| 2799 | | filename = astring_cpyc(astring_alloc(), "vector"); |
| 2800 | | } else if (driver != NULL) |
| 2801 | | { |
| 2802 | | astring *basename, *srcname; |
| 2803 | | machine_config drv; |
| 2804 | | |
| 2805 | | /* expand the machine driver to look at the info */ |
| 2806 | | expand_machine_driver(driver->drv, &drv); |
| 2807 | | |
| 2808 | | switch (opt_type) |
| 2809 | | { |
| 2810 | | case OPTIONS_SOURCE: |
| 2811 | | /* determine the <sourcefile> */ |
| 2812 | | basename = core_filename_extract_base(astring_alloc(), driver->source_file, TRUE); |
| 2813 | | srcname = astring_assemble_3(astring_alloc(), "source", PATH_SEPARATOR, astring_c(basename)); |
| 2814 | | filename = astring_cpyc(astring_alloc(),astring_c(srcname)); |
| 2815 | | astring_free(srcname); |
| 2816 | | astring_free(basename); |
| 2817 | | break; |
| 2818 | | case OPTIONS_GAME: |
| 2819 | | filename = astring_cpyc(astring_alloc(), driver->name); |
| 2820 | | break; |
| 2821 | | default: |
| 2822 | | break; |
| 2823 | | } |
| 2824 | | } |
| 2825 | | if (filename != NULL) |
| 2826 | | { |
| 2827 | | astring *filepath = NULL; |
| 2828 | | filepath = astring_assemble_4(astring_alloc(), GetIniDir(), PATH_SEPARATOR, astring_c(filename), ".ini"); |
| 2829 | | astring_free(filename); |
| 2830 | | |
| 2831 | | SaveSettingsFile(opts, baseopts, astring_c(filepath)); |
| 2832 | | astring_free(filepath); |
| 2833 | | } |
| 2834 | | if (baseopts != NULL) |
| 2835 | | { |
| 2836 | | options_free(baseopts); |
| 2837 | | } |
| 2838 | | } |
| 2839 | | |
| 2840 | | /* Remove all the srcname.ini files from inipath/source directory. */ |
| 2841 | | static void remove_all_source_options(void) { |
| 2842 | | WIN32_FIND_DATA findFileData; |
| 2843 | | HANDLE hFindFile; |
| 2844 | | astring *pathname, *match; |
| 2845 | | char* utf8_filename; |
| 2846 | | |
| 2847 | | /* |
| 2848 | | * Easiest to just open the ini/source folder if it exists, |
| 2849 | | * then remove all the files in it that end in ini. |
| 2850 | | */ |
| 2851 | | pathname = astring_assemble_3(astring_alloc(), GetIniDir(), PATH_SEPARATOR, "source"); |
| 2852 | | match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, "*.ini"); |
| 2853 | | if ((hFindFile = win_find_first_file_utf8(astring_c(match), &findFileData)) != INVALID_HANDLE_VALUE) |
| 2854 | | { |
| 2855 | | astring_free(match); |
| 2856 | | utf8_filename = utf8_from_tstring(findFileData.cFileName); |
| 2857 | | match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, utf8_filename ); |
| 2858 | | free(utf8_filename); |
| 2859 | | osd_rmfile(astring_c(match)); |
| 2860 | | astring_free(match); |
| 2861 | | |
| 2862 | | while (0 != FindNextFile(hFindFile, &findFileData)) |
| 2863 | | { |
| 2864 | | utf8_filename = utf8_from_tstring(findFileData.cFileName); |
| 2865 | | match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, utf8_filename ); |
| 2866 | | free(utf8_filename); |
| 2867 | | osd_rmfile(astring_c(match)); |
| 2868 | | astring_free(match); |
| 2869 | | } |
| 2870 | | |
| 2871 | | FindClose(hFindFile); |
| 2872 | | |
| 2873 | | } |
| 2874 | | else |
| 2875 | | { |
| 2876 | | astring_free(match); |
| 2877 | | } |
| 2878 | | astring_free(pathname); |
| 2879 | | |
| 2880 | | } |
| 2881 | | |
| 2882 | | // Reset the given core_options to their default settings. |
| 2883 | | static void ResetToDefaults(core_options *opts, int priority) |
| 2884 | | { |
| 2885 | | // iterate through the options setting each one back to the default value. |
| 2886 | | options_revert(opts, priority); |
| 2887 | | } |
| 2888 | | |
| 2889 | | |
| 2890 | | |
src/osd/winui/mameui.rc
| r0 | r1368 | |
| 1 | // Microsoft Visual C++ generated resource script. |
| 2 | // |
| 3 | #include "resource.h" |
| 4 | |
| 5 | #ifdef MESS |
| 6 | #include "resourcems.h" |
| 7 | #endif |
| 8 | |
| 9 | // Generated Help ID header file |
| 10 | #define APSTUDIO_HIDDEN_SYMBOLS |
| 11 | #include "resource.hm" |
| 12 | #undef APSTUDIO_HIDDEN_SYMBOLS |
| 13 | |
| 14 | #define APSTUDIO_READONLY_SYMBOLS |
| 15 | ///////////////////////////////////////////////////////////////////////////// |
| 16 | // |
| 17 | // Generated from the TEXTINCLUDE 2 resource. |
| 18 | // |
| 19 | #define NOWINRES |
| 20 | #include "windows.h" |
| 21 | #include "commctrl.h" |
| 22 | |
| 23 | ///////////////////////////////////////////////////////////////////////////// |
| 24 | #undef APSTUDIO_READONLY_SYMBOLS |
| 25 | |
| 26 | ///////////////////////////////////////////////////////////////////////////// |
| 27 | // English (U.S.) resources |
| 28 | |
| 29 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
| 30 | #ifdef _WIN32 |
| 31 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US |
| 32 | #pragma code_page(1252) |
| 33 | #endif //_WIN32 |
| 34 | |
| 35 | ///////////////////////////////////////////////////////////////////////////// |
| 36 | // |
| 37 | // Menu |
| 38 | // |
| 39 | |
| 40 | IDR_MAIN_MENU MENU |
| 41 | BEGIN |
| 42 | POPUP "&File" |
| 43 | BEGIN |
| 44 | MENUITEM "&Exit", ID_FILE_EXIT |
| 45 | END |
| 46 | POPUP "&Help" |
| 47 | BEGIN |
| 48 | #ifdef MESS |
| 49 | MENUITEM "&About MESS", ID_ABOUT |
| 50 | #else |
| 51 | MENUITEM "&About MAMEUI", ID_ABOUT |
| 52 | #endif |
| 53 | END |
| 54 | END |
| 55 | |
| 56 | IDR_UI_MENU MENU |
| 57 | BEGIN |
| 58 | POPUP "&File" |
| 59 | BEGIN |
| 60 | MENUITEM "&Play", ID_FILE_PLAY |
| 61 | MENUITEM SEPARATOR |
| 62 | MENUITEM "Play and &Record Input...", ID_FILE_PLAY_RECORD |
| 63 | MENUITEM "P&layback Input...", ID_FILE_PLAY_BACK |
| 64 | MENUITEM SEPARATOR |
| 65 | MENUITEM "Play and Record &Wave Output...", ID_FILE_PLAY_RECORD_WAVE |
| 66 | MENUITEM SEPARATOR |
| 67 | MENUITEM "Play and Record &MNG Output...", ID_FILE_PLAY_RECORD_MNG |
| 68 | MENUITEM SEPARATOR |
| 69 | MENUITEM "Loa&d Savestate...", ID_FILE_LOADSTATE |
| 70 | MENUITEM SEPARATOR |
| 71 | #ifdef MESS |
| 72 | MENUITEM "&Select Random System", ID_CONTEXT_SELECT_RANDOM |
| 73 | MENUITEM SEPARATOR |
| 74 | MENUITEM "Op&en Other Software...", ID_MESS_OPEN_SOFTWARE |
| 75 | MENUITEM "&Create Image...", ID_MESS_CREATE_SOFTWARE |
| 76 | #ifdef MAME_DEBUG |
| 77 | MENUITEM SEPARATOR |
| 78 | MENUITEM "Run Tests", ID_MESS_RUN_TESTS |
| 79 | #endif |
| 80 | #else /* !MESS */ |
| 81 | MENUITEM "&Select Random Game", ID_CONTEXT_SELECT_RANDOM |
| 82 | #endif |
| 83 | MENUITEM SEPARATOR |
| 84 | MENUITEM "Pr&operties", ID_GAME_PROPERTIES |
| 85 | MENUITEM SEPARATOR |
| 86 | #ifdef MESS |
| 87 | MENUITEM "&Audit all systems", ID_FILE_AUDIT |
| 88 | #else |
| 89 | MENUITEM "&Audit all games", ID_FILE_AUDIT |
| 90 | #endif |
| 91 | MENUITEM SEPARATOR |
| 92 | MENUITEM "E&xit", ID_FILE_EXIT |
| 93 | END |
| 94 | POPUP "&View" |
| 95 | BEGIN |
| 96 | MENUITEM "&Toolbar\tAlt+T", ID_VIEW_TOOLBARS |
| 97 | MENUITEM "&Status bar\tAlt+S", ID_VIEW_STATUS |
| 98 | MENUITEM "Fold&er List\tAlt+D", ID_VIEW_FOLDERS |
| 99 | MENUITEM "&Picture Area\tAlt+P", ID_VIEW_PICTURE_AREA |
| 100 | MENUITEM "Screenshot Ta&b\tAlt+B", ID_VIEW_PAGETAB |
| 101 | MENUITEM SEPARATOR |
| 102 | MENUITEM "&Fullscreen\tF11", ID_VIEW_FULLSCREEN |
| 103 | MENUITEM SEPARATOR |
| 104 | POPUP "S&how Pictures" |
| 105 | BEGIN |
| 106 | MENUITEM "&Snapshot", ID_TOGGLE_TAB_SCREENSHOT |
| 107 | MENUITEM "&Flyer", ID_TOGGLE_TAB_FLYER |
| 108 | MENUITEM "&Cabinet", ID_TOGGLE_TAB_CABINET |
| 109 | MENUITEM "&Marquee", ID_TOGGLE_TAB_MARQUEE |
| 110 | MENUITEM "&Title", ID_TOGGLE_TAB_TITLE |
| 111 | MENUITEM "Control &Panel", ID_TOGGLE_TAB_CONTROL_PANEL |
| 112 | MENUITEM "PC&B", ID_TOGGLE_TAB_PCB |
| 113 | |
| 114 | MENUITEM "&History", ID_TOGGLE_TAB_HISTORY |
| 115 | END |
| 116 | MENUITEM SEPARATOR |
| 117 | MENUITEM "L&arge Icons", ID_VIEW_LARGE_ICON |
| 118 | MENUITEM "S&mall Icons", ID_VIEW_SMALL_ICON |
| 119 | MENUITEM "&List", ID_VIEW_LIST_MENU |
| 120 | MENUITEM "&Details", ID_VIEW_DETAIL |
| 121 | MENUITEM "&Grouped", ID_VIEW_GROUPED |
| 122 | MENUITEM SEPARATOR |
| 123 | POPUP "Arrange &Icons" |
| 124 | BEGIN |
| 125 | MENUITEM "by &Name", ID_VIEW_BYGAME |
| 126 | MENUITEM "by D&irectory", ID_VIEW_BYDIRECTORY |
| 127 | MENUITEM "by &Manufacturer", ID_VIEW_BYMANUFACTURER |
| 128 | MENUITEM "by Times &Played", ID_VIEW_BYTIMESPLAYED |
| 129 | MENUITEM "by &Type", ID_VIEW_BYTYPE |
| 130 | MENUITEM "by &Date", ID_VIEW_BYYEAR |
| 131 | END |
| 132 | MENUITEM "Line &Up Icons", ID_VIEW_LINEUPICONS |
| 133 | MENUITEM SEPARATOR |
| 134 | MENUITEM "&Refresh\tF5", ID_UPDATE_GAMELIST |
| 135 | MENUITEM "&Custom Filters...\tCtrl+F", ID_CONTEXT_FILTERS |
| 136 | MENUITEM "Customi&ze Fields...", ID_CUSTOMIZE_FIELDS |
| 137 | END |
| 138 | POPUP "&Options" |
| 139 | BEGIN |
| 140 | #ifdef MESS |
| 141 | MENUITEM "System List &Font...", ID_OPTIONS_FONT |
| 142 | MENUITEM "System List &Clone Color...", ID_OPTIONS_CLONE_COLOR |
| 143 | MENUITEM "&Directories...", ID_OPTIONS_DIR |
| 144 | MENUITEM "Default System &Options...", ID_OPTIONS_DEFAULTS |
| 145 | #else |
| 146 | MENUITEM "Game List &Font...", ID_OPTIONS_FONT |
| 147 | MENUITEM "Game List &Clone Color...", ID_OPTIONS_CLONE_COLOR |
| 148 | MENUITEM "&Directories...", ID_OPTIONS_DIR |
| 149 | MENUITEM "Default Game &Options...", ID_OPTIONS_DEFAULTS |
| 150 | #endif |
| 151 | MENUITEM "&Reset to Default...", ID_OPTIONS_RESET_DEFAULTS |
| 152 | MENUITEM "&Interface Options...", ID_OPTIONS_INTERFACE |
| 153 | MENUITEM "&Background Image...", ID_OPTIONS_BG |
| 154 | END |
| 155 | POPUP "&Help" |
| 156 | BEGIN |
| 157 | #ifdef MESS |
| 158 | MENUITEM "&Mess Release Notes", ID_HELP_RELEASE |
| 159 | MENUITEM "&New Mess Features", ID_HELP_WHATS_NEW |
| 160 | #else |
| 161 | MENUITEM "&Contents\tF1", ID_HELP_CONTENTS |
| 162 | MENUITEM "&Troubleshooting", ID_HELP_TROUBLE |
| 163 | MENUITEM SEPARATOR |
| 164 | MENUITEM "&New Game Changes", ID_HELP_WHATS_NEWUI |
| 165 | MENUITEM "&Mame Release Notes", ID_HELP_WHATS_NEW |
| 166 | #endif |
| 167 | MENUITEM SEPARATOR |
| 168 | MENUITEM "&About", ID_HELP_ABOUT |
| 169 | END |
| 170 | END |
| 171 | |
| 172 | IDR_CONTEXT_MENU MENU |
| 173 | BEGIN |
| 174 | POPUP "Context Menu" |
| 175 | BEGIN |
| 176 | MENUITEM "&Play", ID_FILE_PLAY |
| 177 | MENUITEM SEPARATOR |
| 178 | MENUITEM "Play and &Record Input...", ID_FILE_PLAY_RECORD |
| 179 | MENUITEM SEPARATOR |
| 180 | MENUITEM "&Add to Custom Folder...", ID_CONTEXT_ADD_CUSTOM |
| 181 | MENUITEM "R&emove From This Folder", ID_CONTEXT_REMOVE_CUSTOM |
| 182 | MENUITEM "&Custom Filters...", ID_CONTEXT_FILTERS |
| 183 | MENUITEM SEPARATOR |
| 184 | #ifdef MESS |
| 185 | MENUITEM "&Select Random System", ID_CONTEXT_SELECT_RANDOM |
| 186 | #else |
| 187 | MENUITEM "&Select Random Game", ID_CONTEXT_SELECT_RANDOM |
| 188 | #endif |
| 189 | MENUITEM SEPARATOR |
| 190 | MENUITEM "Rese&t Playcount", ID_CONTEXT_RESET_PLAYCOUNT |
| 191 | MENUITEM "Reset Pla&y Time", ID_CONTEXT_RESET_PLAYTIME |
| 192 | MENUITEM SEPARATOR |
| 193 | MENUITEM "A&udit", ID_GAME_AUDIT |
| 194 | MENUITEM SEPARATOR |
| 195 | MENUITEM "Pr&operties", ID_GAME_PROPERTIES |
| 196 | MENUITEM "Source propert&ies", ID_FOLDER_SOURCEPROPERTIES |
| 197 | MENUITEM "&Vector properties", ID_FOLDER_VECTORPROPERTIES |
| 198 | END |
| 199 | END |
| 200 | |
| 201 | IDR_CONTEXT_HEADER MENU |
| 202 | BEGIN |
| 203 | POPUP "Header Context Menu" |
| 204 | BEGIN |
| 205 | MENUITEM "Sort &Ascending", ID_SORT_ASCENDING |
| 206 | MENUITEM "Sort &Descending", ID_SORT_DESCENDING |
| 207 | MENUITEM SEPARATOR |
| 208 | MENUITEM "Customi&ze Fields...", ID_CUSTOMIZE_FIELDS |
| 209 | END |
| 210 | END |
| 211 | |
| 212 | IDR_CONTEXT_TREE MENU |
| 213 | BEGIN |
| 214 | POPUP "Context Menu Tree" |
| 215 | BEGIN |
| 216 | MENUITEM "&Rename", ID_CONTEXT_RENAME_CUSTOM |
| 217 | MENUITEM "&Custom Filters...", ID_CONTEXT_FILTERS |
| 218 | MENUITEM SEPARATOR |
| 219 | POPUP "&Show Folders" |
| 220 | BEGIN |
| 221 | MENUITEM "overridden by code", ID_CONTEXT_SHOW_FOLDER_START |
| 222 | |
| 223 | END |
| 224 | MENUITEM SEPARATOR |
| 225 | MENUITEM "&Audit", ID_FOLDER_AUDIT |
| 226 | MENUITEM SEPARATOR |
| 227 | MENUITEM "&Properties", ID_FOLDER_PROPERTIES |
| 228 | END |
| 229 | END |
| 230 | |
| 231 | IDR_CONTEXT_SCREENSHOT MENU |
| 232 | BEGIN |
| 233 | POPUP "Context Screen Shot" |
| 234 | BEGIN |
| 235 | MENUITEM "Show Tab &Control", ID_VIEW_PAGETAB |
| 236 | MENUITEM SEPARATOR |
| 237 | POPUP "S&how Pictures" |
| 238 | BEGIN |
| 239 | MENUITEM "&Snapshot", ID_TOGGLE_TAB_SCREENSHOT |
| 240 | MENUITEM "&Flyer", ID_TOGGLE_TAB_FLYER |
| 241 | MENUITEM "&Cabinet", ID_TOGGLE_TAB_CABINET |
| 242 | MENUITEM "&Marquee", ID_TOGGLE_TAB_MARQUEE |
| 243 | MENUITEM "&Title", ID_TOGGLE_TAB_TITLE |
| 244 | MENUITEM "Control &Panel", ID_TOGGLE_TAB_CONTROL_PANEL |
| 245 | MENUITEM "PC&B", ID_TOGGLE_TAB_PCB |
| 246 | |
| 247 | MENUITEM "&History", ID_TOGGLE_TAB_HISTORY |
| 248 | END |
| 249 | MENUITEM SEPARATOR |
| 250 | MENUITEM "&Snapshot", ID_VIEW_TAB_SCREENSHOT |
| 251 | MENUITEM "&Flyer", ID_VIEW_TAB_FLYER |
| 252 | MENUITEM "&Cabinet", ID_VIEW_TAB_CABINET |
| 253 | MENUITEM "&Marquee", ID_VIEW_TAB_MARQUEE |
| 254 | MENUITEM "&Title", ID_VIEW_TAB_TITLE |
| 255 | MENUITEM "Control &Panel", ID_VIEW_TAB_CONTROL_PANEL |
| 256 | MENUITEM "PC&B", ID_VIEW_TAB_PCB |
| 257 | MENUITEM "&History", ID_VIEW_TAB_HISTORY |
| 258 | END |
| 259 | END |
| 260 | |
| 261 | |
| 262 | #ifdef APSTUDIO_INVOKED |
| 263 | ///////////////////////////////////////////////////////////////////////////// |
| 264 | // |
| 265 | // TEXTINCLUDE |
| 266 | // |
| 267 | |
| 268 | 1 TEXTINCLUDE |
| 269 | BEGIN |
| 270 | "resource.h\0" |
| 271 | END |
| 272 | |
| 273 | 2 TEXTINCLUDE |
| 274 | BEGIN |
| 275 | "#define NOWINRES\r\n" |
| 276 | "#include ""windows.h""\r\n" |
| 277 | "#include ""commctrl.h""\r\n" |
| 278 | "\0" |
| 279 | END |
| 280 | |
| 281 | 3 TEXTINCLUDE |
| 282 | BEGIN |
| 283 | "#include ""mamevers.rc"" // Version block\r\n" |
| 284 | "\r\n" |
| 285 | "\0" |
| 286 | END |
| 287 | |
| 288 | #endif // APSTUDIO_INVOKED |
| 289 | |
| 290 | |
| 291 | ///////////////////////////////////////////////////////////////////////////// |
| 292 | // |
| 293 | // Icon |
| 294 | // |
| 295 | |
| 296 | // Icon with lowest ID value placed first to ensure application icon |
| 297 | // remains consistent on all systems. |
| 298 | #ifdef MESS |
| 299 | IDI_MAME32_ICON ICON "res/mess.ico" |
| 300 | #else |
| 301 | IDI_MAMEUI_ICON ICON "res\\mameui.ico" |
| 302 | #endif |
| 303 | IDI_WIN_ROMS ICON "res\\win_roms.ico" |
| 304 | IDI_WIN_NOROMS ICON "res\\win_noro.ico" |
| 305 | IDI_WIN_UNKNOWN ICON "res\\win_unkn.ico" |
| 306 | IDI_WIN_CLONE ICON "res\\win_clone.ico" |
| 307 | IDI_WIN_REDX ICON "res\\win_redx.ico" |
| 308 | IDI_FOLDER_AVAILABLE ICON "res\\foldavail.ico" |
| 309 | IDI_FOLDER ICON "res\\folder.ico" |
| 310 | IDI_FOLDER_MANUFACTURER ICON "res\\foldmanu.ico" |
| 311 | IDI_FOLDER_OPEN ICON "res\\foldopen.ico" |
| 312 | IDI_FOLDER_UNAVAILABLE ICON "res\\foldunav.ico" |
| 313 | IDI_FOLDER_HORIZONTAL ICON "res\\horz.ico" |
| 314 | IDI_FOLDER_VERTICAL ICON "res\\vert.ico" |
| 315 | IDI_MANUFACTURER ICON "res\\manufact.ico" |
| 316 | IDI_FOLDER_YEAR ICON "res\\foldyear.ico" |
| 317 | IDI_FOLDER_SOURCE ICON "res\\foldsrc.ico" |
| 318 | IDI_WORKING ICON "res\\working.ico" |
| 319 | IDI_NONWORKING ICON "res\\nonwork.ico" |
| 320 | IDI_YEAR ICON "res\\year.ico" |
| 321 | IDI_KEYBOARD ICON "res\\keyboard.ico" |
| 322 | IDI_JOYSTICK ICON "res\\joystick.ico" |
| 323 | IDI_CPU ICON "res\\cpu.ico" |
| 324 | IDI_SOUND ICON "res\\samples.ico" |
| 325 | IDI_SOUNDTAB ICON "res\\sound.ico" |
| 326 | IDI_SOURCE ICON "res\\source.ico" |
| 327 | IDI_HARDDISK ICON "res\\harddisk.ico" |
| 328 | IDI_DISPLAY ICON "res\\display.ico" |
| 329 | IDI_CHECKMARK ICON "res\\checkmark.ico" |
| 330 | IDI_HEADER_UP ICON "res\\header_up.ico" |
| 331 | IDI_HEADER_DOWN ICON "res\\header_down.ico" |
| 332 | |
| 333 | #ifdef MESS |
| 334 | IDI_WIN_NOROMSNEEDED ICON "res/win_nrnd.ico" |
| 335 | IDI_WIN_MISSINGOPTROM ICON "res/win_noor.ico" |
| 336 | IDI_WIN_FLOP ICON "res/win_flop.ico" |
| 337 | IDI_WIN_CASS ICON "res/win_cass.ico" |
| 338 | IDI_WIN_SERL ICON "res/win_serl.ico" |
| 339 | IDI_WIN_SNAP ICON "res/win_snap.ico" |
| 340 | IDI_WIN_PRIN ICON "res/win_prin.ico" |
| 341 | IDI_WIN_HARD ICON "res/win_hard.ico" |
| 342 | IDI_WIN_CYLN ICON "res/win_cyln.ico" |
| 343 | IDI_WIN_PTAP ICON "res/win_ptap.ico" |
| 344 | IDI_WIN_PCRD ICON "res/win_pcrd.ico" |
| 345 | #endif |
| 346 | |
| 347 | ///////////////////////////////////////////////////////////////////////////// |
| 348 | // |
| 349 | // Dialog |
| 350 | // |
| 351 | |
| 352 | IDD_ABOUT DIALOG 0, 0, 296, 129 |
| 353 | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 354 | #ifdef MESS |
| 355 | CAPTION "About MESS" |
| 356 | #else |
| 357 | CAPTION "About MAMEUI" |
| 358 | #endif |
| 359 | FONT 8, "MS Shell Dlg" |
| 360 | BEGIN |
| 361 | DEFPUSHBUTTON "&OK",IDOK,200,109,50,14,WS_GROUP |
| 362 | #ifdef MESS |
| 363 | CTEXT "Multi Emulator Super System",IDC_STATIC,147,7,142, |
| 364 | 11,NOT WS_GROUP |
| 365 | CTEXT "Version 0",IDC_VERSION,147,18,142,11,NOT WS_GROUP |
| 366 | CTEXT "Copyright (C) 1998-2005 The MESS Team",IDC_STATIC,147, |
| 367 | 29,142,10,NOT WS_GROUP |
| 368 | CTEXT "MESS UI based on MAMEUI version by",IDC_STATIC,147,51,142,10,NOT |
| 369 | WS_GROUP |
| 370 | #else |
| 371 | CTEXT "Multiple Arcade Machine Emulator",IDC_STATIC,147,7,142, |
| 372 | 11,NOT WS_GROUP |
| 373 | CTEXT "Version 0",IDC_VERSION,147,18,142,11,NOT WS_GROUP |
| 374 | CTEXT "Copyright (C) 1997-2007 The MAME Team",IDC_STATIC,147, |
| 375 | 29,142,10,NOT WS_GROUP |
| 376 | CTEXT "MAMEUI version by",IDC_STATIC,147,51,142,10,NOT |
| 377 | WS_GROUP |
| 378 | #endif |
| 379 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,147,44,142,1 |
| 380 | CTEXT "Christopher Kirmse and the MAMEUI team",IDC_STATIC, |
| 381 | 147,62,142,9,NOT WS_GROUP |
| 382 | CTEXT "Additional MAMEUI code by",IDC_STATIC,147,74,142,9 |
| 383 | CTEXT "Mike Haaland, Andrew Kirmse, Jeff Miller",IDC_STATIC, |
| 384 | 147,85,142,9 |
| 385 | CTEXT "John Hardy IV and Michael Soderstrom",IDC_STATIC,147,96,142,9 |
| 386 | CONTROL "",IDC_ABOUT,"Static",SS_BITMAP | SS_SUNKEN,7,7,16,14 |
| 387 | END |
| 388 | |
| 389 | IDD_DIRECTX DIALOG 0, 0, 236, 69 |
| 390 | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 391 | #ifdef MESS |
| 392 | CAPTION "MESS" |
| 393 | #else |
| 394 | CAPTION "MAMEUI" |
| 395 | #endif |
| 396 | FONT 8, "MS Shell Dlg" |
| 397 | BEGIN |
| 398 | DEFPUSHBUTTON "Go to Microsoft's DirectX Web Page",IDB_WEB_PAGE,48,52, |
| 399 | 140,14 |
| 400 | EDITTEXT IDC_DIRECTX_HELP,7,0,222,48,ES_MULTILINE | |
| 401 | ES_AUTOHSCROLL | ES_READONLY |
| 402 | END |
| 403 | |
| 404 | IDD_AUDIT DIALOG 0, 0, 283, 188 |
| 405 | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 406 | CAPTION "File Audit" |
| 407 | FONT 8, "MS Shell Dlg" |
| 408 | BEGIN |
| 409 | PUSHBUTTON "&Pause",IDPAUSE,98,168,40,14 |
| 410 | PUSHBUTTON "&Cancel",IDCANCEL,144,168,40,14 |
| 411 | GROUPBOX "ROMs",IDC_STATIC,6,4,132,65 |
| 412 | LTEXT "Correct:",IDC_STATIC,51,28,32,8 |
| 413 | CONTROL "Progress1",IDC_ROMS_PROGRESS,"msctls_progress32", |
| 414 | WS_BORDER | 0x1,14,16,116,8 |
| 415 | LTEXT "Incorrect:",IDC_STATIC,51,42,32,8 |
| 416 | LTEXT "Total:",IDC_STATIC,51,56,32,8 |
| 417 | LTEXT "0",IDC_ROMS_CORRECT,87,28,20,8 |
| 418 | LTEXT "0",IDC_ROMS_INCORRECT,87,42,20,8 |
| 419 | LTEXT "0",IDC_ROMS_TOTAL,87,56,20,8 |
| 420 | GROUPBOX "Samples",IDC_STATIC,145,4,132,65 |
| 421 | CONTROL "Progress1",IDC_SAMPLES_PROGRESS,"msctls_progress32", |
| 422 | WS_BORDER | 0x1,153,16,116,8 |
| 423 | LTEXT "Correct:",IDC_STATIC,191,28,33,8 |
| 424 | LTEXT "Incorrect:",IDC_STATIC,191,42,33,8 |
| 425 | LTEXT "Total:",IDC_STATIC,191,56,33,8 |
| 426 | LTEXT "0",IDC_SAMPLES_CORRECT,227,28,20,8 |
| 427 | LTEXT "0",IDC_SAMPLES_INCORRECT,227,42,20,8 |
| 428 | LTEXT "0",IDC_SAMPLES_TOTAL,227,56,20,8 |
| 429 | GROUPBOX "Details",IDC_STATIC,6,72,271,90 |
| 430 | EDITTEXT IDC_AUDIT_DETAILS,12,82,259,74,ES_MULTILINE | |
| 431 | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL | |
| 432 | NOT WS_TABSTOP |
| 433 | END |
| 434 | |
| 435 | IDD_DIRECTORIES DIALOG 0, 0, 230, 107 |
| 436 | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 437 | CAPTION "Directories" |
| 438 | FONT 8, "MS Shell Dlg" |
| 439 | BEGIN |
| 440 | LTEXT "Show directories for:",IDC_STATIC,6,6,67,10 |
| 441 | COMBOBOX IDC_DIR_COMBO,6,18,160,79,CBS_DROPDOWNLIST | CBS_SORT | |
| 442 | WS_VSCROLL | WS_TABSTOP |
| 443 | LTEXT "Directories:",IDC_STATIC,6,38,38,10 |
| 444 | CONTROL "List1",IDC_DIR_LIST,"SysListView32",LVS_REPORT | |
| 445 | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_EDITLABELS | |
| 446 | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | |
| 447 | WS_TABSTOP,6,50,160,51 |
| 448 | DEFPUSHBUTTON "OK",IDOK,173,8,50,14 |
| 449 | PUSHBUTTON "Cancel",IDCANCEL,173,26,50,14 |
| 450 | PUSHBUTTON "Browse...",IDC_DIR_BROWSE,173,50,50,14 |
| 451 | PUSHBUTTON "Insert",IDC_DIR_INSERT,173,68,50,14 |
| 452 | PUSHBUTTON "Delete",IDC_DIR_DELETE,173,87,50,14 |
| 453 | END |
| 454 | |
| 455 | IDD_COLUMNS DIALOG 0, 0, 302, 145 |
| 456 | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 457 | CAPTION "Customize Fields" |
| 458 | FONT 8, "MS Shell Dlg" |
| 459 | BEGIN |
| 460 | LTEXT "Available fields:",IDC_STATIC,6,6,80,10,SS_CENTERIMAGE |
| 461 | CONTROL "List1",IDC_LISTAVAILABLECOLUMNS,"SysListView32", |
| 462 | LVS_LIST | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | |
| 463 | LVS_NOSORTHEADER | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6, |
| 464 | 18,90,100 |
| 465 | PUSHBUTTON "Add ->",IDC_BUTTONADD,102,18,46,14,WS_DISABLED |
| 466 | PUSHBUTTON "<- Remove",IDC_BUTTONREMOVE,102,36,46,14,WS_DISABLED |
| 467 | LTEXT "Show these fields in this order:",IDC_STATIC,154,6,96, |
| 468 | 10,SS_CENTERIMAGE |
| 469 | CONTROL "List1",IDC_LISTSHOWCOLUMNS,"SysListView32",LVS_LIST | |
| 470 | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | |
| 471 | WS_BORDER | WS_HSCROLL | WS_TABSTOP,154,18,90,100 |
| 472 | PUSHBUTTON "Move Up",IDC_BUTTONMOVEUP,250,18,46,14,WS_DISABLED |
| 473 | PUSHBUTTON "Move Down",IDC_BUTTONMOVEDOWN,250,36,46,14,WS_DISABLED |
| 474 | DEFPUSHBUTTON "OK",IDOK,105,124,44,14 |
| 475 | PUSHBUTTON "Cancel",IDCANCEL,155,124,44,14 |
| 476 | END |
| 477 | |
| 478 | IDD_PROP_CONTROLLER DIALOGEX 0, 0, 220, 240 |
| 479 | STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION |
| 480 | CAPTION "Controller Mapping" |
| 481 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 482 | BEGIN |
| 483 | ICON IDI_JOYSTICK,IDC_STATIC,20,10,20,20 |
| 484 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 485 | SS_NOPREFIX |
| 486 | GROUPBOX "Paddle device",IDC_STATIC,4,40,102,28 |
| 487 | COMBOBOX IDC_PADDLE,10,50,91,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 488 | WS_TABSTOP,0,HIDC_PADDLE |
| 489 | GROUPBOX "ADStick device",IDC_STATIC,4,71,102,28 |
| 490 | COMBOBOX IDC_ADSTICK,10,80,91,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 491 | WS_TABSTOP,0,HIDC_ADSTICK |
| 492 | GROUPBOX "Pedal device",IDC_STATIC,4,102,102,28 |
| 493 | COMBOBOX IDC_PEDAL,10,112,91,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 494 | WS_TABSTOP,0,HIDC_PEDAL |
| 495 | GROUPBOX "Mouse device",IDC_STATIC,4,133,102,28 |
| 496 | COMBOBOX IDC_MOUSE,10,142,90,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 497 | WS_TABSTOP,0,HIDC_MOUSE |
| 498 | GROUPBOX "Dial device",IDC_STATIC,113,40,102,28 |
| 499 | COMBOBOX IDC_DIAL,119,50,90,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 500 | WS_TABSTOP,0,HIDC_DIAL |
| 501 | GROUPBOX "Trackball device",IDC_STATIC,113,71,102,28 |
| 502 | COMBOBOX IDC_TRACKBALL,119,80,90,62,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 503 | WS_TABSTOP,0,HIDC_TRACKBALL |
| 504 | GROUPBOX "Lightgun device",IDC_STATIC,113,102,102,28 |
| 505 | COMBOBOX IDC_LIGHTGUNDEVICE,119,112,90,62,CBS_DROPDOWNLIST | |
| 506 | WS_VSCROLL | WS_TABSTOP,0,HIDC_LIGHTGUNDEVICE |
| 507 | GROUPBOX "Positional device",IDC_STATIC,113,133,102,28 |
| 508 | COMBOBOX IDC_POSITIONAL,119,142,90,62,CBS_DROPDOWNLIST | |
| 509 | WS_VSCROLL | WS_TABSTOP,0,HIDC_POSITIONAL |
| 510 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 511 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 512 | 0,0,HIDC_USE_DEFAULT |
| 513 | END |
| 514 | |
| 515 | IDD_PROP_SCREEN DIALOGEX 0, 0, 220, 240 |
| 516 | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 517 | CAPTION "Screen" |
| 518 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 519 | BEGIN |
| 520 | ICON IDI_DISPLAY,IDC_STATIC,20,10,21,20 |
| 521 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 522 | SS_NOPREFIX |
| 523 | GROUPBOX "Number of screens",IDC_STATIC,4,40,103,24 |
| 524 | CONTROL "GammaSlider",IDC_NUMSCREENS,"msctls_trackbar32", |
| 525 | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,50,75,10,0, |
| 526 | HIDC_NUMSCREENS |
| 527 | RTEXT "1",IDC_NUMSCREENSDISP,84,49,14,10,SS_CENTERIMAGE | NOT |
| 528 | WS_GROUP |
| 529 | GROUPBOX "Screen",IDC_STATIC,4,66,103,29 |
| 530 | COMBOBOX IDC_SCREEN,10,76,91,64,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 531 | WS_TABSTOP,0,HIDC_SCREEN |
| 532 | GROUPBOX "",IDC_STATIC,4,97,103,28 |
| 533 | CONTROL "Autoselect aspect",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | |
| 534 | WS_TABSTOP,10,97,73,10,0,HIDC_ASPECT |
| 535 | LTEXT "Aspect ratio",IDC_ASPECTRATIOTEXT,17,108,40,11, |
| 536 | SS_CENTERIMAGE | NOT WS_GROUP |
| 537 | EDITTEXT IDC_ASPECTRATION,60,108,14,12,ES_RIGHT | ES_AUTOHSCROLL | |
| 538 | ES_NUMBER,0,HIDC_ASPECTRATION |
| 539 | LTEXT ":",IDC_STATIC,76,108,8,10,SS_CENTERIMAGE | NOT WS_GROUP |
| 540 | EDITTEXT IDC_ASPECTRATIOD,80,108,14,12,ES_RIGHT | ES_AUTOHSCROLL | |
| 541 | ES_NUMBER,0,HIDC_ASPECTRATIOD |
| 542 | GROUPBOX "View",IDC_STATIC,4,128,103,28 |
| 543 | COMBOBOX IDC_VIEW,10,137,91,64,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 544 | WS_TABSTOP,0,HIDC_VIEW |
| 545 | GROUPBOX "Screennumber",IDC_SCREENSELECTTEXT,113,40,102,28 |
| 546 | COMBOBOX IDC_SCREENSELECT,119,50,90,64,CBS_DROPDOWNLIST | |
| 547 | WS_VSCROLL | WS_TABSTOP,0,HIDC_SCREENSELECT |
| 548 | GROUPBOX "Resolution",IDC_STATIC,113,71,102,76,WS_GROUP |
| 549 | GROUPBOX "Size",IDC_STATIC,119,81,90,28,WS_GROUP |
| 550 | COMBOBOX IDC_SIZES,126,91,77,70,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 551 | WS_TABSTOP,0,HIDC_SIZES |
| 552 | GROUPBOX "Refresh",IDC_REFRESHTEXT,119,112,90,28,WS_GROUP |
| 553 | COMBOBOX IDC_REFRESH,126,121,77,76,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 554 | WS_TABSTOP,0,HIDC_REFRESH |
| 555 | CONTROL "Switch resolutions to fit",IDC_SWITCHRES,"Button", |
| 556 | BS_AUTOCHECKBOX | WS_TABSTOP,119,151,93,10,0, |
| 557 | HIDC_SWITCHRES |
| 558 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 559 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 560 | 0,0,HIDC_USE_DEFAULT |
| 561 | END |
| 562 | |
| 563 | IDD_PROP_GAME DIALOG 0, 0, 220, 240 |
| 564 | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 565 | CAPTION "General" |
| 566 | FONT 8, "MS Shell Dlg" |
| 567 | BEGIN |
| 568 | ICON IDI_MAMEUI_ICON,IDC_GAME_ICON,20,10,20,20 |
| 569 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 570 | SS_NOPREFIX |
| 571 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,20,38,178,1 |
| 572 | LTEXT "Manufactured:",IDC_STATIC,18,45,47,8 |
| 573 | LTEXT "Static",IDC_PROP_MANUFACTURED,75,45,139,9,SS_NOPREFIX |
| 574 | LTEXT "Status:",IDC_STATIC,18,55,47,8 |
| 575 | LTEXT "Static",IDC_PROP_STATUS,75,55,139,30 |
| 576 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,85,178,1 |
| 577 | LTEXT "CPU:",IDC_STATIC,18,90,47,8 |
| 578 | LTEXT "Static\nStatic\nStatic\nStatic\nStatic",IDC_PROP_CPU,75, |
| 579 | 90,139,40 |
| 580 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,130,178,1 |
| 581 | LTEXT "Sound:",IDC_STATIC,18,135,47,8 |
| 582 | LTEXT "Static\nStatic\nStatic\nStatic\nStatic",IDC_PROP_SOUND, |
| 583 | 75,135,139,45 |
| 584 | CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,18,181,178,1 |
| 585 | LTEXT "Screen:",IDC_STATIC,18,188,47,8 |
| 586 | LTEXT "Static",IDC_PROP_SCREEN,75,188,139,8 |
| 587 | LTEXT "Colors:",IDC_STATIC,18,198,47,8 |
| 588 | LTEXT "Static",IDC_PROP_COLORS,75,198,139,8 |
| 589 | LTEXT "Clone of:",IDC_PROP_CLONEOF_TEXT,18,218,50,8 |
| 590 | LTEXT "Static",IDC_PROP_CLONEOF,75,218,130,18 |
| 591 | LTEXT "Source:",IDC_STATIC,18,208,47,8 |
| 592 | LTEXT "Static",IDC_PROP_SOURCE,75,208,139,8 |
| 593 | END |
| 594 | |
| 595 | IDD_PROP_AUDIT DIALOG 0, 0, 220, 240 |
| 596 | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 597 | CAPTION "Audit" |
| 598 | FONT 8, "MS Shell Dlg" |
| 599 | BEGIN |
| 600 | ICON IDI_CHECKMARK,IDC_STATIC,20,10,20,20 |
| 601 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 602 | SS_NOPREFIX |
| 603 | LTEXT "ROM check:",IDC_STATIC,10,40,50,8 |
| 604 | LTEXT "Checking...",IDC_PROP_ROMS,66,40,139,8 |
| 605 | LTEXT "Sample check:",IDC_STATIC,10,52,50,8 |
| 606 | LTEXT "Checking...",IDC_PROP_SAMPLES,66,52,139,8 |
| 607 | GROUPBOX "Details",IDC_STATIC,4,64,211,171 |
| 608 | EDITTEXT IDC_AUDIT_DETAILS_PROP,10,74,199,155,ES_MULTILINE | |
| 609 | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL | |
| 610 | NOT WS_TABSTOP |
| 611 | END |
| 612 | |
| 613 | IDD_PROP_DISPLAY DIALOGEX 0, 0, 220, 240 |
| 614 | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 615 | CAPTION "Display" |
| 616 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 617 | BEGIN |
| 618 | ICON IDI_DISPLAY,IDC_STATIC,20,10,20,20 |
| 619 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,169,25, |
| 620 | SS_NOPREFIX |
| 621 | CONTROL "Run in a window",IDC_WINDOWED,"Button",BS_AUTOCHECKBOX | |
| 622 | WS_TABSTOP,10,40,69,10,0,HIDC_WINDOWED |
| 623 | CONTROL "Start out maximized",IDC_MAXIMIZE,"Button", |
| 624 | BS_AUTOCHECKBOX | WS_TABSTOP,10,52,74,10,0,HIDC_MAXIMIZE |
| 625 | CONTROL "Enforce aspect ratio",IDC_KEEPASPECT,"Button", |
| 626 | BS_AUTOCHECKBOX | WS_TABSTOP,10,64,77,10,0, |
| 627 | HIDC_KEEPASPECT |
| 628 | CONTROL "Throttle",IDC_THROTTLE,"Button",BS_AUTOCHECKBOX | |
| 629 | WS_TABSTOP,10,76,39,10,0,HIDC_THROTTLE |
| 630 | GROUPBOX "Bitmap prescaling",IDC_STATIC,4,89,103,24 |
| 631 | CONTROL "GammaSlider",IDC_PRESCALE,"msctls_trackbar32",TBS_BOTH | |
| 632 | TBS_NOTICKS | WS_TABSTOP,10,99,71,10,0,HIDC_PRESCALE |
| 633 | RTEXT "1.00",IDC_PRESCALEDISP,84,98,14,11,SS_CENTERIMAGE | NOT |
| 634 | WS_GROUP |
| 635 | GROUPBOX "Gamma Correction",IDC_STATIC,4,115,103,24 |
| 636 | CONTROL "GammaSlider",IDC_GAMMA,"msctls_trackbar32",TBS_BOTH | |
| 637 | TBS_NOTICKS | WS_TABSTOP,10,125,71,10,0,HIDC_GAMMA |
| 638 | RTEXT "2.00",IDC_GAMMADISP,84,124,14,10,SS_CENTERIMAGE | NOT |
| 639 | WS_GROUP |
| 640 | GROUPBOX "Brightness Correction",IDC_STATIC,4,141,103,24 |
| 641 | CONTROL "GammaSlider",IDC_BRIGHTCORRECT,"msctls_trackbar32", |
| 642 | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,151,71,10,0, |
| 643 | HIDC_BRIGHTCORRECT |
| 644 | RTEXT "1.00",IDC_BRIGHTCORRECTDISP,84,150,14,10,SS_CENTERIMAGE | |
| 645 | NOT WS_GROUP |
| 646 | GROUPBOX "Contrast Correction",IDC_STATIC,4,167,103,24 |
| 647 | CONTROL "GammaSlider",IDC_CONTRAST,"msctls_trackbar32",TBS_BOTH | |
| 648 | TBS_NOTICKS | WS_TABSTOP,10,176,71,10,0,HIDC_CONTRAST |
| 649 | RTEXT "1.00",IDC_CONTRASTDISP,84,175,14,11,SS_CENTERIMAGE | |
| 650 | NOT WS_GROUP |
| 651 | GROUPBOX "Pause Brightness",IDC_STATIC,4,193,103,24 |
| 652 | CONTROL "Slider1",IDC_PAUSEBRIGHT,"msctls_trackbar32",TBS_BOTH | |
| 653 | TBS_NOTICKS | WS_TABSTOP,10,203,71,10,0,HIDC_PAUSEBRIGHT |
| 654 | RTEXT "0.65",IDC_PAUSEBRIGHTDISP,84,202,14,11,SS_CENTERIMAGE | |
| 655 | NOT WS_GROUP |
| 656 | GROUPBOX "Videomode",IDC_STATIC,113,40,102,28 |
| 657 | COMBOBOX IDC_VIDEO_MODE,119,50,90,50,CBS_DROPDOWNLIST | CBS_SORT | |
| 658 | WS_VSCROLL | WS_TABSTOP,0,HIDC_VIDEO_MODE |
| 659 | GROUPBOX "Rotation",IDC_STATIC,113,71,102,55 |
| 660 | COMBOBOX IDC_ROTATE,119,81,90,57,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 661 | WS_TABSTOP,0,HIDC_ROTATE |
| 662 | CONTROL "Flip screen upside-down",IDC_FLIPY,"Button", |
| 663 | BS_AUTOCHECKBOX | WS_TABSTOP,119,98,91,10,0,HIDC_FLIPY |
| 664 | CONTROL "Flip screen left-right",IDC_FLIPX,"Button", |
| 665 | BS_AUTOCHECKBOX | WS_TABSTOP,119,110,77,10,0,HIDC_FLIPX |
| 666 | GROUPBOX "Direct3D",IDC_STATIC,113,128,102,57 |
| 667 | CONTROL "Use Bilinear filtering",IDC_D3D_FILTER,"Button", |
| 668 | BS_AUTOCHECKBOX | WS_TABSTOP,119,138,85,10,0, |
| 669 | HIDC_D3D_FILTER |
| 670 | GROUPBOX "Version",IDC_STATIC,119,150,90,28 |
| 671 | COMBOBOX IDC_D3D_VERSION,125,160,78,95,CBS_DROPDOWNLIST | |
| 672 | WS_VSCROLL | WS_TABSTOP,0,HIDC_D3D_VERSION |
| 673 | GROUPBOX "DirectDraw",IDC_STATIC,113,187,102,26 |
| 674 | CONTROL "Stretch using hardware",IDC_HWSTRETCH,"Button", |
| 675 | BS_AUTOCHECKBOX | WS_TABSTOP,119,197,85,10,0, |
| 676 | HIDC_HWSTRETCH |
| 677 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 678 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 679 | 0,0,HIDC_USE_DEFAULT |
| 680 | END |
| 681 | |
| 682 | IDD_PROP_SOUND DIALOGEX 0, 0, 220, 240 |
| 683 | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 684 | CAPTION "Sound" |
| 685 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 686 | BEGIN |
| 687 | ICON IDI_SOUNDTAB,IDC_STATIC,20,10,20,20 |
| 688 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 689 | SS_NOPREFIX |
| 690 | GROUPBOX "",IDC_STATIC,4,40,211,122 |
| 691 | CONTROL "Enable sound and sound CPUs",IDC_USE_SOUND,"Button", |
| 692 | BS_AUTOCHECKBOX | WS_TABSTOP,10,40,112,10,0, |
| 693 | HIDC_USE_SOUND |
| 694 | CONTROL "Use samples",IDC_SAMPLES,"Button",BS_AUTOCHECKBOX | |
| 695 | WS_TABSTOP,10,52,55,10,0,HIDC_SAMPLES |
| 696 | GROUPBOX "Sample rate",IDC_RATETEXT,60,65,100,28 |
| 697 | COMBOBOX IDC_SAMPLERATE,66,75,88,60,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 698 | WS_TABSTOP,0,HIDC_SAMPLERATE |
| 699 | GROUPBOX "Volume attenuation",IDC_STATIC,60,96,100,28 |
| 700 | CONTROL "Slider1",IDC_VOLUME,"msctls_trackbar32",TBS_BOTH | |
| 701 | TBS_NOTICKS | WS_TABSTOP,66,108,68,10,0,HIDC_VOLUME |
| 702 | RTEXT "0dB",IDC_VOLUMEDISP,132,107,20,11,SS_CENTERIMAGE |
| 703 | GROUPBOX "Audio latency",IDC_AUDIO_LATENCY_TEXT,60,127,100,28 |
| 704 | CONTROL "Slider1",IDC_AUDIO_LATENCY,"msctls_trackbar32",TBS_BOTH | |
| 705 | TBS_NOTICKS | WS_TABSTOP,66,139,68,10,0, |
| 706 | HIDC_AUDIO_LATENCY |
| 707 | RTEXT "1/5",IDC_AUDIO_LATENCY_DISP,132,138,20,11, |
| 708 | SS_CENTERIMAGE |
| 709 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 710 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 711 | 0,0,HIDC_USE_DEFAULT |
| 712 | END |
| 713 | |
| 714 | IDD_PROP_ADVANCED DIALOGEX 0, 0, 220, 240 |
| 715 | STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION |
| 716 | CAPTION "Advanced" |
| 717 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 718 | BEGIN |
| 719 | ICON IDI_DISPLAY,IDC_STATIC,20,10,20,20 |
| 720 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 721 | SS_NOPREFIX |
| 722 | CONTROL "Triple buffering",IDC_TRIPLE_BUFFER,"Button", |
| 723 | BS_AUTOCHECKBOX | WS_TABSTOP,10,40,93,10,0, |
| 724 | HIDC_TRIPLE_BUFFER |
| 725 | CONTROL "Sync to monitor refresh",IDC_SYNCREFRESH,"Button", |
| 726 | BS_AUTOCHECKBOX | WS_TABSTOP,10,52,93,10,0, |
| 727 | HIDC_SYNCREFRESH |
| 728 | CONTROL "Wait for vertical sync",IDC_WAITVSYNC,"Button", |
| 729 | BS_AUTOCHECKBOX | WS_TABSTOP,10,64,93,10,0, |
| 730 | HIDC_WAITVSYNC |
| 731 | CONTROL "Refresh speed",IDC_REFRESHSPEED,"Button", |
| 732 | BS_AUTOCHECKBOX | WS_TABSTOP,10,76,93,10,0, |
| 733 | HIDC_REFRESHSPEED |
| 734 | GROUPBOX "Frame skipping",IDC_STATIC,4,88,103,42 |
| 735 | CONTROL "Automatic",IDC_AUTOFRAMESKIP,"Button",BS_AUTOCHECKBOX | |
| 736 | WS_TABSTOP,10,98,77,10,0,HIDC_AUTOFRAMESKIP |
| 737 | COMBOBOX IDC_FRAMESKIP,10,111,91,88,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 738 | WS_TABSTOP,0,HIDC_FRAMESKIP |
| 739 | GROUPBOX "Full screen gamma",IDC_FSGAMMATEXT,113,40,102,24 |
| 740 | CONTROL "Slider1",IDC_FSGAMMA,"msctls_trackbar32",TBS_BOTH | |
| 741 | TBS_NOTICKS | WS_TABSTOP,119,50,71,10,0,HIDC_FSGAMMA |
| 742 | RTEXT "2.00",IDC_FSGAMMADISP,193,49,16,10,SS_CENTERIMAGE | NOT |
| 743 | WS_GROUP |
| 744 | GROUPBOX "Full screen brightness",IDC_FSBRIGHTNESSTEXT,113,67,102, |
| 745 | 24 |
| 746 | CONTROL "Slider1",IDC_FSBRIGHTNESS,"msctls_trackbar32",TBS_BOTH | |
| 747 | TBS_NOTICKS | WS_TABSTOP,119,77,71,10,0, |
| 748 | HIDC_FSBRIGHTNESS |
| 749 | RTEXT "2.00",IDC_FSBRIGHTNESSDISP,193,76,16,10,SS_CENTERIMAGE | |
| 750 | NOT WS_GROUP |
| 751 | GROUPBOX "Full screen contrast",IDC_FSCONTRASTTEXT,113,94,102,24 |
| 752 | CONTROL "Slider1",IDC_FSCONTRAST,"msctls_trackbar32",TBS_BOTH | |
| 753 | TBS_NOTICKS | WS_TABSTOP,119,104,71,10,0,HIDC_FSCONTRAST |
| 754 | RTEXT "2.00",IDC_FSCONTRASTDISP,193,103,16,11,SS_CENTERIMAGE | |
| 755 | NOT WS_GROUP |
| 756 | GROUPBOX "Emulation speed",IDC_SPEEDTEXT,4,133,211,24 |
| 757 | CONTROL "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_BOTH | |
| 758 | TBS_NOTICKS | WS_TABSTOP,10,143,180,10,0,HIDC_SPEED |
| 759 | RTEXT "1.00",IDC_SPEEDDISP,189,142,20,11,SS_CENTERIMAGE | NOT |
| 760 | WS_GROUP |
| 761 | GROUPBOX "Effect",IDC_STATIC,4,160,211,50 |
| 762 | EDITTEXT IDC_EFFECT,10,170,200,14,ES_AUTOHSCROLL | WS_DISABLED |
| 763 | PUSHBUTTON "Select Effect",IDC_SELECT_EFFECT,10,189,60,14,0,0, |
| 764 | HIDC_SELECT_EFFECT |
| 765 | PUSHBUTTON "Reset Effect",IDC_RESET_EFFECT,150,189,60,14,0,0, |
| 766 | HIDC_RESET_EFFECT |
| 767 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 768 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 769 | 0,0,HIDC_USE_DEFAULT |
| 770 | END |
| 771 | |
| 772 | IDD_PROP_INPUT DIALOGEX 0, 0, 220, 240 |
| 773 | STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION |
| 774 | CAPTION "Controllers" |
| 775 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 776 | BEGIN |
| 777 | ICON IDI_JOYSTICK,IDC_STATIC,20,10,20,20 |
| 778 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 779 | SS_NOPREFIX |
| 780 | CONTROL "Enable mouse input",IDC_USE_MOUSE,"Button", |
| 781 | BS_AUTOCHECKBOX | WS_TABSTOP,10,40,86,10,0, |
| 782 | HIDC_USE_MOUSE |
| 783 | CONTROL "Enable steadykey support",IDC_STEADYKEY,"Button", |
| 784 | BS_AUTOCHECKBOX | WS_TABSTOP,10,52,95,10,0, |
| 785 | HIDC_STEADYKEY |
| 786 | GROUPBOX "",IDC_STATIC,4,64,103,74 |
| 787 | CONTROL "Enable joystick input",IDC_JOYSTICK,"Button", |
| 788 | BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,10,64,78,10,0, |
| 789 | HIDC_JOYSTICK |
| 790 | GROUPBOX "Joystick deadzone",IDC_JDZTEXT,10,76,91,28 |
| 791 | CONTROL "IntensitySlider",IDC_JDZ,"msctls_trackbar32",TBS_BOTH | |
| 792 | TBS_NOTICKS | WS_TABSTOP,15,88,60,10,0,HIDC_JDZ |
| 793 | RTEXT "0.3",IDC_JDZDISP,76,87,16,11,SS_CENTERIMAGE | NOT |
| 794 | WS_GROUP |
| 795 | GROUPBOX "Default input layout",IDC_STATIC,113,40,102,28 |
| 796 | COMBOBOX IDC_DEFAULT_INPUT,119,50,90,53,CBS_DROPDOWNLIST | |
| 797 | WS_VSCROLL | WS_TABSTOP,0,HIDC_DEFAULT_INPUT |
| 798 | GROUPBOX "",IDC_STATIC,113,71,102,66 |
| 799 | CONTROL "Enable lightgun input",IDC_LIGHTGUN,"Button", |
| 800 | BS_AUTOCHECKBOX | WS_TABSTOP,119,71,80,10,0, |
| 801 | HIDC_LIGHTGUN |
| 802 | CONTROL "Offscreen shots reload",IDC_RELOAD,"Button", |
| 803 | BS_AUTOCHECKBOX | WS_TABSTOP,119,83,86,10,0,HIDC_RELOAD |
| 804 | CONTROL "Dual lightguns",IDC_DUAL_LIGHTGUN,"Button", |
| 805 | BS_AUTOCHECKBOX | WS_TABSTOP,119,96,86,10,0, |
| 806 | HIDC_DUAL_LIGHTGUN |
| 807 | CONTROL "Multiple keyboards",IDC_MULTIKEYBOARD,"Button", |
| 808 | BS_AUTOCHECKBOX | WS_TABSTOP,119,109,75,10,0, |
| 809 | HIDC_MULTIKEYBOARD |
| 810 | CONTROL "Multiple mice",IDC_MULTIMOUSE,"Button",BS_AUTOCHECKBOX | |
| 811 | WS_TABSTOP,119,122,56,10,0,HIDC_MULTIMOUSE |
| 812 | GROUPBOX "Joystick saturation",IDC_JSATTEXT,10,106,91,28 |
| 813 | CONTROL "IntensitySlider",IDC_JSAT,"msctls_trackbar32",TBS_BOTH | |
| 814 | TBS_NOTICKS | WS_TABSTOP,16,118,60,10,0,HIDC_JSAT |
| 815 | RTEXT "0.85",IDC_JSATDISP,76,116,16,11,SS_CENTERIMAGE | NOT |
| 816 | WS_GROUP |
| 817 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 818 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 819 | 0,0,HIDC_USE_DEFAULT |
| 820 | END |
| 821 | |
| 822 | IDD_PROP_MISC DIALOGEX 0, 0, 220, 240 |
| 823 | STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION |
| 824 | CAPTION "Miscellaneous" |
| 825 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 826 | BEGIN |
| 827 | ICON IDI_MAMEUI_ICON,IDC_STATIC,20,10,20,20 |
| 828 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 829 | SS_NOPREFIX |
| 830 | #ifdef MESS |
| 831 | CONTROL "Enable system cheats",IDC_CHEAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,86,10,0,HIDC_CHEAT |
| 832 | #else |
| 833 | CONTROL "Enable game cheats",IDC_CHEAT,"Button",BS_AUTOCHECKBOX | |
| 834 | WS_TABSTOP,10,40,86,10,0,HIDC_CHEAT |
| 835 | #endif |
| 836 | CONTROL "Error log (for developers)",IDC_LOG,"Button", |
| 837 | BS_AUTOCHECKBOX | WS_TABSTOP,10,52,96,10,0,HIDC_LOG |
| 838 | CONTROL "Sleep when possible",IDC_SLEEP,"Button",BS_AUTOCHECKBOX | |
| 839 | WS_TABSTOP,10,64,86,10,0,HIDC_SLEEP |
| 840 | CONTROL "Enable game debugger",IDC_DEBUG,"Button", |
| 841 | BS_AUTOCHECKBOX | WS_TABSTOP,10,76,86,10,0,HIDC_DEBUG |
| 842 | #ifdef MESS |
| 843 | CONTROL "Skip system info",IDC_SKIP_GAME_INFO,"Button", |
| 844 | BS_AUTOCHECKBOX | WS_TABSTOP,10,88,96,10,0, |
| 845 | HIDC_SKIP_GAME_INFO |
| 846 | #else |
| 847 | CONTROL "Skip game info",IDC_SKIP_GAME_INFO,"Button", |
| 848 | BS_AUTOCHECKBOX | WS_TABSTOP,10,88,96,10,0, |
| 849 | HIDC_SKIP_GAME_INFO |
| 850 | #endif |
| 851 | CONTROL "Save game state on exit",IDC_ENABLE_AUTOSAVE,"Button", |
| 852 | BS_AUTOCHECKBOX | WS_TABSTOP,10,100,96,10,0, |
| 853 | HIDC_ENABLE_AUTOSAVE |
| 854 | CONTROL "Multi-threaded rendering",IDC_MULTITHREAD_RENDERING, |
| 855 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,112,96,10,0, |
| 856 | HIDC_MULTITHREAD_RENDERING |
| 857 | GROUPBOX "Thread Priority",IDC_HIGH_PRIORITY_TEXT,4,124,103,34 |
| 858 | CONTROL "Slider1",IDC_HIGH_PRIORITY,"msctls_trackbar32",TBS_BOTH | |
| 859 | TBS_NOTICKS | WS_TABSTOP,10,135,75,10,0, |
| 860 | HIDC_HIGH_PRIORITY |
| 861 | LTEXT "idle",IDC_STATIC,13,144,12,8 |
| 862 | RTEXT "-15",IDC_HIGH_PRIORITYTXT,84,134,14,10,SS_CENTERIMAGE |
| 863 | RTEXT "real-time",IDC_STATIC,53,144,28,8 |
| 864 | GROUPBOX "Artwork options",IDC_STATIC,113,40,102,61 |
| 865 | CONTROL "Backdrops",IDC_BACKDROPS,"Button",BS_AUTOCHECKBOX | |
| 866 | WS_TABSTOP,119,50,86,10,0,HIDC_BACKDROPS |
| 867 | CONTROL "Bezels",IDC_BEZELS,"Button",BS_AUTOCHECKBOX | |
| 868 | WS_TABSTOP,119,62,86,10,0,HIDC_BEZELS |
| 869 | CONTROL "Overlays",IDC_OVERLAYS,"Button",BS_AUTOCHECKBOX | |
| 870 | WS_TABSTOP,119,74,84,10,0,HIDC_OVERLAYS |
| 871 | CONTROL "Crop artwork",IDC_ARTWORK_CROP,"Button",BS_AUTOCHECKBOX | |
| 872 | WS_TABSTOP,119,86,53,10,0,HIDC_ARTWORK_CROP |
| 873 | GROUPBOX "BIOS",IDC_STATIC,113,104,102,28 |
| 874 | COMBOBOX IDC_BIOS,119,114,90,60,CBS_DROPDOWNLIST | WS_VSCROLL | |
| 875 | WS_TABSTOP,0,HIDC_BIOS |
| 876 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 877 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 878 | 0,0,HIDC_USE_DEFAULT |
| 879 | #ifdef MESS |
| 880 | CONTROL "Skip warnings",IDC_SKIP_WARNINGS,"Button", |
| 881 | BS_AUTOCHECKBOX | WS_TABSTOP,10,180,86,10,0 |
| 882 | CONTROL "Use New UI",IDC_USE_NEW_UI,"Button", |
| 883 | BS_AUTOCHECKBOX | WS_TABSTOP,10,192,86,10,0 |
| 884 | #endif |
| 885 | END |
| 886 | |
| 887 | IDD_PROP_VECTOR DIALOGEX 0, 0, 220, 240 |
| 888 | STYLE DS_SETFONT | WS_CHILD | WS_CAPTION |
| 889 | CAPTION "Vector" |
| 890 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 891 | BEGIN |
| 892 | ICON IDI_MAMEUI_ICON,IDC_STATIC,20,10,20,20 |
| 893 | LTEXT "Title\nDirectory\nExtra",IDC_PROP_TITLE,52,9,161,25, |
| 894 | SS_NOPREFIX |
| 895 | CONTROL "Draw antialiased vectors",IDC_ANTIALIAS,"Button", |
| 896 | BS_AUTOCHECKBOX | WS_TABSTOP,10,40,92,10,0, |
| 897 | HIDC_ANTIALIAS |
| 898 | GROUPBOX "Beam width",IDC_BEAMTEXT,60,53,100,28 |
| 899 | CONTROL "BeamSlider",IDC_BEAM,"msctls_trackbar32",TBS_BOTH | |
| 900 | TBS_NOTICKS | WS_TABSTOP,66,65,64,10,0,HIDC_BEAM |
| 901 | RTEXT "16.00",IDC_BEAMDISP,132,64,20,11,SS_CENTERIMAGE |
| 902 | GROUPBOX "Flicker",IDC_FLICKERTEXT,60,84,100,28 |
| 903 | CONTROL "FlickerSlider",IDC_FLICKER,"msctls_trackbar32",TBS_BOTH | |
| 904 | TBS_NOTICKS | WS_TABSTOP,66,96,64,10,0,HIDC_FLICKER |
| 905 | RTEXT "100.00",IDC_FLICKERDISP,128,95,24,11,SS_CENTERIMAGE | |
| 906 | NOT WS_GROUP |
| 907 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 908 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 909 | 0,0,HIDC_USE_DEFAULT |
| 910 | END |
| 911 | |
| 912 | #ifdef MESS |
| 913 | IDD_MAIN DIALOGEX 0, 0, 364, 206 |
| 914 | #else |
| 915 | IDD_MAIN DIALOGEX 0, 0, 304, 206 |
| 916 | #endif |
| 917 | STYLE DS_SETFONT | DS_3DLOOK | DS_NOFAILCREATE | WS_MINIMIZEBOX | |
| 918 | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME |
| 919 | EXSTYLE WS_EX_CONTROLPARENT |
| 920 | CAPTION "MAMEUI - overwritten at runtime" |
| 921 | CLASS "MainClass" |
| 922 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 923 | BEGIN |
| 924 | CONTROL "",IDC_DIVIDER,"Static",SS_ETCHEDHORZ,0,5,304,1 |
| 925 | CONTROL "Tree1",IDC_TREE,"SysTreeView32",TVS_HASBUTTONS | |
| 926 | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS | |
| 927 | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER | |
| 928 | WS_TABSTOP,5,28,48,172 |
| 929 | CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | |
| 930 | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | |
| 931 | LVS_OWNERDRAWFIXED | WS_BORDER | WS_TABSTOP,65,28,42,172 |
| 932 | GROUPBOX "",IDC_SPLITTER,55,28,8,172,BS_NOTIFY | NOT WS_VISIBLE |
| 933 | GROUPBOX "",IDC_SPLITTER2,109,28,8,172,BS_NOTIFY | NOT WS_VISIBLE |
| 934 | #ifdef MESS |
| 935 | CONTROL "",IDC_SSTAB,"SysTabControl32",TCS_HOTTRACK,121,0,181,18 |
| 936 | CONTROL "",IDC_SWTAB,"SysTabControl32",TCS_HOTTRACK,119,0,200,100 |
| 937 | CONTROL "List2",IDC_SWLIST,"SysListView32",LVS_REPORT | |
| 938 | LVS_SHOWSELALWAYS | LVS_OWNERDRAWFIXED | WS_BORDER | |
| 939 | WS_TABSTOP,119,60,42,140 |
| 940 | CONTROL "",IDC_SWDEVVIEW,"MessSoftwareDevView",WS_VISIBLE,119,0,200,100 |
| 941 | GROUPBOX "",IDC_SPLITTER3,163,28,8,172,BS_NOTIFY | NOT WS_VISIBLE |
| 942 | CONTROL "",IDC_SSFRAME,"Static",SS_ETCHEDFRAME,175,11,181,194 |
| 943 | CONTROL "",IDC_SSPICTURE,"Static",SS_BITMAP | SS_NOTIFY | |
| 944 | SS_CENTERIMAGE | NOT WS_VISIBLE,195,18,141,127 |
| 945 | EDITTEXT IDC_HISTORY,183,150,167,49,ES_MULTILINE | ES_READONLY | |
| 946 | WS_VSCROLL,WS_EX_STATICEDGE,HIDC_HISTORY |
| 947 | #else |
| 948 | CONTROL "",IDC_SSFRAME,"Static",SS_ETCHEDFRAME | SS_NOTIFY,121, |
| 949 | 11,181,194 |
| 950 | CONTROL "",IDC_SSTAB,"SysTabControl32",TCS_HOTTRACK,121,0,181,18 |
| 951 | CONTROL "",IDC_SSPICTURE,"Static",SS_BITMAP | NOT WS_VISIBLE,141, |
| 952 | 18,141,127 |
| 953 | EDITTEXT IDC_HISTORY,129,150,167,49,ES_MULTILINE | ES_READONLY | |
| 954 | NOT WS_BORDER | WS_VSCROLL | NOT WS_TABSTOP,0, |
| 955 | HIDC_HISTORY |
| 956 | #endif |
| 957 | END |
| 958 | |
| 959 | IDD_FILTERS DIALOGEX 0, 0, 190, 182 |
| 960 | STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | |
| 961 | WS_SYSMENU |
| 962 | EXSTYLE WS_EX_CONTEXTHELP |
| 963 | #ifdef MESS |
| 964 | CAPTION "System Filters" |
| 965 | #else |
| 966 | CAPTION "Game Filters" |
| 967 | #endif |
| 968 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 969 | BEGIN |
| 970 | #ifdef MESS |
| 971 | GROUPBOX "System filters",IDC_STATIC,6,4,178,85 |
| 972 | #else |
| 973 | GROUPBOX "Game filters",IDC_STATIC,6,4,178,85 |
| 974 | #endif |
| 975 | CONTROL "&Vector Graphics",IDC_FILTER_VECTOR,"Button", |
| 976 | BS_AUTOCHECKBOX | WS_TABSTOP,14,16,70,10,0, |
| 977 | HIDC_FILTER_VECTOR |
| 978 | CONTROL "C&lones",IDC_FILTER_CLONES,"Button",BS_AUTOCHECKBOX | |
| 979 | WS_TABSTOP,14,30,41,10,0,HIDC_FILTER_CLONES |
| 980 | CONTROL "Non-Wor&king",IDC_FILTER_NONWORKING,"Button", |
| 981 | BS_AUTOCHECKBOX | WS_TABSTOP,14,44,61,10,0, |
| 982 | HIDC_FILTER_NONWORKING |
| 983 | CONTROL "&Horizontal",IDC_FILTER_HORIZONTAL,"Button", |
| 984 | BS_AUTOCHECKBOX | WS_TABSTOP,14,58,57,10,0, |
| 985 | HIDC_FILTER_HORIZONTAL |
| 986 | CONTROL "&Unavailable",IDC_FILTER_UNAVAILABLE,"Button", |
| 987 | BS_AUTOCHECKBOX | WS_TABSTOP,14,72,57,10,0, |
| 988 | HIDC_FILTER_UNAVAILABLE |
| 989 | #ifdef MESS |
| 990 | CONTROL "&Computers",IDC_FILTER_COMPUTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,57,10,0,HIDC_FILTER_UNAVAILABLE |
| 991 | CONTROL "C&onsoles",IDC_FILTER_CONSOLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,58,57,10,0,HIDC_FILTER_UNAVAILABLE |
| 992 | #endif |
| 993 | CONTROL "&Raster Graphics",IDC_FILTER_RASTER,"Button", |
| 994 | BS_AUTOCHECKBOX | WS_TABSTOP,100,16,70,10,0, |
| 995 | HIDC_FILTER_RASTER |
| 996 | CONTROL "Ori&ginals",IDC_FILTER_ORIGINALS,"Button", |
| 997 | BS_AUTOCHECKBOX | WS_TABSTOP,100,30,47,10,0, |
| 998 | HIDC_FILTER_ORIGINALS |
| 999 | CONTROL "&Working",IDC_FILTER_WORKING,"Button",BS_AUTOCHECKBOX | |
| 1000 | WS_TABSTOP,100,44,47,10,0,HIDC_FILTER_WORKING |
| 1001 | CONTROL "&Vertical",IDC_FILTER_VERTICAL,"Button",BS_AUTOCHECKBOX | |
| 1002 | WS_TABSTOP,100,58,47,10,0,HIDC_FILTER_VERTICAL |
| 1003 | LTEXT "(*) = inherited from parent folder",IDC_INHERITED,14,72, |
| 1004 | 99,10 |
| 1005 | #ifdef MESS |
| 1006 | CTEXT "System filters allow customizing the systems that are displayed in each folder by hiding games that match the filters applied.",IDC_STATIC,6,94,178,27 |
| 1007 | #else |
| 1008 | CTEXT "Game filters allow customizing the games that are displayed in each folder by hiding games that match the filters applied.", |
| 1009 | IDC_STATIC,6,94,178,27 |
| 1010 | #endif |
| 1011 | GROUPBOX "&Description filter",IDC_STATIC,6,122,178,33 |
| 1012 | EDITTEXT IDC_FILTER_EDIT,14,134,162,13,ES_AUTOHSCROLL,0, |
| 1013 | HIDC_FILTER_EDIT |
| 1014 | DEFPUSHBUTTON "&OK",IDOK,42,161,50,14 |
| 1015 | PUSHBUTTON "&Cancel",IDCANCEL,98,161,50,14 |
| 1016 | END |
| 1017 | |
| 1018 | IDD_RESET DIALOGEX 0, 0, 190, 122 |
| 1019 | STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | |
| 1020 | WS_SYSMENU |
| 1021 | EXSTYLE WS_EX_CONTEXTHELP |
| 1022 | CAPTION "Reset Options" |
| 1023 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 1024 | BEGIN |
| 1025 | GROUPBOX "Categories",IDC_STATIC,6,4,178,70 |
| 1026 | CONTROL "&User Interface (Fonts, Colors, Sizes)",IDC_RESET_UI, |
| 1027 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,146,10,0, |
| 1028 | HIDC_RESET_UI |
| 1029 | #ifdef MESS |
| 1030 | CONTROL "&Default system options",IDC_RESET_DEFAULT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30,146,10,0,HIDC_RESET_DEFAULT |
| 1031 | CONTROL "&All systems to use default options",IDC_RESET_GAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,146,10,0,HIDC_RESET_GAMES |
| 1032 | #else |
| 1033 | CONTROL "&Default game options",IDC_RESET_DEFAULT,"Button", |
| 1034 | BS_AUTOCHECKBOX | WS_TABSTOP,14,30,146,10,0, |
| 1035 | HIDC_RESET_DEFAULT |
| 1036 | CONTROL "&All games to use default options",IDC_RESET_GAMES, |
| 1037 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,146,10,0, |
| 1038 | HIDC_RESET_GAMES |
| 1039 | #endif |
| 1040 | CONTROL "&Folder 'filters'",IDC_RESET_FILTERS,"Button", |
| 1041 | BS_AUTOCHECKBOX | WS_TABSTOP,14,58,146,10,0, |
| 1042 | HIDC_RESET_FILTERS |
| 1043 | CTEXT "Select the options to be restored to the default settings.", |
| 1044 | IDC_STATIC,6,79,178,20 |
| 1045 | DEFPUSHBUTTON "&OK",IDOK,42,101,50,14 |
| 1046 | PUSHBUTTON "&Cancel",IDCANCEL,98,101,50,14 |
| 1047 | END |
| 1048 | |
| 1049 | IDD_LOAD_PROGRESS DIALOGEX 0, 0, 260, 187 |
| 1050 | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | |
| 1051 | WS_SYSMENU |
| 1052 | EXSTYLE WS_EX_CONTROLPARENT |
| 1053 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 1054 | BEGIN |
| 1055 | CONTROL "Progress1",IDC_LOAD_PROGRESS,"msctls_progress32", |
| 1056 | WS_BORDER | 0x1,6,7,248,12 |
| 1057 | CTEXT "",IDC_LOAD_ROMNAME,6,21,248,10,SS_CENTERIMAGE | NOT |
| 1058 | WS_GROUP |
| 1059 | EDITTEXT IDC_LOAD_STATUS,6,32,248,116,ES_MULTILINE | ES_READONLY | |
| 1060 | WS_VSCROLL |
| 1061 | CTEXT "",IDC_ERROR_TEXT,6,150,248,13,SS_NOPREFIX | |
| 1062 | SS_CENTERIMAGE |
| 1063 | PUSHBUTTON "&OK",IDOK,77,166,50,14,WS_DISABLED |
| 1064 | PUSHBUTTON "&Cancel",IDCANCEL,133,166,50,14 |
| 1065 | END |
| 1066 | |
| 1067 | IDD_INTERFACE_OPTIONS DIALOGEX 0, 0, 378, 225 |
| 1068 | STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | |
| 1069 | WS_SYSMENU |
| 1070 | EXSTYLE WS_EX_CONTEXTHELP |
| 1071 | CAPTION "Interface Options" |
| 1072 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 1073 | BEGIN |
| 1074 | #ifdef MESS |
| 1075 | GROUPBOX "System Selection",IDC_STATIC,6,4,189,194 |
| 1076 | CONTROL "&Search for new systems on start",IDC_START_GAME_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,112,10,0,HIDC_START_GAME_CHECK |
| 1077 | CONTROL "Allow system selection by a &joystick (requires restart)",IDC_JOY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30,178,10,0,HIDC_JOY_GUI |
| 1078 | CONTROL "Allow system selection by custom &key sequences",IDC_KEY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,166,10 |
| 1079 | #else |
| 1080 | GROUPBOX "Game Selection",IDC_STATIC,6,4,189,194 |
| 1081 | CONTROL "&Search for new games on start",IDC_START_GAME_CHECK, |
| 1082 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,111,10,0, |
| 1083 | HIDC_START_GAME_CHECK |
| 1084 | CONTROL "Allow game selection by a &joystick (requires restart)", |
| 1085 | IDC_JOY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30, |
| 1086 | 174,10,0,HIDC_JOY_GUI |
| 1087 | CONTROL "Allow game selection by custom &key sequences", |
| 1088 | IDC_KEY_GUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44, |
| 1089 | 166,10 |
| 1090 | #endif |
| 1091 | CONTROL "Select &random background image",IDC_RANDOM_BG,"Button", |
| 1092 | BS_AUTOCHECKBOX | WS_TABSTOP,14,58,122,10,0, |
| 1093 | HIDC_RANDOM_BG |
| 1094 | CONTROL "&Broadcast selected game to all windows",IDC_BROADCAST, |
| 1095 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,72,141,10,0, |
| 1096 | HIDC_BROADCAST |
| 1097 | CONTROL "Hide &mouse cursor (requires restart)",IDC_HIDE_MOUSE, |
| 1098 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,86,126,10,0, |
| 1099 | HIDC_HIDE_MOUSE |
| 1100 | CONTROL "Inheritable Filters",IDC_FILTER_INHERIT,"Button", |
| 1101 | BS_AUTOCHECKBOX | WS_TABSTOP,14,100,68,10 |
| 1102 | CONTROL "No offset for clones missing parent in view", |
| 1103 | IDC_NOOFFSET_CLONES,"Button",BS_AUTOCHECKBOX | |
| 1104 | WS_TABSTOP,14,114,148,10 |
| 1105 | GROUPBOX "Show History on Tab",IDC_STATIC,14,128,173,28 |
| 1106 | COMBOBOX IDC_HISTORY_TAB,57,138,88,50,CBS_DROPDOWNLIST | |
| 1107 | WS_VSCROLL | WS_TABSTOP |
| 1108 | GROUPBOX "Emulation",IDC_STATIC,202,4,170,28 |
| 1109 | #ifdef MESS |
| 1110 | CONTROL "Show System Ca&ption",IDC_GAME_CAPTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,16,81,10 |
| 1111 | #else |
| 1112 | CONTROL "Show Game Ca&ption",IDC_GAME_CAPTION,"Button", |
| 1113 | BS_AUTOCHECKBOX | WS_TABSTOP,210,16,80,10,0, |
| 1114 | HIDC_GAME_CAPTION |
| 1115 | #endif |
| 1116 | GROUPBOX "Bookkeeping",IDC_STATIC,202,36,170,43 |
| 1117 | CONTROL "Reset all Playcounts",IDC_RESET_PLAYCOUNT,"Button", |
| 1118 | BS_AUTOCHECKBOX | WS_TABSTOP,210,48,80,10 |
| 1119 | CONTROL "Reset all Play Times",IDC_RESET_PLAYTIME,"Button", |
| 1120 | BS_AUTOCHECKBOX | WS_TABSTOP,210,62,79,10 |
| 1121 | GROUPBOX "Screenshot Area",IDC_STATIC,202,83,170,115 |
| 1122 | CONTROL "S&tretch screenshot larger than natural size", |
| 1123 | IDC_STRETCH_SCREENSHOT_LARGER,"Button",BS_AUTOCHECKBOX | |
| 1124 | WS_TABSTOP,210,95,148,10,0, |
| 1125 | HIDC_STRETCH_SCREENSHOT_LARGER |
| 1126 | GROUPBOX "Screenshot Cycletime in Seconds",IDC_STATIC,210,109,154, |
| 1127 | 28 |
| 1128 | CONTROL "Slider1",IDC_CYCLETIMESEC,"msctls_trackbar32",TBS_BOTH | |
| 1129 | TBS_NOTICKS | WS_TABSTOP,218,121,120,10,0, |
| 1130 | HIDC_CYCLETIMESEC |
| 1131 | RTEXT "60",IDC_CYCLETIMESECTXT,340,120,13,10,SS_CENTERIMAGE |
| 1132 | GROUPBOX "Screenshot Bordersize",IDC_STATIC,210,141,154,28 |
| 1133 | CONTROL "Slider1",IDC_SCREENSHOT_BORDERSIZE,"msctls_trackbar32", |
| 1134 | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,218,153,120,10 |
| 1135 | RTEXT "100",IDC_SCREENSHOT_BORDERSIZETXT,340,152,13,10, |
| 1136 | SS_CENTERIMAGE |
| 1137 | PUSHBUTTON "Set Screenshot Border Color",IDC_SCREENSHOT_BORDERCOLOR, |
| 1138 | 210,176,154,14 |
| 1139 | DEFPUSHBUTTON "&OK",IDOK,136,204,50,14 |
| 1140 | PUSHBUTTON "&Cancel",IDCANCEL,192,204,50,14 |
| 1141 | END |
| 1142 | |
| 1143 | IDD_LANGUAGE DIALOGEX 0, 0, 190, 66 |
| 1144 | STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | |
| 1145 | WS_SYSMENU |
| 1146 | EXSTYLE WS_EX_CONTEXTHELP |
| 1147 | CAPTION "Language" |
| 1148 | FONT 8, "MS Shell Dlg", 0, 0, 0x1 |
| 1149 | BEGIN |
| 1150 | GROUPBOX "",IDC_STATIC,6,4,178,34 |
| 1151 | CONTROL "Use language file",IDC_LANGUAGECHECK,"Button", |
| 1152 | BS_AUTOCHECKBOX | WS_TABSTOP,12,4,66,10,0, |
| 1153 | HIDC_LANGUAGECHECK |
| 1154 | EDITTEXT IDC_LANGUAGEEDIT,14,17,142,13,ES_AUTOHSCROLL,0, |
| 1155 | HIDC_LANGUAGEEDIT |
| 1156 | PUSHBUTTON "...",IDC_LANGUAGEBROWSE,162,17,14,13 |
| 1157 | DEFPUSHBUTTON "OK",IDOK,42,45,50,14 |
| 1158 | PUSHBUTTON "Cancel",IDCANCEL,98,45,50,14 |
| 1159 | END |
| 1160 | |
| 1161 | IDD_CUSTOM_FILE DIALOG 0, 0, 190, 135 |
| 1162 | STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
| 1163 | CAPTION "Add Game To Custom Folder" |
| 1164 | FONT 8, "MS Shell Dlg" |
| 1165 | BEGIN |
| 1166 | LTEXT "",IDC_CUSTOMFILE_GAME,6,6,175,10,SS_NOPREFIX | |
| 1167 | SS_CENTERIMAGE |
| 1168 | CONTROL "CustomTree",IDC_CUSTOM_TREE,"SysTreeView32", |
| 1169 | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | |
| 1170 | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | |
| 1171 | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,6,18,178,90 |
| 1172 | DEFPUSHBUTTON "OK",IDOK,42,114,50,14 |
| 1173 | PUSHBUTTON "Cancel",IDCANCEL,98,114,50,14 |
| 1174 | END |
| 1175 | |
| 1176 | |
| 1177 | ///////////////////////////////////////////////////////////////////////////// |
| 1178 | // |
| 1179 | // Accelerator |
| 1180 | // |
| 1181 | |
| 1182 | IDA_TAB_KEYS ACCELERATORS |
| 1183 | BEGIN |
| 1184 | "1", ID_VIEW_TAB_SCREENSHOT, VIRTKEY, ALT, NOINVERT |
| 1185 | "2", ID_VIEW_TAB_FLYER, VIRTKEY, ALT, NOINVERT |
| 1186 | "3", ID_VIEW_TAB_CABINET, VIRTKEY, ALT, NOINVERT |
| 1187 | "4", ID_VIEW_TAB_MARQUEE, VIRTKEY, ALT, NOINVERT |
| 1188 | "5", ID_VIEW_TAB_TITLE, VIRTKEY, ALT, NOINVERT |
| 1189 | "6", ID_VIEW_TAB_CONTROL_PANEL, VIRTKEY, ALT, NOINVERT |
| 1190 | "7", ID_VIEW_TAB_PCB, VIRTKEY, ALT, NOINVERT |
| 1191 | "8", ID_VIEW_TAB_HISTORY, VIRTKEY, ALT, NOINVERT |
| 1192 | "A", ID_GAME_AUDIT, VIRTKEY, ALT, NOINVERT |
| 1193 | "B", ID_VIEW_PAGETAB, VIRTKEY, ALT, NOINVERT |
| 1194 | "D", ID_VIEW_FOLDERS, VIRTKEY, ALT, NOINVERT |
| 1195 | "F", ID_CONTEXT_FILTERS, VIRTKEY, CONTROL, NOINVERT |
| 1196 | "U", ID_FOLDER_AUDIT, VIRTKEY, ALT, NOINVERT |
| 1197 | "P", ID_VIEW_PICTURE_AREA, VIRTKEY, ALT, NOINVERT |
| 1198 | "R", ID_CONTEXT_SELECT_RANDOM, VIRTKEY, CONTROL, NOINVERT |
| 1199 | "S", ID_VIEW_STATUS, VIRTKEY, ALT, NOINVERT |
| 1200 | "T", ID_VIEW_TOOLBARS, VIRTKEY, ALT, NOINVERT |
| 1201 | VK_F1, ID_HELP_CONTENTS, VIRTKEY, NOINVERT |
| 1202 | VK_F11, ID_VIEW_FULLSCREEN, VIRTKEY, NOINVERT |
| 1203 | VK_F5, ID_UPDATE_GAMELIST, VIRTKEY, NOINVERT |
| 1204 | VK_NEXT, ID_UI_HISTORY_DOWN, VIRTKEY, CONTROL, NOINVERT |
| 1205 | VK_PRIOR, ID_UI_HISTORY_UP, VIRTKEY, CONTROL, NOINVERT |
| 1206 | VK_RETURN, ID_GAME_PROPERTIES, VIRTKEY, ALT, NOINVERT |
| 1207 | END |
| 1208 | |
| 1209 | |
| 1210 | ///////////////////////////////////////////////////////////////////////////// |
| 1211 | // |
| 1212 | // DESIGNINFO |
| 1213 | // |
| 1214 | |
| 1215 | #ifdef APSTUDIO_INVOKED |
| 1216 | GUIDELINES DESIGNINFO |
| 1217 | BEGIN |
| 1218 | IDD_ABOUT, DIALOG |
| 1219 | BEGIN |
| 1220 | LEFTMARGIN, 7 |
| 1221 | RIGHTMARGIN, 289 |
| 1222 | TOPMARGIN, 7 |
| 1223 | BOTTOMMARGIN, 123 |
| 1224 | END |
| 1225 | |
| 1226 | IDD_DIRECTX, DIALOG |
| 1227 | BEGIN |
| 1228 | LEFTMARGIN, 7 |
| 1229 | RIGHTMARGIN, 229 |
| 1230 | TOPMARGIN, 7 |
| 1231 | BOTTOMMARGIN, 62 |
| 1232 | END |
| 1233 | |
| 1234 | IDD_AUDIT, DIALOG |
| 1235 | BEGIN |
| 1236 | LEFTMARGIN, 7 |
| 1237 | RIGHTMARGIN, 280 |
| 1238 | TOPMARGIN, 7 |
| 1239 | BOTTOMMARGIN, 187 |
| 1240 | HORZGUIDE, 19 |
| 1241 | END |
| 1242 | |
| 1243 | IDD_DIRECTORIES, DIALOG |
| 1244 | BEGIN |
| 1245 | LEFTMARGIN, 7 |
| 1246 | RIGHTMARGIN, 224 |
| 1247 | TOPMARGIN, 7 |
| 1248 | BOTTOMMARGIN, 98 |
| 1249 | END |
| 1250 | |
| 1251 | IDD_COLUMNS, DIALOG |
| 1252 | BEGIN |
| 1253 | LEFTMARGIN, 7 |
| 1254 | RIGHTMARGIN, 301 |
| 1255 | TOPMARGIN, 7 |
| 1256 | BOTTOMMARGIN, 143 |
| 1257 | END |
| 1258 | |
| 1259 | IDD_PROP_CONTROLLER, DIALOG |
| 1260 | BEGIN |
| 1261 | RIGHTMARGIN, 210 |
| 1262 | BOTTOMMARGIN, 154 |
| 1263 | END |
| 1264 | |
| 1265 | IDD_PROP_SCREEN, DIALOG |
| 1266 | BEGIN |
| 1267 | LEFTMARGIN, 4 |
| 1268 | VERTGUIDE, 7 |
| 1269 | VERTGUIDE, 123 |
| 1270 | BOTTOMMARGIN, 199 |
| 1271 | HORZGUIDE, 179 |
| 1272 | END |
| 1273 | |
| 1274 | IDD_PROP_GAME, DIALOG |
| 1275 | BEGIN |
| 1276 | LEFTMARGIN, 7 |
| 1277 | RIGHTMARGIN, 213 |
| 1278 | VERTGUIDE, 19 |
| 1279 | VERTGUIDE, 66 |
| 1280 | VERTGUIDE, 74 |
| 1281 | VERTGUIDE, 201 |
| 1282 | BOTTOMMARGIN, 232 |
| 1283 | END |
| 1284 | |
| 1285 | IDD_PROP_AUDIT, DIALOG |
| 1286 | BEGIN |
| 1287 | LEFTMARGIN, 7 |
| 1288 | RIGHTMARGIN, 213 |
| 1289 | VERTGUIDE, 12 |
| 1290 | VERTGUIDE, 208 |
| 1291 | BOTTOMMARGIN, 198 |
| 1292 | HORZGUIDE, 38 |
| 1293 | END |
| 1294 | |
| 1295 | IDD_PROP_DISPLAY, DIALOG |
| 1296 | BEGIN |
| 1297 | LEFTMARGIN, 4 |
| 1298 | VERTGUIDE, 7 |
| 1299 | VERTGUIDE, 123 |
| 1300 | HORZGUIDE, 179 |
| 1301 | END |
| 1302 | |
| 1303 | IDD_PROP_SOUND, DIALOG |
| 1304 | BEGIN |
| 1305 | LEFTMARGIN, 7 |
| 1306 | RIGHTMARGIN, 213 |
| 1307 | VERTGUIDE, 50 |
| 1308 | BOTTOMMARGIN, 198 |
| 1309 | END |
| 1310 | |
| 1311 | IDD_PROP_ADVANCED, DIALOG |
| 1312 | BEGIN |
| 1313 | LEFTMARGIN, 10 |
| 1314 | BOTTOMMARGIN, 211 |
| 1315 | END |
| 1316 | |
| 1317 | IDD_PROP_INPUT, DIALOG |
| 1318 | BEGIN |
| 1319 | LEFTMARGIN, 4 |
| 1320 | RIGHTMARGIN, 215 |
| 1321 | VERTGUIDE, 50 |
| 1322 | VERTGUIDE, 170 |
| 1323 | END |
| 1324 | |
| 1325 | IDD_PROP_MISC, DIALOG |
| 1326 | BEGIN |
| 1327 | LEFTMARGIN, 7 |
| 1328 | RIGHTMARGIN, 213 |
| 1329 | VERTGUIDE, 25 |
| 1330 | VERTGUIDE, 40 |
| 1331 | VERTGUIDE, 104 |
| 1332 | VERTGUIDE, 114 |
| 1333 | VERTGUIDE, 204 |
| 1334 | BOTTOMMARGIN, 183 |
| 1335 | END |
| 1336 | |
| 1337 | IDD_PROP_VECTOR, DIALOG |
| 1338 | BEGIN |
| 1339 | LEFTMARGIN, 7 |
| 1340 | RIGHTMARGIN, 213 |
| 1341 | VERTGUIDE, 50 |
| 1342 | BOTTOMMARGIN, 198 |
| 1343 | END |
| 1344 | |
| 1345 | IDD_FILTERS, DIALOG |
| 1346 | BEGIN |
| 1347 | LEFTMARGIN, 7 |
| 1348 | TOPMARGIN, 7 |
| 1349 | BOTTOMMARGIN, 178 |
| 1350 | END |
| 1351 | |
| 1352 | IDD_RESET, DIALOG |
| 1353 | BEGIN |
| 1354 | LEFTMARGIN, 7 |
| 1355 | RIGHTMARGIN, 175 |
| 1356 | VERTGUIDE, 18 |
| 1357 | VERTGUIDE, 164 |
| 1358 | TOPMARGIN, 7 |
| 1359 | END |
| 1360 | |
| 1361 | IDD_LANGUAGE, DIALOG |
| 1362 | BEGIN |
| 1363 | LEFTMARGIN, 7 |
| 1364 | RIGHTMARGIN, 179 |
| 1365 | TOPMARGIN, 7 |
| 1366 | BOTTOMMARGIN, 59 |
| 1367 | END |
| 1368 | END |
| 1369 | #endif // APSTUDIO_INVOKED |
| 1370 | |
| 1371 | |
| 1372 | ///////////////////////////////////////////////////////////////////////////// |
| 1373 | // |
| 1374 | // Bitmap |
| 1375 | // |
| 1376 | |
| 1377 | #ifdef MESS |
| 1378 | IDB_ABOUT BITMAP "res\\about_mess.bmp" |
| 1379 | #else |
| 1380 | IDB_ABOUT BITMAP "res\\about.bmp" |
| 1381 | #endif |
| 1382 | IDB_TOOLBAR BITMAP "res\\toolbar.bmp" |
| 1383 | |
| 1384 | ///////////////////////////////////////////////////////////////////////////// |
| 1385 | // |
| 1386 | // Cursor |
| 1387 | // |
| 1388 | |
| 1389 | IDC_CURSOR_HSPLIT CURSOR "res\\splith.cur" |
| 1390 | |
| 1391 | ///////////////////////////////////////////////////////////////////////////// |
| 1392 | // |
| 1393 | // RT_MANIFEST |
| 1394 | // |
| 1395 | |
| 1396 | 1 RT_MANIFEST "res\\mameui.manifest" |
| 1397 | |
| 1398 | ///////////////////////////////////////////////////////////////////////////// |
| 1399 | // |
| 1400 | // String Table |
| 1401 | // |
| 1402 | |
| 1403 | STRINGTABLE |
| 1404 | BEGIN |
| 1405 | IDS_UI_FILE "Contains commands for working with the selected items" |
| 1406 | IDS_UI_VIEW "Contains commands for manupulating the view" |
| 1407 | IDS_UI_OPTIONS "Contains commands for user interface options" |
| 1408 | END |
| 1409 | |
| 1410 | STRINGTABLE |
| 1411 | BEGIN |
| 1412 | IDS_UI_HELP "Contains commands for displaying help" |
| 1413 | IDS_VIEW_TOOLBAR "Show or hide the toolbar" |
| 1414 | IDS_VIEW_STATUSBAR "Show or hide the status bar" |
| 1415 | IDS_VIEW_FOLDERLIST "Show or hide the folder list" |
| 1416 | IDS_VIEW_SCREENSHOT "Show or hide the screen shot" |
| 1417 | IDS_VIEW_PICTURETABS "Show or hide tabs in the picture area" |
| 1418 | IDS_VIEW_SPACER1 "Spacer" |
| 1419 | IDS_VIEW_FULLSCREEN "Toggle full screen mode" |
| 1420 | IDS_VIEW_SPACER2 "Spacer" |
| 1421 | IDS_VIEW_SHOWPICTURES "Contains commands to select tabs shown in the picture area" |
| 1422 | IDS_VIEW_SPACER3 "Spacer" |
| 1423 | END |
| 1424 | |
| 1425 | STRINGTABLE |
| 1426 | BEGIN |
| 1427 | IDS_VIEW_LARGEICONS "Display items by using large icons." |
| 1428 | IDS_VIEW_SMALLICONS "Display items by using small icons." |
| 1429 | IDS_VIEW_LIST "Displays items in a list." |
| 1430 | IDS_VIEW_DETAILS "Displays detailed information about each item in the window." |
| 1431 | IDS_VIEW_GROUPED "Displays items grouped by parent game" |
| 1432 | IDS_VIEW_SPACER4 "Spacer" |
| 1433 | IDS_VIEW_ARRANGE "Contains commands for sorting by various columns" |
| 1434 | IDS_VIEW_LINEUPICONS "Arranges icons in a grid" |
| 1435 | IDS_VIEW_SPACER5 "Spacer" |
| 1436 | IDS_VIEW_REFRESH "Refresh game list" |
| 1437 | IDS_VIEW_CONTEXTFILTERS "Allows filtering out games from a folder" |
| 1438 | IDS_VIEW_CUSTOMIZEFIELDS |
| 1439 | "Customize which columns are used in the game list" |
| 1440 | END |
| 1441 | |
| 1442 | STRINGTABLE |
| 1443 | BEGIN |
| 1444 | ID_FILE_EXIT "Exit the application" |
| 1445 | #ifdef MESS |
| 1446 | ID_FILE_PLAY "Play currently selected system" |
| 1447 | #else |
| 1448 | ID_FILE_PLAY "Play currently selected game" |
| 1449 | #endif |
| 1450 | ID_HELP_ABOUT "Displays program and copyright information" |
| 1451 | ID_VIEW_LARGE_ICON "Display items by using large icons." |
| 1452 | ID_VIEW_SMALL_ICON "Display items by using small icons." |
| 1453 | ID_VIEW_LIST_MENU "Displays items in a list." |
| 1454 | ID_VIEW_DETAIL "Displays detailed information about each item in the window." |
| 1455 | #ifdef MESS |
| 1456 | ID_OPTIONS_FONT "Set system list and folder list font" |
| 1457 | ID_OPTIONS_DIR "Set directory configuration" |
| 1458 | ID_OPTIONS_DEFAULTS "Set default system options" |
| 1459 | #else |
| 1460 | ID_VIEW_GROUPED "Show items grouped by parent game" |
| 1461 | ID_OPTIONS_FONT "Set game list and folder list font" |
| 1462 | ID_OPTIONS_CLONE_COLOR "Set the clone font color" |
| 1463 | ID_OPTIONS_DIR "Set directory configuration" |
| 1464 | ID_OPTIONS_DEFAULTS "Set default game options" |
| 1465 | #endif |
| 1466 | END |
| 1467 | |
| 1468 | STRINGTABLE |
| 1469 | BEGIN |
| 1470 | ID_OPTIONS_RESET_DEFAULTS "Allow restoring options to 'sane' values." |
| 1471 | ID_OPTIONS_INTERFACE "Customize interface options." |
| 1472 | ID_FILE_AUDIT "Audit ROM and samples sets" |
| 1473 | #ifdef MESS |
| 1474 | ID_FILE_PLAY_RECORD "Record a system for later playback" |
| 1475 | ID_FILE_PLAY_BACK "Playback a recorded system" |
| 1476 | ID_FILE_PLAY_RECORD_WAVE "Record the sound output of a system" |
| 1477 | #else |
| 1478 | ID_FILE_PLAY_RECORD "Record a game for later playback" |
| 1479 | ID_FILE_PLAY_BACK "Playback a recorded game" |
| 1480 | ID_FILE_PLAY_RECORD_WAVE "Record the audio output of a game" |
| 1481 | ID_FILE_PLAY_RECORD_MNG "Record the video output of a game" |
| 1482 | #endif |
| 1483 | ID_VIEW_PICTURE_AREA "Show or hide the picture area" |
| 1484 | ID_HELP_CONTENTS "Display help contents" |
| 1485 | #ifdef MESS |
| 1486 | ID_HELP_WHATS_NEWUI "Recent changes" |
| 1487 | ID_HELP_TROUBLE "Troubleshooting Documentation" |
| 1488 | ID_HELP_RELEASE "MESS release notes" |
| 1489 | ID_HELP_WHATS_NEW "What's new in MESS" |
| 1490 | ID_HELP_CHEATS "How cheats work" |
| 1491 | #else |
| 1492 | ID_HELP_WHATS_NEWUI "New game changes" |
| 1493 | ID_HELP_TROUBLE "Troubleshooting Documentation" |
| 1494 | ID_HELP_RELEASE "MAME release notes" |
| 1495 | ID_HELP_WHATS_NEW "What's new in MAME" |
| 1496 | ID_HELP_CHEATS "How cheats work" |
| 1497 | #endif |
| 1498 | END |
| 1499 | |
| 1500 | STRINGTABLE |
| 1501 | BEGIN |
| 1502 | ID_CONTEXT_RESET_PLAYTIME "Reset time played for selected item" |
| 1503 | ID_CONTEXT_RESET_PLAYCOUNT "Reset number of plays for selected item" |
| 1504 | ID_FOLDER_PROPERTIES "Display folder properties" |
| 1505 | ID_FOLDER_AUDIT "Audit itmes in this folder" |
| 1506 | #ifdef MESS |
| 1507 | ID_FILE_LOADSTATE "Run a system starting with the given savestate" |
| 1508 | #else |
| 1509 | ID_FILE_LOADSTATE "Play a game starting with the given savestate" |
| 1510 | #endif |
| 1511 | END |
| 1512 | |
| 1513 | STRINGTABLE |
| 1514 | BEGIN |
| 1515 | ID_VIEW_TAB_CABINET "Select Cabinet tab" |
| 1516 | ID_VIEW_TAB_MARQUEE "Select Marquee tab" |
| 1517 | ID_VIEW_TAB_TITLE "Select Title tab" |
| 1518 | ID_VIEW_TAB_CONTROL_PANEL "Select Control panel tab" |
| 1519 | ID_VIEW_TAB_HISTORY "Select History tab" |
| 1520 | ID_OPTIONS_BG "Set the bacground image" |
| 1521 | ID_TOGGLE_TAB_SCREENSHOT "Enable the screenshot tab" |
| 1522 | ID_TOGGLE_TAB_FLYER "Enable the flyer tab" |
| 1523 | ID_TOGGLE_TAB_CABINET "Enable the cabinet tab" |
| 1524 | ID_TOGGLE_TAB_MARQUEE "Enable the marquee tab" |
| 1525 | ID_TOGGLE_TAB_TITLE "Enable the title tab" |
| 1526 | ID_TOGGLE_TAB_CONTROL_PANEL "Enable the control panel tab" |
| 1527 | ID_TOGGLE_TAB_PCB "Enable the PCB tab" |
| 1528 | ID_TOGGLE_TAB_HISTORY "Enable the history tab" |
| 1529 | ID_VIEW_FULLSCREEN "Toggle Fullscreen mode" |
| 1530 | END |
| 1531 | |
| 1532 | STRINGTABLE |
| 1533 | BEGIN |
| 1534 | #ifdef MESS |
| 1535 | ID_CUSTOMIZE_FIELDS "Customize which columns are used in the system list" |
| 1536 | #else |
| 1537 | ID_CUSTOMIZE_FIELDS "Customize which columns are used in the game list" |
| 1538 | #endif |
| 1539 | ID_GAME_PROPERTIES "Display the properties of the selected item" |
| 1540 | ID_VIEW_PAGETAB "Show or hide the tabs in the picture area" |
| 1541 | ID_VIEW_FOLDERS "Show or hide the folder list" |
| 1542 | ID_VIEW_TOOLBARS "Show or hide the toolbar" |
| 1543 | ID_VIEW_STATUS "Show or hide the status bar" |
| 1544 | #ifdef MESS |
| 1545 | ID_CONTEXT_FILTERS "Allows filtering out systems from a folder" |
| 1546 | ID_CONTEXT_RENAME_CUSTOM "Rename this folder" |
| 1547 | ID_CONTEXT_ADD_CUSTOM "Add selected item to custom folder" |
| 1548 | ID_CONTEXT_REMOVE_CUSTOM "Remove selected item from this folder" |
| 1549 | ID_GAME_AUDIT "Audit the selected item" |
| 1550 | ID_CONTEXT_SELECT_RANDOM "Randomly select a system." |
| 1551 | #else |
| 1552 | ID_CONTEXT_FILTERS "Allows filtering out games from a folder" |
| 1553 | ID_CONTEXT_RENAME_CUSTOM "Rename this folder" |
| 1554 | ID_CONTEXT_ADD_CUSTOM "Add selected item to custom folder" |
| 1555 | ID_CONTEXT_REMOVE_CUSTOM "Remove selected item from this folder" |
| 1556 | ID_GAME_AUDIT "Audit the selected item" |
| 1557 | ID_CONTEXT_SELECT_RANDOM "Randomly select a game." |
| 1558 | #endif |
| 1559 | ID_VIEW_TAB_SCREENSHOT "Select Screenshot tab" |
| 1560 | ID_VIEW_TAB_FLYER "Select Flyer tab" |
| 1561 | END |
| 1562 | |
| 1563 | STRINGTABLE |
| 1564 | BEGIN |
| 1565 | #ifdef MESS |
| 1566 | ID_VIEW_BYGAME "Sort items by system" |
| 1567 | #else |
| 1568 | ID_VIEW_BYGAME "Sort items by game" |
| 1569 | #endif |
| 1570 | ID_VIEW_BYDIRECTORY "Sort items by directories" |
| 1571 | ID_VIEW_BYMANUFACTURER "Sort items by manufacturer" |
| 1572 | ID_VIEW_BYYEAR "Sort items by year" |
| 1573 | ID_VIEW_BYTYPE "Sort items by type" |
| 1574 | ID_VIEW_BYTIMESPLAYED "Sort by number of plays" |
| 1575 | ID_VIEW_LINEUPICONS "Arranges icons in a grid" |
| 1576 | #ifdef MESS |
| 1577 | ID_UPDATE_GAMELIST "Refresh system list" |
| 1578 | #else |
| 1579 | ID_UPDATE_GAMELIST "Refresh game list" |
| 1580 | #endif |
| 1581 | ID_SORT_ASCENDING "Sort column in ascending (A-Z) order" |
| 1582 | ID_SORT_DESCENDING "Sort column in descending (Z-A) order" |
| 1583 | END |
| 1584 | |
| 1585 | STRINGTABLE |
| 1586 | BEGIN |
| 1587 | ID_FOLDER_SOURCEPROPERTIES |
| 1588 | "Display properties for all games in this source file" |
| 1589 | ID_FOLDER_VECTORPROPERTIES "Display properties for all vector based games" |
| 1590 | END |
| 1591 | |
| 1592 | #endif // English (U.S.) resources |
| 1593 | ///////////////////////////////////////////////////////////////////////////// |
| 1594 | |
| 1595 | |
| 1596 | |
| 1597 | #ifndef APSTUDIO_INVOKED |
| 1598 | ///////////////////////////////////////////////////////////////////////////// |
| 1599 | // |
| 1600 | // Generated from the TEXTINCLUDE 3 resource. |
| 1601 | // |
| 1602 | #include "mamevers.rc" // Version block |
| 1603 | |
| 1604 | |
| 1605 | ///////////////////////////////////////////////////////////////////////////// |
| 1606 | #endif // not APSTUDIO_INVOKED |
| 1607 | |
src/osd/winui/mui_opts.c
| r0 | r1368 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | M.A.M.E.UI - Multiple Arcade Machine Emulator with User Interface |
| 4 | Win32 Portions Copyright (C) 1997-2003 Michael Soderstrom and Chris Kirmse, |
| 5 | Copyright (C) 2003-2007 Chris Kirmse and the MAME32/MAMEUI team. |
| 6 | |
| 7 | This file is part of MAMEUI, and may only be used, modified and |
| 8 | distributed under the terms of the MAME license, in "readme.txt". |
| 9 | By continuing to use, modify or distribute this file you indicate |
| 10 | that you have read the license and understand and accept it fully. |
| 11 | |
| 12 | ***************************************************************************/ |
| 13 | |
| 14 | /*************************************************************************** |
| 15 | |
| 16 | mui_opts.c |
| 17 | |
| 18 | Stores global options and per-game options; |
| 19 | |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | // standard windows headers |
| 23 | #define WIN32_LEAN_AND_MEAN |
| 24 | #include <windows.h> |
| 25 | #include <windowsx.h> |
| 26 | #include <winreg.h> |
| 27 | #include <commctrl.h> |
| 28 | |
| 29 | // standard C headers |
| 30 | #include <assert.h> |
| 31 | #include <stdio.h> |
| 32 | #include <sys/stat.h> |
| 33 | #include <math.h> |
| 34 | #include <direct.h> |
| 35 | #include <driver.h> |
| 36 | #include <stddef.h> |
| 37 | #include <tchar.h> |
| 38 | |
| 39 | // MAME/MAMEUI headers |
| 40 | #include "bitmask.h" |
| 41 | #include "winui.h" |
| 42 | #include "mui_util.h" |
| 43 | #include "treeview.h" |
| 44 | #include "splitters.h" |
| 45 | #include "mui_opts.h" |
| 46 | #include "winmain.h" |
| 47 | #include "winutf8.h" |
| 48 | #include "strconv.h" |
| 49 | |
| 50 | #ifdef MESS |
| 51 | #include "optionsms.h" |
| 52 | #endif // MESS |
| 53 | |
| 54 | #ifdef _MSC_VER |
| 55 | #define snprintf _snprintf |
| 56 | #endif |
| 57 | |
| 58 | /*************************************************************************** |
| 59 | Internal function prototypes |
| 60 | ***************************************************************************/ |
| 61 | |
| 62 | // static void LoadFolderFilter(int folder_index,int filters); |
| 63 | |
| 64 | static file_error LoadSettingsFile(core_options *opts, const char *filename); |
| 65 | static file_error SaveSettingsFile(core_options *opts, core_options *baseopts, const char *filename); |
| 66 | |
| 67 | static void LoadOptionsAndSettings(void); |
| 68 | |
| 69 | static void CusColorEncodeString(const COLORREF *value, char* str); |
| 70 | static void CusColorDecodeString(const char* str, COLORREF *value); |
| 71 | |
| 72 | static void SplitterEncodeString(const int *value, char* str); |
| 73 | static void SplitterDecodeString(const char *str, int *value); |
| 74 | |
| 75 | static void FontEncodeString(const LOGFONT *f, char *str); |
| 76 | static void FontDecodeString(const char* str, LOGFONT *f); |
| 77 | |
| 78 | static void TabFlagsEncodeString(int data, char *str); |
| 79 | static void TabFlagsDecodeString(const char *str, int *data); |
| 80 | |
| 81 | static DWORD DecodeFolderFlags(const char *buf); |
| 82 | static const char * EncodeFolderFlags(DWORD value); |
| 83 | |
| 84 | static void ResetToDefaults(core_options *opts, int priority); |
| 85 | |
| 86 | static void ui_parse_ini_file(core_options *opts, const char *name); |
| 87 | static void remove_all_source_options(void); |
| 88 | |
| 89 | |
| 90 | #ifdef _MSC_VER |
| 91 | #define snprintf _snprintf |
| 92 | #endif |
| 93 | |
| 94 | /*************************************************************************** |
| 95 | Internal defines |
| 96 | ***************************************************************************/ |
| 97 | |
| 98 | #define UI_INI_FILENAME MAMEUINAME ".ini" |
| 99 | #define DEFAULT_OPTIONS_INI_FILENAME CONFIGNAME ".ini" |
| 100 | |
| 101 | #define MUIOPTION_LIST_MODE "list_mode" |
| 102 | #define MUIOPTION_CHECK_GAME "check_game" |
| 103 | #define MUIOPTION_JOYSTICK_IN_INTERFACE "joystick_in_interface" |
| 104 | #define MUIOPTION_KEYBOARD_IN_INTERFACE "keyboard_in_interface" |
| 105 | #define MUIOPTION_CYCLE_SCREENSHOT "cycle_screenshot" |
| 106 | #define MUIOPTION_STRETCH_SCREENSHOT_LARGER "stretch_screenshot_larger" |
| 107 | #define MUIOPTION_SCREENSHOT_BORDER_SIZE "screenshot_bordersize" |
| 108 | #define MUIOPTION_SCREENSHOT_BORDER_COLOR "screenshot_bordercolor" |
| 109 | #define MUIOPTION_INHERIT_FILTER "inherit_filter" |
| 110 | #define MUIOPTION_OFFSET_CLONES "offset_clones" |
| 111 | #define MUIOPTION_GAME_CAPTION "game_caption" |
| 112 | #define MUIOPTION_BROADCAST_GAME_NAME "broadcast_game_name" |
| 113 | #define MUIOPTION_RANDOM_BACKGROUND "random_background" |
| 114 | #define MUIOPTION_DEFAULT_FOLDER_ID "default_folder_id" |
| 115 | #define MUIOPTION_SHOW_IMAGE_SECTION "show_image_section" |
| 116 | #define MUIOPTION_SHOW_FOLDER_SECTION "show_folder_section" |
| 117 | #define MUIOPTION_HIDE_FOLDERS "hide_folders" |
| 118 | #define MUIOPTION_SHOW_STATUS_BAR "show_status_bar" |
| 119 | #define MUIOPTION_SHOW_TABS "show_tabs" |
| 120 | #define MUIOPTION_SHOW_TOOLBAR "show_tool_bar" |
| 121 | #define MUIOPTION_CURRENT_TAB "current_tab" |
| 122 | #define MUIOPTION_WINDOW_X "window_x" |
| 123 | #define MUIOPTION_WINDOW_Y "window_y" |
| 124 | #define MUIOPTION_WINDOW_WIDTH "window_width" |
| 125 | #define MUIOPTION_WINDOW_HEIGHT "window_height" |
| 126 | #define MUIOPTION_WINDOW_STATE "window_state" |
| 127 | #define MUIOPTION_CUSTOM_COLOR "custom_color" |
| 128 | #define MUIOPTION_LIST_FONT "list_font" |
| 129 | #define MUIOPTION_TEXT_COLOR "text_color" |
| 130 | #define MUIOPTION_CLONE_COLOR "clone_color" |
| 131 | #define MUIOPTION_HIDE_TABS "hide_tabs" |
| 132 | #define MUIOPTION_HISTORY_TAB "history_tab" |
| 133 | #define MUIOPTION_COLUMN_WIDTHS "column_widths" |
| 134 | #define MUIOPTION_COLUMN_ORDER "column_order" |
| 135 | #define MUIOPTION_COLUMN_SHOWN "column_shown" |
| 136 | #define MUIOPTION_SPLITTERS "splitters" |
| 137 | #define MUIOPTION_SORT_COLUMN "sort_column" |
| 138 | #define MUIOPTION_SORT_REVERSED "sort_reversed" |
| 139 | #define MUIOPTION_LANGUAGE "language" |
| 140 | #define MUIOPTION_FLYER_DIRECTORY "flyer_directory" |
| 141 | #define MUIOPTION_CABINET_DIRECTORY "cabinet_directory" |
| 142 | #define MUIOPTION_MARQUEE_DIRECTORY "marquee_directory" |
| 143 | #define MUIOPTION_TITLE_DIRECTORY "title_directory" |
| 144 | #define MUIOPTION_CPANEL_DIRECTORY "cpanel_directory" |
| 145 | #define MUIOPTION_PCB_DIRECTORY "pcb_directory" |
| 146 | #define MUIOPTION_ICONS_DIRECTORY "icons_directory" |
| 147 | #define MUIOPTION_BACKGROUND_DIRECTORY "background_directory" |
| 148 | #define MUIOPTION_FOLDER_DIRECTORY "folder_directory" |
| 149 | #define MUIOPTION_UI_KEY_UP "ui_key_up" |
| 150 | #define MUIOPTION_UI_KEY_DOWN "ui_key_down" |
| 151 | #define MUIOPTION_UI_KEY_LEFT "ui_key_left" |
| 152 | #define MUIOPTION_UI_KEY_RIGHT "ui_key_right" |
| 153 | #define MUIOPTION_UI_KEY_START "ui_key_start" |
| 154 | #define MUIOPTION_UI_KEY_PGUP "ui_key_pgup" |
| 155 | #define MUIOPTION_UI_KEY_PGDWN "ui_key_pgdwn" |
| 156 | #define MUIOPTION_UI_KEY_HOME "ui_key_home" |
| 157 | #define MUIOPTION_UI_KEY_END "ui_key_end" |
| 158 | #define MUIOPTION_UI_KEY_SS_CHANGE "ui_key_ss_change" |
| 159 | #define MUIOPTION_UI_KEY_HISTORY_UP "ui_key_history_up" |
| 160 | #define MUIOPTION_UI_KEY_HISTORY_DOWN "ui_key_history_down" |
| 161 | #define MUIOPTION_UI_KEY_CONTEXT_FILTERS "ui_key_context_filters" |
| 162 | #define MUIOPTION_UI_KEY_SELECT_RANDOM "ui_key_select_random" |
| 163 | #define MUIOPTION_UI_KEY_GAME_AUDIT "ui_key_game_audit" |
| 164 | #define MUIOPTION_UI_KEY_GAME_PROPERTIES "ui_key_game_properties" |
| 165 | #define MUIOPTION_UI_KEY_HELP_CONTENTS "ui_key_help_contents" |
| 166 | #define MUIOPTION_UI_KEY_UPDATE_GAMELIST "ui_key_update_gamelist" |
| 167 | #define MUIOPTION_UI_KEY_VIEW_FOLDERS "ui_key_view_folders" |
| 168 | #define MUIOPTION_UI_KEY_VIEW_FULLSCREEN "ui_key_view_fullscreen" |
| 169 | #define MUIOPTION_UI_KEY_VIEW_PAGETAB "ui_key_view_pagetab" |
| 170 | #define MUIOPTION_UI_KEY_VIEW_PICTURE_AREA "ui_key_view_picture_area" |
| 171 | #define MUIOPTION_UI_KEY_VIEW_STATUS "ui_key_view_status" |
| 172 | #define MUIOPTION_UI_KEY_VIEW_TOOLBARS "ui_key_view_toolbars" |
| 173 | #define MUIOPTION_UI_KEY_VIEW_TAB_CABINET "ui_key_view_tab_cabinet" |
| 174 | #define MUIOPTION_UI_KEY_VIEW_TAB_CPANEL "ui_key_view_tab_cpanel" |
| 175 | #define MUIOPTION_UI_KEY_VIEW_TAB_FLYER "ui_key_view_tab_flyer" |
| 176 | #define MUIOPTION_UI_KEY_VIEW_TAB_HISTORY "ui_key_view_tab_history" |
| 177 | #define MUIOPTION_UI_KEY_VIEW_TAB_MARQUEE "ui_key_view_tab_marquee" |
| 178 | #define MUIOPTION_UI_KEY_VIEW_TAB_SCREENSHOT "ui_key_view_tab_screenshot" |
| 179 | #define MUIOPTION_UI_KEY_VIEW_TAB_TITLE "ui_key_view_tab_title" |
| 180 | #define MUIOPTION_UI_KEY_VIEW_TAB_PCB "ui_key_view_tab_pcb" |
| 181 | #define MUIOPTION_UI_KEY_QUIT "ui_key_quit" |
| 182 | #define MUIOPTION_UI_JOY_UP "ui_joy_up" |
| 183 | #define MUIOPTION_UI_JOY_DOWN "ui_joy_down" |
| 184 | #define MUIOPTION_UI_JOY_LEFT "ui_joy_left" |
| 185 | #define MUIOPTION_UI_JOY_RIGHT "ui_joy_right" |
| 186 | #define MUIOPTION_UI_JOY_START "ui_joy_start" |
| 187 | #define MUIOPTION_UI_JOY_PGUP "ui_joy_pgup" |
| 188 | #define MUIOPTION_UI_JOY_PGDWN "ui_joy_pgdwn" |
| 189 | #define MUIOPTION_UI_JOY_HOME "ui_joy_home" |
| 190 | #define MUIOPTION_UI_JOY_END "ui_joy_end" |
| 191 | #define MUIOPTION_UI_JOY_SS_CHANGE "ui_joy_ss_change" |
| 192 | #define MUIOPTION_UI_JOY_HISTORY_UP "ui_joy_history_up" |
| 193 | #define MUIOPTION_UI_JOY_HISTORY_DOWN "ui_joy_history_down" |
| 194 | #define MUIOPTION_UI_JOY_EXEC "ui_joy_exec" |
| 195 | #define MUIOPTION_EXEC_COMMAND "exec_command" |
| 196 | #define MUIOPTION_EXEC_WAIT "exec_wait" |
| 197 | #define MUIOPTION_HIDE_MOUSE "hide_mouse" |
| 198 | #define MUIOPTION_FULL_SCREEN "full_screen" |
| 199 | |
| 200 | #ifdef MESS |
| 201 | // Options names |
| 202 | #define MUIOPTION_DEFAULT_GAME "default_system" |
| 203 | #define MUIOPTION_HISTORY_FILE "sysinfo_file" |
| 204 | #define MUIOPTION_MAMEINFO_FILE "messinfo_file" |
| 205 | // Option values |
| 206 | #define MUIDEFAULT_SELECTION "nes" |
| 207 | #define MUIDEFAULT_SPLITTERS "152,310,468" |
| 208 | #define MUIHISTORY_FILE "sysinfo.dat" |
| 209 | #define MUIMAMEINFO_FILE "messinfo.dat" |
| 210 | #else |
| 211 | // Options names |
| 212 | #define MUIOPTION_DEFAULT_GAME "default_game" |
| 213 | #define MUIOPTION_HISTORY_FILE "history_file" |
| 214 | #define MUIOPTION_MAMEINFO_FILE "mameinfo_file" |
| 215 | // Options values |
| 216 | #define MUIDEFAULT_SELECTION "puckman" |
| 217 | #define MUIDEFAULT_SPLITTERS "152,362" |
| 218 | #define MUIHISTORY_FILE "history.dat" |
| 219 | #define MUIMAMEINFO_FILE "mameinfo.dat" |
| 220 | #endif |
| 221 | |
| 222 | |
| 223 | |
| 224 | /*************************************************************************** |
| 225 | Internal structures |
| 226 | ***************************************************************************/ |
| 227 | |
| 228 | #if 0 |
| 229 | typedef struct |
| 230 | { |
| 231 | int folder_index; |
| 232 | int filters; |
| 233 | } folder_filter_type; |
| 234 | #endif |
| 235 | |
| 236 | /*************************************************************************** |
| 237 | Internal variables |
| 238 | ***************************************************************************/ |
| 239 | |
| 240 | static object_pool *options_memory_pool; |
| 241 | |
| 242 | static core_options *settings; |
| 243 | |
| 244 | static core_options *global = NULL; // Global 'default' options |
| 245 | |
| 246 | // UI options in mameui.ini |
| 247 | static const options_entry regSettings[] = |
| 248 | { |
| 249 | // UI options |
| 250 | { NULL, NULL, OPTION_HEADER, "DISPLAY STATE OPTIONS" }, |
| 251 | { MUIOPTION_DEFAULT_GAME, MUIDEFAULT_SELECTION, 0, NULL }, |
| 252 | { MUIOPTION_DEFAULT_GAME, "puckman", 0, NULL }, |
| 253 | { MUIOPTION_DEFAULT_FOLDER_ID, "0", 0, NULL }, |
| 254 | { MUIOPTION_SHOW_IMAGE_SECTION, "1", OPTION_BOOLEAN, NULL }, |
| 255 | { MUIOPTION_FULL_SCREEN, "0", OPTION_BOOLEAN, NULL }, |
| 256 | { MUIOPTION_CURRENT_TAB, "0", 0, NULL }, |
| 257 | { MUIOPTION_SHOW_TOOLBAR, "1", OPTION_BOOLEAN, NULL }, |
| 258 | { MUIOPTION_SHOW_STATUS_BAR, "1", OPTION_BOOLEAN, NULL }, |
| 259 | { MUIOPTION_HIDE_FOLDERS, "", 0, NULL }, |
| 260 | #ifdef MESS |
| 261 | { MUIOPTION_SHOW_FOLDER_SECTION, "0", OPTION_BOOLEAN, NULL }, |
| 262 | { MUIOPTION_SHOW_TABS, "0", OPTION_BOOLEAN, NULL }, |
| 263 | { MUIOPTION_HIDE_TABS, "flyer, cabinet, marquee, title, cpanel, pcb", 0, NULL }, |
| 264 | { MUIOPTION_HISTORY_TAB, "1", 0, NULL }, |
| 265 | #else |
| 266 | { MUIOPTION_SHOW_FOLDER_SECTION, "1", OPTION_BOOLEAN, NULL }, |
| 267 | { MUIOPTION_SHOW_TABS, "1", OPTION_BOOLEAN, NULL }, |
| 268 | { MUIOPTION_HIDE_TABS, "marquee, title, cpanel, pcb, history", 0, NULL }, |
| 269 | { MUIOPTION_HISTORY_TAB, "0", 0, NULL }, |
| 270 | #endif |
| 271 | |
| 272 | { MUIOPTION_SORT_COLUMN, "0", 0, NULL }, |
| 273 | { MUIOPTION_SORT_REVERSED, "0", OPTION_BOOLEAN, NULL }, |
| 274 | { MUIOPTION_WINDOW_X, "0", 0, NULL }, |
| 275 | { MUIOPTION_WINDOW_Y, "0", 0, NULL }, |
| 276 | { MUIOPTION_WINDOW_WIDTH, "640", 0, NULL }, |
| 277 | { MUIOPTION_WINDOW_HEIGHT, "400", 0, NULL }, |
| 278 | { MUIOPTION_WINDOW_STATE, "1", 0, NULL }, |
| 279 | |
| 280 | { MUIOPTION_TEXT_COLOR, "-1", 0, NULL }, |
| 281 | { MUIOPTION_CLONE_COLOR, "-1", 0, NULL }, |
| 282 | { MUIOPTION_CUSTOM_COLOR, "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0", 0, NULL }, |
| 283 | /* ListMode needs to be before ColumnWidths settings */ |
| 284 | { MUIOPTION_LIST_MODE, "5", 0, NULL }, |
| 285 | { MUIOPTION_SPLITTERS, MUIDEFAULT_SPLITTERS, 0, NULL }, |
| 286 | { MUIOPTION_LIST_FONT, "-8,0,0,0,400,0,0,0,0,0,0,0,0,MS Sans Serif", 0, NULL }, |
| 287 | { MUIOPTION_COLUMN_WIDTHS, "185,78,84,84,64,88,74,108,60,144,84,60", 0, NULL }, |
| 288 | { MUIOPTION_COLUMN_ORDER, "0,2,3,4,5,6,7,8,9,1,10,11", 0, NULL }, |
| 289 | { MUIOPTION_COLUMN_SHOWN, "1,0,1,1,1,1,1,1,1,1,0,0", 0, NULL }, |
| 290 | |
| 291 | { NULL, NULL, OPTION_HEADER, "INTERFACE OPTIONS" }, |
| 292 | { MUIOPTION_LANGUAGE, "english", 0, NULL }, |
| 293 | { MUIOPTION_CHECK_GAME, "1", OPTION_BOOLEAN, NULL }, |
| 294 | { MUIOPTION_JOYSTICK_IN_INTERFACE, "0", OPTION_BOOLEAN, NULL }, |
| 295 | { MUIOPTION_KEYBOARD_IN_INTERFACE, "0", OPTION_BOOLEAN, NULL }, |
| 296 | { MUIOPTION_RANDOM_BACKGROUND, "0", OPTION_BOOLEAN, NULL }, |
| 297 | { MUIOPTION_BROADCAST_GAME_NAME, "0", OPTION_BOOLEAN, NULL }, |
| 298 | { MUIOPTION_HIDE_MOUSE, "0", OPTION_BOOLEAN, NULL }, |
| 299 | { MUIOPTION_INHERIT_FILTER, "0", OPTION_BOOLEAN, NULL }, |
| 300 | { MUIOPTION_OFFSET_CLONES, "0", OPTION_BOOLEAN, NULL }, |
| 301 | { MUIOPTION_GAME_CAPTION, "1", OPTION_BOOLEAN, NULL }, |
| 302 | { MUIOPTION_STRETCH_SCREENSHOT_LARGER, "0", OPTION_BOOLEAN, NULL }, |
| 303 | { MUIOPTION_CYCLE_SCREENSHOT, "0", 0, NULL }, |
| 304 | { MUIOPTION_SCREENSHOT_BORDER_SIZE, "11", 0, NULL }, |
| 305 | { MUIOPTION_SCREENSHOT_BORDER_COLOR, "-1", 0, NULL }, |
| 306 | { MUIOPTION_EXEC_COMMAND, "", 0, NULL }, |
| 307 | { MUIOPTION_EXEC_WAIT, "0", 0, NULL }, |
| 308 | |
| 309 | { NULL, NULL, OPTION_HEADER, "SEARCH PATH OPTIONS" }, |
| 310 | { MUIOPTION_FLYER_DIRECTORY, "flyers", 0, NULL }, |
| 311 | { MUIOPTION_CABINET_DIRECTORY, "cabinets", 0, NULL }, |
| 312 | { MUIOPTION_MARQUEE_DIRECTORY, "marquees", 0, NULL }, |
| 313 | { MUIOPTION_TITLE_DIRECTORY, "titles", 0, NULL }, |
| 314 | { MUIOPTION_CPANEL_DIRECTORY, "cpanel", 0, NULL }, |
| 315 | { MUIOPTION_PCB_DIRECTORY, "pcb", 0, NULL }, |
| 316 | { MUIOPTION_BACKGROUND_DIRECTORY, "bkground", 0, NULL }, |
| 317 | { MUIOPTION_FOLDER_DIRECTORY, "folders", 0, NULL }, |
| 318 | { MUIOPTION_ICONS_DIRECTORY, "icons", 0, NULL }, |
| 319 | |
| 320 | |
| 321 | { NULL, NULL, OPTION_HEADER, "FILENAME OPTIONS" }, |
| 322 | { MUIOPTION_HISTORY_FILE, MUIHISTORY_FILE, 0, NULL }, |
| 323 | { MUIOPTION_MAMEINFO_FILE, MUIMAMEINFO_FILE, 0, NULL }, |
| 324 | |
| 325 | { NULL, NULL, OPTION_HEADER, "NAVIGATION KEY CODES" }, |
| 326 | { MUIOPTION_UI_KEY_UP, "KEYCODE_UP", 0, NULL }, |
| 327 | { MUIOPTION_UI_KEY_DOWN, "KEYCODE_DOWN", 0, NULL }, |
| 328 | { MUIOPTION_UI_KEY_LEFT, "KEYCODE_LEFT", 0, NULL }, |
| 329 | { MUIOPTION_UI_KEY_RIGHT, "KEYCODE_RIGHT", 0, NULL }, |
| 330 | { MUIOPTION_UI_KEY_START, "KEYCODE_ENTER NOT KEYCODE_LALT", 0, NULL }, |
| 331 | { MUIOPTION_UI_KEY_PGUP, "KEYCODE_PGUP", 0, NULL }, |
| 332 | { MUIOPTION_UI_KEY_PGDWN, "KEYCODE_PGDN", 0, NULL }, |
| 333 | { MUIOPTION_UI_KEY_HOME, "KEYCODE_HOME", 0, NULL }, |
| 334 | { MUIOPTION_UI_KEY_END, "KEYCODE_END", 0, NULL }, |
| 335 | { MUIOPTION_UI_KEY_SS_CHANGE, "KEYCODE_INSERT", 0, NULL }, |
| 336 | { MUIOPTION_UI_KEY_HISTORY_UP, "KEYCODE_DEL", 0, NULL }, |
| 337 | { MUIOPTION_UI_KEY_HISTORY_DOWN, "KEYCODE_LALT KEYCODE_0", 0, NULL }, |
| 338 | |
| 339 | { MUIOPTION_UI_KEY_CONTEXT_FILTERS, "KEYCODE_LCONTROL KEYCODE_F", 0, NULL }, |
| 340 | { MUIOPTION_UI_KEY_SELECT_RANDOM, "KEYCODE_LCONTROL KEYCODE_R", 0, NULL }, |
| 341 | { MUIOPTION_UI_KEY_GAME_AUDIT, "KEYCODE_LALT KEYCODE_A", 0, NULL }, |
| 342 | { MUIOPTION_UI_KEY_GAME_PROPERTIES, "KEYCODE_LALT KEYCODE_ENTER", 0, NULL }, |
| 343 | { MUIOPTION_UI_KEY_HELP_CONTENTS, "KEYCODE_F1", 0, NULL }, |
| 344 | { MUIOPTION_UI_KEY_UPDATE_GAMELIST, "KEYCODE_F5", 0, NULL }, |
| 345 | { MUIOPTION_UI_KEY_VIEW_FOLDERS, "KEYCODE_LALT KEYCODE_D", 0, NULL }, |
| 346 | { MUIOPTION_UI_KEY_VIEW_FULLSCREEN, "KEYCODE_F11", 0, NULL }, |
| 347 | { MUIOPTION_UI_KEY_VIEW_PAGETAB, "KEYCODE_LALT KEYCODE_B", 0, NULL }, |
| 348 | { MUIOPTION_UI_KEY_VIEW_PICTURE_AREA, "KEYCODE_LALT KEYCODE_P", 0, NULL }, |
| 349 | { MUIOPTION_UI_KEY_VIEW_STATUS, "KEYCODE_LALT KEYCODE_S", 0, NULL }, |
| 350 | { MUIOPTION_UI_KEY_VIEW_TOOLBARS, "KEYCODE_LALT KEYCODE_T", 0, NULL }, |
| 351 | |
| 352 | { MUIOPTION_UI_KEY_VIEW_TAB_CABINET, "KEYCODE_LALT KEYCODE_3", 0, NULL }, |
| 353 | { MUIOPTION_UI_KEY_VIEW_TAB_CPANEL, "KEYCODE_LALT KEYCODE_6", 0, NULL }, |
| 354 | { MUIOPTION_UI_KEY_VIEW_TAB_FLYER, "KEYCODE_LALT KEYCODE_2", 0, NULL }, |
| 355 | { MUIOPTION_UI_KEY_VIEW_TAB_HISTORY, "KEYCODE_LALT KEYCODE_8", 0, NULL }, |
| 356 | { MUIOPTION_UI_KEY_VIEW_TAB_MARQUEE, "KEYCODE_LALT KEYCODE_4", 0, NULL }, |
| 357 | { MUIOPTION_UI_KEY_VIEW_TAB_SCREENSHOT, "KEYCODE_LALT KEYCODE_1", 0, NULL }, |
| 358 | { MUIOPTION_UI_KEY_VIEW_TAB_TITLE, "KEYCODE_LALT KEYCODE_5", 0, NULL }, |
| 359 | { MUIOPTION_UI_KEY_VIEW_TAB_PCB, "KEYCODE_LALT KEYCODE_7", 0, NULL }, |
| 360 | { MUIOPTION_UI_KEY_QUIT, "KEYCODE_LALT KEYCODE_Q", 0, NULL }, |
| 361 | |
| 362 | { NULL, NULL, OPTION_HEADER, "NAVIGATION JOYSTICK CODES" }, |
| 363 | { MUIOPTION_UI_JOY_UP, "", 0, NULL }, |
| 364 | { MUIOPTION_UI_JOY_DOWN, "", 0, NULL }, |
| 365 | { MUIOPTION_UI_JOY_LEFT, "", 0, NULL }, |
| 366 | { MUIOPTION_UI_JOY_RIGHT, "", 0, NULL }, |
| 367 | { MUIOPTION_UI_JOY_START, "", 0, NULL }, |
| 368 | { MUIOPTION_UI_JOY_PGUP, "", 0, NULL }, |
| 369 | { MUIOPTION_UI_JOY_PGDWN, "", 0, NULL }, |
| 370 | { MUIOPTION_UI_JOY_HOME, "0,0,0,0", 0, NULL }, |
| 371 | { MUIOPTION_UI_JOY_END, "0,0,0,0", 0, NULL }, |
| 372 | { MUIOPTION_UI_JOY_SS_CHANGE, "", 0, NULL }, |
| 373 | { MUIOPTION_UI_JOY_HISTORY_UP, "", 0, NULL }, |
| 374 | { MUIOPTION_UI_JOY_HISTORY_DOWN, "", 0, NULL }, |
| 375 | { MUIOPTION_UI_JOY_EXEC, "0,0,0,0", 0, NULL }, |
| 376 | |
| 377 | #ifndef MESS |
| 378 | { NULL, NULL, OPTION_HEADER, "GAME STATISTICS" }, |
| 379 | #endif |
| 380 | { NULL } |
| 381 | }; |
| 382 | |
| 383 | static const options_entry perGameOptions[] = |
| 384 | { |
| 385 | // per game options |
| 386 | { "_play_count", "0", 0, NULL }, |
| 387 | { "_play_time", "0", 0, NULL }, |
| 388 | { "_rom_audit", "-1", 0, NULL }, |
| 389 | { "_samples_audit", "-1", 0, NULL }, |
| 390 | #ifdef MESS |
| 391 | { "_extra_software", "", 0, NULL }, |
| 392 | #endif |
| 393 | { NULL } |
| 394 | }; |
| 395 | |
| 396 | static const options_entry filterOptions[] = |
| 397 | { |
| 398 | // filters |
| 399 | { "_filters", "0", 0, NULL }, |
| 400 | { NULL } |
| 401 | }; |
| 402 | |
| 403 | |
| 404 | |
| 405 | // Screen shot Page tab control text |
| 406 | // these must match the order of the options flags in options.h |
| 407 | // (TAB_...) |
| 408 | const char* image_tabs_long_name[MAX_TAB_TYPES] = |
| 409 | { |
| 410 | "Snapshot ", |
| 411 | "Flyer ", |
| 412 | "Cabinet ", |
| 413 | "Marquee", |
| 414 | "Title", |
| 415 | "Control Panel", |
| 416 | "PCB", |
| 417 | "History ", |
| 418 | }; |
| 419 | |
| 420 | const char* image_tabs_short_name[MAX_TAB_TYPES] = |
| 421 | { |
| 422 | "snapshot", |
| 423 | "flyer", |
| 424 | "cabinet", |
| 425 | "marquee", |
| 426 | "title", |
| 427 | "cpanel", |
| 428 | "pcb", |
| 429 | "history" |
| 430 | }; |
| 431 | |
| 432 | |
| 433 | static BOOL save_gui_settings = TRUE; |
| 434 | static BOOL save_default_options = TRUE; |
| 435 | |
| 436 | #if 0 |
| 437 | folder_filter_type *folder_filters; |
| 438 | int size_folder_filters; |
| 439 | int num_folder_filters; |
| 440 | #endif |
| 441 | |
| 442 | /*************************************************************************** |
| 443 | External functions |
| 444 | ***************************************************************************/ |
| 445 | |
| 446 | static void memory_error(const char *message) |
| 447 | { |
| 448 | win_message_box_utf8(NULL, message, NULL, MB_OK); |
| 449 | exit(-1); |
| 450 | } |
| 451 | |
| 452 | |
| 453 | |
| 454 | void AddOptions(core_options *opts, const options_entry *entrylist, BOOL is_global) |
| 455 | { |
| 456 | static const char *blacklist[] = |
| 457 | { |
| 458 | WINOPTION_SCREEN, |
| 459 | WINOPTION_ASPECT, |
| 460 | WINOPTION_RESOLUTION, |
| 461 | WINOPTION_VIEW |
| 462 | }; |
| 463 | options_entry entries[2]; |
| 464 | BOOL good_option; |
| 465 | int i; |
| 466 | |
| 467 | for ( ; entrylist->name != NULL || (entrylist->flags & OPTION_HEADER); entrylist++) |
| 468 | { |
| 469 | good_option = TRUE; |
| 470 | |
| 471 | // check blacklist |
| 472 | if (entrylist->name != NULL) |
| 473 | { |
| 474 | for (i = 0; i < ARRAY_LENGTH(blacklist); i++) |
| 475 | { |
| 476 | if (!strcmp(entrylist->name, blacklist[i])) |
| 477 | { |
| 478 | good_option = FALSE; |
| 479 | break; |
| 480 | } |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | // if is_global is FALSE, blacklist global options |
| 485 | if (entrylist->name && !is_global && IsGlobalOption(entrylist->name)) |
| 486 | good_option = FALSE; |
| 487 | |
| 488 | if (good_option) |
| 489 | { |
| 490 | memcpy(entries, entrylist, sizeof(options_entry)); |
| 491 | memset(&entries[1], 0, sizeof(entries[1])); |
| 492 | options_add_entries(opts, entries); |
| 493 | } |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | |
| 498 | |
| 499 | core_options *CreateGameOptions(int driver_index) |
| 500 | { |
| 501 | core_options *opts; |
| 502 | BOOL is_global = (driver_index == OPTIONS_TYPE_GLOBAL); |
| 503 | extern const options_entry mame_win_options[]; |
| 504 | |
| 505 | // create the options |
| 506 | opts = options_create(memory_error); |
| 507 | |
| 508 | // add the options |
| 509 | AddOptions(opts, mame_core_options, is_global); |
| 510 | AddOptions(opts, mame_win_options, is_global); |
| 511 | |
| 512 | // customize certain options |
| 513 | if (is_global) |
| 514 | options_set_option_default_value(opts, OPTION_INIPATH, "ini"); |
| 515 | |
| 516 | #ifdef MESS |
| 517 | MessSetupGameOptions(opts, driver_index); |
| 518 | #endif // MESS |
| 519 | |
| 520 | return opts; |
| 521 | } |
| 522 | |
| 523 | |
| 524 | |
| 525 | BOOL OptionsInit() |
| 526 | { |
| 527 | // create a memory pool for our data |
| 528 | options_memory_pool = pool_alloc(memory_error); |
| 529 | if (!options_memory_pool) |
| 530 | return FALSE; |
| 531 | |
| 532 | // set up the MAME32 settings (these get placed in MAME32ui.ini |
| 533 | settings = options_create(memory_error); |
| 534 | options_add_entries(settings, regSettings); |
| 535 | #ifdef MESS |
| 536 | MessSetupSettings(settings); |
| 537 | #endif |
| 538 | |
| 539 | // set up per game options |
| 540 | { |
| 541 | char buffer[128]; |
| 542 | int i, j; |
| 543 | int game_option_count = 0; |
| 544 | options_entry *driver_per_game_options; |
| 545 | options_entry *ent; |
| 546 | |
| 547 | while(perGameOptions[game_option_count].name) |
| 548 | game_option_count++; |
| 549 | |
| 550 | driver_per_game_options = (options_entry *) pool_malloc(options_memory_pool, |
| 551 | (game_option_count * driver_list_get_count(drivers) + 1) * sizeof(*driver_per_game_options)); |
| 552 | |
| 553 | for (i = 0; i < driver_list_get_count(drivers); i++) |
| 554 | { |
| 555 | for (j = 0; j < game_option_count; j++) |
| 556 | { |
| 557 | ent = &driver_per_game_options[i * game_option_count + j]; |
| 558 | |
| 559 | snprintf(buffer, ARRAY_LENGTH(buffer), "%s%s", drivers[i]->name, perGameOptions[j].name); |
| 560 | |
| 561 | memset(ent, 0, sizeof(*ent)); |
| 562 | ent->name = pool_strdup(options_memory_pool, buffer); |
| 563 | ent->defvalue = perGameOptions[j].defvalue; |
| 564 | ent->flags = perGameOptions[j].flags; |
| 565 | ent->description = perGameOptions[j].description; |
| 566 | } |
| 567 | } |
| 568 | ent = &driver_per_game_options[driver_list_get_count(drivers) * game_option_count]; |
| 569 | memset(ent, 0, sizeof(*ent)); |
| 570 | options_add_entries(settings, driver_per_game_options); |
| 571 | } |
| 572 | |
| 573 | // set up global options |
| 574 | global = CreateGameOptions(OPTIONS_TYPE_GLOBAL); |
| 575 | #if 0 |
| 576 | // set up folders |
| 577 | size_folder_filters = 1; |
| 578 | num_folder_filters = 0; |
| 579 | folder_filters = (folder_filter_type *) pool_malloc(options_memory_pool, size_folder_filters * sizeof(*folder_filters)); |
| 580 | #endif |
| 581 | // now load the options and settings |
| 582 | LoadOptionsAndSettings(); |
| 583 | |
| 584 | return TRUE; |
| 585 | |
| 586 | } |
| 587 | |
| 588 | void OptionsExit(void) |
| 589 | { |
| 590 | // free global options |
| 591 | options_free(global); |
| 592 | global = NULL; |
| 593 | |
| 594 | // free settings |
| 595 | options_free(settings); |
| 596 | settings = NULL; |
| 597 | |
| 598 | // free the memory pool |
| 599 | pool_free(options_memory_pool); |
| 600 | options_memory_pool = NULL; |
| 601 | } |
| 602 | |
| 603 | core_options * MameUISettings(void) |
| 604 | { |
| 605 | return settings; |
| 606 | } |
| 607 | |
| 608 | core_options * MameUIGlobal(void) |
| 609 | { |
| 610 | return global; |
| 611 | } |
| 612 | |
| 613 | #if 0 |
| 614 | static void LoadFolderFilter(int folder_index,int filters) |
| 615 | { |
| 616 | //dprintf("loaded folder filter %i %i",folder_index,filters); |
| 617 | |
| 618 | if (num_folder_filters == size_folder_filters) |
| 619 | { |
| 620 | size_folder_filters *= 2; |
| 621 | folder_filters = (folder_filter_type *)realloc( |
| 622 | folder_filters,size_folder_filters * sizeof(folder_filter_type)); |
| 623 | } |
| 624 | folder_filters[num_folder_filters].folder_index = folder_index; |
| 625 | folder_filters[num_folder_filters].filters = filters; |
| 626 | |
| 627 | num_folder_filters++; |
| 628 | } |
| 629 | #endif |
| 630 | |
| 631 | // Restore ui settings to factory |
| 632 | void ResetGUI(void) |
| 633 | { |
| 634 | ResetToDefaults(settings, OPTION_PRIORITY_NORMAL); |
| 635 | // Save the new MAME32ui.ini |
| 636 | SaveOptions(); |
| 637 | save_gui_settings = FALSE; |
| 638 | } |
| 639 | |
| 640 | const char * GetImageTabLongName(int tab_index) |
| 641 | { |
| 642 | assert(tab_index >= 0); |
| 643 | assert(tab_index < ARRAY_LENGTH(image_tabs_long_name)); |
| 644 | return image_tabs_long_name[tab_index]; |
| 645 | } |
| 646 | |
| 647 | const char * GetImageTabShortName(int tab_index) |
| 648 | { |
| 649 | assert(tab_index >= 0); |
| 650 | assert(tab_index < ARRAY_LENGTH(image_tabs_short_name)); |
| 651 | return image_tabs_short_name[tab_index]; |
| 652 | } |
| 653 | |
| 654 | //============================================================ |
| 655 | // OPTIONS WRAPPERS |
| 656 | //============================================================ |
| 657 | |
| 658 | static COLORREF options_get_color(core_options *opts, const char *name) |
| 659 | { |
| 660 | const char *value_str; |
| 661 | unsigned int r, g, b; |
| 662 | COLORREF value; |
| 663 | |
| 664 | value_str = options_get_string(opts, name); |
| 665 | |
| 666 | if (sscanf(value_str, "%u,%u,%u", &r, &g, &b) == 3) |
| 667 | value = RGB(r,g,b); |
| 668 | else |
| 669 | value = (COLORREF) - 1; |
| 670 | return value; |
| 671 | } |
| 672 | |
| 673 | static void options_set_color(core_options *opts, const char *name, COLORREF value) |
| 674 | { |
| 675 | char value_str[32]; |
| 676 | |
| 677 | if (value == (COLORREF) -1) |
| 678 | { |
| 679 | snprintf(value_str, ARRAY_LENGTH(value_str), "%d", (int) value); |
| 680 | } |
| 681 | else |
| 682 | { |
| 683 | snprintf(value_str, ARRAY_LENGTH(value_str), "%d,%d,%d", |
| 684 | (((int) value) >> 0) & 0xFF, |
| 685 | (((int) value) >> 8) & 0xFF, |
| 686 | (((int) value) >> 16) & 0xFF); |
| 687 | } |
| 688 | options_set_string(opts, name, value_str, OPTION_PRIORITY_CMDLINE); |
| 689 | } |
| 690 | |
| 691 | static COLORREF options_get_color_default(core_options *opts, const char *name, int default_color) |
| 692 | { |
| 693 | COLORREF value = options_get_color(opts, name); |
| 694 | if (value == (COLORREF) -1) |
| 695 | value = GetSysColor(default_color); |
| 696 | return value; |
| 697 | } |
| 698 | |
| 699 | static void options_set_color_default(core_options *opts, const char *name, COLORREF value, int default_color) |
| 700 | { |
| 701 | if (value == GetSysColor(default_color)) |
| 702 | options_set_color(settings, name, (COLORREF) -1); |
| 703 | else |
| 704 | options_set_color(settings, name, value); |
| 705 | } |
| 706 | |
| 707 | static input_seq *options_get_input_seq(core_options *opts, const char *name) |
| 708 | { |
| 709 | static input_seq seq; |
| 710 | const char *seq_string; |
| 711 | |
| 712 | seq_string = options_get_string(opts, name); |
| 713 | input_seq_from_tokens(seq_string, &seq); |
| 714 | return &seq; |
| 715 | } |
| 716 | |
| 717 | |
| 718 | |
| 719 | //============================================================ |
| 720 | // OPTIONS CALLS |
| 721 | //============================================================ |
| 722 | |
| 723 | void SetViewMode(int val) |
| 724 | { |
| 725 | options_set_int(settings, MUIOPTION_LIST_MODE, val, OPTION_PRIORITY_CMDLINE); |
| 726 | } |
| 727 | |
| 728 | int GetViewMode(void) |
| 729 | { |
| 730 | return options_get_int(settings, MUIOPTION_LIST_MODE); |
| 731 | } |
| 732 | |
| 733 | void SetGameCheck(BOOL game_check) |
| 734 | { |
| 735 | options_set_bool(settings, MUIOPTION_CHECK_GAME, game_check, OPTION_PRIORITY_CMDLINE); |
| 736 | } |
| 737 | |
| 738 | BOOL GetGameCheck(void) |
| 739 | { |
| 740 | return options_get_bool(settings,MUIOPTION_CHECK_GAME); |
| 741 | } |
| 742 | |
| 743 | void SetJoyGUI(BOOL use_joygui) |
| 744 | { |
| 745 | options_set_bool(settings, MUIOPTION_JOYSTICK_IN_INTERFACE, use_joygui, OPTION_PRIORITY_CMDLINE); |
| 746 | } |
| 747 | |
| 748 | BOOL GetJoyGUI(void) |
| 749 | { |
| 750 | return options_get_bool(settings, MUIOPTION_JOYSTICK_IN_INTERFACE); |
| 751 | } |
| 752 | |
| 753 | void SetKeyGUI(BOOL use_keygui) |
| 754 | { |
| 755 | options_set_bool(settings, MUIOPTION_KEYBOARD_IN_INTERFACE, use_keygui, OPTION_PRIORITY_CMDLINE); |
| 756 | } |
| 757 | |
| 758 | BOOL GetKeyGUI(void) |
| 759 | { |
| 760 | return options_get_bool(settings, MUIOPTION_KEYBOARD_IN_INTERFACE); |
| 761 | } |
| 762 | |
| 763 | void SetCycleScreenshot(int cycle_screenshot) |
| 764 | { |
| 765 | options_set_int(settings, MUIOPTION_CYCLE_SCREENSHOT, cycle_screenshot, OPTION_PRIORITY_CMDLINE); |
| 766 | } |
| 767 | |
| 768 | int GetCycleScreenshot(void) |
| 769 | { |
| 770 | return options_get_int(settings, MUIOPTION_CYCLE_SCREENSHOT); |
| 771 | } |
| 772 | |
| 773 | void SetStretchScreenShotLarger(BOOL stretch) |
| 774 | { |
| 775 | options_set_bool(settings, MUIOPTION_STRETCH_SCREENSHOT_LARGER, stretch, OPTION_PRIORITY_CMDLINE); |
| 776 | } |
| 777 | |
| 778 | BOOL GetStretchScreenShotLarger(void) |
| 779 | { |
| 780 | return options_get_bool(settings, MUIOPTION_STRETCH_SCREENSHOT_LARGER); |
| 781 | } |
| 782 | |
| 783 | void SetScreenshotBorderSize(int size) |
| 784 | { |
| 785 | options_set_int(settings, MUIOPTION_SCREENSHOT_BORDER_SIZE, size, OPTION_PRIORITY_CMDLINE); |
| 786 | } |
| 787 | |
| 788 | int GetScreenshotBorderSize(void) |
| 789 | { |
| 790 | return options_get_int(settings, MUIOPTION_SCREENSHOT_BORDER_SIZE); |
| 791 | } |
| 792 | |
| 793 | void SetScreenshotBorderColor(COLORREF uColor) |
| 794 | { |
| 795 | options_set_color_default(settings, MUIOPTION_SCREENSHOT_BORDER_COLOR, uColor, COLOR_3DFACE); |
| 796 | } |
| 797 | |
| 798 | COLORREF GetScreenshotBorderColor(void) |
| 799 | { |
| 800 | return options_get_color_default(settings, MUIOPTION_SCREENSHOT_BORDER_COLOR, COLOR_3DFACE); |
| 801 | } |
| 802 | |
| 803 | void SetFilterInherit(BOOL inherit) |
| 804 | { |
| 805 | options_set_bool(settings, MUIOPTION_INHERIT_FILTER, inherit, OPTION_PRIORITY_CMDLINE); |
| 806 | } |
| 807 | |
| 808 | BOOL GetFilterInherit(void) |
| 809 | { |
| 810 | return options_get_bool(settings, MUIOPTION_INHERIT_FILTER); |
| 811 | } |
| 812 | |
| 813 | void SetOffsetClones(BOOL offset) |
| 814 | { |
| 815 | options_set_bool(settings, MUIOPTION_OFFSET_CLONES, offset, OPTION_PRIORITY_CMDLINE); |
| 816 | } |
| 817 | |
| 818 | BOOL GetOffsetClones(void) |
| 819 | { |
| 820 | return options_get_bool(settings, MUIOPTION_OFFSET_CLONES); |
| 821 | } |
| 822 | |
| 823 | void SetGameCaption(BOOL caption) |
| 824 | { |
| 825 | options_set_bool(settings, MUIOPTION_GAME_CAPTION, caption, OPTION_PRIORITY_CMDLINE); |
| 826 | } |
| 827 | |
| 828 | BOOL GetGameCaption(void) |
| 829 | { |
| 830 | return options_get_bool(settings, MUIOPTION_GAME_CAPTION); |
| 831 | } |
| 832 | |
| 833 | void SetBroadcast(BOOL broadcast) |
| 834 | { |
| 835 | options_set_bool(settings, MUIOPTION_BROADCAST_GAME_NAME, broadcast, OPTION_PRIORITY_CMDLINE); |
| 836 | } |
| 837 | |
| 838 | BOOL GetBroadcast(void) |
| 839 | { |
| 840 | return options_get_bool(settings, MUIOPTION_BROADCAST_GAME_NAME); |
| 841 | } |
| 842 | |
| 843 | void SetRandomBackground(BOOL random_bg) |
| 844 | { |
| 845 | options_set_bool(settings, MUIOPTION_RANDOM_BACKGROUND, random_bg, OPTION_PRIORITY_CMDLINE); |
| 846 | } |
| 847 | |
| 848 | BOOL GetRandomBackground(void) |
| 849 | { |
| 850 | return options_get_bool(settings, MUIOPTION_RANDOM_BACKGROUND); |
| 851 | } |
| 852 | |
| 853 | void SetSavedFolderID(UINT val) |
| 854 | { |
| 855 | options_set_int(settings, MUIOPTION_DEFAULT_FOLDER_ID, (int) val, OPTION_PRIORITY_CMDLINE); |
| 856 | } |
| 857 | |
| 858 | UINT GetSavedFolderID(void) |
| 859 | { |
| 860 | return (UINT) options_get_int(settings, MUIOPTION_DEFAULT_FOLDER_ID); |
| 861 | } |
| 862 | |
| 863 | void SetShowScreenShot(BOOL val) |
| 864 | { |
| 865 | options_set_bool(settings, MUIOPTION_SHOW_IMAGE_SECTION, val, OPTION_PRIORITY_CMDLINE); |
| 866 | } |
| 867 | |
| 868 | BOOL GetShowScreenShot(void) |
| 869 | { |
| 870 | return options_get_bool(settings, MUIOPTION_SHOW_IMAGE_SECTION); |
| 871 | } |
| 872 | |
| 873 | void SetShowFolderList(BOOL val) |
| 874 | { |
| 875 | options_set_bool(settings, MUIOPTION_SHOW_FOLDER_SECTION, val, OPTION_PRIORITY_CMDLINE); |
| 876 | } |
| 877 | |
| 878 | BOOL GetShowFolderList(void) |
| 879 | { |
| 880 | return options_get_bool(settings, MUIOPTION_SHOW_FOLDER_SECTION); |
| 881 | } |
| 882 | |
| 883 | static void GetsShowFolderFlags(LPBITS bits) |
| 884 | { |
| 885 | char s[2000]; |
| 886 | extern FOLDERDATA g_folderData[]; |
| 887 | char *token; |
| 888 | |
| 889 | snprintf(s, ARRAY_LENGTH(s), "%s", options_get_string(settings, MUIOPTION_HIDE_FOLDERS)); |
| 890 | |
| 891 | SetAllBits(bits, TRUE); |
| 892 | |
| 893 | token = strtok(s,", \t"); |
| 894 | while (token != NULL) |
| 895 | { |
| 896 | int j; |
| 897 | |
| 898 | for (j=0;g_folderData[j].m_lpTitle != NULL;j++) |
| 899 | { |
| 900 | if (strcmp(g_folderData[j].short_name,token) == 0) |
| 901 | { |
| 902 | ClearBit(bits, g_folderData[j].m_nFolderId); |
| 903 | break; |
| 904 | } |
| 905 | } |
| 906 | token = strtok(NULL,", \t"); |
| 907 | } |
| 908 | } |
| 909 | |
| 910 | BOOL GetShowFolder(int folder) |
| 911 | { |
| 912 | BOOL result; |
| 913 | LPBITS show_folder_flags = NewBits(MAX_FOLDERS); |
| 914 | GetsShowFolderFlags(show_folder_flags); |
| 915 | result = TestBit(show_folder_flags, folder); |
| 916 | DeleteBits(show_folder_flags); |
| 917 | return result; |
| 918 | } |
| 919 | |
| 920 | void SetShowFolder(int folder,BOOL show) |
| 921 | { |
| 922 | LPBITS show_folder_flags = NewBits(MAX_FOLDERS); |
| 923 | int i; |
| 924 | int num_saved = 0; |
| 925 | char str[10000]; |
| 926 | extern FOLDERDATA g_folderData[]; |
| 927 | |
| 928 | GetsShowFolderFlags(show_folder_flags); |
| 929 | |
| 930 | if (show) |
| 931 | SetBit(show_folder_flags, folder); |
| 932 | else |
| 933 | ClearBit(show_folder_flags, folder); |
| 934 | |
| 935 | strcpy(str, ""); |
| 936 | |
| 937 | // we save the ones that are NOT displayed, so we can add new ones |
| 938 | // and upgraders will see them |
| 939 | for (i=0;i<MAX_FOLDERS;i++) |
| 940 | { |
| 941 | if (TestBit(show_folder_flags, i) == FALSE) |
| 942 | { |
| 943 | int j; |
| 944 | |
| 945 | if (num_saved != 0) |
| 946 | strcat(str,", "); |
| 947 | |
| 948 | for (j=0;g_folderData[j].m_lpTitle != NULL;j++) |
| 949 | { |
| 950 | if (g_folderData[j].m_nFolderId == i) |
| 951 | { |
| 952 | strcat(str,g_folderData[j].short_name); |
| 953 | num_saved++; |
| 954 | break; |
| 955 | } |
| 956 | } |
| 957 | } |
| 958 | } |
| 959 | options_set_string(settings, MUIOPTION_HIDE_FOLDERS, str, OPTION_PRIORITY_CMDLINE); |
| 960 | DeleteBits(show_folder_flags); |
| 961 | } |
| 962 | |
| 963 | void SetShowStatusBar(BOOL val) |
| 964 | { |
| 965 | options_set_bool(settings, MUIOPTION_SHOW_STATUS_BAR, val, OPTION_PRIORITY_CMDLINE); |
| 966 | } |
| 967 | |
| 968 | BOOL GetShowStatusBar(void) |
| 969 | { |
| 970 | return options_get_bool(settings, MUIOPTION_SHOW_STATUS_BAR); |
| 971 | } |
| 972 | |
| 973 | void SetShowTabCtrl (BOOL val) |
| 974 | { |
| 975 | options_set_bool(settings, MUIOPTION_SHOW_TABS, val, OPTION_PRIORITY_CMDLINE); |
| 976 | } |
| 977 | |
| 978 | BOOL GetShowTabCtrl (void) |
| 979 | { |
| 980 | return options_get_bool(settings, MUIOPTION_SHOW_TABS); |
| 981 | } |
| 982 | |
| 983 | void SetShowToolBar(BOOL val) |
| 984 | { |
| 985 | options_set_bool(settings, MUIOPTION_SHOW_TOOLBAR, val, OPTION_PRIORITY_CMDLINE); |
| 986 | } |
| 987 | |
| 988 | BOOL GetShowToolBar(void) |
| 989 | { |
| 990 | return options_get_bool(settings, MUIOPTION_SHOW_TOOLBAR); |
| 991 | } |
| 992 | |
| 993 | void SetCurrentTab(const char *shortname) |
| 994 | { |
| 995 | options_set_string(settings, MUIOPTION_CURRENT_TAB, shortname, OPTION_PRIORITY_CMDLINE); |
| 996 | } |
| 997 | |
| 998 | const char *GetCurrentTab(void) |
| 999 | { |
| 1000 | return options_get_string(settings, MUIOPTION_CURRENT_TAB); |
| 1001 | } |
| 1002 | |
| 1003 | void SetDefaultGame(const char *name) |
| 1004 | { |
| 1005 | options_set_string(settings, MUIOPTION_DEFAULT_GAME, name, OPTION_PRIORITY_CMDLINE); |
| 1006 | } |
| 1007 | |
| 1008 | const char *GetDefaultGame(void) |
| 1009 | { |
| 1010 | return options_get_string(settings, MUIOPTION_DEFAULT_GAME); |
| 1011 | } |
| 1012 | |
| 1013 | void SetWindowArea(const AREA *area) |
| 1014 | { |
| 1015 | options_set_int(settings, MUIOPTION_WINDOW_X, area->x, OPTION_PRIORITY_CMDLINE); |
| 1016 | options_set_int(settings, MUIOPTION_WINDOW_Y, area->y, OPTION_PRIORITY_CMDLINE); |
| 1017 | options_set_int(settings, MUIOPTION_WINDOW_WIDTH, area->width, OPTION_PRIORITY_CMDLINE); |
| 1018 | options_set_int(settings, MUIOPTION_WINDOW_HEIGHT, area->height, OPTION_PRIORITY_CMDLINE); |
| 1019 | } |
| 1020 | |
| 1021 | void GetWindowArea(AREA *area) |
| 1022 | { |
| 1023 | area->x = options_get_int(settings, MUIOPTION_WINDOW_X); |
| 1024 | area->y = options_get_int(settings, MUIOPTION_WINDOW_Y); |
| 1025 | area->width = options_get_int(settings, MUIOPTION_WINDOW_WIDTH); |
| 1026 | area->height = options_get_int(settings, MUIOPTION_WINDOW_HEIGHT); |
| 1027 | } |
| 1028 | |
| 1029 | void SetWindowState(UINT state) |
| 1030 | { |
| 1031 | options_set_int(settings, MUIOPTION_WINDOW_STATE, state, OPTION_PRIORITY_CMDLINE); |
| 1032 | } |
| 1033 | |
| 1034 | UINT GetWindowState(void) |
| 1035 | { |
| 1036 | return options_get_int(settings, MUIOPTION_WINDOW_STATE); |
| 1037 | } |
| 1038 | |
| 1039 | void SetCustomColor(int iIndex, COLORREF uColor) |
| 1040 | { |
| 1041 | const char *custom_color_string; |
| 1042 | COLORREF custom_color[256]; |
| 1043 | char buffer[10000]; |
| 1044 | |
| 1045 | custom_color_string = options_get_string(settings, MUIOPTION_CUSTOM_COLOR); |
| 1046 | CusColorDecodeString(custom_color_string, custom_color); |
| 1047 | |
| 1048 | custom_color[iIndex] = uColor; |
| 1049 | |
| 1050 | CusColorEncodeString(custom_color, buffer); |
| 1051 | options_set_string(settings, MUIOPTION_CUSTOM_COLOR, buffer, OPTION_PRIORITY_CMDLINE); |
| 1052 | } |
| 1053 | |
| 1054 | COLORREF GetCustomColor(int iIndex) |
| 1055 | { |
| 1056 | const char *custom_color_string; |
| 1057 | COLORREF custom_color[256]; |
| 1058 | |
| 1059 | custom_color_string = options_get_string(settings, MUIOPTION_CUSTOM_COLOR); |
| 1060 | CusColorDecodeString(custom_color_string, custom_color); |
| 1061 | |
| 1062 | if (custom_color[iIndex] == (COLORREF)-1) |
| 1063 | return (COLORREF)RGB(0,0,0); |
| 1064 | |
| 1065 | return custom_color[iIndex]; |
| 1066 | } |
| 1067 | |
| 1068 | void SetListFont(const LOGFONT *font) |
| 1069 | { |
| 1070 | char font_string[10000]; |
| 1071 | FontEncodeString(font, font_string); |
| 1072 | options_set_string(settings, MUIOPTION_LIST_FONT, font_string, OPTION_PRIORITY_CMDLINE); |
| 1073 | } |
| 1074 | |
| 1075 | void GetListFont(LOGFONT *font) |
| 1076 | { |
| 1077 | const char *font_string = options_get_string(settings, MUIOPTION_LIST_FONT); |
| 1078 | FontDecodeString(font_string, font); |
| 1079 | } |
| 1080 | |
| 1081 | void SetListFontColor(COLORREF uColor) |
| 1082 | { |
| 1083 | options_set_color_default(settings, MUIOPTION_TEXT_COLOR, uColor, COLOR_WINDOWTEXT); |
| 1084 | } |
| 1085 | |
| 1086 | COLORREF GetListFontColor(void) |
| 1087 | { |
| 1088 | return options_get_color_default(settings, MUIOPTION_TEXT_COLOR, COLOR_WINDOWTEXT); |
| 1089 | } |
| 1090 | |
| 1091 | void SetListCloneColor(COLORREF uColor) |
| 1092 | { |
| 1093 | options_set_color_default(settings, MUIOPTION_CLONE_COLOR, uColor, COLOR_WINDOWTEXT); |
| 1094 | } |
| 1095 | |
| 1096 | COLORREF GetListCloneColor(void) |
| 1097 | { |
| 1098 | return options_get_color_default(settings, MUIOPTION_CLONE_COLOR, COLOR_WINDOWTEXT); |
| 1099 | } |
| 1100 | |
| 1101 | int GetShowTab(int tab) |
| 1102 | { |
| 1103 | const char *show_tabs_string; |
| 1104 | int show_tab_flags; |
| 1105 | |
| 1106 | show_tabs_string = options_get_string(settings, MUIOPTION_HIDE_TABS); |
| 1107 | TabFlagsDecodeString(show_tabs_string, &show_tab_flags); |
| 1108 | return (show_tab_flags & (1 << tab)) != 0; |
| 1109 | } |
| 1110 | |
| 1111 | void SetShowTab(int tab,BOOL show) |
| 1112 | { |
| 1113 | const char *show_tabs_string; |
| 1114 | int show_tab_flags; |
| 1115 | char buffer[10000]; |
| 1116 | |
| 1117 | show_tabs_string = options_get_string(settings, MUIOPTION_HIDE_TABS); |
| 1118 | TabFlagsDecodeString(show_tabs_string, &show_tab_flags); |
| 1119 | |
| 1120 | if (show) |
| 1121 | show_tab_flags |= 1 << tab; |
| 1122 | else |
| 1123 | show_tab_flags &= ~(1 << tab); |
| 1124 | |
| 1125 | TabFlagsEncodeString(show_tab_flags, buffer); |
| 1126 | options_set_string(settings, MUIOPTION_HIDE_TABS, buffer, OPTION_PRIORITY_CMDLINE); |
| 1127 | } |
| 1128 | |
| 1129 | // don't delete the last one |
| 1130 | BOOL AllowedToSetShowTab(int tab,BOOL show) |
| 1131 | { |
| 1132 | const char *show_tabs_string; |
| 1133 | int show_tab_flags; |
| 1134 | |
| 1135 | if (show == TRUE) |
| 1136 | return TRUE; |
| 1137 | |
| 1138 | show_tabs_string = options_get_string(settings, MUIOPTION_HIDE_TABS); |
| 1139 | TabFlagsDecodeString(show_tabs_string, &show_tab_flags); |
| 1140 | |
| 1141 | show_tab_flags &= ~(1 << tab); |
| 1142 | return show_tab_flags != 0; |
| 1143 | } |
| 1144 | |
| 1145 | int GetHistoryTab(void) |
| 1146 | { |
| 1147 | return options_get_int(settings, MUIOPTION_HISTORY_TAB); |
| 1148 | } |
| 1149 | |
| 1150 | void SetHistoryTab(int tab, BOOL show) |
| 1151 | { |
| 1152 | if (show) |
| 1153 | options_set_int(settings, MUIOPTION_HISTORY_TAB, tab, OPTION_PRIORITY_CMDLINE); |
| 1154 | else |
| 1155 | options_set_int(settings, MUIOPTION_HISTORY_TAB, TAB_NONE, OPTION_PRIORITY_CMDLINE); |
| 1156 | } |
| 1157 | |
| 1158 | void SetColumnWidths(int width[]) |
| 1159 | { |
| 1160 | char column_width_string[10000]; |
| 1161 | ColumnEncodeStringWithCount(width, column_width_string, COLUMN_MAX); |
| 1162 | options_set_string(settings, MUIOPTION_COLUMN_WIDTHS, column_width_string, OPTION_PRIORITY_CMDLINE); |
| 1163 | } |
| 1164 | |
| 1165 | void GetColumnWidths(int width[]) |
| 1166 | { |
| 1167 | const char *column_width_string; |
| 1168 | column_width_string = options_get_string(settings, MUIOPTION_COLUMN_WIDTHS); |
| 1169 | ColumnDecodeStringWithCount(column_width_string, width, COLUMN_MAX); |
| 1170 | } |
| 1171 | |
| 1172 | void SetSplitterPos(int splitterId, int pos) |
| 1173 | { |
| 1174 | const char *splitter_string; |
| 1175 | int *splitter; |
| 1176 | char buffer[10000]; |
| 1177 | |
| 1178 | if (splitterId < GetSplitterCount()) |
| 1179 | { |
| 1180 | splitter_string = options_get_string(settings, MUIOPTION_SPLITTERS); |
| 1181 | splitter = (int *) alloca(GetSplitterCount() * sizeof(*splitter)); |
| 1182 | SplitterDecodeString(splitter_string, splitter); |
| 1183 | |
| 1184 | splitter[splitterId] = pos; |
| 1185 | |
| 1186 | SplitterEncodeString(splitter, buffer); |
| 1187 | options_set_string(settings, MUIOPTION_SPLITTERS, buffer, OPTION_PRIORITY_CMDLINE); |
| 1188 | } |
| 1189 | } |
| 1190 | |
| 1191 | int GetSplitterPos(int splitterId) |
| 1192 | { |
| 1193 | const char *splitter_string; |
| 1194 | int *splitter; |
| 1195 | |
| 1196 | splitter_string = options_get_string(settings, MUIOPTION_SPLITTERS); |
| 1197 | splitter = (int *) alloca(GetSplitterCount() * sizeof(*splitter)); |
| 1198 | SplitterDecodeString(splitter_string, splitter); |
| 1199 | |
| 1200 | if (splitterId < GetSplitterCount()) |
| 1201 | return splitter[splitterId]; |
| 1202 | |
| 1203 | return -1; /* Error */ |
| 1204 | } |
| 1205 | |
| 1206 | void SetColumnOrder(int order[]) |
| 1207 | { |
| 1208 | char column_order_string[10000]; |
| 1209 | ColumnEncodeStringWithCount(order, column_order_string, COLUMN_MAX); |
| 1210 | options_set_string(settings, MUIOPTION_COLUMN_ORDER, column_order_string, OPTION_PRIORITY_CMDLINE); |
| 1211 | } |
| 1212 | |
| 1213 | void GetColumnOrder(int order[]) |
| 1214 | { |
| 1215 | const char *column_order_string; |
| 1216 | column_order_string = options_get_string(settings, MUIOPTION_COLUMN_ORDER); |
| 1217 | ColumnDecodeStringWithCount(column_order_string, order, COLUMN_MAX); |
| 1218 | } |
| 1219 | |
| 1220 | void SetColumnShown(int shown[]) |
| 1221 | { |
| 1222 | char column_shown_string[10000]; |
| 1223 | ColumnEncodeStringWithCount(shown, column_shown_string, COLUMN_MAX); |
| 1224 | options_set_string(settings, MUIOPTION_COLUMN_SHOWN, column_shown_string, OPTION_PRIORITY_CMDLINE); |
| 1225 | } |
| 1226 | |
| 1227 | void GetColumnShown(int shown[]) |
| 1228 | { |
| 1229 | const char *column_shown_string; |
| 1230 | column_shown_string = options_get_string(settings, MUIOPTION_COLUMN_SHOWN); |
| 1231 | ColumnDecodeStringWithCount(column_shown_string, shown, COLUMN_MAX); |
| 1232 | } |
| 1233 | |
| 1234 | void SetSortColumn(int column) |
| 1235 | { |
| 1236 | options_set_int(settings, MUIOPTION_SORT_COLUMN, column, OPTION_PRIORITY_CMDLINE); |
| 1237 | } |
| 1238 | |
| 1239 | int GetSortColumn(void) |
| 1240 | { |
| 1241 | return options_get_int(settings, MUIOPTION_SORT_COLUMN); |
| 1242 | } |
| 1243 | |
| 1244 | void SetSortReverse(BOOL reverse) |
| 1245 | { |
| 1246 | options_set_bool(settings, MUIOPTION_SORT_REVERSED, reverse, OPTION_PRIORITY_CMDLINE); |
| 1247 | } |
| 1248 | |
| 1249 | BOOL GetSortReverse(void) |
| 1250 | { |
| 1251 | return options_get_bool(settings, MUIOPTION_SORT_REVERSED); |
| 1252 | } |
| 1253 | |
| 1254 | const char* GetLanguage(void) |
| 1255 | { |
| 1256 | return options_get_string(settings, MUIOPTION_LANGUAGE); |
| 1257 | } |
| 1258 | |
| 1259 | void SetLanguage(const char* lang) |
| 1260 | { |
| 1261 | options_set_string(settings, MUIOPTION_LANGUAGE, lang, OPTION_PRIORITY_CMDLINE); |
| 1262 | } |
| 1263 | |
| 1264 | const char* GetRomDirs(void) |
| 1265 | { |
| 1266 | return options_get_string(global, OPTION_ROMPATH); |
| 1267 | } |
| 1268 | |
| 1269 | void SetRomDirs(const char* paths) |
| 1270 | { |
| 1271 | options_set_string(global, OPTION_ROMPATH, paths, OPTION_PRIORITY_CMDLINE); |
| 1272 | } |
| 1273 | |
| 1274 | const char* GetSampleDirs(void) |
| 1275 | { |
| 1276 | return options_get_string(global, OPTION_SAMPLEPATH); |
| 1277 | } |
| 1278 | |
| 1279 | void SetSampleDirs(const char* paths) |
| 1280 | { |
| 1281 | options_set_string(global, OPTION_SAMPLEPATH, paths, OPTION_PRIORITY_CMDLINE); |
| 1282 | } |
| 1283 | |
| 1284 | const char * GetIniDir(void) |
| 1285 | { |
| 1286 | const char *ini_dir; |
| 1287 | const char *s; |
| 1288 | |
| 1289 | ini_dir = options_get_string(global, OPTION_INIPATH); |
| 1290 | while((s = strchr(ini_dir, ';')) != NULL) |
| 1291 | { |
| 1292 | ini_dir = s + 1; |
| 1293 | } |
| 1294 | return ini_dir; |
| 1295 | |
| 1296 | } |
| 1297 | |
| 1298 | void SetIniDir(const char *path) |
| 1299 | { |
| 1300 | options_set_string(global, OPTION_INIPATH, path, OPTION_PRIORITY_CMDLINE); |
| 1301 | } |
| 1302 | |
| 1303 | const char* GetCtrlrDir(void) |
| 1304 | { |
| 1305 | return options_get_string(global, OPTION_CTRLRPATH); |
| 1306 | } |
| 1307 | |
| 1308 | void SetCtrlrDir(const char* path) |
| 1309 | { |
| 1310 | options_set_string(global, OPTION_CTRLRPATH, path, OPTION_PRIORITY_CMDLINE); |
| 1311 | } |
| 1312 | |
| 1313 | const char* GetCommentDir(void) |
| 1314 | { |
| 1315 | return options_get_string(global, OPTION_COMMENT_DIRECTORY); |
| 1316 | } |
| 1317 | |
| 1318 | void SetCommentDir(const char* path) |
| 1319 | { |
| 1320 | options_set_string(global, OPTION_COMMENT_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1321 | } |
| 1322 | |
| 1323 | const char* GetCfgDir(void) |
| 1324 | { |
| 1325 | return options_get_string(global, OPTION_CFG_DIRECTORY); |
| 1326 | } |
| 1327 | |
| 1328 | void SetCfgDir(const char* path) |
| 1329 | { |
| 1330 | options_set_string(global, OPTION_CFG_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1331 | } |
| 1332 | |
| 1333 | const char* GetNvramDir(void) |
| 1334 | { |
| 1335 | return options_get_string(global, OPTION_NVRAM_DIRECTORY); |
| 1336 | } |
| 1337 | |
| 1338 | void SetNvramDir(const char* path) |
| 1339 | { |
| 1340 | options_set_string(global, OPTION_NVRAM_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1341 | } |
| 1342 | |
| 1343 | const char* GetInpDir(void) |
| 1344 | { |
| 1345 | return options_get_string(global, OPTION_INPUT_DIRECTORY); |
| 1346 | } |
| 1347 | |
| 1348 | void SetInpDir(const char* path) |
| 1349 | { |
| 1350 | options_set_string(global, OPTION_INPUT_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1351 | } |
| 1352 | |
| 1353 | const char* GetImgDir(void) |
| 1354 | { |
| 1355 | return options_get_string(global, OPTION_SNAPSHOT_DIRECTORY); |
| 1356 | } |
| 1357 | |
| 1358 | void SetImgDir(const char* path) |
| 1359 | { |
| 1360 | options_set_string(global, OPTION_SNAPSHOT_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1361 | } |
| 1362 | |
| 1363 | const char* GetStateDir(void) |
| 1364 | { |
| 1365 | return options_get_string(global, OPTION_STATE_DIRECTORY); |
| 1366 | } |
| 1367 | |
| 1368 | void SetStateDir(const char* path) |
| 1369 | { |
| 1370 | options_set_string(global, OPTION_STATE_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1371 | } |
| 1372 | |
| 1373 | const char* GetArtDir(void) |
| 1374 | { |
| 1375 | return options_get_string(global, OPTION_ARTPATH); |
| 1376 | } |
| 1377 | |
| 1378 | void SetArtDir(const char* path) |
| 1379 | { |
| 1380 | options_set_string(global, OPTION_ARTPATH, path, OPTION_PRIORITY_CMDLINE); |
| 1381 | } |
| 1382 | |
| 1383 | const char* GetMemcardDir(void) |
| 1384 | { |
| 1385 | return options_get_string(global, OPTION_MEMCARD_DIRECTORY); |
| 1386 | } |
| 1387 | |
| 1388 | void SetMemcardDir(const char* path) |
| 1389 | { |
| 1390 | options_set_string(global, OPTION_MEMCARD_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1391 | } |
| 1392 | |
| 1393 | const char* GetFlyerDir(void) |
| 1394 | { |
| 1395 | return options_get_string(settings, MUIOPTION_FLYER_DIRECTORY); |
| 1396 | } |
| 1397 | |
| 1398 | void SetFlyerDir(const char* path) |
| 1399 | { |
| 1400 | options_set_string(settings, MUIOPTION_FLYER_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1401 | } |
| 1402 | |
| 1403 | const char* GetCabinetDir(void) |
| 1404 | { |
| 1405 | return options_get_string(settings, MUIOPTION_CABINET_DIRECTORY); |
| 1406 | } |
| 1407 | |
| 1408 | void SetCabinetDir(const char* path) |
| 1409 | { |
| 1410 | options_set_string(settings, MUIOPTION_CABINET_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1411 | } |
| 1412 | |
| 1413 | const char* GetMarqueeDir(void) |
| 1414 | { |
| 1415 | return options_get_string(settings, MUIOPTION_MARQUEE_DIRECTORY); |
| 1416 | } |
| 1417 | |
| 1418 | void SetMarqueeDir(const char* path) |
| 1419 | { |
| 1420 | options_set_string(settings, MUIOPTION_MARQUEE_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1421 | } |
| 1422 | |
| 1423 | const char* GetTitlesDir(void) |
| 1424 | { |
| 1425 | return options_get_string(settings, MUIOPTION_TITLE_DIRECTORY); |
| 1426 | } |
| 1427 | |
| 1428 | void SetTitlesDir(const char* path) |
| 1429 | { |
| 1430 | options_set_string(settings, MUIOPTION_TITLE_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1431 | } |
| 1432 | |
| 1433 | const char * GetControlPanelDir(void) |
| 1434 | { |
| 1435 | return options_get_string(settings, MUIOPTION_CPANEL_DIRECTORY); |
| 1436 | } |
| 1437 | |
| 1438 | void SetControlPanelDir(const char *path) |
| 1439 | { |
| 1440 | options_set_string(settings, MUIOPTION_CPANEL_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1441 | } |
| 1442 | |
| 1443 | const char * GetPcbDir(void) |
| 1444 | { |
| 1445 | return options_get_string(settings, MUIOPTION_PCB_DIRECTORY); |
| 1446 | } |
| 1447 | |
| 1448 | void SetPcbDir(const char *path) |
| 1449 | { |
| 1450 | options_set_string(settings, MUIOPTION_PCB_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1451 | } |
| 1452 | |
| 1453 | const char * GetDiffDir(void) |
| 1454 | { |
| 1455 | return options_get_string(global, OPTION_DIFF_DIRECTORY); |
| 1456 | } |
| 1457 | |
| 1458 | void SetDiffDir(const char* path) |
| 1459 | { |
| 1460 | options_set_string(global, OPTION_DIFF_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1461 | } |
| 1462 | |
| 1463 | const char* GetIconsDir(void) |
| 1464 | { |
| 1465 | return options_get_string(settings, MUIOPTION_ICONS_DIRECTORY); |
| 1466 | } |
| 1467 | |
| 1468 | void SetIconsDir(const char* path) |
| 1469 | { |
| 1470 | options_set_string(settings, MUIOPTION_ICONS_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1471 | } |
| 1472 | |
| 1473 | const char* GetBgDir (void) |
| 1474 | { |
| 1475 | return options_get_string(settings, MUIOPTION_BACKGROUND_DIRECTORY); |
| 1476 | } |
| 1477 | |
| 1478 | void SetBgDir (const char* path) |
| 1479 | { |
| 1480 | options_set_string(settings, MUIOPTION_BACKGROUND_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1481 | } |
| 1482 | |
| 1483 | const char* GetFolderDir(void) |
| 1484 | { |
| 1485 | return options_get_string(settings, MUIOPTION_FOLDER_DIRECTORY); |
| 1486 | } |
| 1487 | |
| 1488 | void SetFolderDir(const char* path) |
| 1489 | { |
| 1490 | options_set_string(settings, MUIOPTION_FOLDER_DIRECTORY, path, OPTION_PRIORITY_CMDLINE); |
| 1491 | } |
| 1492 | |
| 1493 | const char* GetCheatFileName(void) |
| 1494 | { |
| 1495 | return options_get_string(global, OPTION_CHEAT_FILE); |
| 1496 | } |
| 1497 | |
| 1498 | void SetCheatFileName(const char* path) |
| 1499 | { |
| 1500 | options_set_string(global, OPTION_CHEAT_FILE, path, OPTION_PRIORITY_CMDLINE); |
| 1501 | } |
| 1502 | |
| 1503 | const char* GetHistoryFileName(void) |
| 1504 | { |
| 1505 | return options_get_string(settings, MUIOPTION_HISTORY_FILE); |
| 1506 | } |
| 1507 | |
| 1508 | void SetHistoryFileName(const char* path) |
| 1509 | { |
| 1510 | options_set_string(settings, MUIOPTION_HISTORY_FILE, path, OPTION_PRIORITY_CMDLINE); |
| 1511 | } |
| 1512 | |
| 1513 | |
| 1514 | const char* GetMAMEInfoFileName(void) |
| 1515 | { |
| 1516 | return options_get_string(settings, MUIOPTION_MAMEINFO_FILE); |
| 1517 | } |
| 1518 | |
| 1519 | void SetMAMEInfoFileName(const char* path) |
| 1520 | { |
| 1521 | options_set_string(settings, MUIOPTION_MAMEINFO_FILE, path, OPTION_PRIORITY_CMDLINE); |
| 1522 | } |
| 1523 | |
| 1524 | void ResetGameOptions(int driver_index) |
| 1525 | { |
| 1526 | assert(0 <= driver_index && driver_index < driver_list_get_count(drivers)); |
| 1527 | |
| 1528 | save_options(OPTIONS_GAME, NULL, driver_index); |
| 1529 | } |
| 1530 | |
| 1531 | void ResetGameDefaults(void) |
| 1532 | { |
| 1533 | // Walk the global settings and reset everything to defaults; |
| 1534 | ResetToDefaults(global, OPTION_PRIORITY_CMDLINE); |
| 1535 | save_options(OPTIONS_GLOBAL, global, 1); |
| 1536 | save_default_options = FALSE; |
| 1537 | } |
| 1538 | |
| 1539 | /* |
| 1540 | * Reset all game, vector and source options to defaults. |
| 1541 | * No reason to reboot if this is done. |
| 1542 | */ |
| 1543 | void ResetAllGameOptions(void) |
| 1544 | { |
| 1545 | int i; |
| 1546 | |
| 1547 | for (i = 0; i < driver_list_get_count(drivers); i++) |
| 1548 | { |
| 1549 | ResetGameOptions(i); |
| 1550 | } |
| 1551 | |
| 1552 | /* Walk the ini/source folder deleting all ini's. */ |
| 1553 | remove_all_source_options(); |
| 1554 | |
| 1555 | /* finally vector.ini */ |
| 1556 | save_options(OPTIONS_VECTOR, NULL, 0); |
| 1557 | } |
| 1558 | |
| 1559 | static void GetDriverOptionName(int driver_index, const char *option_name, char *buffer, size_t buffer_len) |
| 1560 | { |
| 1561 | assert(0 <= driver_index && driver_index < driver_list_get_count(drivers)); |
| 1562 | snprintf(buffer, buffer_len, "%s_%s", drivers[driver_index]->name, option_name); |
| 1563 | } |
| 1564 | |
| 1565 | int GetRomAuditResults(int driver_index) |
| 1566 | { |
| 1567 | char buffer[128]; |
| 1568 | GetDriverOptionName(driver_index, "rom_audit", buffer, ARRAY_LENGTH(buffer)); |
| 1569 | return options_get_int(settings, buffer); |
| 1570 | } |
| 1571 | |
| 1572 | void SetRomAuditResults(int driver_index, int audit_results) |
| 1573 | { |
| 1574 | char buffer[128]; |
| 1575 | GetDriverOptionName(driver_index, "rom_audit", buffer, ARRAY_LENGTH(buffer)); |
| 1576 | options_set_int(settings, buffer, audit_results, OPTION_PRIORITY_CMDLINE); |
| 1577 | } |
| 1578 | |
| 1579 | int GetSampleAuditResults(int driver_index) |
| 1580 | { |
| 1581 | char buffer[128]; |
| 1582 | GetDriverOptionName(driver_index, "samples_audit", buffer, ARRAY_LENGTH(buffer)); |
| 1583 | return options_get_int(settings, buffer); |
| 1584 | } |
| 1585 | |
| 1586 | void SetSampleAuditResults(int driver_index, int audit_results) |
| 1587 | { |
| 1588 | char buffer[128]; |
| 1589 | GetDriverOptionName(driver_index, "samples_audit", buffer, ARRAY_LENGTH(buffer)); |
| 1590 | options_set_int(settings, buffer, audit_results, OPTION_PRIORITY_CMDLINE); |
| 1591 | } |
| 1592 | |
| 1593 | static void IncrementPlayVariable(int driver_index, const char *play_variable, int increment) |
| 1594 | { |
| 1595 | char buffer[128]; |
| 1596 | int count; |
| 1597 | |
| 1598 | GetDriverOptionName(driver_index, play_variable, buffer, ARRAY_LENGTH(buffer)); |
| 1599 | count = options_get_int(settings, buffer); |
| 1600 | options_set_int(settings, buffer, count + increment, OPTION_PRIORITY_CMDLINE); |
| 1601 | } |
| 1602 | |
| 1603 | void IncrementPlayCount(int driver_index) |
| 1604 | { |
| 1605 | IncrementPlayVariable(driver_index, "play_count", 1); |
| 1606 | } |
| 1607 | |
| 1608 | int GetPlayCount(int driver_index) |
| 1609 | { |
| 1610 | char buffer[128]; |
| 1611 | GetDriverOptionName(driver_index, "play_count", buffer, ARRAY_LENGTH(buffer)); |
| 1612 | return options_get_int(settings, buffer); |
| 1613 | } |
| 1614 | |
| 1615 | static void ResetPlayVariable(int driver_index, const char *play_variable) |
| 1616 | { |
| 1617 | int i; |
| 1618 | if (driver_index < 0) |
| 1619 | { |
| 1620 | /* all games */ |
| 1621 | for (i = 0; i< driver_list_get_count(drivers); i++) |
| 1622 | { |
| 1623 | /* 20070808 MSH - Was passing in driver_index instead of i. Doh! */ |
| 1624 | ResetPlayVariable(i, play_variable); |
| 1625 | } |
| 1626 | } |
| 1627 | else |
| 1628 | { |
| 1629 | char buffer[128]; |
| 1630 | GetDriverOptionName(driver_index, play_variable, buffer, ARRAY_LENGTH(buffer)); |
| 1631 | options_set_int(settings, buffer, 0, OPTION_PRIORITY_CMDLINE); |
| 1632 | } |
| 1633 | } |
| 1634 | |
| 1635 | void ResetPlayCount(int driver_index) |
| 1636 | { |
| 1637 | ResetPlayVariable(driver_index, "play_count"); |
| 1638 | } |
| 1639 | |
| 1640 | void ResetPlayTime(int driver_index) |
| 1641 | { |
| 1642 | ResetPlayVariable(driver_index, "play_time"); |
| 1643 | } |
| 1644 | |
| 1645 | int GetPlayTime(int driver_index) |
| 1646 | { |
| 1647 | char buffer[128]; |
| 1648 | GetDriverOptionName(driver_index, "play_time", buffer, ARRAY_LENGTH(buffer)); |
| 1649 | return options_get_int(settings, buffer); |
| 1650 | } |
| 1651 | |
| 1652 | void IncrementPlayTime(int driver_index,int playtime) |
| 1653 | { |
| 1654 | IncrementPlayVariable(driver_index, "play_time", playtime); |
| 1655 | } |
| 1656 | |
| 1657 | void GetTextPlayTime(int driver_index,char *buf) |
| 1658 | { |
| 1659 | int hour, minute, second; |
| 1660 | int temp = GetPlayTime(driver_index); |
| 1661 | |
| 1662 | assert(0 <= driver_index && driver_index < driver_list_get_count(drivers)); |
| 1663 | |
| 1664 | hour = temp / 3600; |
| 1665 | temp = temp - 3600*hour; |
| 1666 | minute = temp / 60; //Calc Minutes |
| 1667 | second = temp - 60*minute; |
| 1668 | |
| 1669 | if (hour == 0) |
| 1670 | sprintf(buf, "%d:%02d", minute, second ); |
| 1671 | else |
| 1672 | sprintf(buf, "%d:%02d:%02d", hour, minute, second ); |
| 1673 | } |
| 1674 | |
| 1675 | input_seq* Get_ui_key_up(void) |
| 1676 | { |
| 1677 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_UP); |
| 1678 | } |
| 1679 | input_seq* Get_ui_key_down(void) |
| 1680 | { |
| 1681 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_DOWN); |
| 1682 | } |
| 1683 | input_seq* Get_ui_key_left(void) |
| 1684 | { |
| 1685 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_LEFT); |
| 1686 | } |
| 1687 | input_seq* Get_ui_key_right(void) |
| 1688 | { |
| 1689 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_RIGHT); |
| 1690 | } |
| 1691 | input_seq* Get_ui_key_start(void) |
| 1692 | { |
| 1693 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_START); |
| 1694 | } |
| 1695 | input_seq* Get_ui_key_pgup(void) |
| 1696 | { |
| 1697 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_PGUP); |
| 1698 | } |
| 1699 | input_seq* Get_ui_key_pgdwn(void) |
| 1700 | { |
| 1701 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_PGDWN); |
| 1702 | } |
| 1703 | input_seq* Get_ui_key_home(void) |
| 1704 | { |
| 1705 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_HOME); |
| 1706 | } |
| 1707 | input_seq* Get_ui_key_end(void) |
| 1708 | { |
| 1709 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_END); |
| 1710 | } |
| 1711 | input_seq* Get_ui_key_ss_change(void) |
| 1712 | { |
| 1713 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_SS_CHANGE); |
| 1714 | } |
| 1715 | input_seq* Get_ui_key_history_up(void) |
| 1716 | { |
| 1717 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_HISTORY_UP); |
| 1718 | } |
| 1719 | input_seq* Get_ui_key_history_down(void) |
| 1720 | { |
| 1721 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_HISTORY_DOWN); |
| 1722 | } |
| 1723 | |
| 1724 | |
| 1725 | input_seq* Get_ui_key_context_filters(void) |
| 1726 | { |
| 1727 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_CONTEXT_FILTERS); |
| 1728 | } |
| 1729 | input_seq* Get_ui_key_select_random(void) |
| 1730 | { |
| 1731 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_SELECT_RANDOM); |
| 1732 | } |
| 1733 | input_seq* Get_ui_key_game_audit(void) |
| 1734 | { |
| 1735 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_GAME_AUDIT); |
| 1736 | } |
| 1737 | input_seq* Get_ui_key_game_properties(void) |
| 1738 | { |
| 1739 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_GAME_PROPERTIES); |
| 1740 | } |
| 1741 | input_seq* Get_ui_key_help_contents(void) |
| 1742 | { |
| 1743 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_HELP_CONTENTS); |
| 1744 | } |
| 1745 | input_seq* Get_ui_key_update_gamelist(void) |
| 1746 | { |
| 1747 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_UPDATE_GAMELIST); |
| 1748 | } |
| 1749 | input_seq* Get_ui_key_view_folders(void) |
| 1750 | { |
| 1751 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_FOLDERS); |
| 1752 | } |
| 1753 | input_seq* Get_ui_key_view_fullscreen(void) |
| 1754 | { |
| 1755 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_FULLSCREEN); |
| 1756 | } |
| 1757 | input_seq* Get_ui_key_view_pagetab(void) |
| 1758 | { |
| 1759 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_PAGETAB); |
| 1760 | } |
| 1761 | input_seq* Get_ui_key_view_picture_area(void) |
| 1762 | { |
| 1763 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_PICTURE_AREA); |
| 1764 | } |
| 1765 | input_seq* Get_ui_key_view_status(void) |
| 1766 | { |
| 1767 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_STATUS); |
| 1768 | } |
| 1769 | input_seq* Get_ui_key_view_toolbars(void) |
| 1770 | { |
| 1771 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TOOLBARS); |
| 1772 | } |
| 1773 | |
| 1774 | input_seq* Get_ui_key_view_tab_cabinet(void) |
| 1775 | { |
| 1776 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TAB_CABINET); |
| 1777 | } |
| 1778 | input_seq* Get_ui_key_view_tab_cpanel(void) |
| 1779 | { |
| 1780 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TAB_CPANEL); |
| 1781 | } |
| 1782 | input_seq* Get_ui_key_view_tab_flyer(void) |
| 1783 | { |
| 1784 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TAB_FLYER); |
| 1785 | } |
| 1786 | input_seq* Get_ui_key_view_tab_history(void) |
| 1787 | { |
| 1788 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TAB_HISTORY); |
| 1789 | } |
| 1790 | input_seq* Get_ui_key_view_tab_marquee(void) |
| 1791 | { |
| 1792 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TAB_MARQUEE); |
| 1793 | } |
| 1794 | input_seq* Get_ui_key_view_tab_screenshot(void) |
| 1795 | { |
| 1796 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TAB_SCREENSHOT); |
| 1797 | } |
| 1798 | input_seq* Get_ui_key_view_tab_title(void) |
| 1799 | { |
| 1800 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TAB_TITLE); |
| 1801 | } |
| 1802 | input_seq* Get_ui_key_view_tab_pcb(void) |
| 1803 | { |
| 1804 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_VIEW_TAB_PCB); |
| 1805 | } |
| 1806 | input_seq* Get_ui_key_quit(void) |
| 1807 | { |
| 1808 | return options_get_input_seq(settings, MUIOPTION_UI_KEY_QUIT); |
| 1809 | } |
| 1810 | |
| 1811 | |
| 1812 | |
| 1813 | static int GetUIJoy(const char *option_name, int joycodeIndex) |
| 1814 | { |
| 1815 | const char *joycodes_string; |
| 1816 | int joycodes[4]; |
| 1817 | |
| 1818 | assert(0 <= joycodeIndex && joycodeIndex < 4); |
| 1819 | joycodes_string = options_get_string(settings, option_name); |
| 1820 | ColumnDecodeStringWithCount(joycodes_string, joycodes, ARRAY_LENGTH(joycodes)); |
| 1821 | return joycodes[joycodeIndex]; |
| 1822 | } |
| 1823 | |
| 1824 | static void SetUIJoy(const char *option_name, int joycodeIndex, int val) |
| 1825 | { |
| 1826 | const char *joycodes_string; |
| 1827 | int joycodes[4]; |
| 1828 | char buffer[1024]; |
| 1829 | |
| 1830 | assert(0 <= joycodeIndex && joycodeIndex < 4); |
| 1831 | joycodes_string = options_get_string(settings, option_name); |
| 1832 | ColumnDecodeStringWithCount(joycodes_string, joycodes, ARRAY_LENGTH(joycodes)); |
| 1833 | |
| 1834 | joycodes[joycodeIndex] = val; |
| 1835 | ColumnEncodeStringWithCount(joycodes, buffer, ARRAY_LENGTH(joycodes)); |
| 1836 | options_set_string(settings, option_name, buffer, OPTION_PRIORITY_CMDLINE); |
| 1837 | |
| 1838 | |
| 1839 | } |
| 1840 | |
| 1841 | int GetUIJoyUp(int joycodeIndex) |
| 1842 | { |
| 1843 | return GetUIJoy(MUIOPTION_UI_JOY_UP, joycodeIndex); |
| 1844 | } |
| 1845 | |
| 1846 | void SetUIJoyUp(int joycodeIndex, int val) |
| 1847 | { |
| 1848 | SetUIJoy(MUIOPTION_UI_JOY_UP, joycodeIndex, val); |
| 1849 | } |
| 1850 | |
| 1851 | int GetUIJoyDown(int joycodeIndex) |
| 1852 | { |
| 1853 | return GetUIJoy(MUIOPTION_UI_JOY_DOWN, joycodeIndex); |
| 1854 | } |
| 1855 | |
| 1856 | void SetUIJoyDown(int joycodeIndex, int val) |
| 1857 | { |
| 1858 | SetUIJoy(MUIOPTION_UI_JOY_DOWN, joycodeIndex, val); |
| 1859 | } |
| 1860 | |
| 1861 | int GetUIJoyLeft(int joycodeIndex) |
| 1862 | { |
| 1863 | return GetUIJoy(MUIOPTION_UI_JOY_LEFT, joycodeIndex); |
| 1864 | } |
| 1865 | |
| 1866 | void SetUIJoyLeft(int joycodeIndex, int val) |
| 1867 | { |
| 1868 | SetUIJoy(MUIOPTION_UI_JOY_LEFT, joycodeIndex, val); |
| 1869 | } |
| 1870 | |
| 1871 | int GetUIJoyRight(int joycodeIndex) |
| 1872 | { |
| 1873 | return GetUIJoy(MUIOPTION_UI_JOY_RIGHT, joycodeIndex); |
| 1874 | } |
| 1875 | |
| 1876 | void SetUIJoyRight(int joycodeIndex, int val) |
| 1877 | { |
| 1878 | SetUIJoy(MUIOPTION_UI_JOY_RIGHT, joycodeIndex, val); |
| 1879 | } |
| 1880 | |
| 1881 | int GetUIJoyStart(int joycodeIndex) |
| 1882 | { |
| 1883 | return GetUIJoy(MUIOPTION_UI_JOY_START, joycodeIndex); |
| 1884 | } |
| 1885 | |
| 1886 | void SetUIJoyStart(int joycodeIndex, int val) |
| 1887 | { |
| 1888 | SetUIJoy(MUIOPTION_UI_JOY_START, joycodeIndex, val); |
| 1889 | } |
| 1890 | |
| 1891 | int GetUIJoyPageUp(int joycodeIndex) |
| 1892 | { |
| 1893 | return GetUIJoy(MUIOPTION_UI_JOY_PGUP, joycodeIndex); |
| 1894 | } |
| 1895 | |
| 1896 | void SetUIJoyPageUp(int joycodeIndex, int val) |
| 1897 | { |
| 1898 | SetUIJoy(MUIOPTION_UI_JOY_PGUP, joycodeIndex, val); |
| 1899 | } |
| 1900 | |
| 1901 | int GetUIJoyPageDown(int joycodeIndex) |
| 1902 | { |
| 1903 | return GetUIJoy(MUIOPTION_UI_JOY_PGDWN, joycodeIndex); |
| 1904 | } |
| 1905 | |
| 1906 | void SetUIJoyPageDown(int joycodeIndex, int val) |
| 1907 | { |
| 1908 | SetUIJoy(MUIOPTION_UI_JOY_PGDWN, joycodeIndex, val); |
| 1909 | } |
| 1910 | |
| 1911 | int GetUIJoyHome(int joycodeIndex) |
| 1912 | { |
| 1913 | return GetUIJoy(MUIOPTION_UI_JOY_HOME, joycodeIndex); |
| 1914 | } |
| 1915 | |
| 1916 | void SetUIJoyHome(int joycodeIndex, int val) |
| 1917 | { |
| 1918 | SetUIJoy(MUIOPTION_UI_JOY_HOME, joycodeIndex, val); |
| 1919 | } |
| 1920 | |
| 1921 | int GetUIJoyEnd(int joycodeIndex) |
| 1922 | { |
| 1923 | return GetUIJoy(MUIOPTION_UI_JOY_END, joycodeIndex); |
| 1924 | } |
| 1925 | |
| 1926 | void SetUIJoyEnd(int joycodeIndex, int val) |
| 1927 | { |
| 1928 | SetUIJoy(MUIOPTION_UI_JOY_END, joycodeIndex, val); |
| 1929 | } |
| 1930 | |
| 1931 | int GetUIJoySSChange(int joycodeIndex) |
| 1932 | { |
| 1933 | return GetUIJoy(MUIOPTION_UI_JOY_SS_CHANGE, joycodeIndex); |
| 1934 | } |
| 1935 | |
| 1936 | void SetUIJoySSChange(int joycodeIndex, int val) |
| 1937 | { |
| 1938 | SetUIJoy(MUIOPTION_UI_JOY_SS_CHANGE, joycodeIndex, val); |
| 1939 | } |
| 1940 | |
| 1941 | int GetUIJoyHistoryUp(int joycodeIndex) |
| 1942 | { |
| 1943 | return GetUIJoy(MUIOPTION_UI_JOY_HISTORY_UP, joycodeIndex); |
| 1944 | } |
| 1945 | |
| 1946 | void SetUIJoyHistoryUp(int joycodeIndex, int val) |
| 1947 | { |
| 1948 | SetUIJoy(MUIOPTION_UI_JOY_HISTORY_UP, joycodeIndex, val); |
| 1949 | } |
| 1950 | |
| 1951 | int GetUIJoyHistoryDown(int joycodeIndex) |
| 1952 | { |
| 1953 | return GetUIJoy(MUIOPTION_UI_JOY_HISTORY_DOWN, joycodeIndex); |
| 1954 | } |
| 1955 | |
| 1956 | void SetUIJoyHistoryDown(int joycodeIndex, int val) |
| 1957 | { |
| 1958 | SetUIJoy(MUIOPTION_UI_JOY_HISTORY_DOWN, joycodeIndex, val); |
| 1959 | } |
| 1960 | |
| 1961 | void SetUIJoyExec(int joycodeIndex, int val) |
| 1962 | { |
| 1963 | SetUIJoy(MUIOPTION_UI_JOY_EXEC, joycodeIndex, val); |
| 1964 | } |
| 1965 | |
| 1966 | int GetUIJoyExec(int joycodeIndex) |
| 1967 | { |
| 1968 | return GetUIJoy(MUIOPTION_UI_JOY_EXEC, joycodeIndex); |
| 1969 | } |
| 1970 | |
| 1971 | const char * GetExecCommand(void) |
| 1972 | { |
| 1973 | return options_get_string(settings, MUIOPTION_EXEC_COMMAND); |
| 1974 | } |
| 1975 | |
| 1976 | void SetExecCommand(char *cmd) |
| 1977 | { |
| 1978 | options_set_string(settings, MUIOPTION_EXEC_COMMAND, cmd, OPTION_PRIORITY_CMDLINE); |
| 1979 | } |
| 1980 | |
| 1981 | int GetExecWait(void) |
| 1982 | { |
| 1983 | return options_get_int(settings, MUIOPTION_EXEC_WAIT); |
| 1984 | } |
| 1985 | |
| 1986 | void SetExecWait(int wait) |
| 1987 | { |
| 1988 | options_set_int(settings, MUIOPTION_EXEC_WAIT, wait, OPTION_PRIORITY_CMDLINE); |
| 1989 | } |
| 1990 | |
| 1991 | BOOL GetHideMouseOnStartup(void) |
| 1992 | { |
| 1993 | return options_get_bool(settings, MUIOPTION_HIDE_MOUSE); |
| 1994 | } |
| 1995 | |
| 1996 | void SetHideMouseOnStartup(BOOL hide) |
| 1997 | { |
| 1998 | options_set_bool(settings, MUIOPTION_HIDE_MOUSE, hide, OPTION_PRIORITY_CMDLINE); |
| 1999 | } |
| 2000 | |
| 2001 | BOOL GetRunFullScreen(void) |
| 2002 | { |
| 2003 | return options_get_bool(settings, MUIOPTION_FULL_SCREEN); |
| 2004 | } |
| 2005 | |
| 2006 | void SetRunFullScreen(BOOL fullScreen) |
| 2007 | { |
| 2008 | options_set_bool(settings, MUIOPTION_FULL_SCREEN, fullScreen, OPTION_PRIORITY_CMDLINE); |
| 2009 | } |
| 2010 | |
| 2011 | /*************************************************************************** |
| 2012 | Internal functions |
| 2013 | ***************************************************************************/ |
| 2014 | |
| 2015 | static void CusColorEncodeString(const COLORREF *value, char* str) |
| 2016 | { |
| 2017 | int i; |
| 2018 | char tmpStr[256]; |
| 2019 | |
| 2020 | sprintf(tmpStr, "%u", (int) value[0]); |
| 2021 | |
| 2022 | strcpy(str, tmpStr); |
| 2023 | |
| 2024 | for (i = 1; i < 16; i++) |
| 2025 | { |
| 2026 | sprintf(tmpStr, ",%u", (unsigned) value[i]); |
| 2027 | strcat(str, tmpStr); |
| 2028 | } |
| 2029 | } |
| 2030 | |
| 2031 | static void CusColorDecodeString(const char* str, COLORREF *value) |
| 2032 | { |
| 2033 | int i; |
| 2034 | char *s, *p; |
| 2035 | char tmpStr[256]; |
| 2036 | |
| 2037 | strcpy(tmpStr, str); |
| 2038 | p = tmpStr; |
| 2039 | |
| 2040 | for (i = 0; p && i < 16; i++) |
| 2041 | { |
| 2042 | s = p; |
| 2043 | |
| 2044 | if ((p = strchr(s,',')) != NULL && *p == ',') |
| 2045 | { |
| 2046 | *p = '\0'; |
| 2047 | p++; |
| 2048 | } |
| 2049 | value[i] = atoi(s); |
| 2050 | } |
| 2051 | } |
| 2052 | |
| 2053 | |
| 2054 | void ColumnEncodeStringWithCount(const int *value, char *str, int count) |
| 2055 | { |
| 2056 | int i; |
| 2057 | char buffer[100]; |
| 2058 | |
| 2059 | snprintf(buffer,sizeof(buffer),"%d",value[0]); |
| 2060 | |
| 2061 | strcpy(str,buffer); |
| 2062 | |
| 2063 | for (i = 1; i < count; i++) |
| 2064 | { |
| 2065 | snprintf(buffer,sizeof(buffer),",%d",value[i]); |
| 2066 | strcat(str,buffer); |
| 2067 | } |
| 2068 | } |
| 2069 | |
| 2070 | void ColumnDecodeStringWithCount(const char* str, int *value, int count) |
| 2071 | { |
| 2072 | int i; |
| 2073 | char *s, *p; |
| 2074 | char tmpStr[100]; |
| 2075 | |
| 2076 | if (str == NULL) |
| 2077 | return; |
| 2078 | |
| 2079 | strcpy(tmpStr, str); |
| 2080 | p = tmpStr; |
| 2081 | |
| 2082 | for (i = 0; p && i < count; i++) |
| 2083 | { |
| 2084 | s = p; |
| 2085 | |
| 2086 | if ((p = strchr(s,',')) != NULL && *p == ',') |
| 2087 | { |
| 2088 | *p = '\0'; |
| 2089 | p++; |
| 2090 | } |
| 2091 | value[i] = atoi(s); |
| 2092 | } |
| 2093 | } |
| 2094 | |
| 2095 | static void SplitterEncodeString(const int *value, char* str) |
| 2096 | { |
| 2097 | int i; |
| 2098 | char tmpStr[100]; |
| 2099 | |
| 2100 | sprintf(tmpStr, "%d", value[0]); |
| 2101 | |
| 2102 | strcpy(str, tmpStr); |
| 2103 | |
| 2104 | for (i = 1; i < GetSplitterCount(); i++) |
| 2105 | { |
| 2106 | sprintf(tmpStr, ",%d", value[i]); |
| 2107 | strcat(str, tmpStr); |
| 2108 | } |
| 2109 | } |
| 2110 | |
| 2111 | static void SplitterDecodeString(const char *str, int *value) |
| 2112 | { |
| 2113 | int i; |
| 2114 | char *s, *p; |
| 2115 | char tmpStr[100]; |
| 2116 | |
| 2117 | strcpy(tmpStr, str); |
| 2118 | p = tmpStr; |
| 2119 | |
| 2120 | for (i = 0; p && i < GetSplitterCount(); i++) |
| 2121 | { |
| 2122 | s = p; |
| 2123 | |
| 2124 | if ((p = strchr(s,',')) != NULL && *p == ',') |
| 2125 | { |
| 2126 | *p = '\0'; |
| 2127 | p++; |
| 2128 | } |
| 2129 | value[i] = atoi(s); |
| 2130 | } |
| 2131 | } |
| 2132 | |
| 2133 | /* Parse the given comma-delimited string into a LOGFONT structure */ |
| 2134 | static void FontDecodeString(const char* str, LOGFONT *f) |
| 2135 | { |
| 2136 | char* ptr; |
| 2137 | TCHAR* t_ptr; |
| 2138 | |
| 2139 | sscanf(str, "%li,%li,%li,%li,%li,%i,%i,%i,%i,%i,%i,%i,%i", |
| 2140 | &f->lfHeight, |
| 2141 | &f->lfWidth, |
| 2142 | &f->lfEscapement, |
| 2143 | &f->lfOrientation, |
| 2144 | &f->lfWeight, |
| 2145 | (int*)&f->lfItalic, |
| 2146 | (int*)&f->lfUnderline, |
| 2147 | (int*)&f->lfStrikeOut, |
| 2148 | (int*)&f->lfCharSet, |
| 2149 | (int*)&f->lfOutPrecision, |
| 2150 | (int*)&f->lfClipPrecision, |
| 2151 | (int*)&f->lfQuality, |
| 2152 | (int*)&f->lfPitchAndFamily); |
| 2153 | ptr = strrchr(str, ','); |
| 2154 | if (ptr != NULL) { |
| 2155 | t_ptr = tstring_from_utf8(ptr + 1); |
| 2156 | if( !t_ptr ) |
| 2157 | return; |
| 2158 | _tcscpy(f->lfFaceName, t_ptr); |
| 2159 | free(t_ptr); |
| 2160 | } |
| 2161 | } |
| 2162 | |
| 2163 | /* Encode the given LOGFONT structure into a comma-delimited string */ |
| 2164 | static void FontEncodeString(const LOGFONT *f, char *str) |
| 2165 | { |
| 2166 | char* utf8_FaceName = utf8_from_tstring(f->lfFaceName); |
| 2167 | if( !utf8_FaceName ) |
| 2168 | return; |
| 2169 | |
| 2170 | sprintf(str, "%li,%li,%li,%li,%li,%i,%i,%i,%i,%i,%i,%i,%i,%s", |
| 2171 | f->lfHeight, |
| 2172 | f->lfWidth, |
| 2173 | f->lfEscapement, |
| 2174 | f->lfOrientation, |
| 2175 | f->lfWeight, |
| 2176 | f->lfItalic, |
| 2177 | f->lfUnderline, |
| 2178 | f->lfStrikeOut, |
| 2179 | f->lfCharSet, |
| 2180 | f->lfOutPrecision, |
| 2181 | f->lfClipPrecision, |
| 2182 | f->lfQuality, |
| 2183 | f->lfPitchAndFamily, |
| 2184 | utf8_FaceName); |
| 2185 | |
| 2186 | free(utf8_FaceName); |
| 2187 | } |
| 2188 | |
| 2189 | static void TabFlagsEncodeString(int data, char *str) |
| 2190 | { |
| 2191 | int i; |
| 2192 | int num_saved = 0; |
| 2193 | |
| 2194 | strcpy(str,""); |
| 2195 | |
| 2196 | // we save the ones that are NOT displayed, so we can add new ones |
| 2197 | // and upgraders will see them |
| 2198 | for (i=0;i<MAX_TAB_TYPES;i++) |
| 2199 | { |
| 2200 | if (((data & (1 << i)) == 0) && GetImageTabShortName(i)) |
| 2201 | { |
| 2202 | if (num_saved != 0) |
| 2203 | strcat(str, ", "); |
| 2204 | |
| 2205 | strcat(str,GetImageTabShortName(i)); |
| 2206 | num_saved++; |
| 2207 | } |
| 2208 | } |
| 2209 | } |
| 2210 | |
| 2211 | static void TabFlagsDecodeString(const char *str, int *data) |
| 2212 | { |
| 2213 | char s[2000]; |
| 2214 | char *token; |
| 2215 | |
| 2216 | snprintf(s, ARRAY_LENGTH(s), "%s", str); |
| 2217 | |
| 2218 | // simple way to set all tab bits "on" |
| 2219 | *data = (1 << MAX_TAB_TYPES) - 1; |
| 2220 | |
| 2221 | token = strtok(s,", \t"); |
| 2222 | while (token != NULL) |
| 2223 | { |
| 2224 | int j; |
| 2225 | |
| 2226 | for (j=0;j<MAX_TAB_TYPES;j++) |
| 2227 | { |
| 2228 | if (!GetImageTabShortName(j) || (strcmp(GetImageTabShortName(j), token) == 0)) |
| 2229 | { |
| 2230 | // turn off this bit |
| 2231 | *data &= ~(1 << j); |
| 2232 | break; |
| 2233 | } |
| 2234 | } |
| 2235 | token = strtok(NULL,", \t"); |
| 2236 | } |
| 2237 | |
| 2238 | if (*data == 0) |
| 2239 | { |
| 2240 | // not allowed to hide all tabs, because then why even show the area? |
| 2241 | *data = (1 << TAB_SCREENSHOT); |
| 2242 | } |
| 2243 | } |
| 2244 | |
| 2245 | static file_error LoadSettingsFile(core_options *opts, const char *filename) |
| 2246 | { |
| 2247 | core_file *file; |
| 2248 | file_error filerr; |
| 2249 | |
| 2250 | filerr = core_fopen(filename, OPEN_FLAG_READ, &file); |
| 2251 | if (filerr == FILERR_NONE) |
| 2252 | { |
| 2253 | options_parse_ini_file(opts, file, OPTION_PRIORITY_CMDLINE); |
| 2254 | core_fclose(file); |
| 2255 | } |
| 2256 | return filerr; |
| 2257 | } |
| 2258 | |
| 2259 | |
| 2260 | static file_error SaveSettingsFile(core_options *opts, core_options *baseopts, const char *filename) |
| 2261 | { |
| 2262 | core_file *file; |
| 2263 | file_error filerr; |
| 2264 | |
| 2265 | if ((opts != NULL) && ((baseopts == NULL) || !options_equal(opts, baseopts))) |
| 2266 | { |
| 2267 | filerr = core_fopen(filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file); |
| 2268 | if (filerr == FILERR_NONE) |
| 2269 | { |
| 2270 | options_output_diff_ini_file(opts, baseopts, file); |
| 2271 | core_fclose(file); |
| 2272 | } |
| 2273 | } |
| 2274 | else |
| 2275 | { |
| 2276 | filerr = osd_rmfile(filename); |
| 2277 | } |
| 2278 | |
| 2279 | return filerr; |
| 2280 | } |
| 2281 | |
| 2282 | |
| 2283 | |
| 2284 | static void GetGlobalOptionsFileName(char *filename, size_t filename_size) |
| 2285 | { |
| 2286 | // copy INI directory |
| 2287 | snprintf(filename, filename_size, "%s\\%s.ini", GetIniDir(), CONFIGNAME); |
| 2288 | } |
| 2289 | |
| 2290 | /* Register access functions below */ |
| 2291 | static void LoadOptionsAndSettings(void) |
| 2292 | { |
| 2293 | char buffer[MAX_PATH]; |
| 2294 | |
| 2295 | // parse MAME32ui.ini - always in the current directory. |
| 2296 | LoadSettingsFile(settings, UI_INI_FILENAME); |
| 2297 | |
| 2298 | // parse global options ini/mame32.ini |
| 2299 | GetGlobalOptionsFileName(buffer, ARRAY_LENGTH(buffer)); |
| 2300 | LoadSettingsFile(global, buffer); |
| 2301 | } |
| 2302 | |
| 2303 | const char * GetFolderNameByID(UINT nID) |
| 2304 | { |
| 2305 | UINT i; |
| 2306 | extern FOLDERDATA g_folderData[]; |
| 2307 | extern LPEXFOLDERDATA ExtraFolderData[]; |
| 2308 | |
| 2309 | for (i = 0; i < MAX_EXTRA_FOLDERS * MAX_EXTRA_SUBFOLDERS; i++) |
| 2310 | { |
| 2311 | if( ExtraFolderData[i] ) |
| 2312 | { |
| 2313 | if (ExtraFolderData[i]->m_nFolderId == nID) |
| 2314 | { |
| 2315 | return ExtraFolderData[i]->m_szTitle; |
| 2316 | } |
| 2317 | } |
| 2318 | } |
| 2319 | for( i = 0; i < MAX_FOLDERS; i++) |
| 2320 | { |
| 2321 | if (g_folderData[i].m_nFolderId == nID) |
| 2322 | { |
| 2323 | |
| 2324 | return g_folderData[i].m_lpTitle; |
| 2325 | } |
| 2326 | } |
| 2327 | return NULL; |
| 2328 | } |
| 2329 | |
| 2330 | |
| 2331 | DWORD GetFolderFlags(int folder_index) |
| 2332 | { |
| 2333 | LPTREEFOLDER lpFolder = GetFolder(folder_index); |
| 2334 | |
| 2335 | if (lpFolder) |
| 2336 | return lpFolder->m_dwFlags & F_MASK; |
| 2337 | |
| 2338 | return 0; |
| 2339 | #if 0 |
| 2340 | int i; |
| 2341 | |
| 2342 | for (i=0;i<num_folder_filters;i++) |
| 2343 | { |
| 2344 | if (folder_filters[i].folder_index == folder_index) |
| 2345 | { |
| 2346 | //dprintf("found folder filter %i %i",folder_index,folder_filters[i].filters); |
| 2347 | return folder_filters[i].filters; |
| 2348 | } |
| 2349 | } |
| 2350 | return 0; |
| 2351 | #endif |
| 2352 | } |
| 2353 | |
| 2354 | |
| 2355 | /* Decode the flags into a DWORD */ |
| 2356 | static DWORD DecodeFolderFlags(const char *buf) |
| 2357 | { |
| 2358 | DWORD flags = 0; |
| 2359 | int shift = 0; |
| 2360 | const char *ptr = buf; |
| 2361 | |
| 2362 | while (*ptr && (1 << shift) & F_MASK) |
| 2363 | { |
| 2364 | if (*ptr++ == '1') |
| 2365 | { |
| 2366 | flags |= (1 << shift); |
| 2367 | } |
| 2368 | shift++; |
| 2369 | } |
| 2370 | return flags; |
| 2371 | } |
| 2372 | |
| 2373 | /* Encode the flags into a string */ |
| 2374 | static const char * EncodeFolderFlags(DWORD value) |
| 2375 | { |
| 2376 | static char buf[40]; |
| 2377 | int shift = 0; |
| 2378 | |
| 2379 | memset(buf,'\0', sizeof(buf)); |
| 2380 | |
| 2381 | while ((1 << shift) & F_MASK) { |
| 2382 | buf[shift] = (value & (1 << shift)) ? '1' : '0'; |
| 2383 | shift++; |
| 2384 | } |
| 2385 | |
| 2386 | return buf; |
| 2387 | } |
| 2388 | |
| 2389 | /* MSH 20080813 |
| 2390 | * Read the folder filters from MAME32ui.ini. This must only |
| 2391 | * be called AFTER the folders have all been created. |
| 2392 | */ |
| 2393 | void LoadFolderFlags(void) |
| 2394 | { |
| 2395 | core_options *opts; |
| 2396 | int numFolders; |
| 2397 | LPTREEFOLDER lpFolder; |
| 2398 | int i; |
| 2399 | options_entry entries[2]; |
| 2400 | |
| 2401 | memcpy(entries, filterOptions, sizeof(filterOptions)); |
| 2402 | |
| 2403 | opts = options_create(memory_error); |
| 2404 | |
| 2405 | if (NULL == opts) |
| 2406 | { |
| 2407 | return; |
| 2408 | } |
| 2409 | |
| 2410 | numFolders = GetNumFolders(); |
| 2411 | |
| 2412 | for (i = 0; i < numFolders; i++) |
| 2413 | { |
| 2414 | lpFolder = GetFolder(i); |
| 2415 | |
| 2416 | if (lpFolder) |
| 2417 | { |
| 2418 | char folder_name[80]; |
| 2419 | char *ptr; |
| 2420 | astring *option_name; |
| 2421 | |
| 2422 | // Convert spaces to underscores |
| 2423 | strcpy(folder_name, lpFolder->m_lpTitle); |
| 2424 | ptr = folder_name; |
| 2425 | while (*ptr && *ptr != '\0') |
| 2426 | { |
| 2427 | if (*ptr == ' ') |
| 2428 | { |
| 2429 | *ptr = '_'; |
| 2430 | } |
| 2431 | ptr++; |
| 2432 | } |
| 2433 | |
| 2434 | option_name = astring_assemble_2(astring_alloc(), folder_name, "_filters"); |
| 2435 | // create entry |
| 2436 | entries[0].name = astring_c(option_name); |
| 2437 | options_add_entries(opts, entries); |
| 2438 | astring_free(option_name); |
| 2439 | } |
| 2440 | } |
| 2441 | |
| 2442 | // These are overlayed at the end of our UI ini |
| 2443 | // The normal read will skip them. |
| 2444 | LoadSettingsFile(opts, UI_INI_FILENAME); |
| 2445 | |
| 2446 | // retrive the stored values |
| 2447 | for (i = 0; i < numFolders; i++) |
| 2448 | { |
| 2449 | lpFolder = GetFolder(i); |
| 2450 | |
| 2451 | if (lpFolder) |
| 2452 | { |
| 2453 | char folder_name[80]; |
| 2454 | char *ptr; |
| 2455 | astring *option_name; |
| 2456 | const char *value; |
| 2457 | |
| 2458 | // Convert spaces to underscores |
| 2459 | strcpy(folder_name, lpFolder->m_lpTitle); |
| 2460 | ptr = folder_name; |
| 2461 | while (*ptr && *ptr != '\0') |
| 2462 | { |
| 2463 | if (*ptr == ' ') |
| 2464 | { |
| 2465 | *ptr = '_'; |
| 2466 | } |
| 2467 | ptr++; |
| 2468 | } |
| 2469 | option_name = astring_assemble_2(astring_alloc(), folder_name, "_filters" ); |
| 2470 | // get entry and decode it |
| 2471 | value = options_get_string(opts, astring_c(option_name)); |
| 2472 | astring_free(option_name); |
| 2473 | |
| 2474 | if (value) |
| 2475 | { |
| 2476 | lpFolder->m_dwFlags |= DecodeFolderFlags(value) & F_MASK; |
| 2477 | } |
| 2478 | } |
| 2479 | } |
| 2480 | // fee the options |
| 2481 | options_free(opts); |
| 2482 | } |
| 2483 | |
| 2484 | |
| 2485 | |
| 2486 | // Copy options, if entry doesn't exist in the dest, create it. |
| 2487 | static void copy_options_ex(core_options *pDestOpts, core_options *pSourceOpts) |
| 2488 | { |
| 2489 | options_enumerator *enumerator; |
| 2490 | const char *option_name; |
| 2491 | const char *option_value; |
| 2492 | options_entry entries[2]; |
| 2493 | |
| 2494 | memcpy(entries, filterOptions, sizeof(filterOptions)); |
| 2495 | |
| 2496 | enumerator = options_enumerator_begin(pSourceOpts); |
| 2497 | |
| 2498 | if (enumerator != NULL) |
| 2499 | { |
| 2500 | while((option_name = options_enumerator_next(enumerator)) != NULL) |
| 2501 | { |
| 2502 | option_value = options_get_string(pSourceOpts, option_name); |
| 2503 | { |
| 2504 | const char *existing = options_get_string(pDestOpts, option_name); |
| 2505 | if (NULL == existing || *existing == '\0') |
| 2506 | { |
| 2507 | entries[0].name = option_name; |
| 2508 | // create entry |
| 2509 | options_add_entries(pDestOpts, entries); |
| 2510 | } |
| 2511 | if (strcmp(option_value, existing) != 0) |
| 2512 | options_set_string(pDestOpts, option_name, option_value, OPTION_PRIORITY_CMDLINE); |
| 2513 | } |
| 2514 | } |
| 2515 | options_enumerator_free(enumerator); |
| 2516 | } |
| 2517 | } |
| 2518 | |
| 2519 | // Adds our folder flags to a temporarty core_options, for saving. |
| 2520 | static core_options * AddFolderFlags(core_options *settings) |
| 2521 | { |
| 2522 | core_options *opts; |
| 2523 | int numFolders; |
| 2524 | int i; |
| 2525 | LPTREEFOLDER lpFolder; |
| 2526 | int num_entries = 0; |
| 2527 | options_entry entries[2]; |
| 2528 | |
| 2529 | opts = options_create(memory_error); |
| 2530 | |
| 2531 | if (NULL == opts) |
| 2532 | { |
| 2533 | return NULL; |
| 2534 | } |
| 2535 | |
| 2536 | options_add_entries(opts, regSettings); |
| 2537 | copy_options_ex(opts, settings); |
| 2538 | |
| 2539 | memcpy(entries, filterOptions, sizeof(filterOptions)); |
| 2540 | entries[0].name = NULL; |
| 2541 | entries[0].defvalue = NULL; |
| 2542 | entries[0].flags = OPTION_HEADER; |
| 2543 | entries[0].description = "FOLDER FILTERS"; |
| 2544 | options_add_entries(opts, entries); |
| 2545 | |
| 2546 | memcpy(entries, filterOptions, sizeof(filterOptions)); |
| 2547 | |
| 2548 | numFolders = GetNumFolders(); |
| 2549 | |
| 2550 | for (i = 0; i < numFolders; i++) |
| 2551 | { |
| 2552 | lpFolder = GetFolder(i); |
| 2553 | if (lpFolder && (lpFolder->m_dwFlags & F_MASK) != 0) |
| 2554 | { |
| 2555 | char folder_name[80]; |
| 2556 | char *ptr; |
| 2557 | astring *option_name; |
| 2558 | |
| 2559 | // Convert spaces to underscores |
| 2560 | strcpy(folder_name, lpFolder->m_lpTitle); |
| 2561 | ptr = folder_name; |
| 2562 | while (*ptr && *ptr != '\0') |
| 2563 | { |
| 2564 | if (*ptr == ' ') |
| 2565 | { |
| 2566 | *ptr = '_'; |
| 2567 | } |
| 2568 | ptr++; |
| 2569 | } |
| 2570 | |
| 2571 | option_name = astring_assemble_2(astring_alloc(), folder_name, "_filters" ); |
| 2572 | |
| 2573 | // create entry |
| 2574 | entries[0].name = astring_c(option_name); |
| 2575 | options_add_entries(opts, entries); |
| 2576 | |
| 2577 | // store entry |
| 2578 | options_set_string(opts, astring_c(option_name), EncodeFolderFlags(lpFolder->m_dwFlags), OPTION_PRIORITY_CMDLINE); |
| 2579 | astring_free(option_name); |
| 2580 | |
| 2581 | // increment counter |
| 2582 | num_entries++; |
| 2583 | } |
| 2584 | } |
| 2585 | if (num_entries == 0) { |
| 2586 | options_free(opts); |
| 2587 | opts = NULL; |
| 2588 | } |
| 2589 | return opts; |
| 2590 | } |
| 2591 | |
| 2592 | // Save the UI ini |
| 2593 | void SaveOptions(void) |
| 2594 | { |
| 2595 | if (save_gui_settings) |
| 2596 | { |
| 2597 | // Add the folder flag to settings. |
| 2598 | core_options *opts = AddFolderFlags(settings); |
| 2599 | // Save opts if it is non-null, else save settings. |
| 2600 | // It will be null if there are no filters set. |
| 2601 | SaveSettingsFile((opts == NULL) ? settings : opts, NULL, UI_INI_FILENAME); |
| 2602 | // Free up the opts allocated by AddFolderFlags. |
| 2603 | if (opts) |
| 2604 | { |
| 2605 | options_free(opts); |
| 2606 | } |
| 2607 | } |
| 2608 | } |
| 2609 | |
| 2610 | |
| 2611 | void SaveDefaultOptions(void) |
| 2612 | { |
| 2613 | char buffer[MAX_PATH]; |
| 2614 | GetGlobalOptionsFileName(buffer, ARRAY_LENGTH(buffer)); |
| 2615 | SaveSettingsFile(global, NULL, buffer); |
| 2616 | } |
| 2617 | |
| 2618 | char * GetVersionString(void) |
| 2619 | { |
| 2620 | return build_version; |
| 2621 | } |
| 2622 | |
| 2623 | |
| 2624 | BOOL IsGlobalOption(const char *option_name) |
| 2625 | { |
| 2626 | static const char *global_options[] = |
| 2627 | { |
| 2628 | OPTION_ROMPATH, |
| 2629 | #ifdef MESS |
| 2630 | OPTION_HASHPATH, |
| 2631 | #endif // MESS |
| 2632 | OPTION_SAMPLEPATH, |
| 2633 | OPTION_ARTPATH, |
| 2634 | OPTION_CTRLRPATH, |
| 2635 | OPTION_INIPATH, |
| 2636 | OPTION_FONTPATH, |
| 2637 | OPTION_CFG_DIRECTORY, |
| 2638 | OPTION_NVRAM_DIRECTORY, |
| 2639 | OPTION_MEMCARD_DIRECTORY, |
| 2640 | OPTION_INPUT_DIRECTORY, |
| 2641 | OPTION_STATE_DIRECTORY, |
| 2642 | OPTION_SNAPSHOT_DIRECTORY, |
| 2643 | OPTION_DIFF_DIRECTORY, |
| 2644 | OPTION_COMMENT_DIRECTORY |
| 2645 | }; |
| 2646 | int i; |
| 2647 | char command_name[128]; |
| 2648 | char *s; |
| 2649 | |
| 2650 | // determine command name |
| 2651 | snprintf(command_name, ARRAY_LENGTH(command_name), "%s", option_name); |
| 2652 | s = strchr(command_name, ';'); |
| 2653 | if (s) |
| 2654 | *s = '\0'; |
| 2655 | |
| 2656 | for (i = 0; i < ARRAY_LENGTH(global_options); i++) |
| 2657 | { |
| 2658 | if (!strcmp(command_name, global_options[i])) |
| 2659 | return TRUE; |
| 2660 | } |
| 2661 | return FALSE; |
| 2662 | } |
| 2663 | |
| 2664 | |
| 2665 | /* ui_parse_ini_file - parse a single INI file */ |
| 2666 | static void ui_parse_ini_file(core_options *opts, const char *name) |
| 2667 | { |
| 2668 | astring *fname; |
| 2669 | |
| 2670 | /* open the file; if we fail, that's ok */ |
| 2671 | fname = astring_assemble_4(astring_alloc(), GetIniDir(), PATH_SEPARATOR, name, ".ini"); |
| 2672 | LoadSettingsFile(opts, astring_c(fname)); |
| 2673 | astring_free(fname); |
| 2674 | } |
| 2675 | |
| 2676 | |
| 2677 | /* get options, based on passed in option level. */ |
| 2678 | core_options * load_options(OPTIONS_TYPE opt_type, int game_num) |
| 2679 | { |
| 2680 | core_options *opts; |
| 2681 | const game_driver *driver = NULL; |
| 2682 | |
| 2683 | opts = CreateGameOptions(game_num); |
| 2684 | |
| 2685 | if (opts == NULL) |
| 2686 | { |
| 2687 | return NULL; |
| 2688 | } |
| 2689 | |
| 2690 | /* Copy over the defaults */ |
| 2691 | options_copy(opts, global); |
| 2692 | |
| 2693 | if (opt_type == OPTIONS_GLOBAL) |
| 2694 | { |
| 2695 | return opts; |
| 2696 | } |
| 2697 | |
| 2698 | /* debug builds: parse "debug.ini" as well */ |
| 2699 | #ifdef MAME_DEBUG |
| 2700 | ui_parse_ini_file(opts, "debug"); |
| 2701 | #endif |
| 2702 | if (game_num >= 0) |
| 2703 | { |
| 2704 | driver = drivers[game_num]; |
| 2705 | } |
| 2706 | |
| 2707 | /* if we have a valid game driver, parse game-specific INI files */ |
| 2708 | if (driver != NULL) |
| 2709 | { |
| 2710 | const game_driver *parent = driver_get_clone(driver); |
| 2711 | const game_driver *gparent = (parent != NULL) ? driver_get_clone(parent) : NULL; |
| 2712 | astring *basename; |
| 2713 | astring *srcname; |
| 2714 | machine_config drv; |
| 2715 | |
| 2716 | /* expand the machine driver to look at the info */ |
| 2717 | expand_machine_driver(driver->drv, &drv); |
| 2718 | |
| 2719 | /* parse "vector.ini" for vector games */ |
| 2720 | if (drv.video_attributes & VIDEO_TYPE_VECTOR) |
| 2721 | ui_parse_ini_file(opts, "vector"); |
| 2722 | |
| 2723 | if (opt_type == OPTIONS_VECTOR) |
| 2724 | { |
| 2725 | return opts; |
| 2726 | } |
| 2727 | |
| 2728 | /* then parse "<sourcefile>.ini" */ |
| 2729 | basename = core_filename_extract_base(astring_alloc(), driver->source_file, TRUE); |
| 2730 | srcname = astring_assemble_3(astring_alloc(), "source", PATH_SEPARATOR, astring_c(basename)); |
| 2731 | ui_parse_ini_file(opts, astring_c(srcname)); |
| 2732 | astring_free(srcname); |
| 2733 | astring_free(basename); |
| 2734 | |
| 2735 | if (opt_type == OPTIONS_SOURCE) |
| 2736 | { |
| 2737 | return opts; |
| 2738 | } |
| 2739 | |
| 2740 | /* then parent the grandparent, parent, and game-specific INIs */ |
| 2741 | if (gparent != NULL) |
| 2742 | ui_parse_ini_file(opts, gparent->name); |
| 2743 | if (parent != NULL) |
| 2744 | ui_parse_ini_file(opts, parent->name); |
| 2745 | |
| 2746 | if (opt_type == OPTIONS_PARENT) |
| 2747 | { |
| 2748 | return opts; |
| 2749 | } |
| 2750 | |
| 2751 | ui_parse_ini_file(opts, driver->name); |
| 2752 | |
| 2753 | if (opt_type == OPTIONS_GAME) |
| 2754 | { |
| 2755 | return opts; |
| 2756 | } |
| 2757 | } |
| 2758 | options_free(opts); |
| 2759 | return NULL; |
| 2760 | } |
| 2761 | |
| 2762 | |
| 2763 | |
| 2764 | /* |
| 2765 | * Save ini file based on game_num and passed in opt_type. If opts are |
| 2766 | * NULL, the ini wiil be removed. |
| 2767 | * |
| 2768 | * game_num must be valid or the driver cannot be expanded and anything |
| 2769 | * with a higher priority than OPTIONS_VECTOR will not be saved. |
| 2770 | */ |
| 2771 | void save_options(OPTIONS_TYPE opt_type, core_options *opts, int game_num) |
| 2772 | { |
| 2773 | core_options *baseopts = NULL; |
| 2774 | const game_driver *driver = NULL; |
| 2775 | astring *filename = NULL; |
| 2776 | |
| 2777 | if (OPTIONS_GLOBAL != opt_type && NULL != opts && !options_equal(opts, global)) |
| 2778 | { |
| 2779 | baseopts = load_options(opt_type - 1, game_num); |
| 2780 | } |
| 2781 | |
| 2782 | if (game_num >= 0) |
| 2783 | { |
| 2784 | driver = drivers[game_num]; |
| 2785 | } |
| 2786 | |
| 2787 | if (opt_type == OPTIONS_GLOBAL) |
| 2788 | { |
| 2789 | /* Don't try to save a null global options file, or it will be erased. */ |
| 2790 | if (NULL == opts) |
| 2791 | return; |
| 2792 | options_copy(global, opts); |
| 2793 | filename = astring_cpyc(astring_alloc(), CONFIGNAME); |
| 2794 | } else if (opt_type == OPTIONS_VECTOR) |
| 2795 | { |
| 2796 | filename = astring_cpyc(astring_alloc(), "vector"); |
| 2797 | } else if (driver != NULL) |
| 2798 | { |
| 2799 | astring *basename, *srcname; |
| 2800 | machine_config drv; |
| 2801 | |
| 2802 | /* expand the machine driver to look at the info */ |
| 2803 | expand_machine_driver(driver->drv, &drv); |
| 2804 | |
| 2805 | switch (opt_type) |
| 2806 | { |
| 2807 | case OPTIONS_SOURCE: |
| 2808 | /* determine the <sourcefile> */ |
| 2809 | basename = core_filename_extract_base(astring_alloc(), driver->source_file, TRUE); |
| 2810 | srcname = astring_assemble_3(astring_alloc(), "source", PATH_SEPARATOR, astring_c(basename)); |
| 2811 | filename = astring_cpyc(astring_alloc(),astring_c(srcname)); |
| 2812 | astring_free(srcname); |
| 2813 | astring_free(basename); |
| 2814 | break; |
| 2815 | case OPTIONS_GAME: |
| 2816 | filename = astring_cpyc(astring_alloc(), driver->name); |
| 2817 | break; |
| 2818 | default: |
| 2819 | break; |
| 2820 | } |
| 2821 | } |
| 2822 | if (filename != NULL) |
| 2823 | { |
| 2824 | astring *filepath = NULL; |
| 2825 | filepath = astring_assemble_4(astring_alloc(), GetIniDir(), PATH_SEPARATOR, astring_c(filename), ".ini"); |
| 2826 | astring_free(filename); |
| 2827 | |
| 2828 | SaveSettingsFile(opts, baseopts, astring_c(filepath)); |
| 2829 | astring_free(filepath); |
| 2830 | } |
| 2831 | if (baseopts != NULL) |
| 2832 | { |
| 2833 | options_free(baseopts); |
| 2834 | } |
| 2835 | } |
| 2836 | |
| 2837 | /* Remove all the srcname.ini files from inipath/source directory. */ |
| 2838 | static void remove_all_source_options(void) { |
| 2839 | WIN32_FIND_DATA findFileData; |
| 2840 | HANDLE hFindFile; |
| 2841 | astring *pathname, *match; |
| 2842 | char* utf8_filename; |
| 2843 | |
| 2844 | /* |
| 2845 | * Easiest to just open the ini/source folder if it exists, |
| 2846 | * then remove all the files in it that end in ini. |
| 2847 | */ |
| 2848 | pathname = astring_assemble_3(astring_alloc(), GetIniDir(), PATH_SEPARATOR, "source"); |
| 2849 | match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, "*.ini"); |
| 2850 | if ((hFindFile = win_find_first_file_utf8(astring_c(match), &findFileData)) != INVALID_HANDLE_VALUE) |
| 2851 | { |
| 2852 | astring_free(match); |
| 2853 | utf8_filename = utf8_from_tstring(findFileData.cFileName); |
| 2854 | match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, utf8_filename ); |
| 2855 | free(utf8_filename); |
| 2856 | osd_rmfile(astring_c(match)); |
| 2857 | astring_free(match); |
| 2858 | |
| 2859 | while (0 != FindNextFile(hFindFile, &findFileData)) |
| 2860 | { |
| 2861 | utf8_filename = utf8_from_tstring(findFileData.cFileName); |
| 2862 | match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, utf8_filename ); |
| 2863 | free(utf8_filename); |
| 2864 | osd_rmfile(astring_c(match)); |
| 2865 | astring_free(match); |
| 2866 | } |
| 2867 | |
| 2868 | FindClose(hFindFile); |
| 2869 | |
| 2870 | } |
| 2871 | else |
| 2872 | { |
| 2873 | astring_free(match); |
| 2874 | } |
| 2875 | astring_free(pathname); |
| 2876 | |
| 2877 | } |
| 2878 | |
| 2879 | // Reset the given core_options to their default settings. |
| 2880 | static void ResetToDefaults(core_options *opts, int priority) |
| 2881 | { |
| 2882 | // iterate through the options setting each one back to the default value. |
| 2883 | options_revert(opts, priority); |
| 2884 | } |
| 2885 | |
| 2886 | |
| 2887 | |
src/osd/winui/help/html/mameui_whatsnew32.htm
| r0 | r1368 | |
| 1 | </style>
|
| 2 | |
| 3 | <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
| 4 | |
| 5 | <title>MameUI Whatsnew</title>
|
| 6 | <!--[if gte mso 9]><xml>
|
| 7 | <o:DocumentProperties>
|
| 8 | <o:Author>john4</o:Author>
|
| 9 | <o:Template>Normal</o:Template>
|
| 10 | <o:LastAuthor>john4</o:LastAuthor>
|
| 11 | <o:Revision>100</o:Revision>
|
| 12 | <o:TotalTime>113</o:TotalTime>
|
| 13 | <o:Created>2003-11-03T04:49:00Z</o:Created>
|
| 14 | <o:LastSaved>2004-08-30T18:21:00Z</o:LastSaved>
|
| 15 | <o:Pages>6</o:Pages>
|
| 16 | <o:Words>3470</o:Words>
|
| 17 | <o:Characters>19785</o:Characters>
|
| 18 | <o:Lines>164</o:Lines>
|
| 19 | <o:Paragraphs>46</o:Paragraphs>
|
| 20 | <o:CharactersWithSpaces>23209</o:CharactersWithSpaces>
|
| 21 | <o:Version>11.6360</o:Version>
|
| 22 | </o:DocumentProperties>
|
| 23 | </xml><![endif]--><!--[if gte mso 9]><xml>
|
| 24 | <w:WordDocument>
|
| 25 | <w:DisplayBackgroundShape/>
|
| 26 | <w:ActiveWritingStyle Lang="EN-US" VendorID="64" DLLVersion="131078"
|
| 27 | NLCheck="1">1</w:ActiveWritingStyle>
|
| 28 | <w:SpellingState>Clean</w:SpellingState>
|
| 29 | <w:GrammarState>Clean</w:GrammarState>
|
| 30 | <w:ValidateAgainstSchemas/>
|
| 31 | <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
|
| 32 | <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
|
| 33 | <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
|
| 34 | <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
|
| 35 | </w:WordDocument>
|
| 36 | </xml><![endif]--><!--[if gte mso 9]><xml>
|
| 37 | <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
|
| 38 | </w:LatentStyles>
|
| 39 | </xml><![endif]-->
|
| 40 | <style>
|
| 41 | <!--
|
| 42 | /* Font Definitions */
|
| 43 | @font-face
|
| 44 | {font-family:Wingdings;
|
| 45 | panose-1:5 0 0 0 0 0 0 0 0 0;
|
| 46 | mso-font-charset:2;
|
| 47 | mso-generic-font-family:auto;
|
| 48 | mso-font-pitch:variable;
|
| 49 | mso-font-signature:0 268435456 0 0 -2147483648 0;}
|
| 50 | @font-face
|
| 51 | {font-family:SimSun;
|
| 52 | panose-1:2 1 6 0 3 1 1 1 1 1;
|
| 53 | mso-font-alt:\5B8B\4F53;
|
| 54 | mso-font-charset:134;
|
| 55 | mso-generic-font-family:auto;
|
| 56 | mso-font-format:other;
|
| 57 | mso-font-pitch:variable;
|
| 58 | mso-font-signature:1 135135232 16 0 262144 0;}
|
| 59 | @font-face
|
| 60 | {font-family:"\@SimSun";
|
| 61 | mso-font-charset:134;
|
| 62 | mso-generic-font-family:auto;
|
| 63 | mso-font-pitch:variable;
|
| 64 | mso-font-signature:3 135135232 16 0 262145 0;}
|
| 65 | /* Style Definitions */
|
| 66 | p.MsoNormal, li.MsoNormal, div.MsoNormal
|
| 67 | {mso-style-parent:"";
|
| 68 | margin-bottom:.0001pt;
|
| 69 | mso-pagination:widow-orphan;
|
| 70 | font-size:10.0pt;
|
| 71 | font-family:Arial;
|
| 72 | mso-fareast-font-family:"Times New Roman";
|
| 73 | color:windowtext; margin-left:0in; margin-right:0in; margin-top:0in}
|
| 74 | h1
|
| 75 | {margin-top:12.0pt;
|
| 76 | margin-right:0in;
|
| 77 | margin-bottom:3.0pt;
|
| 78 | margin-left:0in;
|
| 79 | mso-pagination:widow-orphan;
|
| 80 | page-break-after:avoid;
|
| 81 | mso-outline-level:1;
|
| 82 | font-size:16.0pt;
|
| 83 | font-family:Arial;
|
| 84 | mso-fareast-font-family:SimSun;
|
| 85 | color:windowtext;
|
| 86 | font-weight:bold;}
|
| 87 | h2
|
| 88 | {margin-top:12.0pt;
|
| 89 | margin-right:0in;
|
| 90 | margin-bottom:3.0pt;
|
| 91 | margin-left:0in;
|
| 92 | mso-pagination:widow-orphan;
|
| 93 | page-break-after:avoid;
|
| 94 | mso-outline-level:2;
|
| 95 | font-size:14.0pt;
|
| 96 | font-family:Arial;
|
| 97 | mso-fareast-font-family:SimSun;
|
| 98 | color:windowtext;
|
| 99 | font-weight:bold;
|
| 100 | font-style:italic;}
|
| 101 | p
|
| 102 | {mso-margin-top-alt:auto;
|
| 103 | margin-right:0in;
|
| 104 | mso-margin-bottom-alt:auto;
|
| 105 | margin-left:0in;
|
| 106 | mso-pagination:widow-orphan;
|
| 107 | font-size:10.0pt;
|
| 108 | font-family:Arial;
|
| 109 | mso-fareast-font-family:"Times New Roman";
|
| 110 | color:black;}
|
| 111 | span.GramE
|
| 112 | {mso-style-name:"";
|
| 113 | mso-gram-e:yes}
|
| 114 | @page Section1
|
| 115 | {size:8.5in 11.0in;
|
| 116 | margin:1.0in 1.25in 1.0in 1.25in;
|
| 117 | mso-header-margin:.5in;
|
| 118 | mso-footer-margin:.5in;
|
| 119 | mso-paper-source:0;}
|
| 120 | div.Section1
|
| 121 | {page:Section1;}
|
| 122 | /* List Definitions */
|
| 123 | @list l0
|
| 124 | {mso-list-id:8872955;
|
| 125 | mso-list-template-ids:-1360482768;}
|
| 126 | @list l0:level1
|
| 127 | {mso-level-number-format:bullet;
|
| 128 | mso-level-text:\F0A7;
|
| 129 | mso-level-tab-stop:.5in;
|
| 130 | mso-level-number-position:left;
|
| 131 | text-indent:-.25in;
|
| 132 | mso-ansi-font-size:10.0pt;
|
| 133 | font-family:Wingdings;}
|
| 134 | @list l0:level2
|
| 135 | {mso-level-tab-stop:1.0in;
|
| 136 | mso-level-number-position:left;
|
| 137 | text-indent:-.25in;}
|
| 138 | @list l0:level3
|
| 139 | {mso-level-tab-stop:1.5in;
|
| 140 | mso-level-number-position:left;
|
| 141 | text-indent:-.25in;}
|
| 142 | @list l0:level4
|
| 143 | {mso-level-tab-stop:2.0in;
|
| 144 | mso-level-number-position:left;
|
| 145 | text-indent:-.25in;}
|
| 146 | @list l0:level5
|
| 147 | {mso-level-tab-stop:2.5in;
|
| 148 | mso-level-number-position:left;
|
| 149 | text-indent:-.25in;}
|
| 150 | @list l0:level6
|
| 151 | {mso-level-tab-stop:3.0in;
|
| 152 | mso-level-number-position:left;
|
| 153 | text-indent:-.25in;}
|
| 154 | @list l0:level7
|
| 155 | {mso-level-tab-stop:3.5in;
|
| 156 | mso-level-number-position:left;
|
| 157 | text-indent:-.25in;}
|
| 158 | @list l0:level8
|
| 159 | {mso-level-tab-stop:4.0in;
|
| 160 | mso-level-number-position:left;
|
| 161 | text-indent:-.25in;}
|
| 162 | @list l0:level9
|
| 163 | {mso-level-tab-stop:4.5in;
|
| 164 | mso-level-number-position:left;
|
| 165 | text-indent:-.25in;}
|
| 166 | @list l1
|
| 167 | {mso-list-id:45884847;
|
| 168 | mso-list-template-ids:-1235059890;}
|
| 169 | @list l1:level1
|
| 170 | {mso-level-number-format:bullet;
|
| 171 | mso-level-text:\F0A7;
|
| 172 | mso-level-tab-stop:.5in;
|
| 173 | mso-level-number-position:left;
|
| 174 | text-indent:-.25in;
|
| 175 | mso-ansi-font-size:10.0pt;
|
| 176 | font-family:Wingdings;}
|
| 177 | @list l1:level2
|
| 178 | {mso-level-tab-stop:1.0in;
|
| 179 | mso-level-number-position:left;
|
| 180 | text-indent:-.25in;}
|
| 181 | @list l1:level3
|
| 182 | {mso-level-tab-stop:1.5in;
|
| 183 | mso-level-number-position:left;
|
| 184 | text-indent:-.25in;}
|
| 185 | @list l1:level4
|
| 186 | {mso-level-tab-stop:2.0in;
|
| 187 | mso-level-number-position:left;
|
| 188 | text-indent:-.25in;}
|
| 189 | @list l1:level5
|
| 190 | {mso-level-tab-stop:2.5in;
|
| 191 | mso-level-number-position:left;
|
| 192 | text-indent:-.25in;}
|
| 193 | @list l1:level6
|
| 194 | {mso-level-tab-stop:3.0in;
|
| 195 | mso-level-number-position:left;
|
| 196 | text-indent:-.25in;}
|
| 197 | @list l1:level7
|
| 198 | {mso-level-tab-stop:3.5in;
|
| 199 | mso-level-number-position:left;
|
| 200 | text-indent:-.25in;}
|
| 201 | @list l1:level8
|
| 202 | {mso-level-tab-stop:4.0in;
|
| 203 | mso-level-number-position:left;
|
| 204 | text-indent:-.25in;}
|
| 205 | @list l1:level9
|
| 206 | {mso-level-tab-stop:4.5in;
|
| 207 | mso-level-number-position:left;
|
| 208 | text-indent:-.25in;}
|
| 209 | @list l2
|
| 210 | {mso-list-id:439879227;
|
| 211 | mso-list-template-ids:1518119328;}
|
| 212 | @list l2:level1
|
| 213 | {mso-level-number-format:bullet;
|
| 214 | mso-level-text:\F0A7;
|
| 215 | mso-level-tab-stop:.5in;
|
| 216 | mso-level-number-position:left;
|
| 217 | text-indent:-.25in;
|
| 218 | mso-ansi-font-size:10.0pt;
|
| 219 | font-family:Wingdings;}
|
| 220 | @list l2:level2
|
| 221 | {mso-level-tab-stop:1.0in;
|
| 222 | mso-level-number-position:left;
|
| 223 | text-indent:-.25in;}
|
| 224 | @list l2:level3
|
| 225 | {mso-level-tab-stop:1.5in;
|
| 226 | mso-level-number-position:left;
|
| 227 | text-indent:-.25in;}
|
| 228 | @list l2:level4
|
| 229 | {mso-level-tab-stop:2.0in;
|
| 230 | mso-level-number-position:left;
|
| 231 | text-indent:-.25in;}
|
| 232 | @list l2:level5
|
| 233 | {mso-level-tab-stop:2.5in;
|
| 234 | mso-level-number-position:left;
|
| 235 | text-indent:-.25in;}
|
| 236 | @list l2:level6
|
| 237 | {mso-level-tab-stop:3.0in;
|
| 238 | mso-level-number-position:left;
|
| 239 | text-indent:-.25in;}
|
| 240 | @list l2:level7
|
| 241 | {mso-level-tab-stop:3.5in;
|
| 242 | mso-level-number-position:left;
|
| 243 | text-indent:-.25in;}
|
| 244 | @list l2:level8
|
| 245 | {mso-level-tab-stop:4.0in;
|
| 246 | mso-level-number-position:left;
|
| 247 | text-indent:-.25in;}
|
| 248 | @list l2:level9
|
| 249 | {mso-level-tab-stop:4.5in;
|
| 250 | mso-level-number-position:left;
|
| 251 | text-indent:-.25in;}
|
| 252 | @list l3
|
| 253 | {mso-list-id:489293858;
|
| 254 | mso-list-template-ids:1845671390;}
|
| 255 | @list l3:level1
|
| 256 | {mso-level-number-format:bullet;
|
| 257 | mso-level-text:\F0A7;
|
| 258 | mso-level-tab-stop:.5in;
|
| 259 | mso-level-number-position:left;
|
| 260 | text-indent:-.25in;
|
| 261 | mso-ansi-font-size:10.0pt;
|
| 262 | font-family:Wingdings;}
|
| 263 | @list l3:level2
|
| 264 | {mso-level-tab-stop:1.0in;
|
| 265 | mso-level-number-position:left;
|
| 266 | text-indent:-.25in;}
|
| 267 | @list l3:level3
|
| 268 | {mso-level-tab-stop:1.5in;
|
| 269 | mso-level-number-position:left;
|
| 270 | text-indent:-.25in;}
|
| 271 | @list l3:level4
|
| 272 | {mso-level-tab-stop:2.0in;
|
| 273 | mso-level-number-position:left;
|
| 274 | text-indent:-.25in;}
|
| 275 | @list l3:level5
|
| 276 | {mso-level-tab-stop:2.5in;
|
| 277 | mso-level-number-position:left;
|
| 278 | text-indent:-.25in;}
|
| 279 | @list l3:level6
|
| 280 | {mso-level-tab-stop:3.0in;
|
| 281 | mso-level-number-position:left;
|
| 282 | text-indent:-.25in;}
|
| 283 | @list l3:level7
|
| 284 | {mso-level-tab-stop:3.5in;
|
| 285 | mso-level-number-position:left;
|
| 286 | text-indent:-.25in;}
|
| 287 | @list l3:level8
|
| 288 | {mso-level-tab-stop:4.0in;
|
| 289 | mso-level-number-position:left;
|
| 290 | text-indent:-.25in;}
|
| 291 | @list l3:level9
|
| 292 | {mso-level-tab-stop:4.5in;
|
| 293 | mso-level-number-position:left;
|
| 294 | text-indent:-.25in;}
|
| 295 | @list l4
|
| 296 | {mso-list-id:619726884;
|
| 297 | mso-list-template-ids:-1537423390;}
|
| 298 | @list l4:level1
|
| 299 | {mso-level-number-format:bullet;
|
| 300 | mso-level-text:\F0A7;
|
| 301 | mso-level-tab-stop:.5in;
|
| 302 | mso-level-number-position:left;
|
| 303 | text-indent:-.25in;
|
| 304 | mso-ansi-font-size:10.0pt;
|
| 305 | font-family:Wingdings;}
|
| 306 | @list l4:level2
|
| 307 | {mso-level-tab-stop:1.0in;
|
| 308 | mso-level-number-position:left;
|
| 309 | text-indent:-.25in;}
|
| 310 | @list l4:level3
|
| 311 | {mso-level-tab-stop:1.5in;
|
| 312 | mso-level-number-position:left;
|
| 313 | text-indent:-.25in;}
|
| 314 | @list l4:level4
|
| 315 | {mso-level-tab-stop:2.0in;
|
| 316 | mso-level-number-position:left;
|
| 317 | text-indent:-.25in;}
|
| 318 | @list l4:level5
|
| 319 | {mso-level-tab-stop:2.5in;
|
| 320 | mso-level-number-position:left;
|
| 321 | text-indent:-.25in;}
|
| 322 | @list l4:level6
|
| 323 | {mso-level-tab-stop:3.0in;
|
| 324 | mso-level-number-position:left;
|
| 325 | text-indent:-.25in;}
|
| 326 | @list l4:level7
|
| 327 | {mso-level-tab-stop:3.5in;
|
| 328 | mso-level-number-position:left;
|
| 329 | text-indent:-.25in;}
|
| 330 | @list l4:level8
|
| 331 | {mso-level-tab-stop:4.0in;
|
| 332 | mso-level-number-position:left;
|
| 333 | text-indent:-.25in;}
|
| 334 | @list l4:level9
|
| 335 | {mso-level-tab-stop:4.5in;
|
| 336 | mso-level-number-position:left;
|
| 337 | text-indent:-.25in;}
|
| 338 | @list l5
|
| 339 | {mso-list-id:621153244;
|
| 340 | mso-list-template-ids:995154020;}
|
| 341 | @list l5:level1
|
| 342 | {mso-level-number-format:bullet;
|
| 343 | mso-level-text:\F0A7;
|
| 344 | mso-level-tab-stop:.5in;
|
| 345 | mso-level-number-position:left;
|
| 346 | text-indent:-.25in;
|
| 347 | mso-ansi-font-size:10.0pt;
|
| 348 | font-family:Wingdings;}
|
| 349 | @list l5:level2
|
| 350 | {mso-level-tab-stop:1.0in;
|
| 351 | mso-level-number-position:left;
|
| 352 | text-indent:-.25in;}
|
| 353 | @list l5:level3
|
| 354 | {mso-level-tab-stop:1.5in;
|
| 355 | mso-level-number-position:left;
|
| 356 | text-indent:-.25in;}
|
| 357 | @list l5:level4
|
| 358 | {mso-level-tab-stop:2.0in;
|
| 359 | mso-level-number-position:left;
|
| 360 | text-indent:-.25in;}
|
| 361 | @list l5:level5
|
| 362 | {mso-level-tab-stop:2.5in;
|
| 363 | mso-level-number-position:left;
|
| 364 | text-indent:-.25in;}
|
| 365 | @list l5:level6
|
| 366 | {mso-level-tab-stop:3.0in;
|
| 367 | mso-level-number-position:left;
|
| 368 | text-indent:-.25in;}
|
| 369 | @list l5:level7
|
| 370 | {mso-level-tab-stop:3.5in;
|
| 371 | mso-level-number-position:left;
|
| 372 | text-indent:-.25in;}
|
| 373 | @list l5:level8
|
| 374 | {mso-level-tab-stop:4.0in;
|
| 375 | mso-level-number-position:left;
|
| 376 | text-indent:-.25in;}
|
| 377 | @list l5:level9
|
| 378 | {mso-level-tab-stop:4.5in;
|
| 379 | mso-level-number-position:left;
|
| 380 | text-indent:-.25in;}
|
| 381 | @list l6
|
| 382 | {mso-list-id:730887387;
|
| 383 | mso-list-template-ids:-2040104406;}
|
| 384 | @list l6:level1
|
| 385 | {mso-level-number-format:bullet;
|
| 386 | mso-level-text:\F0A7;
|
| 387 | mso-level-tab-stop:.5in;
|
| 388 | mso-level-number-position:left;
|
| 389 | text-indent:-.25in;
|
| 390 | mso-ansi-font-size:10.0pt;
|
| 391 | font-family:Wingdings;}
|
| 392 | @list l6:level2
|
| 393 | {mso-level-tab-stop:1.0in;
|
| 394 | mso-level-number-position:left;
|
| 395 | text-indent:-.25in;}
|
| 396 | @list l6:level3
|
| 397 | {mso-level-tab-stop:1.5in;
|
| 398 | mso-level-number-position:left;
|
| 399 | text-indent:-.25in;}
|
| 400 | @list l6:level4
|
| 401 | {mso-level-tab-stop:2.0in;
|
| 402 | mso-level-number-position:left;
|
| 403 | text-indent:-.25in;}
|
| 404 | @list l6:level5
|
| 405 | {mso-level-tab-stop:2.5in;
|
| 406 | mso-level-number-position:left;
|
| 407 | text-indent:-.25in;}
|
| 408 | @list l6:level6
|
| 409 | {mso-level-tab-stop:3.0in;
|
| 410 | mso-level-number-position:left;
|
| 411 | text-indent:-.25in;}
|
| 412 | @list l6:level7
|
| 413 | {mso-level-tab-stop:3.5in;
|
| 414 | mso-level-number-position:left;
|
| 415 | text-indent:-.25in;}
|
| 416 | @list l6:level8
|
| 417 | {mso-level-tab-stop:4.0in;
|
| 418 | mso-level-number-position:left;
|
| 419 | text-indent:-.25in;}
|
| 420 | @list l6:level9
|
| 421 | {mso-level-tab-stop:4.5in;
|
| 422 | mso-level-number-position:left;
|
| 423 | text-indent:-.25in;}
|
| 424 | @list l7
|
| 425 | {mso-list-id:1220288851;
|
| 426 | mso-list-template-ids:880986230;}
|
| 427 | @list l7:level1
|
| 428 | {mso-level-number-format:bullet;
|
| 429 | mso-level-text:\F0A7;
|
| 430 | mso-level-tab-stop:.5in;
|
| 431 | mso-level-number-position:left;
|
| 432 | text-indent:-.25in;
|
| 433 | mso-ansi-font-size:10.0pt;
|
| 434 | font-family:Wingdings;}
|
| 435 | @list l7:level2
|
| 436 | {mso-level-tab-stop:1.0in;
|
| 437 | mso-level-number-position:left;
|
| 438 | text-indent:-.25in;}
|
| 439 | @list l7:level3
|
| 440 | {mso-level-tab-stop:1.5in;
|
| 441 | mso-level-number-position:left;
|
| 442 | text-indent:-.25in;}
|
| 443 | @list l7:level4
|
| 444 | {mso-level-tab-stop:2.0in;
|
| 445 | mso-level-number-position:left;
|
| 446 | text-indent:-.25in;}
|
| 447 | @list l7:level5
|
| 448 | {mso-level-tab-stop:2.5in;
|
| 449 | mso-level-number-position:left;
|
| 450 | text-indent:-.25in;}
|
| 451 | @list l7:level6
|
| 452 | {mso-level-tab-stop:3.0in;
|
| 453 | mso-level-number-position:left;
|
| 454 | text-indent:-.25in;}
|
| 455 | @list l7:level7
|
| 456 | {mso-level-tab-stop:3.5in;
|
| 457 | mso-level-number-position:left;
|
| 458 | text-indent:-.25in;}
|
| 459 | @list l7:level8
|
| 460 | {mso-level-tab-stop:4.0in;
|
| 461 | mso-level-number-position:left;
|
| 462 | text-indent:-.25in;}
|
| 463 | @list l7:level9
|
| 464 | {mso-level-tab-stop:4.5in;
|
| 465 | mso-level-number-position:left;
|
| 466 | text-indent:-.25in;}
|
| 467 | @list l8
|
| 468 | {mso-list-id:1275020199;
|
| 469 | mso-list-template-ids:551206706;}
|
| 470 | @list l8:level1
|
| 471 | {mso-level-number-format:bullet;
|
| 472 | mso-level-text:\F0A7;
|
| 473 | mso-level-tab-stop:.5in;
|
| 474 | mso-level-number-position:left;
|
| 475 | text-indent:-.25in;
|
| 476 | mso-ansi-font-size:10.0pt;
|
| 477 | font-family:Wingdings;}
|
| 478 | @list l8:level2
|
| 479 | {mso-level-tab-stop:1.0in;
|
| 480 | mso-level-number-position:left;
|
| 481 | text-indent:-.25in;}
|
| 482 | @list l8:level3
|
| 483 | {mso-level-tab-stop:1.5in;
|
| 484 | mso-level-number-position:left;
|
| 485 | text-indent:-.25in;}
|
| 486 | @list l8:level4
|
| 487 | {mso-level-tab-stop:2.0in;
|
| 488 | mso-level-number-position:left;
|
| 489 | text-indent:-.25in;}
|
| 490 | @list l8:level5
|
| 491 | {mso-level-tab-stop:2.5in;
|
| 492 | mso-level-number-position:left;
|
| 493 | text-indent:-.25in;}
|
| 494 | @list l8:level6
|
| 495 | {mso-level-tab-stop:3.0in;
|
| 496 | mso-level-number-position:left;
|
| 497 | text-indent:-.25in;}
|
| 498 | @list l8:level7
|
| 499 | {mso-level-tab-stop:3.5in;
|
| 500 | mso-level-number-position:left;
|
| 501 | text-indent:-.25in;}
|
| 502 | @list l8:level8
|
| 503 | {mso-level-tab-stop:4.0in;
|
| 504 | mso-level-number-position:left;
|
| 505 | text-indent:-.25in;}
|
| 506 | @list l8:level9
|
| 507 | {mso-level-tab-stop:4.5in;
|
| 508 | mso-level-number-position:left;
|
| 509 | text-indent:-.25in;}
|
| 510 | @list l9
|
| 511 | {mso-list-id:1357196694;
|
| 512 | mso-list-template-ids:795358278;}
|
| 513 | @list l9:level1
|
| 514 | {mso-level-number-format:bullet;
|
| 515 | mso-level-text:\F0A7;
|
| 516 | mso-level-tab-stop:.5in;
|
| 517 | mso-level-number-position:left;
|
| 518 | text-indent:-.25in;
|
| 519 | mso-ansi-font-size:10.0pt;
|
| 520 | font-family:Wingdings;}
|
| 521 | @list l9:level2
|
| 522 | {mso-level-tab-stop:1.0in;
|
| 523 | mso-level-number-position:left;
|
| 524 | text-indent:-.25in;}
|
| 525 | @list l9:level3
|
| 526 | {mso-level-tab-stop:1.5in;
|
| 527 | mso-level-number-position:left;
|
| 528 | text-indent:-.25in;}
|
| 529 | @list l9:level4
|
| 530 | {mso-level-tab-stop:2.0in;
|
| 531 | mso-level-number-position:left;
|
| 532 | text-indent:-.25in;}
|
| 533 | @list l9:level5
|
| 534 | {mso-level-tab-stop:2.5in;
|
| 535 | mso-level-number-position:left;
|
| 536 | text-indent:-.25in;}
|
| 537 | @list l9:level6
|
| 538 | {mso-level-tab-stop:3.0in;
|
| 539 | mso-level-number-position:left;
|
| 540 | text-indent:-.25in;}
|
| 541 | @list l9:level7
|
| 542 | {mso-level-tab-stop:3.5in;
|
| 543 | mso-level-number-position:left;
|
| 544 | text-indent:-.25in;}
|
| 545 | @list l9:level8
|
| 546 | {mso-level-tab-stop:4.0in;
|
| 547 | mso-level-number-position:left;
|
| 548 | text-indent:-.25in;}
|
| 549 | @list l9:level9
|
| 550 | {mso-level-tab-stop:4.5in;
|
| 551 | mso-level-number-position:left;
|
| 552 | text-indent:-.25in;}
|
| 553 | @list l10
|
| 554 | {mso-list-id:1503541588;
|
| 555 | mso-list-template-ids:823551726;}
|
| 556 | @list l10:level1
|
| 557 | {mso-level-number-format:bullet;
|
| 558 | mso-level-text:\F0A7;
|
| 559 | mso-level-tab-stop:.5in;
|
| 560 | mso-level-number-position:left;
|
| 561 | text-indent:-.25in;
|
| 562 | mso-ansi-font-size:10.0pt;
|
| 563 | font-family:Wingdings;}
|
| 564 | @list l10:level2
|
| 565 | {mso-level-tab-stop:1.0in;
|
| 566 | mso-level-number-position:left;
|
| 567 | text-indent:-.25in;}
|
| 568 | @list l10:level3
|
| 569 | {mso-level-tab-stop:1.5in;
|
| 570 | mso-level-number-position:left;
|
| 571 | text-indent:-.25in;}
|
| 572 | @list l10:level4
|
| 573 | {mso-level-tab-stop:2.0in;
|
| 574 | mso-level-number-position:left;
|
| 575 | text-indent:-.25in;}
|
| 576 | @list l10:level5
|
| 577 | {mso-level-tab-stop:2.5in;
|
| 578 | mso-level-number-position:left;
|
| 579 | text-indent:-.25in;}
|
| 580 | @list l10:level6
|
| 581 | {mso-level-tab-stop:3.0in;
|
| 582 | mso-level-number-position:left;
|
| 583 | text-indent:-.25in;}
|
| 584 | @list l10:level7
|
| 585 | {mso-level-tab-stop:3.5in;
|
| 586 | mso-level-number-position:left;
|
| 587 | text-indent:-.25in;}
|
| 588 | @list l10:level8
|
| 589 | {mso-level-tab-stop:4.0in;
|
| 590 | mso-level-number-position:left;
|
| 591 | text-indent:-.25in;}
|
| 592 | @list l10:level9
|
| 593 | {mso-level-tab-stop:4.5in;
|
| 594 | mso-level-number-position:left;
|
| 595 | text-indent:-.25in;}
|
| 596 | @list l11
|
| 597 | {mso-list-id:1535195385;
|
| 598 | mso-list-template-ids:-778014484;}
|
| 599 | @list l11:level1
|
| 600 | {mso-level-number-format:bullet;
|
| 601 | mso-level-text:\F0A7;
|
| 602 | mso-level-tab-stop:.5in;
|
| 603 | mso-level-number-position:left;
|
| 604 | text-indent:-.25in;
|
| 605 | mso-ansi-font-size:10.0pt;
|
| 606 | font-family:Wingdings;}
|
| 607 | @list l11:level2
|
| 608 | {mso-level-tab-stop:1.0in;
|
| 609 | mso-level-number-position:left;
|
| 610 | text-indent:-.25in;}
|
| 611 | @list l11:level3
|
| 612 | {mso-level-tab-stop:1.5in;
|
| 613 | mso-level-number-position:left;
|
| 614 | text-indent:-.25in;}
|
| 615 | @list l11:level4
|
| 616 | {mso-level-tab-stop:2.0in;
|
| 617 | mso-level-number-position:left;
|
| 618 | text-indent:-.25in;}
|
| 619 | @list l11:level5
|
| 620 | {mso-level-tab-stop:2.5in;
|
| 621 | mso-level-number-position:left;
|
| 622 | text-indent:-.25in;}
|
| 623 | @list l11:level6
|
| 624 | {mso-level-tab-stop:3.0in;
|
| 625 | mso-level-number-position:left;
|
| 626 | text-indent:-.25in;}
|
| 627 | @list l11:level7
|
| 628 | {mso-level-tab-stop:3.5in;
|
| 629 | mso-level-number-position:left;
|
| 630 | text-indent:-.25in;}
|
| 631 | @list l11:level8
|
| 632 | {mso-level-tab-stop:4.0in;
|
| 633 | mso-level-number-position:left;
|
| 634 | text-indent:-.25in;}
|
| 635 | @list l11:level9
|
| 636 | {mso-level-tab-stop:4.5in;
|
| 637 | mso-level-number-position:left;
|
| 638 | text-indent:-.25in;}
|
| 639 | @list l12
|
| 640 | {mso-list-id:1924140378;
|
| 641 | mso-list-template-ids:-893489372;}
|
| 642 | @list l12:level1
|
| 643 | {mso-level-number-format:bullet;
|
| 644 | mso-level-text:\F0A7;
|
| 645 | mso-level-tab-stop:.5in;
|
| 646 | mso-level-number-position:left;
|
| 647 | text-indent:-.25in;
|
| 648 | mso-ansi-font-size:10.0pt;
|
| 649 | font-family:Wingdings;}
|
| 650 | @list l12:level2
|
| 651 | {mso-level-tab-stop:1.0in;
|
| 652 | mso-level-number-position:left;
|
| 653 | text-indent:-.25in;}
|
| 654 | @list l12:level3
|
| 655 | {mso-level-tab-stop:1.5in;
|
| 656 | mso-level-number-position:left;
|
| 657 | text-indent:-.25in;}
|
| 658 | @list l12:level4
|
| 659 | {mso-level-tab-stop:2.0in;
|
| 660 | mso-level-number-position:left;
|
| 661 | text-indent:-.25in;}
|
| 662 | @list l12:level5
|
| 663 | {mso-level-tab-stop:2.5in;
|
| 664 | mso-level-number-position:left;
|
| 665 | text-indent:-.25in;}
|
| 666 | @list l12:level6
|
| 667 | {mso-level-tab-stop:3.0in;
|
| 668 | mso-level-number-position:left;
|
| 669 | text-indent:-.25in;}
|
| 670 | @list l12:level7
|
| 671 | {mso-level-tab-stop:3.5in;
|
| 672 | mso-level-number-position:left;
|
| 673 | text-indent:-.25in;}
|
| 674 | @list l12:level8
|
| 675 | {mso-level-tab-stop:4.0in;
|
| 676 | mso-level-number-position:left;
|
| 677 | text-indent:-.25in;}
|
| 678 | @list l12:level9
|
| 679 | {mso-level-tab-stop:4.5in;
|
| 680 | mso-level-number-position:left;
|
| 681 | text-indent:-.25in;}
|
| 682 | @list l13
|
| 683 | {mso-list-id:1983192207;
|
| 684 | mso-list-template-ids:-1719795094;}
|
| 685 | @list l13:level1
|
| 686 | {mso-level-number-format:bullet;
|
| 687 | mso-level-text:\F0A7;
|
| 688 | mso-level-tab-stop:.5in;
|
| 689 | mso-level-number-position:left;
|
| 690 | text-indent:-.25in;
|
| 691 | mso-ansi-font-size:10.0pt;
|
| 692 | font-family:Wingdings;}
|
| 693 | @list l13:level2
|
| 694 | {mso-level-tab-stop:1.0in;
|
| 695 | mso-level-number-position:left;
|
| 696 | text-indent:-.25in;}
|
| 697 | @list l13:level3
|
| 698 | {mso-level-tab-stop:1.5in;
|
| 699 | mso-level-number-position:left;
|
| 700 | text-indent:-.25in;}
|
| 701 | @list l13:level4
|
| 702 | {mso-level-tab-stop:2.0in;
|
| 703 | mso-level-number-position:left;
|
| 704 | text-indent:-.25in;}
|
| 705 | @list l13:level5
|
| 706 | {mso-level-tab-stop:2.5in;
|
| 707 | mso-level-number-position:left;
|
| 708 | text-indent:-.25in;}
|
| 709 | @list l13:level6
|
| 710 | {mso-level-tab-stop:3.0in;
|
| 711 | mso-level-number-position:left;
|
| 712 | text-indent:-.25in;}
|
| 713 | @list l13:level7
|
| 714 | {mso-level-tab-stop:3.5in;
|
| 715 | mso-level-number-position:left;
|
| 716 | text-indent:-.25in;}
|
| 717 | @list l13:level8
|
| 718 | {mso-level-tab-stop:4.0in;
|
| 719 | mso-level-number-position:left;
|
| 720 | text-indent:-.25in;}
|
| 721 | @list l13:level9
|
| 722 | {mso-level-tab-stop:4.5in;
|
| 723 | mso-level-number-position:left;
|
| 724 | text-indent:-.25in;}
|
| 725 | @list l14
|
| 726 | {mso-list-id:1997802346;
|
| 727 | mso-list-template-ids:325871162;}
|
| 728 | @list l14:level1
|
| 729 | {mso-level-number-format:bullet;
|
| 730 | mso-level-text:\F0A7;
|
| 731 | mso-level-tab-stop:.5in;
|
| 732 | mso-level-number-position:left;
|
| 733 | text-indent:-.25in;
|
| 734 | mso-ansi-font-size:10.0pt;
|
| 735 | font-family:Wingdings;}
|
| 736 | @list l14:level2
|
| 737 | {mso-level-tab-stop:1.0in;
|
| 738 | mso-level-number-position:left;
|
| 739 | text-indent:-.25in;}
|
| 740 | @list l14:level3
|
| 741 | {mso-level-tab-stop:1.5in;
|
| 742 | mso-level-number-position:left;
|
| 743 | text-indent:-.25in;}
|
| 744 | @list l14:level4
|
| 745 | {mso-level-tab-stop:2.0in;
|
| 746 | mso-level-number-position:left;
|
| 747 | text-indent:-.25in;}
|
| 748 | @list l14:level5
|
| 749 | {mso-level-tab-stop:2.5in;
|
| 750 | mso-level-number-position:left;
|
| 751 | text-indent:-.25in;}
|
| 752 | @list l14:level6
|
| 753 | {mso-level-tab-stop:3.0in;
|
| 754 | mso-level-number-position:left;
|
| 755 | text-indent:-.25in;}
|
| 756 | @list l14:level7
|
| 757 | {mso-level-tab-stop:3.5in;
|
| 758 | mso-level-number-position:left;
|
| 759 | text-indent:-.25in;}
|
| 760 | @list l14:level8
|
| 761 | {mso-level-tab-stop:4.0in;
|
| 762 | mso-level-number-position:left;
|
| 763 | text-indent:-.25in;}
|
| 764 | @list l14:level9
|
| 765 | {mso-level-tab-stop:4.5in;
|
| 766 | mso-level-number-position:left;
|
| 767 | text-indent:-.25in;}
|
| 768 | @list l15
|
| 769 | {mso-list-id:2000308197;
|
| 770 | mso-list-template-ids:-1152595466;}
|
| 771 | @list l15:level1
|
| 772 | {mso-level-number-format:bullet;
|
| 773 | mso-level-text:\F0A7;
|
| 774 | mso-level-tab-stop:.5in;
|
| 775 | mso-level-number-position:left;
|
| 776 | text-indent:-.25in;
|
| 777 | mso-ansi-font-size:10.0pt;
|
| 778 | font-family:Wingdings;}
|
| 779 | @list l15:level2
|
| 780 | {mso-level-tab-stop:1.0in;
|
| 781 | mso-level-number-position:left;
|
| 782 | text-indent:-.25in;}
|
| 783 | @list l15:level3
|
| 784 | {mso-level-tab-stop:1.5in;
|
| 785 | mso-level-number-position:left;
|
| 786 | text-indent:-.25in;}
|
| 787 | @list l15:level4
|
| 788 | {mso-level-tab-stop:2.0in;
|
| 789 | mso-level-number-position:left;
|
| 790 | text-indent:-.25in;}
|
| 791 | @list l15:level5
|
| 792 | {mso-level-tab-stop:2.5in;
|
| 793 | mso-level-number-position:left;
|
| 794 | text-indent:-.25in;}
|
| 795 | @list l15:level6
|
| 796 | {mso-level-tab-stop:3.0in;
|
| 797 | mso-level-number-position:left;
|
| 798 | text-indent:-.25in;}
|
| 799 | @list l15:level7
|
| 800 | {mso-level-tab-stop:3.5in;
|
| 801 | mso-level-number-position:left;
|
| 802 | text-indent:-.25in;}
|
| 803 | @list l15:level8
|
| 804 | {mso-level-tab-stop:4.0in;
|
| 805 | mso-level-number-position:left;
|
| 806 | text-indent:-.25in;}
|
| 807 | @list l15:level9
|
| 808 | {mso-level-tab-stop:4.5in;
|
| 809 | mso-level-number-position:left;
|
| 810 | text-indent:-.25in;}
|
| 811 | @list l16
|
| 812 | {mso-list-id:2035185965;
|
| 813 | mso-list-template-ids:57055450;}
|
| 814 | @list l16:level1
|
| 815 | {mso-level-number-format:bullet;
|
| 816 | mso-level-text:\F0A7;
|
| 817 | mso-level-tab-stop:.5in;
|
| 818 | mso-level-number-position:left;
|
| 819 | text-indent:-.25in;
|
| 820 | mso-ansi-font-size:10.0pt;
|
| 821 | font-family:Wingdings;}
|
| 822 | @list l16:level2
|
| 823 | {mso-level-tab-stop:1.0in;
|
| 824 | mso-level-number-position:left;
|
| 825 | text-indent:-.25in;}
|
| 826 | @list l16:level3
|
| 827 | {mso-level-tab-stop:1.5in;
|
| 828 | mso-level-number-position:left;
|
| 829 | text-indent:-.25in;}
|
| 830 | @list l16:level4
|
| 831 | {mso-level-tab-stop:2.0in;
|
| 832 | mso-level-number-position:left;
|
| 833 | text-indent:-.25in;}
|
| 834 | @list l16:level5
|
| 835 | {mso-level-tab-stop:2.5in;
|
| 836 | mso-level-number-position:left;
|
| 837 | text-indent:-.25in;}
|
| 838 | @list l16:level6
|
| 839 | {mso-level-tab-stop:3.0in;
|
| 840 | mso-level-number-position:left;
|
| 841 | text-indent:-.25in;}
|
| 842 | @list l16:level7
|
| 843 | {mso-level-tab-stop:3.5in;
|
| 844 | mso-level-number-position:left;
|
| 845 | text-indent:-.25in;}
|
| 846 | @list l16:level8
|
| 847 | {mso-level-tab-stop:4.0in;
|
| 848 | mso-level-number-position:left;
|
| 849 | text-indent:-.25in;}
|
| 850 | @list l16:level9
|
| 851 | {mso-level-tab-stop:4.5in;
|
| 852 | mso-level-number-position:left;
|
| 853 | text-indent:-.25in;}
|
| 854 | ol
|
| 855 | {margin-bottom:0in;}
|
| 856 | ul
|
| 857 | {margin-bottom:0in;}
|
| 858 | -->
|
| 859 | </style>
|
| 860 | <!--[if gte mso 10]>
|
| 861 | <style>
|
| 862 | /* Style Definitions */
|
| 863 | table.MsoNormalTable
|
| 864 | {mso-style-name:"Table Normal";
|
| 865 | mso-tstyle-rowband-size:0;
|
| 866 | mso-tstyle-colband-size:0;
|
| 867 | mso-style-noshow:yes;
|
| 868 | mso-style-parent:"";
|
| 869 | mso-padding-alt:0in 5.4pt 0in 5.4pt;
|
| 870 | mso-para-margin:0in;
|
| 871 | mso-para-margin-bottom:.0001pt;
|
| 872 | mso-pagination:widow-orphan;
|
| 873 | font-size:10.0pt;
|
| 874 | font-family:"Times New Roman";
|
| 875 | mso-ansi-language:#0400;
|
| 876 | mso-fareast-language:#0400;
|
| 877 | mso-bidi-language:#0400}
|
| 878 | </style>
|
| 879 | <![endif]--><!--[if gte mso 9]><xml>
|
| 880 | <o:shapedefaults v:ext="edit" spidmax="1026"/>
|
| 881 | </xml><![endif]--><!--[if gte mso 9]><xml>
|
| 882 | <o:shapelayout v:ext="edit">
|
| 883 | <o:idmap v:ext="edit" data="1"/>
|
| 884 | </o:shapelayout></xml><![endif]-->
|
| 885 | </head>
|
| 886 | |
| 887 | <body bgcolor=white background="../images/bkground.gif" lang=EN-US
|
| 888 | style='tab-interval:.5in'>
|
| 889 | |
| 890 | <div class=Section1>
|
| 891 | |
| 892 | <h1>Changes to MameUI</h1>
|
| 893 | |
| 894 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">120.2</font></h2>
|
| 895 | |
| 896 | <ul type=square>
|
| 897 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 898 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Rebranded Mame32 to MameUI32 |
| 899 | and MameUI64 to avoid confusion with the baseline builds that are now being |
| 900 | released as 64bit native apps. [<b style='mso-bidi-font-weight:
|
| 901 | normal'>Mike Haaland / John IV</b>]</li>
|
| 902 | </ul>
|
| 903 | |
| 904 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">120.2</font></h2>
|
| 905 | |
| 906 | <ul type=square>
|
| 907 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 908 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added support for a |
| 909 | 'nonworking.png' which will appear for non-working games in the art panes if |
| 910 | the specific game *.png doesn't exist <strong>and</strong> the game is |
| 911 | flagged as non-working in the core.<font face="Arial" size="2"> </font>[<b style='mso-bidi-font-weight:
|
| 912 | normal'>Mike Haaland / John IV</b>]</li>
|
| 913 | </ul>
|
| 914 | |
| 915 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">118.6</font></h2>
|
| 916 | |
| 917 | <ul type=square>
|
| 918 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 919 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added game search/filter to |
| 920 | the toolbar. Works similarly to the Ctrl-F filter but doesn't search |
| 921 | on manufacturer, driver name, or shortname.<font face="Arial" size="2"> |
| 922 | Added PCB art pane view. </font>[<b style='mso-bidi-font-weight:
|
| 923 | normal'>René Single / John IV</b>]</li>
|
| 924 | </ul>
|
| 925 | |
| 926 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">118.5</font></h2>
|
| 927 | |
| 928 | <ul type=square>
|
| 929 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 930 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Per MameDEV request; removed |
| 931 | the ROMs view customization item, and reworked auditing to not show an icon |
| 932 | change state for unavailable sets in all games folder view. This was |
| 933 | to bring MameUI into compliance w/ the section of the Mame terms of usage |
| 934 | which states '<font face="Arial" size="2">Do not provide a means of |
| 935 | generating a list of games that specifically identifies those games for |
| 936 | which the user does not have image files'. Audit functionality and |
| 937 | game search on start is still present to populate the 'Available' folder |
| 938 | view. </font>[<b style='mso-bidi-font-weight:
|
| 939 | normal'>Mike Haaland</b>]</li>
|
| 940 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 941 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Promoted screen orientation |
| 942 | folder view to 'horizontal' and 'vertical' top level views and added them to |
| 943 | the Ctrl-F filter dialogue. [<b style='mso-bidi-font-weight:
|
| 944 | normal'>Mike Haaland</b>]</li>
|
| 945 | </ul>
|
| 946 | |
| 947 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">118.2</font></h2>
|
| 948 | |
| 949 | <ul type=square>
|
| 950 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 951 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fixed all recent options |
| 952 | related bugs as well as expanding the functionality of the audit control so |
| 953 | it doesn't cut off anymore. [<b style='mso-bidi-font-weight:
|
| 954 | normal'>Mike Haaland</b>]</li>
|
| 955 | </ul>
|
| 956 | |
| 957 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">110.2</font></h2>
|
| 958 | |
| 959 | <ul type=square>
|
| 960 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 961 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Re-arranged UI elements in |
| 962 | Options menus. [<b style='mso-bidi-font-weight:
|
| 963 | normal'>Radius</b>]</li>
|
| 964 | </ul>
|
| 965 | |
| 966 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">107.1</font></h2>
|
| 967 | |
| 968 | <ul type=square>
|
| 969 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 970 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Updated the help file to |
| 971 | include the new UI support for the core's latest video changes. [<b style='mso-bidi-font-weight:
|
| 972 | normal'>John IV</b>]</li>
|
| 973 | </ul>
|
| 974 | |
| 975 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">107</font></h2>
|
| 976 | |
| 977 | <ul type=square>
|
| 978 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 979 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added UI support for the large |
| 980 | amount of core changes made by Aaron Giles for the new video renderer. [<b style='mso-bidi-font-weight:
|
| 981 | normal'>René Single / John IV</b>]</li>
|
| 982 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 983 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Created the new scanline *.png |
| 984 | files in \artwork for use with the new -effect switch. [<b>John IV</b>]</li>
|
| 985 | </ul>
|
| 986 | |
| 987 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">105.2</font></h2>
|
| 988 | |
| 989 | <ul type=square>
|
| 990 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 991 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added BIOS folder view on the |
| 992 | left pane. This folder lists all the BIOSes supported by MameUI and |
| 993 | allows launching them as if turning on a machine without a cartridge etc. in |
| 994 | it, like the Neo-Geo. [<b style='mso-bidi-font-weight:
|
| 995 | normal'>René Single</b>]</li>
|
| 996 | </ul>
|
| 997 | |
| 998 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">104.7</font></h2>
|
| 999 | |
| 1000 | <ul type=square>
|
| 1001 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1002 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added properties for driver.c |
| 1003 | and vector on secondary click shortcut menu. This is the same as |
| 1004 | altering the properties on the vector folder and the \source\driver folder |
| 1005 | on the left pane. [<b style='mso-bidi-font-weight:
|
| 1006 | normal'>René Single / John IV</b>]</li>
|
| 1007 | </ul>
|
| 1008 | |
| 1009 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">104.4</font></h2>
|
| 1010 | |
| 1011 | <ul type=square>
|
| 1012 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1013 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added support for priority |
| 1014 | switch, now a slider. Note: there may be system related issues going |
| 1015 | to setting 1 (lagging keyboard, joystick controls), default is 0. [<b style='mso-bidi-font-weight:
|
| 1016 | normal'>René Single</b>]</li>
|
| 1017 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1018 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Removed multi-screen folder |
| 1019 | view on left pane as that flag has been removed in the core. [<b style='mso-bidi-font-weight:
|
| 1020 | normal'>René Single</b>]</li>
|
| 1021 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1022 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added mngwrite option to |
| 1023 | launch a game and immediately begin recording a MNG movie file. [<b style='mso-bidi-font-weight:
|
| 1024 | normal'>René Single</b>]</li>
|
| 1025 | </ul>
|
| 1026 | |
| 1027 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">101.1</font></h2>
|
| 1028 | |
| 1029 | <ul type=square>
|
| 1030 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1031 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added support for savestate |
| 1032 | game folder view on left. Added switch for autosave. |
| 1033 | [<b style='mso-bidi-font-weight:
|
| 1034 | normal'>René Single</b>]</li>
|
| 1035 | </ul>
|
| 1036 | |
| 1037 | <h2><span style='font-size:12.0pt'>v.</span><font size="3">100</font></h2>
|
| 1038 | |
| 1039 | <ul type=square>
|
| 1040 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1041 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>New Galaxian homage about.bmp. |
| 1042 | [<b style='mso-bidi-font-weight:
|
| 1043 | normal'>John IV</b>]</li>
|
| 1044 | </ul>
|
| 1045 | |
| 1046 | <h2><span style='font-size:12.0pt'>v.99.</span><font size="3">3</font></h2>
|
| 1047 | |
| 1048 | <ul type=square>
|
| 1049 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1050 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Re-implemented history.dat for |
| 1051 | MameUI which had its support removed from core. [<b style='mso-bidi-font-weight:
|
| 1052 | normal'>René Single</b>]</li>
|
| 1053 | </ul>
|
| 1054 | |
| 1055 | <h2><span style='font-size:12.0pt'>v.98.</span><font size="3">3</font></h2>
|
| 1056 | |
| 1057 | <ul type=square>
|
| 1058 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1059 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>UI dialogues realignment. [<b>Radius</b>]</li>
|
| 1060 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1061 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added ability to type in Mame |
| 1062 | shortname in the Ctrl-F text filter, i.e. 'ddonpach'. [<b>John IV / Mash</b>]</li>
|
| 1063 | </ul>
|
| 1064 | |
| 1065 | <h2><span style='font-size:12.0pt'>v.96.4</span></h2>
|
| 1066 | |
| 1067 | <ul type=square>
|
| 1068 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1069 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>First pass at adding support |
| 1070 | for the analogue and digital controller section of the core. [<b style='mso-bidi-font-weight:
|
| 1071 | normal'>René Single</b>]</li>
|
| 1072 | </ul>
|
| 1073 | |
| 1074 | <h2><span style='font-size:12.0pt'>v.95.</span><font size="3">5</font></h2>
|
| 1075 | |
| 1076 | <ul type=square>
|
| 1077 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1078 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added core's -screen switch to |
| 1079 | UI to allow playing games on secondary/tertiary monitors in multi-head |
| 1080 | setups. [<b style='mso-bidi-font-weight:
|
| 1081 | normal'>René Single</b>]</li>
|
| 1082 | </ul>
|
| 1083 | |
| 1084 | <h2><span style='font-size:12.0pt'>v.90.3</span></h2>
|
| 1085 | |
| 1086 | <ul type=square>
|
| 1087 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1088 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>More UI dialogues realignment. [<b style='mso-bidi-font-weight:
|
| 1089 | normal'>Radius</b>]</li>
|
| 1090 | </ul>
|
| 1091 | |
| 1092 | <h2><span style='font-size:12.0pt'>v.89.3</span></h2>
|
| 1093 | |
| 1094 | <ul type=square>
|
| 1095 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1096 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Re-aligned UI elements in |
| 1097 | Options menus and added some XP-style icons. [<b style='mso-bidi-font-weight:
|
| 1098 | normal'>Radius</b>]</li>
|
| 1099 | </ul>
|
| 1100 | |
| 1101 | <h2><span style='font-size:12.0pt'>v.88.1<o:p></o:p></span></h2>
|
| 1102 | |
| 1103 | <ul type=square>
|
| 1104 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1105 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added switch to toggle |
| 1106 | validity checking in the binary. [<b style='mso-bidi-font-weight:
|
| 1107 | normal'>René Single</b>]</li>
|
| 1108 | </ul>
|
| 1109 | |
| 1110 | <h2><span style='font-size:12.0pt'>v.87.1<o:p></o:p></span></h2>
|
| 1111 | |
| 1112 | <ul type=square>
|
| 1113 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1114 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Increased start up speed via |
| 1115 | driver info caching. [<b>Sauro Puccini / Chris Kirmse</b>]</li>
|
| 1116 | </ul>
|
| 1117 | |
| 1118 | <h2><span style='font-size:12.0pt'>v.86.1<o:p></o:p></span></h2>
|
| 1119 | |
| 1120 | <ul type=square>
|
| 1121 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1122 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Reworked MameUI folder
|
| 1123 | properties and their initial memory allocation.<span
|
| 1124 | style='mso-spacerun:yes'> </span>Results in halving MameUI’s memory
|
| 1125 | footprint on most systems. [<b style='mso-bidi-font-weight:normal'>René
|
| 1126 | Single</b>]</li>
|
| 1127 | </ul>
|
| 1128 | |
| 1129 | <h2><span style='font-size:12.0pt'>v.86<o:p></o:p></span></h2>
|
| 1130 | |
| 1131 | <ul type=square>
|
| 1132 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1133 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Reworked MameUI multisession
|
| 1134 | behaviour.<span style='mso-spacerun:yes'> </span>When launching a game, |
| 1135 | MameUI
|
| 1136 | will now dynamically resize itself in memory rather than spawning a
|
| 1137 | separate core process, saving some memory (this new feature impacts the
|
| 1138 | icons on windowed mode playing and the show caption option). [<b
|
| 1139 | style='mso-bidi-font-weight:normal'>Chris Kirmse</b>]</li>
|
| 1140 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1141 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Re-added support for custom
|
| 1142 | controller selection again in the controller tab. [<b style='mso-bidi-font-weight:
|
| 1143 | normal'>Chris Kirmse</b>]</li>
|
| 1144 | </ul>
|
| 1145 | |
| 1146 | <h2><span style='font-size:12.0pt'>v.84.5<o:p></o:p></span></h2>
|
| 1147 | |
| 1148 | <ul type=square>
|
| 1149 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1150 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Cleaned up the Options •
|
| 1151 | Interface Options menu, adding sliders. [<b style='mso-bidi-font-weight:
|
| 1152 | normal'>René Single</b>]</li>
|
| 1153 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1154 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Internal clean-ups to provide
|
| 1155 | support for the new core changes. [<b style='mso-bidi-font-weight:normal'>Chris
|
| 1156 | Kirmse</b> / <b style='mso-bidi-font-weight:normal'>Nathan Woods</b>]</li>
|
| 1157 | </ul>
|
| 1158 | |
| 1159 | <h2><span style='font-size:12.0pt'>v.84.2<o:p></o:p></span></h2>
|
| 1160 | |
| 1161 | <ul type=square>
|
| 1162 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1163 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added feature request to
|
| 1164 | place a border around the artwork in the art pane, user selectable size
|
| 1165 | and color (0=no border). [<b>René Single</b><b style='mso-bidi-font-weight:
|
| 1166 | normal'> / John IV</b>]</li>
|
| 1167 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1168 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added dump status folder
|
| 1169 | view, an easy reference for un-dumped and badly dumped ROMs for folks who
|
| 1170 | may be in a position to update them. [<b>René Single</b><span
|
| 1171 | style='mso-bidi-font-weight:bold'>]</span></li>
|
| 1172 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1173 | mso-list:l8 level1 lfo1;tab-stops:list .5in'><span style='mso-bidi-font-weight:
|
| 1174 | bold'>Expanded game list font control to go beyond the original 16 color
|
| 1175 | choices allowing access to a greater UI customization (see last color on
|
| 1176 | drop down list ‘custom’). [<b>René Single</b>]</span></li>
|
| 1177 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1178 | mso-list:l8 level1 lfo1;tab-stops:list .5in'><span style='mso-bidi-font-weight:
|
| 1179 | bold'>Added wave output option to match the core.<span
|
| 1180 | style='mso-spacerun:yes'> </span>File menu / Play and Record Wave output.
|
| 1181 | [<b>Chris Kirmse</b>]</span></li>
|
| 1182 | </ul>
|
| 1183 | |
| 1184 | <h2><span style='font-size:12.0pt'>v.84<o:p></o:p></span></h2>
|
| 1185 | |
| 1186 | <ul type=square>
|
| 1187 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1188 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Various internal treeview
|
| 1189 | fixes [year / manufacturer] and cleanups. [<b style='mso-bidi-font-weight:
|
| 1190 | normal'>Nathan Woods / <span style='mso-bidi-font-weight:bold'>René Single</span>
|
| 1191 | / Mamesick / Chris Kirmse</b>]</li>
|
| 1192 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1193 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Factored out list view
|
| 1194 | handling into its own module, picker.c.<span style='mso-spacerun:yes'>
|
| 1195 | </span>Auto_malloc() now used and appears to result in a speed up of the
|
| 1196 | GUI game list scrolling, however at the moment it does cause slight pauses
|
| 1197 | moving from one ‘view’ to another. [<b style='mso-bidi-font-weight:normal'>Nathan
|
| 1198 | Woods</b>]</li>
|
| 1199 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1200 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added ability to display
|
| 1201 | games in windowed mode without their titlebar caption. Not fully
|
| 1202 | functioning w/ GCC compile. [<b>René Single / John IV</b><span
|
| 1203 | style='mso-bidi-font-weight:bold'>]</span></li>
|
| 1204 | </ul>
|
| 1205 | |
| 1206 | <h2><span style='font-size:12.0pt'>v.82<o:p></o:p></span></h2>
|
| 1207 | |
| 1208 | <ul type=square>
|
| 1209 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1210 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Brought game ‘not working’
|
| 1211 | status messages in-line with core [status bar, general properties, etc.]
|
| 1212 | and rearranged status area on properties tab.<span
|
| 1213 | style='mso-spacerun:yes'> </span>[<b style='mso-bidi-font-weight:normal'>Mamesick</b>]</li>
|
| 1214 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1215 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added sample folder view. [<b
|
| 1216 | style='mso-bidi-font-weight:normal'>Mamesick</b>]</li>
|
| 1217 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1218 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Renamed Hard Disk folder view
|
| 1219 | to CHD due to newly supported CD CHDs. [<b style='mso-bidi-font-weight:
|
| 1220 | normal'>John IV / Nathan Woods</b>]</li>
|
| 1221 | </ul>
|
| 1222 | |
| 1223 | <h2><span style='font-size:12.0pt'>v.81<o:p></o:p></span></h2>
|
| 1224 | |
| 1225 | <ul type=square>
|
| 1226 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1227 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Moved placement of
|
| 1228 | bkground.png to \bkground folder instead of \snap folder. [<b>René Single</b>]</li>
|
| 1229 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1230 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fixed erroneous behaviour for
|
| 1231 | Imperfect folder view. [<b>René Single</b>]</li>
|
| 1232 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1233 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Corrected audio latency
|
| 1234 | slider movement and setting past notch 4. [<b>René Single</b>]</li>
|
| 1235 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1236 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added customizable quit key
|
| 1237 | [default Alt-Q] for the mappable keyboard solution option. [<b>René Single</b>]</li>
|
| 1238 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1239 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added new History.dat option
|
| 1240 | to allow display under any or all of the art views in Options • Interface
|
| 1241 | Options. [<b>René Single</b>]</li>
|
| 1242 | </ul>
|
| 1243 | |
| 1244 | <h2><span style='font-size:12.0pt'>v.79</span></h2>
|
| 1245 | |
| 1246 | <ul type=square>
|
| 1247 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1248 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added an ‘Imperfect’ folder
|
| 1249 | view on the left pane, this categorizes the various problems flagged in
|
| 1250 | games. [<b>René Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1251 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1252 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Reworked handling of the BIOS
|
| 1253 | option, now that there are multiple drivers that support different BIOSes
|
| 1254 | [neogeo.c, stv.c] the global setting is not appropriate.<span
|
| 1255 | style='mso-spacerun:yes'> </span>Select the driver from the source folder
|
| 1256 | view on the left pane and change its BIOS settings, this will alter it for
|
| 1257 | all games in that driver.<span style='mso-spacerun:yes'> </span>The
|
| 1258 | functionality remains the same for altering individual games settings in
|
| 1259 | all games view or anywhere else. [<b>René Single</b>]</li>
|
| 1260 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1261 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added the ability to control
|
| 1262 | the MameUI GUI via mappable keyboard solutions.<span
|
| 1263 | style='mso-spacerun:yes'> </span>This feature is intended to compliment
|
| 1264 | the GUI control via joystick option first offered in version .70
|
| 1265 | below.<span style='mso-spacerun:yes'> </span>It is designed to allow
|
| 1266 | users of Mame cabinets with keyboard encoders the same functionality and
|
| 1267 | is controlled in the mameUI32/64.ini file [mapping the enter key to button 1
|
| 1268 | to launch a game for example], using the same syntax as the \ctrlr files.
|
| 1269 | [<b style='mso-bidi-font-weight:normal'>Jarek Burczynski / Chris Kirmse</b>]<span
|
| 1270 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1271 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1272 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added support for the new
|
| 1273 | core switches for lightgun modifications; reload to allow mapping reload
|
| 1274 | to keys, and dual gun setups. [<b style='mso-bidi-font-weight:normal'>Chris
|
| 1275 | Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1276 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1277 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added accelerator key for
|
| 1278 | folder level ‘mini-audits’, Alt-U [<b>René Single</b><b style='mso-bidi-font-weight:
|
| 1279 | normal'> / John IV</b>].<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1280 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1281 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added accelerator key support
|
| 1282 | for scrolling up and down through history.dat text window. CTRL-Page Up /
|
| 1283 | CTRL-Page Down.<b style='mso-bidi-font-weight:normal'> </b>[<b>René Single</b>]<span
|
| 1284 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1285 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1286 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added toggle in Grouped view
|
| 1287 | to allow clones missing a parent to display non-indented. [<b>René Single</b><span
|
| 1288 | style='mso-bidi-font-weight:bold'>]</span><span style='font-size:12.0pt;
|
| 1289 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1290 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1291 | mso-list:l8 level1 lfo1;tab-stops:list .5in'><span style='mso-bidi-font-weight:
|
| 1292 | bold'>Added support for the core’s new save state loading on game
|
| 1293 | start.<span style='mso-spacerun:yes'> </span>[<b>René Single</b>]</span><span
|
| 1294 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1295 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1296 | mso-list:l8 level1 lfo1;tab-stops:list .5in'><span style='mso-bidi-font-weight:
|
| 1297 | bold'>Added support for the core’s new keyboard LED choices, USB or PS/2.
|
| 1298 | [<b>René Single</b>]</span><span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1299 | </ul>
|
| 1300 | |
| 1301 | <h2><span style='font-size:12.0pt'>v.78</span></h2>
|
| 1302 | |
| 1303 | <ul type=square>
|
| 1304 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1305 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added the ability to do ‘mini-audits’
|
| 1306 | on each of the folders on the left pane.<span style='mso-spacerun:yes'>
|
| 1307 | </span>Secondary click on the folders to see audit as a choice. [<b>René
|
| 1308 | Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1309 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1310 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Changed behaviour of MameUI
|
| 1311 | when displaying games that have the protection not emulated flag,
|
| 1312 | previously it would flag these games as non-working and display the
|
| 1313 | warning.ico.<span style='mso-spacerun:yes'> </span>Now warning.ico and
|
| 1314 | non-working status will only occur if the game has the non-working flag
|
| 1315 | attached in the driver. [<b>René Single / </b><b style='mso-bidi-font-weight:
|
| 1316 | normal'>Mamesick / John IV / Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1317 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1318 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1319 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Increased CPU and sound area
|
| 1320 | on games’ properties page to accommodate 5 lines now that tceptor and tmnt
|
| 1321 | utilise it. [<b>René Single / Chris Kirmse</b>]<span style='font-size:
|
| 1322 | 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1323 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1324 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Altered behaviour of
|
| 1325 | properties titlebar on driver.ini to show the driver name instead of
|
| 1326 | ‘folder’ properties. [<b>René Single / Chris Kirmse</b>]<span
|
| 1327 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1328 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1329 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>No longer UPX compressing the
|
| 1330 | MameUI .exe.<span style='mso-spacerun:yes'> </span>This saves 20 Megs
|
| 1331 | when MameUI is loaded into memory, will allow for better dynamic loading,
|
| 1332 | and won’t trip off virus detectors that have trouble w/ UPX compression.<span
|
| 1333 | style='mso-spacerun:yes'> </span>As a result, MameUI.exe is now 20 Megs
|
| 1334 | in size on the hard drive.<span style='mso-spacerun:yes'> </span>The
|
| 1335 | distribution package is also being changed and compressed with 7-Zip as a
|
| 1336 | self-extracting archive, this actually makes the distribution package
|
| 1337 | about 1 Meg smaller than previous releases. [<b style='mso-bidi-font-weight:
|
| 1338 | normal'>John IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1339 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1340 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Switched default settings in
|
| 1341 | MameUI to disable auto frameskipping and to use draw every frame per
|
| 1342 | discussion on MameDEV list. [<b style='mso-bidi-font-weight:normal'>John
|
| 1343 | IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1344 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1345 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Added 48000 as a sample rate
|
| 1346 | option, works well with modern soundcards and chips. [<b style='mso-bidi-font-weight:
|
| 1347 | normal'>John IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1348 | </ul>
|
| 1349 | |
| 1350 | <h2><span style='font-size:12.0pt'>v.77</span></h2>
|
| 1351 | |
| 1352 | <ul type=square>
|
| 1353 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1354 | mso-list:l8 level1 lfo1;tab-stops:list .5in'>Fulfilling the longstanding
|
| 1355 | feature req. added the ability to globally alter vector.ini and driver.ini
|
| 1356 | to match the core. Secondary click on the vector folder • properties
|
| 1357 | in the folder pane to set options for that group of games. To alter
|
| 1358 | global settings for game families, drill down into the source folder in
|
| 1359 | the folder pane, and secondary click on a driver's properties i.e.
|
| 1360 | 1942.c. This will change options for all games based on that
|
| 1361 | driver. The different levels of alteration are color coded,
|
| 1362 | vector.ini changes are red, driver.ini changes are green, and individual
|
| 1363 | game settings are blue. Thus there is the possibility to have four
|
| 1364 | color/levels of alterations when a game's individual properties are viewed
|
| 1365 | in All Games or any folder. The changes can be backed out of
|
| 1366 | hierarchically with reset to default on each respective properties, the
|
| 1367 | reset to default global option, or by deleting the .ini files in the \ini
|
| 1368 | directory.<span style='mso-spacerun:yes'> </span><b style='mso-bidi-font-weight:
|
| 1369 | normal'>Note</b>: Currently the color alterations do not display properly
|
| 1370 | with XP in themed mode, but the functionality works [bug 462].<span
|
| 1371 | style='mso-spacerun:yes'> </span>Coded solutions to this issue via DIFF
|
| 1372 | are welcomed. [<b>René Single / Chris Kirmse / John IV</b>]<span
|
| 1373 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1374 | </ul>
|
| 1375 | |
| 1376 | <h2><span style='font-size:12.0pt'>v.76</span></h2>
|
| 1377 | |
| 1378 | <ul type=square>
|
| 1379 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1380 | mso-list:l7 level1 lfo2;tab-stops:list .5in'>Added programmatically
|
| 1381 | populated lightgun and multi-monitor folders. [<b>René Single</b>]<span
|
| 1382 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1383 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1384 | mso-list:l7 level1 lfo2;tab-stops:list .5in'>Added reset play count and
|
| 1385 | play time for individual games, and globally. [Secondary click on game,
|
| 1386 | & Options • Interface Options. [<b>René Single</b>]<span
|
| 1387 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1388 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1389 | mso-list:l7 level1 lfo2;tab-stops:list .5in'>Allowed filter propagation
|
| 1390 | downward from parent folders, toggle this feature in Options • Interface
|
| 1391 | Options. [<b>René Single</b>]<span style='font-size:12.0pt;font-family:
|
| 1392 | "Times New Roman"'><o:p></o:p></span></li>
|
| 1393 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1394 | mso-list:l7 level1 lfo2;tab-stops:list .5in'>Changed behavior of vertical
|
| 1395 | scrollbar in history pane, will not show if there is less text than
|
| 1396 | available room. [<b>René Single</b>]<span style='font-size:12.0pt;
|
| 1397 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1398 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1399 | mso-list:l7 level1 lfo2;tab-stops:list .5in'>Extended game not working
|
| 1400 | status support to show more flags in status bar and game properties. [<b>René
|
| 1401 | Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1402 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1403 | mso-list:l7 level1 lfo2;tab-stops:list .5in'>Added tool tip text to status
|
| 1404 | bar if longer than displayable name is selected. [<b>René Single</b>]<span
|
| 1405 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1406 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1407 | mso-list:l7 level1 lfo2;tab-stops:list .5in'>Increased history.dat buffer
|
| 1408 | to prevent cut-off and overflow. [<b>René Single</b>]<span
|
| 1409 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1410 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1411 | mso-list:l7 level1 lfo2;tab-stops:list .5in'>Re-implemented ability to
|
| 1412 | show game's icon on title bar in windowed mode. [<b>René Single</b>]<span
|
| 1413 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1414 | </ul>
|
| 1415 | |
| 1416 | <h2><span style='font-size:12.0pt'>v.72</span></h2>
|
| 1417 | |
| 1418 | <ul type=square>
|
| 1419 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1420 | mso-list:l0 level1 lfo3;tab-stops:list .5in'>Added the ability to scale
|
| 1421 | the right side art pane contents upwards as the window size increases,
|
| 1422 | toggle on Options • Interface Options. [<b>René Single / Chris Kirmse</b>]<span
|
| 1423 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1424 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1425 | mso-list:l0 level1 lfo3;tab-stops:list .5in'>Expanded the reach of the
|
| 1426 | CTRL-F text filter, it can now act on name, driver name e.g. 'cps2.c', and
|
| 1427 | manufacturer. This is a quick method for immediately seeing a driver
|
| 1428 | family instead of drilling down through the source folder on the left. [<b>René
|
| 1429 | Single / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1430 | </ul>
|
| 1431 | |
| 1432 | <h2><span style='font-size:12.0pt'>v.71</span></h2>
|
| 1433 | |
| 1434 | <ul type=square>
|
| 1435 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1436 | mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added the ability to
|
| 1437 | selectively disable built in folder views on the left pane, secondary
|
| 1438 | click in the window area for the dialogue box. [<b>Chris Kirmse</b>]<span
|
| 1439 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1440 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1441 | mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added control panel art tab.
|
| 1442 | [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1443 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1444 | mso-list:l1 level1 lfo4;tab-stops:list .5in'>Fixed audit control overflow
|
| 1445 | issue. [<b>René Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1446 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1447 | mso-list:l1 level1 lfo4;tab-stops:list .5in'>Designed art tab state
|
| 1448 | toggles to be more readable in MameUI32/64.ini. [<b>Chris Kirmse</b>]<span
|
| 1449 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1450 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1451 | mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added the ability to have
|
| 1452 | MameUI automatically cycle the selected art views at an interval, in
|
| 1453 | seconds. Accessible in Options • Interface Options. [<b>René Single
|
| 1454 | / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1455 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1456 | mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added the ability to track
|
| 1457 | the amount of time spent playing each game in minutes and seconds.
|
| 1458 | Displays in details or grouped view. Add the column in View • Customize
|
| 1459 | fields. [<b>René Single / Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1460 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1461 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1462 | mso-list:l1 level1 lfo4;tab-stops:list .5in'>Added the ability to view
|
| 1463 | game's icon on title bar in windowed mode. [<b>René Single / Chris Kirmse</b>]<span
|
| 1464 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1465 | </ul>
|
| 1466 | |
| 1467 | <h2><span style='font-size:12.0pt'>v.70.1</span></h2>
|
| 1468 | |
| 1469 | <ul type=square>
|
| 1470 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1471 | mso-list:l12 level1 lfo5;tab-stops:list .5in'>Removed saturate slider from
|
| 1472 | D3D tab. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:
|
| 1473 | "Times New Roman"'><o:p></o:p></span></li>
|
| 1474 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1475 | mso-list:l12 level1 lfo5;tab-stops:list .5in'>Fixed cleanstretch and
|
| 1476 | prescale settings not holding. [<b>Chris Kirmse</b>]<span
|
| 1477 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1478 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1479 | mso-list:l12 level1 lfo5;tab-stops:list .5in'>Implemented BIOS selection
|
| 1480 | on per game basis [only Neo Geo games currently] and allowed temporary
|
| 1481 | global settings for BIOS via number. [<b>Chris Kirmse</b>]<span
|
| 1482 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1483 | </ul>
|
| 1484 | |
| 1485 | <h2><span style='font-size:12.0pt'>v.70</span></h2>
|
| 1486 | |
| 1487 | <ul type=square>
|
| 1488 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1489 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added art tab with only
|
| 1490 | history.dat. If this tab is enabled and history.dat is present
|
| 1491 | history text will no longer appear beneath the screenshot. [<b>Tor Arne
|
| 1492 | Vestbø / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1493 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1494 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added option to hide the
|
| 1495 | mouse cursor on launch in full screen on Options • Interface Options. [<b>Tor
|
| 1496 | Arne Vestbø</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1497 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1498 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Addressed some long standing
|
| 1499 | bugs dealing with icon decimation and windows title bar size, and
|
| 1500 | details/grouped view not holding the column size on return from large icon
|
| 1501 | view post-session restart. [<b>René Single</b>]<span style='font-size:
|
| 1502 | 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1503 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1504 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added option to expand MameUI
|
| 1505 | to full screen kiosk mode without any windows controls [F11]. [<b>Tor Arne
|
| 1506 | Vestbø / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1507 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1508 | 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>
|
| 1509 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1510 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Reworked drop down for D3D
|
| 1511 | prescale effect, now allowing various levels of sharpness to be used. [<b>Chris
|
| 1512 | Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1513 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1514 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Updated win32ui.c to pull
|
| 1515 | certain information more appropriately out of layout.c. [<b>Nathan
|
| 1516 | Woods/MESS32</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1517 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1518 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Removed obsoleted version
|
| 1519 | mismatch toggle. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1520 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1521 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1522 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added a built in orientation
|
| 1523 | folder view for displaying vertical and horizontal games. [<b>René Single</b>]<span
|
| 1524 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1525 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1526 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added support for the new
|
| 1527 | cleanstretch options. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1528 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1529 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1530 | mso-list:l3 level1 lfo6;tab-stops:list .5in'>Added ability to map joystick
|
| 1531 | actions in MameUI32/64.ini to control GUI navigation instead of being hard
|
| 1532 | coded:<br>
|
| 1533 | <b>Format</b>: joystick_number, stick_type, axis_or_button, direction<br>
|
| 1534 | <br>
|
| 1535 | #define JOYCODE_STICK_BTN 0<br>
|
| 1536 | #define JOYCODE_STICK_AXIS 1<br>
|
| 1537 | #define JOYCODE_STICK_POV 2<br>
|
| 1538 | #define JOYCODE_DIR_BTN 0<br>
|
| 1539 | #define JOYCODE_DIR_NEG 1<br>
|
| 1540 | #define JOYCODE_DIR_POS 2<span style='font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1541 | </ul>
|
| 1542 | |
| 1543 | <p style='margin-left:.5in'>So, pressing button 3 on joystick one would be:
|
| 1544 | 1,0,3,0<br>
|
| 1545 | <br>
|
| 1546 | ui_joy_up 1,1,2,1<br>
|
| 1547 | ui_joy_down 1,1,2,2<br>
|
| 1548 | ui_joy_left 1,1,1,1<br>
|
| 1549 | ui_joy_right 1,1,1,2<br>
|
| 1550 | ui_joy_start 1,0,1,0<br>
|
| 1551 | ui_joy_pgup 2,1,2,1<br>
|
| 1552 | ui_joy_pgdwn 2,1,2,2<br>
|
| 1553 | ui_joy_home 0,0,0,0<br>
|
| 1554 | ui_joy_end 0,0,0,0<br>
|
| 1555 | ui_joy_ss_change 2,0,3,0<br>
|
| 1556 | ui_joy_history_up 2,0,4,0<br>
|
| 1557 | ui_joy_history_down 2,0,1,0<br>
|
| 1558 | ui_joy_exec 0,0,0,0</p>
|
| 1559 | |
| 1560 | <p style='margin-left:.5in'>For stick type POV there are no directions, only
|
| 1561 | four axes (0-3) [<b>Tor Arne Vestbø</b>]</p>
|
| 1562 | |
| 1563 | <h2><span style='font-size:12.0pt'>v.69</span></h2>
|
| 1564 | |
| 1565 | <ul type=square>
|
| 1566 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1567 | mso-list:l11 level1 lfo7;tab-stops:list .5in'>Added support for the new
|
| 1568 | D3D filter and effects options in Options • Default Game Options •
|
| 1569 | Direct3D, see help menu contents for further descriptions of the new
|
| 1570 | features. [<b>John IV / Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1571 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1572 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1573 | mso-list:l11 level1 lfo7;tab-stops:list .5in'>Added support for the new
|
| 1574 | core toggle -bios to allow selection of the various supported Neo Geo
|
| 1575 | BIOSes. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:
|
| 1576 | "Times New Roman"'><o:p></o:p></span></li>
|
| 1577 | </ul>
|
| 1578 | |
| 1579 | <h2><span style='font-size:12.0pt'>v.68</span></h2>
|
| 1580 | |
| 1581 | <ul type=square>
|
| 1582 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1583 | mso-list:l9 level1 lfo8;tab-stops:list .5in'>Added code to allow clicking
|
| 1584 | anywhere in the screenshot window to toggle the art views. No longer
|
| 1585 | necessary to click directly on the default image. [<b>K&K</b>]<span
|
| 1586 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1587 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1588 | mso-list:l9 level1 lfo8;tab-stops:list .5in'>Added code to allow disabling
|
| 1589 | / toggling individual art views on the view menu and the context menu of
|
| 1590 | the art window. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1591 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1592 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1593 | mso-list:l9 level1 lfo8;tab-stops:list .5in'>Added support for the new
|
| 1594 | core D3D items, accessible on the Options • Default Game Options • Direct3D.
|
| 1595 | [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1596 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1597 | mso-list:l9 level1 lfo8;tab-stops:list .5in'>Added support for the new
|
| 1598 | core audio latency settings. [<b>Chris Kirmse</b>]<span style='font-size:
|
| 1599 | 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1600 | </ul>
|
| 1601 | |
| 1602 | <h2><span style='font-size:12.0pt'>v.67</span></h2>
|
| 1603 | |
| 1604 | <ul type=square>
|
| 1605 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1606 | mso-list:l14 level1 lfo9;tab-stops:list .5in'>Re-worked the rotation
|
| 1607 | options to a drop down, and included the new switches for auto-clockwise /
|
| 1608 | auto-anti-clockwise for pivot monitors. [<b>Chris Kirmse</b>]<span
|
| 1609 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1610 | </ul>
|
| 1611 | |
| 1612 | <h2><span style='font-size:12.0pt'>v.66</span></h2>
|
| 1613 | |
| 1614 | <ul type=square>
|
| 1615 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1616 | mso-list:l4 level1 lfo10;tab-stops:list .5in'>Moved towards an *.ini based
|
| 1617 | settings storage scheme to more closely match the Mame.exe core,
|
| 1618 | individual game *.inis whose settings are altered are stored in the \ini
|
| 1619 | directory. The MameUI GUI settings are stored in MameUI32/64.ini in the root
|
| 1620 | w/ MameUI.exe, and MameUI.ini is stored in the \ini directory and should
|
| 1621 | be interchangeable with a regular Mame.ini. Purge these two items to
|
| 1622 | return to baseline, the registry is no longer used for MameUI. [<b>Chris
|
| 1623 | Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1624 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1625 | mso-list:l4 level1 lfo10;tab-stops:list .5in'>Provided an additional 'migration'
|
| 1626 | version of MameUI which will copy the contents of the registry key and
|
| 1627 | write it out to the new *.ini scheme when exiting. Useful for people
|
| 1628 | who have a large number of individual game customizations. [<b>John IV /
|
| 1629 | Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1630 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1631 | mso-list:l4 level1 lfo10;tab-stops:list .5in'>Added toggle for high thread
|
| 1632 | priority in Options • Interface Options to match the core's new
|
| 1633 | -high_priority switch. This will devote more system resources and
|
| 1634 | time to MameUI at the expense of other already running programs. [<b>Chris
|
| 1635 | Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1636 | </ul>
|
| 1637 | |
| 1638 | <h2><span style='font-size:12.0pt'>v.65</span></h2>
|
| 1639 | |
| 1640 | <ul type=square>
|
| 1641 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1642 | mso-list:l10 level1 lfo11;tab-stops:list .5in'>Updated columnedit.c to
|
| 1643 | allow for MESS32 usage in software view. [<b>Nathan Woods/MESS32</b>]<span
|
| 1644 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1645 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1646 | mso-list:l10 level1 lfo11;tab-stops:list .5in'>Reworked F5/refresh
|
| 1647 | routines to utilise more audit code and logic. [<b>Chris Kirmse</b>]<span
|
| 1648 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1649 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1650 | mso-list:l10 level1 lfo11;tab-stops:list .5in'>Reworked -lightgun
|
| 1651 | handling, enabling independently selectable mouse control for those games.
|
| 1652 | [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1653 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1654 | mso-list:l10 level1 lfo11;tab-stops:list .5in'>Custom icons are included
|
| 1655 | in the distribution \icons directory to show what the control/tree icons
|
| 1656 | are without having to go through the source. [<b>John IV</b>]<span
|
| 1657 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1658 | </ul>
|
| 1659 | |
| 1660 | <h2><span style='font-size:12.0pt'>v.63.1</span></h2>
|
| 1661 | |
| 1662 | <ul type=square>
|
| 1663 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1664 | mso-list:l5 level1 lfo12;tab-stops:list .5in'>Fixed analogue dead-zone not
|
| 1665 | being maintained, and pre-0.63 timing not being maintained. [<b>Chris
|
| 1666 | Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1667 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1668 | mso-list:l5 level1 lfo12;tab-stops:list .5in'>Added folder view for hard
|
| 1669 | drive based games. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1670 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1671 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1672 | mso-list:l5 level1 lfo12;tab-stops:list .5in'>Addressed missing/blank
|
| 1673 | custom icon display indexing issue on F5/refresh. [<b>Chris Kirmse</b>]<span
|
| 1674 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1675 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1676 | mso-list:l5 level1 lfo12;tab-stops:list .5in'>Sped up MameUI launch /
|
| 1677 | folder reading routine. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1678 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1679 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1680 | mso-list:l5 level1 lfo12;tab-stops:list .5in'>Fixed screenshot area
|
| 1681 | decimation when resizing images larger than the viewable area. [<b>John IV
|
| 1682 | / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1683 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1684 | mso-list:l5 level1 lfo12;tab-stops:list .5in'>Added additional help topic
|
| 1685 | IDs and tool tips. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1686 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1687 | </ul>
|
| 1688 | |
| 1689 | <h2><span style='font-size:12.0pt'>v.63</span></h2>
|
| 1690 | |
| 1691 | <ul type=square>
|
| 1692 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1693 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added code to ROM loading
|
| 1694 | dialogue to visually indicate user intervention when the game being
|
| 1695 | launched may not work due to 'no good dump' this will match the baseline
|
| 1696 | Mame [press ok to continue]. Examples include the game Astyanax,
|
| 1697 | 64th Street etc. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1698 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1699 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1700 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Return to baseline non-I686
|
| 1701 | compile as it prevented MameUI working on a variety of machines. [<b>John
|
| 1702 | IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1703 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1704 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Made numerous code changes
|
| 1705 | to allow MameUI to be compiled with the new MinGW 2.0 package. [<b>Chris
|
| 1706 | Kirmse / Mike Haaland</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1707 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1708 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Distribution compiles are
|
| 1709 | now done using above mentioned MinGW 2.0 package. [<b>John IV</b>]<span
|
| 1710 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1711 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1712 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added code to allow for a
|
| 1713 | tool tip to appear showing the full name of a game whose description is
|
| 1714 | cut-off by column width in details/grouped view. Hover cursor over
|
| 1715 | game to activate. [<b>Andrew Kirmse / Chris Kirmse</b>]<span
|
| 1716 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1717 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1718 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>The default
|
| 1719 | \folders\Favorites.ini has been cleaned out. Now that it is easy to
|
| 1720 | drag and drop or secondary click to add games from the main list to the
|
| 1721 | custom folders, it no longer needs to serve as an example using personal
|
| 1722 | favorites. Be sure to backup existing \folders\Favorites.ini if using the
|
| 1723 | built in installer version of the MameUI distribution. [<b>John IV</b>]<span
|
| 1724 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1725 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1726 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Tweaked code for drag &
|
| 1727 | drop of games into custom folders. In a custom folder to drag an
|
| 1728 | item out for deletion, it must go out of the game list pane either left,
|
| 1729 | right, up, or down beneath the last item in the pane or further out of the
|
| 1730 | GUI. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1731 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1732 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Reworked internal file
|
| 1733 | handling code to interface with Aaron's substantial core updates. [<b>Chris
|
| 1734 | Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1735 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1736 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Submitted code suggestion
|
| 1737 | to allow for more granular sorting and display of items in the Manufacturers
|
| 1738 | view, so companies will no longer be grouped with others incorrectly. [<b>René
|
| 1739 | Single</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1740 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1741 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Created new main icon and
|
| 1742 | about.bmp 'Ladybug Homage'. [<b>John IV</b>]<span style='font-size:12.0pt;
|
| 1743 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1744 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1745 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Fixed ascending/descending
|
| 1746 | toggle via View • Arrange Icons for columns other than Game. Added
|
| 1747 | some logic to the -listsourcefile column display. Prevented color depth
|
| 1748 | and refresh rate settings from being displayed if games are played in
|
| 1749 | windowed mode. [<b>René Single / Chris Kirmse</b>]<span style='font-size:
|
| 1750 | 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1751 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1752 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Made Misc. art option gray
|
| 1753 | properly when its parent control was deselected. [<b>Chris Kirmse</b>]<span
|
| 1754 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1755 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1756 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Submitted code to clean up
|
| 1757 | some issues with the list and small icons view and icons squishing in
|
| 1758 | details view upon return from another view like large icons. [<b>René
|
| 1759 | Single / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1760 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1761 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Upgraded MameUI to utilize
|
| 1762 | the new common controls from Windows XP, allowing the proper look of an XP
|
| 1763 | application without the need for an external manifest file. [<b>Chris
|
| 1764 | Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1765 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1766 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added ability to rename
|
| 1767 | custom folders from the tree view, secondary click on them and choose
|
| 1768 | rename folder from the context menu, or click the name of the folder three
|
| 1769 | times quickly. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;
|
| 1770 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1771 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1772 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added the 'Source' folder
|
| 1773 | view, this will display all the driver.c files and all the games within
|
| 1774 | each family. [<b>Mike Haaland</b>]<span style='font-size:12.0pt;
|
| 1775 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1776 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1777 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Removed the
|
| 1778 | \folders\BIOS.ini as it is now obviated by the built-in Source folder
|
| 1779 | view. [<b>John IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1780 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1781 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added -sourcefileinfo
|
| 1782 | information to the general tab for each <span class=GramE>games'</span>
|
| 1783 | properties, to easily and quickly see what driver family a game belongs
|
| 1784 | to. [<b>Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1785 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1786 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added the long requested
|
| 1787 | clone offset aka 'Grouped' view. This will display the parent games
|
| 1788 | flush left, with all their clones alphabetized beneath them indented
|
| 1789 | inward. Excellent for grouping the clones whose names may be considerably
|
| 1790 | different than their <span class=GramE>parents,</span> and allowing typing
|
| 1791 | the name of the game to go to the parent set immediately. [<b>John
|
| 1792 | IV / Chris Kirmse</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1793 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1794 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Reworked the Startup
|
| 1795 | Options to now be Interface Options, and added checkboxes to support
|
| 1796 | Aaron's new disclaimer / info screen toggle. [<b>Chris Kirmse</b>]<span
|
| 1797 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1798 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1799 | mso-list:l16 level1 lfo13;tab-stops:list .5in'>Added new switches -rdtsc /
|
| 1800 | -pause_brightness to match the core. [<b>Chris Kirmse</b>]<span
|
| 1801 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1802 | </ul>
|
| 1803 | |
| 1804 | <h2><span style='font-size:12.0pt'>v.62</span></h2>
|
| 1805 | |
| 1806 | <ul type=square>
|
| 1807 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1808 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Internalized the code for
|
| 1809 | rotate.exe, MameUI can now choose its background images from Options •
|
| 1810 | Background Image, and choose a random one on startup. Options •
|
| 1811 | Startup Options • Select Random Background Image. [<b>K&K</b>]<span
|
| 1812 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1813 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1814 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added tabs for the
|
| 1815 | screenshot art <span class=GramE>area,</span> toggle with Alt-b. [<b>K&K</b>]<span
|
| 1816 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1817 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1818 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added code to increase speed
|
| 1819 | of audit. [<b>K&K</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1820 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1821 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added secondary click menu
|
| 1822 | pop-up for screenshot area. [<b>Sword</b>]<span style='font-size:12.0pt;
|
| 1823 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1824 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1825 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Allowed bkground.png to be displayed
|
| 1826 | in history.dat area under screenshot, font color changed to match GUI font
|
| 1827 | color. [<b>K&K</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1828 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1829 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Created new icons for the
|
| 1830 | various tabs in Default Options / Game Properties dialogue boxes. [<b>John
|
| 1831 | IV</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1832 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1833 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Updated the ColumnEdit and
|
| 1834 | Properties code to make them both more extensible. [<b>Nathan Woods/MESS32</b>]<span
|
| 1835 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1836 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1837 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Included index fixes to
|
| 1838 | speed load time in treeview.c, particularly with extra \folders *.inis. [<b>Jeff
|
| 1839 | Miller</b>] <span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1840 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1841 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Fixed an issue where the
|
| 1842 | startup focus in the details list would jump to the top of the list before
|
| 1843 | returning to the prior selection. [<b>Chris Kirmse</b>]<span
|
| 1844 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1845 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1846 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Main distribution now
|
| 1847 | compiled with I686=1 for Pentium Pro optimization. Doesn't impact
|
| 1848 | high end AMD chips at all but provides speed increases to lower range PII,
|
| 1849 | P3 machines. [<b>John IV</b>]<span style='font-size:12.0pt;font-family:
|
| 1850 | "Times New Roman"'><o:p></o:p></span></li>
|
| 1851 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1852 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Created new *.ini files for
|
| 1853 | the \folders directory. Replace the old ones with these (<span
|
| 1854 | class=GramE>except</span> any user-modified of course). [<b>John IV</b>]<span
|
| 1855 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1856 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1857 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Created a new MameUI MSI
|
| 1858 | installer package. This should be easier for beginners. [<b>John IV</b>]<span
|
| 1859 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1860 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1861 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added the ability to drag and
|
| 1862 | drop games into the custom *.ini folders. [<b>Chris Kirmse</b>] <span
|
| 1863 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1864 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1865 | mso-list:l6 level1 lfo14;tab-stops:list .5in'>Added the ability to
|
| 1866 | secondary click on a game to add or remove it from an *.ini file in the
|
| 1867 | \folders directory. [<b>Patrick Jones / Chris Kirmse</b>]<span
|
| 1868 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1869 | </ul>
|
| 1870 | |
| 1871 | <h2><span style='font-size:12.0pt'>v.61</span></h2>
|
| 1872 | |
| 1873 | <ul type=square>
|
| 1874 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1875 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Fixed a nasty crasher where
|
| 1876 | MameUI would hang if loading a game that required user intervention in
|
| 1877 | Mame[w] <span class=GramE>like</span> 'The Astyanax', and there was no
|
| 1878 | joystick connected to the system. [<b>Sword</b>]<span style='font-size:
|
| 1879 | 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1880 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1881 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Fixed a couple of fringe
|
| 1882 | case crashers when Windows is shut down beneath MameUI, i.e. a cabinet
|
| 1883 | setting. [<b>Robert John Sheppard</b>]<span style='font-size:12.0pt;
|
| 1884 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1885 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1886 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Removed -dirty / -nodirty
|
| 1887 | options to match Aaron's core changes. [<b>John IV</b>]<span
|
| 1888 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1889 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1890 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added dialogue box support
|
| 1891 | for new artwork switches, added -ini support to Options • Directories. [<b>Mike
|
| 1892 | Haaland</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1893 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1894 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added dialogue box support
|
| 1895 | for LED disablement, artwork resolution. [<b>Mike Haaland</b>]<span
|
| 1896 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1897 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1898 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added brightness slider,
|
| 1899 | removed -bpp per Aaron's changes. [<b>Mike Haaland</b>]<span
|
| 1900 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1901 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1902 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added sound chip and CPU
|
| 1903 | information to the folder views. Added the long requested feature to
|
| 1904 | create user defined folder views, see \folders files for examples. [<b>Sword,
|
| 1905 | BUT, Emuman / Mike Haaland</b>] <span style='font-size:12.0pt;font-family:
|
| 1906 | "Times New Roman"'><o:p></o:p></span></li>
|
| 1907 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1908 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Created Artwork, BIOS, and
|
| 1909 | Custom folder views. [<b>John IV</b>]<span style='font-size:12.0pt;
|
| 1910 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1911 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1912 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added support for displaying
|
| 1913 | -listsourcefile [source] field to the View • Customize Fields. Handy
|
| 1914 | for sorting to test global driver changes across all its <span
|
| 1915 | class=GramE>games.,</span> or using to report game problems to
|
| 1916 | MameTesters.com. [<b>Mike Haaland</b>]<span style='font-size:12.0pt;
|
| 1917 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1918 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1919 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Created new Version and
|
| 1920 | Classification folder views. [<b>John IV</b>]<span style='font-size:12.0pt;
|
| 1921 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1922 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1923 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added support for the new
|
| 1924 | -lightgun switch. [<b>John IV</b>]<span style='font-size:12.0pt;
|
| 1925 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1926 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1927 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Removed 'add to favorites'
|
| 1928 | from context menus and file menu since it is now possible/preferable to
|
| 1929 | have favorites stored in the portable, user-defined, external text file
|
| 1930 | [\folders]. <span class=GramE>Which also of course would survive a
|
| 1931 | registry key purge.</span> <span class=GramE>Times played is</span> still
|
| 1932 | accessible as a column in details view. [<b>John IV</b>]<span
|
| 1933 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1934 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1935 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Updated help file with new
|
| 1936 | settings, added baseline Mame[w] documents to help file. [<b>John IV</b>]<span
|
| 1937 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1938 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1939 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Added \titles directory
|
| 1940 | support to allow for title screenshots viewing. [<b>John IV</b>]<span
|
| 1941 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1942 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1943 | mso-list:l2 level1 lfo15;tab-stops:list .5in'>Created new MameUI icon and <span
|
| 1944 | class=GramE>About</span> graphic. [<b>John IV</b>]<span style='font-size:
|
| 1945 | 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1946 | </ul>
|
| 1947 | |
| 1948 | <h2><span style='font-size:12.0pt'>v.60</span></h2>
|
| 1949 | |
| 1950 | <ul type=square>
|
| 1951 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1952 | mso-list:l13 level1 lfo16;tab-stops:list .5in'>Created and added the new
|
| 1953 | MameUI HTML Help File. [<b>John IV</b>]<span style='font-size:12.0pt;
|
| 1954 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1955 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1956 | mso-list:l13 level1 lfo16;tab-stops:list .5in'>Updated context sensitive
|
| 1957 | help support to MameUI, all controls should be mapped to pop-up help. [<b>Mike
|
| 1958 | Haaland</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1959 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1960 | mso-list:l13 level1 lfo16;tab-stops:list .5in'>Added 'Use less CPU if
|
| 1961 | possible' check box in Options • Default Options • Miscellaneous.
|
| 1962 | This toggles the new baseline Mame[w] sleep / -nosleep switch. If
|
| 1963 | toggled on, it will return more time slices to the processor and be more
|
| 1964 | amenable to multi-tasking with other applications. If toggled off,
|
| 1965 | MameUI will continue to take 100% of the CPU time as it has historically.
|
| 1966 | It should be toggled 'off' for people experiencing severe slowdowns,
|
| 1967 | particularly laptop users. [<b>John IV / Mike Haaland</b>]<span
|
| 1968 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1969 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1970 | mso-list:l13 level1 lfo16;tab-stops:list .5in'>Added option to set the
|
| 1971 | directory for hard drive image diff files to match Mame[w] in Options •
|
| 1972 | Directories. Fixed screenshot area decimation when image sized too large
|
| 1973 | for area. Scales properly now and looks great. Fixed flip
|
| 1974 | options. [<b>Sword</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1975 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1976 | mso-list:l13 level1 lfo16;tab-stops:list .5in'>Added option to set the
|
| 1977 | directory for icons in Options • Directories. [<b>John IV</b>]<span
|
| 1978 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1979 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1980 | mso-list:l13 level1 lfo16;tab-stops:list .5in'>Added support for new
|
| 1981 | external controller mapping. This adds support for common arcade
|
| 1982 | controllers and provides the ability to create user defined mappings for
|
| 1983 | home built solutions. See Options • Default Options • Controllers.
|
| 1984 | Also see the controller mapping document in the Mame Documents help
|
| 1985 | section. [<b>Ron Fries</b>]<span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 1986 | </ul>
|
| 1987 | |
| 1988 | <h2><span style='font-size:12.0pt'>v.59</span></h2>
|
| 1989 | |
| 1990 | <ul type=square>
|
| 1991 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 1992 | mso-list:l15 level1 lfo17;tab-stops:list .5in'>Added 'Allow game selection
|
| 1993 | by joystick' check box to Startup Options. Allows navigation and
|
| 1994 | game launch via controller<span class=GramE>:</span><br>
|
| 1995 | joystick 1 up = up arrow<br>
|
| 1996 | joystick 1 down = down arrow<br>
|
| 1997 | joystick 1 left = left arrow<br>
|
| 1998 | joystick 1 right = right arrow<br>
|
| 1999 | joystick 1 button 1 = play game<br>
|
| 2000 | joystick 1 button 2 = page up<br>
|
| 2001 | joystick 1 button 5 = page down<br>
|
| 2002 | joystick 1 button 3 = end<br>
|
| 2003 | joystick 1 button 6 = home. [<b>Chris Kirmse</b>]<span style='font-size:
|
| 2004 | 12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 2005 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 2006 | mso-list:l15 level1 lfo17;tab-stops:list .5in'>Fixed a few files to allow
|
| 2007 | a MinGW compile without errors. [<b>Sword</b>]<span style='font-size:12.0pt;
|
| 2008 | font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 2009 | <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
| 2010 | mso-list:l15 level1 lfo17;tab-stops:list .5in'>Added 'Broadcast selected game
|
| 2011 | to all windows' check box in Startup Options, this allows third party
|
| 2012 | applications to be programmatically told what game is being played in
|
| 2013 | MameUI. It can be used to hook into applications like LED reader
|
| 2014 | boards, or instant message clients, etc. [<b>Chris Kirmse</b>]<span
|
| 2015 | style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></li>
|
| 2016 | </ul>
|
| 2017 | |
| 2018 | <p><font size="1">
|
| 2019 | <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y-%m-%d %I:%M %p %Z" startspan -->2007-11-10 02:06 AM -0800<!--webbot bot="Timestamp" endspan i-checksum="38017" -->/ <span class=GramE>john</span> iv</font></p>
|
| 2020 | |
| 2021 | </div>
|
| 2022 | |
| 2023 | </body>
|
| 2024 | |
| 2025 | </html> |
src/osd/winui/help/html/mameui_support.htm
| r0 | r1368 | |
| 1 | <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">
|
| 2 | |
| 3 | <head>
|
| 4 | <style type="text/css">
|
| 5 | div.Section1
|
| 6 | {page:Section1;}
|
| 7 | h1
|
| 8 | {margin-top:12.0pt;
|
| 9 | margin-right:0in;
|
| 10 | margin-bottom:3.0pt;
|
| 11 | margin-left:0in;
|
| 12 | page-break-after:avoid;
|
| 13 | font-size:16.0pt;
|
| 14 | font-family:"Arial","sans-serif";
|
| 15 | color:windowtext;
|
| 16 | font-weight:bold;
|
| 17 | }
|
| 18 | p
|
| 19 | {margin-right:0in;
|
| 20 | margin-left:0in;
|
| 21 | font-size:10.0pt;
|
| 22 | font-family:"Arial","sans-serif";
|
| 23 | color:black;
|
| 24 | }
|
| 25 | a:link
|
| 26 | {color:blue;
|
| 27 | text-decoration:underline;
|
| 28 | text-underline:single;
|
| 29 | }
|
| 30 | </style>
|
| 31 | </head>
|
| 32 | |
| 33 | <body style="background-image: url('../images/bkground.gif')">
|
| 34 | |
| 35 | <div class="Section1">
|
| 36 | <h1 style="mso-margin-bottom-alt: auto"><span style="COLOR: black">MameUI |
| 37 | Troubleshooting [& Tips]<o:p></o:p></span></h1>
|
| 38 | <p style="MARGIN-TOP: 0in">MameUI has been in development since 1997.<span style="mso-spacerun: yes">
|
| 39 | </span>It is mature, complex, and robust. However, since the Mame |
| 40 | project itself is a documentation effort, and development is continuous, |
| 41 | there will be times when changes to the core program effect MameUI. |
| 42 | When problems do occur with a specific game in a specific version of MameUI, |
| 43 | a previous version of MameUI may be used. </p>
|
| 44 | <p style="MARGIN-TOP: 0in">MameUI is now an integrated GUI front end which |
| 45 | passes user input from the GUI to the
|
| 46 | <b style="mso-bidi-font-weight: normal"><a href="http://www.mamedev.org/">
|
| 47 | <span style="COLOR: black">Mame</span></a></b> engine/core.<span style="mso-spacerun: yes">
|
| 48 | </span>Thus, any problems that occur in the
|
| 49 | <b style="mso-bidi-font-weight: normal"><a href="http://www.mamedev.org">
|
| 50 | <span style="COLOR: black">Mame</span></a></b> engine will be inherited by |
| 51 | MameUI. Prior to <b>
|
| 52 | <a href="http://groups.msn.com/mameui/messageboard.msnw">
|
| 53 | <span style="COLOR: black">reporting problems</span></a> </b>
|
| 54 | <span style="mso-bidi-font-weight: bold">against MameUI</span>, verify that |
| 55 | the issue is not a known, core defect in
|
| 56 | <b style="mso-bidi-font-weight: normal"><a href="http://www.mamedev.org/">
|
| 57 | <span style="COLOR: black">Mame</span></a></b>. The <b>
|
| 58 | <a target="_blank" href="http://www.mametesters.org/">
|
| 59 | <span style="COLOR: black">Mametesters.org</span></a></b> site is designed |
| 60 | to track and report bugs in the baseline
|
| 61 | <b style="mso-bidi-font-weight: normal"><a href="http://www.mamedev.org/">
|
| 62 | <span style="COLOR: black">Mame</span></a></b> version. To find if a |
| 63 | problem plagues the game in question, do an
|
| 64 | <b style="mso-bidi-font-weight: normal">alt-enter</b> on the game and note |
| 65 | its driver/source name at the bottom of the general properties tab; then |
| 66 | search the Mametesters’ bug database and search their
|
| 67 | <b style="mso-bidi-font-weight: normal">
|
| 68 | <a href="http://www.mameworld.info/ubbthreads/postlist.php?Cat=&Board=mametesters">
|
| 69 | <span style="COLOR: black">message board</span></a></b>.<span style="mso-spacerun: yes">
|
| 70 | </span>The current list of known MameUI specific issues and defect tracking |
| 71 | is available at <b>
|
| 72 | <a target="_blank" href="http://mameui.classicgaming.gamespy.com//MameUI_Bugs.xls">
|
| 73 | <span style="COLOR: black">MameUI</span></a></b>. </p>
|
| 74 | <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
|
| 75 | <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">ROMs and |
| 76 | CHDs Related Topics</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
|
| 77 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 78 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 79 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 80 | </span></span></span>Utilization of an external ROMs management utility like
|
| 81 | <b style="mso-bidi-font-weight: normal"><a href="http://www.clrmame.com/">
|
| 82 | <span style="COLOR: black">Clrmame</span></a></b> is recommended for repair |
| 83 | and identification of damaged sets.</p>
|
| 84 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 85 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 86 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 87 | </span></span></span>If receiving missing ROMs error messages when |
| 88 | attempting to run a game, secondary click on the game in the list and choose |
| 89 | properties, do an audit on that game [or use <b>Alt-A</b>].<span style="mso-spacerun: yes">
|
| 90 | </span>The audit will determine which files are missing from the ROMset |
| 91 | currently being played.<span style="mso-spacerun: yes"> </span>MameUI |
| 92 | will not run a game which fails its internal audit.</p>
|
| 93 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 94 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 95 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 96 | </span></span></span>Mame is an ongoing documentation project. Sometimes old |
| 97 | ROM sets are found to have miss-dumped, missing, or damaged ROMs, which need |
| 98 | to be replaced. As new versions of Mame are released, the Mame |
| 99 | developers add support for these new iterations of ROMs, supplanting or |
| 100 | renaming the old supported versions.<span style="mso-spacerun: yes">
|
| 101 | </span>Thus, often, older versions of ROMs which did work in older versions |
| 102 | of MameUI, will <u>not</u> work with newer versions of MameUI because they |
| 103 | are now read as incomplete or wrong.<span style="mso-spacerun: yes">
|
| 104 | </span>MameUI will not play the game in question until the updated ROMs are |
| 105 | utilized.</p>
|
| 106 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 107 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 108 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 109 | </span></span></span>MameUI utilizes the idea of a parent / clone |
| 110 | relationship for its games. If trying to play a clone or a bootleg of |
| 111 | a game, MameUI will need the ROMs for the clone game, <b>and</b> the parent |
| 112 | set. MameUI indicates the parent set of a clone at the bottom of the |
| 113 | game’s properties tab, or more easily in grouped view, View \ Grouped.</p>
|
| 114 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 115 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 116 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 117 | </span></span></span>MameUI utilizes the idea of having single zip files to |
| 118 | house the BIOS files for a large number of similar games.<span style="mso-spacerun: yes">
|
| 119 | </span>The NeoGeo games for example, share upwards of ten BIOS files in |
| 120 | every game. Mame will look to neogeo.zip as the BIOS zip, if this file |
| 121 | is freestanding along with the other NeoGeo games, it will use it. |
| 122 | Otherwise, MameUI expects all the BIOS files in every NeoGeo game’s zip |
| 123 | file. DECO cassette, PGM, and Playchoice are some examples of other BIOS |
| 124 | games. An error message will occur if the BIOS files are not present |
| 125 | and those games are run.<span style="mso-spacerun: yes"> </span>
|
| 126 | Occasionally, new ROMs will need to be added to the BIOS packages |
| 127 | themselves, this occurred recently with the ‘ng-lo.rom’ and then 6 new |
| 128 | regional BIOSes in the neogeo.zip. MameUI will not audit a game as correct |
| 129 | without all the BIOS files with the correct CRC, while it may however be |
| 130 | possible to play the game after an error message.</p>
|
| 131 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 132 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 133 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 134 | </span></span></span>Games that support .CHD [compressed hunks of data] |
| 135 | images [Max Force, Killer Instinct I & II, Area 51, Vicious Circle, War |
| 136 | Gods, beatmania games, and items in the CHD folder view on the left pane] |
| 137 | have to have their ROMs and .CHD files in a very specific directory |
| 138 | structure. The <b style="mso-bidi-font-weight: normal">single</b> large .CHD |
| 139 | file needs to go in the \ROMs\gamename\ directory, and have the *.CHD |
| 140 | extension, e.g. \ROMs\area51\area51.chd.<span style="mso-spacerun: yes">
|
| 141 | </span>These games also have ROMs, these go one level up in the \ROMs folder |
| 142 | proper like any other game.<span style="mso-spacerun: yes"> </span>So |
| 143 | in the end two files should exist for these games one *.zip in the \ROMs |
| 144 | folder and the *.chd in a sub-directory named for the game.<span style="mso-spacerun: yes">
|
| 145 | </span></p>
|
| 146 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 147 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 148 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 149 | </span></span></span><b>F5 </b>/ View • Refresh in the GUI. (Do this anytime |
| 150 | ROMs are altered, renaming, etc.)</p>
|
| 151 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 152 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 153 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 154 | </span></span></span>If games are not displaying in the game list, ensure |
| 155 | the appropriate folder view on the far left is toggled, i.e. 'all games' and |
| 156 | it doesn't have filtering on it to stop the display of the game being |
| 157 | searched for.</p>
|
| 158 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 159 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 160 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 161 | </span></span></span>Use the Options • Reset to default menu choice and |
| 162 | check all of the items, restart MameUI.</p>
|
| 163 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo2; tab-stops: list .5in">
|
| 164 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 165 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 166 | </span></span></span>Final option, manually delete the MameUI32/64.ini and the |
| 167 | Mame.ini file in the \ini directory.</p>
|
| 168 | <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
|
| 169 | <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Crash |
| 170 | Related Topics</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
|
| 171 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 172 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 173 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 174 | </span></span></span>Delete the \cfg\*.CFG, \diff\*.DIF, \ini\*.INI, or |
| 175 | \nv\*.NV files for the game that's crashing.</p>
|
| 176 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 177 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 178 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 179 | </span></span></span>Check to see that the zip file is valid and that it's |
| 180 | not corrupt or read-only.</p>
|
| 181 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 182 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 183 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 184 | </span></span></span>Verify the presence of the \ini directory under |
| 185 | MameUI.exe’s location.</p>
|
| 186 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 187 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 188 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 189 | </span></span></span>If versions of MameUI prior to .66 had been installed |
| 190 | on the system, verify that the old registry key has been deleted with |
| 191 | regedit.exe. HKEY_CURRENT_USER/Software/Freeware/Mame32</p>
|
| 192 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 193 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 194 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 195 | </span></span></span>If crashing during an audit or an [<b>F5</b>] refresh, |
| 196 | it could be a corrupt .zip file. Extract it and re-zip. Pkunzip -t *.zip. |
| 197 | Note the file that dies during the audit and concentrate on that one. Also |
| 198 | verify that if zip files are not used, that the folder is not empty, or |
| 199 | contains partial or damaged ROMs.<span style="mso-spacerun: yes">
|
| 200 | </span>Utilization of an external ROMs management utility like
|
| 201 | <b style="mso-bidi-font-weight: normal"><a href="http://www.clrmame.com/">
|
| 202 | <span style="COLOR: black">Clrmame</span></a></b> is recommended for repair |
| 203 | and identification of damaged sets.</p>
|
| 204 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 205 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 206 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 207 | </span></span></span>If seeing crashes or weird screen coloration, try |
| 208 | disabling running background apps [in Win98, use msconfig.exe], Norton |
| 209 | Crashguard, PnP programs like Kaaza, eDonkey, LimeWire, popup killers, |
| 210 | viruscans, MS Office Fast Find, the Microsoft Office Bar, Intellimouse, even |
| 211 | IE subscription updates, etc. Try moving MameUI away from compressed |
| 212 | [DriveSpace, DoubleSpace, stacker] drives. IntelliMouse and Office |
| 213 | Toolbars have been known to cause conflicts.<span style="mso-spacerun: yes">
|
| 214 | </span>Also disable items in the system tray, like the CD player, etc. |
| 215 | It may also be necessary to download and install the latest version of |
| 216 | DirectX from Microsoft to prevent some errors.</p>
|
| 217 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 218 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 219 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 220 | </span></span></span>If MameUI crashes with an access violation it may be |
| 221 | the DEP (Data Execution Prevention) setting on that machine.<span style="mso-spacerun: yes">
|
| 222 | </span>Add MameUI to the exception list in Control Panel / System / Advanced |
| 223 | / DEP.</p>
|
| 224 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 225 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 226 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 227 | </span></span></span>In some instances games may fail to start if the |
| 228 | installed directory path contains a large number of characters and spaces, |
| 229 | to alleviate this, install MameUI and its support directory structure into a |
| 230 | shorter path name, i.e. c:\MameUI\.</p>
|
| 231 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 232 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 233 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 234 | </span></span></span>MameUI may fail to launch its games in situations where |
| 235 | an errant, non-DX compliant, or badly written gamepad USB adapter |
| 236 | driver/software is used.<span style="mso-spacerun: yes"> </span>This |
| 237 | includes some cheap Playstation, SNES, U64 converters.</p>
|
| 238 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 239 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 240 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 241 | </span></span></span>Games may fail to start if a video cards DirectX driver |
| 242 | is flakey, utilise an earlier one to test or re-install DirectX.</p>
|
| 243 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 244 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 245 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 246 | </span></span></span>Some recent viruses which attach to .exes will cause |
| 247 | page faults and access violations in MameUI when it's run. Use an |
| 248 | anti-virus check and verify MameUI is not infected.</p>
|
| 249 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 250 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 251 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 252 | </span></span></span>Odd behaviour may be exhibited in NT based systems if |
| 253 | attempting to run games while security/permissions settings do not allow it |
| 254 | or the user is not an administrator or member of the administrator’s group.</p>
|
| 255 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 256 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 257 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 258 | </span></span></span>Some anti-virus packages may slow down navigation |
| 259 | within the MameUI directory.<span style="mso-spacerun: yes"> </span>
|
| 260 | These are false positives and the anti-virus vendors should update their |
| 261 | virus dat signatures.<span style="mso-spacerun: yes"> </span>It may |
| 262 | also be possible to exclude the MameUI.exe from real-time scanning as a |
| 263 | workaround.</p>
|
| 264 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 265 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 266 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 267 | </span></span></span>In the event of MameUI not launching a game and just |
| 268 | sitting there, try placing the entire MameUI directory and its |
| 269 | sub-directories including \ROMs into a more simple path, like c:\MameUI |
| 270 | instead of "c:\Games for Fun\MameUI Goes Here\".<span style="mso-spacerun: yes">
|
| 271 | </span>Simplify the path.</p>
|
| 272 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 273 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 274 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 275 | </span></span></span>On rare occasions malformed or damaged *.dat files |
| 276 | [history.dat, mameinfo.dat, cheat.dat] can cause MameUI to error on startup |
| 277 | when it tries to read them.<span style="mso-spacerun: yes"> </span>
|
| 278 | Remove those files individually to check for the one causing the crash.</p>
|
| 279 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 280 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 281 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 282 | </span></span></span>With the move to XML based Controller *.cfg files in |
| 283 | the .8x era it is necessary to remove the old \Ctrlr\*.ini files and use |
| 284 | their new *.cfg counterparts, otherwise MameUI may launch games then |
| 285 | immediately return to the GUI.</p>
|
| 286 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 287 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 288 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 289 | </span></span></span>Use the Options • Reset to default menu choice and |
| 290 | check all of the items, restart MameUI.</p>
|
| 291 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4; tab-stops: list .5in">
|
| 292 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 293 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 294 | </span></span></span>Final option, manually delete the MameUI32/64.ini and the |
| 295 | Mame.ini file in the \ini directory.</p>
|
| 296 | <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
|
| 297 | <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Performance |
| 298 | Related Topics [incl. sound scratchiness and stuttering]</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
|
| 299 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 300 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 301 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 302 | </span></span></span>MameUI will start to crackle, scratch, or echo if the |
| 303 | game running is too taxing for the processor in use. This can be visually |
| 304 | confirmed by turning on FPS display with [<b>F11</b>], and frame skip to |
| 305 | auto with [<b>F8</b>]. If the FPS dips anywhere or frame skipping |
| 306 | rises anywhere during the game play, the game is maxing out the CPU and |
| 307 | sound breakup could occur.<span style="mso-spacerun: yes"> </span>If |
| 308 | upgrading machine components, provide MameUI with as much hardware as |
| 309 | possible; a faster CPU makes the most difference, followed by video card, |
| 310 | and RAM.</p>
|
| 311 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 312 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 313 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 314 | </span></span></span>MameUI will start to 'skip' sound on games that run |
| 315 | slightly over the host monitor refresh rate in full-screen mode with |
| 316 | triplebuffer. For example, Pac-Man and other early Namco games run at |
| 317 | 60.60Hz and if they are run on a fixed 60Hz LCD monitor using triplebuffer |
| 318 | they will skip since the emulation is outpacing the monitor. In this |
| 319 | instance it is necessary to toggle on the 'Refresh Speed' switch in the |
| 320 | Options • Default Options • Advanced tab. This issue can also be |
| 321 | overcome by running the game in windowed mode.</p>
|
| 322 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 323 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 324 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 325 | </span></span></span>With the advent of MameUI .120 some historically |
| 326 | hardware punishing games become playable on high end overclocked [3.6Ghz+] |
| 327 | Intel Core2Duo and Quad Cores. These processors combined with 64bit |
| 328 | operating systems and native 64bit MameUI provide almost 100% playability in |
| 329 | namcos21.c / namcos22.c / seattle.c and midvunit.c games.</p>
|
| 330 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 331 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 332 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 333 | </span></span></span>Some of the largest games supported by MameUI [NeoGeo |
| 334 | mainly] can run into the hundreds of megabyte range when they are |
| 335 | uncompressed into memory, this combined with MameUI in memory, plus OS |
| 336 | overhead can lead to very slow performance as Windows swaps the information |
| 337 | out to disk if there is not enough physical memory. 512M to 1G of |
| 338 | memory is recommended for all current games [.118].</p>
|
| 339 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 340 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 341 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 342 | </span></span></span>As Mame has continued development, infrastructure and |
| 343 | accuracy has improved.<span style="mso-spacerun: yes"> </span>As such, |
| 344 | the optimization point of the games has shifted so that older games may be |
| 345 | slower unthrottled overall than when run on earlier versions.<span style="mso-spacerun: yes">
|
| 346 | </span>For example, in version .36 Donkey Kong may have run unthrottled at |
| 347 | 1900 FPS, but in .77 it runs 1500 FPS.<span style="mso-spacerun: yes">
|
| 348 | </span>Regardless, modern machines should have no problem running these |
| 349 | earlier games at their intended 60 FPS rate.</p>
|
| 350 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 351 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 352 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 353 | </span></span></span>Periodically, speed-up hacks in the core code will be |
| 354 | removed to provide more accurate emulation of the games.<span style="mso-spacerun: yes">
|
| 355 | </span>This can result in a drop in FPS for that particular family of games, |
| 356 | but can be offset by upgrading the machine Mame is used on.</p>
|
| 357 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 358 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 359 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 360 | </span></span></span>AMD’s Cool ‘n Quiet technology on certain setups has |
| 361 | been known to cause slowdowns and lags while working in the MameUI GUI as |
| 362 | well as causing some in-game sound and graphic stuttering.<span style="mso-spacerun: yes">
|
| 363 | </span>Disable the feature in the BIOS to verify.</p>
|
| 364 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 365 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 366 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 367 | </span></span></span>On certain system setups (older), DirectDraw may be a |
| 368 | faster option than the D3D settings.<span style="mso-spacerun: yes">
|
| 369 | </span>Choose Ddraw as the video mode in Default Options • Display. </p>
|
| 370 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 371 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 372 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 373 | </span></span></span>If seeing a severe slowdown in games that previously |
| 374 | didn't, toggle the Use less CPU time if possible menu item in Options • |
| 375 | Default Options • Miscellaneous. This happens to laptop users |
| 376 | particularly.</p>
|
| 377 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 378 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 379 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 380 | </span></span></span>Certain games in MameUI perform better on machines that |
| 381 | cannot handle them 100% if auto-frame skipping is turned <b>off</b>.
|
| 382 | </p>
|
| 383 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 384 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 385 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 386 | </span></span></span>Certain games if run with D3D settings will perform |
| 387 | better if Triplebuffering is set to <b style="mso-bidi-font-weight: normal">
|
| 388 | off</b>.<span style="mso-spacerun: yes"> </span>D3D will double buffer |
| 389 | if triple is turned off.</p>
|
| 390 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 391 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 392 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 393 | </span></span></span>There may be certain sound anomalies in games if the |
| 394 | *.cfg files have become damaged, delete all the files in \cfg to remedy.</p>
|
| 395 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 396 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 397 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 398 | </span></span></span>If games are running too <b>fast</b>, verify in the |
| 399 | Options • Default Game Options menu that the throttle option is turned <b>on</b>, |
| 400 | that sync to monitor refresh is turned <b>off </b>and Wait for Vertical Sync |
| 401 | is turned <b>off</b> in the Options • Default Game Options • Advanced menu.<span style="mso-spacerun: yes">
|
| 402 | </span></p>
|
| 403 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 404 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 405 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 406 | </span></span></span>MameUI video performance can be greatly enhanced if |
| 407 | running in 32bpp mode by ensuring AGP Fast Writes are toggled on in the |
| 408 | motherboard BIOS.<span style="mso-spacerun: yes"> </span>The videocard |
| 409 | drivers also need to support this setting, the switch for this may be in the |
| 410 | advanced tab of the Windows display control panel applet.</p>
|
| 411 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 412 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 413 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 414 | </span></span></span>There are some soundcards like early PCI
|
| 415 | <span class="SpellE">Soundblasters</span> 128 that will cause scratchiness |
| 416 | if their hardware acceleration is turned up too high. Move the slider |
| 417 | down various steps to troubleshoot in Control Panel • Sound • Advanced |
| 418 | Audio.</p>
|
| 419 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 420 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 421 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 422 | </span></span></span>There are some older video card/video driver |
| 423 | combinations that <b>can</b> do hardware stretching, but are slower than |
| 424 | running with hardware stretch <b>off</b>. If games are too sluggish with the |
| 425 | hw stretch on, toggle it off if possible. Some PCI graphic cards have |
| 426 | been seen to have this problem.</p>
|
| 427 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo6; tab-stops: list .5in">
|
| 428 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 429 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 430 | </span></span></span>If a large number of icons are being used in the GUI, |
| 431 | it is typically quicker to unzip them into the \icons folder instead of |
| 432 | leaving them zipped as icons.zip.</p>
|
| 433 | <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
|
| 434 | <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Joysticks / |
| 435 | Mice / Gamepad / Lightgun Related Topics</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
|
| 436 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
|
| 437 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 438 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 439 | </span></span></span>Gamepads and mouse are disabled by default on first |
| 440 | MameUI launch, enable them by toggling their check boxes on in Options • |
| 441 | Default Options • Controllers.</p>
|
| 442 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
|
| 443 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 444 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 445 | </span></span></span>MameUI relies on DirectX’s DirectInput for joystick |
| 446 | support, ensure the game pad is seen as present and active in the game |
| 447 | controller control panel: start menu • settings • control panel • game |
| 448 | controllers.</p>
|
| 449 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
|
| 450 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 451 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 452 | </span></span></span>If seeing keys ‘stick’ while playing, verify that the |
| 453 | operating systems’ accessibility options and their shortcut keys are turned |
| 454 | off, things like ‘sticky keys’, and verify that Popup killers or other |
| 455 | resident programs are not mapped to the sticking key.<span style="mso-spacerun: yes">
|
| 456 | </span>Also keys can stick on some KVM switch boxes if their hotkey switches |
| 457 | are set to [<b style="mso-bidi-font-weight: normal">Ctrl</b>] etc.</p>
|
| 458 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
|
| 459 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 460 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 461 | </span></span></span>Daisy chained gameport Microsoft Sidewinders [original] |
| 462 | in Win2k or XP do not work very well. Use USB gamepads instead. Single |
| 463 | Sidewinders may also cause odd behavior like ghost button presses.</p>
|
| 464 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo8; tab-stops: list .5in">
|
| 465 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 466 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 467 | </span></span></span>Lightguns and mice are treated like mappable joysticks |
| 468 | in current versions of Mame.<span style="mso-spacerun: yes"> </span>If |
| 469 | multiple mice are in use it is necessary to enter the in-game [<b style="mso-bidi-font-weight: normal">TAB</b>] |
| 470 | menu and map their axes in the ‘Input General’ section.</p>
|
| 471 | <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
|
| 472 | <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Settings |
| 473 | Topics</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
|
| 474 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 475 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 476 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 477 | </span></span></span>With the advent of version 0.66 MameUI no longer stores |
| 478 | its configuration information in the Windows registry, it stores it in |
| 479 | \MameUI32/64.ini and \ini\Mame.ini.<span style="mso-spacerun: yes">
|
| 480 | </span>To remove vestiges of the old versions, run regedit.exe and delete |
| 481 | the following key: HKEY_CURRENT_USER\Software\Freeware\MameUI.</p>
|
| 482 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 483 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 484 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 485 | </span></span></span>If having trouble saving keyboard mappings and |
| 486 | configuration, verify that the *.cfg files are not read-only and that a |
| 487 | \MameUI\cfg directory is present.</p>
|
| 488 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 489 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 490 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 491 | </span></span></span>If GUI settings and/or audit results aren’t being |
| 492 | maintained, verify the existence of a writeable MameUI32/64.ini and that the |
| 493 | \ini directory is present and writeable [not read only] under the MameUI.exe |
| 494 | location.</p>
|
| 495 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 496 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 497 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 498 | </span></span></span>If baseline Mame settings like directories and game |
| 499 | options are not being maintained, verify the existence of a writeable |
| 500 | Mame.ini [not read-only] in the \ini directory and that the \ini directory |
| 501 | itself is writeable.</p>
|
| 502 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 503 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 504 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 505 | </span></span></span>If experiencing odd behavior with MameUI saving files |
| 506 | or not appearing to clear its settings, verify that there are not multiple |
| 507 | shortcuts pointing to different versions, that an .exe is not being used by |
| 508 | itself instead of a shortcut to the .exe, or a shortcut pointing to an old |
| 509 | version of the .exe.<span style="mso-spacerun: yes"> </span>Also |
| 510 | verify that there are not multiple versions of MameUI running in memory as |
| 511 | the last one out will save the settings.</p>
|
| 512 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 513 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 514 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 515 | </span></span></span>If seeing MameUI folders being created on the desktop, |
| 516 | verify that the .exe itself is not sitting on the desktop and being launched |
| 517 | which is not correct. Verify that a short-cut to the original is being |
| 518 | properly utilised.<span style="mso-spacerun: yes"> </span>This means |
| 519 | setting the properties on the shortcut to ‘start in’ the appropriate |
| 520 | directory that the original .exe resides in.</p>
|
| 521 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 522 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 523 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 524 | </span></span></span>If the in-game [<b>TAB</b>] menu is no longer working |
| 525 | or can’t be accessed, it has been mapped to another key; delete the |
| 526 | default.cfg file in the \MameUI\cfg directory.</p>
|
| 527 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 528 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 529 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 530 | </span></span></span>If in-game [<b style="mso-bidi-font-weight: normal">TAB</b>] |
| 531 | settings need to be completely reset due to bad mappings, delete the |
| 532 | default.cfg file in the \MameUI\cfg directory.</p>
|
| 533 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 534 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 535 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 536 | </span></span></span>To remove the mappings on an individual game from the [<b style="mso-bidi-font-weight: normal">TAB</b>] |
| 537 | menu, delete its *.cfg file in the \MameUI\cfg directory, i.e. dkong.cfg, |
| 538 | asteroid.cfg.</p>
|
| 539 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 540 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 541 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 542 | </span></span></span>If having trouble mapping keys with the [<b style="mso-bidi-font-weight: normal">TAB</b>] |
| 543 | menu, verify the game is not paused while mapping.</p>
|
| 544 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 545 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 546 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 547 | </span></span></span>MameUI inherits a limit from baseline Mame on the |
| 548 | amount of characters that can be used for the ROM paths.<span style="mso-spacerun: yes">
|
| 549 | </span>If directory settings are not being maintained, pare down the number |
| 550 | and names of the directories being added or simply use a single \ROMs |
| 551 | directory which MameUI expects.</p>
|
| 552 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 553 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 554 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 555 | </span></span></span>If having trouble getting games to display in the |
| 556 | proper orientation [they will not rotate] verify that rotation is set to |
| 557 | default, and that there are no video-card specific hot-keys set in Windows’ |
| 558 | advanced display settings tab that could impact rotation, ATI and NVIDIA |
| 559 | both now include the ability to rotate the Windows screen to portrait |
| 560 | orientation.</p>
|
| 561 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 562 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 563 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 564 | </span></span></span>If games are appearing sideways regardless of rotation |
| 565 | settings, an onboard Intel graphic chipset or similar may be in use.<span style="mso-spacerun: yes">
|
| 566 | </span>Disable the auto rotation capabilities of the Intel graphic chip.</p>
|
| 567 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 568 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 569 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 570 | </span></span></span>MameUI now supports the core’s –<span class="SpellE">mt</span> |
| 571 | switch.<span style="mso-spacerun: yes"> </span>This allows |
| 572 | multi-threading of the final video blit during games. Dual core chips [X2, |
| 573 | C2D, etc.] can take advantage of this feature to offload the work to the |
| 574 | second thread and make MameUI more efficient.<span style="mso-spacerun: yes">
|
| 575 | </span>Speed gains are seen on the unthrottled GPU bound games like dkong, |
| 576 | invaders, etc.</p>
|
| 577 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo10; tab-stops: list .5in">
|
| 578 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 579 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 580 | </span></span></span>MameUI now stores its settings in external *.ini files |
| 581 | instead of the registry.<span style="mso-spacerun: yes"> </span>If it |
| 582 | is necessary to return MameUI to baseline, simply delete the MameUI32/64.ini |
| 583 | file and the Mame.ini file in the \ini directory.<span style="mso-spacerun: yes">
|
| 584 | </span>The next time MameUI runs it will recreate those files with the |
| 585 | default settings.</p>
|
| 586 | <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
|
| 587 | <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">GUI Related |
| 588 | Topics & Miscellaneous Tips</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
|
| 589 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 590 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 591 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 592 | </span></span></span>MameUI will read freestanding icons in the \icons |
| 593 | directory first, then icons in the icons.zip file. </p>
|
| 594 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 595 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 596 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 597 | </span></span></span>If seeing icon palette corruption in the GUI when |
| 598 | returning from a full screen game, try increasing the desktop color depth to |
| 599 | 24bpp or 32bpp.</p>
|
| 600 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 601 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 602 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 603 | </span></span></span>Sometimes icons in large icon view may appear to be |
| 604 | missing their white color or have portions transparent, this is the result |
| 605 | of having white chosen as the windows desktop window setting in Control |
| 606 | Panel / Display. Change the window setting to slightly off-white or |
| 607 | another color to return the icons to their appropriate look.</p>
|
| 608 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 609 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 610 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 611 | </span></span></span>To toggle the MameUI UI fullscreen [no Windows titlebar |
| 612 | and potentially no toolbar or status bar] and back use the [<b style="mso-bidi-font-weight: normal">F11</b>] |
| 613 | key.</p>
|
| 614 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 615 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 616 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 617 | </span></span></span>The GUI text may disappear from the folder view if the |
| 618 | GUI font color chosen is very close to the Windows system background color |
| 619 | scheme or if it is a large enough font [or bold] to anti-alias. </p>
|
| 620 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 621 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 622 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 623 | </span></span></span>MameUI no longer supports *.bmp format and may show a |
| 624 | blank or empty background if a *.bmp is erroneously renamed and used for |
| 625 | bkground.png, or if the bkground directory is marked as read only and MameUI |
| 626 | cannot create the bkground.png file when run.</p>
|
| 627 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 628 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 629 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 630 | </span></span></span>To return to a blank gray background in the GUI, delete |
| 631 | the bkground.png file in the \MameUI\bkground directory.</p>
|
| 632 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 633 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 634 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 635 | </span></span></span>Quickly navigate through games in the details view by |
| 636 | simply typing the first few letters in the name of the game, the highlight |
| 637 | will jump to that game and become more granular as the name is typed out.</p>
|
| 638 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 639 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 640 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 641 | </span></span></span>Select a random game with [<b>Ctrl-R</b>].</p>
|
| 642 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 643 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 644 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 645 | </span></span></span>Audit an individual game with [<b>Alt-A</b>].</p>
|
| 646 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 647 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 648 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 649 | </span></span></span>Various arcade game controller companies produce custom |
| 650 | made configuration files for their setups; these *.cfg files need to go in |
| 651 | the \MameUI\ctrlr folder to be recognized in the MameUI controllers tab.<span style="mso-spacerun: yes">
|
| 652 | </span>These files are the responsibility of the controller companies |
| 653 | themselves and are not included or endorsed by MameUI, they can typically be |
| 654 | found at the companies’ web sites.</p>
|
| 655 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 656 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 657 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 658 | </span></span></span>In grouped view, clones are indented regardless of |
| 659 | whether their parents are visible; in a non-All Games folder this means that |
| 660 | there is not a direct relationship of a clone to the game item above it if |
| 661 | that games’ parent is not shown. This behaviour can be changed by the |
| 662 | setting Interface Options • No offset for clones missing parent in view.</p>
|
| 663 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 664 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 665 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 666 | </span></span></span>Certain items in the GUI may be missing if MameUI is |
| 667 | run on a Win2K/XP box and the user is not an admin or member of the admin |
| 668 | group.</p>
|
| 669 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo12; tab-stops: list .5in">
|
| 670 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 671 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 672 | </span></span></span>The unavailable folder and the available filter are |
| 673 | disabled in MameUI due to a direct request from Nicola.</p>
|
| 674 | <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
|
| 675 | <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Keyboard |
| 676 | Shortcuts</span></strong><span style="FONT-SIZE: 12pt"><o:p></o:p></span></p>
|
| 677 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo14; tab-stops: list .5in">
|
| 678 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 679 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 680 | </span></span></span><b style="mso-bidi-font-weight: normal">Type letters of |
| 681 | game name</b> to jump directly to its first instance.<span style="mso-spacerun: yes">
|
| 682 | </span><b style="mso-bidi-font-weight: normal">Alt-1 through Alt-7</b>: |
| 683 | Toggle art views.<span style="mso-spacerun: yes"> </span>
|
| 684 | <b style="mso-bidi-font-weight: normal">Alt-A</b>: Audit selected game.<span style="mso-spacerun: yes">
|
| 685 | </span><b style="mso-bidi-font-weight: normal">Alt-B</b>: Toggle art tabs.<span style="mso-spacerun: yes">
|
| 686 | </span><b style="mso-bidi-font-weight: normal">Alt-D</b>: Toggle folder |
| 687 | pane.<span style="mso-spacerun: yes"> </span>
|
| 688 | <b style="mso-bidi-font-weight: normal">Alt-P</b>: Toggle screenshot area.<span style="mso-spacerun: yes">
|
| 689 | </span><b style="mso-bidi-font-weight: normal">Alt-S</b>: Toggle status bar.
|
| 690 | <b style="mso-bidi-font-weight: normal">Alt-T</b>: Toggle toolbar.
|
| 691 | <b style="mso-bidi-font-weight: normal">Alt-U</b>: Audit selected folder.
|
| 692 | <b style="mso-bidi-font-weight: normal">Alt-Enter</b>: Show games’ |
| 693 | properties.<span style="mso-spacerun: yes"> </span>
|
| 694 | <b style="mso-bidi-font-weight: normal">Ctrl-F</b>: Text filter.<span style="mso-spacerun: yes">
|
| 695 | </span><b style="mso-bidi-font-weight: normal">Ctrl-R</b>: Choose random |
| 696 | game from GUI. <b style="mso-bidi-font-weight: normal">Ctrl-Page Up</b>: |
| 697 | Scroll up in history.dat text window.<span style="mso-spacerun: yes">
|
| 698 | </span><b style="mso-bidi-font-weight: normal">Ctrl-Page Down</b>: Scroll |
| 699 | down in history.dat text window. <b style="mso-bidi-font-weight: normal">F11</b>: |
| 700 | Fullscreen mode toggle.</p>
|
| 701 | <p style="BACKGROUND: white; MARGIN: 0in 0in 5pt 0.25in"><strong>
|
| 702 | <span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Arial','sans-serif'">Refresh |
| 703 | Restart Instructions<o:p></o:p></span></strong></p>
|
| 704 | <p style="MARGIN: 0in 0in 5pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo14; tab-stops: list .5in">
|
| 705 | <span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol">
|
| 706 | <span style="mso-list: Ignore">·<span style="FONT: 7pt 'Times New Roman'">
|
| 707 | </span></span></span><b style="mso-bidi-font-weight: normal">a.</b> |
| 708 | Re-download the binary dist package from
|
| 709 | <a href="http://mameui.classicgaming.gamespy.com/">
|
| 710 | <span style="COLOR: black">MameUI</span></a>.<span style="mso-spacerun: yes">
|
| 711 | </span><b style="mso-bidi-font-weight: normal">b.</b> Disable running |
| 712 | anti-virus packages before extracting the files.
|
| 713 | <b style="mso-bidi-font-weight: normal">c.</b> Double-click the |
| 714 | self-extracting archive. <span style="mso-spacerun: yes"> </span><b style="mso-bidi-font-weight: normal">d.</b> |
| 715 | When prompted, enter “c:\” [no quotes] as the destination folder.<span style="mso-spacerun: yes">
|
| 716 | </span><b style="mso-bidi-font-weight: normal">e.</b> Launch MameUI by |
| 717 | double-clicking its .exe, allow the audit/refresh to finish, it should go |
| 718 | quick as there are no ROMs.<span style="mso-spacerun: yes"> </span>
|
| 719 | <b style="mso-bidi-font-weight: normal">f.</b> Put a couple of zipped ROMs |
| 720 | from <a href="http://www.mamedev.org/roms"><span style="COLOR: black">
|
| 721 | mamedev.org</span></a> in the c:\MameUI\ROMs directory.<span style="mso-spacerun: yes">
|
| 722 | </span><b style="mso-bidi-font-weight: normal">g.</b> Launch MameUI, audit |
| 723 | the two games individually with [<b style="mso-bidi-font-weight: normal">Alt-A</b>].<span style="mso-spacerun: yes">
|
| 724 | </span><b style="mso-bidi-font-weight: normal">h.</b> Launch Robby or |
| 725 | Gridlee.<span style="mso-spacerun: yes"> </span>
|
| 726 | <b style="mso-bidi-font-weight: normal">i.</b> Quit the game, then quit |
| 727 | MameUI.<span style="mso-spacerun: yes"> </span>
|
| 728 | <b style="mso-bidi-font-weight: normal">j.</b> Add more ROMs and try again.<br style="mso-special-character: line-break">
|
| 729 | <br style="mso-special-character: line-break">
|
| 730 | </p>
|
| 731 | <p style="MARGIN: 0in 0in 5pt 0.25in"><span style="FONT-SIZE: 8pt">
|
| 732 | <span style="mso-no-proof: yes">8/17/2007 1:17:01 AM</span> / john iv<o:p></o:p></span></p>
|
| 733 | </div>
|
| 734 | |
| 735 | |
| 736 | </html>
|
src/osd/winui/help/docs/Command Line Settings.htm
| r0 | r1368 | |
| 1 | |
| 2 | <head>
|
| 3 | <style type="text/css">
|
| 4 | .style1 {
|
| 5 | font-family: Arial, Helvetica, sans-serif;
|
| 6 | }
|
| 7 | .style2 {
|
| 8 | font-size: x-small;
|
| 9 | }
|
| 10 | </style>
|
| 11 | </head>
|
| 12 | |
| 13 | <body style="background-image: url('../images/bkground.gif')">
|
| 14 | |
| 15 | <span class="style1"><span class="style2"><strong>This file describes general usage |
| 16 | information about MAME. It is intended<br>
|
| 17 | to cover aspects of using and configuring the program that are common<br>
|
| 18 | across operating systems. For additional OS-specific options, please see<br>
|
| 19 | the separate documentation for your particular version of MAME.</strong></strong><br>
|
| 20 | <br>
|
| 21 | <br>
|
| 22 | <br>
|
| 23 | Using the program<br>
|
| 24 | -----------------<br>
|
| 25 | <br>
|
| 26 | The usual way to run MAME is by telling it to run a particular game:<br>
|
| 27 | <br>
|
| 28 | mame <gamename> [options]<br>
|
| 29 | <br>
|
| 30 | For example:<br>
|
| 31 | <br>
|
| 32 | mame robby -nosound<br>
|
| 33 | <br>
|
| 34 | ...will run Robby Roto without sound. There are many, many options <br>
|
| 35 | available. All commonly supported options are listed below. Options that<br>
|
| 36 | are specific to one operating system or version of MAME will be listed<br>
|
| 37 | in a separate document.<br>
|
| 38 | <br>
|
| 39 | An alternative way to run MAME is to give it a command:<br>
|
| 40 | <br>
|
| 41 | mame <command> [parameters]<br>
|
| 42 | <br>
|
| 43 | For example:<br>
|
| 44 | <br>
|
| 45 | mame -listsource gridlee<br>
|
| 46 | <br>
|
| 47 | ...will print the name of the source file where the gridlee driver lives <br>
|
| 48 | to the screen. There are just a handful of these commands in MAME. They <br>
|
| 49 | are all listed below, just before the options list.<br>
|
| 50 | <br>
|
| 51 | <br>
|
| 52 | <br>
|
| 53 | Default Keys<br>
|
| 54 | ------------<br>
|
| 55 | <br>
|
| 56 | All the keys below are fully configurable in the user interface. This list<br>
|
| 57 | shows the standard keyboard configuration.<br>
|
| 58 | <br>
|
| 59 | Tab Toggles the configuration menu.<br>
|
| 60 | <br>
|
| 61 | ~ Toggles the On Screen Display. When the on-screen display is<br>
|
| 62 | visible, you can use the following keys to control it:<br>
|
| 63 | <br>
|
| 64 | Up - select previous parameter to modify<br>
|
| 65 | Down - select next parameter to modify<br>
|
| 66 | Enter - reset parameter value to its default<br>
|
| 67 | <br>
|
| 68 | Left - decrease the value of the selected parameter<br>
|
| 69 | </span><span class="style2">Control+Left - decrease the value by 10x<br>
|
| 70 | </span><span class="style2">Shift+Left - decrease the value by 0.1x<br>
|
| 71 | </span><span class="style2">Alt+Left - decrease the value by the smallest amount<br>
|
| 72 | <br>
|
| 73 | Right - increase the value of the selected parameter<br>
|
| 74 | </span><span class="style2">Control+Right - increase the value by 10x<br>
|
| 75 | </span><span class="style2">Shift+Right - increase the value by 0.1x<br>
|
| 76 | </span><span class="style2">Alt+Right - increase the value by the smallest amount<br>
|
| 77 | <br>
|
| 78 | P Pauses the game.<br>
|
| 79 | <br>
|
| 80 | </span><span class="style2">Shift+P While paused, advances to next frame.<br>
|
| 81 | <br>
|
| 82 | F1 Toggle crosshairs for games that use them. Each subsequent<br>
|
| 83 | press will enable crosshairs for one more player.<br>
|
| 84 | <br>
|
| 85 | F2 Service Mode for games that support it.<br>
|
| 86 | <br>
|
| 87 | F3 Resets the game.<br>
|
| 88 | <br>
|
| 89 | Shift+F3 Performs a "hard reset", which tears everything down and re-<br>
|
| 90 | creates it from scratch. This is a more thorough and complete<br>
|
| 91 | reset than an F3.<br>
|
| 92 | <br>
|
| 93 | F4 Shows the game palette, decoded GFX, and any tilemaps. Use the<br>
|
| 94 | Enter key to switch between the three modes (palette, graphics,<br>
|
| 95 | and tilemaps). Press F4 again to turn off the display. The key<br>
|
| 96 | controls in each mode vary slightly:<br>
|
| 97 | <br>
|
| 98 | * Palette/colortable mode:<br>
|
| 99 | [ ] - switch between palette and colortable modes<br>
|
| 100 | Up/Down - scroll up/down one line at a time<br>
|
| 101 | Page Up/Page Down - scroll up/down one page at a time<br>
|
| 102 | Home/End - move to top/bottom of list<br>
|
| 103 | -/+ - increase/decrease the number of colors per row<br>
|
| 104 | Enter - switch to graphics viewer<br>
|
| 105 | <br>
|
| 106 | * Graphics mode:<br>
|
| 107 | [ ] - switch between different graphics sets<br>
|
| 108 | Up/Down - scroll up/down one line at a time<br>
|
| 109 | Page Up/Page Down - scroll up/down one page at a time<br>
|
| 110 | Home/End - move to top/bottom of list<br>
|
| 111 | Left/Right - change color displayed<br>
|
| 112 | R - rotate tiles 90 degrees clockwise<br>
|
| 113 | -/+ - increase/decrease the number of tiles per row<br>
|
| 114 | Enter - switch to tilemap viewer<br>
|
| 115 | <br>
|
| 116 | * Tilemap mode:<br>
|
| 117 | [ ] - switch between different tilemaps<br>
|
| 118 | Up/Down/Left/Right - scroll 8 pixels at a time<br>
|
| 119 | </span><span class="style2">Shift+Up/Down/Left/Right - scroll 1 pixel at a time<br>
|
| 120 | </span><span class="style2">Control+Up/Down/Left/Right - scroll 64 pixels at a time<br>
|
| 121 | R - rotate tilemap view 90 degrees clockwise<br>
|
| 122 | -/+ - increase/decrease the zoom factor<br>
|
| 123 | Enter - switch to palette/colortable mode<br>
|
| 124 | <br>
|
| 125 | Note: Not all games have decoded graphics and/or tilemaps.<br>
|
| 126 | <br>
|
| 127 | F6 Toggle cheat mode (if started with "-cheat").<br>
|
| 128 | <br>
|
| 129 | F7 Load a save state. You will be requested to press a key to<br>
|
| 130 | determine which save state you wish to load. Note that the save<br>
|
| 131 | state feature is not supported for a large number of drivers. If<br>
|
| 132 | support is not enabled for a given driver, you will receive a <br>
|
| 133 | warning when attempting to save or load.<br>
|
| 134 | <br>
|
| 135 | Shift+F7 Create a save state. Requires an additional keypress to identify<br>
|
| 136 | the state, similar to the load option above.<br>
|
| 137 | <br>
|
| 138 | F8 Decrease frame skip on the fly.<br>
|
| 139 | <br>
|
| 140 | F9 Increase frame skip on the fly.<br>
|
| 141 | <br>
|
| 142 | F10 Toggle speed throttling.<br>
|
| 143 | <br>
|
| 144 | F11 Toggles speed display.<br>
|
| 145 | <br>
|
| 146 | Shift+F11 Toggles profiler display (debug builds only).<br>
|
| 147 | <br>
|
| 148 | F12 Saves a screen snapshot.<br>
|
| 149 | <br>
|
| 150 | Insert Fast forward. While held, runs the game with throttling disabled<br>
|
| 151 | and with the maximum frameskip.<br>
|
| 152 | <br>
|
| 153 | Escape Exits emulator.<br>
|
| 154 | <br>
|
| 155 | <br>
|
| 156 | <br>
|
| 157 | <br>
|
| 158 | Core commands<br>
|
| 159 | -------------<br>
|
| 160 | <br>
|
| 161 | -help / -h / -?<br>
|
| 162 | <br>
|
| 163 | Displays current MAME version and copyright notice.<br>
|
| 164 | <br>
|
| 165 | -validate / -valid<br>
|
| 166 | <br>
|
| 167 | Performs internal validation on every driver in the system. Run this<br>
|
| 168 | before submitting changes to ensure that you haven't violated any of<br>
|
| 169 | the core system rules.<br>
|
| 170 | <br>
|
| 171 | <br>
|
| 172 | <br>
|
| 173 | Configuration commands<br>
|
| 174 | ----------------------<br>
|
| 175 | <br>
|
| 176 | </span></span></span>-<span class="style2"><span class="style1">createconfig / -cc<br>
|
| 177 | <br>
|
| 178 | Creates the default mame.ini file. All the configuration options<br>
|
| 179 | (not commands) described below can be permanently changed by editing <br>
|
| 180 | this configuration file.<br>
|
| 181 | <br>
|
| 182 | </span>
|
| 183 | </span>-<span class="style2"><span class="style1">showconfig / -sc<br>
|
| 184 | <br>
|
| 185 | Displays the current configuration settings. If you route this to a<br>
|
| 186 | file, you can use it as an INI file. For example, the command:<br>
|
| 187 | <br>
|
| 188 | mame -showconfig >mame.ini<br>
|
| 189 | <br>
|
| 190 | is equivalent to -createconfig.<br>
|
| 191 | <br>
|
| 192 | -showusage / -su<br>
|
| 193 | <br>
|
| 194 | Displays a summary of all the command line options. For options that<br>
|
| 195 | are not mentioned here, the short summary given by "mame -showusage" <br>
|
| 196 | is usually sufficient.<br>
|
| 197 | <br>
|
| 198 | <br>
|
| 199 | <br>
|
| 200 | Frontend commands<br>
|
| 201 | -----------------<br>
|
| 202 | <br>
|
| 203 | Note: By default, all the '-list' commands below write info to the screen.<br>
|
| 204 | If you wish to write the info to a textfile instead, add this to the end <br>
|
| 205 | of your command:<br>
|
| 206 | <br>
|
| 207 | > filename<br>
|
| 208 | <br>
|
| 209 | ...where 'filename' is the textfile's path and name <br>
|
| 210 | (e.g., c:\mame\list.txt).<br>
|
| 211 | <br>
|
| 212 | -listxml / -lx [<gamename|wildcard>]<br>
|
| 213 | <br>
|
| 214 | List comprehensive details for all of the supported games. The output<br>
|
| 215 | is quite long, so it is usually better to redirect this into a file. <br>
|
| 216 | The output is in XML format. By default all games are listed; however,<br>
|
| 217 | you can limit this list by specifying a driver name or wildcard after <br>
|
| 218 | the -listxml command.<br>
|
| 219 | <br>
|
| 220 | -listfull / -ll [<gamename|wildcard>]<br>
|
| 221 | <br>
|
| 222 | Displays a list of game driver names and descriptions. By default all<br>
|
| 223 | games are listed; however, you can limit this list by specifying a <br>
|
| 224 | driver name or wildcard after the -listfull command.<br>
|
| 225 | <br>
|
| 226 | </span>
|
| 227 | </span>-<span class="style2"><span class="style1">listsource / -ls [<gamename|wildcard>]<br>
|
| 228 | <br>
|
| 229 | Displays a list of drivers and the names of the source files their <br>
|
| 230 | game drivers live in. Useful for finding which driver a game runs on <br>
|
| 231 | in order to fix bugs. By default all games are listed; however, you <br>
|
| 232 | can limit this list by specifying a driver name or wildcard after <br>
|
| 233 | the -listsource command.<br>
|
| 234 | <br>
|
| 235 | -listclones / -lc [<gamename|wildcard>]<br>
|
| 236 | <br>
|
| 237 | Displays a list of clones. By default all clones are listed; however, <br>
|
| 238 | you can limit this list by specifying a driver name or wildcard after <br>
|
| 239 | the -listsource command.<br>
|
| 240 | <br>
|
| 241 | </span>
|
| 242 | </span>-<span class="style2"><span class="style1">listcrc<br>
|
| 243 | <br>
|
| 244 | Displays a full list of CRCs of all ROM images referenced by all<br>
|
| 245 | drivers within MAME.<br>
|
| 246 | <br>
|
| 247 | -listroms <gamename><br>
|
| 248 | <br>
|
| 249 | Displays a list of ROM images referenced by the specified game.<br>
|
| 250 | <br>
|
| 251 | -listsamples <gamename><br>
|
| 252 | <br>
|
| 253 | Displays a list of samples referenced by the specified game.<br>
|
| 254 | <br>
|
| 255 | -verifyroms [<gamename|wildcard>]<br>
|
| 256 | <br>
|
| 257 | Checks for invalid or missing ROM images. By default all drivers that<br>
|
| 258 | have valid ZIP files or directories in the rompath are verified; <br>
|
| 259 | however, you can limit this list by specifying a driver name or <br>
|
| 260 | wildcard after the -verifyroms command.<br>
|
| 261 | <br>
|
| 262 | -verifysamples [<gamename|wildcard>]<br>
|
| 263 | <br>
|
| 264 | Checks for invalid or missing samples. By default all drivers that<br>
|
| 265 | have valid ZIP files or directories in the samplepath are verified; <br>
|
| 266 | however, you can limit this list by specifying a driver name or <br>
|
| 267 | wildcard after the -verifyroms command.<br>
|
| 268 | <br>
|
| 269 | </span>
|
| 270 | </span>-<span class="style2"><span class="style1">romident<br>
|
| 271 | <br>
|
| 272 | Attempts to identify ROM files, if they are known to MAME, in the<br>
|
| 273 | specified .zip file or directory. This command can be used to try and <br>
|
| 274 | identify ROM sets taken from unknown boards. On exit, the errorlevel <br>
|
| 275 | is returned as one of the following:<br>
|
| 276 | <br>
|
| 277 | 0: means all files were identified<br>
|
| 278 | 7: means all files were identified except for 1 or more "non-ROM"<br>
|
| 279 | files<br>
|
| 280 | 8: means some files were identified<br>
|
| 281 | 9: means no files were identified<br>
|
| 282 | <br>
|
| 283 | <br>
|
| 284 | <br>
|
| 285 | Configuration options<br>
|
| 286 | ---------------------<br>
|
| 287 | <br>
|
| 288 | -[no]readconfig / -[no]rc<br>
|
| 289 | <br>
|
| 290 | Enables or disables the reading of the config files. When enabled<br>
|
| 291 | (which is the default), MAME reads the following config files in order:<br>
|
| 292 | <br>
|
| 293 | - mame.ini<br>
|
| 294 | - <mymame>.ini (i.e. if MAME was renamed mame060.exe, MAME<br>
|
| 295 | parses mame060.ini here)<br>
|
| 296 | - mamed.ini (if this is a debug build, i.e. mamed.exe)<br>
|
| 297 | - vector.ini (for vector games only)<br>
|
| 298 | - <driver>.ini (based on the source filename of the driver)<br>
|
| 299 | - <parent>.ini (for clones only, may be called recursively)<br>
|
| 300 | - <gamename>.ini<br>
|
| 301 | <br>
|
| 302 | The settings in the later ini's override those in the earlier ini's.<br>
|
| 303 | So, for example, if you wanted to disable overlay effects in the<br>
|
| 304 | vector games, you can create a vector.ini with the "effect none" line<br>
|
| 305 | in it, and it will override whatever effect value you have in your<br>
|
| 306 | mame.ini. The default is ON (-readconfig).<br>
|
| 307 | <br>
|
| 308 | <br>
|
| 309 | <br>
|
| 310 | Core search path options<br>
|
| 311 | ------------------------<br>
|
| 312 | <br>
|
| 313 | -rompath / -rp <path><br>
|
| 314 | <br>
|
| 315 | Specifies a list of paths within which to find ROM or hard disk images.<br>
|
| 316 | Multiple paths can be specified by separating them with semicolons.<br>
|
| 317 | The default is 'roms' (that is, a directory "roms" in the same directory<br>
|
| 318 | as the MAME executable).<br>
|
| 319 | <br>
|
| 320 | </span>
|
| 321 | </span>-<span class="style2"><span class="style1">samplepath / -sp <path><br>
|
| 322 | <br>
|
| 323 | Specifies a list of paths within which to find sample files. Multiple <br>
|
| 324 | paths can be specified by separating them with semicolons. The default <br>
|
| 325 | is 'samples' (that is, a directory "samples" in the same directory as<br>
|
| 326 | the MAME executable).<br>
|
| 327 | <br>
|
| 328 | </span>
|
| 329 | </span>-<span class="style2"><span class="style1">artpath / -artwork_directory <path><br>
|
| 330 | <br>
|
| 331 | Specifies a list of paths within which to find artwork files. Multiple <br>
|
| 332 | paths can be specified by separating them with semicolons. The default <br>
|
| 333 | is 'artwork' (that is, a directory "artwork" in the same directory as<br>
|
| 334 | the MAME executable).<br>
|
| 335 | <br>
|
| 336 | </span>
|
| 337 | </span>-<span class="style2"><span class="style1">ctrlrpath / -ctrlr_directory <path><br>
|
| 338 | <br>
|
| 339 | Specifies a list of paths within which to find controller-specific<br>
|
| 340 | configuration files. Multiple paths can be specified by separating <br>
|
| 341 | them with semicolons. The default is 'ctrlr' (that is, a directory <br>
|
| 342 | "ctrlr" in the same directory as the MAME executable).<br>
|
| 343 | <br>
|
| 344 | </span>
|
| 345 | </span>-<span class="style2"><span class="style1">inipath <path><br>
|
| 346 | <br>
|
| 347 | Specifies a list of paths within which to find .INI files. Multiple <br>
|
| 348 | paths can be specified by separating them with semicolons. The default <br>
|
| 349 | is '.;ini' (that is, search in the current directory first, and then<br>
|
| 350 | in the directory "ini" in the same directory as the MAME executable).<br>
|
| 351 | <br>
|
| 352 | </span>
|
| 353 | </span>-<span class="style2"><span class="style1">fontpath <path><br>
|
| 354 | <br>
|
| 355 | Specifies a list of paths within which to find .BDF font files. Multiple <br>
|
| 356 | paths can be specified by separating them with semicolons. The default <br>
|
| 357 | is '.' (that is, search in the same directory as the MAME executable).<br>
|
| 358 | <br>
|
| 359 | <br>
|
| 360 | <br>
|
| 361 | Core Output Directory Options<br>
|
| 362 | -----------------------------<br>
|
| 363 | <br>
|
| 364 | </span>
|
| 365 | </span>-<span class="style2"><span class="style1">cfg_directory <path><br>
|
| 366 | <br>
|
| 367 | Specifies a single directory where configuration files are stored.<br>
|
| 368 | Configuration files store user configurable settings that are read at<br>
|
| 369 | startup and written when MAME exits. The default is 'cfg' (that is,<br>
|
| 370 | a directory "cfg" in the same directory as the MAME executable). If <br>
|
| 371 | this directory does not exist, it will be automatically created.<br>
|
| 372 | <br>
|
| 373 | </span>
|
| 374 | </span>-<span class="style2"><span class="style1">nvram_directory <path><br>
|
| 375 | <br>
|
| 376 | Specifies a single directory where NVRAM files are stored. NVRAM files<br>
|
| 377 | store the contents of EEPROM and non-volatile RAM (NVRAM) for games<br>
|
| 378 | which used this type of hardware. This data is read at startup and <br>
|
| 379 | written when MAME exits. The default is 'nvram' (that is, a directory <br>
|
| 380 | "nvram" in the same directory as the MAME executable). If this <br>
|
| 381 | directory does not exist, it will be automatically created.<br>
|
| 382 | <br>
|
| 383 | </span>
|
| 384 | </span>-<span class="style2"><span class="style1">memcard_directory <path><br>
|
| 385 | <br>
|
| 386 | Specifies a single directory where memory card files are stored. <br>
|
| 387 | Memory card files store the contents of removable memory cards for <br>
|
| 388 | games which used this type of hardware. This data is read and written <br>
|
| 389 | under control of the user via the "Memory Card" menu in the user <br>
|
| 390 | interface. The default is 'memcard' (that is, a directory "memcard" <br>
|
| 391 | in the same directory as the MAME executable). If this directory does <br>
|
| 392 | not exist, it will be automatically created.<br>
|
| 393 | <br>
|
| 394 | </span>
|
| 395 | </span>-<span class="style2"><span class="style1">input_directory <path><br>
|
| 396 | <br>
|
| 397 | Specifies a single directory where input recording files are stored.<br>
|
| 398 | Input recordings are created via the -record option and played back <br>
|
| 399 | via the -playback option. The default is 'inp' (that is, a directory <br>
|
| 400 | "inp" in the same directory as the MAME executable). If this directory <br>
|
| 401 | does not exist, it will be automatically created.<br>
|
| 402 | <br>
|
| 403 | </span>
|
| 404 | </span>-<span class="style2"><span class="style1">state_directory <path><br>
|
| 405 | <br>
|
| 406 | Specifies a single directory where save state files are stored. Save<br>
|
| 407 | state files are read and written either upon user request, or when <br>
|
| 408 | using the -autosave option. The default is 'sta' (that is, a directory <br>
|
| 409 | </span>
|
| 410 | </span>"<span class="style2"><span class="style1">sta" in the same directory as the MAME executable). |
| 411 | If this directory <br>
|
| 412 | does not exist, it will be automatically created.<br>
|
| 413 | <br>
|
| 414 | </span>
|
| 415 | </span>-<span class="style2"><span class="style1">snapshot_directory <path><br>
|
| 416 | <br>
|
| 417 | Specifies a single directory where screen snapshots are stored, when<br>
|
| 418 | requested by the user. The default is 'snap' (that is, a directory <br>
|
| 419 | "snap" in the same directory as the MAME executable). If this <br>
|
| 420 | directory does not exist, it will be automatically created.<br>
|
| 421 | <br>
|
| 422 | -diff_directory <path><br>
|
| 423 | <br>
|
| 424 | Specifies a single directory where hard drive differencing files are <br>
|
| 425 | stored. Hard drive differencing files store any data that is written<br>
|
| 426 | back to a hard disk image, in order to preserve the original image. <br>
|
| 427 | The differencing files are created at startup when a game with a hard <br>
|
| 428 | disk image. The default is 'diff' (that is, a directory "diff" in the <br>
|
| 429 | same directory as the MAME executable). If this directory does not <br>
|
| 430 | exist, it will be automatically created.<br>
|
| 431 | <br>
|
| 432 | </span>
|
| 433 | </span>-<span class="style2"><span class="style1">comment_directory <path><br>
|
| 434 | <br>
|
| 435 | Specifies a single directory where debugger comment files are stored. <br>
|
| 436 | Debugger comment files are written by the debugger when comments are<br>
|
| 437 | added to the disassembly for a game. The default is 'comments' (that <br>
|
| 438 | is, a directory "comments" in the same directory as the MAME <br>
|
| 439 | executable). If this directory does not exist, it will be <br>
|
| 440 | automatically created.<br>
|
| 441 | <br>
|
| 442 | <br>
|
| 443 | <br>
|
| 444 | Core Filename Options<br>
|
| 445 | ---------------------<br>
|
| 446 | <br>
|
| 447 | </span>
|
| 448 | </span>-<span class="style2"><span class="style1">cheat_file <filename><br>
|
| 449 | <br>
|
| 450 | Specifies the name of the cheat database file. The default is <br>
|
| 451 | 'cheat.dat'.<br>
|
| 452 | <br>
|
| 453 | <br>
|
| 454 | <br>
|
| 455 | Core state/playback options<br>
|
| 456 | ---------------------------<br>
|
| 457 | <br>
|
| 458 | -state <slot><br>
|
| 459 | <br>
|
| 460 | Immediately after starting the specified game, will cause the save <br>
|
| 461 | state in the specified <slot> to be loaded.<br>
|
| 462 | <br>
|
| 463 | -[no]autosave<br>
|
| 464 | <br>
|
| 465 | When enabled, automatically creates a save state file when exiting <br>
|
| 466 | MAME and automatically attempts to reload it when later starting MAME <br>
|
| 467 | with the same game. This only works for games that have explicitly <br>
|
| 468 | enabled save state support in their driver. The default is OFF <br>
|
| 469 | (-noautosave).<br>
|
| 470 | <br>
|
| 471 | -playback / -pb <filename><br>
|
| 472 | <br>
|
| 473 | Specifies a file from which to play back a series of game inputs. This<br>
|
| 474 | feature does not work reliably for all games, but can be used to watch<br>
|
| 475 | a previously recorded game session from start to finish. In order to<br>
|
| 476 | make things consistent, you should only record and playback with all<br>
|
| 477 | configuration (.cfg), NVRAM (.nv), and memory card files deleted. The<br>
|
| 478 | default is NULL (no playback).<br>
|
| 479 | <br>
|
| 480 | -record / -rec <filename><br>
|
| 481 | <br>
|
| 482 | Specifies a file to record all input from a game session. This can be<br>
|
| 483 | used to record a game session for later playback. This feature does <br>
|
| 484 | not work reliably for all games, but can be used to watch a previously <br>
|
| 485 | recorded game session from start to finish. In order to make things <br>
|
| 486 | consistent, you should only record and playback with all configuration <br>
|
| 487 | (.cfg), NVRAM (.nv), and memory card files deleted. The default is <br>
|
| 488 | NULL (no recording).<br>
|
| 489 | <br>
|
| 490 | </span>
|
| 491 | </span>-<span class="style2"><span class="style1">mngwrite <filename><br>
|
| 492 | <br>
|
| 493 | Writes each video frame to the given <filename> in MNG format, <br>
|
| 494 | producing an animation of the game session. Note that -mngwrite only <br>
|
| 495 | writes video frames; it does not save any audio data. Use -wavwrite <br>
|
| 496 | for that, and reassemble the audio/video using offline tools. The <br>
|
| 497 | default is NULL (no recording).<br>
|
| 498 | <br>
|
| 499 | </span>
|
| 500 | </span>-<span class="style2"><span class="style1">wavwrite <filename><br>
|
| 501 | <br>
|
| 502 | Writes the final mixer output to the given <filename> in WAV format, <br>
|
| 503 | producing an audio recording of the game session. The default is <br>
|
| 504 | NULL (no recording).<br>
|
| 505 | <br>
|
| 506 | <br>
|
| 507 | <br>
|
| 508 | Core performance options<br>
|
| 509 | ------------------------<br>
|
| 510 | <br>
|
| 511 | -[no]autoframeskip / -[no]afs<br>
|
| 512 | <br>
|
| 513 | Automatically determines the frameskip level while you're playing the<br>
|
| 514 | game, adjusting it constantly in a frantic attempt to keep the game<br>
|
| 515 | running at full speed. Turning this on overrides the value you have <br>
|
| 516 | set for -frameskip below. The default is OFF (-noautoframeskip).<br>
|
| 517 | <br>
|
| 518 | -frameskip / -fs <level><br>
|
| 519 | <br>
|
| 520 | Specifies the frameskip value. This is the number of frames out of<br>
|
| 521 | every 12 to drop when running. For example, if you say -frameskip 2,<br>
|
| 522 | then MAME will display 10 out of every 12 frames. By skipping those<br>
|
| 523 | frames, you may be able to get full speed in a game that requires more<br>
|
| 524 | horsepower than your computer has. The default value is -frameskip 0,<br>
|
| 525 | which skips no frames.<br>
|
| 526 | <br>
|
| 527 | </span>
|
| 528 | </span>-<span class="style2"><span class="style1">seconds_to_run / -str <seconds><br>
|
| 529 | <br>
|
| 530 | This option can be used for benchmarking and automated testing. It tells <br>
|
| 531 | MAME to stop execution after a fixed number of seconds. By combining <br>
|
| 532 | this with a fixed set of other command line options, you can set up a <br>
|
| 533 | consistent environment for benchmarking MAME performance. In addition, <br>
|
| 534 | upon exit, the -str option will write a screenshot called final.png<br>
|
| 535 | to the game's snapshot directory.<br>
|
| 536 | <br>
|
| 537 | -[no]throttle<br>
|
| 538 | <br>
|
| 539 | Configures the default thottling setting. When throttling is on, MAME<br>
|
| 540 | attempts to keep the game running at the game's intended speed. When<br>
|
| 541 | throttling is off, MAME runs the game as fast as it can. Note that the<br>
|
| 542 | fastest speed is more often than not limited by your graphics card,<br>
|
| 543 | especially for older games. The default is ON (-throttle).<br>
|
| 544 | <br>
|
| 545 | -[no]sleep<br>
|
| 546 | <br>
|
| 547 | Allows MAME to give time back to the system when running with -throttle.<br>
|
| 548 | This allows other programs to have some CPU time, assuming that the<br>
|
| 549 | game isn't taxing 100% of your CPU resources. This option can <br>
|
| 550 | potentially cause hiccups in performance if other demanding programs<br>
|
| 551 | are running. The default is ON (-sleep).<br>
|
| 552 | <br>
|
| 553 | <br>
|
| 554 | <br>
|
| 555 | Core rotation options<br>
|
| 556 | ---------------------<br>
|
| 557 | <br>
|
| 558 | -[no]rotate<br>
|
| 559 | <br>
|
| 560 | Rotate the game to match its normal state (horizontal/vertical). This<br>
|
| 561 | ensures that both vertically and horizontally oriented games show up<br>
|
| 562 | correctly without the need to rotate your monitor. If you want to keep <br>
|
| 563 | the game displaying 'raw' on the screen the way it would have in the <br>
|
| 564 | arcade, turn this option OFF. The default is ON (-rotate).<br>
|
| 565 | <br>
|
| 566 | -[no]ror<br>
|
| 567 | -[no]rol<br>
|
| 568 | <br>
|
| 569 | Rotate the game screen to the right (clockwise) or left (counter-<br>
|
| 570 | clockwise) relative to either its normal state (if -rotate is <br>
|
| 571 | specified) or its native state (if -norotate is specified). The <br>
|
| 572 | default for both of these options is OFF (-noror -norol).<br>
|
| 573 | <br>
|
| 574 | -[no]flipx<br>
|
| 575 | -[no]flipy<br>
|
| 576 | <br>
|
| 577 | Flip (mirror) the game screen either horizontally (-flipx) or <br>
|
| 578 | vertically (-flipy). The flips are applied after the -rotate and <br>
|
| 579 | </span>
|
| 580 | </span>-<span class="style2"><span class="style1">ror/-rol options are applied. The default for both |
| 581 | of these options <br>
|
| 582 | is OFF (-noflipx -noflipy).<br>
|
| 583 | <br>
|
| 584 | -[no]autoror<br>
|
| 585 | -[no]autorol<br>
|
| 586 | <br>
|
| 587 | These options are designed for use with pivoting screens that only<br>
|
| 588 | pivot in a single direction. If your screen only pivots clockwise,<br>
|
| 589 | use -autorol to ensure that the game will fill the screen either<br>
|
| 590 | horizontally or vertically in one of the directions you can handle.<br>
|
| 591 | If your screen only pivots counter-clockwise, use -autoror.<br>
|
| 592 | <br>
|
| 593 | <br>
|
| 594 | <br>
|
| 595 | Core artwork options<br>
|
| 596 | --------------------<br>
|
| 597 | <br>
|
| 598 | -[no]artwork_crop / -[no]artcrop<br>
|
| 599 | <br>
|
| 600 | Enable cropping of artwork to the game screen area only. This works<br>
|
| 601 | best with -video gdi or -video d3d, and means that vertically oriented<br>
|
| 602 | games running full screen can display their artwork to the left and <br>
|
| 603 | right sides of the screen. This does not work with -video ddraw <br>
|
| 604 | because of the way the game screens are rendered and scaled after the <br>
|
| 605 | fact. This option can also be controlled via the Video Options menu in <br>
|
| 606 | the user interface. The default is OFF (-noartwork_crop).<br>
|
| 607 | <br>
|
| 608 | -[no]use_backdrops / -[no]backdrop<br>
|
| 609 | <br>
|
| 610 | Enables/disables the display of backdrops. The default is ON<br>
|
| 611 | (-use_backdrops).<br>
|
| 612 | <br>
|
| 613 | -[no]use_overlays / -[no]overlay<br>
|
| 614 | <br>
|
| 615 | Enables/disables the display of overlays. The default is ON<br>
|
| 616 | (-use_overlays).<br>
|
| 617 | <br>
|
| 618 | -[no]use_bezels / -[no]bezel<br>
|
| 619 | <br>
|
| 620 | Enables/disables the display of bezels. The default is ON<br>
|
| 621 | (-use_bezels).<br>
|
| 622 | <br>
|
| 623 | <br>
|
| 624 | <br>
|
| 625 | Core screen options<br>
|
| 626 | -------------------<br>
|
| 627 | <br>
|
| 628 | -brightness <value><br>
|
| 629 | <br>
|
| 630 | Controls the default brightness, or black level, of the game screens. <br>
|
| 631 | This option does not affect the artwork or other parts of the display.<br>
|
| 632 | Using the MAME UI, you can individually set the brightness for each <br>
|
| 633 | game screen; this option controls the initial value for all visible <br>
|
| 634 | game screens. The standard value is 1.0. Selecting lower values (down <br>
|
| 635 | to 0.1) will produce a darkened display, while selecting higher values <br>
|
| 636 | (up to 2.0) will give a brighter display. The default is 1.0.<br>
|
| 637 | <br>
|
| 638 | -contrast <value><br>
|
| 639 | <br>
|
| 640 | Controls the contrast, or white level, of the game screens. This <br>
|
| 641 | option does not affect the artwork or other parts of the display. <br>
|
| 642 | Using the MAME UI, you can individually set the contrast for each <br>
|
| 643 | game screen; this option controls the initial value for all visible <br>
|
| 644 | game screens. The standard value is 1.0. Selecting lower values (down <br>
|
| 645 | to 0.1) will produce a dimmer display, while selecting higher values <br>
|
| 646 | (up to 2.0) will give a more saturated display. The default is 1.0.<br>
|
| 647 | <br>
|
| 648 | -gamma <value><br>
|
| 649 | <br>
|
| 650 | Controls the gamma, which produces a potentially nonlinear black to<br>
|
| 651 | white ramp, for the game screens. This option does not affect the <br>
|
| 652 | artwork or other parts of the display. Using the MAME UI, you can <br>
|
| 653 | individually set the gamma for each game screen; this option controls <br>
|
| 654 | the initial value for all visible game screens. The standard value is <br>
|
| 655 | 1.0, which gives a linear ramp from black to white. Selecting lower <br>
|
| 656 | values (down to 0.1) will increase the nonlinearity toward black, <br>
|
| 657 | while selecting higher values (up to 3.0) will push the nonlinearity <br>
|
| 658 | toward white. The default is 1.0.<br>
|
| 659 | <br>
|
| 660 | -pause_brightness <value><br>
|
| 661 | <br>
|
| 662 | This controls the brightness level when MAME is paused. The default<br>
|
| 663 | value is 0.65.<br>
|
| 664 | <br>
|
| 665 | <br>
|
| 666 | <br>
|
| 667 | Core vector options<br>
|
| 668 | -------------------<br>
|
| 669 | <br>
|
| 670 | -[no]antialias / -[no]aa<br>
|
| 671 | <br>
|
| 672 | Enables antialiased line rendering for vector games. The default is ON<br>
|
| 673 | (-antialias).<br>
|
| 674 | <br>
|
| 675 | -beam <width><br>
|
| 676 | <br>
|
| 677 | Sets the width of the vectors. This is a scaling factor against the<br>
|
| 678 | standard vector width. A value of 1.0 will keep the default vector <br>
|
| 679 | line width. Smaller values will reduce the width, and larger values <br>
|
| 680 | will increase the width. The default is 1.0.<br>
|
| 681 | <br>
|
| 682 | -flicker <value><br>
|
| 683 | <br>
|
| 684 | Simulates a vector "flicker" effect, similar to a vector monitor that<br>
|
| 685 | needs adjustment. This option requires a float argument in the range <br>
|
| 686 | of 0.00 - 100.00 (0=none, 100=maximum). The default is 0.<br>
|
| 687 | <br>
|
| 688 | <br>
|
| 689 | <br>
|
| 690 | Core sound options<br>
|
| 691 | ------------------<br>
|
| 692 | <br>
|
| 693 | -[no]sound<br>
|
| 694 | <br>
|
| 695 | Enable or disable sound altogether. The default is ON (-sound).<br>
|
| 696 | <br>
|
| 697 | -samplerate <value> / -sr <value><br>
|
| 698 | <br>
|
| 699 | Sets the audio sample rate. Smaller values (e.g. 11025) cause lower<br>
|
| 700 | audio quality but faster emulation speed. Higher values (e.g. 48000)<br>
|
| 701 | cause higher audio quality but slower emulation speed. The default is<br>
|
| 702 | 48000.<br>
|
| 703 | <br>
|
| 704 | -[no]samples<br>
|
| 705 | <br>
|
| 706 | Use samples if available. The default is ON (-samples).<br>
|
| 707 | <br>
|
| 708 | -volume / -vol <value><br>
|
| 709 | <br>
|
| 710 | Sets the startup volume. It can later be changed with the user <br>
|
| 711 | interface (see Keys section). The volume is an attenuation in dB: <br>
|
| 712 | e.g., "-volume -12" will start with -12dB attenuation. The default <br>
|
| 713 | is 0.<br>
|
| 714 | <br>
|
| 715 | <br>
|
| 716 | <br>
|
| 717 | Core input options<br>
|
| 718 | ------------------<br>
|
| 719 | <br>
|
| 720 | -ctrlr <controller><br>
|
| 721 | <br>
|
| 722 | Enables support for special controllers. Configuration files are<br>
|
| 723 | loaded from the ctrlrpath. They are in the same format as the .cfg<br>
|
| 724 | files that are saved, but only control configuration data is read<br>
|
| 725 | from the file. The default is NULL (no controller file).<br>
|
| 726 | <br>
|
| 727 | -[no]mouse<br>
|
| 728 | <br>
|
| 729 | Controls whether or not MAME makes use of mouse controllers. When<br>
|
| 730 | this is enabled, you will likely be unable to use your mouse for other<br>
|
| 731 | purposes until you exit or pause the game. The default is OFF <br>
|
| 732 | (-nomouse).<br>
|
| 733 | <br>
|
| 734 | -[no]joystick / -[no]joy<br>
|
| 735 | <br>
|
| 736 | Controls whether or not MAME makes use of joystick/gamepad controllers.<br>
|
| 737 | When this is enabled, MAME will ask DirectInput about which <br>
|
| 738 | controllers are connected. The default is OFF (-nojoystick).<br>
|
| 739 | <br>
|
| 740 | -[no]lightgun / -[no]gun<br>
|
| 741 | <br>
|
| 742 | Controls whether or not MAME makes use of lightgun controllers.<br>
|
| 743 | Note that most lightguns map to the mouse, so using -lightgun and<br>
|
| 744 | -mouse together may produce strange results. The default is OFF<br>
|
| 745 | (-nolightgun).<br>
|
| 746 | <br>
|
| 747 | -[no]multikeyboard / -[no]multikey<br>
|
| 748 | <br>
|
| 749 | Determines whether MAME differentiates between multiple keyboards.<br>
|
| 750 | Some systems may report more than one keyboard; by default, the data<br>
|
| 751 | from all of these keyboards is combined so that it looks like a single<br>
|
| 752 | keyboard. Turning this option on will enable MAME to report keypresses<br>
|
| 753 | on different keyboards independently. The default is OFF <br>
|
| 754 | (-nomultikeyboard).<br>
|
| 755 | <br>
|
| 756 | -[no]multimouse<br>
|
| 757 | <br>
|
| 758 | Determines whether MAME differentiates between multiple mice. Some <br>
|
| 759 | systems may report more than one mouse device; by default, the data<br>
|
| 760 | from all of these mice is combined so that it looks like a single<br>
|
| 761 | mouse. Turning this option on will enable MAME to report mouse <br>
|
| 762 | movement and button presses on different mice independently. The <br>
|
| 763 | default is OFF (-nomultimouse).<br>
|
| 764 | <br>
|
| 765 | -[no]steadykey / -[no]steady<br>
|
| 766 | <br>
|
| 767 | Some games require two or more buttons to be pressed at exactly the<br>
|
| 768 | same time to make special moves. Due to limitations in the keyboard<br>
|
| 769 | hardware, it can be difficult or even impossible to accomplish that<br>
|
| 770 | using the standard keyboard handling. This option selects a different<br>
|
| 771 | handling that makes it easier to register simultaneous button presses,<br>
|
| 772 | but has the disadvantage of making controls less responsive. The<br>
|
| 773 | default is OFF (-nosteadykey)<br>
|
| 774 | <br>
|
| 775 | -[no]offscreen_reload / -[no]reload<br>
|
| 776 | <br>
|
| 777 | Controls whether or not MAME treats a second button input from a<br>
|
| 778 | lightgun as a reload signal. In this case, MAME will report the gun's<br>
|
| 779 | position as (0,MAX) with the trigger held, which is equivalent to an<br>
|
| 780 | offscreen reload. This is only needed for games that required you to <br>
|
| 781 | shoot offscreen to reload, and then only if your gun does not support <br>
|
| 782 | off screen reloads. The default is OFF (-nooffscreen_reload).<br>
|
| 783 | <br>
|
| 784 | </span>
|
| 785 | </span>-<span class="style2"><span class="style1">joystick_map <map> / -joymap <map><br>
|
| 786 | <br>
|
| 787 | Controls how joystick values map to digital joystick controls. MAME<br>
|
| 788 | accepts all joystick input from the system as analog data. For true<br>
|
| 789 | analog joysticks, this needs to be mapped down to the usual 4-way or<br>
|
| 790 | 8-way digital joystick values. To do this, MAME divides the analog<br>
|
| 791 | range into a 9x9 grid. It then takes the joystick axis position (for<br>
|
| 792 | X and Y axes only), maps it to this grid, and then looks up a <br>
|
| 793 | translation from a joystick map. This parameter allows you to specify<br>
|
| 794 | the map. The default is 'auto', which means that a standard 8-way,<br>
|
| 795 | 4-way, or 4-way diagonal map is selected automatically based on the<br>
|
| 796 | input port configuration of the current game.<br>
|
| 797 | <br>
|
| 798 | Maps are defined as a string of numbers and characters. Since the grid<br>
|
| 799 | is 9x9, there are a total of 81 characters necessary to define a<br>
|
| 800 | complete map. Below is an example map for an 8-way joystick:<br>
|
| 801 | <br>
|
| 802 | 777888999 Note that the numeric digits correspond to the keys<br>
|
| 803 | 777888999 on a numeric keypad. So '7' maps to up+left, '4' maps<br>
|
| 804 | 777888999 to left, '5' maps to neutral, etc. In addition to the<br>
|
| 805 | 444555666 numeric values, you can specify the character 's',<br>
|
| 806 | 444555666 which means "sticky". In this case, the value of the<br>
|
| 807 | 444555666 map is the same as it was the last time a non-sticky<br>
|
| 808 | 111222333 value was read.<br>
|
| 809 | 111222333<br>
|
| 810 | 111222333<br>
|
| 811 | <br>
|
| 812 | To specify the map for this parameter, you can specify a string of<br>
|
| 813 | rows separated by a '.' (which indicates the end of a row), like so:<br>
|
| 814 | <br>
|
| 815 | 777888999.777888999.777888999.444555666.444555666.444555666.<br>
|
| 816 | 111222333.111222333.111222333<br>
|
| 817 | <br>
|
| 818 | However, this can be reduced using several shorthands supported by the<br>
|
| 819 | <map> parameter. If information about a row is missing, then it is <br>
|
| 820 | assumed that any missing data in columns 5-9 are left/right symmetric <br>
|
| 821 | with data in columns 0-4; and any missing data in colums 0-4 is <br>
|
| 822 | assumed to be copies of the previous data. The same logic applies to<br>
|
| 823 | missing rows, except that up/down symmetry is assumed.<br>
|
| 824 | <br>
|
| 825 | By using these shorthands, the 81 character map can be simply <br>
|
| 826 | specified by this 11 character string: 7778...4445<br>
|
| 827 | <br>
|
| 828 | Looking at the first row, 7778 is only 4 characters long. The 5th <br>
|
| 829 | entry can't use symmetry, so it is assumed to be equal to the previous<br>
|
| 830 | character '8'. The 6th character is left/right symmetric with the 4th <br>
|
| 831 | character, giving an '8'. The 7th character is left/right symmetric<br>
|
| 832 | with the 3rd character, giving a '9' (which is '7' with left/right<br>
|
| 833 | flipped). Eventually this gives the full 777888999 string of the row.<br>
|
| 834 | <br>
|
| 835 | The second and third rows are missing, so they are assumed to be <br>
|
| 836 | identical to the first row. The fourth row decodes similarly to the<br>
|
| 837 | first row, producing 444555666. The fifth row is missing so it is<br>
|
| 838 | assumed to be the same as the fourth.<br>
|
| 839 | <br>
|
| 840 | The remaining three rows are also missing, so they are assumed to be<br>
|
| 841 | the up/down mirrors of the first three rows, giving three final rows<br>
|
| 842 | of 111222333.<br>
|
| 843 | <br>
|
| 844 | </span>
|
| 845 | </span>-<span class="style2"><span class="style1">joystick_deadzone <value> / -joy_deadzone <value> / |
| 846 | -jdz <value><br>
|
| 847 | <br>
|
| 848 | If you play with an analog joystick, the center can drift a little.<br>
|
| 849 | joystick_deadzone tells how far along an axis you must move before the<br>
|
| 850 | axis starts to change. This option expects a float in the range of<br>
|
| 851 | 0.0 to 1.0. Where 0 is the center of the joystick and 1 is the outer<br>
|
| 852 | limit. The default is 0.3.<br>
|
| 853 | <br>
|
| 854 | </span>
|
| 855 | </span>-<span class="style2"><span class="style1">joystick_saturation <value> / joy_saturation |
| 856 | <value> / -jsat <value><br>
|
| 857 | <br>
|
| 858 | If you play with an analog joystick, the ends can drift a little,<br>
|
| 859 | and may not match in the +/- directions. joystick_saturation tells how <br>
|
| 860 | far along an axis movement change will be accepted before it reaches <br>
|
| 861 | the maximum range. This option expects a float in the range of 0.0 to <br>
|
| 862 | 1.0, where 0 is the center of the joystick and 1 is the outer limit.<br>
|
| 863 | The default is 0.85.<br>
|
| 864 | <br>
|
| 865 | <br>
|
| 866 | <br>
|
| 867 | Core input automatic enable options<br>
|
| 868 | -----------------------------------<br>
|
| 869 | <br>
|
| 870 | </span>
|
| 871 | </span>-<span class="style2"><span class="style1">paddle_device <keyboard|mouse|joystick|lightgun|none> |
| 872 | / -paddle<br>
|
| 873 | </span>
|
| 874 | </span>-<span class="style2"><span class="style1">adstick_device <keyboard|mouse|joystick|lightgun|none> |
| 875 | / -adstick<br>
|
| 876 | </span>
|
| 877 | </span>-<span class="style2"><span class="style1">pedal_device <keyboard|mouse|joystick|lightgun|none> |
| 878 | / -pedal<br>
|
| 879 | </span>
|
| 880 | </span>-<span class="style2"><span class="style1">dial_device <keyboard|mouse|joystick|lightgun|none> |
| 881 | / -dial<br>
|
| 882 | </span>
|
| 883 | </span>-<span class="style2"><span class="style1">trackball_device <keyboard|mouse|joystick|lightgun|none> |
| 884 | / -trackball<br>
|
| 885 | </span>
|
| 886 | </span>-<span class="style2"><span class="style1">lightgun_device <keyboard|mouse|joystick|lightgun|none><br>
|
| 887 | </span>
|
| 888 | </span>-<span class="style2"><span class="style1">positional_device <keyboard|mouse|joystick|lightgun|none><br>
|
| 889 | <br>
|
| 890 | Each of these options controls autoenabling the mouse, joystick, or<br>
|
| 891 | lightgun depending on the presence of a particular class of analog<br>
|
| 892 | control for a particular game. For example, if you specify the option<br>
|
| 893 | -paddle mouse, then any game that has a paddle control will <br>
|
| 894 | automatically enable mouse controls just as if you had explicitly <br>
|
| 895 | specified -mouse. Note that these controls override the values of <br>
|
| 896 | -[no]mouse, -[no]joystick, etc.<br>
|
| 897 | <br>
|
| 898 | <br>
|
| 899 | <br>
|
| 900 | Debugging options<br>
|
| 901 | -----------------<br>
|
| 902 | <br>
|
| 903 | -[no]log<br>
|
| 904 | <br>
|
| 905 | Creates a file called error.log which contains all of the internal<br>
|
| 906 | log messages generated by the MAME core and game drivers. The default <br>
|
| 907 | is OFF (-nolog).<br>
|
| 908 | <br>
|
| 909 | -[no]verbose / -[no]v<br>
|
| 910 | <br>
|
| 911 | Displays internal diagnostic information. This information is very <br>
|
| 912 | useful for debugging problems with your configuration. IMPORTANT: when<br>
|
| 913 | reporting bugs, please run with mame -verbose and include the <br>
|
| 914 | resulting information. The default is OFF (-noverbose).<br>
|
| 915 | <br>
|
| 916 | -[no]debug<br>
|
| 917 | <br>
|
| 918 | Activates the integrated debugger. This is available only if the <br>
|
| 919 | program is compiled with MAME_DEBUG defined. By default, the debugger <br>
|
| 920 | is entered by pressing the tilde (~) key during emulation. It is also<br>
|
| 921 | entered immediately at startup. The default is ON (-debug).<br>
|
| 922 | <br>
|
| 923 | </span>
|
| 924 | </span>-<span class="style2"><span class="style1">debugscript <filename><br>
|
| 925 | <br>
|
| 926 | Specifies a file that contains a list of debugger commands to execute<br>
|
| 927 | immediately upon startup. The default is NULL (no commands).<br>
|
| 928 | <br>
|
| 929 | <br>
|
| 930 | <br>
|
| 931 | Core misc options<br>
|
| 932 | -----------------<br>
|
| 933 | <br>
|
| 934 | -bios <biosname><br>
|
| 935 | <br>
|
| 936 | Specifies the specific BIOS to use with the current game, for game<br>
|
| 937 | systems that make use of a BIOS. The -listxml output will list all of<br>
|
| 938 | the possible BIOS names for a game. The default is 'default'.<br>
|
| 939 | <br>
|
| 940 | -[no]cheat / -[no]c<br>
|
| 941 | <br>
|
| 942 | Enables the reading of the cheat database, if present, and the Cheat<br>
|
| 943 | menu in the user interface. The default is OFF (-nocheat).<br>
|
| 944 | <br>
|
| 945 | -[no]skip_gameinfo<br>
|
| 946 | <br>
|
| 947 | Forces MAME to skip displaying the game info screen. The default is <br>
|
| 948 | OFF (-noskip_gameinfo).<br>
|
| 949 | </span>
|
| 950 | </span></h1>
|
| 951 | |
| 952 | </div>
|
| 953 | <p><span class="style3"><span class="style4"><strong><span class="style1">
|
| 954 | <span class="style2">This file describes |
| 955 | Windows-specific usage information about MAME. It is <br>
|
| 956 | intended to cover aspects of using and configuring the program that are <br>
|
| 957 | specific to running MAME from the command line on a Windows-based system.<br>
|
| 958 | For common options that apply to all systems, please see config.txt.</span></span></strong><span class="style1"><span class="style2"><br>
|
| 959 | <br>
|
| 960 | <br>
|
| 961 | <br>
|
| 962 | Default Keys<br>
|
| 963 | ------------<br>
|
| 964 | <br>
|
| 965 | In addition to the keys described in config.txt, the following additional<br>
|
| 966 | keys are defined for Windows versions of MAME:<br>
|
| 967 | <br>
|
| 968 | <br>
|
| 969 | Alt+Enter Toggles between full-screen and windowed |
| 970 | mode.<br>
|
| 971 | <br>
|
| 972 | <br>
|
| 973 | <br>
|
| 974 | Windows debugging options<br>
|
| 975 | -------------------------<br>
|
| 976 | <br>
|
| 977 | -[no]oslog<br>
|
| 978 | <br>
|
| 979 | Outputs the error.log data to the Windows debugger. This can be used at<br>
|
| 980 | the same time as -log to output the log data to both targets as well.<br>
|
| 981 | Default is OFF (-nooslog).<br>
|
| 982 | <br>
|
| 983 | <br>
|
| 984 | <br>
|
| 985 | Windows performance options<br>
|
| 986 | ---------------------------<br>
|
| 987 | <br>
|
| 988 | -priority <priority><br>
|
| 989 | <br>
|
| 990 | Sets the thread priority for the MAME threads. By default the priority<br>
|
| 991 | is left alone to guarantee proper cooperation with other applications. <br>
|
| 992 | The valid range is -15 to 1, with 1 being the highest priority. The <br>
|
| 993 | default is 0 (NORMAL priority).<br>
|
| 994 | <br>
|
| 995 | -[no]multithreading / -[no]mt<br>
|
| 996 | <br>
|
| 997 | Enables multithreading within MAME. At the moment, this causes the <br>
|
| 998 | window and all DirectDraw/Direct3D code to execute on a second thread, <br>
|
| 999 | which can improve performance on hyperthreaded and multicore systems. <br>
|
| 1000 | The default is OFF (-nomultithreading).<br>
|
| 1001 | <br>
|
| 1002 | <br>
|
| 1003 | <br>
|
| 1004 | Windows video options<br>
|
| 1005 | ---------------------<br>
|
| 1006 | <br>
|
| 1007 | -video <gdi|ddraw|d3d|none><br>
|
| 1008 | <br>
|
| 1009 | Specifies which video subsystem to use for drawing. By specifying 'gdi'<br>
|
| 1010 | here, you tell MAME to render video using standard Windows graphics<br>
|
| 1011 | drawing calls. This is the slowest but most compatible option. <br>
|
| 1012 | Specifying 'ddraw' instructs MAME to use DirectDraw for rendering. <br>
|
| 1013 | This causes MAME to render everything at a lower resolution and then <br>
|
| 1014 | upscale the results at the end. This produces high performance, <br>
|
| 1015 | especially on older or low-power video cards, but has a noticeably <br>
|
| 1016 | lower output quality. Specifying 'd3d' tells MAME to use Direct3D for <br>
|
| 1017 | rendering. This produces the highest quality output and enables all <br>
|
| 1018 | rendering options. It is recommended if you have a recent (2002+) <br>
|
| 1019 | video card. The final option 'none' displays no windows and does no <br>
|
| 1020 | drawing. This is primarily present for doing CPU benchmarks without <br>
|
| 1021 | the overhead of the video system. The default is d3d.<br>
|
| 1022 | <br>
|
| 1023 | -numscreens <count><br>
|
| 1024 | <br>
|
| 1025 | Tells MAME how many output windows to create. For most games, a single<br>
|
| 1026 | output window is all you need, but some games originally used multiple<br>
|
| 1027 | screens. Each screen (up to 4) has its own independent settings for<br>
|
| 1028 | physical monitor, aspect ratio, resolution, and view, which can be<br>
|
| 1029 | set using the options below. The default is 1.<br>
|
| 1030 | <br>
|
| 1031 | -[no]window<br>
|
| 1032 | <br>
|
| 1033 | Run MAME in either a window or full screen. The default is OFF<br>
|
| 1034 | (-nowindow).<br>
|
| 1035 | <br>
|
| 1036 | -[no]maximize / -[no]max<br>
|
| 1037 | <br>
|
| 1038 | Controls initial window size in windowed mode. If it is set on, the<br>
|
| 1039 | window will initially be set to the maximum supported size when you<br>
|
| 1040 | start MAME. If it is turned off, the window will start out at the<br>
|
| 1041 | smallest supported size. This option only has an effect when the <br>
|
| 1042 | -window option is used. The default is ON (-maximize).<br>
|
| 1043 | <br>
|
| 1044 | -[no]keepaspect / -[no]ka<br>
|
| 1045 | <br>
|
| 1046 | Enables aspect ratio enforcement. When this option is on, the game's<br>
|
| 1047 | proper aspect ratio (generally 4:3 or 3:4) is enforced, so you get the<br>
|
| 1048 | game looking like it should. When running in a window with this option<br>
|
| 1049 | on, you can only resize the window to the proper aspect ratio, unless<br>
|
| 1050 | you are holding down the CONTROL key. By turning the option off, the<br>
|
| 1051 | aspect ratio is allowed to float. In full screen mode, this means that<br>
|
| 1052 | all games will stretch to the full screen size (even vertical games).<br>
|
| 1053 | In window mode, it means that you can freely resize the window without<br>
|
| 1054 | any constraints. The default is ON (-keepaspect).<br>
|
| 1055 | <br>
|
| 1056 | -prescale <amount><br>
|
| 1057 | <br>
|
| 1058 | Controls the size of the screen images when they are passed off to the<br>
|
| 1059 | graphics system for scaling. At the minimum setting of 1, the screen<br>
|
| 1060 | is rendered at its original resolution before being scaled. At higher<br>
|
| 1061 | settings, the screen is expanded by a factor of <amount> before being<br>
|
| 1062 | scaled. With -video ddraw or -video d3d, this produces a less blurry<br>
|
| 1063 | image at the expense of some speed. In -video ddraw mode, this also<br>
|
| 1064 | increases the effective resolution of non-screen elements such as <br>
|
| 1065 | artwork and fonts. The default is 1.<br>
|
| 1066 | <br>
|
| 1067 | -effect <filename><br>
|
| 1068 | <br>
|
| 1069 | Specifies a single PNG file that is used as an overlay over any game<br>
|
| 1070 | screens in the video display. This PNG file is assumed to live in the<br>
|
| 1071 | root of one of the artpath directories. The pattern in the PNG file is <br>
|
| 1072 | repeated both horizontally and vertically to cover the entire game <br>
|
| 1073 | screen areas (but not any external artwork), and is rendered at<br>
|
| 1074 | the target resolution of the game image. For -video gdi and -video d3d<br>
|
| 1075 | modes, this means that one pixel in the PNG will map to one pixel on<br>
|
| 1076 | your output display. For -video ddraw, this means that one pixel in the<br>
|
| 1077 | PNG will map to one pixel in the prescaled game screen. If you wish to<br>
|
| 1078 | use an effect that requires mapping n PNG pixels to each game screen<br>
|
| 1079 | pixel with -video ddraw, you need to specify a -prescale factor of n as<br>
|
| 1080 | well. The RGB values of each pixel in the PNG are multiplied against the<br>
|
| 1081 | RGB values of the target screen. The default is 'none', meaning no <br>
|
| 1082 | effect.<br>
|
| 1083 | <br>
|
| 1084 | -[no]waitvsync<br>
|
| 1085 | <br>
|
| 1086 | Waits for the refresh period on your computer's monitor to finish<br>
|
| 1087 | before starting to draw video to your screen. If this option is off,<br>
|
| 1088 | MAME will just draw to the screen at any old time, even in the middle<br>
|
| 1089 | of a refresh cycle. This can cause "tearing" artifacts, where the top<br>
|
| 1090 | portion of the screen is out of sync with the bottom portion. Tearing<br>
|
| 1091 | is not noticeable on all games, and some people hate it more than<br>
|
| 1092 | others. However, if you turn this option on, you will waste more of<br>
|
| 1093 | your CPU cycles waiting for the proper time to draw, so you will see a<br>
|
| 1094 | performance hit. You should only need to turn this on in windowed mode.<br>
|
| 1095 | In full screen mode, it is only needed if -triplebuffer does not<br>
|
| 1096 | remove the tearing, in which case you should use -notriplebuffer <br>
|
| 1097 | </span></span>
|
| 1098 | </span></span>-<span class="style3"><span class="style4"><span class="style1"><span class="style2">waitvsync. Note that |
| 1099 | this option does not work with -video gdi mode.<br>
|
| 1100 | The default is OFF (-nowaitvsync).<br>
|
| 1101 | <br>
|
| 1102 | -[no]syncrefresh<br>
|
| 1103 | <br>
|
| 1104 | Enables speed throttling only to the refresh of your monitor. This<br>
|
| 1105 | means that the game's actual refresh rate is ignored; however, the<br>
|
| 1106 | sound code still attempts to keep up with the game's original refresh<br>
|
| 1107 | rate, so you may encounter sound problems. This option is intended <br>
|
| 1108 | mainly for those who have tweaked their video card's settings to<br>
|
| 1109 | provide carefully matched refresh rate options. Note that this option <br>
|
| 1110 | does not work with -video gdi mode.The default is OFF (-nosyncrefresh).<br>
|
| 1111 | <br>
|
| 1112 | <br>
|
| 1113 | <br>
|
| 1114 | DirectDraw-specific options<br>
|
| 1115 | ---------------------------<br>
|
| 1116 | <br>
|
| 1117 | -[no]hwstretch / -[no]hws<br>
|
| 1118 | <br>
|
| 1119 | When enabled, MAME uses the hardware stretching abilities of your<br>
|
| 1120 | video card to scale the game image and associated artwork to the <br>
|
| 1121 | target resolution. Depending on the quality of your graphic card and <br>
|
| 1122 | its drivers, this may be a fractional, antialiased scaling (nice) or <br>
|
| 1123 | an integer, blocky scaling (not so nice), in which case you might want<br>
|
| 1124 | to disable this option. In addition, if you have configured specific<br>
|
| 1125 | arcade-like video modes for MAME and don't want MAME to perform any<br>
|
| 1126 | non-integral scaling of the image, you should also disable this option.<br>
|
| 1127 | The default is ON (-hwstretch).<br>
|
| 1128 | <br>
|
| 1129 | <br>
|
| 1130 | <br>
|
| 1131 | Direct3D-specific options<br>
|
| 1132 | -------------------------<br>
|
| 1133 | <br>
|
| 1134 | -d3dversion <version><br>
|
| 1135 | <br>
|
| 1136 | MAME supports both Direct3D 9 and Direct3D 8 for maximum compatibility.<br>
|
| 1137 | By default, it will automatically detect which one it can use and use<br>
|
| 1138 | that version exclusively. You can override MAME's selection with this<br>
|
| 1139 | option. It is primarily intended as a means for the MAME developers to<br>
|
| 1140 | test compatibility with older hardware; for the most part, there is no<br>
|
| 1141 | reason to alter this setting. The default is 9.<br>
|
| 1142 | <br>
|
| 1143 | -[no]filter / -[no]d3dfilter / -[no]flt<br>
|
| 1144 | <br>
|
| 1145 | Enable bilinear filtering on the game screen graphics. When disabled,<br>
|
| 1146 | point filtering is applied, which is crisper but leads to scaling<br>
|
| 1147 | artifacts. If you don't like the filtered look, you are probably better<br>
|
| 1148 | off increasing the -prescale value rather than turning off filtering<br>
|
| 1149 | altogether. The default is ON (-filter).<br>
|
| 1150 | <br>
|
| 1151 | <br>
|
| 1152 | <br>
|
| 1153 | Per-window options<br>
|
| 1154 | ------------------<br>
|
| 1155 | <br>
|
| 1156 | -screen <display><br>
|
| 1157 | -screen0 <display><br>
|
| 1158 | -screen1 <display><br>
|
| 1159 | -screen2 <display><br>
|
| 1160 | -screen3 <display><br>
|
| 1161 | <br>
|
| 1162 | Specifies which physical monitor on your system you wish to have each<br>
|
| 1163 | window use by default. In order to use multiple windows, you must have<br>
|
| 1164 | increased the value of the -numscreens option. The name of each <br>
|
| 1165 | display in your system can be determined by running MAME with the <br>
|
| 1166 | -verbose option. The display names are typically in the format of: <br>
|
| 1167 | \\.\DISPLAYn, where 'n' is a number from 1 to the number of connected <br>
|
| 1168 | monitors. The default value for these options is 'auto', which means <br>
|
| 1169 | that the first window is placed on the first display, the second <br>
|
| 1170 | window on the second display, etc.<br>
|
| 1171 | <br>
|
| 1172 | The -screen0, -screen1, -screen2, -screen3 parameters apply to the<br>
|
| 1173 | specific window. The -screen parameter applies to all windows. The<br>
|
| 1174 | window-specific options override values from the all window option.<br>
|
| 1175 | <br>
|
| 1176 | -aspect <width:height> / -screen_aspect <num:den><br>
|
| 1177 | -aspect0 <width:height><br>
|
| 1178 | -aspect1 <width:height><br>
|
| 1179 | -aspect2 <width:height><br>
|
| 1180 | -aspect3 <width:height><br>
|
| 1181 | <br>
|
| 1182 | Specifies the physical aspect ratio of the physical monitor for each<br>
|
| 1183 | window. In order to use multiple windows, you must have increased the <br>
|
| 1184 | value of the -numscreens option. The physical aspect ratio can be<br>
|
| 1185 | determined by measuring the width and height of the visible screen <br>
|
| 1186 | image and specifying them separated by a colon. The default value for<br>
|
| 1187 | these options is 'auto', which means that MAME assumes the aspect <br>
|
| 1188 | ratio is proportional to the number of pixels in the desktop video <br>
|
| 1189 | mode for each monitor.<br>
|
| 1190 | <br>
|
| 1191 | The -aspect0, -aspect1, -aspect2, -aspect3 parameters apply to the<br>
|
| 1192 | specific window. The -aspect parameter applies to all windows. The<br>
|
| 1193 | window-specific options override values from the all window option.<br>
|
| 1194 | <br>
|
| 1195 | -resolution <widthxheight[@refresh]> / -r <widthxheight[@refresh]><br>
|
| 1196 | -resolution0 <widthxheight[@refresh]> / -r0 <widthxheight[@refresh]><br>
|
| 1197 | -resolution1 <widthxheight[@refresh]> / -r1 <widthxheight[@refresh]><br>
|
| 1198 | -resolution2 <widthxheight[@refresh]> / -r2 <widthxheight[@refresh]><br>
|
| 1199 | -resolution3 <widthxheight[@refresh]> / -r3 <widthxheight[@refresh]><br>
|
| 1200 | <br>
|
| 1201 | Specifies an exact resolution to run in. In full screen mode, MAME <br>
|
| 1202 | will try to use the specific resolution you request. The width and<br>
|
| 1203 | height are required; the refresh rate is optional. If omitted or<br>
|
| 1204 | set to 0, MAME will determine the mode auomatically. For example,<br>
|
| 1205 | -resolution 640x480 will force 640x480 resolution, but MAME is free to<br>
|
| 1206 | choose the refresh rate. Similarly, -resolution 0x0@60 will force a<br>
|
| 1207 | 60Hz refresh rate, but allows MAME to choose the resolution. The <br>
|
| 1208 | string "auto" is also supported, and is equivalent to 0x0@0. In window <br>
|
| 1209 | mode, this resolution is used as a maximum size for the window. This <br>
|
| 1210 | option requires the -switchres option as well in order to actually <br>
|
| 1211 | enable resolution switching with -video ddraw or -video d3d. The <br>
|
| 1212 | default value for these options is 'auto'.<br>
|
| 1213 | <br>
|
| 1214 | The -resolution0, -resolution1, -resolution2, -resolution3 parameters <br>
|
| 1215 | apply to the specific window. The -resolution parameter applies to all<br>
|
| 1216 | windows. The window-specific options override values from the all <br>
|
| 1217 | window option.<br>
|
| 1218 | <br>
|
| 1219 | -view <viewname><br>
|
| 1220 | -view0 <viewname> <br>
|
| 1221 | -view1 <viewname><br>
|
| 1222 | -view2 <viewname><br>
|
| 1223 | -view3 <viewname><br>
|
| 1224 | <br>
|
| 1225 | Specifies the initial view setting for each window. The <viewname> <br>
|
| 1226 | does not need to be a perfect match; rather, it will select the first <br>
|
| 1227 | view whose name matches all the characters specified by <viewname>. <br>
|
| 1228 | For example, -view native will match the "Native (15:14)" view even <br>
|
| 1229 | though it is not a perfect match. The value 'auto' is also supported, <br>
|
| 1230 | and requests that MAME perform a default selection. The default value <br>
|
| 1231 | for these options is 'auto'.<br>
|
| 1232 | <br>
|
| 1233 | The -view0, -view1, -view2, -view3 parameters apply to the<br>
|
| 1234 | specific window. The -view parameter applies to all windows. The<br>
|
| 1235 | window-specific options override values from the all window option.<br>
|
| 1236 | <br>
|
| 1237 | <br>
|
| 1238 | <br>
|
| 1239 | Full screen options<br>
|
| 1240 | -------------------<br>
|
| 1241 | <br>
|
| 1242 | -[no]triplebuffer / -[no]tb<br>
|
| 1243 | <br>
|
| 1244 | Enables or disables "triple buffering". Normally, MAME just draws<br>
|
| 1245 | directly to the screen, without any fancy buffering. But with this<br>
|
| 1246 | option enabled, MAME creates three buffers to draw to, and cycles<br>
|
| 1247 | between them in order. It attempts to keep things flowing such that one<br>
|
| 1248 | buffer is currently displayed, the second buffer is waiting to be<br>
|
| 1249 | displayed, and the third buffer is being drawn to. -triplebuffer will <br>
|
| 1250 | override -waitvsync, if the buffer is sucessfully created. This option<br>
|
| 1251 | does not work with -video gdi. The default is OFF (-notriplebuffer).<br>
|
| 1252 | <br>
|
| 1253 | -[no]switchres<br>
|
| 1254 | <br>
|
| 1255 | Enables resolution switching. This option is required for the<br>
|
| 1256 | -resolution* options to switch resolutions in full screen mode. On<br>
|
| 1257 | modern video cards, there is little reason to switch resolutions unless<br>
|
| 1258 | you are trying to achieve the "exact" pixel resolutions of the original<br>
|
| 1259 | games, which requires significant tweaking. This option is also useful <br>
|
| 1260 | on LCD displays, since they run with a fixed resolution and switching<br>
|
| 1261 | resolutions on them is just silly. This option does not work with<br>
|
| 1262 | -video gdi. The default is OFF (-noswitchres).<br>
|
| 1263 | <br>
|
| 1264 | </span></span>
|
| 1265 | </span></span>-<span class="style3"><span class="style4"><span class="style1"><span class="style2">full_screen_brightness |
| 1266 | / -fsb <value><br>
|
| 1267 | <br>
|
| 1268 | Controls the brightness, or black level, of the entire display. The<br>
|
| 1269 | standard value is 1.0. Selecting lower values (down to 0.1) will produce<br>
|
| 1270 | a darkened display, while selecting higher values (up to 2.0) will<br>
|
| 1271 | give a brighter display. Note that not all video cards have hardware to<br>
|
| 1272 | support this option. This option does not work with -video gdi. The<br>
|
| 1273 | default is 1.0.<br>
|
| 1274 | <br>
|
| 1275 | </span></span>
|
| 1276 | </span></span>-<span class="style3"><span class="style4"><span class="style1"><span class="style2">full_screen_contrast / |
| 1277 | -fsc <value><br>
|
| 1278 | <br>
|
| 1279 | Controls the contrast, or white level, of the entire display. The<br>
|
| 1280 | standard value is 1.0. Selecting lower values (down to 0.1) will produce<br>
|
| 1281 | a dimmer display, while selecting higher values (up to 2.0) will<br>
|
| 1282 | give a more saturated display. Note that not all video cards have <br>
|
| 1283 | hardware to support this option. This option does not work with <br>
|
| 1284 | -video gdi. The default is 1.0.<br>
|
| 1285 | <br>
|
| 1286 | </span></span>
|
| 1287 | </span></span>-<span class="style3"><span class="style4"><span class="style1"><span class="style2">full_screen_gamma / -fsg |
| 1288 | <value><br>
|
| 1289 | <br>
|
| 1290 | Controls the gamma, which produces a potentially nonlinear black to<br>
|
| 1291 | white ramp, for the entire display. The standard value is 1.0, which <br>
|
| 1292 | gives a linear ramp from black to white. Selecting lower values (down <br>
|
| 1293 | to 0.1) will increase the nonlinearity toward black, while selecting <br>
|
| 1294 | higher values (up to 3.0) will push the nonlinearity toward white. Note <br>
|
| 1295 | that not all video cards have hardware to support this option. This <br>
|
| 1296 | option does not work with -video gdi. The default is 1.0.<br>
|
| 1297 | <br>
|
| 1298 | <br>
|
| 1299 | <br>
|
| 1300 | Windows sound options<br>
|
| 1301 | ---------------------<br>
|
| 1302 | <br>
|
| 1303 | </span></span>
|
| 1304 | </span></span>-<span class="style3"><span class="style4"><span class="style1"><span class="style2">audio_latency <value><br>
|
| 1305 | <br>
|
| 1306 | This controls the amount of latency built into the audio streaming. By<br>
|
| 1307 | default MAME tries to keep the DirectSound audio buffer between 1/5 and<br>
|
| 1308 | 2/5 full. On some systems, this is pushing it too close to the edge,<br>
|
| 1309 | and you get poor sound sometimes. The latency parameter controls the<br>
|
| 1310 | lower threshold. The default is 1 (meaning lower=1/5 and upper=2/5).<br>
|
| 1311 | Set it to 2 (-audio_latency 2) to keep the sound buffer between 2/5 and<br>
|
| 1312 | 3/5 full. If you crank it up to 4, you can definitely notice the lag.<br>
|
| 1313 | <br>
|
| 1314 | <br>
|
| 1315 | <br>
|
| 1316 | Input device options<br>
|
| 1317 | --------------------<br>
|
| 1318 | <br>
|
| 1319 | -[no]dual_lightgun / -[no]dual<br>
|
| 1320 | <br>
|
| 1321 | Controls whether or not MAME attempts to track two lightguns connected<br>
|
| 1322 | at the same time. This option requires -lightgun. This option is a hack<br>
|
| 1323 | for supporting older dual lightgun setups. If you have multiple <br>
|
| 1324 | lightguns connected, you will probably just need to enable -mouse and<br>
|
| 1325 | configure each lightgun independently. The default is OFF<br>
|
| 1326 | (-nodual_lightgun).</span></span></span></span></p>
|
| 1327 | |
| 1328 | |
| 1329 | </html>
|
src/osd/winui/winui.c
| r0 | r1368 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | M.A.M.E.UI - Multiple Arcade Machine Emulator with User Interface |
| 4 | Win32 Portions Copyright (C) 1997-2003 Michael Soderstrom and Chris Kirmse, |
| 5 | Copyright (C) 2003-2007 Chris Kirmse and the MAME32/MAMEUI team. |
| 6 | |
| 7 | This file is part of MAMEUI, and may only be used, modified and |
| 8 | distributed under the terms of the MAME license, in "readme.txt". |
| 9 | By continuing to use, modify or distribute this file you indicate |
| 10 | that you have read the license and understand and accept it fully. |
| 11 | |
| 12 | ***************************************************************************/ |
| 13 | |
| 14 | /*************************************************************************** |
| 15 | |
| 16 | winui.c |
| 17 | |
| 18 | Win32 GUI code. |
| 19 | |
| 20 | Created 8/12/97 by Christopher Kirmse (ckirmse@ricochet.net) |
| 21 | Additional code November 1997 by Jeff Miller (miller@aa.net) |
| 22 | More July 1998 by Mike Haaland (mhaaland@hypertech.com) |
| 23 | Added Spitters/Property Sheets/Removed Tabs/Added Tree Control in |
| 24 | Nov/Dec 1998 - Mike Haaland |
| 25 | |
| 26 | ***************************************************************************/ |
| 27 | |
| 28 | // standard windows headers |
| 29 | #define WIN32_LEAN_AND_MEAN |
| 30 | #define _WIN32_IE 0x0500 |
| 31 | #include <windows.h> |
| 32 | #include <windowsx.h> |
| 33 | #include <shellapi.h> |
| 34 | #include <commctrl.h> |
| 35 | #include <wingdi.h> |
| 36 | |
| 37 | // standard C headers |
| 38 | #include <stdio.h> |
| 39 | #include <ctype.h> |
| 40 | #include <io.h> |
| 41 | #include <fcntl.h> |
| 42 | #include <dlgs.h> |
| 43 | #include <string.h> |
| 44 | #include <sys/stat.h> |
| 45 | #include <time.h> |
| 46 | #include <tchar.h> |
| 47 | |
| 48 | |
| 49 | // MAME/MAMEUI headers |
| 50 | #include "driver.h" |
| 51 | #include "osdepend.h" |
| 52 | #include "unzip.h" |
| 53 | #include "winutf8.h" |
| 54 | #include "strconv.h" |
| 55 | #include "input.h" |
| 56 | #include "window.h" |
| 57 | #include "winmain.h" |
| 58 | |
| 59 | #include "resource.h" |
| 60 | #include "resource.hm" |
| 61 | |
| 62 | #include "winui.h" |
| 63 | #include "mui_util.h" |
| 64 | #include "mui_audit.h" |
| 65 | #include "directories.h" |
| 66 | #include "mui_opts.h" |
| 67 | #include "properties.h" |
| 68 | #include "columnedit.h" |
| 69 | #include "picker.h" |
| 70 | #include "tabview.h" |
| 71 | #include "bitmask.h" |
| 72 | #include "treeview.h" |
| 73 | #include "splitters.h" |
| 74 | #include "dirwatch.h" |
| 75 | #include "help.h" |
| 76 | #include "history.h" |
| 77 | #include "dialogs.h" |
| 78 | #include "directdraw.h" |
| 79 | #include "directinput.h" |
| 80 | #include "dijoystick.h" /* For DIJoystick avalibility. */ |
| 81 | |
| 82 | #ifdef MESS |
| 83 | #include "messui.h" |
| 84 | #include "messopts.h" |
| 85 | #endif // MESS |
| 86 | |
| 87 | #ifdef _MSC_VER |
| 88 | #define snprintf _snprintf |
| 89 | #endif |
| 90 | |
| 91 | #ifndef LVS_EX_LABELTIP |
| 92 | #define LVS_EX_LABELTIP 0x00004000 // listview unfolds partly hidden labels if it does not have infotip text |
| 93 | #endif // LVS_EX_LABELTIP |
| 94 | |
| 95 | // fix warning: cast does not match function type |
| 96 | #if defined(__GNUC__) && defined(ListView_CreateDragImage) |
| 97 | #undef ListView_CreateDragImage |
| 98 | #endif |
| 99 | |
| 100 | #ifndef ListView_CreateDragImage |
| 101 | #define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \ |
| 102 | (HIMAGELIST)(LRESULT)(int)SendMessage((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft)) |
| 103 | #endif // ListView_CreateDragImage |
| 104 | |
| 105 | #ifndef TreeView_EditLabel |
| 106 | #define TreeView_EditLabel(w, i) \ |
| 107 | SNDMSG(w,TVM_EDITLABEL,0,(LPARAM)(i)) |
| 108 | #endif // TreeView_EditLabel |
| 109 | |
| 110 | #ifndef HDF_SORTUP |
| 111 | #define HDF_SORTUP 0x400 |
| 112 | #endif // HDF_SORTUP |
| 113 | |
| 114 | #ifndef HDF_SORTDOWN |
| 115 | #define HDF_SORTDOWN 0x200 |
| 116 | #endif // HDF_SORTDOWN |
| 117 | |
| 118 | #ifndef LVM_SETBKIMAGEA |
| 119 | #define LVM_SETBKIMAGEA (LVM_FIRST + 68) |
| 120 | #endif // LVM_SETBKIMAGEA |
| 121 | |
| 122 | #ifndef LVM_SETBKIMAGEW |
| 123 | #define LVM_SETBKIMAGEW (LVM_FIRST + 138) |
| 124 | #endif // LVM_SETBKIMAGEW |
| 125 | |
| 126 | #ifndef LVM_GETBKIMAGEA |
| 127 | #define LVM_GETBKIMAGEA (LVM_FIRST + 69) |
| 128 | #endif // LVM_GETBKIMAGEA |
| 129 | |
| 130 | #ifndef LVM_GETBKIMAGEW |
| 131 | #define LVM_GETBKIMAGEW (LVM_FIRST + 139) |
| 132 | #endif // LVM_GETBKIMAGEW |
| 133 | |
| 134 | #ifndef LVBKIMAGE |
| 135 | |
| 136 | typedef struct tagLVBKIMAGEA |
| 137 | { |
| 138 | ULONG ulFlags; |
| 139 | HBITMAP hbm; |
| 140 | LPSTR pszImage; |
| 141 | UINT cchImageMax; |
| 142 | int xOffsetPercent; |
| 143 | int yOffsetPercent; |
| 144 | } LVBKIMAGEA, *LPLVBKIMAGEA; |
| 145 | |
| 146 | typedef struct tagLVBKIMAGEW |
| 147 | { |
| 148 | ULONG ulFlags; |
| 149 | HBITMAP hbm; |
| 150 | LPWSTR pszImage; |
| 151 | UINT cchImageMax; |
| 152 | int xOffsetPercent; |
| 153 | int yOffsetPercent; |
| 154 | } LVBKIMAGEW, *LPLVBKIMAGEW; |
| 155 | |
| 156 | #ifdef UNICODE |
| 157 | #define LVBKIMAGE LVBKIMAGEW |
| 158 | #define LPLVBKIMAGE LPLVBKIMAGEW |
| 159 | #define LVM_SETBKIMAGE LVM_SETBKIMAGEW |
| 160 | #define LVM_GETBKIMAGE LVM_GETBKIMAGEW |
| 161 | #else |
| 162 | #define LVBKIMAGE LVBKIMAGEA |
| 163 | #define LPLVBKIMAGE LPLVBKIMAGEA |
| 164 | #define LVM_SETBKIMAGE LVM_SETBKIMAGEA |
| 165 | #define LVM_GETBKIMAGE LVM_GETBKIMAGEA |
| 166 | #endif |
| 167 | #endif |
| 168 | |
| 169 | #ifndef LVBKIF_SOURCE_NONE |
| 170 | #define LVBKIF_SOURCE_NONE 0x00000000 |
| 171 | #endif // LVBKIF_SOURCE_NONE |
| 172 | |
| 173 | #ifndef LVBKIF_SOURCE_HBITMAP |
| 174 | #define LVBKIF_SOURCE_HBITMAP 0x00000001 |
| 175 | #endif |
| 176 | |
| 177 | #ifndef LVBKIF_SOURCE_URL |
| 178 | #define LVBKIF_SOURCE_URL 0x00000002 |
| 179 | #endif // LVBKIF_SOURCE_URL |
| 180 | |
| 181 | #ifndef LVBKIF_SOURCE_MASK |
| 182 | #define LVBKIF_SOURCE_MASK 0x00000003 |
| 183 | #endif // LVBKIF_SOURCE_MASK |
| 184 | |
| 185 | #ifndef LVBKIF_STYLE_NORMAL |
| 186 | #define LVBKIF_STYLE_NORMAL 0x00000000 |
| 187 | #endif // LVBKIF_STYLE_NORMAL |
| 188 | |
| 189 | #ifndef LVBKIF_STYLE_TILE |
| 190 | #define LVBKIF_STYLE_TILE 0x00000010 |
| 191 | #endif // LVBKIF_STYLE_TILE |
| 192 | |
| 193 | #ifndef LVBKIF_STYLE_MASK |
| 194 | #define LVBKIF_STYLE_MASK 0x00000010 |
| 195 | #endif // LVBKIF_STYLE_MASK |
| 196 | |
| 197 | #ifndef ListView_SetBkImage |
| 198 | #define ListView_SetBkImage(hwnd, plvbki) \ |
| 199 | (BOOL)SNDMSG((hwnd), LVM_SETBKIMAGE, 0, (LPARAM)(plvbki)) |
| 200 | #endif // ListView_SetBkImage |
| 201 | |
| 202 | #ifndef ListView_GetBkImage |
| 203 | #define ListView_GetBkImage(hwnd, plvbki) \ |
| 204 | (BOOL)SNDMSG((hwnd), LVM_GETBKIMAGE, 0, (LPARAM)(plvbki)) |
| 205 | #endif // ListView_GetBkImage |
| 206 | |
| 207 | #define MM_PLAY_GAME (WM_APP + 15000) |
| 208 | |
| 209 | #define JOYGUI_MS 100 |
| 210 | |
| 211 | #define JOYGUI_TIMER 1 |
| 212 | #define SCREENSHOT_TIMER 2 |
| 213 | #define GAMEWND_TIMER 3 |
| 214 | |
| 215 | /* Max size of a sub-menu */ |
| 216 | #define DBU_MIN_WIDTH 292 |
| 217 | #define DBU_MIN_HEIGHT 190 |
| 218 | |
| 219 | int MIN_WIDTH = DBU_MIN_WIDTH; |
| 220 | int MIN_HEIGHT = DBU_MIN_HEIGHT; |
| 221 | |
| 222 | /* Max number of bkground picture files */ |
| 223 | #define MAX_BGFILES 100 |
| 224 | |
| 225 | #ifndef LVS_EX_LABELTIP |
| 226 | #define LVS_EX_LABELTIP 0x00004000 // listview unfolds partly hidden labels if it does not have infotip text |
| 227 | #endif |
| 228 | |
| 229 | #define NO_FOLDER -1 |
| 230 | #define STATESAVE_VERSION 1 |
| 231 | |
| 232 | /*************************************************************************** |
| 233 | externally defined global variables |
| 234 | ***************************************************************************/ |
| 235 | extern const ICONDATA g_iconData[]; |
| 236 | extern const TCHAR g_szPlayGameString[]; |
| 237 | extern const char g_szGameCountString[]; |
| 238 | |
| 239 | typedef struct _play_options play_options; |
| 240 | struct _play_options |
| 241 | { |
| 242 | const char *record; // OPTION_RECORD |
| 243 | const char *playback; // OPTION_PLAYBACK |
| 244 | const char *state; // OPTION_STATE |
| 245 | const char *wavwrite; // OPTION_WAVWRITE |
| 246 | const char *mngwrite; // OPTION_MNGWRITE |
| 247 | }; |
| 248 | |
| 249 | /*************************************************************************** |
| 250 | function prototypes |
| 251 | ***************************************************************************/ |
| 252 | |
| 253 | static BOOL Win32UI_init(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow); |
| 254 | static void Win32UI_exit(void); |
| 255 | |
| 256 | static BOOL PumpMessage(void); |
| 257 | static BOOL OnIdle(HWND hWnd); |
| 258 | static void OnSize(HWND hwnd, UINT state, int width, int height); |
| 259 | static LRESULT CALLBACK MameWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam); |
| 260 | |
| 261 | static void SetView(int menu_id); |
| 262 | static void ResetListView(void); |
| 263 | static void UpdateGameList(BOOL bUpdateRomAudit, BOOL bUpdateSampleAudit); |
| 264 | static void DestroyIcons(void); |
| 265 | static void ReloadIcons(void); |
| 266 | static void PollGUIJoystick(void); |
| 267 | //static void PressKey(HWND hwnd,UINT vk); |
| 268 | static BOOL MameCommand(HWND hwnd,int id, HWND hwndCtl, UINT codeNotify); |
| 269 | static void KeyboardKeyDown(int syskey, int vk_code, int special); |
| 270 | static void KeyboardKeyUp(int syskey, int vk_code, int special); |
| 271 | static void KeyboardStateClear(void); |
| 272 | |
| 273 | static void UpdateStatusBar(void); |
| 274 | //static BOOL PickerHitTest(HWND hWnd); |
| 275 | static BOOL TreeViewNotify(NMHDR *nm); |
| 276 | |
| 277 | static void ResetBackground(char *szFile); |
| 278 | static void RandomSelectBackground(void); |
| 279 | static void LoadBackgroundBitmap(void); |
| 280 | static void PaintBackgroundImage(HWND hWnd, HRGN hRgn, int x, int y); |
| 281 | |
| 282 | static int CLIB_DECL DriverDataCompareFunc(const void *arg1,const void *arg2); |
| 283 | static int GamePicker_Compare(HWND hwndPicker, int index1, int index2, int sort_subitem); |
| 284 | |
| 285 | static void DisableSelection(void); |
| 286 | static void EnableSelection(int nGame); |
| 287 | |
| 288 | static HICON GetSelectedPickItemIcon(void); |
| 289 | static void SetRandomPickItem(void); |
| 290 | static void PickColor(COLORREF *cDefault); |
| 291 | |
| 292 | static LPTREEFOLDER GetSelectedFolder(void); |
| 293 | static HICON GetSelectedFolderIcon(void); |
| 294 | |
| 295 | static LRESULT CALLBACK HistoryWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
| 296 | static LRESULT CALLBACK PictureFrameWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
| 297 | static LRESULT CALLBACK PictureWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); |
| 298 | static INT_PTR CALLBACK LanguageDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); |
| 299 | |
| 300 | static BOOL SelectLanguageFile(HWND hWnd, TCHAR* filename); |
| 301 | static void MamePlayRecordGame(void); |
| 302 | static void MamePlayBackGame(void); |
| 303 | static void MamePlayRecordWave(void); |
| 304 | static void MamePlayRecordMNG(void); |
| 305 | static void MameLoadState(void); |
| 306 | static void MamePlayGameWithOptions(int nGame, const play_options *playopts); |
| 307 | static BOOL GameCheck(void); |
| 308 | static BOOL FolderCheck(void); |
| 309 | |
| 310 | static void ToggleScreenShot(void); |
| 311 | static void AdjustMetrics(void); |
| 312 | //static void EnablePlayOptions(int nIndex, core_options *o); |
| 313 | |
| 314 | /* Icon routines */ |
| 315 | static DWORD GetShellLargeIconSize(void); |
| 316 | static DWORD GetShellSmallIconSize(void); |
| 317 | static void CreateIcons(void); |
| 318 | static int GetIconForDriver(int nItem); |
| 319 | static void AddDriverIcon(int nItem,int default_icon_index); |
| 320 | |
| 321 | // Context Menu handlers |
| 322 | static void UpdateMenu(HMENU hMenu); |
| 323 | static void InitTreeContextMenu(HMENU hTreeMenu); |
| 324 | static void InitBodyContextMenu(HMENU hBodyContextMenu); |
| 325 | static void ToggleShowFolder(int folder); |
| 326 | static BOOL HandleTreeContextMenu( HWND hWnd, WPARAM wParam, LPARAM lParam); |
| 327 | static BOOL HandleScreenShotContextMenu( HWND hWnd, WPARAM wParam, LPARAM lParam); |
| 328 | static void GamePicker_OnHeaderContextMenu(POINT pt, int nColumn); |
| 329 | static void GamePicker_OnBodyContextMenu(POINT pt); |
| 330 | |
| 331 | static void InitListView(void); |
| 332 | /* Re/initialize the ListView header columns */ |
| 333 | static void ResetColumnDisplay(BOOL first_time); |
| 334 | |
| 335 | static void CopyToolTipText (LPTOOLTIPTEXT lpttt); |
| 336 | |
| 337 | static void ProgressBarShow(void); |
| 338 | static void ProgressBarHide(void); |
| 339 | static void ResizeProgressBar(void); |
| 340 | static void ProgressBarStep(void); |
| 341 | static void ProgressBarStepParam(int iGameIndex, int nGameCount); |
| 342 | |
| 343 | static HWND InitProgressBar(HWND hParent); |
| 344 | static HWND InitToolbar(HWND hParent); |
| 345 | static HWND InitStatusBar(HWND hParent); |
| 346 | |
| 347 | static LRESULT Statusbar_MenuSelect (HWND hwnd, WPARAM wParam, LPARAM lParam); |
| 348 | |
| 349 | static void UpdateHistory(void); |
| 350 | |
| 351 | |
| 352 | void RemoveCurrentGameCustomFolder(void); |
| 353 | void RemoveGameCustomFolder(int driver_index); |
| 354 | |
| 355 | void BeginListViewDrag(NM_LISTVIEW *pnmv); |
| 356 | void MouseMoveListViewDrag(POINTS pt); |
| 357 | void ButtonUpListViewDrag(POINTS p); |
| 358 | |
| 359 | void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height); |
| 360 | |
| 361 | BOOL MouseHasBeenMoved(void); |
| 362 | void SwitchFullScreenMode(void); |
| 363 | |
| 364 | /*************************************************************************** |
| 365 | External variables |
| 366 | ***************************************************************************/ |
| 367 | |
| 368 | /*************************************************************************** |
| 369 | Internal structures |
| 370 | ***************************************************************************/ |
| 371 | |
| 372 | /* |
| 373 | * These next two structs represent how the icon information |
| 374 | * is stored in an ICO file. |
| 375 | */ |
| 376 | typedef struct |
| 377 | { |
| 378 | BYTE bWidth; /* Width of the image */ |
| 379 | BYTE bHeight; /* Height of the image (times 2) */ |
| 380 | BYTE bColorCount; /* Number of colors in image (0 if >=8bpp) */ |
| 381 | BYTE bReserved; /* Reserved */ |
| 382 | WORD wPlanes; /* Color Planes */ |
| 383 | WORD wBitCount; /* Bits per pixel */ |
| 384 | DWORD dwBytesInRes; /* how many bytes in this resource? */ |
| 385 | DWORD dwImageOffset; /* where in the file is this image */ |
| 386 | } ICONDIRENTRY, *LPICONDIRENTRY; |
| 387 | |
| 388 | typedef struct |
| 389 | { |
| 390 | UINT Width, Height, Colors; /* Width, Height and bpp */ |
| 391 | LPBYTE lpBits; /* ptr to DIB bits */ |
| 392 | DWORD dwNumBytes; /* how many bytes? */ |
| 393 | LPBITMAPINFO lpbi; /* ptr to header */ |
| 394 | LPBYTE lpXOR; /* ptr to XOR image bits */ |
| 395 | LPBYTE lpAND; /* ptr to AND image bits */ |
| 396 | } ICONIMAGE, *LPICONIMAGE; |
| 397 | |
| 398 | /* Which edges of a control are anchored to the corresponding side of the parent window */ |
| 399 | #define RA_LEFT 0x01 |
| 400 | #define RA_RIGHT 0x02 |
| 401 | #define RA_TOP 0x04 |
| 402 | #define RA_BOTTOM 0x08 |
| 403 | #define RA_ALL 0x0F |
| 404 | |
| 405 | #define RA_END 0 |
| 406 | #define RA_ID 1 |
| 407 | #define RA_HWND 2 |
| 408 | |
| 409 | typedef struct |
| 410 | { |
| 411 | int type; /* Either RA_ID or RA_HWND, to indicate which member of u is used; or RA_END |
| 412 | to signify last entry */ |
| 413 | union /* Can identify a child window by control id or by handle */ |
| 414 | { |
| 415 | int id; /* Window control id */ |
| 416 | HWND hwnd; /* Window handle */ |
| 417 | } u; |
| 418 | BOOL setfont; /* Do we set this item's font? */ |
| 419 | int action; /* What to do when control is resized */ |
| 420 | void *subwindow; /* Points to a Resize structure for this subwindow; NULL if none */ |
| 421 | } ResizeItem; |
| 422 | |
| 423 | typedef struct |
| 424 | { |
| 425 | RECT rect; /* Client rect of window; must be initialized before first resize */ |
| 426 | ResizeItem* items; /* Array of subitems to be resized */ |
| 427 | } Resize; |
| 428 | |
| 429 | static void ResizeWindow(HWND hParent, Resize *r); |
| 430 | static void SetAllWindowsFont(HWND hParent, const Resize *r, HFONT hFont, BOOL bRedraw); |
| 431 | |
| 432 | /* List view Icon defines */ |
| 433 | #define LG_ICONMAP_WIDTH GetSystemMetrics(SM_CXICON) |
| 434 | #define LG_ICONMAP_HEIGHT GetSystemMetrics(SM_CYICON) |
| 435 | #define ICONMAP_WIDTH GetSystemMetrics(SM_CXSMICON) |
| 436 | #define ICONMAP_HEIGHT GetSystemMetrics(SM_CYSMICON) |
| 437 | |
| 438 | typedef struct tagPOPUPSTRING |
| 439 | { |
| 440 | HMENU hMenu; |
| 441 | UINT uiString; |
| 442 | } POPUPSTRING; |
| 443 | |
| 444 | #define MAX_MENUS 3 |
| 445 | |
| 446 | #define SPLITTER_WIDTH 4 |
| 447 | #define MIN_VIEW_WIDTH 10 |
| 448 | |
| 449 | // Struct needed for Game Window Communication |
| 450 | |
| 451 | typedef struct |
| 452 | { |
| 453 | LPPROCESS_INFORMATION ProcessInfo; |
| 454 | HWND hwndFound; |
| 455 | } FINDWINDOWHANDLE; |
| 456 | |
| 457 | /*************************************************************************** |
| 458 | Internal variables |
| 459 | ***************************************************************************/ |
| 460 | |
| 461 | static HWND hMain = NULL; |
| 462 | static HACCEL hAccel = NULL; |
| 463 | |
| 464 | static HWND hwndList = NULL; |
| 465 | static HWND hTreeView = NULL; |
| 466 | static HWND hProgWnd = NULL; |
| 467 | static HWND hTabCtrl = NULL; |
| 468 | |
| 469 | static HINSTANCE hInst = NULL; |
| 470 | |
| 471 | static HFONT hFont = NULL; /* Font for list view */ |
| 472 | |
| 473 | static int optionfolder_count = 0; |
| 474 | |
| 475 | /* global data--know where to send messages */ |
| 476 | static BOOL in_emulation; |
| 477 | |
| 478 | /* idle work at startup */ |
| 479 | static BOOL idle_work; |
| 480 | |
| 481 | /* object pool in use */ |
| 482 | static object_pool *mameui_pool; |
| 483 | |
| 484 | static int game_index; |
| 485 | static int progBarStep; |
| 486 | |
| 487 | static BOOL bDoGameCheck = FALSE; |
| 488 | |
| 489 | /* Tree control variables */ |
| 490 | static BOOL bShowTree = 1; |
| 491 | static BOOL bShowToolBar = 1; |
| 492 | static BOOL bShowStatusBar = 1; |
| 493 | static BOOL bShowTabCtrl = 1; |
| 494 | static BOOL bProgressShown = FALSE; |
| 495 | static BOOL bListReady = FALSE; |
| 496 | |
| 497 | #define WM_MAME32_FILECHANGED (WM_USER + 0) |
| 498 | #define WM_MAME32_AUDITGAME (WM_USER + 1) |
| 499 | |
| 500 | static PDIRWATCHER s_pWatcher; |
| 501 | |
| 502 | /* use a joystick subsystem in the gui? */ |
| 503 | static struct OSDJoystick* g_pJoyGUI = NULL; |
| 504 | |
| 505 | /* store current keyboard state (in internal codes) here */ |
| 506 | static input_code keyboard_state[ 2048 ]; /* __code_max #defines the number of internal key_codes */ |
| 507 | |
| 508 | /* search */ |
| 509 | static char g_SearchText[256]; |
| 510 | /* table copied from windows/inputs.c */ |
| 511 | // table entry indices |
| 512 | #define MAME_KEY 0 |
| 513 | #define DI_KEY 1 |
| 514 | #define VIRTUAL_KEY 2 |
| 515 | #define ASCII_KEY 3 |
| 516 | |
| 517 | // master keyboard translation table |
| 518 | static const int win_key_trans_table[][4] = |
| 519 | { |
| 520 | // MAME key dinput key virtual key ascii |
| 521 | { ITEM_ID_ESC, DIK_ESCAPE, VK_ESCAPE, 27 }, |
| 522 | { ITEM_ID_1, DIK_1, '1', '1' }, |
| 523 | { ITEM_ID_2, DIK_2, '2', '2' }, |
| 524 | { ITEM_ID_3, DIK_3, '3', '3' }, |
| 525 | { ITEM_ID_4, DIK_4, '4', '4' }, |
| 526 | { ITEM_ID_5, DIK_5, '5', '5' }, |
| 527 | { ITEM_ID_6, DIK_6, '6', '6' }, |
| 528 | { ITEM_ID_7, DIK_7, '7', '7' }, |
| 529 | { ITEM_ID_8, DIK_8, '8', '8' }, |
| 530 | { ITEM_ID_9, DIK_9, '9', '9' }, |
| 531 | { ITEM_ID_0, DIK_0, '0', '0' }, |
| 532 | { ITEM_ID_BACKSPACE, DIK_BACK, VK_BACK, 8 }, |
| 533 | { ITEM_ID_TAB, DIK_TAB, VK_TAB, 9 }, |
| 534 | { ITEM_ID_Q, DIK_Q, 'Q', 'Q' }, |
| 535 | { ITEM_ID_W, DIK_W, 'W', 'W' }, |
| 536 | { ITEM_ID_E, DIK_E, 'E', 'E' }, |
| 537 | { ITEM_ID_R, DIK_R, 'R', 'R' }, |
| 538 | { ITEM_ID_T, DIK_T, 'T', 'T' }, |
| 539 | { ITEM_ID_Y, DIK_Y, 'Y', 'Y' }, |
| 540 | { ITEM_ID_U, DIK_U, 'U', 'U' }, |
| 541 | { ITEM_ID_I, DIK_I, 'I', 'I' }, |
| 542 | { ITEM_ID_O, DIK_O, 'O', 'O' }, |
| 543 | { ITEM_ID_P, DIK_P, 'P', 'P' }, |
| 544 | { ITEM_ID_OPENBRACE, DIK_LBRACKET, VK_OEM_4, '[' }, |
| 545 | { ITEM_ID_CLOSEBRACE, DIK_RBRACKET, VK_OEM_6, ']' }, |
| 546 | { ITEM_ID_ENTER, DIK_RETURN, VK_RETURN, 13 }, |
| 547 | { ITEM_ID_LCONTROL, DIK_LCONTROL, VK_LCONTROL, 0 }, |
| 548 | { ITEM_ID_A, DIK_A, 'A', 'A' }, |
| 549 | { ITEM_ID_S, DIK_S, 'S', 'S' }, |
| 550 | { ITEM_ID_D, DIK_D, 'D', 'D' }, |
| 551 | { ITEM_ID_F, DIK_F, 'F', 'F' }, |
| 552 | { ITEM_ID_G, DIK_G, 'G', 'G' }, |
| 553 | { ITEM_ID_H, DIK_H, 'H', 'H' }, |
| 554 | { ITEM_ID_J, DIK_J, 'J', 'J' }, |
| 555 | { ITEM_ID_K, DIK_K, 'K', 'K' }, |
| 556 | { ITEM_ID_L, DIK_L, 'L', 'L' }, |
| 557 | { ITEM_ID_COLON, DIK_SEMICOLON, VK_OEM_1, ';' }, |
| 558 | { ITEM_ID_QUOTE, DIK_APOSTROPHE, VK_OEM_7, '\'' }, |
| 559 | { ITEM_ID_TILDE, DIK_GRAVE, VK_OEM_3, '`' }, |
| 560 | { ITEM_ID_LSHIFT, DIK_LSHIFT, VK_LSHIFT, 0 }, |
| 561 | { ITEM_ID_BACKSLASH, DIK_BACKSLASH, VK_OEM_5, '\\' }, |
| 562 | { ITEM_ID_Z, DIK_Z, 'Z', 'Z' }, |
| 563 | { ITEM_ID_X, DIK_X, 'X', 'X' }, |
| 564 | { ITEM_ID_C, DIK_C, 'C', 'C' }, |
| 565 | { ITEM_ID_V, DIK_V, 'V', 'V' }, |
| 566 | { ITEM_ID_B, DIK_B, 'B', 'B' }, |
| 567 | { ITEM_ID_N, DIK_N, 'N', 'N' }, |
| 568 | { ITEM_ID_M, DIK_M, 'M', 'M' }, |
| 569 | { ITEM_ID_SLASH, DIK_SLASH, VK_OEM_2, '/' }, |
| 570 | { ITEM_ID_RSHIFT, DIK_RSHIFT, VK_RSHIFT, 0 }, |
| 571 | { ITEM_ID_ASTERISK, DIK_MULTIPLY, VK_MULTIPLY, '*' }, |
| 572 | { ITEM_ID_LALT, DIK_LMENU, VK_LMENU, 0 }, |
| 573 | { ITEM_ID_SPACE, DIK_SPACE, VK_SPACE, ' ' }, |
| 574 | { ITEM_ID_CAPSLOCK, DIK_CAPITAL, VK_CAPITAL, 0 }, |
| 575 | { ITEM_ID_F1, DIK_F1, VK_F1, 0 }, |
| 576 | { ITEM_ID_F2, DIK_F2, VK_F2, 0 }, |
| 577 | { ITEM_ID_F3, DIK_F3, VK_F3, 0 }, |
| 578 | { ITEM_ID_F4, DIK_F4, VK_F4, 0 }, |
| 579 | { ITEM_ID_F5, DIK_F5, VK_F5, 0 }, |
| 580 | { ITEM_ID_F6, DIK_F6, VK_F6, 0 }, |
| 581 | { ITEM_ID_F7, DIK_F7, VK_F7, 0 }, |
| 582 | { ITEM_ID_F8, DIK_F8, VK_F8, 0 }, |
| 583 | { ITEM_ID_F9, DIK_F9, VK_F9, 0 }, |
| 584 | { ITEM_ID_F10, DIK_F10, VK_F10, 0 }, |
| 585 | { ITEM_ID_NUMLOCK, DIK_NUMLOCK, VK_NUMLOCK, 0 }, |
| 586 | { ITEM_ID_SCRLOCK, DIK_SCROLL, VK_SCROLL, 0 }, |
| 587 | { ITEM_ID_7_PAD, DIK_NUMPAD7, VK_NUMPAD7, 0 }, |
| 588 | { ITEM_ID_8_PAD, DIK_NUMPAD8, VK_NUMPAD8, 0 }, |
| 589 | { ITEM_ID_9_PAD, DIK_NUMPAD9, VK_NUMPAD9, 0 }, |
| 590 | { ITEM_ID_MINUS_PAD, DIK_SUBTRACT, VK_SUBTRACT, 0 }, |
| 591 | { ITEM_ID_4_PAD, DIK_NUMPAD4, VK_NUMPAD4, 0 }, |
| 592 | { ITEM_ID_5_PAD, DIK_NUMPAD5, VK_NUMPAD5, 0 }, |
| 593 | { ITEM_ID_6_PAD, DIK_NUMPAD6, VK_NUMPAD6, 0 }, |
| 594 | { ITEM_ID_PLUS_PAD, DIK_ADD, VK_ADD, 0 }, |
| 595 | { ITEM_ID_1_PAD, DIK_NUMPAD1, VK_NUMPAD1, 0 }, |
| 596 | { ITEM_ID_2_PAD, DIK_NUMPAD2, VK_NUMPAD2, 0 }, |
| 597 | { ITEM_ID_3_PAD, DIK_NUMPAD3, VK_NUMPAD3, 0 }, |
| 598 | { ITEM_ID_0_PAD, DIK_NUMPAD0, VK_NUMPAD0, 0 }, |
| 599 | { ITEM_ID_DEL_PAD, DIK_DECIMAL, VK_DECIMAL, 0 }, |
| 600 | { ITEM_ID_F11, DIK_F11, VK_F11, 0 }, |
| 601 | { ITEM_ID_F12, DIK_F12, VK_F12, 0 }, |
| 602 | { ITEM_ID_F13, DIK_F13, VK_F13, 0 }, |
| 603 | { ITEM_ID_F14, DIK_F14, VK_F14, 0 }, |
| 604 | { ITEM_ID_F15, DIK_F15, VK_F15, 0 }, |
| 605 | { ITEM_ID_ENTER_PAD, DIK_NUMPADENTER, VK_RETURN, 0 }, |
| 606 | { ITEM_ID_RCONTROL, DIK_RCONTROL, VK_RCONTROL, 0 }, |
| 607 | { ITEM_ID_SLASH_PAD, DIK_DIVIDE, VK_DIVIDE, 0 }, |
| 608 | { ITEM_ID_PRTSCR, DIK_SYSRQ, 0, 0 }, |
| 609 | { ITEM_ID_RALT, DIK_RMENU, VK_RMENU, 0 }, |
| 610 | { ITEM_ID_HOME, DIK_HOME, VK_HOME, 0 }, |
| 611 | { ITEM_ID_UP, DIK_UP, VK_UP, 0 }, |
| 612 | { ITEM_ID_PGUP, DIK_PRIOR, VK_PRIOR, 0 }, |
| 613 | { ITEM_ID_LEFT, DIK_LEFT, VK_LEFT, 0 }, |
| 614 | { ITEM_ID_RIGHT, DIK_RIGHT, VK_RIGHT, 0 }, |
| 615 | { ITEM_ID_END, DIK_END, VK_END, 0 }, |
| 616 | { ITEM_ID_DOWN, DIK_DOWN, VK_DOWN, 0 }, |
| 617 | { ITEM_ID_PGDN, DIK_NEXT, VK_NEXT, 0 }, |
| 618 | { ITEM_ID_INSERT, DIK_INSERT, VK_INSERT, 0 }, |
| 619 | { ITEM_ID_DEL, DIK_DELETE, VK_DELETE, 0 }, |
| 620 | { ITEM_ID_LWIN, DIK_LWIN, VK_LWIN, 0 }, |
| 621 | { ITEM_ID_RWIN, DIK_RWIN, VK_RWIN, 0 }, |
| 622 | { ITEM_ID_MENU, DIK_APPS, VK_APPS, 0 }, |
| 623 | { ITEM_ID_PAUSE, DIK_PAUSE, VK_PAUSE, 0 }, |
| 624 | { ITEM_ID_CANCEL, 0, VK_CANCEL, 0 }, |
| 625 | }; |
| 626 | |
| 627 | |
| 628 | |
| 629 | typedef struct |
| 630 | { |
| 631 | char name[40]; // functionality name (optional) |
| 632 | input_seq is; // the input sequence (the keys pressed) |
| 633 | UINT func_id; // the identifier |
| 634 | input_seq* (*getiniptr)(void);// pointer to function to get the value from .ini file |
| 635 | } GUISequence; |
| 636 | |
| 637 | static GUISequence GUISequenceControl[]= |
| 638 | { |
| 639 | {"gui_key_up", SEQ_DEF_0, ID_UI_UP, Get_ui_key_up }, |
| 640 | {"gui_key_down", SEQ_DEF_0, ID_UI_DOWN, Get_ui_key_down }, |
| 641 | {"gui_key_left", SEQ_DEF_0, ID_UI_LEFT, Get_ui_key_left }, |
| 642 | {"gui_key_right", SEQ_DEF_0, ID_UI_RIGHT, Get_ui_key_right }, |
| 643 | {"gui_key_start", SEQ_DEF_0, ID_UI_START, Get_ui_key_start }, |
| 644 | {"gui_key_pgup", SEQ_DEF_0, ID_UI_PGUP, Get_ui_key_pgup }, |
| 645 | {"gui_key_pgdwn", SEQ_DEF_0, ID_UI_PGDOWN, Get_ui_key_pgdwn }, |
| 646 | {"gui_key_home", SEQ_DEF_0, ID_UI_HOME, Get_ui_key_home }, |
| 647 | {"gui_key_end", SEQ_DEF_0, ID_UI_END, Get_ui_key_end }, |
| 648 | {"gui_key_ss_change", SEQ_DEF_0, IDC_SSFRAME, Get_ui_key_ss_change }, |
| 649 | {"gui_key_history_up", SEQ_DEF_0, ID_UI_HISTORY_UP, Get_ui_key_history_up }, |
| 650 | {"gui_key_history_down", SEQ_DEF_0, ID_UI_HISTORY_DOWN, Get_ui_key_history_down }, |
| 651 | |
| 652 | {"gui_key_context_filters", SEQ_DEF_0, ID_CONTEXT_FILTERS, Get_ui_key_context_filters }, |
| 653 | {"gui_key_select_random", SEQ_DEF_0, ID_CONTEXT_SELECT_RANDOM, Get_ui_key_select_random }, |
| 654 | {"gui_key_game_audit", SEQ_DEF_0, ID_GAME_AUDIT, Get_ui_key_game_audit }, |
| 655 | {"gui_key_game_properties", SEQ_DEF_0, ID_GAME_PROPERTIES, Get_ui_key_game_properties }, |
| 656 | {"gui_key_help_contents", SEQ_DEF_0, ID_HELP_CONTENTS, Get_ui_key_help_contents }, |
| 657 | {"gui_key_update_gamelist", SEQ_DEF_0, ID_UPDATE_GAMELIST, Get_ui_key_update_gamelist }, |
| 658 | {"gui_key_view_folders", SEQ_DEF_0, ID_VIEW_FOLDERS, Get_ui_key_view_folders }, |
| 659 | {"gui_key_view_fullscreen", SEQ_DEF_0, ID_VIEW_FULLSCREEN, Get_ui_key_view_fullscreen }, |
| 660 | {"gui_key_view_pagetab", SEQ_DEF_0, ID_VIEW_PAGETAB, Get_ui_key_view_pagetab }, |
| 661 | {"gui_key_view_picture_area", SEQ_DEF_0, ID_VIEW_PICTURE_AREA, Get_ui_key_view_picture_area }, |
| 662 | {"gui_key_view_status", SEQ_DEF_0, ID_VIEW_STATUS, Get_ui_key_view_status }, |
| 663 | {"gui_key_view_toolbars", SEQ_DEF_0, ID_VIEW_TOOLBARS, Get_ui_key_view_toolbars }, |
| 664 | |
| 665 | {"gui_key_view_tab_cabinet", SEQ_DEF_0, ID_VIEW_TAB_CABINET, Get_ui_key_view_tab_cabinet }, |
| 666 | {"gui_key_view_tab_cpanel", SEQ_DEF_0, ID_VIEW_TAB_CONTROL_PANEL, Get_ui_key_view_tab_cpanel }, |
| 667 | {"gui_key_view_tab_flyer", SEQ_DEF_0, ID_VIEW_TAB_FLYER, Get_ui_key_view_tab_flyer }, |
| 668 | {"gui_key_view_tab_history", SEQ_DEF_0, ID_VIEW_TAB_HISTORY, Get_ui_key_view_tab_history }, |
| 669 | {"gui_key_view_tab_marquee", SEQ_DEF_0, ID_VIEW_TAB_MARQUEE, Get_ui_key_view_tab_marquee }, |
| 670 | {"gui_key_view_tab_screenshot", SEQ_DEF_0, ID_VIEW_TAB_SCREENSHOT, Get_ui_key_view_tab_screenshot }, |
| 671 | {"gui_key_view_tab_title", SEQ_DEF_0, ID_VIEW_TAB_TITLE, Get_ui_key_view_tab_title }, |
| 672 | {"gui_key_view_tab_pcb", SEQ_DEF_0, ID_VIEW_TAB_PCB, Get_ui_key_view_tab_pcb }, |
| 673 | {"gui_key_quit", SEQ_DEF_0, ID_FILE_EXIT, Get_ui_key_quit }, |
| 674 | }; |
| 675 | |
| 676 | |
| 677 | #define NUM_GUI_SEQUENCES (sizeof(GUISequenceControl) / sizeof(GUISequenceControl[0])) |
| 678 | |
| 679 | |
| 680 | static UINT lastColumnClick = 0; |
| 681 | static WNDPROC g_lpHistoryWndProc = NULL; |
| 682 | static WNDPROC g_lpPictureFrameWndProc = NULL; |
| 683 | static WNDPROC g_lpPictureWndProc = NULL; |
| 684 | |
| 685 | static POPUPSTRING popstr[MAX_MENUS + 1]; |
| 686 | |
| 687 | /* Tool and Status bar variables */ |
| 688 | static HWND hStatusBar = 0; |
| 689 | static HWND hToolBar = 0; |
| 690 | |
| 691 | /* Column Order as Displayed */ |
| 692 | static BOOL oldControl = FALSE; |
| 693 | static BOOL xpControl = FALSE; |
| 694 | |
| 695 | /* Used to recalculate the main window layout */ |
| 696 | static int bottomMargin; |
| 697 | static int topMargin; |
| 698 | static int have_history = FALSE; |
| 699 | |
| 700 | static BOOL have_selection = FALSE; |
| 701 | |
| 702 | static HBITMAP hMissing_bitmap; |
| 703 | |
| 704 | /* Icon variables */ |
| 705 | static HIMAGELIST hLarge = NULL; |
| 706 | static HIMAGELIST hSmall = NULL; |
| 707 | static HIMAGELIST hHeaderImages = NULL; |
| 708 | static int *icon_index = NULL; /* for custom per-game icons */ |
| 709 | |
| 710 | static TBBUTTON tbb[] = |
| 711 | { |
| 712 | {0, ID_VIEW_FOLDERS, TBSTATE_ENABLED, TBSTYLE_CHECK, {0, 0}, 0, 0}, |
| 713 | {1, ID_VIEW_PICTURE_AREA,TBSTATE_ENABLED, TBSTYLE_CHECK, {0, 0}, 0, 1}, |
| 714 | {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0}, |
| 715 | {2, ID_VIEW_LARGE_ICON, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 2}, |
| 716 | {3, ID_VIEW_SMALL_ICON, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 3}, |
| 717 | {4, ID_VIEW_LIST_MENU, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 4}, |
| 718 | {5, ID_VIEW_DETAIL, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 5}, |
| 719 | {6, ID_VIEW_GROUPED, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, {0, 0}, 0, 6}, |
| 720 | {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0}, |
| 721 | {7, ID_HELP_ABOUT, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 7}, |
| 722 | {8, ID_HELP_CONTENTS, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 8} |
| 723 | }; |
| 724 | |
| 725 | #define NUM_TOOLBUTTONS (sizeof(tbb) / sizeof(tbb[0])) |
| 726 | |
| 727 | #define NUM_TOOLTIPS 8 |
| 728 | |
| 729 | static const TCHAR szTbStrings[NUM_TOOLTIPS + 1][30] = |
| 730 | { |
| 731 | TEXT("Toggle Folder List"), |
| 732 | TEXT("Toggle Screen Shot"), |
| 733 | TEXT("Large Icons"), |
| 734 | TEXT("Small Icons"), |
| 735 | TEXT("List"), |
| 736 | TEXT("Details"), |
| 737 | TEXT("Grouped"), |
| 738 | TEXT("About"), |
| 739 | TEXT("Help") |
| 740 | }; |
| 741 | |
| 742 | static const int CommandToString[] = |
| 743 | { |
| 744 | ID_VIEW_FOLDERS, |
| 745 | ID_VIEW_PICTURE_AREA, |
| 746 | ID_VIEW_LARGE_ICON, |
| 747 | ID_VIEW_SMALL_ICON, |
| 748 | ID_VIEW_LIST_MENU, |
| 749 | ID_VIEW_DETAIL, |
| 750 | ID_VIEW_GROUPED, |
| 751 | ID_HELP_ABOUT, |
| 752 | ID_HELP_CONTENTS, |
| 753 | -1 |
| 754 | }; |
| 755 | |
| 756 | static const int s_nPickers[] = |
| 757 | { |
| 758 | IDC_LIST |
| 759 | #ifdef MESS |
| 760 | ,IDC_SWLIST |
| 761 | #endif |
| 762 | }; |
| 763 | |
| 764 | /* How to resize main window */ |
| 765 | static ResizeItem main_resize_items[] = |
| 766 | { |
| 767 | { RA_HWND, { 0 }, FALSE, RA_LEFT | RA_RIGHT | RA_TOP, NULL }, |
| 768 | { RA_HWND, { 0 }, FALSE, RA_LEFT | RA_RIGHT | RA_BOTTOM, NULL }, |
| 769 | { RA_ID, { IDC_DIVIDER }, FALSE, RA_LEFT | RA_RIGHT | RA_TOP, NULL }, |
| 770 | { RA_ID, { IDC_TREE }, TRUE, RA_LEFT | RA_BOTTOM | RA_TOP, NULL }, |
| 771 | { RA_ID, { IDC_LIST }, TRUE, RA_ALL, NULL }, |
| 772 | { RA_ID, { IDC_SPLITTER }, FALSE, RA_LEFT | RA_BOTTOM | RA_TOP, NULL }, |
| 773 | { RA_ID, { IDC_SPLITTER2 },FALSE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 774 | { RA_ID, { IDC_SSFRAME }, FALSE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 775 | { RA_ID, { IDC_SSPICTURE },FALSE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 776 | { RA_ID, { IDC_HISTORY }, TRUE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 777 | { RA_ID, { IDC_SSTAB }, FALSE, RA_RIGHT | RA_TOP, NULL }, |
| 778 | #ifdef MESS |
| 779 | { RA_ID, { IDC_SWLIST }, TRUE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 780 | { RA_ID, { IDC_SPLITTER3 },FALSE, RA_RIGHT | RA_BOTTOM | RA_TOP, NULL }, |
| 781 | #endif /* MESS */ |
| 782 | { RA_END, { 0 }, FALSE, 0, NULL } |
| 783 | }; |
| 784 | |
| 785 | static Resize main_resize = { {0, 0, 0, 0}, main_resize_items }; |
| 786 | |
| 787 | /* last directory for common file dialogs */ |
| 788 | TCHAR last_directory[MAX_PATH]; |
| 789 | |
| 790 | /* system-wide window message sent out with an ATOM of the current game name |
| 791 | each time it changes */ |
| 792 | static UINT g_mame32_message = 0; |
| 793 | static BOOL g_bDoBroadcast = FALSE; |
| 794 | |
| 795 | static BOOL use_gui_romloading = FALSE; |
| 796 | |
| 797 | static BOOL g_listview_dragging = FALSE; |
| 798 | HIMAGELIST himl_drag; |
| 799 | int game_dragged; /* which game started the drag */ |
| 800 | HTREEITEM prev_drag_drop_target; /* which tree view item we're currently highlighting */ |
| 801 | |
| 802 | static BOOL g_in_treeview_edit = FALSE; |
| 803 | |
| 804 | typedef struct |
| 805 | { |
| 806 | const char *name; |
| 807 | int index; |
| 808 | } driver_data_type; |
| 809 | static driver_data_type *sorted_drivers; |
| 810 | |
| 811 | /*************************************************************************** |
| 812 | Global variables |
| 813 | ***************************************************************************/ |
| 814 | |
| 815 | /* Background Image handles also accessed from TreeView.c */ |
| 816 | static HPALETTE hPALbg = 0; |
| 817 | static HBITMAP hBackground = 0; |
| 818 | static MYBITMAPINFO bmDesc; |
| 819 | |
| 820 | /* List view Column text */ |
| 821 | LPCTSTR column_names[COLUMN_MAX] = |
| 822 | { |
| 823 | #ifdef MESS |
| 824 | TEXT("System"), |
| 825 | #else |
| 826 | TEXT("Game"), |
| 827 | #endif |
| 828 | TEXT("Screen"), |
| 829 | //TEXT("ROMs"), |
| 830 | TEXT("Samples"), |
| 831 | TEXT("Directory"), |
| 832 | TEXT("Type"), |
| 833 | TEXT("Trackball"), |
| 834 | TEXT("Played"), |
| 835 | TEXT("Manufacturer"), |
| 836 | TEXT("Year"), |
| 837 | TEXT("Clone Of"), |
| 838 | TEXT("Source"), |
| 839 | TEXT("Play Time") |
| 840 | }; |
| 841 | |
| 842 | /*************************************************************************** |
| 843 | Message Macros |
| 844 | ***************************************************************************/ |
| 845 | |
| 846 | #ifndef StatusBar_GetItemRect |
| 847 | #define StatusBar_GetItemRect(hWnd, iPart, lpRect) \ |
| 848 | SendMessage(hWnd, SB_GETRECT, (WPARAM) iPart, (LPARAM) (LPRECT) lpRect) |
| 849 | #endif |
| 850 | |
| 851 | #ifndef ToolBar_CheckButton |
| 852 | #define ToolBar_CheckButton(hWnd, idButton, fCheck) \ |
| 853 | SendMessage(hWnd, TB_CHECKBUTTON, (WPARAM)idButton, (LPARAM)MAKELONG(fCheck, 0)) |
| 854 | #endif |
| 855 | |
| 856 | /*************************************************************************** |
| 857 | External functions |
| 858 | ***************************************************************************/ |
| 859 | #if 0 |
| 860 | static void CopyOptions(core_options *pDestOpts, core_options *pSourceOpts) |
| 861 | { |
| 862 | options_enumerator *enumerator; |
| 863 | const char *option_name; |
| 864 | const char *option_value; |
| 865 | |
| 866 | enumerator = options_enumerator_begin(pSourceOpts); |
| 867 | if (enumerator != NULL) |
| 868 | { |
| 869 | while((option_name = options_enumerator_next(enumerator)) != NULL) |
| 870 | { |
| 871 | option_value = options_get_string(pSourceOpts, option_name); |
| 872 | if (option_value != NULL) |
| 873 | { |
| 874 | dprintf("CopyOptions(): Copying %s = \"%s\"\n", option_name, option_value); |
| 875 | options_set_string(pDestOpts, option_name, option_value, OPTION_PRIORITY_CMDLINE); |
| 876 | } |
| 877 | } |
| 878 | options_enumerator_free(enumerator); |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | static BOOL WaitWithMessageLoop(HANDLE hEvent) |
| 883 | { |
| 884 | DWORD dwRet; |
| 885 | MSG msg; |
| 886 | |
| 887 | while (1) |
| 888 | { |
| 889 | dwRet = MsgWaitForMultipleObjects(1, &hEvent, FALSE, INFINITE, QS_ALLINPUT); |
| 890 | |
| 891 | if (dwRet == WAIT_OBJECT_0) |
| 892 | return TRUE; |
| 893 | |
| 894 | if (dwRet != WAIT_OBJECT_0 + 1) |
| 895 | break; |
| 896 | |
| 897 | while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) |
| 898 | { |
| 899 | TranslateMessage(&msg); |
| 900 | DispatchMessage(&msg); |
| 901 | if (WaitForSingleObject(hEvent, 0) == WAIT_OBJECT_0) |
| 902 | return TRUE; |
| 903 | } |
| 904 | } |
| 905 | return FALSE; |
| 906 | } |
| 907 | #endif |
| 908 | |
| 909 | static DWORD RunMAME(int nGameIndex, const play_options *playopts) |
| 910 | { |
| 911 | time_t start, end; |
| 912 | double elapsedtime; |
| 913 | DWORD dwExitCode = 0; |
| 914 | int i; |
| 915 | core_options *mame_opts; |
| 916 | |
| 917 | // set up MAME options |
| 918 | mame_opts = mame_options_init(mame_win_options); |
| 919 | |
| 920 | // Tell mame were to get the INIs |
| 921 | options_set_string(mame_opts, OPTION_INIPATH, GetIniDir(), OPTION_PRIORITY_CMDLINE); |
| 922 | |
| 923 | #ifdef MESS |
| 924 | // add MESS specific device options |
| 925 | mess_add_device_options(mame_opts, drivers[nGameIndex]); |
| 926 | #endif // MESS |
| 927 | |
| 928 | // set any specified play options |
| 929 | if (playopts != NULL) |
| 930 | { |
| 931 | if (playopts->record != NULL) |
| 932 | options_set_string(mame_opts, OPTION_RECORD, playopts->record, OPTION_PRIORITY_CMDLINE); |
| 933 | if (playopts->playback != NULL) |
| 934 | options_set_string(mame_opts, OPTION_PLAYBACK, playopts->playback, OPTION_PRIORITY_CMDLINE); |
| 935 | if (playopts->state != NULL) |
| 936 | options_set_string(mame_opts, OPTION_STATE, playopts->state, OPTION_PRIORITY_CMDLINE); |
| 937 | if (playopts->wavwrite != NULL) |
| 938 | options_set_string(mame_opts, OPTION_WAVWRITE, playopts->wavwrite, OPTION_PRIORITY_CMDLINE); |
| 939 | if (playopts->mngwrite != NULL) |
| 940 | options_set_string(mame_opts, OPTION_MNGWRITE, playopts->mngwrite, OPTION_PRIORITY_CMDLINE); |
| 941 | } |
| 942 | |
| 943 | // Mame will parse all the needed .ini files. |
| 944 | |
| 945 | // prepare MAME32 to run the game |
| 946 | ShowWindow(hMain, SW_HIDE); |
| 947 | |
| 948 | for (i = 0; i < ARRAY_LENGTH(s_nPickers); i++) |
| 949 | Picker_ClearIdle(GetDlgItem(hMain, s_nPickers[i])); |
| 950 | |
| 951 | // run the emulation |
| 952 | options_set_string(mame_opts, OPTION_GAMENAME, drivers[nGameIndex]->name, OPTION_PRIORITY_CMDLINE); |
| 953 | // Time the game run. |
| 954 | time(&start); |
| 955 | mame_execute(mame_opts); |
| 956 | // Calc the duration |
| 957 | time(&end); |
| 958 | elapsedtime = end - start; |
| 959 | // Increment our playtime. |
| 960 | IncrementPlayTime(nGameIndex, elapsedtime); |
| 961 | // the emulation is complete; continue |
| 962 | for (i = 0; i < ARRAY_LENGTH(s_nPickers); i++) |
| 963 | Picker_ResetIdle(GetDlgItem(hMain, s_nPickers[i])); |
| 964 | ShowWindow(hMain, SW_SHOW); |
| 965 | SetForegroundWindow(hMain); |
| 966 | |
| 967 | return dwExitCode; |
| 968 | } |
| 969 | |
| 970 | int MameUIMain(HINSTANCE hInstance, |
| 971 | LPSTR lpCmdLine, |
| 972 | int nCmdShow) |
| 973 | { |
| 974 | dprintf("MAMEUI starting\n"); |
| 975 | |
| 976 | use_gui_romloading = TRUE; |
| 977 | |
| 978 | if (__argc != 1) |
| 979 | { |
| 980 | /* Rename main because gcc will use it instead of WinMain even with -mwindows */ |
| 981 | extern int /*DECL_SPEC*/ utf8_main(int, char**); |
| 982 | exit(utf8_main(__argc, __argv)); |
| 983 | } |
| 984 | if (!Win32UI_init(hInstance, lpCmdLine, nCmdShow)) |
| 985 | return 1; |
| 986 | |
| 987 | // pump message, but quit on WM_QUIT |
| 988 | while(PumpMessage()) |
| 989 | ; |
| 990 | |
| 991 | Win32UI_exit(); |
| 992 | return 0; |
| 993 | } |
| 994 | |
| 995 | |
| 996 | HWND GetMainWindow(void) |
| 997 | { |
| 998 | return hMain; |
| 999 | } |
| 1000 | |
| 1001 | HWND GetTreeView(void) |
| 1002 | { |
| 1003 | return hTreeView; |
| 1004 | } |
| 1005 | |
| 1006 | HIMAGELIST GetLargeImageList(void) |
| 1007 | { |
| 1008 | return hLarge; |
| 1009 | } |
| 1010 | |
| 1011 | HIMAGELIST GetSmallImageList(void) |
| 1012 | { |
| 1013 | return hSmall; |
| 1014 | } |
| 1015 | |
| 1016 | object_pool *GetMameUIMemoryPool(void) |
| 1017 | { |
| 1018 | return mameui_pool; |
| 1019 | } |
| 1020 | |
| 1021 | void GetRealColumnOrder(int order[]) |
| 1022 | { |
| 1023 | int tmpOrder[COLUMN_MAX]; |
| 1024 | int nColumnMax; |
| 1025 | int i; |
| 1026 | |
| 1027 | nColumnMax = Picker_GetNumColumns(hwndList); |
| 1028 | |
| 1029 | /* Get the Column Order and save it */ |
| 1030 | if (!oldControl) |
| 1031 | { |
| 1032 | ListView_GetColumnOrderArray(hwndList, nColumnMax, tmpOrder); |
| 1033 | |
| 1034 | for (i = 0; i < nColumnMax; i++) |
| 1035 | { |
| 1036 | order[i] = Picker_GetRealColumnFromViewColumn(hwndList, tmpOrder[i]); |
| 1037 | } |
| 1038 | } |
| 1039 | } |
| 1040 | |
| 1041 | /* |
| 1042 | * PURPOSE: Format raw data read from an ICO file to an HICON |
| 1043 | * PARAMS: PBYTE ptrBuffer - Raw data from an ICO file |
| 1044 | * UINT nBufferSize - Size of buffer ptrBuffer |
| 1045 | * RETURNS: HICON - handle to the icon, NULL for failure |
| 1046 | * History: July '95 - Created |
| 1047 | * March '00- Seriously butchered from MSDN for mine own |
| 1048 | * purposes, sayeth H0ek. |
| 1049 | */ |
| 1050 | HICON FormatICOInMemoryToHICON(PBYTE ptrBuffer, UINT nBufferSize) |
| 1051 | { |
| 1052 | ICONIMAGE IconImage; |
| 1053 | LPICONDIRENTRY lpIDE = NULL; |
| 1054 | UINT nNumImages; |
| 1055 | UINT nBufferIndex = 0; |
| 1056 | HICON hIcon = NULL; |
| 1057 | |
| 1058 | /* Is there a WORD? */ |
| 1059 | if (nBufferSize < sizeof(WORD)) |
| 1060 | { |
| 1061 | return NULL; |
| 1062 | } |
| 1063 | |
| 1064 | /* Was it 'reserved' ? (ie 0) */ |
| 1065 | if ((WORD)(ptrBuffer[nBufferIndex]) != 0) |
| 1066 | { |
| 1067 | return NULL; |
| 1068 | } |
| 1069 | |
| 1070 | nBufferIndex += sizeof(WORD); |
| 1071 | |
| 1072 | /* Is there a WORD? */ |
| 1073 | if (nBufferSize - nBufferIndex < sizeof(WORD)) |
| 1074 | { |
| 1075 | return NULL; |
| 1076 | } |
| 1077 | |
| 1078 | /* Was it type 1? */ |
| 1079 | if ((WORD)(ptrBuffer[nBufferIndex]) != 1) |
| 1080 | { |
| 1081 | return NULL; |
| 1082 | } |
| 1083 | |
| 1084 | nBufferIndex += sizeof(WORD); |
| 1085 | |
| 1086 | /* Is there a WORD? */ |
| 1087 | if (nBufferSize - nBufferIndex < sizeof(WORD)) |
| 1088 | { |
| 1089 | return NULL; |
| 1090 | } |
| 1091 | |
| 1092 | /* Then that's the number of images in the ICO file */ |
| 1093 | nNumImages = (WORD)(ptrBuffer[nBufferIndex]); |
| 1094 | |
| 1095 | /* Is there at least one icon in the file? */ |
| 1096 | if ( nNumImages < 1 ) |
| 1097 | { |
| 1098 | return NULL; |
| 1099 | } |
| 1100 | |
| 1101 | nBufferIndex += sizeof(WORD); |
| 1102 | |
| 1103 | /* Is there enough space for the icon directory entries? */ |
| 1104 | if ((nBufferIndex + nNumImages * sizeof(ICONDIRENTRY)) > nBufferSize) |
| 1105 | { |
| 1106 | return NULL; |
| 1107 | } |
| 1108 | |
| 1109 | /* Assign icon directory entries from buffer */ |
| 1110 | lpIDE = (LPICONDIRENTRY)(&ptrBuffer[nBufferIndex]); |
| 1111 | nBufferIndex += nNumImages * sizeof (ICONDIRENTRY); |
| 1112 | |
| 1113 | IconImage.dwNumBytes = lpIDE->dwBytesInRes; |
| 1114 | |
| 1115 | /* Seek to beginning of this image */ |
| 1116 | if ( lpIDE->dwImageOffset > nBufferSize ) |
| 1117 | { |
| 1118 | return NULL; |
| 1119 | } |
| 1120 | |
| 1121 | nBufferIndex = lpIDE->dwImageOffset; |
| 1122 | |
| 1123 | /* Read it in */ |
| 1124 | if ((nBufferIndex + lpIDE->dwBytesInRes) > nBufferSize) |
| 1125 | { |
| 1126 | return NULL; |
| 1127 | } |
| 1128 | |
| 1129 | IconImage.lpBits = &ptrBuffer[nBufferIndex]; |
| 1130 | nBufferIndex += lpIDE->dwBytesInRes; |
| 1131 | #if 0 // Not sure we want odd sized icons. |
| 1132 | hIcon = CreateIconFromResourceEx(IconImage.lpBits, IconImage.dwNumBytes, TRUE, 0x00030000, |
| 1133 | (*(LPBITMAPINFOHEADER)(IconImage.lpBits)).biWidth, (*(LPBITMAPINFOHEADER)(IconImage.lpBits)).biHeight/2, 0 ); |
| 1134 | #endif |
| 1135 | /* It failed, odds are good we're on NT so try the non-Ex way */ |
| 1136 | if (hIcon == NULL) |
| 1137 | { |
| 1138 | /* We would break on NT if we try with a 16bpp image */ |
| 1139 | if (((LPBITMAPINFO)IconImage.lpBits)->bmiHeader.biBitCount != 16) |
| 1140 | { |
| 1141 | hIcon = CreateIconFromResource(IconImage.lpBits, IconImage.dwNumBytes, TRUE, 0x00030000); |
| 1142 | } |
| 1143 | } |
| 1144 | return hIcon; |
| 1145 | } |
| 1146 | |
| 1147 | HICON LoadIconFromFile(const char *iconname) |
| 1148 | { |
| 1149 | HICON hIcon = 0; |
| 1150 | struct stat file_stat; |
| 1151 | char tmpStr[MAX_PATH]; |
| 1152 | char tmpIcoName[MAX_PATH]; |
| 1153 | const char* sDirName = GetImgDir(); |
| 1154 | PBYTE bufferPtr; |
| 1155 | zip_error ziperr; |
| 1156 | zip_file *zip; |
| 1157 | const zip_file_header *entry; |
| 1158 | |
| 1159 | sprintf(tmpStr, "%s/%s.ico", GetIconsDir(), iconname); |
| 1160 | if (stat(tmpStr, &file_stat) != 0 |
| 1161 | || (hIcon = win_extract_icon_utf8(hInst, tmpStr, 0)) == 0) |
| 1162 | { |
| 1163 | sprintf(tmpStr, "%s/%s.ico", sDirName, iconname); |
| 1164 | if (stat(tmpStr, &file_stat) != 0 |
| 1165 | || (hIcon = win_extract_icon_utf8(hInst, tmpStr, 0)) == 0) |
| 1166 | { |
| 1167 | sprintf(tmpStr, "%s/icons.zip", GetIconsDir()); |
| 1168 | sprintf(tmpIcoName, "%s.ico", iconname); |
| 1169 | |
| 1170 | ziperr = zip_file_open(tmpStr, &zip); |
| 1171 | if (ziperr == ZIPERR_NONE) |
| 1172 | { |
| 1173 | entry = zip_file_first_file(zip); |
| 1174 | while(!hIcon && entry) |
| 1175 | { |
| 1176 | if (!mame_stricmp(entry->filename, tmpIcoName)) |
| 1177 | { |
| 1178 | bufferPtr = malloc(entry->uncompressed_length); |
| 1179 | if (bufferPtr) |
| 1180 | { |
| 1181 | ziperr = zip_file_decompress(zip, bufferPtr, entry->uncompressed_length); |
| 1182 | if (ziperr == ZIPERR_NONE) |
| 1183 | { |
| 1184 | hIcon = FormatICOInMemoryToHICON(bufferPtr, entry->uncompressed_length); |
| 1185 | } |
| 1186 | free(bufferPtr); |
| 1187 | } |
| 1188 | } |
| 1189 | entry = zip_file_next_file(zip); |
| 1190 | } |
| 1191 | zip_file_close(zip); |
| 1192 | } |
| 1193 | } |
| 1194 | } |
| 1195 | return hIcon; |
| 1196 | } |
| 1197 | |
| 1198 | /* Return the number of folders with options */ |
| 1199 | int GetNumOptionFolders() |
| 1200 | { |
| 1201 | return optionfolder_count; |
| 1202 | } |
| 1203 | |
| 1204 | /* Return the number of folders with options */ |
| 1205 | void SetNumOptionFolders(int count) |
| 1206 | { |
| 1207 | optionfolder_count = count; |
| 1208 | } |
| 1209 | |
| 1210 | /* search */ |
| 1211 | const char * GetSearchText(void) |
| 1212 | { |
| 1213 | return g_SearchText; |
| 1214 | } |
| 1215 | |
| 1216 | |
| 1217 | /* Sets the treeview and listviews sizes in accordance with their visibility and the splitters */ |
| 1218 | static void ResizeTreeAndListViews(BOOL bResizeHidden) |
| 1219 | { |
| 1220 | int i; |
| 1221 | int nLastWidth = 0; |
| 1222 | int nLastWidth2 = 0; |
| 1223 | int nLeftWindowWidth = 0; |
| 1224 | RECT rect; |
| 1225 | BOOL bVisible; |
| 1226 | int nLastOverlap = -1; |
| 1227 | |
| 1228 | /* Size the List Control in the Picker */ |
| 1229 | GetClientRect(hMain, &rect); |
| 1230 | |
| 1231 | if (bShowStatusBar) |
| 1232 | rect.bottom -= bottomMargin; |
| 1233 | if (bShowToolBar) |
| 1234 | rect.top += topMargin; |
| 1235 | |
| 1236 | /* Tree control */ |
| 1237 | ShowWindow(GetDlgItem(hMain, IDC_TREE), bShowTree ? SW_SHOW : SW_HIDE); |
| 1238 | |
| 1239 | for (i = 0; g_splitterInfo[i].nSplitterWindow; i++) |
| 1240 | { |
| 1241 | bVisible = GetWindowLong(GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow), GWL_STYLE) & WS_VISIBLE ? TRUE : FALSE; |
| 1242 | if (bResizeHidden || bVisible) |
| 1243 | { |
| 1244 | nLeftWindowWidth = nSplitterOffset[i] - SPLITTER_WIDTH/2 - nLastWidth; |
| 1245 | |
| 1246 | /* special case for the rightmost pane when the screenshot is gone */ |
| 1247 | if (!GetShowScreenShot() && !g_splitterInfo[i+1].nSplitterWindow) |
| 1248 | nLeftWindowWidth = rect.right - nLastWidth; |
| 1249 | |
| 1250 | /* woah? are we overlapping ourselves? */ |
| 1251 | if (nLeftWindowWidth < MIN_VIEW_WIDTH) |
| 1252 | { |
| 1253 | nLastOverlap = i; |
| 1254 | nLastWidth = nLastWidth2; |
| 1255 | nLeftWindowWidth = nSplitterOffset[i] - MIN_VIEW_WIDTH - (SPLITTER_WIDTH*3/2) - nLastWidth; |
| 1256 | i--; |
| 1257 | } |
| 1258 | |
| 1259 | MoveWindow(GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow), nLastWidth, rect.top + 2, |
| 1260 | nLeftWindowWidth, (rect.bottom - rect.top) - 4 , TRUE); |
| 1261 | |
| 1262 | MoveWindow(GetDlgItem(hMain, g_splitterInfo[i].nSplitterWindow), nSplitterOffset[i], rect.top + 2, |
| 1263 | SPLITTER_WIDTH, (rect.bottom - rect.top) - 4, TRUE); |
| 1264 | } |
| 1265 | |
| 1266 | if (bVisible) |
| 1267 | { |
| 1268 | nLastWidth2 = nLastWidth; |
| 1269 | nLastWidth += nLeftWindowWidth + SPLITTER_WIDTH; |
| 1270 | } |
| 1271 | } |
| 1272 | } |
| 1273 | |
| 1274 | /* Adjust the list view and screenshot button based on GetShowScreenShot() */ |
| 1275 | void UpdateScreenShot(void) |
| 1276 | { |
| 1277 | RECT rect; |
| 1278 | int nWidth; |
| 1279 | RECT fRect; |
| 1280 | POINT p = {0, 0}; |
| 1281 | |
| 1282 | /* first time through can't do this stuff */ |
| 1283 | if (hwndList == NULL) |
| 1284 | return; |
| 1285 | |
| 1286 | /* Size the List Control in the Picker */ |
| 1287 | GetClientRect(hMain, &rect); |
| 1288 | |
| 1289 | if (bShowStatusBar) |
| 1290 | rect.bottom -= bottomMargin; |
| 1291 | if (bShowToolBar) |
| 1292 | rect.top += topMargin; |
| 1293 | |
| 1294 | if (GetShowScreenShot()) |
| 1295 | { |
| 1296 | nWidth = nSplitterOffset[GetSplitterCount() - 1]; |
| 1297 | CheckMenuItem(GetMenu(hMain),ID_VIEW_PICTURE_AREA, MF_CHECKED); |
| 1298 | ToolBar_CheckButton(hToolBar, ID_VIEW_PICTURE_AREA, MF_CHECKED); |
| 1299 | } |
| 1300 | else |
| 1301 | { |
| 1302 | nWidth = rect.right; |
| 1303 | CheckMenuItem(GetMenu(hMain),ID_VIEW_PICTURE_AREA, MF_UNCHECKED); |
| 1304 | ToolBar_CheckButton(hToolBar, ID_VIEW_PICTURE_AREA, MF_UNCHECKED); |
| 1305 | } |
| 1306 | |
| 1307 | ResizeTreeAndListViews(FALSE); |
| 1308 | |
| 1309 | FreeScreenShot(); |
| 1310 | |
| 1311 | if (have_selection) |
| 1312 | { |
| 1313 | #ifdef MESS |
| 1314 | if (!g_szSelectedItem[0] || !LoadScreenShotEx(Picker_GetSelectedItem(hwndList), g_szSelectedItem, |
| 1315 | TabView_GetCurrentTab(hTabCtrl))) |
| 1316 | #endif |
| 1317 | // load and set image, or empty it if we don't have one |
| 1318 | LoadScreenShot(Picker_GetSelectedItem(hwndList), TabView_GetCurrentTab(hTabCtrl)); |
| 1319 | } |
| 1320 | |
| 1321 | // figure out if we have a history or not, to place our other windows properly |
| 1322 | UpdateHistory(); |
| 1323 | |
| 1324 | // setup the picture area |
| 1325 | |
| 1326 | if (GetShowScreenShot()) |
| 1327 | { |
| 1328 | DWORD dwStyle; |
| 1329 | DWORD dwStyleEx; |
| 1330 | BOOL showing_history; |
| 1331 | |
| 1332 | ClientToScreen(hMain, &p); |
| 1333 | GetWindowRect(GetDlgItem(hMain, IDC_SSFRAME), &fRect); |
| 1334 | OffsetRect(&fRect, -p.x, -p.y); |
| 1335 | |
| 1336 | // show history on this tab IFF |
| 1337 | // - we have history for the game |
| 1338 | // - we're on the first tab |
| 1339 | // - we DON'T have a separate history tab |
| 1340 | showing_history = (have_history && (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() || GetHistoryTab() == TAB_ALL ) && |
| 1341 | GetShowTab(TAB_HISTORY) == FALSE); |
| 1342 | CalculateBestScreenShotRect(GetDlgItem(hMain, IDC_SSFRAME), &rect,showing_history); |
| 1343 | |
| 1344 | dwStyle = GetWindowLong(GetDlgItem(hMain, IDC_SSPICTURE), GWL_STYLE); |
| 1345 | dwStyleEx = GetWindowLong(GetDlgItem(hMain, IDC_SSPICTURE), GWL_EXSTYLE); |
| 1346 | |
| 1347 | AdjustWindowRectEx(&rect, dwStyle, FALSE, dwStyleEx); |
| 1348 | MoveWindow(GetDlgItem(hMain, IDC_SSPICTURE), |
| 1349 | fRect.left + rect.left, |
| 1350 | fRect.top + rect.top, |
| 1351 | rect.right - rect.left, |
| 1352 | rect.bottom - rect.top, |
| 1353 | TRUE); |
| 1354 | |
| 1355 | ShowWindow(GetDlgItem(hMain,IDC_SSPICTURE), |
| 1356 | (TabView_GetCurrentTab(hTabCtrl) != TAB_HISTORY) ? SW_SHOW : SW_HIDE); |
| 1357 | ShowWindow(GetDlgItem(hMain,IDC_SSFRAME),SW_SHOW); |
| 1358 | ShowWindow(GetDlgItem(hMain,IDC_SSTAB),bShowTabCtrl ? SW_SHOW : SW_HIDE); |
| 1359 | |
| 1360 | InvalidateRect(GetDlgItem(hMain,IDC_SSPICTURE),NULL,FALSE); |
| 1361 | } |
| 1362 | else |
| 1363 | { |
| 1364 | ShowWindow(GetDlgItem(hMain,IDC_SSPICTURE),SW_HIDE); |
| 1365 | ShowWindow(GetDlgItem(hMain,IDC_SSFRAME),SW_HIDE); |
| 1366 | ShowWindow(GetDlgItem(hMain,IDC_SSTAB),SW_HIDE); |
| 1367 | } |
| 1368 | |
| 1369 | } |
| 1370 | |
| 1371 | void ResizePickerControls(HWND hWnd) |
| 1372 | { |
| 1373 | RECT frameRect; |
| 1374 | RECT rect, sRect; |
| 1375 | int nListWidth, nScreenShotWidth; |
| 1376 | static BOOL firstTime = TRUE; |
| 1377 | int doSSControls = TRUE; |
| 1378 | int i, nSplitterCount; |
| 1379 | |
| 1380 | nSplitterCount = GetSplitterCount(); |
| 1381 | |
| 1382 | /* Size the List Control in the Picker */ |
| 1383 | GetClientRect(hWnd, &rect); |
| 1384 | |
| 1385 | /* Calc the display sizes based on g_splitterInfo */ |
| 1386 | if (firstTime) |
| 1387 | { |
| 1388 | RECT rWindow; |
| 1389 | |
| 1390 | for (i = 0; i < nSplitterCount; i++) |
| 1391 | nSplitterOffset[i] = rect.right * g_splitterInfo[i].dPosition; |
| 1392 | |
| 1393 | GetWindowRect(hStatusBar, &rWindow); |
| 1394 | bottomMargin = rWindow.bottom - rWindow.top; |
| 1395 | GetWindowRect(hToolBar, &rWindow); |
| 1396 | topMargin = rWindow.bottom - rWindow.top; |
| 1397 | /*buttonMargin = (sRect.bottom + 4); */ |
| 1398 | |
| 1399 | firstTime = FALSE; |
| 1400 | } |
| 1401 | else |
| 1402 | { |
| 1403 | doSSControls = GetShowScreenShot(); |
| 1404 | } |
| 1405 | |
| 1406 | if (bShowStatusBar) |
| 1407 | rect.bottom -= bottomMargin; |
| 1408 | |
| 1409 | if (bShowToolBar) |
| 1410 | rect.top += topMargin; |
| 1411 | |
| 1412 | MoveWindow(GetDlgItem(hWnd, IDC_DIVIDER), rect.left, rect.top - 4, rect.right, 2, TRUE); |
| 1413 | |
| 1414 | ResizeTreeAndListViews(TRUE); |
| 1415 | |
| 1416 | nListWidth = nSplitterOffset[nSplitterCount-1]; |
| 1417 | nScreenShotWidth = (rect.right - nListWidth) - 4; |
| 1418 | |
| 1419 | /* Screen shot Page tab control */ |
| 1420 | if (bShowTabCtrl) |
| 1421 | { |
| 1422 | MoveWindow(GetDlgItem(hWnd, IDC_SSTAB), nListWidth + 4, rect.top + 2, |
| 1423 | nScreenShotWidth - 2, rect.top + 20, doSSControls); |
| 1424 | rect.top += 20; |
| 1425 | } |
| 1426 | |
| 1427 | /* resize the Screen shot frame */ |
| 1428 | MoveWindow(GetDlgItem(hWnd, IDC_SSFRAME), nListWidth + 4, rect.top + 2, |
| 1429 | nScreenShotWidth - 2, (rect.bottom - rect.top) - 4, doSSControls); |
| 1430 | |
| 1431 | /* The screen shot controls */ |
| 1432 | GetClientRect(GetDlgItem(hWnd, IDC_SSFRAME), &frameRect); |
| 1433 | |
| 1434 | /* Text control - game history */ |
| 1435 | sRect.left = nListWidth + 14; |
| 1436 | sRect.right = sRect.left + (nScreenShotWidth - 22); |
| 1437 | |
| 1438 | |
| 1439 | if (GetShowTab(TAB_HISTORY)) |
| 1440 | { |
| 1441 | // We're using the new mode, with the history filling the entire tab (almost) |
| 1442 | sRect.top = rect.top + 14; |
| 1443 | sRect.bottom = (rect.bottom - rect.top) - 30; |
| 1444 | } |
| 1445 | else |
| 1446 | { |
| 1447 | // We're using the original mode, with the history beneath the SS picture |
| 1448 | sRect.top = rect.top + 264; |
| 1449 | sRect.bottom = (rect.bottom - rect.top) - 278; |
| 1450 | } |
| 1451 | |
| 1452 | MoveWindow(GetDlgItem(hWnd, IDC_HISTORY), |
| 1453 | sRect.left, sRect.top, |
| 1454 | sRect.right - sRect.left, sRect.bottom, doSSControls); |
| 1455 | |
| 1456 | /* the other screen shot controls will be properly placed in UpdateScreenshot() */ |
| 1457 | |
| 1458 | } |
| 1459 | |
| 1460 | char *ModifyThe(const char *str) |
| 1461 | { |
| 1462 | static int bufno = 0; |
| 1463 | static char buffer[4][255]; |
| 1464 | |
| 1465 | if (strncmp(str, "The ", 4) == 0) |
| 1466 | { |
| 1467 | char *s, *p; |
| 1468 | char temp[255]; |
| 1469 | |
| 1470 | strcpy(temp, &str[4]); |
| 1471 | |
| 1472 | bufno = (bufno + 1) % 4; |
| 1473 | |
| 1474 | s = buffer[bufno]; |
| 1475 | |
| 1476 | /* Check for version notes in parens */ |
| 1477 | p = strchr(temp, '('); |
| 1478 | if (p) |
| 1479 | { |
| 1480 | p[-1] = '\0'; |
| 1481 | } |
| 1482 | |
| 1483 | strcpy(s, temp); |
| 1484 | strcat(s, ", The"); |
| 1485 | |
| 1486 | if (p) |
| 1487 | { |
| 1488 | strcat(s, " "); |
| 1489 | strcat(s, p); |
| 1490 | } |
| 1491 | |
| 1492 | return s; |
| 1493 | } |
| 1494 | return (char *)str; |
| 1495 | } |
| 1496 | |
| 1497 | HBITMAP GetBackgroundBitmap(void) |
| 1498 | { |
| 1499 | return hBackground; |
| 1500 | } |
| 1501 | |
| 1502 | HPALETTE GetBackgroundPalette(void) |
| 1503 | { |
| 1504 | return hPALbg; |
| 1505 | } |
| 1506 | |
| 1507 | MYBITMAPINFO * GetBackgroundInfo(void) |
| 1508 | { |
| 1509 | return &bmDesc; |
| 1510 | } |
| 1511 | |
| 1512 | BOOL GetUseOldControl(void) |
| 1513 | { |
| 1514 | return oldControl; |
| 1515 | } |
| 1516 | |
| 1517 | BOOL GetUseXPControl(void) |
| 1518 | { |
| 1519 | return xpControl; |
| 1520 | } |
| 1521 | |
| 1522 | int GetMinimumScreenShotWindowWidth(void) |
| 1523 | { |
| 1524 | BITMAP bmp; |
| 1525 | GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp); |
| 1526 | |
| 1527 | return bmp.bmWidth + 6; // 6 is for a little breathing room |
| 1528 | } |
| 1529 | |
| 1530 | |
| 1531 | int GetDriverIndex(const game_driver *driver) |
| 1532 | { |
| 1533 | return GetGameNameIndex(driver->name); |
| 1534 | } |
| 1535 | |
| 1536 | int GetParentIndex(const game_driver *driver) |
| 1537 | { |
| 1538 | return GetGameNameIndex(driver->parent); |
| 1539 | } |
| 1540 | |
| 1541 | int GetParentRomSetIndex(const game_driver *driver) |
| 1542 | { |
| 1543 | int nParentIndex = GetGameNameIndex(driver->parent); |
| 1544 | |
| 1545 | if( nParentIndex >= 0) |
| 1546 | { |
| 1547 | if ((drivers[nParentIndex]->flags & GAME_IS_BIOS_ROOT) == 0) |
| 1548 | return nParentIndex; |
| 1549 | } |
| 1550 | |
| 1551 | return -1; |
| 1552 | } |
| 1553 | |
| 1554 | int GetGameNameIndex(const char *name) |
| 1555 | { |
| 1556 | driver_data_type *driver_index_info; |
| 1557 | driver_data_type key; |
| 1558 | key.name = name; |
| 1559 | |
| 1560 | // uses our sorted array of driver names to get the index in log time |
| 1561 | driver_index_info = bsearch(&key,sorted_drivers,driver_list_get_count(drivers),sizeof(driver_data_type), |
| 1562 | DriverDataCompareFunc); |
| 1563 | |
| 1564 | if (driver_index_info == NULL) |
| 1565 | return -1; |
| 1566 | |
| 1567 | return driver_index_info->index; |
| 1568 | |
| 1569 | } |
| 1570 | |
| 1571 | int GetIndexFromSortedIndex(int sorted_index) |
| 1572 | { |
| 1573 | return sorted_drivers[sorted_index].index; |
| 1574 | } |
| 1575 | |
| 1576 | /*************************************************************************** |
| 1577 | Internal functions |
| 1578 | ***************************************************************************/ |
| 1579 | |
| 1580 | // used for our sorted array of game names |
| 1581 | int CLIB_DECL DriverDataCompareFunc(const void *arg1,const void *arg2) |
| 1582 | { |
| 1583 | return strcmp( ((driver_data_type *)arg1)->name, ((driver_data_type *)arg2)->name ); |
| 1584 | } |
| 1585 | |
| 1586 | static void ResetBackground(char *szFile) |
| 1587 | { |
| 1588 | char szDestFile[MAX_PATH]; |
| 1589 | |
| 1590 | /* The MAME core load the .png file first, so we only need replace this file */ |
| 1591 | sprintf(szDestFile, "%s\\bkground.png", GetBgDir()); |
| 1592 | win_set_file_attributes_utf8(szDestFile, FILE_ATTRIBUTE_NORMAL); |
| 1593 | win_copy_file_utf8(szFile, szDestFile, FALSE); |
| 1594 | } |
| 1595 | |
| 1596 | static void RandomSelectBackground(void) |
| 1597 | { |
| 1598 | struct _finddata_t c_file; |
| 1599 | long hFile; |
| 1600 | char szFile[MAX_PATH]; |
| 1601 | int count=0; |
| 1602 | const char *szDir=GetBgDir(); |
| 1603 | char *buf=malloc(_MAX_FNAME * MAX_BGFILES); |
| 1604 | |
| 1605 | if (buf == NULL) |
| 1606 | return; |
| 1607 | |
| 1608 | sprintf(szFile, "%s\\*.bmp", szDir); |
| 1609 | hFile = _findfirst(szFile, &c_file); |
| 1610 | if (hFile != -1L) |
| 1611 | { |
| 1612 | int Done = 0; |
| 1613 | while (!Done && count < MAX_BGFILES) |
| 1614 | { |
| 1615 | memcpy(buf + count * _MAX_FNAME, c_file.name, _MAX_FNAME); |
| 1616 | count++; |
| 1617 | Done = _findnext(hFile, &c_file); |
| 1618 | } |
| 1619 | _findclose(hFile); |
| 1620 | } |
| 1621 | sprintf(szFile, "%s\\*.png", szDir); |
| 1622 | hFile = _findfirst(szFile, &c_file); |
| 1623 | if (hFile != -1L) |
| 1624 | { |
| 1625 | int Done = 0; |
| 1626 | while (!Done && count < MAX_BGFILES) |
| 1627 | { |
| 1628 | memcpy(buf + count * _MAX_FNAME, c_file.name, _MAX_FNAME); |
| 1629 | count++; |
| 1630 | Done = _findnext(hFile, &c_file); |
| 1631 | } |
| 1632 | _findclose(hFile); |
| 1633 | } |
| 1634 | |
| 1635 | if (count) |
| 1636 | { |
| 1637 | #ifdef rand |
| 1638 | #undef rand |
| 1639 | #endif |
| 1640 | |
| 1641 | srand( (unsigned)time( NULL ) ); |
| 1642 | sprintf(szFile, "%s\\%s", szDir, buf + (rand() % count) * _MAX_FNAME); |
| 1643 | ResetBackground(szFile); |
| 1644 | } |
| 1645 | |
| 1646 | free(buf); |
| 1647 | } |
| 1648 | |
| 1649 | void SetMainTitle(void) |
| 1650 | { |
| 1651 | char version[50]; |
| 1652 | char buffer[100]; |
| 1653 | |
| 1654 | sscanf(build_version,"%s",version); |
| 1655 | snprintf(buffer, ARRAY_LENGTH(buffer), "%s %s", MAMEUINAME, version); |
| 1656 | win_set_window_text_utf8(hMain,buffer); |
| 1657 | } |
| 1658 | |
| 1659 | static void winui_output_error(void *param, const char *format, va_list argptr) |
| 1660 | { |
| 1661 | char buffer[1024]; |
| 1662 | |
| 1663 | // if we are in fullscreen mode, go to windowed mode |
| 1664 | if ((video_config.windowed == 0) && (win_window_list != NULL)) |
| 1665 | winwindow_toggle_full_screen(); |
| 1666 | |
| 1667 | vsnprintf(buffer, ARRAY_LENGTH(buffer), format, argptr); |
| 1668 | win_message_box_utf8(win_window_list ? win_window_list->hwnd : NULL, buffer, APPNAME, MB_OK); |
| 1669 | } |
| 1670 | |
| 1671 | static void memory_error(const char *message) |
| 1672 | { |
| 1673 | win_message_box_utf8(hMain, message, APPNAME, MB_OK); |
| 1674 | exit(-1); |
| 1675 | } |
| 1676 | |
| 1677 | static BOOL Win32UI_init(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) |
| 1678 | { |
| 1679 | extern int mame_validitychecks(int game); |
| 1680 | WNDCLASS wndclass; |
| 1681 | RECT rect; |
| 1682 | int i, nSplitterCount; |
| 1683 | extern FOLDERDATA g_folderData[]; |
| 1684 | extern FILTER_ITEM g_filterList[]; |
| 1685 | extern const char *history_filename; |
| 1686 | extern const char *mameinfo_filename; |
| 1687 | LONG common_control_version = GetCommonControlVersion(); |
| 1688 | int validity_failed = 0; |
| 1689 | TCHAR* t_inpdir; |
| 1690 | LONG_PTR l; |
| 1691 | |
| 1692 | dprintf("about to init options\n"); |
| 1693 | if (!OptionsInit()) |
| 1694 | return FALSE; |
| 1695 | dprintf("options loaded\n"); |
| 1696 | |
| 1697 | srand((unsigned)time(NULL)); |
| 1698 | |
| 1699 | // output errors to message boxes |
| 1700 | mame_set_output_channel(OUTPUT_CHANNEL_ERROR, winui_output_error, NULL, NULL, NULL); |
| 1701 | |
| 1702 | // create the memory pool |
| 1703 | mameui_pool = pool_alloc(memory_error); |
| 1704 | |
| 1705 | // custom per-game icons |
| 1706 | icon_index = pool_malloc(mameui_pool, sizeof(int) * driver_list_get_count(drivers)); |
| 1707 | memset(icon_index, '\0', sizeof(int) * driver_list_get_count(drivers)); |
| 1708 | |
| 1709 | // sorted list of drivers by name |
| 1710 | sorted_drivers = (driver_data_type *) pool_malloc(mameui_pool, sizeof(driver_data_type) * driver_list_get_count(drivers)); |
| 1711 | memset(sorted_drivers, '\0', sizeof(driver_data_type) * driver_list_get_count(drivers)); |
| 1712 | for (i = 0; i < driver_list_get_count(drivers); i++) |
| 1713 | { |
| 1714 | sorted_drivers[i].name = drivers[i]->name; |
| 1715 | sorted_drivers[i].index = i; |
| 1716 | } |
| 1717 | qsort(sorted_drivers, driver_list_get_count(drivers), sizeof(driver_data_type), DriverDataCompareFunc); |
| 1718 | |
| 1719 | // set up window class |
| 1720 | wndclass.style = CS_HREDRAW | CS_VREDRAW; |
| 1721 | wndclass.lpfnWndProc = MameWindowProc; |
| 1722 | wndclass.cbClsExtra = 0; |
| 1723 | wndclass.cbWndExtra = DLGWINDOWEXTRA; |
| 1724 | wndclass.hInstance = hInstance; |
| 1725 | wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAMEUI_ICON)); |
| 1726 | wndclass.hCursor = NULL; |
| 1727 | wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); |
| 1728 | wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_UI_MENU); |
| 1729 | wndclass.lpszClassName = TEXT("MainClass"); |
| 1730 | |
| 1731 | RegisterClass(&wndclass); |
| 1732 | |
| 1733 | #ifdef MESS |
| 1734 | DevView_RegisterClass(); |
| 1735 | #endif //MESS |
| 1736 | |
| 1737 | InitCommonControls(); |
| 1738 | |
| 1739 | // Are we using an Old comctl32.dll? |
| 1740 | dprintf("common controlversion %i %i",common_control_version >> 16, |
| 1741 | common_control_version & 0xffff); |
| 1742 | |
| 1743 | oldControl = (common_control_version < PACKVERSION(4,71)); |
| 1744 | xpControl = (common_control_version >= PACKVERSION(6,0)); |
| 1745 | if (oldControl) |
| 1746 | { |
| 1747 | char buf[] = MAMEUINAME " has detected an old version of comctl32.dll\n\n" |
| 1748 | "Game Properties, many configuration options and\n" |
| 1749 | "features are not available without an updated DLL\n\n" |
| 1750 | "Please install the common control update found at:\n\n" |
| 1751 | "http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp\n\n" |
| 1752 | "Would you like to continue without using the new features?\n"; |
| 1753 | |
| 1754 | if (IDNO == win_message_box_utf8(0, buf, MAMEUINAME " Outdated comctl32.dll Warning", MB_YESNO | MB_ICONWARNING)) |
| 1755 | return FALSE; |
| 1756 | } |
| 1757 | |
| 1758 | g_mame32_message = RegisterWindowMessage(TEXT("MAME32")); |
| 1759 | g_bDoBroadcast = GetBroadcast(); |
| 1760 | |
| 1761 | HelpInit(); |
| 1762 | |
| 1763 | t_inpdir = tstring_from_utf8(GetInpDir()); |
| 1764 | if( ! t_inpdir ) |
| 1765 | return FALSE; |
| 1766 | |
| 1767 | _tcscpy(last_directory,t_inpdir); |
| 1768 | free(t_inpdir); |
| 1769 | hMain = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MAIN), 0, NULL); |
| 1770 | if (hMain == NULL) |
| 1771 | { |
| 1772 | dprintf("error creating main dialog, aborting"); |
| 1773 | return FALSE; |
| 1774 | } |
| 1775 | |
| 1776 | s_pWatcher = DirWatcher_Init(hMain, WM_MAME32_FILECHANGED); |
| 1777 | if (s_pWatcher) |
| 1778 | { |
| 1779 | DirWatcher_Watch(s_pWatcher, 0, GetRomDirs(), TRUE); |
| 1780 | DirWatcher_Watch(s_pWatcher, 1, GetSampleDirs(), TRUE); |
| 1781 | } |
| 1782 | |
| 1783 | SetMainTitle(); |
| 1784 | hTabCtrl = GetDlgItem(hMain, IDC_SSTAB); |
| 1785 | |
| 1786 | { |
| 1787 | struct TabViewOptions opts; |
| 1788 | |
| 1789 | static struct TabViewCallbacks s_tabviewCallbacks = |
| 1790 | { |
| 1791 | GetShowTabCtrl, // pfnGetShowTabCtrl |
| 1792 | SetCurrentTab, // pfnSetCurrentTab |
| 1793 | GetCurrentTab, // pfnGetCurrentTab |
| 1794 | SetShowTab, // pfnSetShowTab |
| 1795 | GetShowTab, // pfnGetShowTab |
| 1796 | |
| 1797 | GetImageTabShortName, // pfnGetTabShortName |
| 1798 | GetImageTabLongName, // pfnGetTabLongName |
| 1799 | UpdateScreenShot // pfnOnSelectionChanged |
| 1800 | }; |
| 1801 | |
| 1802 | memset(&opts, 0, sizeof(opts)); |
| 1803 | opts.pCallbacks = &s_tabviewCallbacks; |
| 1804 | opts.nTabCount = MAX_TAB_TYPES; |
| 1805 | |
| 1806 | if (!SetupTabView(hTabCtrl, &opts)) |
| 1807 | return FALSE; |
| 1808 | } |
| 1809 | |
| 1810 | /* subclass history window */ |
| 1811 | l = GetWindowLongPtr(GetDlgItem(hMain, IDC_HISTORY), GWLP_WNDPROC); |
| 1812 | g_lpHistoryWndProc = (WNDPROC)l; |
| 1813 | SetWindowLongPtr(GetDlgItem(hMain, IDC_HISTORY), GWLP_WNDPROC, (LONG_PTR)HistoryWndProc); |
| 1814 | |
| 1815 | /* subclass picture frame area */ |
| 1816 | l = GetWindowLongPtr(GetDlgItem(hMain, IDC_SSFRAME), GWLP_WNDPROC); |
| 1817 | g_lpPictureFrameWndProc = (WNDPROC)l; |
| 1818 | SetWindowLongPtr(GetDlgItem(hMain, IDC_SSFRAME), GWLP_WNDPROC, (LONG_PTR)PictureFrameWndProc); |
| 1819 | |
| 1820 | /* subclass picture area */ |
| 1821 | l = GetWindowLongPtr(GetDlgItem(hMain, IDC_SSPICTURE), GWLP_WNDPROC); |
| 1822 | g_lpPictureWndProc = (WNDPROC)l; |
| 1823 | SetWindowLongPtr(GetDlgItem(hMain, IDC_SSPICTURE), GWLP_WNDPROC, (LONG_PTR)PictureWndProc); |
| 1824 | |
| 1825 | /* Load the pic for the default screenshot. */ |
| 1826 | hMissing_bitmap = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_ABOUT)); |
| 1827 | |
| 1828 | /* Stash hInstance for later use */ |
| 1829 | hInst = hInstance; |
| 1830 | |
| 1831 | hToolBar = InitToolbar(hMain); |
| 1832 | hStatusBar = InitStatusBar(hMain); |
| 1833 | hProgWnd = InitProgressBar(hStatusBar); |
| 1834 | |
| 1835 | main_resize_items[0].u.hwnd = hToolBar; |
| 1836 | main_resize_items[1].u.hwnd = hStatusBar; |
| 1837 | |
| 1838 | /* In order to handle 'Large Fonts' as the Windows |
| 1839 | * default setting, we need to make the dialogs small |
| 1840 | * enough to fit in our smallest window size with |
| 1841 | * large fonts, then resize the picker, tab and button |
| 1842 | * controls to fill the window, no matter which font |
| 1843 | * is currently set. This will still look like bad |
| 1844 | * if the user uses a bigger default font than 125% |
| 1845 | * (Large Fonts) on the Windows display setting tab. |
| 1846 | * |
| 1847 | * NOTE: This has to do with Windows default font size |
| 1848 | * settings, NOT our picker font size. |
| 1849 | */ |
| 1850 | |
| 1851 | GetClientRect(hMain, &rect); |
| 1852 | |
| 1853 | hTreeView = GetDlgItem(hMain, IDC_TREE); |
| 1854 | hwndList = GetDlgItem(hMain, IDC_LIST); |
| 1855 | |
| 1856 | history_filename = mame_strdup(GetHistoryFileName()); |
| 1857 | mameinfo_filename = mame_strdup(GetMAMEInfoFileName()); |
| 1858 | |
| 1859 | if (!InitSplitters()) |
| 1860 | return FALSE; |
| 1861 | |
| 1862 | nSplitterCount = GetSplitterCount(); |
| 1863 | for (i = 0; i < nSplitterCount; i++) |
| 1864 | { |
| 1865 | HWND hWnd; |
| 1866 | HWND hWndLeft; |
| 1867 | HWND hWndRight; |
| 1868 | |
| 1869 | hWnd = GetDlgItem(hMain, g_splitterInfo[i].nSplitterWindow); |
| 1870 | hWndLeft = GetDlgItem(hMain, g_splitterInfo[i].nLeftWindow); |
| 1871 | hWndRight = GetDlgItem(hMain, g_splitterInfo[i].nRightWindow); |
| 1872 | |
| 1873 | AddSplitter(hWnd, hWndLeft, hWndRight, g_splitterInfo[i].pfnAdjust); |
| 1874 | } |
| 1875 | |
| 1876 | /* Initial adjustment of controls on the Picker window */ |
| 1877 | ResizePickerControls(hMain); |
| 1878 | |
| 1879 | TabView_UpdateSelection(hTabCtrl); |
| 1880 | |
| 1881 | bDoGameCheck = GetGameCheck(); |
| 1882 | idle_work = TRUE; |
| 1883 | game_index = 0; |
| 1884 | |
| 1885 | bShowTree = GetShowFolderList(); |
| 1886 | bShowToolBar = GetShowToolBar(); |
| 1887 | bShowStatusBar = GetShowStatusBar(); |
| 1888 | bShowTabCtrl = GetShowTabCtrl(); |
| 1889 | |
| 1890 | CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED); |
| 1891 | ToolBar_CheckButton(hToolBar, ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED); |
| 1892 | CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED); |
| 1893 | ShowWindow(hToolBar, (bShowToolBar) ? SW_SHOW : SW_HIDE); |
| 1894 | CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED); |
| 1895 | ShowWindow(hStatusBar, (bShowStatusBar) ? SW_SHOW : SW_HIDE); |
| 1896 | CheckMenuItem(GetMenu(hMain), ID_VIEW_PAGETAB, (bShowTabCtrl) ? MF_CHECKED : MF_UNCHECKED); |
| 1897 | |
| 1898 | if (oldControl) |
| 1899 | { |
| 1900 | EnableMenuItem(GetMenu(hMain), ID_CUSTOMIZE_FIELDS, MF_GRAYED); |
| 1901 | EnableMenuItem(GetMenu(hMain), ID_GAME_PROPERTIES, MF_GRAYED); |
| 1902 | EnableMenuItem(GetMenu(hMain), ID_OPTIONS_DEFAULTS, MF_GRAYED); |
| 1903 | } |
| 1904 | |
| 1905 | /* Init DirectDraw */ |
| 1906 | if (!DirectDraw_Initialize()) |
| 1907 | { |
| 1908 | DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_DIRECTX), NULL, DirectXDialogProc); |
| 1909 | return FALSE; |
| 1910 | } |
| 1911 | |
| 1912 | if (GetRandomBackground()) |
| 1913 | RandomSelectBackground(); |
| 1914 | |
| 1915 | LoadBackgroundBitmap(); |
| 1916 | |
| 1917 | dprintf("about to init tree"); |
| 1918 | InitTree(g_folderData, g_filterList); |
| 1919 | dprintf("did init tree"); |
| 1920 | |
| 1921 | /* Initialize listview columns */ |
| 1922 | #ifdef MESS |
| 1923 | InitMessPicker(); |
| 1924 | #endif |
| 1925 | InitListView(); |
| 1926 | SetFocus(hwndList); |
| 1927 | |
| 1928 | /* Reset the font */ |
| 1929 | { |
| 1930 | LOGFONT logfont; |
| 1931 | |
| 1932 | GetListFont(&logfont); |
| 1933 | hFont = CreateFontIndirect(&logfont); |
| 1934 | if (hFont != NULL) |
| 1935 | SetAllWindowsFont(hMain, &main_resize, hFont, FALSE); |
| 1936 | } |
| 1937 | |
| 1938 | /* Init DirectInput */ |
| 1939 | if (!DirectInputInitialize()) |
| 1940 | { |
| 1941 | DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_DIRECTX), NULL, DirectXDialogProc); |
| 1942 | return FALSE; |
| 1943 | } |
| 1944 | |
| 1945 | AdjustMetrics(); |
| 1946 | UpdateScreenShot(); |
| 1947 | |
| 1948 | hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_TAB_KEYS)); |
| 1949 | |
| 1950 | /* clear keyboard state */ |
| 1951 | KeyboardStateClear(); |
| 1952 | |
| 1953 | for (i = 0; i < NUM_GUI_SEQUENCES; i++) |
| 1954 | { |
| 1955 | input_seq *is1; |
| 1956 | input_seq *is2; |
| 1957 | is1 = &(GUISequenceControl[i].is); |
| 1958 | is2 = GUISequenceControl[i].getiniptr(); |
| 1959 | // FIXME |
| 1960 | //input_seq_copy(is1, is2); |
| 1961 | //dprintf("seq =%s is: %4i %4i %4i %4i\n",GUISequenceControl[i].name, (*is1)[0], (*is1)[1], (*is1)[2], (*is1)[3]); |
| 1962 | } |
| 1963 | |
| 1964 | if (GetJoyGUI() == TRUE) |
| 1965 | { |
| 1966 | g_pJoyGUI = &DIJoystick; |
| 1967 | if (g_pJoyGUI->init() != 0) |
| 1968 | g_pJoyGUI = NULL; |
| 1969 | else |
| 1970 | SetTimer(hMain, JOYGUI_TIMER, JOYGUI_MS, NULL); |
| 1971 | } |
| 1972 | else |
| 1973 | g_pJoyGUI = NULL; |
| 1974 | |
| 1975 | if (GetHideMouseOnStartup()) |
| 1976 | { |
| 1977 | /* For some reason the mouse is centered when a game is exited, which of |
| 1978 | course causes a WM_MOUSEMOVE event that shows the mouse. So we center |
| 1979 | it now, before the startup coords are initilized, and that way the mouse |
| 1980 | will still be hidden when exiting from a game (i hope) :) |
| 1981 | */ |
| 1982 | SetCursorPos(GetSystemMetrics(SM_CXSCREEN)/2,GetSystemMetrics(SM_CYSCREEN)/2); |
| 1983 | |
| 1984 | // Then hide it |
| 1985 | ShowCursor(FALSE); |
| 1986 | } |
| 1987 | |
| 1988 | dprintf("about to show window\n"); |
| 1989 | |
| 1990 | nCmdShow = GetWindowState(); |
| 1991 | if (nCmdShow == SW_HIDE || nCmdShow == SW_MINIMIZE || nCmdShow == SW_SHOWMINIMIZED) |
| 1992 | { |
| 1993 | nCmdShow = SW_RESTORE; |
| 1994 | } |
| 1995 | |
| 1996 | if (GetRunFullScreen()) |
| 1997 | { |
| 1998 | LONG lMainStyle; |
| 1999 | |
| 2000 | // Remove menu |
| 2001 | SetMenu(hMain,NULL); |
| 2002 | |
| 2003 | // Frameless dialog (fake fullscreen) |
| 2004 | lMainStyle = GetWindowLong(hMain, GWL_STYLE); |
| 2005 | lMainStyle = lMainStyle & (WS_BORDER ^ 0xffffffff); |
| 2006 | SetWindowLong(hMain, GWL_STYLE, lMainStyle); |
| 2007 | |
| 2008 | nCmdShow = SW_MAXIMIZE; |
| 2009 | } |
| 2010 | |
| 2011 | ShowWindow(hMain, nCmdShow); |
| 2012 | |
| 2013 | |
| 2014 | switch (GetViewMode()) |
| 2015 | { |
| 2016 | case VIEW_LARGE_ICONS : |
| 2017 | SetView(ID_VIEW_LARGE_ICON); |
| 2018 | break; |
| 2019 | case VIEW_SMALL_ICONS : |
| 2020 | SetView(ID_VIEW_SMALL_ICON); |
| 2021 | break; |
| 2022 | case VIEW_INLIST : |
| 2023 | SetView(ID_VIEW_LIST_MENU); |
| 2024 | break; |
| 2025 | case VIEW_REPORT : |
| 2026 | SetView(ID_VIEW_DETAIL); |
| 2027 | break; |
| 2028 | case VIEW_GROUPED : |
| 2029 | default : |
| 2030 | SetView(ID_VIEW_GROUPED); |
| 2031 | break; |
| 2032 | } |
| 2033 | |
| 2034 | if (GetCycleScreenshot() > 0) |
| 2035 | { |
| 2036 | SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL); //scale to Seconds |
| 2037 | } |
| 2038 | |
| 2039 | if (validity_failed) |
| 2040 | { |
| 2041 | win_message_box_utf8(hMain, MAMENAME " has failed its validity checks. The GUI will " |
| 2042 | "still work, but emulations will fail to execute", MAMENAME, MB_OK); |
| 2043 | } |
| 2044 | |
| 2045 | return TRUE; |
| 2046 | } |
| 2047 | |
| 2048 | |
| 2049 | static void Win32UI_exit() |
| 2050 | { |
| 2051 | if (g_bDoBroadcast == TRUE) |
| 2052 | { |
| 2053 | ATOM a = GlobalAddAtom(TEXT("")); |
| 2054 | SendMessage(HWND_BROADCAST, g_mame32_message, a, a); |
| 2055 | GlobalDeleteAtom(a); |
| 2056 | } |
| 2057 | |
| 2058 | if (g_pJoyGUI != NULL) |
| 2059 | g_pJoyGUI->exit(); |
| 2060 | |
| 2061 | /* Free GDI resources */ |
| 2062 | |
| 2063 | if (hMissing_bitmap) |
| 2064 | { |
| 2065 | DeleteObject(hMissing_bitmap); |
| 2066 | hMissing_bitmap = NULL; |
| 2067 | } |
| 2068 | |
| 2069 | if (hBackground) |
| 2070 | { |
| 2071 | DeleteObject(hBackground); |
| 2072 | hBackground = NULL; |
| 2073 | } |
| 2074 | |
| 2075 | if (hPALbg) |
| 2076 | { |
| 2077 | DeleteObject(hPALbg); |
| 2078 | hPALbg = NULL; |
| 2079 | } |
| 2080 | |
| 2081 | if (hFont) |
| 2082 | { |
| 2083 | DeleteObject(hFont); |
| 2084 | hFont = NULL; |
| 2085 | } |
| 2086 | |
| 2087 | DestroyIcons(); |
| 2088 | |
| 2089 | DestroyAcceleratorTable(hAccel); |
| 2090 | |
| 2091 | DirectInputClose(); |
| 2092 | DirectDraw_Close(); |
| 2093 | |
| 2094 | SetSavedFolderID(GetCurrentFolderID()); |
| 2095 | |
| 2096 | SaveOptions(); |
| 2097 | |
| 2098 | FreeFolders(); |
| 2099 | |
| 2100 | /* DestroyTree(hTreeView); */ |
| 2101 | |
| 2102 | FreeScreenShot(); |
| 2103 | |
| 2104 | OptionsExit(); |
| 2105 | |
| 2106 | HelpExit(); |
| 2107 | |
| 2108 | pool_free(mameui_pool); |
| 2109 | mameui_pool = NULL; |
| 2110 | } |
| 2111 | |
| 2112 | static LRESULT CALLBACK MameWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
| 2113 | { |
| 2114 | MINMAXINFO *mminfo; |
| 2115 | int i; |
| 2116 | TCHAR szClass[128]; |
| 2117 | |
| 2118 | switch (message) |
| 2119 | { |
| 2120 | case WM_CTLCOLORSTATIC: |
| 2121 | if (hBackground && (HWND)lParam == GetDlgItem(hMain, IDC_HISTORY)) |
| 2122 | { |
| 2123 | static HBRUSH hBrush=0; |
| 2124 | HDC hDC=(HDC)wParam; |
| 2125 | LOGBRUSH lb; |
| 2126 | |
| 2127 | if (hBrush) |
| 2128 | DeleteObject(hBrush); |
| 2129 | lb.lbStyle = BS_HOLLOW; |
| 2130 | hBrush = CreateBrushIndirect(&lb); |
| 2131 | SetBkMode(hDC, TRANSPARENT); |
| 2132 | SetTextColor(hDC, GetListFontColor()); |
| 2133 | return (LRESULT) hBrush; |
| 2134 | } |
| 2135 | break; |
| 2136 | |
| 2137 | case WM_INITDIALOG: |
| 2138 | /* Initialize info for resizing subitems */ |
| 2139 | GetClientRect(hWnd, &main_resize.rect); |
| 2140 | return TRUE; |
| 2141 | |
| 2142 | case WM_SETFOCUS: |
| 2143 | SetFocus(hwndList); |
| 2144 | break; |
| 2145 | |
| 2146 | case WM_SETTINGCHANGE: |
| 2147 | AdjustMetrics(); |
| 2148 | return 0; |
| 2149 | |
| 2150 | case WM_SIZE: |
| 2151 | OnSize(hWnd, wParam, LOWORD(lParam), HIWORD(wParam)); |
| 2152 | return TRUE; |
| 2153 | |
| 2154 | case WM_MENUSELECT: |
| 2155 | return Statusbar_MenuSelect(hWnd, wParam, lParam); |
| 2156 | |
| 2157 | case MM_PLAY_GAME: |
| 2158 | MamePlayGame(); |
| 2159 | return TRUE; |
| 2160 | |
| 2161 | case WM_INITMENUPOPUP: |
| 2162 | UpdateMenu(GetMenu(hWnd)); |
| 2163 | break; |
| 2164 | |
| 2165 | case WM_CONTEXTMENU: |
| 2166 | if (HandleTreeContextMenu(hWnd, wParam, lParam) |
| 2167 | || HandleScreenShotContextMenu(hWnd, wParam, lParam)) |
| 2168 | return FALSE; |
| 2169 | break; |
| 2170 | |
| 2171 | case WM_COMMAND: |
| 2172 | return MameCommand(hWnd,(int)(LOWORD(wParam)),(HWND)(lParam),(UINT)HIWORD(wParam)); |
| 2173 | |
| 2174 | case WM_GETMINMAXINFO: |
| 2175 | /* Don't let the window get too small; it can break resizing */ |
| 2176 | mminfo = (MINMAXINFO *) lParam; |
| 2177 | mminfo->ptMinTrackSize.x = MIN_WIDTH; |
| 2178 | mminfo->ptMinTrackSize.y = MIN_HEIGHT; |
| 2179 | return 0; |
| 2180 | |
| 2181 | case WM_TIMER: |
| 2182 | switch (wParam) |
| 2183 | { |
| 2184 | case JOYGUI_TIMER: |
| 2185 | PollGUIJoystick(); |
| 2186 | break; |
| 2187 | case SCREENSHOT_TIMER: |
| 2188 | TabView_CalculateNextTab(hTabCtrl); |
| 2189 | UpdateScreenShot(); |
| 2190 | TabView_UpdateSelection(hTabCtrl); |
| 2191 | break; |
| 2192 | default: |
| 2193 | break; |
| 2194 | } |
| 2195 | return TRUE; |
| 2196 | |
| 2197 | case WM_CLOSE: |
| 2198 | { |
| 2199 | /* save current item */ |
| 2200 | RECT rect; |
| 2201 | AREA area; |
| 2202 | int nItem; |
| 2203 | WINDOWPLACEMENT wndpl; |
| 2204 | UINT state; |
| 2205 | |
| 2206 | wndpl.length = sizeof(WINDOWPLACEMENT); |
| 2207 | GetWindowPlacement(hMain, &wndpl); |
| 2208 | state = wndpl.showCmd; |
| 2209 | |
| 2210 | /* Restore the window before we attempt to save parameters, |
| 2211 | * This fixed the lost window on startup problem, among other problems |
| 2212 | */ |
| 2213 | if (state == SW_MINIMIZE || state == SW_SHOWMINIMIZED || state == SW_MAXIMIZE) |
| 2214 | { |
| 2215 | if( wndpl.flags & WPF_RESTORETOMAXIMIZED || state == SW_MAXIMIZE) |
| 2216 | state = SW_MAXIMIZE; |
| 2217 | else |
| 2218 | { |
| 2219 | state = SW_RESTORE; |
| 2220 | ShowWindow(hWnd, SW_RESTORE); |
| 2221 | } |
| 2222 | } |
| 2223 | for (i = 0; i < GetSplitterCount(); i++) |
| 2224 | SetSplitterPos(i, nSplitterOffset[i]); |
| 2225 | SetWindowState(state); |
| 2226 | |
| 2227 | for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++) |
| 2228 | Picker_SaveColumnWidths(GetDlgItem(hMain, s_nPickers[i])); |
| 2229 | |
| 2230 | GetWindowRect(hWnd, &rect); |
| 2231 | area.x = rect.left; |
| 2232 | area.y = rect.top; |
| 2233 | area.width = rect.right - rect.left; |
| 2234 | area.height = rect.bottom - rect.top; |
| 2235 | SetWindowArea(&area); |
| 2236 | |
| 2237 | /* Save the users current game options and default game */ |
| 2238 | nItem = Picker_GetSelectedItem(hwndList); |
| 2239 | SetDefaultGame(ModifyThe(drivers[nItem]->name)); |
| 2240 | |
| 2241 | /* hide window to prevent orphan empty rectangles on the taskbar */ |
| 2242 | /* ShowWindow(hWnd,SW_HIDE); */ |
| 2243 | DestroyWindow( hWnd ); |
| 2244 | |
| 2245 | /* PostQuitMessage(0); */ |
| 2246 | break; |
| 2247 | } |
| 2248 | |
| 2249 | case WM_DESTROY: |
| 2250 | PostQuitMessage(0); |
| 2251 | return 0; |
| 2252 | |
| 2253 | case WM_LBUTTONDOWN: |
| 2254 | OnLButtonDown(hWnd, (UINT)wParam, MAKEPOINTS(lParam)); |
| 2255 | break; |
| 2256 | |
| 2257 | /* |
| 2258 | Check to see if the mouse has been moved by the user since |
| 2259 | startup. I'd like this checking to be done only in the |
| 2260 | main WinProc (here), but somehow the WM_MOUSEDOWN messages |
| 2261 | are eaten up before they reach MameWindowProc. That's why |
| 2262 | there is one check for each of the subclassed windows too. |
| 2263 | |
| 2264 | POSSIBLE BUGS: |
| 2265 | I've included this check in the subclassed windows, but a |
| 2266 | mose move in either the title bar, the menu, or the |
| 2267 | toolbar will not generate a WM_MOUSEOVER message. At least |
| 2268 | not one that I know how to pick up. A solution could maybe |
| 2269 | be to subclass those too, but that's too much work :) |
| 2270 | */ |
| 2271 | |
| 2272 | case WM_MOUSEMOVE: |
| 2273 | { |
| 2274 | if (MouseHasBeenMoved()) |
| 2275 | ShowCursor(TRUE); |
| 2276 | |
| 2277 | if (g_listview_dragging) |
| 2278 | MouseMoveListViewDrag(MAKEPOINTS(lParam)); |
| 2279 | else |
| 2280 | /* for splitters */ |
| 2281 | OnMouseMove(hWnd, (UINT)wParam, MAKEPOINTS(lParam)); |
| 2282 | break; |
| 2283 | } |
| 2284 | |
| 2285 | case WM_LBUTTONUP: |
| 2286 | if (g_listview_dragging) |
| 2287 | ButtonUpListViewDrag(MAKEPOINTS(lParam)); |
| 2288 | else |
| 2289 | /* for splitters */ |
| 2290 | OnLButtonUp(hWnd, (UINT)wParam, MAKEPOINTS(lParam)); |
| 2291 | break; |
| 2292 | |
| 2293 | case WM_NOTIFY: |
| 2294 | /* Where is this message intended to go */ |
| 2295 | { |
| 2296 | LPNMHDR lpNmHdr = (LPNMHDR)lParam; |
| 2297 | |
| 2298 | /* Fetch tooltip text */ |
| 2299 | if (lpNmHdr->code == TTN_NEEDTEXT) |
| 2300 | { |
| 2301 | LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT)lParam; |
| 2302 | CopyToolTipText(lpttt); |
| 2303 | } |
| 2304 | |
| 2305 | if (lpNmHdr->hwndFrom == hTreeView) |
| 2306 | return TreeViewNotify(lpNmHdr); |
| 2307 | |
| 2308 | GetClassName(lpNmHdr->hwndFrom, szClass, sizeof(szClass) / sizeof(szClass[0])); |
| 2309 | if (!_tcscmp(szClass, TEXT("SysListView32"))) |
| 2310 | return Picker_HandleNotify(lpNmHdr); |
| 2311 | if (!_tcscmp(szClass, TEXT("SysTabControl32"))) |
| 2312 | return TabView_HandleNotify(lpNmHdr); |
| 2313 | } |
| 2314 | break; |
| 2315 | |
| 2316 | case WM_DRAWITEM: |
| 2317 | { |
| 2318 | LPDRAWITEMSTRUCT lpDis = (LPDRAWITEMSTRUCT)lParam; |
| 2319 | |
| 2320 | GetClassName(lpDis->hwndItem, szClass, sizeof(szClass) / sizeof(szClass[0])); |
| 2321 | if (!_tcscmp(szClass, TEXT("SysListView32"))) |
| 2322 | Picker_HandleDrawItem(GetDlgItem(hMain, lpDis->CtlID), lpDis); |
| 2323 | } |
| 2324 | break; |
| 2325 | |
| 2326 | case WM_MEASUREITEM : |
| 2327 | { |
| 2328 | LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam; |
| 2329 | |
| 2330 | // tell the list view that each row (item) should be just taller than our font |
| 2331 | |
| 2332 | //DefWindowProc(hWnd, message, wParam, lParam); |
| 2333 | //dprintf("default row height calculation gives %u\n",lpmis->itemHeight); |
| 2334 | |
| 2335 | TEXTMETRIC tm; |
| 2336 | HDC hDC = GetDC(NULL); |
| 2337 | HFONT hFontOld = (HFONT)SelectObject(hDC,hFont); |
| 2338 | |
| 2339 | GetTextMetrics(hDC,&tm); |
| 2340 | |
| 2341 | lpmis->itemHeight = tm.tmHeight + tm.tmExternalLeading + 1; |
| 2342 | if (lpmis->itemHeight < 17) |
| 2343 | lpmis->itemHeight = 17; |
| 2344 | //dprintf("we would do %u\n",tm.tmHeight + tm.tmExternalLeading + 1); |
| 2345 | SelectObject(hDC,hFontOld); |
| 2346 | ReleaseDC(NULL,hDC); |
| 2347 | |
| 2348 | return TRUE; |
| 2349 | } |
| 2350 | |
| 2351 | case WM_MAME32_FILECHANGED: |
| 2352 | { |
| 2353 | char szFileName[32]; |
| 2354 | char *s; |
| 2355 | int nGameIndex; |
| 2356 | int (*pfnGetAuditResults)(int driver_index) = NULL; |
| 2357 | void (*pfnSetAuditResults)(int driver_index, int audit_results) = NULL; |
| 2358 | |
| 2359 | switch(HIWORD(wParam)) |
| 2360 | { |
| 2361 | case 0: |
| 2362 | pfnGetAuditResults = GetRomAuditResults; |
| 2363 | pfnSetAuditResults = SetRomAuditResults; |
| 2364 | break; |
| 2365 | |
| 2366 | case 1: |
| 2367 | pfnGetAuditResults = GetSampleAuditResults; |
| 2368 | pfnSetAuditResults = SetSampleAuditResults; |
| 2369 | break; |
| 2370 | } |
| 2371 | |
| 2372 | if (pfnGetAuditResults && pfnSetAuditResults) |
| 2373 | { |
| 2374 | int nParentIndex = -1; |
| 2375 | |
| 2376 | snprintf(szFileName, sizeof(szFileName), "%s", (LPCSTR) lParam); |
| 2377 | s = strchr(szFileName, '.'); |
| 2378 | if (s) |
| 2379 | *s = '\0'; |
| 2380 | s = strchr(szFileName, '\\'); |
| 2381 | if (s) |
| 2382 | *s = '\0'; |
| 2383 | |
| 2384 | for (nGameIndex = 0; drivers[nGameIndex]; nGameIndex++) |
| 2385 | { |
| 2386 | for (nParentIndex = nGameIndex; nGameIndex == -1; nParentIndex = GetParentIndex(drivers[nParentIndex])) |
| 2387 | { |
| 2388 | if (!mame_stricmp(drivers[nParentIndex]->name, szFileName)) |
| 2389 | { |
| 2390 | if (pfnGetAuditResults(nGameIndex) != UNKNOWN) |
| 2391 | { |
| 2392 | pfnSetAuditResults(nGameIndex, UNKNOWN); |
| 2393 | PostMessage(hMain, WM_MAME32_AUDITGAME, wParam, nGameIndex); |
| 2394 | } |
| 2395 | break; |
| 2396 | } |
| 2397 | } |
| 2398 | } |
| 2399 | } |
| 2400 | } |
| 2401 | break; |
| 2402 | |
| 2403 | case WM_MAME32_AUDITGAME: |
| 2404 | { |
| 2405 | LV_FINDINFO lvfi; |
| 2406 | int nGameIndex; |
| 2407 | |
| 2408 | nGameIndex = lParam; |
| 2409 | |
| 2410 | switch(HIWORD(wParam)) |
| 2411 | { |
| 2412 | case 0: |
| 2413 | MameUIVerifyRomSet(nGameIndex); |
| 2414 | break; |
| 2415 | case 1: |
| 2416 | MameUIVerifySampleSet(nGameIndex); |
| 2417 | break; |
| 2418 | } |
| 2419 | |
| 2420 | memset(&lvfi, 0, sizeof(lvfi)); |
| 2421 | lvfi.flags = LVFI_PARAM; |
| 2422 | lvfi.lParam = nGameIndex; |
| 2423 | |
| 2424 | i = ListView_FindItem(hwndList, -1, &lvfi); |
| 2425 | if (i != -1) |
| 2426 | { |
| 2427 | ListView_RedrawItems(hwndList, i, i); |
| 2428 | } |
| 2429 | } |
| 2430 | break; |
| 2431 | |
| 2432 | default: |
| 2433 | |
| 2434 | break; |
| 2435 | } |
| 2436 | |
| 2437 | return DefWindowProc(hWnd, message, wParam, lParam); |
| 2438 | } |
| 2439 | |
| 2440 | static int HandleKeyboardGUIMessage(HWND hWnd, UINT message, UINT wParam, LONG lParam) |
| 2441 | { |
| 2442 | switch (message) |
| 2443 | { |
| 2444 | case WM_CHAR: /* List-View controls use this message for searching the items "as user types" */ |
| 2445 | //MessageBox(NULL,"wm_char message arrived","TitleBox",MB_OK); |
| 2446 | return TRUE; |
| 2447 | |
| 2448 | case WM_KEYDOWN: |
| 2449 | KeyboardKeyDown(0, wParam, lParam); |
| 2450 | return TRUE; |
| 2451 | |
| 2452 | case WM_KEYUP: |
| 2453 | KeyboardKeyUp(0, wParam, lParam); |
| 2454 | return TRUE; |
| 2455 | |
| 2456 | case WM_SYSKEYDOWN: |
| 2457 | KeyboardKeyDown(1, wParam, lParam); |
| 2458 | return TRUE; |
| 2459 | |
| 2460 | case WM_SYSKEYUP: |
| 2461 | KeyboardKeyUp(1, wParam, lParam); |
| 2462 | return TRUE; |
| 2463 | } |
| 2464 | |
| 2465 | return FALSE; /* message not processed */ |
| 2466 | } |
| 2467 | |
| 2468 | static BOOL PumpMessage() |
| 2469 | { |
| 2470 | MSG msg; |
| 2471 | |
| 2472 | if (!GetMessage(&msg, NULL, 0, 0)) |
| 2473 | { |
| 2474 | return FALSE; |
| 2475 | } |
| 2476 | |
| 2477 | if (IsWindow(hMain)) |
| 2478 | { |
| 2479 | BOOL absorbed_key = FALSE; |
| 2480 | if (GetKeyGUI()) |
| 2481 | absorbed_key = HandleKeyboardGUIMessage(msg.hwnd, msg.message, |
| 2482 | msg.wParam, msg.lParam); |
| 2483 | else |
| 2484 | absorbed_key = TranslateAccelerator(hMain, hAccel, &msg); |
| 2485 | |
| 2486 | if (!absorbed_key) |
| 2487 | { |
| 2488 | if (!IsDialogMessage(hMain, &msg)) |
| 2489 | { |
| 2490 | TranslateMessage(&msg); |
| 2491 | DispatchMessage(&msg); |
| 2492 | } |
| 2493 | } |
| 2494 | } |
| 2495 | |
| 2496 | return TRUE; |
| 2497 | } |
| 2498 | |
| 2499 | static BOOL FolderCheck(void) |
| 2500 | { |
| 2501 | |
| 2502 | char *pDescription = NULL; |
| 2503 | int nGameIndex = 0; |
| 2504 | int i=0; |
| 2505 | int iStep = 0; |
| 2506 | LV_FINDINFO lvfi; |
| 2507 | int nCount = ListView_GetItemCount(hwndList); |
| 2508 | BOOL changed = FALSE; |
| 2509 | |
| 2510 | MSG msg; |
| 2511 | for(i=0; i<nCount;i++) |
| 2512 | { |
| 2513 | LV_ITEM lvi; |
| 2514 | |
| 2515 | lvi.iItem = i; |
| 2516 | lvi.iSubItem = 0; |
| 2517 | lvi.mask = LVIF_PARAM; |
| 2518 | ListView_GetItem(hwndList, &lvi); |
| 2519 | nGameIndex = lvi.lParam; |
| 2520 | SetRomAuditResults(nGameIndex, UNKNOWN); |
| 2521 | SetSampleAuditResults(nGameIndex, UNKNOWN); |
| 2522 | } |
| 2523 | if( nCount > 0) |
| 2524 | ProgressBarShow(); |
| 2525 | else |
| 2526 | return FALSE; |
| 2527 | if( nCount < 100 ) |
| 2528 | iStep = 100 / nCount; |
| 2529 | else |
| 2530 | iStep = nCount/100; |
| 2531 | UpdateListView(); |
| 2532 | UpdateWindow(hMain); |
| 2533 | for(i=0; i<nCount;i++) |
| 2534 | { |
| 2535 | LV_ITEM lvi; |
| 2536 | |
| 2537 | lvi.iItem = i; |
| 2538 | lvi.iSubItem = 0; |
| 2539 | lvi.mask = LVIF_PARAM; |
| 2540 | ListView_GetItem(hwndList, &lvi); |
| 2541 | nGameIndex = lvi.lParam; |
| 2542 | if (GetRomAuditResults(nGameIndex) == UNKNOWN) |
| 2543 | { |
| 2544 | MameUIVerifyRomSet(nGameIndex); |
| 2545 | changed = TRUE; |
| 2546 | } |
| 2547 | |
| 2548 | if (GetSampleAuditResults(nGameIndex) == UNKNOWN) |
| 2549 | { |
| 2550 | MameUIVerifySampleSet(nGameIndex); |
| 2551 | changed = TRUE; |
| 2552 | } |
| 2553 | |
| 2554 | lvfi.flags = LVFI_PARAM; |
| 2555 | lvfi.lParam = nGameIndex; |
| 2556 | |
| 2557 | i = ListView_FindItem(hwndList, -1, &lvfi); |
| 2558 | if (changed && i != -1); |
| 2559 | { |
| 2560 | ListView_RedrawItems(hwndList, i, i); |
| 2561 | while( PeekMessage( &msg, hwndList, 0, 0, PM_REMOVE ) != 0) |
| 2562 | { |
| 2563 | TranslateMessage(&msg); |
| 2564 | DispatchMessage(&msg); |
| 2565 | } |
| 2566 | } |
| 2567 | changed = FALSE; |
| 2568 | if ((i % iStep) == 0) |
| 2569 | ProgressBarStepParam(i, nCount); |
| 2570 | } |
| 2571 | ProgressBarHide(); |
| 2572 | pDescription = ModifyThe(drivers[Picker_GetSelectedItem(hwndList)]->description); |
| 2573 | SetStatusBarText(0, pDescription); |
| 2574 | UpdateStatusBar(); |
| 2575 | return TRUE; |
| 2576 | } |
| 2577 | |
| 2578 | static BOOL GameCheck(void) |
| 2579 | { |
| 2580 | LV_FINDINFO lvfi; |
| 2581 | int i; |
| 2582 | BOOL changed = FALSE; |
| 2583 | |
| 2584 | if (game_index == 0) |
| 2585 | ProgressBarShow(); |
| 2586 | |
| 2587 | if (game_index >= driver_list_get_count(drivers)) |
| 2588 | { |
| 2589 | bDoGameCheck = FALSE; |
| 2590 | ProgressBarHide(); |
| 2591 | ResetWhichGamesInFolders(); |
| 2592 | return FALSE; |
| 2593 | } |
| 2594 | |
| 2595 | if (GetRomAuditResults(game_index) == UNKNOWN) |
| 2596 | { |
| 2597 | MameUIVerifyRomSet(game_index); |
| 2598 | changed = TRUE; |
| 2599 | } |
| 2600 | |
| 2601 | if (GetSampleAuditResults(game_index) == UNKNOWN) |
| 2602 | { |
| 2603 | MameUIVerifySampleSet(game_index); |
| 2604 | changed = TRUE; |
| 2605 | } |
| 2606 | |
| 2607 | lvfi.flags = LVFI_PARAM; |
| 2608 | lvfi.lParam = game_index; |
| 2609 | |
| 2610 | i = ListView_FindItem(hwndList, -1, &lvfi); |
| 2611 | if (changed && i != -1); |
| 2612 | ListView_RedrawItems(hwndList, i, i); |
| 2613 | if ((game_index % progBarStep) == 0) |
| 2614 | ProgressBarStep(); |
| 2615 | game_index++; |
| 2616 | |
| 2617 | return changed; |
| 2618 | } |
| 2619 | |
| 2620 | static BOOL OnIdle(HWND hWnd) |
| 2621 | { |
| 2622 | static int bFirstTime = TRUE; |
| 2623 | static int bResetList = TRUE; |
| 2624 | |
| 2625 | char *pDescription; |
| 2626 | int driver_index; |
| 2627 | |
| 2628 | if (bFirstTime) |
| 2629 | { |
| 2630 | bResetList = FALSE; |
| 2631 | bFirstTime = FALSE; |
| 2632 | } |
| 2633 | if (bDoGameCheck) |
| 2634 | { |
| 2635 | bResetList |= GameCheck(); |
| 2636 | return idle_work; |
| 2637 | } |
| 2638 | // NPW 17-Jun-2003 - Commenting this out because it is redundant |
| 2639 | // and it causes the game to reset back to the original game after an F5 |
| 2640 | // refresh |
| 2641 | //driver_index = GetGameNameIndex(GetDefaultGame()); |
| 2642 | //SetSelectedPickItem(driver_index); |
| 2643 | |
| 2644 | // in case it's not found, get it back |
| 2645 | driver_index = Picker_GetSelectedItem(hwndList); |
| 2646 | |
| 2647 | pDescription = ModifyThe(drivers[driver_index]->description); |
| 2648 | SetStatusBarText(0, pDescription); |
| 2649 | idle_work = FALSE; |
| 2650 | UpdateStatusBar(); |
| 2651 | bFirstTime = TRUE; |
| 2652 | |
| 2653 | if (!idle_work) |
| 2654 | PostMessage(GetMainWindow(),WM_COMMAND, MAKEWPARAM(ID_VIEW_LINEUPICONS, TRUE),(LPARAM)NULL); |
| 2655 | return idle_work; |
| 2656 | } |
| 2657 | |
| 2658 | static void OnSize(HWND hWnd, UINT nState, int nWidth, int nHeight) |
| 2659 | { |
| 2660 | static BOOL firstTime = TRUE; |
| 2661 | |
| 2662 | if (nState != SIZE_MAXIMIZED && nState != SIZE_RESTORED) |
| 2663 | return; |
| 2664 | |
| 2665 | ResizeWindow(hWnd, &main_resize); |
| 2666 | ResizeProgressBar(); |
| 2667 | if (firstTime == FALSE) |
| 2668 | OnSizeSplitter(hMain); |
| 2669 | //firstTime = FALSE; |
| 2670 | /* Update the splitters structures as appropriate */ |
| 2671 | RecalcSplitters(); |
| 2672 | if (firstTime == FALSE) |
| 2673 | ResizePickerControls(hMain); |
| 2674 | firstTime = FALSE; |
| 2675 | UpdateScreenShot(); |
| 2676 | } |
| 2677 | |
| 2678 | |
| 2679 | |
| 2680 | static HWND GetResizeItemWindow(HWND hParent, const ResizeItem *ri) |
| 2681 | { |
| 2682 | HWND hControl; |
| 2683 | if (ri->type == RA_ID) |
| 2684 | hControl = GetDlgItem(hParent, ri->u.id); |
| 2685 | else |
| 2686 | hControl = ri->u.hwnd; |
| 2687 | return hControl; |
| 2688 | } |
| 2689 | |
| 2690 | |
| 2691 | |
| 2692 | static void SetAllWindowsFont(HWND hParent, const Resize *r, HFONT hTheFont, BOOL bRedraw) |
| 2693 | { |
| 2694 | int i; |
| 2695 | HWND hControl; |
| 2696 | |
| 2697 | for (i = 0; r->items[i].type != RA_END; i++) |
| 2698 | { |
| 2699 | if (r->items[i].setfont) |
| 2700 | { |
| 2701 | hControl = GetResizeItemWindow(hParent, &r->items[i]); |
| 2702 | SetWindowFont(hControl, hTheFont, bRedraw); |
| 2703 | } |
| 2704 | } |
| 2705 | } |
| 2706 | |
| 2707 | |
| 2708 | |
| 2709 | static void ResizeWindow(HWND hParent, Resize *r) |
| 2710 | { |
| 2711 | int cmkindex = 0, dx, dy, dx1, dtempx; |
| 2712 | HWND hControl; |
| 2713 | RECT parent_rect, rect; |
| 2714 | ResizeItem *ri; |
| 2715 | POINT p = {0, 0}; |
| 2716 | |
| 2717 | if (hParent == NULL) |
| 2718 | return; |
| 2719 | |
| 2720 | /* Calculate change in width and height of parent window */ |
| 2721 | GetClientRect(hParent, &parent_rect); |
| 2722 | //dx = parent_rect.right - r->rect.right; |
| 2723 | dtempx = parent_rect.right - r->rect.right; |
| 2724 | dy = parent_rect.bottom - r->rect.bottom; |
| 2725 | dx = dtempx/2; |
| 2726 | dx1 = dtempx - dx; |
| 2727 | ClientToScreen(hParent, &p); |
| 2728 | |
| 2729 | while (r->items[cmkindex].type != RA_END) |
| 2730 | { |
| 2731 | ri = &r->items[cmkindex]; |
| 2732 | if (ri->type == RA_ID) |
| 2733 | hControl = GetDlgItem(hParent, ri->u.id); |
| 2734 | else |
| 2735 | hControl = ri->u.hwnd; |
| 2736 | |
| 2737 | if (hControl == NULL) |
| 2738 | { |
| 2739 | cmkindex++; |
| 2740 | continue; |
| 2741 | } |
| 2742 | |
| 2743 | /* Get control's rectangle relative to parent */ |
| 2744 | GetWindowRect(hControl, &rect); |
| 2745 | OffsetRect(&rect, -p.x, -p.y); |
| 2746 | |
| 2747 | if (!(ri->action & RA_LEFT)) |
| 2748 | rect.left += dx; |
| 2749 | |
| 2750 | if (!(ri->action & RA_TOP)) |
| 2751 | rect.top += dy; |
| 2752 | |
| 2753 | if (ri->action & RA_RIGHT) |
| 2754 | rect.right += dx; |
| 2755 | |
| 2756 | if (ri->action & RA_BOTTOM) |
| 2757 | rect.bottom += dy; |
| 2758 | |
| 2759 | MoveWindow(hControl, rect.left, rect.top, |
| 2760 | (rect.right - rect.left), |
| 2761 | (rect.bottom - rect.top), TRUE); |
| 2762 | |
| 2763 | /* Take care of subcontrols, if appropriate */ |
| 2764 | if (ri->subwindow != NULL) |
| 2765 | ResizeWindow(hControl, ri->subwindow); |
| 2766 | |
| 2767 | cmkindex++; |
| 2768 | } |
| 2769 | |
| 2770 | /* Record parent window's new location */ |
| 2771 | memcpy(&r->rect, &parent_rect, sizeof(RECT)); |
| 2772 | } |
| 2773 | |
| 2774 | static void ProgressBarShow() |
| 2775 | { |
| 2776 | RECT rect; |
| 2777 | int widths[2] = {150, -1}; |
| 2778 | |
| 2779 | if (driver_list_get_count(drivers) < 100) |
| 2780 | progBarStep = 100 / driver_list_get_count(drivers); |
| 2781 | else |
| 2782 | progBarStep = (driver_list_get_count(drivers) / 100); |
| 2783 | |
| 2784 | SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)2, (LPARAM)(LPINT)widths); |
| 2785 | SendMessage(hProgWnd, PBM_SETRANGE, 0, (LPARAM)MAKELONG(0, driver_list_get_count(drivers))); |
| 2786 | SendMessage(hProgWnd, PBM_SETSTEP, (WPARAM)progBarStep, 0); |
| 2787 | SendMessage(hProgWnd, PBM_SETPOS, 0, 0); |
| 2788 | |
| 2789 | StatusBar_GetItemRect(hStatusBar, 1, &rect); |
| 2790 | |
| 2791 | MoveWindow(hProgWnd, rect.left, rect.top, |
| 2792 | rect.right - rect.left, |
| 2793 | rect.bottom - rect.top, TRUE); |
| 2794 | |
| 2795 | bProgressShown = TRUE; |
| 2796 | } |
| 2797 | |
| 2798 | static void ProgressBarHide() |
| 2799 | { |
| 2800 | RECT rect; |
| 2801 | int widths[4]; |
| 2802 | HDC hDC; |
| 2803 | SIZE size; |
| 2804 | int numParts = 4; |
| 2805 | |
| 2806 | if (hProgWnd == NULL) |
| 2807 | { |
| 2808 | return; |
| 2809 | } |
| 2810 | |
| 2811 | hDC = GetDC(hProgWnd); |
| 2812 | |
| 2813 | ShowWindow(hProgWnd, SW_HIDE); |
| 2814 | |
| 2815 | GetTextExtentPoint32(hDC, TEXT("MMX"), 3, &size); |
| 2816 | widths[3] = size.cx; |
| 2817 | GetTextExtentPoint32(hDC, TEXT("MMMM games"), 10, &size); |
| 2818 | widths[2] = size.cx; |
| 2819 | //Just specify 24 instead of 30, gives us sufficient space to display the message, and saves some space |
| 2820 | GetTextExtentPoint32(hDC, TEXT("Screen flip support is missing"), 24, &size); |
| 2821 | widths[1] = size.cx; |
| 2822 | |
| 2823 | ReleaseDC(hProgWnd, hDC); |
| 2824 | |
| 2825 | widths[0] = -1; |
| 2826 | SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)1, (LPARAM)(LPINT)widths); |
| 2827 | StatusBar_GetItemRect(hStatusBar, 0, &rect); |
| 2828 | |
| 2829 | widths[0] = (rect.right - rect.left) - (widths[1] + widths[2] + widths[3]); |
| 2830 | widths[1] += widths[0]; |
| 2831 | widths[2] += widths[1]; |
| 2832 | widths[3] = -1; |
| 2833 | |
| 2834 | SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)numParts, (LPARAM)(LPINT)widths); |
| 2835 | UpdateStatusBar(); |
| 2836 | |
| 2837 | bProgressShown = FALSE; |
| 2838 | } |
| 2839 | |
| 2840 | static void ResizeProgressBar() |
| 2841 | { |
| 2842 | if (bProgressShown) |
| 2843 | { |
| 2844 | RECT rect; |
| 2845 | int widths[2] = {150, -1}; |
| 2846 | |
| 2847 | SendMessage(hStatusBar, SB_SETPARTS, (WPARAM)2, (LPARAM)(LPINT)widths); |
| 2848 | StatusBar_GetItemRect(hStatusBar, 1, &rect); |
| 2849 | MoveWindow(hProgWnd, rect.left, rect.top, |
| 2850 | rect.right - rect.left, |
| 2851 | rect.bottom - rect.top, TRUE); |
| 2852 | } |
| 2853 | else |
| 2854 | { |
| 2855 | ProgressBarHide(); |
| 2856 | } |
| 2857 | } |
| 2858 | |
| 2859 | static void ProgressBarStepParam(int iGameIndex, int nGameCount) |
| 2860 | { |
| 2861 | SetStatusBarTextF(0, "Game search %d%% complete", |
| 2862 | ((iGameIndex + 1) * 100) / nGameCount); |
| 2863 | if (iGameIndex == 0) |
| 2864 | ShowWindow(hProgWnd, SW_SHOW); |
| 2865 | SendMessage(hProgWnd, PBM_STEPIT, 0, 0); |
| 2866 | } |
| 2867 | |
| 2868 | static void ProgressBarStep() |
| 2869 | { |
| 2870 | ProgressBarStepParam(game_index, driver_list_get_count(drivers)); |
| 2871 | } |
| 2872 | |
| 2873 | static HWND InitProgressBar(HWND hParent) |
| 2874 | { |
| 2875 | RECT rect; |
| 2876 | |
| 2877 | StatusBar_GetItemRect(hStatusBar, 0, &rect); |
| 2878 | |
| 2879 | rect.left += 150; |
| 2880 | |
| 2881 | return CreateWindowEx(WS_EX_STATICEDGE, |
| 2882 | PROGRESS_CLASS, |
| 2883 | TEXT("Progress Bar"), |
| 2884 | WS_CHILD | PBS_SMOOTH, |
| 2885 | rect.left, |
| 2886 | rect.top, |
| 2887 | rect.right - rect.left, |
| 2888 | rect.bottom - rect.top, |
| 2889 | hParent, |
| 2890 | NULL, |
| 2891 | hInst, |
| 2892 | NULL); |
| 2893 | } |
| 2894 | |
| 2895 | static void CopyToolTipText(LPTOOLTIPTEXT lpttt) |
| 2896 | { |
| 2897 | int i; |
| 2898 | int iButton = lpttt->hdr.idFrom; |
| 2899 | static TCHAR String[1024]; |
| 2900 | BOOL bConverted = FALSE; |
| 2901 | TCHAR* t_gameinfostatus; |
| 2902 | |
| 2903 | /* Map command ID to string index */ |
| 2904 | for (i = 0; CommandToString[i] != -1; i++) |
| 2905 | { |
| 2906 | if (CommandToString[i] == iButton) |
| 2907 | { |
| 2908 | iButton = i; |
| 2909 | bConverted = TRUE; |
| 2910 | break; |
| 2911 | } |
| 2912 | } |
| 2913 | if( bConverted ) |
| 2914 | { |
| 2915 | /* Check for valid parameter */ |
| 2916 | if(iButton > NUM_TOOLTIPS) |
| 2917 | { |
| 2918 | _tcscpy(String,TEXT("Invalid Button Index")); |
| 2919 | } |
| 2920 | else |
| 2921 | { |
| 2922 | _tcscpy(String,szTbStrings[iButton]); |
| 2923 | } |
| 2924 | } |
| 2925 | else if ( iButton <= 2 ) |
| 2926 | { |
| 2927 | //Statusbar |
| 2928 | SendMessage(lpttt->hdr.hwndFrom, TTM_SETMAXTIPWIDTH, 0, 200); |
| 2929 | if( iButton != 1) |
| 2930 | SendMessage(hStatusBar, SB_GETTEXT, (WPARAM)iButton, (LPARAM)&String ); |
| 2931 | else { |
| 2932 | //for first pane we get the Status directly, to get the line breaks |
| 2933 | t_gameinfostatus = tstring_from_utf8( GameInfoStatus(Picker_GetSelectedItem(hwndList), FALSE)); |
| 2934 | if( !t_gameinfostatus ) |
| 2935 | return; |
| 2936 | _tcscpy(String, t_gameinfostatus); |
| 2937 | free(t_gameinfostatus); |
| 2938 | } |
| 2939 | } |
| 2940 | else |
| 2941 | _tcscpy(String,TEXT("Invalid Button Index")); |
| 2942 | |
| 2943 | lpttt->lpszText = String; |
| 2944 | } |
| 2945 | |
| 2946 | static HWND InitToolbar(HWND hParent) |
| 2947 | { |
| 2948 | HWND hToolBar = CreateToolbarEx(hParent, |
| 2949 | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | |
| 2950 | CCS_TOP | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, |
| 2951 | 1, |
| 2952 | 8, |
| 2953 | hInst, |
| 2954 | IDB_TOOLBAR, |
| 2955 | tbb, |
| 2956 | NUM_TOOLBUTTONS, |
| 2957 | 16, |
| 2958 | 16, |
| 2959 | 0, |
| 2960 | 0, |
| 2961 | sizeof(TBBUTTON)); |
| 2962 | RECT rect; |
| 2963 | int idx; |
| 2964 | int iPosX, iPosY, iHeight; |
| 2965 | |
| 2966 | // get Edit Control position |
| 2967 | idx = SendMessage(hToolBar, TB_BUTTONCOUNT, (WPARAM)0, (LPARAM)0) - 1; |
| 2968 | SendMessage(hToolBar, TB_GETITEMRECT, (WPARAM)idx, (LPARAM)&rect); |
| 2969 | iPosX = rect.right + 10; |
| 2970 | iPosY = rect.top + 1; |
| 2971 | iHeight = rect.bottom - rect.top - 2; |
| 2972 | |
| 2973 | // create Edit Control |
| 2974 | win_create_window_ex_utf8( 0L, "Edit", SEARCH_PROMPT, WS_CHILD | WS_BORDER | WS_VISIBLE | ES_LEFT, |
| 2975 | iPosX, iPosY, 200, iHeight, hToolBar, (HMENU)ID_TOOLBAR_EDIT, hInst, NULL ); |
| 2976 | |
| 2977 | return hToolBar; |
| 2978 | } |
| 2979 | |
| 2980 | static HWND InitStatusBar(HWND hParent) |
| 2981 | { |
| 2982 | HMENU hMenu = GetMenu(hParent); |
| 2983 | |
| 2984 | popstr[0].hMenu = 0; |
| 2985 | popstr[0].uiString = 0; |
| 2986 | popstr[1].hMenu = hMenu; |
| 2987 | popstr[1].uiString = IDS_UI_FILE; |
| 2988 | popstr[2].hMenu = GetSubMenu(hMenu, 1); |
| 2989 | popstr[2].uiString = IDS_VIEW_TOOLBAR; |
| 2990 | popstr[3].hMenu = 0; |
| 2991 | popstr[3].uiString = 0; |
| 2992 | |
| 2993 | return CreateStatusWindow(WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | |
| 2994 | CCS_BOTTOM | SBARS_SIZEGRIP | SBT_TOOLTIPS, |
| 2995 | TEXT("Ready"), |
| 2996 | hParent, |
| 2997 | 2); |
| 2998 | } |
| 2999 | |
| 3000 | |
| 3001 | static LRESULT Statusbar_MenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) |
| 3002 | { |
| 3003 | UINT fuFlags = (UINT)HIWORD(wParam); |
| 3004 | HMENU hMainMenu = NULL; |
| 3005 | int iMenu = 0; |
| 3006 | |
| 3007 | /* Handle non-system popup menu descriptions. */ |
| 3008 | if ( (fuFlags & MF_POPUP) |
| 3009 | && (!(fuFlags & MF_SYSMENU))) |
| 3010 | { |
| 3011 | for (iMenu = 1; iMenu < MAX_MENUS; iMenu++) |
| 3012 | { |
| 3013 | if ((HMENU)lParam == popstr[iMenu].hMenu) |
| 3014 | { |
| 3015 | hMainMenu = (HMENU)lParam; |
| 3016 | break ; |
| 3017 | } |
| 3018 | } |
| 3019 | } |
| 3020 | |
| 3021 | if (hMainMenu) |
| 3022 | { |
| 3023 | /* Display helpful text in status bar */ |
| 3024 | MenuHelp(WM_MENUSELECT, wParam, lParam, hMainMenu, hInst, |
| 3025 | hStatusBar, (UINT *)&popstr[iMenu]); |
| 3026 | } |
| 3027 | else |
| 3028 | { |
| 3029 | UINT nZero = 0; |
| 3030 | MenuHelp(WM_MENUSELECT, wParam, lParam, NULL, hInst, |
| 3031 | hStatusBar, &nZero); |
| 3032 | } |
| 3033 | |
| 3034 | return 0; |
| 3035 | } |
| 3036 | |
| 3037 | static void UpdateStatusBar() |
| 3038 | { |
| 3039 | LPTREEFOLDER lpFolder = GetCurrentFolder(); |
| 3040 | int games_shown = 0; |
| 3041 | int i = -1; |
| 3042 | |
| 3043 | if (!lpFolder) |
| 3044 | return; |
| 3045 | |
| 3046 | while (1) |
| 3047 | { |
| 3048 | i = FindGame(lpFolder,i+1); |
| 3049 | if (i == -1) |
| 3050 | break; |
| 3051 | |
| 3052 | if (!GameFiltered(i, lpFolder->m_dwFlags)) |
| 3053 | games_shown++; |
| 3054 | } |
| 3055 | |
| 3056 | /* Show number of games in the current 'View' in the status bar */ |
| 3057 | SetStatusBarTextF(2, g_szGameCountString, games_shown); |
| 3058 | |
| 3059 | i = Picker_GetSelectedItem(hwndList); |
| 3060 | |
| 3061 | if (games_shown == 0) |
| 3062 | DisableSelection(); |
| 3063 | else |
| 3064 | { |
| 3065 | const char* pStatus = GameInfoStatus(i, FALSE); |
| 3066 | SetStatusBarText(1, pStatus); |
| 3067 | } |
| 3068 | } |
| 3069 | |
| 3070 | static void UpdateHistory(void) |
| 3071 | { |
| 3072 | HDC hDC; |
| 3073 | RECT rect; |
| 3074 | TEXTMETRIC tm ; |
| 3075 | int nLines, nLineHeight; |
| 3076 | //DWORD dwStyle = GetWindowLong(GetDlgItem(hMain, IDC_HISTORY), GWL_STYLE); |
| 3077 | have_history = FALSE; |
| 3078 | |
| 3079 | if (GetSelectedPick() >= 0) |
| 3080 | { |
| 3081 | char *histText = GetGameHistory(Picker_GetSelectedItem(hwndList)); |
| 3082 | |
| 3083 | have_history = (histText && histText[0]) ? TRUE : FALSE; |
| 3084 | win_set_window_text_utf8(GetDlgItem(hMain, IDC_HISTORY), histText); |
| 3085 | } |
| 3086 | |
| 3087 | if (have_history && GetShowScreenShot() |
| 3088 | && ((TabView_GetCurrentTab(hTabCtrl) == TAB_HISTORY) || |
| 3089 | (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() && GetShowTab(TAB_HISTORY) == FALSE) || |
| 3090 | (TAB_ALL == GetHistoryTab() && GetShowTab(TAB_HISTORY) == FALSE) )) |
| 3091 | { |
| 3092 | Edit_GetRect(GetDlgItem(hMain, IDC_HISTORY),&rect); |
| 3093 | nLines = Edit_GetLineCount(GetDlgItem(hMain, IDC_HISTORY) ); |
| 3094 | hDC = GetDC(GetDlgItem(hMain, IDC_HISTORY)); |
| 3095 | GetTextMetrics (hDC, &tm); |
| 3096 | nLineHeight = tm.tmHeight - tm.tmInternalLeading; |
| 3097 | if( ( (rect.bottom - rect.top) / nLineHeight) < (nLines) ) |
| 3098 | { |
| 3099 | //more than one Page, so show Scrollbar |
| 3100 | SetScrollRange(GetDlgItem(hMain, IDC_HISTORY), SB_VERT, 0, nLines, TRUE); |
| 3101 | } |
| 3102 | else |
| 3103 | { |
| 3104 | //hide Scrollbar |
| 3105 | SetScrollRange(GetDlgItem(hMain, IDC_HISTORY),SB_VERT, 0, 0, TRUE); |
| 3106 | |
| 3107 | } |
| 3108 | ShowWindow(GetDlgItem(hMain, IDC_HISTORY), SW_SHOW); |
| 3109 | } |
| 3110 | else |
| 3111 | ShowWindow(GetDlgItem(hMain, IDC_HISTORY), SW_HIDE); |
| 3112 | |
| 3113 | } |
| 3114 | |
| 3115 | |
| 3116 | static void DisableSelection() |
| 3117 | { |
| 3118 | MENUITEMINFO mmi; |
| 3119 | HMENU hMenu = GetMenu(hMain); |
| 3120 | BOOL prev_have_selection = have_selection; |
| 3121 | |
| 3122 | mmi.cbSize = sizeof(mmi); |
| 3123 | mmi.fMask = MIIM_TYPE; |
| 3124 | mmi.fType = MFT_STRING; |
| 3125 | mmi.dwTypeData = (TCHAR *) TEXT("&Play"); |
| 3126 | mmi.cch = _tcslen(mmi.dwTypeData); |
| 3127 | SetMenuItemInfo(hMenu, ID_FILE_PLAY, FALSE, &mmi); |
| 3128 | |
| 3129 | EnableMenuItem(hMenu, ID_FILE_PLAY, MF_GRAYED); |
| 3130 | EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_GRAYED); |
| 3131 | EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED); |
| 3132 | |
| 3133 | SetStatusBarText(0, "No Selection"); |
| 3134 | SetStatusBarText(1, ""); |
| 3135 | SetStatusBarText(3, ""); |
| 3136 | |
| 3137 | have_selection = FALSE; |
| 3138 | |
| 3139 | if (prev_have_selection != have_selection) |
| 3140 | UpdateScreenShot(); |
| 3141 | } |
| 3142 | |
| 3143 | static void EnableSelection(int nGame) |
| 3144 | { |
| 3145 | TCHAR buf[200]; |
| 3146 | const char * pText; |
| 3147 | MENUITEMINFO mmi; |
| 3148 | HMENU hMenu = GetMenu(hMain); |
| 3149 | TCHAR* t_description; |
| 3150 | |
| 3151 | #ifdef MESS |
| 3152 | MyFillSoftwareList(nGame, FALSE); |
| 3153 | #endif |
| 3154 | |
| 3155 | t_description = tstring_from_utf8(ConvertAmpersandString(ModifyThe(drivers[nGame]->description))); |
| 3156 | if( !t_description ) |
| 3157 | return; |
| 3158 | |
| 3159 | _sntprintf(buf, sizeof(buf) / sizeof(buf[0]), g_szPlayGameString, t_description); |
| 3160 | mmi.cbSize = sizeof(mmi); |
| 3161 | mmi.fMask = MIIM_TYPE; |
| 3162 | mmi.fType = MFT_STRING; |
| 3163 | mmi.dwTypeData = buf; |
| 3164 | mmi.cch = _tcslen(mmi.dwTypeData); |
| 3165 | SetMenuItemInfo(hMenu, ID_FILE_PLAY, FALSE, &mmi); |
| 3166 | |
| 3167 | pText = ModifyThe(drivers[nGame]->description); |
| 3168 | SetStatusBarText(0, pText); |
| 3169 | /* Add this game's status to the status bar */ |
| 3170 | pText = GameInfoStatus(nGame, FALSE); |
| 3171 | SetStatusBarText(1, pText); |
| 3172 | SetStatusBarText(3, ""); |
| 3173 | |
| 3174 | /* If doing updating game status and the game name is NOT pacman.... */ |
| 3175 | |
| 3176 | EnableMenuItem(hMenu, ID_FILE_PLAY, MF_ENABLED); |
| 3177 | EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_ENABLED); |
| 3178 | |
| 3179 | if (!oldControl) |
| 3180 | EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_ENABLED); |
| 3181 | |
| 3182 | if (bProgressShown && bListReady == TRUE) |
| 3183 | { |
| 3184 | SetDefaultGame(ModifyThe(drivers[nGame]->name)); |
| 3185 | } |
| 3186 | have_selection = TRUE; |
| 3187 | |
| 3188 | UpdateScreenShot(); |
| 3189 | |
| 3190 | free(t_description); |
| 3191 | } |
| 3192 | |
| 3193 | static void PaintBackgroundImage(HWND hWnd, HRGN hRgn, int x, int y) |
| 3194 | { |
| 3195 | RECT rcClient; |
| 3196 | HRGN rgnBitmap; |
| 3197 | HPALETTE hPAL; |
| 3198 | HDC hDC = GetDC(hWnd); |
| 3199 | int i, j; |
| 3200 | HDC htempDC; |
| 3201 | HBITMAP oldBitmap; |
| 3202 | |
| 3203 | /* x and y are offsets within the background image that should be at 0,0 in hWnd */ |
| 3204 | |
| 3205 | /* So we don't paint over the control's border */ |
| 3206 | GetClientRect(hWnd, &rcClient); |
| 3207 | |
| 3208 | htempDC = CreateCompatibleDC(hDC); |
| 3209 | oldBitmap = SelectObject(htempDC, hBackground); |
| 3210 | |
| 3211 | if (hRgn == NULL) |
| 3212 | { |
| 3213 | /* create a region of our client area */ |
| 3214 | rgnBitmap = CreateRectRgnIndirect(&rcClient); |
| 3215 | SelectClipRgn(hDC, rgnBitmap); |
| 3216 | DeleteObject(rgnBitmap); |
| 3217 | } |
| 3218 | else |
| 3219 | { |
| 3220 | /* use the passed in region */ |
| 3221 | SelectClipRgn(hDC, hRgn); |
| 3222 | } |
| 3223 | |
| 3224 | hPAL = GetBackgroundPalette(); |
| 3225 | if (hPAL == NULL) |
| 3226 | hPAL = CreateHalftonePalette(hDC); |
| 3227 | |
| 3228 | if (GetDeviceCaps(htempDC, RASTERCAPS) & RC_PALETTE && hPAL != NULL) |
| 3229 | { |
| 3230 | SelectPalette(htempDC, hPAL, FALSE); |
| 3231 | RealizePalette(htempDC); |
| 3232 | } |
| 3233 | |
| 3234 | for (i = rcClient.left-x; i < rcClient.right; i += bmDesc.bmWidth) |
| 3235 | for (j = rcClient.top-y; j < rcClient.bottom; j += bmDesc.bmHeight) |
| 3236 | BitBlt(hDC, i, j, bmDesc.bmWidth, bmDesc.bmHeight, htempDC, 0, 0, SRCCOPY); |
| 3237 | |
| 3238 | SelectObject(htempDC, oldBitmap); |
| 3239 | DeleteDC(htempDC); |
| 3240 | |
| 3241 | if (GetBackgroundPalette() == NULL) |
| 3242 | { |
| 3243 | DeleteObject(hPAL); |
| 3244 | hPAL = NULL; |
| 3245 | } |
| 3246 | |
| 3247 | ReleaseDC(hWnd, hDC); |
| 3248 | } |
| 3249 | |
| 3250 | static LPCSTR GetCloneParentName(int nItem) |
| 3251 | { |
| 3252 | int nParentIndex = -1; |
| 3253 | |
| 3254 | if (DriverIsClone(nItem) == TRUE) |
| 3255 | { |
| 3256 | nParentIndex = GetParentIndex(drivers[nItem]); |
| 3257 | if( nParentIndex >= 0) |
| 3258 | return ModifyThe(drivers[nParentIndex]->description); |
| 3259 | } |
| 3260 | return ""; |
| 3261 | } |
| 3262 | |
| 3263 | #if 0 |
| 3264 | static BOOL PickerHitTest(HWND hWnd) |
| 3265 | { |
| 3266 | RECT rect; |
| 3267 | POINTS p; |
| 3268 | DWORD res = GetMessagePos(); |
| 3269 | LVHITTESTINFO htInfo; |
| 3270 | |
| 3271 | ZeroMemory(&htInfo,sizeof(LVHITTESTINFO)); |
| 3272 | p = MAKEPOINTS(res); |
| 3273 | GetWindowRect(hWnd, &rect); |
| 3274 | htInfo.pt.x = p.x - rect.left; |
| 3275 | htInfo.pt.y = p.y - rect.top; |
| 3276 | ListView_HitTest(hWnd, &htInfo); |
| 3277 | |
| 3278 | return (! (htInfo.flags & LVHT_NOWHERE)); |
| 3279 | } |
| 3280 | #endif |
| 3281 | |
| 3282 | static BOOL TreeViewNotify(LPNMHDR nm) |
| 3283 | { |
| 3284 | switch (nm->code) |
| 3285 | { |
| 3286 | case TVN_SELCHANGED : |
| 3287 | { |
| 3288 | HTREEITEM hti = TreeView_GetSelection(hTreeView); |
| 3289 | TVITEM tvi; |
| 3290 | |
| 3291 | tvi.mask = TVIF_PARAM | TVIF_HANDLE; |
| 3292 | tvi.hItem = hti; |
| 3293 | |
| 3294 | if (TreeView_GetItem(hTreeView, &tvi)) |
| 3295 | { |
| 3296 | SetCurrentFolder((LPTREEFOLDER)tvi.lParam); |
| 3297 | if (bListReady) |
| 3298 | { |
| 3299 | ResetListView(); |
| 3300 | UpdateScreenShot(); |
| 3301 | } |
| 3302 | } |
| 3303 | return TRUE; |
| 3304 | } |
| 3305 | case TVN_BEGINLABELEDIT : |
| 3306 | { |
| 3307 | TV_DISPINFO *ptvdi = (TV_DISPINFO *)nm; |
| 3308 | LPTREEFOLDER folder = (LPTREEFOLDER)ptvdi->item.lParam; |
| 3309 | |
| 3310 | if (folder->m_dwFlags & F_CUSTOM) |
| 3311 | { |
| 3312 | // user can edit custom folder names |
| 3313 | g_in_treeview_edit = TRUE; |
| 3314 | return FALSE; |
| 3315 | } |
| 3316 | // user can't edit built in folder names |
| 3317 | return TRUE; |
| 3318 | } |
| 3319 | case TVN_ENDLABELEDIT : |
| 3320 | { |
| 3321 | TV_DISPINFO *ptvdi = (TV_DISPINFO *)nm; |
| 3322 | LPTREEFOLDER folder = (LPTREEFOLDER)ptvdi->item.lParam; |
| 3323 | char* szText; |
| 3324 | BOOL result; |
| 3325 | |
| 3326 | g_in_treeview_edit = FALSE; |
| 3327 | |
| 3328 | if (ptvdi->item.pszText == NULL || _tcslen(ptvdi->item.pszText) == 0) |
| 3329 | return FALSE; |
| 3330 | |
| 3331 | szText = utf8_from_tstring(ptvdi->item.pszText); |
| 3332 | if( !szText ) |
| 3333 | return FALSE; |
| 3334 | |
| 3335 | result = TryRenameCustomFolder(folder,szText); |
| 3336 | |
| 3337 | free(szText); |
| 3338 | |
| 3339 | return result; |
| 3340 | } |
| 3341 | } |
| 3342 | return FALSE; |
| 3343 | } |
| 3344 | |
| 3345 | |
| 3346 | |
| 3347 | static void GamePicker_OnHeaderContextMenu(POINT pt, int nColumn) |
| 3348 | { |
| 3349 | // Right button was clicked on header |
| 3350 | HMENU hMenuLoad; |
| 3351 | HMENU hMenu; |
| 3352 | |
| 3353 | hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_HEADER)); |
| 3354 | hMenu = GetSubMenu(hMenuLoad, 0); |
| 3355 | lastColumnClick = nColumn; |
| 3356 | TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hMain,NULL); |
| 3357 | |
| 3358 | DestroyMenu(hMenuLoad); |
| 3359 | } |
| 3360 | |
| 3361 | |
| 3362 | |
| 3363 | char* ConvertAmpersandString(const char *s) |
| 3364 | { |
| 3365 | /* takes a string and changes any ampersands to double ampersands, |
| 3366 | for setting text of window controls that don't allow us to disable |
| 3367 | the ampersand underlining. |
| 3368 | */ |
| 3369 | /* returns a static buffer--use before calling again */ |
| 3370 | |
| 3371 | static char buf[200]; |
| 3372 | char *ptr; |
| 3373 | |
| 3374 | ptr = buf; |
| 3375 | while (*s) |
| 3376 | { |
| 3377 | if (*s == '&') |
| 3378 | *ptr++ = *s; |
| 3379 | *ptr++ = *s++; |
| 3380 | } |
| 3381 | *ptr = 0; |
| 3382 | |
| 3383 | return buf; |
| 3384 | } |
| 3385 | |
| 3386 | static int GUI_seq_pressed(const input_seq *seq) |
| 3387 | { |
| 3388 | int codenum; |
| 3389 | int res = 1; |
| 3390 | int invert = 0; |
| 3391 | int count = 0; |
| 3392 | |
| 3393 | for (codenum = 0; codenum < ARRAY_LENGTH(seq->code); codenum++) |
| 3394 | { |
| 3395 | input_code code = seq->code[codenum]; |
| 3396 | |
| 3397 | switch (code) |
| 3398 | { |
| 3399 | case SEQCODE_OR : |
| 3400 | if (res && count) |
| 3401 | return 1; |
| 3402 | res = 1; |
| 3403 | count = 0; |
| 3404 | break; |
| 3405 | case SEQCODE_NOT : |
| 3406 | invert = !invert; |
| 3407 | break; |
| 3408 | default: |
| 3409 | if (res) |
| 3410 | { |
| 3411 | int pressed = keyboard_state[code]; |
| 3412 | if ((pressed != 0) == invert) |
| 3413 | res = 0; |
| 3414 | } |
| 3415 | invert = 0; |
| 3416 | ++count; |
| 3417 | } |
| 3418 | } |
| 3419 | return res && count; |
| 3420 | } |
| 3421 | |
| 3422 | static void check_for_GUI_action(void) |
| 3423 | { |
| 3424 | int i; |
| 3425 | |
| 3426 | for (i = 0; i < NUM_GUI_SEQUENCES; i++) |
| 3427 | { |
| 3428 | input_seq *is = &(GUISequenceControl[i].is); |
| 3429 | |
| 3430 | if (GUI_seq_pressed(is)) |
| 3431 | { |
| 3432 | dprintf("seq =%s pressed\n", GUISequenceControl[i].name); |
| 3433 | switch (GUISequenceControl[i].func_id) |
| 3434 | { |
| 3435 | case ID_GAME_AUDIT: |
| 3436 | case ID_GAME_PROPERTIES: |
| 3437 | case ID_CONTEXT_FILTERS: |
| 3438 | case ID_UI_START: |
| 3439 | KeyboardStateClear(); /* beacuse whe won't receive KeyUp mesage when we loose focus */ |
| 3440 | break; |
| 3441 | default: |
| 3442 | break; |
| 3443 | } |
| 3444 | SendMessage(hMain, WM_COMMAND, GUISequenceControl[i].func_id, 0); |
| 3445 | } |
| 3446 | } |
| 3447 | } |
| 3448 | |
| 3449 | static void KeyboardStateClear(void) |
| 3450 | { |
| 3451 | memset(keyboard_state, 0, sizeof(keyboard_state)); |
| 3452 | dprintf("keyboard gui state cleared.\n"); |
| 3453 | } |
| 3454 | |
| 3455 | |
| 3456 | static void KeyboardKeyDown(int syskey, int vk_code, int special) |
| 3457 | { |
| 3458 | int i, found = 0; |
| 3459 | input_code icode = 0; |
| 3460 | int special_code = (special >> 24) & 1; |
| 3461 | int scancode = (special>>16) & 0xff; |
| 3462 | |
| 3463 | if ((vk_code==VK_MENU) || (vk_code==VK_CONTROL) || (vk_code==VK_SHIFT)) |
| 3464 | { |
| 3465 | found = 1; |
| 3466 | |
| 3467 | /* a hack for right shift - it's better to use Direct X for keyboard input it seems......*/ |
| 3468 | if (vk_code==VK_SHIFT) |
| 3469 | if (scancode>0x30) /* on my keyboard left shift scancode is 0x2a, right shift is 0x36 */ |
| 3470 | special_code = 1; |
| 3471 | |
| 3472 | if (special_code) /* right hand keys */ |
| 3473 | { |
| 3474 | switch(vk_code) |
| 3475 | { |
| 3476 | case VK_MENU: |
| 3477 | icode = KEYCODE_RALT; |
| 3478 | break; |
| 3479 | case VK_CONTROL: |
| 3480 | icode = KEYCODE_RCONTROL; |
| 3481 | break; |
| 3482 | case VK_SHIFT: |
| 3483 | icode = KEYCODE_RSHIFT; |
| 3484 | break; |
| 3485 | } |
| 3486 | } |
| 3487 | else /* left hand keys */ |
| 3488 | { |
| 3489 | switch(vk_code) |
| 3490 | { |
| 3491 | case VK_MENU: |
| 3492 | icode = KEYCODE_LALT; |
| 3493 | break; |
| 3494 | case VK_CONTROL: |
| 3495 | icode = KEYCODE_LCONTROL; |
| 3496 | break; |
| 3497 | case VK_SHIFT: |
| 3498 | icode = KEYCODE_LSHIFT; |
| 3499 | break; |
| 3500 | } |
| 3501 | } |
| 3502 | } |
| 3503 | else |
| 3504 | { |
| 3505 | for (i = 0; i < ARRAY_LENGTH(win_key_trans_table); i++) |
| 3506 | { |
| 3507 | if ( vk_code == win_key_trans_table[i][VIRTUAL_KEY]) |
| 3508 | { |
| 3509 | icode = win_key_trans_table[i][MAME_KEY]; |
| 3510 | found = 1; |
| 3511 | break; |
| 3512 | } |
| 3513 | } |
| 3514 | } |
| 3515 | if (!found) |
| 3516 | { |
| 3517 | dprintf("VK_code pressed not found = %i\n",vk_code); |
| 3518 | //MessageBox(NULL,"keydown message arrived not processed","TitleBox",MB_OK); |
| 3519 | return; |
| 3520 | } |
| 3521 | dprintf("VK_code pressed found = %i, sys=%i, mame_keycode=%i special=%08x\n", vk_code, syskey, icode, special); |
| 3522 | keyboard_state[icode] = 1; |
| 3523 | check_for_GUI_action(); |
| 3524 | } |
| 3525 | |
| 3526 | static void KeyboardKeyUp(int syskey, int vk_code, int special) |
| 3527 | { |
| 3528 | int i, found = 0; |
| 3529 | input_code icode = 0; |
| 3530 | int special_code = (special >> 24) & 1; |
| 3531 | int scancode = (special>>16) & 0xff; |
| 3532 | |
| 3533 | if ((vk_code==VK_MENU) || (vk_code==VK_CONTROL) || (vk_code==VK_SHIFT)) |
| 3534 | { |
| 3535 | found = 1; |
| 3536 | |
| 3537 | /* a hack for right shift - it's better to use Direct X for keyboard input it seems......*/ |
| 3538 | if (vk_code==VK_SHIFT) |
| 3539 | if (scancode>0x30) /* on my keyboard left shift scancode is 0x2a, right shift is 0x36 */ |
| 3540 | special_code = 1; |
| 3541 | |
| 3542 | if (special_code) /* right hand keys */ |
| 3543 | { |
| 3544 | switch(vk_code) |
| 3545 | { |
| 3546 | case VK_MENU: |
| 3547 | icode = KEYCODE_RALT; |
| 3548 | break; |
| 3549 | case VK_CONTROL: |
| 3550 | icode = KEYCODE_RCONTROL; |
| 3551 | break; |
| 3552 | case VK_SHIFT: |
| 3553 | icode = KEYCODE_RSHIFT; |
| 3554 | break; |
| 3555 | } |
| 3556 | } |
| 3557 | else /* left hand keys */ |
| 3558 | { |
| 3559 | switch(vk_code) |
| 3560 | { |
| 3561 | case VK_MENU: |
| 3562 | icode = KEYCODE_LALT; |
| 3563 | break; |
| 3564 | case VK_CONTROL: |
| 3565 | icode = KEYCODE_LCONTROL; |
| 3566 | break; |
| 3567 | case VK_SHIFT: |
| 3568 | icode = KEYCODE_LSHIFT; |
| 3569 | break; |
| 3570 | } |
| 3571 | } |
| 3572 | } |
| 3573 | else |
| 3574 | { |
| 3575 | for (i = 0; i < ARRAY_LENGTH(win_key_trans_table); i++) |
| 3576 | { |
| 3577 | if (vk_code == win_key_trans_table[i][VIRTUAL_KEY]) |
| 3578 | { |
| 3579 | icode = win_key_trans_table[i][MAME_KEY]; |
| 3580 | found = 1; |
| 3581 | break; |
| 3582 | } |
| 3583 | } |
| 3584 | } |
| 3585 | if (!found) |
| 3586 | { |
| 3587 | dprintf("VK_code released not found = %i",vk_code); |
| 3588 | //MessageBox(NULL,"keyup message arrived not processed","TitleBox",MB_OK); |
| 3589 | return; |
| 3590 | } |
| 3591 | keyboard_state[icode] = 0; |
| 3592 | dprintf("VK_code released found= %i, sys=%i, mame_keycode=%i special=%08x\n", vk_code, syskey, icode, special ); |
| 3593 | check_for_GUI_action(); |
| 3594 | } |
| 3595 | |
| 3596 | static void PollGUIJoystick() |
| 3597 | { |
| 3598 | // For the exec timer, will keep track of how long the button has been pressed |
| 3599 | static int exec_counter = 0; |
| 3600 | const char* exec_command; |
| 3601 | TCHAR* t_exec_command; |
| 3602 | |
| 3603 | if (in_emulation) |
| 3604 | return; |
| 3605 | |
| 3606 | if (g_pJoyGUI == NULL) |
| 3607 | return; |
| 3608 | |
| 3609 | g_pJoyGUI->poll_joysticks(); |
| 3610 | |
| 3611 | |
| 3612 | // User pressed UP |
| 3613 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyUp(0), GetUIJoyUp(1), GetUIJoyUp(2),GetUIJoyUp(3)))) |
| 3614 | { |
| 3615 | SendMessage(hMain, WM_COMMAND, ID_UI_UP, 0); |
| 3616 | } |
| 3617 | |
| 3618 | // User pressed DOWN |
| 3619 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyDown(0), GetUIJoyDown(1), GetUIJoyDown(2),GetUIJoyDown(3)))) |
| 3620 | { |
| 3621 | SendMessage(hMain, WM_COMMAND, ID_UI_DOWN, 0); |
| 3622 | } |
| 3623 | |
| 3624 | // User pressed LEFT |
| 3625 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyLeft(0), GetUIJoyLeft(1), GetUIJoyLeft(2),GetUIJoyLeft(3)))) |
| 3626 | { |
| 3627 | SendMessage(hMain, WM_COMMAND, ID_UI_LEFT, 0); |
| 3628 | } |
| 3629 | |
| 3630 | // User pressed RIGHT |
| 3631 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyRight(0), GetUIJoyRight(1), GetUIJoyRight(2),GetUIJoyRight(3)))) |
| 3632 | { |
| 3633 | SendMessage(hMain, WM_COMMAND, ID_UI_RIGHT, 0); |
| 3634 | } |
| 3635 | |
| 3636 | // User pressed START GAME |
| 3637 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyStart(0), GetUIJoyStart(1), GetUIJoyStart(2),GetUIJoyStart(3)))) |
| 3638 | { |
| 3639 | SendMessage(hMain, WM_COMMAND, ID_UI_START, 0); |
| 3640 | } |
| 3641 | |
| 3642 | // User pressed PAGE UP |
| 3643 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyPageUp(0), GetUIJoyPageUp(1), GetUIJoyPageUp(2),GetUIJoyPageUp(3)))) |
| 3644 | { |
| 3645 | SendMessage(hMain, WM_COMMAND, ID_UI_PGUP, 0); |
| 3646 | } |
| 3647 | |
| 3648 | // User pressed PAGE DOWN |
| 3649 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyPageDown(0), GetUIJoyPageDown(1), GetUIJoyPageDown(2),GetUIJoyPageDown(3)))) |
| 3650 | { |
| 3651 | SendMessage(hMain, WM_COMMAND, ID_UI_PGDOWN, 0); |
| 3652 | } |
| 3653 | |
| 3654 | // User pressed HOME |
| 3655 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHome(0), GetUIJoyHome(1), GetUIJoyHome(2),GetUIJoyHome(3)))) |
| 3656 | { |
| 3657 | SendMessage(hMain, WM_COMMAND, ID_UI_HOME, 0); |
| 3658 | } |
| 3659 | |
| 3660 | // User pressed END |
| 3661 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyEnd(0), GetUIJoyEnd(1), GetUIJoyEnd(2),GetUIJoyEnd(3)))) |
| 3662 | { |
| 3663 | SendMessage(hMain, WM_COMMAND, ID_UI_END, 0); |
| 3664 | } |
| 3665 | |
| 3666 | // User pressed CHANGE SCREENSHOT |
| 3667 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoySSChange(0), GetUIJoySSChange(1), GetUIJoySSChange(2),GetUIJoySSChange(3)))) |
| 3668 | { |
| 3669 | SendMessage(hMain, WM_COMMAND, IDC_SSFRAME, 0); |
| 3670 | } |
| 3671 | |
| 3672 | // User pressed SCROLL HISTORY UP |
| 3673 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHistoryUp(0), GetUIJoyHistoryUp(1), GetUIJoyHistoryUp(2),GetUIJoyHistoryUp(3)))) |
| 3674 | { |
| 3675 | SendMessage(hMain, WM_COMMAND, ID_UI_HISTORY_UP, 0); |
| 3676 | } |
| 3677 | |
| 3678 | // User pressed SCROLL HISTORY DOWN |
| 3679 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyHistoryDown(0), GetUIJoyHistoryDown(1), GetUIJoyHistoryDown(2),GetUIJoyHistoryDown(3)))) |
| 3680 | { |
| 3681 | SendMessage(hMain, WM_COMMAND, ID_UI_HISTORY_DOWN, 0); |
| 3682 | } |
| 3683 | |
| 3684 | // User pressed EXECUTE COMMANDLINE |
| 3685 | if (g_pJoyGUI->is_joy_pressed(JOYCODE(GetUIJoyExec(0), GetUIJoyExec(1), GetUIJoyExec(2),GetUIJoyExec(3)))) |
| 3686 | { |
| 3687 | if (++exec_counter >= GetExecWait()) // Button has been pressed > exec timeout |
| 3688 | { |
| 3689 | PROCESS_INFORMATION pi; |
| 3690 | STARTUPINFO si; |
| 3691 | |
| 3692 | // Reset counter |
| 3693 | exec_counter = 0; |
| 3694 | |
| 3695 | ZeroMemory( &si, sizeof(si) ); |
| 3696 | ZeroMemory( &pi, sizeof(pi) ); |
| 3697 | si.dwFlags = STARTF_FORCEONFEEDBACK; |
| 3698 | si.cb = sizeof(si); |
| 3699 | |
| 3700 | exec_command = GetExecCommand(); |
| 3701 | t_exec_command = tstring_from_utf8(exec_command); |
| 3702 | if( !t_exec_command ) |
| 3703 | return; |
| 3704 | CreateProcess(NULL, t_exec_command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); |
| 3705 | |
| 3706 | free(t_exec_command); |
| 3707 | |
| 3708 | // We will not wait for the process to finish cause it might be a background task |
| 3709 | // The process won't get closed when MAME32 closes either. |
| 3710 | |
| 3711 | // But close the handles cause we won't need them anymore. Will not close process. |
| 3712 | CloseHandle(pi.hProcess); |
| 3713 | CloseHandle(pi.hThread); |
| 3714 | } |
| 3715 | } |
| 3716 | else |
| 3717 | { |
| 3718 | // Button has been released within the timeout period, reset the counter |
| 3719 | exec_counter = 0; |
| 3720 | } |
| 3721 | } |
| 3722 | |
| 3723 | #if 0 |
| 3724 | static void PressKey(HWND hwnd, UINT vk) |
| 3725 | { |
| 3726 | SendMessage(hwnd, WM_KEYDOWN, vk, 0); |
| 3727 | SendMessage(hwnd, WM_KEYUP, vk, 0xc0000000); |
| 3728 | } |
| 3729 | #endif |
| 3730 | |
| 3731 | static void SetView(int menu_id) |
| 3732 | { |
| 3733 | BOOL force_reset = FALSE; |
| 3734 | int i; |
| 3735 | |
| 3736 | // first uncheck previous menu item, check new one |
| 3737 | CheckMenuRadioItem(GetMenu(hMain), ID_VIEW_LARGE_ICON, ID_VIEW_GROUPED, menu_id, MF_CHECKED); |
| 3738 | ToolBar_CheckButton(hToolBar, menu_id, MF_CHECKED); |
| 3739 | |
| 3740 | if (Picker_GetViewID(hwndList) == VIEW_GROUPED || menu_id == ID_VIEW_GROUPED) |
| 3741 | { |
| 3742 | // this changes the sort order, so redo everything |
| 3743 | force_reset = TRUE; |
| 3744 | } |
| 3745 | |
| 3746 | for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++) |
| 3747 | Picker_SetViewID(GetDlgItem(hMain, s_nPickers[i]), menu_id - ID_VIEW_LARGE_ICON); |
| 3748 | |
| 3749 | if (force_reset) |
| 3750 | { |
| 3751 | for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++) |
| 3752 | Picker_Sort(GetDlgItem(hMain, s_nPickers[i])); |
| 3753 | } |
| 3754 | } |
| 3755 | |
| 3756 | static void ResetListView() |
| 3757 | { |
| 3758 | int i; |
| 3759 | int current_game; |
| 3760 | LV_ITEM lvi; |
| 3761 | BOOL no_selection = FALSE; |
| 3762 | LPTREEFOLDER lpFolder = GetCurrentFolder(); |
| 3763 | |
| 3764 | if (!lpFolder) |
| 3765 | { |
| 3766 | return; |
| 3767 | } |
| 3768 | |
| 3769 | /* If the last folder was empty, no_selection is TRUE */ |
| 3770 | if (have_selection == FALSE) |
| 3771 | { |
| 3772 | no_selection = TRUE; |
| 3773 | } |
| 3774 | |
| 3775 | current_game = Picker_GetSelectedItem(hwndList); |
| 3776 | |
| 3777 | SetWindowRedraw(hwndList,FALSE); |
| 3778 | |
| 3779 | ListView_DeleteAllItems(hwndList); |
| 3780 | |
| 3781 | // hint to have it allocate it all at once |
| 3782 | ListView_SetItemCount(hwndList,driver_list_get_count(drivers)); |
| 3783 | |
| 3784 | lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; |
| 3785 | lvi.stateMask = 0; |
| 3786 | |
| 3787 | i = -1; |
| 3788 | |
| 3789 | do |
| 3790 | { |
| 3791 | /* Add the games that are in this folder */ |
| 3792 | if ((i = FindGame(lpFolder, i + 1)) != -1) |
| 3793 | { |
| 3794 | if (GameFiltered(i, lpFolder->m_dwFlags)) |
| 3795 | continue; |
| 3796 | |
| 3797 | lvi.iItem = i; |
| 3798 | lvi.iSubItem = 0; |
| 3799 | lvi.lParam = i; |
| 3800 | lvi.pszText = LPSTR_TEXTCALLBACK; |
| 3801 | lvi.iImage = I_IMAGECALLBACK; |
| 3802 | ListView_InsertItem(hwndList, &lvi); |
| 3803 | } |
| 3804 | } while (i != -1); |
| 3805 | |
| 3806 | Picker_Sort(hwndList); |
| 3807 | |
| 3808 | if (bListReady) |
| 3809 | { |
| 3810 | /* If last folder was empty, select the first item in this folder */ |
| 3811 | if (no_selection) |
| 3812 | Picker_SetSelectedPick(hwndList, 0); |
| 3813 | else |
| 3814 | Picker_SetSelectedItem(hwndList, current_game); |
| 3815 | } |
| 3816 | |
| 3817 | /*RS Instead of the Arrange Call that was here previously on all Views |
| 3818 | We now need to set the ViewMode for SmallIcon again, |
| 3819 | for an explanation why, see SetView*/ |
| 3820 | if (GetViewMode() == VIEW_SMALL_ICONS) |
| 3821 | SetView(ID_VIEW_SMALL_ICON); |
| 3822 | |
| 3823 | SetWindowRedraw(hwndList, TRUE); |
| 3824 | |
| 3825 | UpdateStatusBar(); |
| 3826 | |
| 3827 | } |
| 3828 | |
| 3829 | static void UpdateGameList(BOOL bUpdateRomAudit, BOOL bUpdateSampleAudit) |
| 3830 | { |
| 3831 | int i; |
| 3832 | |
| 3833 | for (i = 0; i < driver_list_get_count(drivers); i++) |
| 3834 | { |
| 3835 | if (bUpdateRomAudit && DriverUsesRoms(i)) |
| 3836 | SetRomAuditResults(i, UNKNOWN); |
| 3837 | if (bUpdateSampleAudit && DriverUsesSamples(i)) |
| 3838 | SetSampleAuditResults(i, UNKNOWN); |
| 3839 | } |
| 3840 | |
| 3841 | idle_work = TRUE; |
| 3842 | bDoGameCheck = TRUE; |
| 3843 | game_index = 0; |
| 3844 | |
| 3845 | ReloadIcons(); |
| 3846 | |
| 3847 | // Let REFRESH also load new background if found |
| 3848 | LoadBackgroundBitmap(); |
| 3849 | InvalidateRect(hMain,NULL,TRUE); |
| 3850 | Picker_ResetIdle(hwndList); |
| 3851 | } |
| 3852 | |
| 3853 | UINT_PTR CALLBACK CFHookProc( |
| 3854 | HWND hdlg, // handle to dialog box |
| 3855 | UINT uiMsg, // message identifier |
| 3856 | WPARAM wParam, // message parameter |
| 3857 | LPARAM lParam // message parameter |
| 3858 | ) |
| 3859 | { |
| 3860 | int iIndex, i; |
| 3861 | COLORREF cCombo, cList; |
| 3862 | switch (uiMsg) |
| 3863 | { |
| 3864 | case WM_INITDIALOG: |
| 3865 | SendDlgItemMessage(hdlg, cmb4, CB_ADDSTRING, 0, (LPARAM)TEXT("Custom")); |
| 3866 | iIndex = SendDlgItemMessage(hdlg, cmb4, CB_GETCOUNT, 0, 0); |
| 3867 | cList = GetListFontColor(); |
| 3868 | SendDlgItemMessage(hdlg, cmb4, CB_SETITEMDATA,(WPARAM)iIndex-1,(LPARAM)cList ); |
| 3869 | for( i = 0; i< iIndex; i++) |
| 3870 | { |
| 3871 | cCombo = SendDlgItemMessage(hdlg, cmb4, CB_GETITEMDATA,(WPARAM)i,0 ); |
| 3872 | if( cList == cCombo) |
| 3873 | { |
| 3874 | SendDlgItemMessage(hdlg, cmb4, CB_SETCURSEL,(WPARAM)i,0 ); |
| 3875 | break; |
| 3876 | } |
| 3877 | } |
| 3878 | break; |
| 3879 | case WM_COMMAND: |
| 3880 | if( LOWORD(wParam) == cmb4) |
| 3881 | { |
| 3882 | switch (HIWORD(wParam)) |
| 3883 | { |
| 3884 | case CBN_SELCHANGE: // The color ComboBox changed selection |
| 3885 | iIndex = (int)SendDlgItemMessage(hdlg, cmb4, |
| 3886 | CB_GETCURSEL, 0, 0L); |
| 3887 | if( iIndex == SendDlgItemMessage(hdlg, cmb4, CB_GETCOUNT, 0, 0)-1) |
| 3888 | { |
| 3889 | //Custom color selected |
| 3890 | cList = GetListFontColor(); |
| 3891 | PickColor(&cList); |
| 3892 | SendDlgItemMessage(hdlg, cmb4, CB_DELETESTRING, iIndex, 0); |
| 3893 | SendDlgItemMessage(hdlg, cmb4, CB_ADDSTRING, 0, (LPARAM)TEXT("Custom")); |
| 3894 | SendDlgItemMessage(hdlg, cmb4, CB_SETITEMDATA,(WPARAM)iIndex,(LPARAM)cList); |
| 3895 | SendDlgItemMessage(hdlg, cmb4, CB_SETCURSEL,(WPARAM)iIndex,0 ); |
| 3896 | return TRUE; |
| 3897 | } |
| 3898 | } |
| 3899 | } |
| 3900 | break; |
| 3901 | } |
| 3902 | return FALSE; |
| 3903 | } |
| 3904 | |
| 3905 | static void PickFont(void) |
| 3906 | { |
| 3907 | LOGFONT font; |
| 3908 | CHOOSEFONT cf; |
| 3909 | TCHAR szClass[128]; |
| 3910 | HWND hWnd; |
| 3911 | |
| 3912 | GetListFont(&font); |
| 3913 | font.lfQuality = DEFAULT_QUALITY; |
| 3914 | |
| 3915 | cf.lStructSize = sizeof(CHOOSEFONT); |
| 3916 | cf.hwndOwner = hMain; |
| 3917 | cf.lpLogFont = &font; |
| 3918 | cf.lpfnHook = &CFHookProc; |
| 3919 | cf.rgbColors = GetListFontColor(); |
| 3920 | cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_ENABLEHOOK; |
| 3921 | if (!ChooseFont(&cf)) |
| 3922 | return; |
| 3923 | |
| 3924 | SetListFont(&font); |
| 3925 | if (hFont != NULL) |
| 3926 | DeleteObject(hFont); |
| 3927 | hFont = CreateFontIndirect(&font); |
| 3928 | if (hFont != NULL) |
| 3929 | { |
| 3930 | COLORREF textColor = cf.rgbColors; |
| 3931 | |
| 3932 | if (textColor == RGB(255,255,255)) |
| 3933 | { |
| 3934 | textColor = RGB(240, 240, 240); |
| 3935 | } |
| 3936 | |
| 3937 | SetAllWindowsFont(hMain, &main_resize, hFont, TRUE); |
| 3938 | |
| 3939 | hWnd = GetWindow(hMain, GW_CHILD); |
| 3940 | while(hWnd) |
| 3941 | { |
| 3942 | if (GetClassName(hWnd, szClass, sizeof(szClass) / sizeof(szClass[0]))) |
| 3943 | { |
| 3944 | if (!_tcscmp(szClass, TEXT("SysListView32"))) |
| 3945 | { |
| 3946 | ListView_SetTextColor(hWnd, textColor); |
| 3947 | } |
| 3948 | else if (!_tcscmp(szClass, TEXT("SysTreeView32"))) |
| 3949 | { |
| 3950 | TreeView_SetTextColor(hTreeView, textColor); |
| 3951 | } |
| 3952 | } |
| 3953 | hWnd = GetWindow(hWnd, GW_HWNDNEXT); |
| 3954 | } |
| 3955 | SetListFontColor(cf.rgbColors); |
| 3956 | ResetListView(); |
| 3957 | } |
| 3958 | } |
| 3959 | |
| 3960 | static void PickColor(COLORREF *cDefault) |
| 3961 | { |
| 3962 | CHOOSECOLOR cc; |
| 3963 | COLORREF choice_colors[16]; |
| 3964 | int i; |
| 3965 | |
| 3966 | for (i=0;i<16;i++) |
| 3967 | choice_colors[i] = GetCustomColor(i); |
| 3968 | |
| 3969 | cc.lStructSize = sizeof(CHOOSECOLOR); |
| 3970 | cc.hwndOwner = hMain; |
| 3971 | cc.rgbResult = *cDefault; |
| 3972 | cc.lpCustColors = choice_colors; |
| 3973 | cc.Flags = CC_ANYCOLOR | CC_RGBINIT | CC_SOLIDCOLOR; |
| 3974 | if (!ChooseColor(&cc)) |
| 3975 | return; |
| 3976 | for (i=0;i<16;i++) |
| 3977 | SetCustomColor(i,choice_colors[i]); |
| 3978 | *cDefault = cc.rgbResult; |
| 3979 | } |
| 3980 | |
| 3981 | static void PickCloneColor(void) |
| 3982 | { |
| 3983 | COLORREF cClonecolor; |
| 3984 | cClonecolor = GetListCloneColor(); |
| 3985 | PickColor( &cClonecolor); |
| 3986 | SetListCloneColor(cClonecolor); |
| 3987 | InvalidateRect(hwndList,NULL,FALSE); |
| 3988 | } |
| 3989 | |
| 3990 | static BOOL MameCommand(HWND hwnd,int id, HWND hwndCtl, UINT codeNotify) |
| 3991 | { |
| 3992 | int i; |
| 3993 | LPTREEFOLDER folder; |
| 3994 | char* t_szFile; |
| 3995 | |
| 3996 | switch (id) |
| 3997 | { |
| 3998 | case ID_FILE_PLAY: |
| 3999 | MamePlayGame(); |
| 4000 | return TRUE; |
| 4001 | |
| 4002 | case ID_FILE_PLAY_RECORD: |
| 4003 | MamePlayRecordGame(); |
| 4004 | return TRUE; |
| 4005 | |
| 4006 | case ID_FILE_PLAY_BACK: |
| 4007 | MamePlayBackGame(); |
| 4008 | return TRUE; |
| 4009 | |
| 4010 | case ID_FILE_PLAY_RECORD_WAVE: |
| 4011 | MamePlayRecordWave(); |
| 4012 | return TRUE; |
| 4013 | |
| 4014 | case ID_FILE_PLAY_RECORD_MNG: |
| 4015 | MamePlayRecordMNG(); |
| 4016 | return TRUE; |
| 4017 | |
| 4018 | case ID_FILE_LOADSTATE : |
| 4019 | MameLoadState(); |
| 4020 | return TRUE; |
| 4021 | |
| 4022 | case ID_FILE_AUDIT: |
| 4023 | AuditDialog(hMain); |
| 4024 | ResetWhichGamesInFolders(); |
| 4025 | ResetListView(); |
| 4026 | SetFocus(hwndList); |
| 4027 | return TRUE; |
| 4028 | |
| 4029 | case ID_FILE_EXIT: |
| 4030 | PostMessage(hMain, WM_CLOSE, 0, 0); |
| 4031 | return TRUE; |
| 4032 | |
| 4033 | case ID_VIEW_LARGE_ICON: |
| 4034 | SetView(ID_VIEW_LARGE_ICON); |
| 4035 | return TRUE; |
| 4036 | |
| 4037 | case ID_VIEW_SMALL_ICON: |
| 4038 | SetView(ID_VIEW_SMALL_ICON); |
| 4039 | ResetListView(); |
| 4040 | return TRUE; |
| 4041 | |
| 4042 | case ID_VIEW_LIST_MENU: |
| 4043 | SetView(ID_VIEW_LIST_MENU); |
| 4044 | return TRUE; |
| 4045 | |
| 4046 | case ID_VIEW_DETAIL: |
| 4047 | SetView(ID_VIEW_DETAIL); |
| 4048 | return TRUE; |
| 4049 | |
| 4050 | case ID_VIEW_GROUPED: |
| 4051 | SetView(ID_VIEW_GROUPED); |
| 4052 | return TRUE; |
| 4053 | |
| 4054 | /* Arrange Icons submenu */ |
| 4055 | case ID_VIEW_BYGAME: |
| 4056 | SetSortReverse(FALSE); |
| 4057 | SetSortColumn(COLUMN_GAMES); |
| 4058 | Picker_Sort(hwndList); |
| 4059 | break; |
| 4060 | |
| 4061 | case ID_VIEW_BYDIRECTORY: |
| 4062 | SetSortReverse(FALSE); |
| 4063 | SetSortColumn(COLUMN_DIRECTORY); |
| 4064 | Picker_Sort(hwndList); |
| 4065 | break; |
| 4066 | |
| 4067 | case ID_VIEW_BYMANUFACTURER: |
| 4068 | SetSortReverse(FALSE); |
| 4069 | SetSortColumn(COLUMN_MANUFACTURER); |
| 4070 | Picker_Sort(hwndList); |
| 4071 | break; |
| 4072 | |
| 4073 | case ID_VIEW_BYTIMESPLAYED: |
| 4074 | SetSortReverse(FALSE); |
| 4075 | SetSortColumn(COLUMN_PLAYED); |
| 4076 | Picker_Sort(hwndList); |
| 4077 | break; |
| 4078 | |
| 4079 | case ID_VIEW_BYTYPE: |
| 4080 | SetSortReverse(FALSE); |
| 4081 | SetSortColumn(COLUMN_TYPE); |
| 4082 | Picker_Sort(hwndList); |
| 4083 | break; |
| 4084 | |
| 4085 | case ID_VIEW_BYYEAR: |
| 4086 | SetSortReverse(FALSE); |
| 4087 | SetSortColumn(COLUMN_YEAR); |
| 4088 | Picker_Sort(hwndList); |
| 4089 | break; |
| 4090 | |
| 4091 | case ID_VIEW_FOLDERS: |
| 4092 | bShowTree = !bShowTree; |
| 4093 | SetShowFolderList(bShowTree); |
| 4094 | CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED); |
| 4095 | ToolBar_CheckButton(hToolBar, ID_VIEW_FOLDERS, (bShowTree) ? MF_CHECKED : MF_UNCHECKED); |
| 4096 | UpdateScreenShot(); |
| 4097 | break; |
| 4098 | |
| 4099 | case ID_VIEW_TOOLBARS: |
| 4100 | bShowToolBar = !bShowToolBar; |
| 4101 | SetShowToolBar(bShowToolBar); |
| 4102 | CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED); |
| 4103 | ToolBar_CheckButton(hToolBar, ID_VIEW_TOOLBARS, (bShowToolBar) ? MF_CHECKED : MF_UNCHECKED); |
| 4104 | ShowWindow(hToolBar, (bShowToolBar) ? SW_SHOW : SW_HIDE); |
| 4105 | ResizePickerControls(hMain); |
| 4106 | UpdateScreenShot(); |
| 4107 | break; |
| 4108 | |
| 4109 | case ID_VIEW_STATUS: |
| 4110 | bShowStatusBar = !bShowStatusBar; |
| 4111 | SetShowStatusBar(bShowStatusBar); |
| 4112 | CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED); |
| 4113 | ToolBar_CheckButton(hToolBar, ID_VIEW_STATUS, (bShowStatusBar) ? MF_CHECKED : MF_UNCHECKED); |
| 4114 | ShowWindow(hStatusBar, (bShowStatusBar) ? SW_SHOW : SW_HIDE); |
| 4115 | ResizePickerControls(hMain); |
| 4116 | UpdateScreenShot(); |
| 4117 | break; |
| 4118 | |
| 4119 | case ID_VIEW_PAGETAB: |
| 4120 | bShowTabCtrl = !bShowTabCtrl; |
| 4121 | SetShowTabCtrl(bShowTabCtrl); |
| 4122 | ShowWindow(hTabCtrl, (bShowTabCtrl) ? SW_SHOW : SW_HIDE); |
| 4123 | ResizePickerControls(hMain); |
| 4124 | UpdateScreenShot(); |
| 4125 | InvalidateRect(hMain,NULL,TRUE); |
| 4126 | break; |
| 4127 | |
| 4128 | /* |
| 4129 | Switches to fullscreen mode. No check mark handeling |
| 4130 | for this item cause in fullscreen mode the menu won't |
| 4131 | be visible anyways. |
| 4132 | */ |
| 4133 | case ID_VIEW_FULLSCREEN: |
| 4134 | SwitchFullScreenMode(); |
| 4135 | break; |
| 4136 | |
| 4137 | case ID_TOOLBAR_EDIT: |
| 4138 | { |
| 4139 | char buf[256]; |
| 4140 | |
| 4141 | win_get_window_text_utf8(hwndCtl, buf, sizeof(buf)); |
| 4142 | switch (codeNotify) |
| 4143 | { |
| 4144 | case EN_CHANGE: |
| 4145 | //put search routine here first, add a 200ms timer later. |
| 4146 | if ((!_stricmp(buf, SEARCH_PROMPT) && !_stricmp(g_SearchText, "")) || |
| 4147 | (!_stricmp(g_SearchText, SEARCH_PROMPT) && !_stricmp(buf, ""))) |
| 4148 | { |
| 4149 | strcpy(g_SearchText, buf); |
| 4150 | } |
| 4151 | else |
| 4152 | { |
| 4153 | strcpy(g_SearchText, buf); |
| 4154 | ResetListView(); |
| 4155 | } |
| 4156 | break; |
| 4157 | case EN_SETFOCUS: |
| 4158 | if (!_stricmp(buf, SEARCH_PROMPT)) |
| 4159 | win_set_window_text_utf8(hwndCtl, ""); |
| 4160 | break; |
| 4161 | case EN_KILLFOCUS: |
| 4162 | if (strlen(buf) == 0) |
| 4163 | win_set_window_text_utf8(hwndCtl, SEARCH_PROMPT); |
| 4164 | break; |
| 4165 | } |
| 4166 | } |
| 4167 | break; |
| 4168 | |
| 4169 | case ID_GAME_AUDIT: |
| 4170 | InitGameAudit(0); |
| 4171 | if (!oldControl) |
| 4172 | { |
| 4173 | InitPropertyPageToPage(hInst, hwnd, GetSelectedPickItemIcon(), OPTIONS_GAME, -1, Picker_GetSelectedItem(hwndList), AUDIT_PAGE); |
| 4174 | } |
| 4175 | /* Just in case the toggle MMX on/off */ |
| 4176 | UpdateStatusBar(); |
| 4177 | break; |
| 4178 | |
| 4179 | /* ListView Context Menu */ |
| 4180 | case ID_CONTEXT_ADD_CUSTOM: |
| 4181 | { |
| 4182 | int nResult; |
| 4183 | |
| 4184 | nResult = DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_CUSTOM_FILE), |
| 4185 | hMain,AddCustomFileDialogProc,Picker_GetSelectedItem(hwndList)); |
| 4186 | SetFocus(hwndList); |
| 4187 | break; |
| 4188 | } |
| 4189 | |
| 4190 | case ID_CONTEXT_REMOVE_CUSTOM: |
| 4191 | { |
| 4192 | RemoveCurrentGameCustomFolder(); |
| 4193 | break; |
| 4194 | } |
| 4195 | |
| 4196 | /* Tree Context Menu */ |
| 4197 | case ID_CONTEXT_FILTERS: |
| 4198 | if (DialogBox(GetModuleHandle(NULL), |
| 4199 | MAKEINTRESOURCE(IDD_FILTERS), hMain, FilterDialogProc) == TRUE) |
| 4200 | ResetListView(); |
| 4201 | SetFocus(hwndList); |
| 4202 | return TRUE; |
| 4203 | |
| 4204 | // ScreenShot Context Menu |
| 4205 | // select current tab |
| 4206 | case ID_VIEW_TAB_SCREENSHOT : |
| 4207 | case ID_VIEW_TAB_FLYER : |
| 4208 | case ID_VIEW_TAB_CABINET : |
| 4209 | case ID_VIEW_TAB_MARQUEE : |
| 4210 | case ID_VIEW_TAB_TITLE : |
| 4211 | case ID_VIEW_TAB_CONTROL_PANEL : |
| 4212 | case ID_VIEW_TAB_PCB : |
| 4213 | case ID_VIEW_TAB_HISTORY: |
| 4214 | if (id == ID_VIEW_TAB_HISTORY && GetShowTab(TAB_HISTORY) == FALSE) |
| 4215 | break; |
| 4216 | |
| 4217 | TabView_SetCurrentTab(hTabCtrl, id - ID_VIEW_TAB_SCREENSHOT); |
| 4218 | UpdateScreenShot(); |
| 4219 | TabView_UpdateSelection(hTabCtrl); |
| 4220 | break; |
| 4221 | |
| 4222 | // toggle tab's existence |
| 4223 | case ID_TOGGLE_TAB_SCREENSHOT : |
| 4224 | case ID_TOGGLE_TAB_FLYER : |
| 4225 | case ID_TOGGLE_TAB_CABINET : |
| 4226 | case ID_TOGGLE_TAB_MARQUEE : |
| 4227 | case ID_TOGGLE_TAB_TITLE : |
| 4228 | case ID_TOGGLE_TAB_CONTROL_PANEL : |
| 4229 | case ID_TOGGLE_TAB_PCB : |
| 4230 | case ID_TOGGLE_TAB_HISTORY : |
| 4231 | { |
| 4232 | int toggle_flag = id - ID_TOGGLE_TAB_SCREENSHOT; |
| 4233 | |
| 4234 | if (AllowedToSetShowTab(toggle_flag,!GetShowTab(toggle_flag)) == FALSE) |
| 4235 | { |
| 4236 | // attempt to hide the last tab |
| 4237 | // should show error dialog? hide picture area? or ignore? |
| 4238 | break; |
| 4239 | } |
| 4240 | |
| 4241 | SetShowTab(toggle_flag,!GetShowTab(toggle_flag)); |
| 4242 | |
| 4243 | TabView_Reset(hTabCtrl); |
| 4244 | |
| 4245 | if (TabView_GetCurrentTab(hTabCtrl) == toggle_flag && GetShowTab(toggle_flag) == FALSE) |
| 4246 | { |
| 4247 | // we're deleting the tab we're on, so go to the next one |
| 4248 | TabView_CalculateNextTab(hTabCtrl); |
| 4249 | } |
| 4250 | |
| 4251 | |
| 4252 | // Resize the controls in case we toggled to another history |
| 4253 | // mode (and the history control needs resizing). |
| 4254 | |
| 4255 | ResizePickerControls(hMain); |
| 4256 | UpdateScreenShot(); |
| 4257 | |
| 4258 | TabView_UpdateSelection(hTabCtrl); |
| 4259 | |
| 4260 | break; |
| 4261 | } |
| 4262 | |
| 4263 | /* Header Context Menu */ |
| 4264 | case ID_SORT_ASCENDING: |
| 4265 | SetSortReverse(FALSE); |
| 4266 | SetSortColumn(Picker_GetRealColumnFromViewColumn(hwndList, lastColumnClick)); |
| 4267 | Picker_Sort(hwndList); |
| 4268 | break; |
| 4269 | |
| 4270 | case ID_SORT_DESCENDING: |
| 4271 | SetSortReverse(TRUE); |
| 4272 | SetSortColumn(Picker_GetRealColumnFromViewColumn(hwndList, lastColumnClick)); |
| 4273 | Picker_Sort(hwndList); |
| 4274 | break; |
| 4275 | |
| 4276 | case ID_CUSTOMIZE_FIELDS: |
| 4277 | if (DialogBox(GetModuleHandle(NULL), |
| 4278 | MAKEINTRESOURCE(IDD_COLUMNS), hMain, ColumnDialogProc) == TRUE) |
| 4279 | ResetColumnDisplay(FALSE); |
| 4280 | SetFocus(hwndList); |
| 4281 | return TRUE; |
| 4282 | |
| 4283 | /* View Menu */ |
| 4284 | case ID_VIEW_LINEUPICONS: |
| 4285 | if( codeNotify == FALSE) |
| 4286 | ResetListView(); |
| 4287 | else |
| 4288 | { |
| 4289 | /*it was sent after a refresh (F5) was done, we only reset the View if "available" is the selected folder |
| 4290 | as it doesn't affect the others*/ |
| 4291 | folder = GetSelectedFolder(); |
| 4292 | if( folder ) |
| 4293 | { |
| 4294 | if (folder->m_nFolderId == FOLDER_AVAILABLE ) |
| 4295 | ResetListView(); |
| 4296 | |
| 4297 | } |
| 4298 | } |
| 4299 | break; |
| 4300 | |
| 4301 | case ID_GAME_PROPERTIES: |
| 4302 | if (!oldControl) |
| 4303 | { |
| 4304 | folder = GetFolderByName(FOLDER_SOURCE, GetDriverFilename(Picker_GetSelectedItem(hwndList)) ); |
| 4305 | InitPropertyPage(hInst, hwnd, GetSelectedPickItemIcon(), OPTIONS_GAME, folder->m_nFolderId, Picker_GetSelectedItem(hwndList)); |
| 4306 | #ifdef MESS |
| 4307 | { |
| 4308 | extern BOOL g_bModifiedSoftwarePaths; |
| 4309 | if (g_bModifiedSoftwarePaths) { |
| 4310 | g_bModifiedSoftwarePaths = FALSE; |
| 4311 | MessUpdateSoftwareList(); |
| 4312 | } |
| 4313 | } |
| 4314 | #endif |
| 4315 | } |
| 4316 | /* Just in case the toggle MMX on/off */ |
| 4317 | UpdateStatusBar(); |
| 4318 | break; |
| 4319 | |
| 4320 | case ID_FOLDER_PROPERTIES: |
| 4321 | if (!oldControl) |
| 4322 | { |
| 4323 | folder = GetSelectedFolder(); |
| 4324 | InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), (folder->m_nFolderId == FOLDER_VECTOR) ? OPTIONS_VECTOR : OPTIONS_SOURCE, folder->m_nFolderId, Picker_GetSelectedItem(hwndList)); |
| 4325 | //SaveFolderOptions(folder->m_nFolderId, Picker_GetSelectedItem(hwndList) ); |
| 4326 | } |
| 4327 | /* Just in case the toggle MMX on/off */ |
| 4328 | UpdateStatusBar(); |
| 4329 | break; |
| 4330 | |
| 4331 | case ID_FOLDER_SOURCEPROPERTIES: |
| 4332 | if (!oldControl) |
| 4333 | { |
| 4334 | folder = GetFolderByName(FOLDER_SOURCE, GetDriverFilename(Picker_GetSelectedItem(hwndList)) ); |
| 4335 | InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), (folder->m_nFolderId == FOLDER_VECTOR) ? OPTIONS_VECTOR : OPTIONS_SOURCE , folder->m_nFolderId, Picker_GetSelectedItem(hwndList)); |
| 4336 | //SaveFolderOptions(folder->m_nFolderId, Picker_GetSelectedItem(hwndList) ); |
| 4337 | } |
| 4338 | /* Just in case the toggle MMX on/off */ |
| 4339 | UpdateStatusBar(); |
| 4340 | break; |
| 4341 | |
| 4342 | case ID_FOLDER_VECTORPROPERTIES: |
| 4343 | if (!oldControl) |
| 4344 | { |
| 4345 | folder = GetFolderByID( FOLDER_VECTOR ); |
| 4346 | InitPropertyPage(hInst, hwnd, GetSelectedFolderIcon(), OPTIONS_VECTOR, folder->m_nFolderId, Picker_GetSelectedItem(hwndList)); |
| 4347 | //SaveFolderOptions(folder->m_nFolderId, Picker_GetSelectedItem(hwndList) ); |
| 4348 | } |
| 4349 | /* Just in case the toggle MMX on/off */ |
| 4350 | UpdateStatusBar(); |
| 4351 | break; |
| 4352 | |
| 4353 | case ID_FOLDER_AUDIT: |
| 4354 | FolderCheck(); |
| 4355 | /* Just in case the toggle MMX on/off */ |
| 4356 | UpdateStatusBar(); |
| 4357 | break; |
| 4358 | |
| 4359 | case ID_VIEW_PICTURE_AREA : |
| 4360 | ToggleScreenShot(); |
| 4361 | break; |
| 4362 | |
| 4363 | case ID_UPDATE_GAMELIST: |
| 4364 | UpdateGameList(TRUE, TRUE); |
| 4365 | break; |
| 4366 | |
| 4367 | case ID_OPTIONS_FONT: |
| 4368 | PickFont(); |
| 4369 | return TRUE; |
| 4370 | |
| 4371 | case ID_OPTIONS_CLONE_COLOR: |
| 4372 | PickCloneColor(); |
| 4373 | return TRUE; |
| 4374 | |
| 4375 | case ID_OPTIONS_DEFAULTS: |
| 4376 | /* Check the return value to see if changes were applied */ |
| 4377 | if (!oldControl) |
| 4378 | { |
| 4379 | InitDefaultPropertyPage(hInst, hwnd); |
| 4380 | SaveDefaultOptions(); |
| 4381 | } |
| 4382 | SetFocus(hwndList); |
| 4383 | return TRUE; |
| 4384 | |
| 4385 | case ID_OPTIONS_DIR: |
| 4386 | { |
| 4387 | int nResult; |
| 4388 | BOOL bUpdateRoms; |
| 4389 | BOOL bUpdateSamples; |
| 4390 | #ifdef MESS |
| 4391 | BOOL bUpdateSoftware; |
| 4392 | #endif |
| 4393 | |
| 4394 | nResult = DialogBox(GetModuleHandle(NULL), |
| 4395 | MAKEINTRESOURCE(IDD_DIRECTORIES), |
| 4396 | hMain, |
| 4397 | DirectoriesDialogProc); |
| 4398 | |
| 4399 | SaveDefaultOptions(); |
| 4400 | |
| 4401 | bUpdateRoms = ((nResult & DIRDLG_ROMS) == DIRDLG_ROMS) ? TRUE : FALSE; |
| 4402 | bUpdateSamples = ((nResult & DIRDLG_SAMPLES) == DIRDLG_SAMPLES) ? TRUE : FALSE; |
| 4403 | #ifdef MESS |
| 4404 | bUpdateSoftware = ((nResult & DIRDLG_SOFTWARE) == DIRDLG_SOFTWARE) ? TRUE : FALSE; |
| 4405 | |
| 4406 | if (bUpdateSoftware) |
| 4407 | MessUpdateSoftwareList(); |
| 4408 | #endif /* MESS */ |
| 4409 | |
| 4410 | if (s_pWatcher) |
| 4411 | { |
| 4412 | if (bUpdateRoms) |
| 4413 | DirWatcher_Watch(s_pWatcher, 0, GetRomDirs(), TRUE); |
| 4414 | if (bUpdateSamples) |
| 4415 | DirWatcher_Watch(s_pWatcher, 1, GetSampleDirs(), TRUE); |
| 4416 | } |
| 4417 | |
| 4418 | /* update game list */ |
| 4419 | if (bUpdateRoms == TRUE || bUpdateSamples == TRUE) |
| 4420 | UpdateGameList(bUpdateRoms, bUpdateSamples); |
| 4421 | |
| 4422 | SetFocus(hwndList); |
| 4423 | } |
| 4424 | return TRUE; |
| 4425 | |
| 4426 | case ID_OPTIONS_RESET_DEFAULTS: |
| 4427 | if (DialogBox(GetModuleHandle(NULL), |
| 4428 | MAKEINTRESOURCE(IDD_RESET), hMain, ResetDialogProc) == TRUE) |
| 4429 | { |
| 4430 | // these may have been changed |
| 4431 | SaveDefaultOptions(); |
| 4432 | DestroyWindow(hwnd); |
| 4433 | PostQuitMessage(0); |
| 4434 | } else { |
| 4435 | ResetListView(); |
| 4436 | SetFocus(hwndList); |
| 4437 | } |
| 4438 | return TRUE; |
| 4439 | |
| 4440 | case ID_OPTIONS_INTERFACE: |
| 4441 | DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_INTERFACE_OPTIONS), |
| 4442 | hMain, InterfaceDialogProc); |
| 4443 | SaveDefaultOptions(); |
| 4444 | |
| 4445 | KillTimer(hMain, SCREENSHOT_TIMER); |
| 4446 | if( GetCycleScreenshot() > 0) |
| 4447 | { |
| 4448 | SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL ); // Scale to seconds |
| 4449 | } |
| 4450 | |
| 4451 | return TRUE; |
| 4452 | |
| 4453 | case ID_OPTIONS_BG: |
| 4454 | { |
| 4455 | OPENFILENAME OpenFileName; |
| 4456 | static TCHAR szFile[MAX_PATH] = TEXT("\0"); |
| 4457 | TCHAR* t_bgdir = tstring_from_utf8(GetBgDir()); |
| 4458 | if( !t_bgdir ) |
| 4459 | return FALSE; |
| 4460 | |
| 4461 | OpenFileName.lStructSize = sizeof(OPENFILENAME); |
| 4462 | OpenFileName.hwndOwner = hMain; |
| 4463 | OpenFileName.hInstance = 0; |
| 4464 | OpenFileName.lpstrFilter = TEXT("Image Files (*.png, *.bmp)\0*.PNG;*.BMP\0"); |
| 4465 | OpenFileName.lpstrCustomFilter = NULL; |
| 4466 | OpenFileName.nMaxCustFilter = 0; |
| 4467 | OpenFileName.nFilterIndex = 1; |
| 4468 | OpenFileName.lpstrFile = szFile; |
| 4469 | OpenFileName.nMaxFile = sizeof(szFile); |
| 4470 | OpenFileName.lpstrFileTitle = NULL; |
| 4471 | OpenFileName.nMaxFileTitle = 0; |
| 4472 | OpenFileName.lpstrInitialDir = t_bgdir; |
| 4473 | OpenFileName.lpstrTitle = TEXT("Select a Background Image"); |
| 4474 | OpenFileName.nFileOffset = 0; |
| 4475 | OpenFileName.nFileExtension = 0; |
| 4476 | OpenFileName.lpstrDefExt = NULL; |
| 4477 | OpenFileName.lCustData = 0; |
| 4478 | OpenFileName.lpfnHook = NULL; |
| 4479 | OpenFileName.lpTemplateName = NULL; |
| 4480 | OpenFileName.Flags = OFN_NOCHANGEDIR | OFN_SHOWHELP | OFN_EXPLORER; |
| 4481 | |
| 4482 | if (GetOpenFileName(&OpenFileName)) |
| 4483 | { |
| 4484 | t_szFile = utf8_from_tstring(szFile); |
| 4485 | if( !t_szFile ) |
| 4486 | return FALSE; |
| 4487 | ResetBackground(t_szFile); |
| 4488 | LoadBackgroundBitmap(); |
| 4489 | InvalidateRect(hMain, NULL, TRUE); |
| 4490 | free(t_bgdir); |
| 4491 | free(t_szFile); |
| 4492 | return TRUE; |
| 4493 | } |
| 4494 | free(t_bgdir); |
| 4495 | } |
| 4496 | break; |
| 4497 | |
| 4498 | case ID_OPTIONS_LANGUAGE: |
| 4499 | DialogBox(GetModuleHandle(NULL), |
| 4500 | MAKEINTRESOURCE(IDD_LANGUAGE), |
| 4501 | hMain, |
| 4502 | LanguageDialogProc); |
| 4503 | return TRUE; |
| 4504 | |
| 4505 | case ID_HELP_ABOUT: |
| 4506 | DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUT), |
| 4507 | hMain, AboutDialogProc); |
| 4508 | SetFocus(hwndList); |
| 4509 | return TRUE; |
| 4510 | |
| 4511 | case IDOK : |
| 4512 | /* cmk -- might need to check more codes here, not sure */ |
| 4513 | if (codeNotify != EN_CHANGE && codeNotify != EN_UPDATE) |
| 4514 | { |
| 4515 | /* enter key */ |
| 4516 | if (g_in_treeview_edit) |
| 4517 | { |
| 4518 | TreeView_EndEditLabelNow(hTreeView, FALSE); |
| 4519 | return TRUE; |
| 4520 | } |
| 4521 | else |
| 4522 | if (have_selection) |
| 4523 | MamePlayGame(); |
| 4524 | } |
| 4525 | break; |
| 4526 | |
| 4527 | case IDCANCEL : /* esc key */ |
| 4528 | if (g_in_treeview_edit) |
| 4529 | TreeView_EndEditLabelNow(hTreeView, TRUE); |
| 4530 | break; |
| 4531 | |
| 4532 | case IDC_PLAY_GAME : |
| 4533 | if (have_selection) |
| 4534 | MamePlayGame(); |
| 4535 | break; |
| 4536 | |
| 4537 | case ID_UI_START: |
| 4538 | SetFocus(hwndList); |
| 4539 | MamePlayGame(); |
| 4540 | break; |
| 4541 | |
| 4542 | case ID_UI_UP: |
| 4543 | Picker_SetSelectedPick(hwndList, GetSelectedPick() - 1); |
| 4544 | break; |
| 4545 | |
| 4546 | case ID_UI_DOWN: |
| 4547 | Picker_SetSelectedPick(hwndList, GetSelectedPick() + 1); |
| 4548 | break; |
| 4549 | |
| 4550 | case ID_UI_PGUP: |
| 4551 | Picker_SetSelectedPick(hwndList, GetSelectedPick() - ListView_GetCountPerPage(hwndList)); |
| 4552 | break; |
| 4553 | |
| 4554 | case ID_UI_PGDOWN: |
| 4555 | if ( (GetSelectedPick() + ListView_GetCountPerPage(hwndList)) < ListView_GetItemCount(hwndList) ) |
| 4556 | Picker_SetSelectedPick(hwndList, GetSelectedPick() + ListView_GetCountPerPage(hwndList) ); |
| 4557 | else |
| 4558 | Picker_SetSelectedPick(hwndList, ListView_GetItemCount(hwndList)-1 ); |
| 4559 | break; |
| 4560 | |
| 4561 | case ID_UI_HOME: |
| 4562 | Picker_SetSelectedPick(hwndList, 0); |
| 4563 | break; |
| 4564 | |
| 4565 | case ID_UI_END: |
| 4566 | Picker_SetSelectedPick(hwndList, ListView_GetItemCount(hwndList)-1 ); |
| 4567 | break; |
| 4568 | case ID_UI_LEFT: |
| 4569 | /* hmmmmm..... */ |
| 4570 | SendMessage(hwndList,WM_HSCROLL, SB_LINELEFT, 0); |
| 4571 | break; |
| 4572 | |
| 4573 | case ID_UI_RIGHT: |
| 4574 | /* hmmmmm..... */ |
| 4575 | SendMessage(hwndList,WM_HSCROLL, SB_LINERIGHT, 0); |
| 4576 | break; |
| 4577 | case ID_UI_HISTORY_UP: |
| 4578 | /* hmmmmm..... */ |
| 4579 | { |
| 4580 | HWND hHistory = GetDlgItem(hMain, IDC_HISTORY); |
| 4581 | SendMessage(hHistory, EM_SCROLL, SB_PAGEUP, 0); |
| 4582 | } |
| 4583 | break; |
| 4584 | |
| 4585 | case ID_UI_HISTORY_DOWN: |
| 4586 | /* hmmmmm..... */ |
| 4587 | { |
| 4588 | HWND hHistory = GetDlgItem(hMain, IDC_HISTORY); |
| 4589 | SendMessage(hHistory, EM_SCROLL, SB_PAGEDOWN, 0); |
| 4590 | } |
| 4591 | break; |
| 4592 | |
| 4593 | case IDC_SSFRAME: |
| 4594 | TabView_CalculateNextTab(hTabCtrl); |
| 4595 | UpdateScreenShot(); |
| 4596 | TabView_UpdateSelection(hTabCtrl); |
| 4597 | break; |
| 4598 | |
| 4599 | case ID_CONTEXT_SELECT_RANDOM: |
| 4600 | SetRandomPickItem(); |
| 4601 | break; |
| 4602 | |
| 4603 | case ID_CONTEXT_RESET_PLAYTIME: |
| 4604 | ResetPlayTime( Picker_GetSelectedItem(hwndList) ); |
| 4605 | ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick()); |
| 4606 | break; |
| 4607 | |
| 4608 | case ID_CONTEXT_RESET_PLAYCOUNT: |
| 4609 | ResetPlayCount( Picker_GetSelectedItem(hwndList) ); |
| 4610 | ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick()); |
| 4611 | break; |
| 4612 | |
| 4613 | case ID_CONTEXT_RENAME_CUSTOM : |
| 4614 | TreeView_EditLabel(hTreeView,TreeView_GetSelection(hTreeView)); |
| 4615 | break; |
| 4616 | |
| 4617 | default: |
| 4618 | if (id >= ID_CONTEXT_SHOW_FOLDER_START && id < ID_CONTEXT_SHOW_FOLDER_END) |
| 4619 | { |
| 4620 | ToggleShowFolder(id - ID_CONTEXT_SHOW_FOLDER_START); |
| 4621 | break; |
| 4622 | } |
| 4623 | for (i = 0; g_helpInfo[i].nMenuItem > 0; i++) |
| 4624 | { |
| 4625 | if (g_helpInfo[i].nMenuItem == id) |
| 4626 | { |
| 4627 | if (g_helpInfo[i].bIsHtmlHelp) |
| 4628 | HelpFunction(hMain, g_helpInfo[i].lpFile, HH_DISPLAY_TOPIC, 0); |
| 4629 | else |
| 4630 | DisplayTextFile(hMain, g_helpInfo[i].lpFile); |
| 4631 | return FALSE; |
| 4632 | } |
| 4633 | } |
| 4634 | #ifdef MESS |
| 4635 | return MessCommand(hwnd, id, hwndCtl, codeNotify); |
| 4636 | #else |
| 4637 | break; |
| 4638 | #endif |
| 4639 | } |
| 4640 | |
| 4641 | return FALSE; |
| 4642 | } |
| 4643 | |
| 4644 | static void LoadBackgroundBitmap() |
| 4645 | { |
| 4646 | HGLOBAL hDIBbg; |
| 4647 | char* pFileName = 0; |
| 4648 | |
| 4649 | if (hBackground) |
| 4650 | { |
| 4651 | DeleteObject(hBackground); |
| 4652 | hBackground = 0; |
| 4653 | } |
| 4654 | |
| 4655 | if (hPALbg) |
| 4656 | { |
| 4657 | DeleteObject(hPALbg); |
| 4658 | hPALbg = 0; |
| 4659 | } |
| 4660 | |
| 4661 | /* Pick images based on number of colors avaliable. */ |
| 4662 | if (GetDepth(hwndList) <= 8) |
| 4663 | { |
| 4664 | pFileName = (char *)"bkgnd16"; |
| 4665 | /*nResource = IDB_BKGROUND16;*/ |
| 4666 | } |
| 4667 | else |
| 4668 | { |
| 4669 | pFileName = (char *)"bkground"; |
| 4670 | /*nResource = IDB_BKGROUND;*/ |
| 4671 | } |
| 4672 | |
| 4673 | if (LoadDIB(pFileName, &hDIBbg, &hPALbg, BACKGROUND)) |
| 4674 | { |
| 4675 | HDC hDC = GetDC(hwndList); |
| 4676 | hBackground = DIBToDDB(hDC, hDIBbg, &bmDesc); |
| 4677 | GlobalFree(hDIBbg); |
| 4678 | ReleaseDC(hwndList, hDC); |
| 4679 | } |
| 4680 | } |
| 4681 | |
| 4682 | static void ResetColumnDisplay(BOOL first_time) |
| 4683 | { |
| 4684 | int driver_index; |
| 4685 | |
| 4686 | if (!first_time) |
| 4687 | Picker_ResetColumnDisplay(hwndList); |
| 4688 | |
| 4689 | ResetListView(); |
| 4690 | |
| 4691 | driver_index = GetGameNameIndex(GetDefaultGame()); |
| 4692 | Picker_SetSelectedItem(hwndList, driver_index); |
| 4693 | } |
| 4694 | |
| 4695 | int GamePicker_GetItemImage(HWND hwndPicker, int nItem) |
| 4696 | { |
| 4697 | return GetIconForDriver(nItem); |
| 4698 | } |
| 4699 | |
| 4700 | const TCHAR *GamePicker_GetItemString(HWND hwndPicker, int nItem, int nColumn, |
| 4701 | TCHAR *pszBuffer, UINT nBufferLength) |
| 4702 | { |
| 4703 | const TCHAR *s = NULL; |
| 4704 | const char* utf8_s = NULL; |
| 4705 | char playtime_buf[256]; |
| 4706 | |
| 4707 | switch(nColumn) |
| 4708 | { |
| 4709 | case COLUMN_GAMES: |
| 4710 | /* Driver description */ |
| 4711 | utf8_s = ModifyThe(drivers[nItem]->description); |
| 4712 | break; |
| 4713 | case COLUMN_ORIENTATION: |
| 4714 | utf8_s = DriverIsVertical(nItem) ? "Vertical" : "Horizontal"; |
| 4715 | break; |
| 4716 | #if 0 |
| 4717 | case COLUMN_ROMS: |
| 4718 | /* Has Roms */ |
| 4719 | utf8_s = GetAuditString(GetRomAuditResults(nItem)); |
| 4720 | break; |
| 4721 | #endif |
| 4722 | case COLUMN_SAMPLES: |
| 4723 | /* Samples */ |
| 4724 | if (DriverUsesSamples(nItem)) |
| 4725 | utf8_s = GetAuditString(GetSampleAuditResults(nItem)); |
| 4726 | break; |
| 4727 | |
| 4728 | case COLUMN_DIRECTORY: |
| 4729 | /* Driver name (directory) */ |
| 4730 | utf8_s = drivers[nItem]->name; |
| 4731 | break; |
| 4732 | |
| 4733 | case COLUMN_SRCDRIVERS: |
| 4734 | /* Source drivers */ |
| 4735 | utf8_s = GetDriverFilename(nItem); |
| 4736 | break; |
| 4737 | |
| 4738 | case COLUMN_PLAYTIME: |
| 4739 | /* Source drivers */ |
| 4740 | GetTextPlayTime(nItem, playtime_buf); |
| 4741 | utf8_s = playtime_buf; |
| 4742 | break; |
| 4743 | |
| 4744 | case COLUMN_TYPE: |
| 4745 | { |
| 4746 | machine_config drv; |
| 4747 | expand_machine_driver(drivers[nItem]->drv,&drv); |
| 4748 | |
| 4749 | /* Vector/Raster */ |
| 4750 | if (drv.video_attributes & VIDEO_TYPE_VECTOR) |
| 4751 | s = TEXT("Vector"); |
| 4752 | else |
| 4753 | s = TEXT("Raster"); |
| 4754 | break; |
| 4755 | } |
| 4756 | case COLUMN_TRACKBALL: |
| 4757 | /* Trackball */ |
| 4758 | if (DriverUsesTrackball(nItem)) |
| 4759 | s = TEXT("Yes"); |
| 4760 | else |
| 4761 | s = TEXT("No"); |
| 4762 | break; |
| 4763 | |
| 4764 | case COLUMN_PLAYED: |
| 4765 | /* times played */ |
| 4766 | _sntprintf(pszBuffer, nBufferLength, TEXT("%i"), GetPlayCount(nItem)); |
| 4767 | s = pszBuffer; |
| 4768 | break; |
| 4769 | |
| 4770 | case COLUMN_MANUFACTURER: |
| 4771 | /* Manufacturer */ |
| 4772 | utf8_s = drivers[nItem]->manufacturer; |
| 4773 | break; |
| 4774 | |
| 4775 | case COLUMN_YEAR: |
| 4776 | /* Year */ |
| 4777 | utf8_s = drivers[nItem]->year; |
| 4778 | break; |
| 4779 | |
| 4780 | case COLUMN_CLONE: |
| 4781 | utf8_s = GetCloneParentName(nItem); |
| 4782 | break; |
| 4783 | } |
| 4784 | |
| 4785 | if( utf8_s ) |
| 4786 | { |
| 4787 | TCHAR* t_s = tstring_from_utf8(utf8_s); |
| 4788 | if( !t_s ) |
| 4789 | return s; |
| 4790 | |
| 4791 | _sntprintf(pszBuffer, nBufferLength, TEXT("%s"), t_s); |
| 4792 | free(t_s); |
| 4793 | |
| 4794 | s = pszBuffer; |
| 4795 | } |
| 4796 | |
| 4797 | return s; |
| 4798 | } |
| 4799 | |
| 4800 | static void GamePicker_LeavingItem(HWND hwndPicker, int nItem) |
| 4801 | { |
| 4802 | // leaving item |
| 4803 | // printf("leaving %s\n",drivers[nItem]->name); |
| 4804 | } |
| 4805 | |
| 4806 | static void GamePicker_EnteringItem(HWND hwndPicker, int nItem) |
| 4807 | { |
| 4808 | TCHAR* t_description; |
| 4809 | ATOM a; |
| 4810 | // printf("entering %s\n",drivers[nItem]->name); |
| 4811 | if (g_bDoBroadcast == TRUE) |
| 4812 | { |
| 4813 | t_description = tstring_from_utf8(drivers[nItem]->description); |
| 4814 | if( !t_description ) |
| 4815 | return; |
| 4816 | a = GlobalAddAtom(t_description); |
| 4817 | SendMessage(HWND_BROADCAST, g_mame32_message, a, a); |
| 4818 | GlobalDeleteAtom(a); |
| 4819 | free(t_description); |
| 4820 | } |
| 4821 | |
| 4822 | EnableSelection(nItem); |
| 4823 | #ifdef MESS |
| 4824 | MessReadMountedSoftware(nItem); |
| 4825 | #endif |
| 4826 | } |
| 4827 | |
| 4828 | static int GamePicker_FindItemParent(HWND hwndPicker, int nItem) |
| 4829 | { |
| 4830 | return GetParentRomSetIndex(drivers[nItem]); |
| 4831 | } |
| 4832 | |
| 4833 | /* Initialize the Picker and List controls */ |
| 4834 | static void InitListView() |
| 4835 | { |
| 4836 | LVBKIMAGE bki; |
| 4837 | TCHAR path[MAX_PATH]; |
| 4838 | TCHAR* t_bgdir; |
| 4839 | |
| 4840 | static const struct PickerCallbacks s_gameListCallbacks = |
| 4841 | { |
| 4842 | SetSortColumn, /* pfnSetSortColumn */ |
| 4843 | GetSortColumn, /* pfnGetSortColumn */ |
| 4844 | SetSortReverse, /* pfnSetSortReverse */ |
| 4845 | GetSortReverse, /* pfnGetSortReverse */ |
| 4846 | SetViewMode, /* pfnSetViewMode */ |
| 4847 | GetViewMode, /* pfnGetViewMode */ |
| 4848 | SetColumnWidths, /* pfnSetColumnWidths */ |
| 4849 | GetColumnWidths, /* pfnGetColumnWidths */ |
| 4850 | SetColumnOrder, /* pfnSetColumnOrder */ |
| 4851 | GetColumnOrder, /* pfnGetColumnOrder */ |
| 4852 | SetColumnShown, /* pfnSetColumnShown */ |
| 4853 | GetColumnShown, /* pfnGetColumnShown */ |
| 4854 | GetOffsetClones, /* pfnGetOffsetChildren */ |
| 4855 | |
| 4856 | GamePicker_Compare, /* pfnCompare */ |
| 4857 | MamePlayGame, /* pfnDoubleClick */ |
| 4858 | GamePicker_GetItemString, /* pfnGetItemString */ |
| 4859 | GamePicker_GetItemImage, /* pfnGetItemImage */ |
| 4860 | GamePicker_LeavingItem, /* pfnLeavingItem */ |
| 4861 | GamePicker_EnteringItem, /* pfnEnteringItem */ |
| 4862 | BeginListViewDrag, /* pfnBeginListViewDrag */ |
| 4863 | GamePicker_FindItemParent, /* pfnFindItemParent */ |
| 4864 | OnIdle, /* pfnIdle */ |
| 4865 | GamePicker_OnHeaderContextMenu, /* pfnOnHeaderContextMenu */ |
| 4866 | GamePicker_OnBodyContextMenu /* pfnOnBodyContextMenu */ |
| 4867 | }; |
| 4868 | |
| 4869 | struct PickerOptions opts; |
| 4870 | |
| 4871 | // subclass the list view |
| 4872 | memset(&opts, 0, sizeof(opts)); |
| 4873 | opts.pCallbacks = &s_gameListCallbacks; |
| 4874 | opts.nColumnCount = COLUMN_MAX; |
| 4875 | opts.ppszColumnNames = column_names; |
| 4876 | SetupPicker(hwndList, &opts); |
| 4877 | |
| 4878 | ListView_SetTextBkColor(hwndList, CLR_NONE); |
| 4879 | ListView_SetBkColor(hwndList, CLR_NONE); |
| 4880 | t_bgdir = tstring_from_utf8(GetBgDir()); |
| 4881 | if( !t_bgdir ) |
| 4882 | return; |
| 4883 | _stprintf(path, TEXT("%s\\bkground.png"), t_bgdir); |
| 4884 | bki.ulFlags = LVBKIF_SOURCE_URL | LVBKIF_STYLE_TILE; |
| 4885 | bki.pszImage = path; |
| 4886 | if( hBackground ) |
| 4887 | ListView_SetBkImage(hwndList, &bki); |
| 4888 | |
| 4889 | CreateIcons(); |
| 4890 | |
| 4891 | ResetColumnDisplay(TRUE); |
| 4892 | |
| 4893 | // Allow selection to change the default saved game |
| 4894 | bListReady = TRUE; |
| 4895 | free(t_bgdir); |
| 4896 | } |
| 4897 | |
| 4898 | static void AddDriverIcon(int nItem,int default_icon_index) |
| 4899 | { |
| 4900 | HICON hIcon = 0; |
| 4901 | int nParentIndex = -1; |
| 4902 | |
| 4903 | /* if already set to rom or clone icon, we've been here before */ |
| 4904 | if (icon_index[nItem] == 1 || icon_index[nItem] == 3) |
| 4905 | return; |
| 4906 | |
| 4907 | hIcon = LoadIconFromFile((char *)drivers[nItem]->name); |
| 4908 | if (hIcon == NULL) |
| 4909 | { |
| 4910 | nParentIndex = GetParentIndex(drivers[nItem]); |
| 4911 | if( nParentIndex >= 0) |
| 4912 | { |
| 4913 | hIcon = LoadIconFromFile((char *)drivers[nParentIndex]->name); |
| 4914 | nParentIndex = GetParentIndex(drivers[nParentIndex]); |
| 4915 | if (hIcon == NULL && nParentIndex >= 0) |
| 4916 | hIcon = LoadIconFromFile((char *)drivers[nParentIndex]->name); |
| 4917 | } |
| 4918 | } |
| 4919 | |
| 4920 | if (hIcon != NULL) |
| 4921 | { |
| 4922 | int nIconPos = ImageList_AddIcon(hSmall, hIcon); |
| 4923 | ImageList_AddIcon(hLarge, hIcon); |
| 4924 | if (nIconPos != -1) |
| 4925 | icon_index[nItem] = nIconPos; |
| 4926 | } |
| 4927 | if (icon_index[nItem] == 0) |
| 4928 | icon_index[nItem] = default_icon_index; |
| 4929 | } |
| 4930 | |
| 4931 | static void DestroyIcons(void) |
| 4932 | { |
| 4933 | if (hSmall != NULL) |
| 4934 | { |
| 4935 | ImageList_Destroy(hSmall); |
| 4936 | hSmall = NULL; |
| 4937 | } |
| 4938 | |
| 4939 | if (icon_index != NULL) |
| 4940 | { |
| 4941 | int i; |
| 4942 | for (i=0;i<driver_list_get_count(drivers);i++) |
| 4943 | icon_index[i] = 0; // these are indices into hSmall |
| 4944 | } |
| 4945 | |
| 4946 | if (hLarge != NULL) |
| 4947 | { |
| 4948 | ImageList_Destroy(hLarge); |
| 4949 | hLarge = NULL; |
| 4950 | } |
| 4951 | |
| 4952 | if (hHeaderImages != NULL) |
| 4953 | { |
| 4954 | ImageList_Destroy(hHeaderImages); |
| 4955 | hHeaderImages = NULL; |
| 4956 | } |
| 4957 | |
| 4958 | } |
| 4959 | |
| 4960 | static void ReloadIcons(void) |
| 4961 | { |
| 4962 | HICON hIcon; |
| 4963 | INT i; |
| 4964 | |
| 4965 | // clear out all the images |
| 4966 | ImageList_RemoveAll(hSmall); |
| 4967 | ImageList_RemoveAll(hLarge); |
| 4968 | |
| 4969 | if (icon_index != NULL) |
| 4970 | { |
| 4971 | for (i=0;i<driver_list_get_count(drivers);i++) |
| 4972 | icon_index[i] = 0; // these are indices into hSmall |
| 4973 | } |
| 4974 | |
| 4975 | for (i = 0; g_iconData[i].icon_name; i++) |
| 4976 | { |
| 4977 | hIcon = LoadIconFromFile((char *) g_iconData[i].icon_name); |
| 4978 | if (hIcon == NULL) |
| 4979 | hIcon = LoadIcon(hInst, MAKEINTRESOURCE(g_iconData[i].resource)); |
| 4980 | |
| 4981 | ImageList_AddIcon(hSmall, hIcon); |
| 4982 | ImageList_AddIcon(hLarge, hIcon); |
| 4983 | } |
| 4984 | } |
| 4985 | |
| 4986 | static DWORD GetShellLargeIconSize(void) |
| 4987 | { |
| 4988 | DWORD dwSize, dwLength = 512, dwType = REG_SZ; |
| 4989 | TCHAR szBuffer[512]; |
| 4990 | HKEY hKey; |
| 4991 | |
| 4992 | /* Get the Key */ |
| 4993 | RegOpenKey(HKEY_CURRENT_USER, TEXT("Control Panel\\desktop\\WindowMetrics"), &hKey); |
| 4994 | /* Save the last size */ |
| 4995 | RegQueryValueEx(hKey, TEXT("Shell Icon Size"), NULL, &dwType, (LPBYTE)szBuffer, &dwLength); |
| 4996 | dwSize = _ttol(szBuffer); |
| 4997 | if (dwSize < 32) |
| 4998 | dwSize = 32; |
| 4999 | |
| 5000 | if (dwSize > 48) |
| 5001 | dwSize = 48; |
| 5002 | |
| 5003 | /* Clean up */ |
| 5004 | RegCloseKey(hKey); |
| 5005 | return dwSize; |
| 5006 | } |
| 5007 | |
| 5008 | static DWORD GetShellSmallIconSize(void) |
| 5009 | { |
| 5010 | DWORD dwSize = ICONMAP_WIDTH; |
| 5011 | |
| 5012 | if (dwSize < 48) |
| 5013 | { |
| 5014 | if (dwSize < 32) |
| 5015 | dwSize = 16; |
| 5016 | else |
| 5017 | dwSize = 32; |
| 5018 | } |
| 5019 | else |
| 5020 | { |
| 5021 | dwSize = 48; |
| 5022 | } |
| 5023 | return dwSize; |
| 5024 | } |
| 5025 | |
| 5026 | // create iconlist for Listview control |
| 5027 | static void CreateIcons(void) |
| 5028 | { |
| 5029 | DWORD dwLargeIconSize = GetShellLargeIconSize(); |
| 5030 | HICON hIcon; |
| 5031 | int icon_count; |
| 5032 | DWORD dwStyle; |
| 5033 | int i; |
| 5034 | |
| 5035 | icon_count = 0; |
| 5036 | while(g_iconData[icon_count].icon_name) |
| 5037 | icon_count++; |
| 5038 | |
| 5039 | // the current window style affects the sizing of the rows when changing |
| 5040 | // between list views, so put it in small icon mode temporarily while we associate |
| 5041 | // our image list |
| 5042 | // |
| 5043 | // using large icon mode instead kills the horizontal scrollbar when doing |
| 5044 | // full refresh, which seems odd (it should recreate the scrollbar when |
| 5045 | // set back to report mode, for example, but it doesn't). |
| 5046 | |
| 5047 | dwStyle = GetWindowLong(hwndList,GWL_STYLE); |
| 5048 | SetWindowLong(hwndList,GWL_STYLE,(dwStyle & ~LVS_TYPEMASK) | LVS_ICON); |
| 5049 | |
| 5050 | hSmall = ImageList_Create(GetShellSmallIconSize(),GetShellSmallIconSize(), |
| 5051 | ILC_COLORDDB | ILC_MASK, icon_count, icon_count + 5000); |
| 5052 | hLarge = ImageList_Create(dwLargeIconSize, dwLargeIconSize, |
| 5053 | ILC_COLORDDB | ILC_MASK, icon_count, icon_count + 5000); |
| 5054 | |
| 5055 | if (NULL == hSmall || NULL == hLarge) { |
| 5056 | win_message_box_utf8(hwndList, "Cannot allocate Icon lists", "Allocation error - Exiting", IDOK); |
| 5057 | PostQuitMessage(0); |
| 5058 | } |
| 5059 | |
| 5060 | ReloadIcons(); |
| 5061 | |
| 5062 | // Associate the image lists with the list view control. |
| 5063 | (void)ListView_SetImageList(hwndList, hSmall, LVSIL_SMALL); |
| 5064 | (void)ListView_SetImageList(hwndList, hLarge, LVSIL_NORMAL); |
| 5065 | |
| 5066 | // restore our view |
| 5067 | SetWindowLong(hwndList,GWL_STYLE,dwStyle); |
| 5068 | |
| 5069 | #ifdef MESS |
| 5070 | CreateMessIcons(); |
| 5071 | #endif |
| 5072 | |
| 5073 | // Now set up header specific stuff |
| 5074 | hHeaderImages = ImageList_Create(8,8,ILC_COLORDDB | ILC_MASK,2,2); |
| 5075 | hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_HEADER_UP)); |
| 5076 | ImageList_AddIcon(hHeaderImages,hIcon); |
| 5077 | hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_HEADER_DOWN)); |
| 5078 | ImageList_AddIcon(hHeaderImages,hIcon); |
| 5079 | |
| 5080 | for (i = 0; i < sizeof(s_nPickers) / sizeof(s_nPickers[0]); i++) |
| 5081 | Picker_SetHeaderImageList(GetDlgItem(hMain, s_nPickers[i]), hHeaderImages); |
| 5082 | } |
| 5083 | |
| 5084 | |
| 5085 | |
| 5086 | static int GamePicker_Compare(HWND hwndPicker, int index1, int index2, int sort_subitem) |
| 5087 | { |
| 5088 | int value = 0; /* Default to 0, for unknown case */ |
| 5089 | const char *name1 = NULL; |
| 5090 | const char *name2 = NULL; |
| 5091 | int nTemp1, nTemp2; |
| 5092 | |
| 5093 | #ifdef DEBUG |
| 5094 | if (strcmp(drivers[index1]->name,"1941") == 0 && strcmp(drivers[index2]->name,"1942") == 0) |
| 5095 | { |
| 5096 | dprintf("comparing 1941, 1942"); |
| 5097 | } |
| 5098 | |
| 5099 | if (strcmp(drivers[index1]->name,"1942") == 0 && strcmp(drivers[index2]->name,"1941") == 0) |
| 5100 | { |
| 5101 | dprintf("comparing 1942, 1941"); |
| 5102 | } |
| 5103 | #endif |
| 5104 | |
| 5105 | switch (sort_subitem) |
| 5106 | { |
| 5107 | case COLUMN_GAMES: |
| 5108 | return mame_stricmp(ModifyThe(drivers[index1]->description), |
| 5109 | ModifyThe(drivers[index2]->description)); |
| 5110 | break; |
| 5111 | |
| 5112 | case COLUMN_ORIENTATION: |
| 5113 | nTemp1 = DriverIsVertical(index1) ? 1 : 0; |
| 5114 | nTemp2 = DriverIsVertical(index2) ? 1 : 0; |
| 5115 | value = nTemp1 - nTemp2; |
| 5116 | break; |
| 5117 | #if 0 |
| 5118 | case COLUMN_ROMS: |
| 5119 | nTemp1 = GetRomAuditResults(index1); |
| 5120 | nTemp2 = GetRomAuditResults(index2); |
| 5121 | |
| 5122 | if (IsAuditResultKnown(nTemp1) == FALSE && IsAuditResultKnown(nTemp2) == FALSE) |
| 5123 | return GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES); |
| 5124 | |
| 5125 | if (IsAuditResultKnown(nTemp1) == FALSE) |
| 5126 | { |
| 5127 | value = 1; |
| 5128 | break; |
| 5129 | } |
| 5130 | |
| 5131 | if (IsAuditResultKnown(nTemp2) == FALSE) |
| 5132 | { |
| 5133 | value = -1; |
| 5134 | break; |
| 5135 | } |
| 5136 | |
| 5137 | // ok, both are known |
| 5138 | if (IsAuditResultYes(nTemp1) && IsAuditResultYes(nTemp2)) |
| 5139 | return GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES); |
| 5140 | |
| 5141 | if (IsAuditResultNo(nTemp1) && IsAuditResultNo(nTemp2)) |
| 5142 | return GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES); |
| 5143 | |
| 5144 | if (IsAuditResultYes(nTemp1) && IsAuditResultNo(nTemp2)) |
| 5145 | value = -1; |
| 5146 | else |
| 5147 | value = 1; |
| 5148 | break; |
| 5149 | #endif |
| 5150 | case COLUMN_SAMPLES: |
| 5151 | nTemp1 = -1; |
| 5152 | if (DriverUsesSamples(index1)) |
| 5153 | { |
| 5154 | int audit_result = GetSampleAuditResults(index1); |
| 5155 | if (IsAuditResultKnown(audit_result)) |
| 5156 | { |
| 5157 | if (IsAuditResultYes(audit_result)) |
| 5158 | nTemp1 = 1; |
| 5159 | else |
| 5160 | nTemp1 = 0; |
| 5161 | } |
| 5162 | else |
| 5163 | nTemp1 = 2; |
| 5164 | } |
| 5165 | |
| 5166 | nTemp2 = -1; |
| 5167 | if (DriverUsesSamples(index2)) |
| 5168 | { |
| 5169 | int audit_result = GetSampleAuditResults(index1); |
| 5170 | if (IsAuditResultKnown(audit_result)) |
| 5171 | { |
| 5172 | if (IsAuditResultYes(audit_result)) |
| 5173 | nTemp2 = 1; |
| 5174 | else |
| 5175 | nTemp2 = 0; |
| 5176 | } |
| 5177 | else |
| 5178 | nTemp2 = 2; |
| 5179 | } |
| 5180 | value = nTemp2 - nTemp1; |
| 5181 | break; |
| 5182 | |
| 5183 | case COLUMN_DIRECTORY: |
| 5184 | value = mame_stricmp(drivers[index1]->name, drivers[index2]->name); |
| 5185 | break; |
| 5186 | |
| 5187 | case COLUMN_SRCDRIVERS: |
| 5188 | value = mame_stricmp(drivers[index1]->source_file, drivers[index2]->source_file); |
| 5189 | break; |
| 5190 | |
| 5191 | case COLUMN_PLAYTIME: |
| 5192 | value = GetPlayTime(index1) - GetPlayTime(index2); |
| 5193 | break; |
| 5194 | |
| 5195 | case COLUMN_TYPE: |
| 5196 | { |
| 5197 | machine_config drv1,drv2; |
| 5198 | expand_machine_driver(drivers[index1]->drv,&drv1); |
| 5199 | expand_machine_driver(drivers[index2]->drv,&drv2); |
| 5200 | |
| 5201 | value = (drv1.video_attributes & VIDEO_TYPE_VECTOR) - |
| 5202 | (drv2.video_attributes & VIDEO_TYPE_VECTOR); |
| 5203 | break; |
| 5204 | } |
| 5205 | case COLUMN_TRACKBALL: |
| 5206 | value = DriverUsesTrackball(index1) - DriverUsesTrackball(index2); |
| 5207 | break; |
| 5208 | |
| 5209 | case COLUMN_PLAYED: |
| 5210 | value = GetPlayCount(index1) - GetPlayCount(index2); |
| 5211 | break; |
| 5212 | |
| 5213 | case COLUMN_MANUFACTURER: |
| 5214 | value = mame_stricmp(drivers[index1]->manufacturer, drivers[index2]->manufacturer); |
| 5215 | break; |
| 5216 | |
| 5217 | case COLUMN_YEAR: |
| 5218 | value = mame_stricmp(drivers[index1]->year, drivers[index2]->year); |
| 5219 | break; |
| 5220 | |
| 5221 | case COLUMN_CLONE: |
| 5222 | name1 = GetCloneParentName(index1); |
| 5223 | name2 = GetCloneParentName(index2); |
| 5224 | |
| 5225 | if (*name1 == '\0') |
| 5226 | name1 = NULL; |
| 5227 | if (*name2 == '\0') |
| 5228 | name2 = NULL; |
| 5229 | |
| 5230 | if (NULL == name1 && NULL == name2) |
| 5231 | value = 0; |
| 5232 | else if (name2 == NULL) |
| 5233 | value = -1; |
| 5234 | else if (name1 == NULL) |
| 5235 | value = 1; |
| 5236 | else |
| 5237 | value = mame_stricmp(name1, name2); |
| 5238 | break; |
| 5239 | } |
| 5240 | |
| 5241 | // Handle same comparisons here |
| 5242 | if (0 == value && COLUMN_GAMES != sort_subitem) |
| 5243 | { |
| 5244 | value = GamePicker_Compare(hwndPicker, index1, index2, COLUMN_GAMES); |
| 5245 | } |
| 5246 | #ifdef DEBUG |
| 5247 | if ((strcmp(drivers[index1]->name,"1941") == 0 && strcmp(drivers[index2]->name,"1942") == 0) || |
| 5248 | (strcmp(drivers[index1]->name,"1942") == 0 && strcmp(drivers[index2]->name,"1941") == 0)) |
| 5249 | dprintf("result: %i",value); |
| 5250 | #endif |
| 5251 | |
| 5252 | return value; |
| 5253 | } |
| 5254 | |
| 5255 | int GetSelectedPick() |
| 5256 | { |
| 5257 | /* returns index of listview selected item */ |
| 5258 | /* This will return -1 if not found */ |
| 5259 | return ListView_GetNextItem(hwndList, -1, LVIS_SELECTED | LVIS_FOCUSED); |
| 5260 | } |
| 5261 | |
| 5262 | static HICON GetSelectedPickItemIcon() |
| 5263 | { |
| 5264 | LV_ITEM lvi; |
| 5265 | |
| 5266 | lvi.iItem = GetSelectedPick(); |
| 5267 | lvi.iSubItem = 0; |
| 5268 | lvi.mask = LVIF_IMAGE; |
| 5269 | ListView_GetItem(hwndList, &lvi); |
| 5270 | |
| 5271 | return ImageList_GetIcon(hLarge, lvi.iImage, ILD_TRANSPARENT); |
| 5272 | } |
| 5273 | |
| 5274 | static void SetRandomPickItem() |
| 5275 | { |
| 5276 | int nListCount; |
| 5277 | |
| 5278 | nListCount = ListView_GetItemCount(hwndList); |
| 5279 | |
| 5280 | if (nListCount > 0) |
| 5281 | { |
| 5282 | Picker_SetSelectedPick(hwndList, rand() % nListCount); |
| 5283 | } |
| 5284 | } |
| 5285 | |
| 5286 | BOOL CommonFileDialog(common_file_dialog_proc cfd, char *filename, int filetype) |
| 5287 | { |
| 5288 | BOOL success; |
| 5289 | OPENFILENAME of; |
| 5290 | TCHAR* t_filename; |
| 5291 | TCHAR* t_statedir = 0; |
| 5292 | TCHAR* t_artdir = 0; |
| 5293 | TCHAR t_filename_buffer[MAX_PATH] = {0, }; |
| 5294 | char *utf8_filename; |
| 5295 | |
| 5296 | // convert the filename to UTF-8 and copy into buffer |
| 5297 | t_filename = tstring_from_utf8(filename); |
| 5298 | if (t_filename != NULL) |
| 5299 | { |
| 5300 | _sntprintf(t_filename_buffer, ARRAY_LENGTH(t_filename_buffer), TEXT("%s"), t_filename); |
| 5301 | free(t_filename); |
| 5302 | } |
| 5303 | |
| 5304 | of.lStructSize = sizeof(of); |
| 5305 | of.hwndOwner = hMain; |
| 5306 | of.hInstance = NULL; |
| 5307 | switch (filetype) |
| 5308 | { |
| 5309 | case FILETYPE_INPUT_FILES : |
| 5310 | of.lpstrFilter = TEXT(MAMENAME " input files (*.inp,*.zip)\0*.inp;*.zip\0All files (*.*)\0*.*\0"); |
| 5311 | break; |
| 5312 | case FILETYPE_SAVESTATE_FILES : |
| 5313 | of.lpstrFilter = TEXT(MAMENAME " savestate files (*.sta)\0*.sta;\0All files (*.*)\0*.*\0"); |
| 5314 | break; |
| 5315 | case FILETYPE_WAVE_FILES : |
| 5316 | of.lpstrFilter = TEXT("sounds (*.wav)\0*.wav;\0All files (*.*)\0*.*\0"); |
| 5317 | break; |
| 5318 | case FILETYPE_MNG_FILES : |
| 5319 | of.lpstrFilter = TEXT("videos (*.mng)\0*.mng;\0All files (*.*)\0*.*\0"); |
| 5320 | break; |
| 5321 | case FILETYPE_EFFECT_FILES : |
| 5322 | of.lpstrFilter = TEXT("effects (*.png)\0*.png;\0All files (*.*)\0*.*\0"); |
| 5323 | break; |
| 5324 | } |
| 5325 | of.lpstrCustomFilter = NULL; |
| 5326 | of.nMaxCustFilter = 0; |
| 5327 | of.nFilterIndex = 1; |
| 5328 | of.lpstrFile = t_filename_buffer; |
| 5329 | of.nMaxFile = ARRAY_LENGTH(t_filename_buffer); |
| 5330 | of.lpstrFileTitle = NULL; |
| 5331 | of.nMaxFileTitle = 0; |
| 5332 | if (filetype == FILETYPE_SAVESTATE_FILES) |
| 5333 | { |
| 5334 | t_statedir = tstring_from_utf8(GetStateDir()); |
| 5335 | if( !t_statedir ) |
| 5336 | return FALSE; |
| 5337 | |
| 5338 | of.lpstrInitialDir = t_statedir; |
| 5339 | } |
| 5340 | else |
| 5341 | { |
| 5342 | if (filetype == FILETYPE_EFFECT_FILES) |
| 5343 | { |
| 5344 | t_artdir = tstring_from_utf8(GetArtDir()); |
| 5345 | if( !t_artdir ) |
| 5346 | return FALSE; |
| 5347 | |
| 5348 | of.lpstrInitialDir = t_artdir; |
| 5349 | } |
| 5350 | else |
| 5351 | of.lpstrInitialDir = last_directory; |
| 5352 | } |
| 5353 | of.lpstrTitle = NULL; |
| 5354 | of.Flags = OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY; |
| 5355 | of.nFileOffset = 0; |
| 5356 | of.nFileExtension = 0; |
| 5357 | switch (filetype) |
| 5358 | { |
| 5359 | case FILETYPE_INPUT_FILES : |
| 5360 | of.lpstrDefExt = TEXT("inp"); |
| 5361 | break; |
| 5362 | case FILETYPE_SAVESTATE_FILES : |
| 5363 | of.lpstrDefExt = TEXT("sta"); |
| 5364 | break; |
| 5365 | case FILETYPE_WAVE_FILES : |
| 5366 | of.lpstrDefExt = TEXT("wav"); |
| 5367 | break; |
| 5368 | case FILETYPE_MNG_FILES : |
| 5369 | of.lpstrDefExt = TEXT("mng"); |
| 5370 | break; |
| 5371 | case FILETYPE_EFFECT_FILES : |
| 5372 | of.lpstrDefExt = TEXT("png"); |
| 5373 | break; |
| 5374 | } |
| 5375 | of.lCustData = 0; |
| 5376 | of.lpfnHook = NULL; |
| 5377 | of.lpTemplateName = NULL; |
| 5378 | |
| 5379 | success = cfd(&of); |
| 5380 | if (success) |
| 5381 | { |
| 5382 | //dprintf("got filename %s nFileExtension %u\n",filename,of.nFileExtension); |
| 5383 | /*GetDirectory(filename,last_directory,sizeof(last_directory));*/ |
| 5384 | } |
| 5385 | |
| 5386 | if( t_artdir ) |
| 5387 | free(t_artdir); |
| 5388 | if( t_statedir ) |
| 5389 | free(t_statedir); |
| 5390 | |
| 5391 | utf8_filename = utf8_from_tstring(t_filename_buffer); |
| 5392 | if (utf8_filename != NULL) |
| 5393 | { |
| 5394 | snprintf(filename, MAX_PATH, "%s", utf8_filename); |
| 5395 | } |
| 5396 | |
| 5397 | return success; |
| 5398 | } |
| 5399 | |
| 5400 | static BOOL SelectLanguageFile(HWND hWnd, TCHAR* filename) |
| 5401 | { |
| 5402 | OPENFILENAME of; |
| 5403 | |
| 5404 | of.lStructSize = sizeof(of); |
| 5405 | of.hwndOwner = hWnd; |
| 5406 | of.hInstance = NULL; |
| 5407 | of.lpstrFilter = TEXT(MAMENAME " Language files (*.lng)\0*.lng\0"); |
| 5408 | of.lpstrCustomFilter = NULL; |
| 5409 | of.nMaxCustFilter = 0; |
| 5410 | of.nFilterIndex = 1; |
| 5411 | of.lpstrFile = filename; |
| 5412 | of.nMaxFile = MAX_PATH; |
| 5413 | of.lpstrFileTitle = NULL; |
| 5414 | of.nMaxFileTitle = 0; |
| 5415 | of.lpstrInitialDir = NULL; |
| 5416 | of.lpstrTitle = NULL; |
| 5417 | of.Flags = OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST; |
| 5418 | of.nFileOffset = 0; |
| 5419 | of.nFileExtension = 0; |
| 5420 | of.lpstrDefExt = TEXT("lng"); |
| 5421 | of.lCustData = 0; |
| 5422 | of.lpfnHook = NULL; |
| 5423 | of.lpTemplateName = NULL; |
| 5424 | |
| 5425 | return GetOpenFileName(&of); |
| 5426 | } |
| 5427 | |
| 5428 | static INT_PTR CALLBACK LanguageDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) |
| 5429 | { |
| 5430 | TCHAR pLangFile[MAX_PATH]; |
| 5431 | DWORD dwHelpIDs[] = { IDC_LANGUAGECHECK, HIDC_LANGUAGECHECK, |
| 5432 | IDC_LANGUAGEEDIT, HIDC_LANGUAGEEDIT, |
| 5433 | 0, 0}; |
| 5434 | char* utf8_LangFile; |
| 5435 | |
| 5436 | switch (Msg) |
| 5437 | { |
| 5438 | case WM_INITDIALOG: |
| 5439 | { |
| 5440 | const char* pLang = GetLanguage(); |
| 5441 | if (pLang == NULL || *pLang == '\0') |
| 5442 | { |
| 5443 | win_set_window_text_utf8(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), ""); |
| 5444 | Button_SetCheck(GetDlgItem(hDlg, IDC_LANGUAGECHECK), FALSE); |
| 5445 | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), FALSE); |
| 5446 | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEBROWSE), FALSE); |
| 5447 | } |
| 5448 | else |
| 5449 | { |
| 5450 | win_set_window_text_utf8(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), pLang); |
| 5451 | Button_SetCheck(GetDlgItem(hDlg, IDC_LANGUAGECHECK), TRUE); |
| 5452 | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), TRUE); |
| 5453 | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEBROWSE), TRUE); |
| 5454 | } |
| 5455 | |
| 5456 | return TRUE; |
| 5457 | } |
| 5458 | |
| 5459 | case WM_HELP: |
| 5460 | HelpFunction(((LPHELPINFO)lParam)->hItemHandle, MAMEUICONTEXTHELP, HH_TP_HELP_WM_HELP, (DWORD_PTR)dwHelpIDs); |
| 5461 | break; |
| 5462 | |
| 5463 | case WM_CONTEXTMENU: |
| 5464 | HelpFunction((HWND)wParam, MAMEUICONTEXTHELP, HH_TP_HELP_CONTEXTMENU, (DWORD_PTR)dwHelpIDs); |
| 5465 | break; |
| 5466 | |
| 5467 | case WM_COMMAND: |
| 5468 | switch (GET_WM_COMMAND_ID(wParam, lParam)) |
| 5469 | { |
| 5470 | case IDOK: |
| 5471 | Edit_GetText(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), pLangFile, MAX_PATH); |
| 5472 | utf8_LangFile = utf8_from_tstring(pLangFile); |
| 5473 | if( !utf8_LangFile ) |
| 5474 | return FALSE; |
| 5475 | SetLanguage(utf8_LangFile); |
| 5476 | free(utf8_LangFile); |
| 5477 | |
| 5478 | case IDCANCEL: |
| 5479 | EndDialog(hDlg, 0); |
| 5480 | return TRUE; |
| 5481 | |
| 5482 | case IDC_LANGUAGECHECK: |
| 5483 | { |
| 5484 | BOOL bCheck = Button_GetCheck(GetDlgItem(hDlg, IDC_LANGUAGECHECK)); |
| 5485 | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), bCheck); |
| 5486 | EnableWindow(GetDlgItem(hDlg, IDC_LANGUAGEBROWSE), bCheck); |
| 5487 | if (bCheck == FALSE) |
| 5488 | Edit_SetText(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), TEXT("")); |
| 5489 | return TRUE; |
| 5490 | } |
| 5491 | |
| 5492 | case IDC_LANGUAGEBROWSE: |
| 5493 | Edit_GetText(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), pLangFile, MAX_PATH); |
| 5494 | if (SelectLanguageFile(hDlg, pLangFile) == TRUE) |
| 5495 | Edit_SetText(GetDlgItem(hDlg, IDC_LANGUAGEEDIT), pLangFile); |
| 5496 | break; |
| 5497 | } |
| 5498 | break; |
| 5499 | } |
| 5500 | return 0; |
| 5501 | } |
| 5502 | |
| 5503 | void SetStatusBarText(int part_index, const char *message) |
| 5504 | { |
| 5505 | TCHAR* t_message = tstring_from_utf8(message); |
| 5506 | if( !t_message ) |
| 5507 | return; |
| 5508 | SendMessage(hStatusBar, SB_SETTEXT, (WPARAM) part_index, (LPARAM)(LPCTSTR) win_tstring_strdup(t_message)); |
| 5509 | free(t_message); |
| 5510 | } |
| 5511 | |
| 5512 | void SetStatusBarTextF(int part_index, const char *fmt, ...) |
| 5513 | { |
| 5514 | char buf[256]; |
| 5515 | va_list va; |
| 5516 | |
| 5517 | va_start(va, fmt); |
| 5518 | vsprintf(buf, fmt, va); |
| 5519 | va_end(va); |
| 5520 | |
| 5521 | SetStatusBarText(part_index, buf); |
| 5522 | } |
| 5523 | |
| 5524 | static void CLIB_DECL MameMessageBox(const char *fmt, ...) |
| 5525 | { |
| 5526 | char buf[2048]; |
| 5527 | va_list va; |
| 5528 | |
| 5529 | va_start(va, fmt); |
| 5530 | vsprintf(buf, fmt, va); |
| 5531 | win_message_box_utf8(GetMainWindow(), buf, MAMEUINAME, MB_OK | MB_ICONERROR); |
| 5532 | va_end(va); |
| 5533 | } |
| 5534 | |
| 5535 | static void MamePlayBackGame() |
| 5536 | { |
| 5537 | int nGame; |
| 5538 | char filename[MAX_PATH]; |
| 5539 | |
| 5540 | *filename = 0; |
| 5541 | |
| 5542 | nGame = Picker_GetSelectedItem(hwndList); |
| 5543 | if (nGame != -1) |
| 5544 | strcpy(filename, drivers[nGame]->name); |
| 5545 | |
| 5546 | if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_INPUT_FILES)) |
| 5547 | { |
| 5548 | file_error fileerr; |
| 5549 | mame_file* pPlayBack; |
| 5550 | char drive[_MAX_DRIVE]; |
| 5551 | char dir[_MAX_DIR]; |
| 5552 | char bare_fname[_MAX_FNAME]; |
| 5553 | char ext[_MAX_EXT]; |
| 5554 | |
| 5555 | char path[MAX_PATH]; |
| 5556 | char fname[MAX_PATH]; |
| 5557 | play_options playopts; |
| 5558 | |
| 5559 | _splitpath(filename, drive, dir, bare_fname, ext); |
| 5560 | |
| 5561 | sprintf(path,"%s%s",drive,dir); |
| 5562 | sprintf(fname,"%s%s",bare_fname,ext); |
| 5563 | if (path[strlen(path)-1] == '\\') |
| 5564 | path[strlen(path)-1] = 0; // take off trailing back slash |
| 5565 | |
| 5566 | fileerr = mame_fopen_options(MameUIGlobal(), SEARCHPATH_INPUTLOG, fname, OPEN_FLAG_READ, &pPlayBack); |
| 5567 | if (fileerr != FILERR_NONE) |
| 5568 | { |
| 5569 | MameMessageBox("Could not open '%s' as a valid input file.", filename); |
| 5570 | return; |
| 5571 | } |
| 5572 | |
| 5573 | // check for game name embedded in .inp header |
| 5574 | if (pPlayBack) |
| 5575 | { |
| 5576 | inp_header input_header; |
| 5577 | |
| 5578 | // read playback header |
| 5579 | mame_fread(pPlayBack, &input_header, sizeof(inp_header)); |
| 5580 | |
| 5581 | if (!isalnum(input_header.name[0])) // If first byte is not alpha-numeric |
| 5582 | mame_fseek(pPlayBack, 0, SEEK_SET); // old .inp file - no header |
| 5583 | else |
| 5584 | { |
| 5585 | int i; |
| 5586 | for (i = 0; drivers[i] != 0; i++) // find game and play it |
| 5587 | { |
| 5588 | if (strcmp(drivers[i]->name, input_header.name) == 0) |
| 5589 | { |
| 5590 | nGame = i; |
| 5591 | break; |
| 5592 | } |
| 5593 | } |
| 5594 | } |
| 5595 | } |
| 5596 | mame_fclose(pPlayBack); |
| 5597 | |
| 5598 | memset(&playopts, 0, sizeof(playopts)); |
| 5599 | playopts.playback = fname; |
| 5600 | MamePlayGameWithOptions(nGame, &playopts); |
| 5601 | } |
| 5602 | } |
| 5603 | |
| 5604 | static void MameLoadState() |
| 5605 | { |
| 5606 | int nGame; |
| 5607 | char filename[MAX_PATH]; |
| 5608 | char selected_filename[MAX_PATH]; |
| 5609 | play_options playopts; |
| 5610 | |
| 5611 | *filename = 0; |
| 5612 | |
| 5613 | nGame = Picker_GetSelectedItem(hwndList); |
| 5614 | if (nGame != -1) |
| 5615 | { |
| 5616 | strcpy(filename, drivers[nGame]->name); |
| 5617 | strcpy(selected_filename, drivers[nGame]->name); |
| 5618 | } |
| 5619 | if (CommonFileDialog(GetOpenFileName, filename, FILETYPE_SAVESTATE_FILES)) |
| 5620 | { |
| 5621 | mame_file* pSaveState; |
| 5622 | char drive[_MAX_DRIVE]; |
| 5623 | char dir[_MAX_DIR]; |
| 5624 | char ext[_MAX_EXT]; |
| 5625 | |
| 5626 | char path[MAX_PATH]; |
| 5627 | char fname[MAX_PATH]; |
| 5628 | char bare_fname[_MAX_FNAME]; |
| 5629 | char *state_fname; |
| 5630 | int rc; |
| 5631 | |
| 5632 | _splitpath(filename, drive, dir, bare_fname, ext); |
| 5633 | |
| 5634 | // parse path |
| 5635 | sprintf(path,"%s%s",drive,dir); |
| 5636 | sprintf(fname,"%s%s",bare_fname,ext); |
| 5637 | if (path[strlen(path)-1] == '\\') |
| 5638 | path[strlen(path)-1] = 0; // take off trailing back slash |
| 5639 | |
| 5640 | #ifdef MESS |
| 5641 | { |
| 5642 | state_fname = filename; |
| 5643 | } |
| 5644 | #else // !MESS |
| 5645 | { |
| 5646 | char *cPos=0; |
| 5647 | int iPos=0; |
| 5648 | char romname[MAX_PATH]; |
| 5649 | |
| 5650 | cPos = strchr(bare_fname, '-' ); |
| 5651 | iPos = cPos ? cPos - bare_fname : strlen(bare_fname); |
| 5652 | strncpy(romname, bare_fname, iPos ); |
| 5653 | romname[iPos] = '\0'; |
| 5654 | if( strcmp(selected_filename,romname) != 0 ) |
| 5655 | { |
| 5656 | MameMessageBox("'%s' is not a valid savestate file for game '%s'.", filename, selected_filename); |
| 5657 | return; |
| 5658 | } |
| 5659 | state_fname = fname; |
| 5660 | } |
| 5661 | #endif // MESS |
| 5662 | |
| 5663 | mame_fopen_options(MameUIGlobal(), SEARCHPATH_STATE, state_fname, OPEN_FLAG_READ, &pSaveState); |
| 5664 | if (pSaveState == NULL) |
| 5665 | { |
| 5666 | MameMessageBox("Could not open '%s' as a valid savestate file.", filename); |
| 5667 | return; |
| 5668 | } |
| 5669 | |
| 5670 | // call the MAME core function to check the save state file |
| 5671 | rc = state_save_check_file(pSaveState, selected_filename, TRUE, MameMessageBox); |
| 5672 | mame_fclose(pSaveState); |
| 5673 | if (rc) |
| 5674 | return; |
| 5675 | |
| 5676 | memset(&playopts, 0, sizeof(playopts)); |
| 5677 | #ifdef MESS |
| 5678 | playopts.state = state_fname; |
| 5679 | #else |
| 5680 | { |
| 5681 | char *cPos; |
| 5682 | cPos = strrchr(bare_fname, '-' ); |
| 5683 | cPos = cPos+1; |
| 5684 | if( strlen(cPos) >0) |
| 5685 | { |
| 5686 | playopts.state = cPos; |
| 5687 | } |
| 5688 | } |
| 5689 | #endif |
| 5690 | |
| 5691 | MamePlayGameWithOptions(nGame, &playopts); |
| 5692 | } |
| 5693 | } |
| 5694 | |
| 5695 | static void MamePlayRecordGame() |
| 5696 | { |
| 5697 | int nGame; |
| 5698 | char filename[MAX_PATH]; |
| 5699 | *filename = 0; |
| 5700 | |
| 5701 | nGame = Picker_GetSelectedItem(hwndList); |
| 5702 | strcpy(filename, drivers[nGame]->name); |
| 5703 | |
| 5704 | if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_INPUT_FILES)) |
| 5705 | { |
| 5706 | char drive[_MAX_DRIVE]; |
| 5707 | char dir[_MAX_DIR]; |
| 5708 | char fname[_MAX_FNAME]; |
| 5709 | char ext[_MAX_EXT]; |
| 5710 | char path[MAX_PATH]; |
| 5711 | play_options playopts; |
| 5712 | |
| 5713 | _splitpath(filename, drive, dir, fname, ext); |
| 5714 | |
| 5715 | sprintf(path,"%s%s",drive,dir); |
| 5716 | if (path[strlen(path)-1] == '\\') |
| 5717 | path[strlen(path)-1] = 0; // take off trailing back slash |
| 5718 | |
| 5719 | memset(&playopts, 0, sizeof(playopts)); |
| 5720 | playopts.record = fname; |
| 5721 | MamePlayGameWithOptions(nGame, &playopts); |
| 5722 | } |
| 5723 | } |
| 5724 | |
| 5725 | void MamePlayGame(void) |
| 5726 | { |
| 5727 | int nGame; |
| 5728 | play_options playopts; |
| 5729 | |
| 5730 | nGame = Picker_GetSelectedItem(hwndList); |
| 5731 | |
| 5732 | memset(&playopts, 0, sizeof(playopts)); |
| 5733 | MamePlayGameWithOptions(nGame, &playopts); |
| 5734 | } |
| 5735 | |
| 5736 | static void MamePlayRecordWave() |
| 5737 | { |
| 5738 | int nGame; |
| 5739 | char filename[MAX_PATH]; |
| 5740 | play_options playopts; |
| 5741 | |
| 5742 | nGame = Picker_GetSelectedItem(hwndList); |
| 5743 | strcpy(filename, drivers[nGame]->name); |
| 5744 | |
| 5745 | if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_WAVE_FILES)) |
| 5746 | { |
| 5747 | memset(&playopts, 0, sizeof(playopts)); |
| 5748 | playopts.wavwrite = filename; |
| 5749 | MamePlayGameWithOptions(nGame, &playopts); |
| 5750 | } |
| 5751 | } |
| 5752 | |
| 5753 | static void MamePlayRecordMNG() |
| 5754 | { |
| 5755 | int nGame; |
| 5756 | char filename[MAX_PATH] = { 0, }; |
| 5757 | play_options playopts; |
| 5758 | |
| 5759 | nGame = Picker_GetSelectedItem(hwndList); |
| 5760 | strcpy(filename, drivers[nGame]->name); |
| 5761 | |
| 5762 | if (CommonFileDialog(GetSaveFileName, filename, FILETYPE_MNG_FILES)) |
| 5763 | { |
| 5764 | memset(&playopts, 0, sizeof(playopts)); |
| 5765 | playopts.mngwrite = filename; |
| 5766 | MamePlayGameWithOptions(nGame, &playopts); |
| 5767 | } |
| 5768 | } |
| 5769 | |
| 5770 | static void MamePlayGameWithOptions(int nGame, const play_options *playopts) |
| 5771 | { |
| 5772 | DWORD dwExitCode; |
| 5773 | |
| 5774 | #ifdef MESS |
| 5775 | if (!MessApproveImageList(hMain, nGame)) |
| 5776 | return; |
| 5777 | #endif |
| 5778 | |
| 5779 | if (g_pJoyGUI != NULL) |
| 5780 | KillTimer(hMain, JOYGUI_TIMER); |
| 5781 | if (GetCycleScreenshot() > 0) |
| 5782 | KillTimer(hMain, SCREENSHOT_TIMER); |
| 5783 | |
| 5784 | in_emulation = TRUE; |
| 5785 | |
| 5786 | dwExitCode = RunMAME(nGame, playopts); |
| 5787 | if (dwExitCode == 0) |
| 5788 | { |
| 5789 | IncrementPlayCount(nGame); |
| 5790 | ListView_RedrawItems(hwndList, GetSelectedPick(), GetSelectedPick()); |
| 5791 | } |
| 5792 | else |
| 5793 | { |
| 5794 | ShowWindow(hMain, SW_SHOW); |
| 5795 | } |
| 5796 | |
| 5797 | in_emulation = FALSE; |
| 5798 | |
| 5799 | // re-sort if sorting on # of times played |
| 5800 | if (GetSortColumn() == COLUMN_PLAYED) |
| 5801 | Picker_Sort(hwndList); |
| 5802 | |
| 5803 | UpdateStatusBar(); |
| 5804 | |
| 5805 | ShowWindow(hMain, SW_SHOW); |
| 5806 | SetFocus(hwndList); |
| 5807 | |
| 5808 | if (g_pJoyGUI != NULL) |
| 5809 | SetTimer(hMain, JOYGUI_TIMER, JOYGUI_MS, NULL); |
| 5810 | if (GetCycleScreenshot() > 0) |
| 5811 | SetTimer(hMain, SCREENSHOT_TIMER, GetCycleScreenshot()*1000, NULL); //scale to seconds |
| 5812 | } |
| 5813 | |
| 5814 | /* Toggle ScreenShot ON/OFF */ |
| 5815 | static void ToggleScreenShot(void) |
| 5816 | { |
| 5817 | BOOL showScreenShot = GetShowScreenShot(); |
| 5818 | |
| 5819 | SetShowScreenShot((showScreenShot) ? FALSE : TRUE); |
| 5820 | UpdateScreenShot(); |
| 5821 | |
| 5822 | /* Redraw list view */ |
| 5823 | if (hBackground != NULL && showScreenShot) |
| 5824 | InvalidateRect(hwndList, NULL, FALSE); |
| 5825 | } |
| 5826 | |
| 5827 | static void AdjustMetrics(void) |
| 5828 | { |
| 5829 | HDC hDC; |
| 5830 | TEXTMETRIC tm; |
| 5831 | int xtraX, xtraY; |
| 5832 | AREA area; |
| 5833 | int offX, offY; |
| 5834 | int maxX, maxY; |
| 5835 | COLORREF textColor; |
| 5836 | TCHAR szClass[128]; |
| 5837 | HWND hWnd; |
| 5838 | |
| 5839 | /* WM_SETTINGCHANGE also */ |
| 5840 | xtraX = GetSystemMetrics(SM_CXFIXEDFRAME); /* Dialog frame width */ |
| 5841 | xtraY = GetSystemMetrics(SM_CYFIXEDFRAME); /* Dialog frame height */ |
| 5842 | xtraY += GetSystemMetrics(SM_CYMENUSIZE); /* Menu height */ |
| 5843 | xtraY += GetSystemMetrics(SM_CYCAPTION); /* Caption Height */ |
| 5844 | maxX = GetSystemMetrics(SM_CXSCREEN); /* Screen Width */ |
| 5845 | maxY = GetSystemMetrics(SM_CYSCREEN); /* Screen Height */ |
| 5846 | |
| 5847 | hDC = GetDC(hMain); |
| 5848 | GetTextMetrics (hDC, &tm); |
| 5849 | |
| 5850 | /* Convert MIN Width/Height from Dialog Box Units to pixels. */ |
| 5851 | MIN_WIDTH = (int)((tm.tmAveCharWidth / 4.0) * DBU_MIN_WIDTH) + xtraX; |
| 5852 | MIN_HEIGHT = (int)((tm.tmHeight / 8.0) * DBU_MIN_HEIGHT) + xtraY; |
| 5853 | ReleaseDC(hMain, hDC); |
| 5854 | |
| 5855 | if ((textColor = GetListFontColor()) == RGB(255, 255, 255)) |
| 5856 | textColor = RGB(240, 240, 240); |
| 5857 | |
| 5858 | hWnd = GetWindow(hMain, GW_CHILD); |
| 5859 | while(hWnd) |
| 5860 | { |
| 5861 | if (GetClassName(hWnd, szClass, sizeof(szClass) / sizeof(szClass[0]))) |
| 5862 | { |
| 5863 | if (!_tcscmp(szClass, TEXT("SysListView32"))) |
| 5864 | { |
| 5865 | ListView_SetBkColor(hWnd, GetSysColor(COLOR_WINDOW)); |
| 5866 | ListView_SetTextColor(hWnd, textColor); |
| 5867 | } |
| 5868 | else if (!_tcscmp(szClass, TEXT("SysTreeView32"))) |
| 5869 | { |
| 5870 | TreeView_SetBkColor(hTreeView, GetSysColor(COLOR_WINDOW)); |
| 5871 | TreeView_SetTextColor(hTreeView, textColor); |
| 5872 | } |
| 5873 | } |
| 5874 | hWnd = GetWindow(hWnd, GW_HWNDNEXT); |
| 5875 | } |
| 5876 | |
| 5877 | GetWindowArea(&area); |
| 5878 | |
| 5879 | offX = area.x + area.width; |
| 5880 | offY = area.y + area.height; |
| 5881 | |
| 5882 | if (offX > maxX) |
| 5883 | { |
| 5884 | offX = maxX; |
| 5885 | area.x = (offX - area.width > 0) ? (offX - area.width) : 0; |
| 5886 | } |
| 5887 | if (offY > maxY) |
| 5888 | { |
| 5889 | offY = maxY; |
| 5890 | area.y = (offY - area.height > 0) ? (offY - area.height) : 0; |
| 5891 | } |
| 5892 | |
| 5893 | SetWindowArea(&area); |
| 5894 | SetWindowPos(hMain, 0, area.x, area.y, area.width, area.height, SWP_NOZORDER | SWP_SHOWWINDOW | SWP_NOACTIVATE); |
| 5895 | } |
| 5896 | |
| 5897 | #if 0 |
| 5898 | /* Adjust options - tune them to the currently selected game */ |
| 5899 | static void EnablePlayOptions(int nIndex, core_options *o) |
| 5900 | { |
| 5901 | } |
| 5902 | #endif |
| 5903 | |
| 5904 | int FindIconIndex(int nIconResource) |
| 5905 | { |
| 5906 | int i; |
| 5907 | for(i = 0; g_iconData[i].icon_name; i++) |
| 5908 | { |
| 5909 | if (g_iconData[i].resource == nIconResource) |
| 5910 | return i; |
| 5911 | } |
| 5912 | return -1; |
| 5913 | } |
| 5914 | |
| 5915 | int FindIconIndexByName(const char *icon_name) |
| 5916 | { |
| 5917 | int i; |
| 5918 | for (i = 0; g_iconData[i].icon_name; i++) |
| 5919 | { |
| 5920 | if (!strcmp(g_iconData[i].icon_name, icon_name)) |
| 5921 | return i; |
| 5922 | } |
| 5923 | return -1; |
| 5924 | } |
| 5925 | |
| 5926 | static int GetIconForDriver(int nItem) |
| 5927 | { |
| 5928 | int iconRoms = 1; |
| 5929 | |
| 5930 | if (DriverUsesRoms(nItem)) |
| 5931 | { |
| 5932 | int audit_result = GetRomAuditResults(nItem); |
| 5933 | if (IsAuditResultKnown(audit_result) == FALSE) |
| 5934 | return 2; |
| 5935 | #ifdef SHOW_MISSING_ROMS_ICON |
| 5936 | if (IsAuditResultYes(audit_result)) |
| 5937 | iconRoms = 1; |
| 5938 | else |
| 5939 | iconRoms = 0; |
| 5940 | #endif |
| 5941 | } |
| 5942 | |
| 5943 | // iconRoms is now either 0 (no roms), 1 (roms), or 2 (unknown) |
| 5944 | |
| 5945 | /* these are indices into icon_names, which maps into our image list |
| 5946 | * also must match IDI_WIN_NOROMS + iconRoms |
| 5947 | */ |
| 5948 | |
| 5949 | // Show Red-X if the ROMs are present and flagged as NOT WORKING |
| 5950 | if (iconRoms == 1 && DriverIsBroken(nItem)) |
| 5951 | iconRoms = FindIconIndex(IDI_WIN_REDX); |
| 5952 | |
| 5953 | // show clone icon if we have roms and game is working |
| 5954 | if (iconRoms == 1 && DriverIsClone(nItem)) |
| 5955 | iconRoms = FindIconIndex(IDI_WIN_CLONE); |
| 5956 | |
| 5957 | // if we have the roms, then look for a custom per-game icon to override |
| 5958 | if (iconRoms == 1 || iconRoms == 3) |
| 5959 | { |
| 5960 | if (icon_index[nItem] == 0) |
| 5961 | AddDriverIcon(nItem,iconRoms); |
| 5962 | iconRoms = icon_index[nItem]; |
| 5963 | } |
| 5964 | |
| 5965 | return iconRoms; |
| 5966 | } |
| 5967 | |
| 5968 | static BOOL HandleTreeContextMenu(HWND hWnd, WPARAM wParam, LPARAM lParam) |
| 5969 | { |
| 5970 | HMENU hTreeMenu; |
| 5971 | HMENU hMenu; |
| 5972 | TVHITTESTINFO hti; |
| 5973 | POINT pt; |
| 5974 | |
| 5975 | if ((HWND)wParam != GetDlgItem(hWnd, IDC_TREE)) |
| 5976 | return FALSE; |
| 5977 | |
| 5978 | pt.x = GET_X_LPARAM(lParam); |
| 5979 | pt.y = GET_Y_LPARAM(lParam); |
| 5980 | if (pt.x < 0 && pt.y < 0) |
| 5981 | GetCursorPos(&pt); |
| 5982 | |
| 5983 | /* select the item that was right clicked or shift-F10'ed */ |
| 5984 | hti.pt = pt; |
| 5985 | ScreenToClient(hTreeView,&hti.pt); |
| 5986 | (void)TreeView_HitTest(hTreeView,&hti); |
| 5987 | if ((hti.flags & TVHT_ONITEM) != 0) |
| 5988 | TreeView_SelectItem(hTreeView,hti.hItem); |
| 5989 | |
| 5990 | hTreeMenu = LoadMenu(hInst,MAKEINTRESOURCE(IDR_CONTEXT_TREE)); |
| 5991 | |
| 5992 | InitTreeContextMenu(hTreeMenu); |
| 5993 | |
| 5994 | hMenu = GetSubMenu(hTreeMenu, 0); |
| 5995 | |
| 5996 | UpdateMenu(hMenu); |
| 5997 | |
| 5998 | TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hWnd,NULL); |
| 5999 | |
| 6000 | DestroyMenu(hTreeMenu); |
| 6001 | |
| 6002 | return TRUE; |
| 6003 | } |
| 6004 | |
| 6005 | |
| 6006 | |
| 6007 | static void GamePicker_OnBodyContextMenu(POINT pt) |
| 6008 | { |
| 6009 | HMENU hMenuLoad; |
| 6010 | HMENU hMenu; |
| 6011 | |
| 6012 | hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_MENU)); |
| 6013 | hMenu = GetSubMenu(hMenuLoad, 0); |
| 6014 | InitBodyContextMenu(hMenu); |
| 6015 | |
| 6016 | UpdateMenu(hMenu); |
| 6017 | |
| 6018 | TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hMain,NULL); |
| 6019 | |
| 6020 | DestroyMenu(hMenuLoad); |
| 6021 | } |
| 6022 | |
| 6023 | |
| 6024 | |
| 6025 | static BOOL HandleScreenShotContextMenu(HWND hWnd, WPARAM wParam, LPARAM lParam) |
| 6026 | { |
| 6027 | HMENU hMenuLoad; |
| 6028 | HMENU hMenu; |
| 6029 | POINT pt; |
| 6030 | |
| 6031 | if ((HWND)wParam != GetDlgItem(hWnd, IDC_SSPICTURE) && (HWND)wParam != GetDlgItem(hWnd, IDC_SSFRAME)) |
| 6032 | return FALSE; |
| 6033 | |
| 6034 | pt.x = GET_X_LPARAM(lParam); |
| 6035 | pt.y = GET_Y_LPARAM(lParam); |
| 6036 | if (pt.x < 0 && pt.y < 0) |
| 6037 | GetCursorPos(&pt); |
| 6038 | |
| 6039 | hMenuLoad = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT_SCREENSHOT)); |
| 6040 | hMenu = GetSubMenu(hMenuLoad, 0); |
| 6041 | |
| 6042 | UpdateMenu(hMenu); |
| 6043 | |
| 6044 | TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x,pt.y,0,hWnd,NULL); |
| 6045 | |
| 6046 | DestroyMenu(hMenuLoad); |
| 6047 | |
| 6048 | return TRUE; |
| 6049 | } |
| 6050 | |
| 6051 | static void UpdateMenu(HMENU hMenu) |
| 6052 | { |
| 6053 | TCHAR buf[200]; |
| 6054 | MENUITEMINFO mItem; |
| 6055 | int nGame = Picker_GetSelectedItem(hwndList); |
| 6056 | LPTREEFOLDER lpFolder = GetCurrentFolder(); |
| 6057 | int i; |
| 6058 | const char *pParent; |
| 6059 | TCHAR* t_description; |
| 6060 | |
| 6061 | if (have_selection) |
| 6062 | { |
| 6063 | t_description = tstring_from_utf8(ConvertAmpersandString(ModifyThe(drivers[nGame]->description))); |
| 6064 | if( !t_description ) |
| 6065 | return; |
| 6066 | |
| 6067 | _sntprintf(buf, ARRAY_LENGTH(buf), g_szPlayGameString, t_description); |
| 6068 | |
| 6069 | mItem.cbSize = sizeof(mItem); |
| 6070 | mItem.fMask = MIIM_TYPE; |
| 6071 | mItem.fType = MFT_STRING; |
| 6072 | mItem.dwTypeData = buf; |
| 6073 | mItem.cch = _tcslen(mItem.dwTypeData); |
| 6074 | |
| 6075 | SetMenuItemInfo(hMenu, ID_FILE_PLAY, FALSE, &mItem); |
| 6076 | |
| 6077 | EnableMenuItem(hMenu, ID_CONTEXT_SELECT_RANDOM, MF_ENABLED); |
| 6078 | |
| 6079 | free(t_description); |
| 6080 | } |
| 6081 | else |
| 6082 | { |
| 6083 | EnableMenuItem(hMenu, ID_FILE_PLAY, MF_GRAYED); |
| 6084 | EnableMenuItem(hMenu, ID_FILE_PLAY_RECORD, MF_GRAYED); |
| 6085 | EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED); |
| 6086 | EnableMenuItem(hMenu, ID_CONTEXT_SELECT_RANDOM, MF_GRAYED); |
| 6087 | } |
| 6088 | |
| 6089 | if (oldControl) |
| 6090 | { |
| 6091 | EnableMenuItem(hMenu, ID_CUSTOMIZE_FIELDS, MF_GRAYED); |
| 6092 | EnableMenuItem(hMenu, ID_GAME_PROPERTIES, MF_GRAYED); |
| 6093 | EnableMenuItem(hMenu, ID_OPTIONS_DEFAULTS, MF_GRAYED); |
| 6094 | } |
| 6095 | |
| 6096 | if (lpFolder->m_dwFlags & F_CUSTOM) |
| 6097 | { |
| 6098 | EnableMenuItem(hMenu,ID_CONTEXT_REMOVE_CUSTOM,MF_ENABLED); |
| 6099 | EnableMenuItem(hMenu,ID_CONTEXT_RENAME_CUSTOM,MF_ENABLED); |
| 6100 | } |
| 6101 | else |
| 6102 | { |
| 6103 | EnableMenuItem(hMenu,ID_CONTEXT_REMOVE_CUSTOM,MF_GRAYED); |
| 6104 | EnableMenuItem(hMenu,ID_CONTEXT_RENAME_CUSTOM,MF_GRAYED); |
| 6105 | } |
| 6106 | pParent = GetFolderNameByID(lpFolder->m_nParent+1); |
| 6107 | |
| 6108 | if (lpFolder->m_dwFlags & F_INIEDIT) |
| 6109 | EnableMenuItem(hMenu,ID_FOLDER_PROPERTIES,MF_ENABLED); |
| 6110 | else |
| 6111 | EnableMenuItem(hMenu,ID_FOLDER_PROPERTIES,MF_GRAYED); |
| 6112 | |
| 6113 | CheckMenuRadioItem(hMenu, ID_VIEW_TAB_SCREENSHOT, ID_VIEW_TAB_HISTORY, |
| 6114 | ID_VIEW_TAB_SCREENSHOT + TabView_GetCurrentTab(hTabCtrl), MF_BYCOMMAND); |
| 6115 | |
| 6116 | // set whether we're showing the tab control or not |
| 6117 | if (bShowTabCtrl) |
| 6118 | CheckMenuItem(hMenu,ID_VIEW_PAGETAB,MF_BYCOMMAND | MF_CHECKED); |
| 6119 | else |
| 6120 | CheckMenuItem(hMenu,ID_VIEW_PAGETAB,MF_BYCOMMAND | MF_UNCHECKED); |
| 6121 | |
| 6122 | |
| 6123 | for (i=0;i<MAX_TAB_TYPES;i++) |
| 6124 | { |
| 6125 | // disable menu items for tabs we're not currently showing |
| 6126 | if (GetShowTab(i)) |
| 6127 | EnableMenuItem(hMenu,ID_VIEW_TAB_SCREENSHOT + i,MF_BYCOMMAND | MF_ENABLED); |
| 6128 | else |
| 6129 | EnableMenuItem(hMenu,ID_VIEW_TAB_SCREENSHOT + i,MF_BYCOMMAND | MF_GRAYED); |
| 6130 | |
| 6131 | // check toggle menu items |
| 6132 | if (GetShowTab(i)) |
| 6133 | CheckMenuItem(hMenu, ID_TOGGLE_TAB_SCREENSHOT + i,MF_BYCOMMAND | MF_CHECKED); |
| 6134 | else |
| 6135 | CheckMenuItem(hMenu, ID_TOGGLE_TAB_SCREENSHOT + i,MF_BYCOMMAND | MF_UNCHECKED); |
| 6136 | } |
| 6137 | |
| 6138 | for (i=0;i<MAX_FOLDERS;i++) |
| 6139 | { |
| 6140 | if (GetShowFolder(i)) |
| 6141 | CheckMenuItem(hMenu,ID_CONTEXT_SHOW_FOLDER_START + i,MF_BYCOMMAND | MF_CHECKED); |
| 6142 | else |
| 6143 | CheckMenuItem(hMenu,ID_CONTEXT_SHOW_FOLDER_START + i,MF_BYCOMMAND | MF_UNCHECKED); |
| 6144 | } |
| 6145 | |
| 6146 | } |
| 6147 | |
| 6148 | void InitTreeContextMenu(HMENU hTreeMenu) |
| 6149 | { |
| 6150 | MENUITEMINFO mii; |
| 6151 | HMENU hMenu; |
| 6152 | int i; |
| 6153 | extern FOLDERDATA g_folderData[]; |
| 6154 | |
| 6155 | ZeroMemory(&mii,sizeof(mii)); |
| 6156 | mii.cbSize = sizeof(mii); |
| 6157 | |
| 6158 | mii.wID = -1; |
| 6159 | mii.fMask = MIIM_SUBMENU | MIIM_ID; |
| 6160 | |
| 6161 | hMenu = GetSubMenu(hTreeMenu, 0); |
| 6162 | |
| 6163 | if (GetMenuItemInfo(hMenu,3,TRUE,&mii) == FALSE) |
| 6164 | { |
| 6165 | dprintf("can't find show folders context menu"); |
| 6166 | return; |
| 6167 | } |
| 6168 | |
| 6169 | if (mii.hSubMenu == NULL) |
| 6170 | { |
| 6171 | dprintf("can't find submenu for show folders context menu"); |
| 6172 | return; |
| 6173 | } |
| 6174 | |
| 6175 | hMenu = mii.hSubMenu; |
| 6176 | |
| 6177 | for (i=0;g_folderData[i].m_lpTitle != NULL;i++) |
| 6178 | { |
| 6179 | TCHAR* t_title = tstring_from_utf8(g_folderData[i].m_lpTitle); |
| 6180 | if( !t_title ) |
| 6181 | return; |
| 6182 | |
| 6183 | mii.fMask = MIIM_TYPE | MIIM_ID; |
| 6184 | mii.fType = MFT_STRING; |
| 6185 | mii.dwTypeData = t_title; |
| 6186 | mii.cch = _tcslen(mii.dwTypeData); |
| 6187 | mii.wID = ID_CONTEXT_SHOW_FOLDER_START + g_folderData[i].m_nFolderId; |
| 6188 | |
| 6189 | |
| 6190 | // menu in resources has one empty item (needed for the submenu to setup properly) |
| 6191 | // so overwrite this one, append after |
| 6192 | if (i == 0) |
| 6193 | SetMenuItemInfo(hMenu,ID_CONTEXT_SHOW_FOLDER_START,FALSE,&mii); |
| 6194 | else |
| 6195 | InsertMenuItem(hMenu,i,FALSE,&mii); |
| 6196 | |
| 6197 | free(t_title); |
| 6198 | } |
| 6199 | |
| 6200 | } |
| 6201 | |
| 6202 | void InitBodyContextMenu(HMENU hBodyContextMenu) |
| 6203 | { |
| 6204 | LPTREEFOLDER lpFolder; |
| 6205 | TCHAR tmp[30]; |
| 6206 | MENUITEMINFO mii; |
| 6207 | ZeroMemory(&mii,sizeof(mii)); |
| 6208 | mii.cbSize = sizeof(mii); |
| 6209 | |
| 6210 | if (GetMenuItemInfo(hBodyContextMenu,ID_FOLDER_SOURCEPROPERTIES,FALSE,&mii) == FALSE) |
| 6211 | { |
| 6212 | dprintf("can't find show folders context menu"); |
| 6213 | return; |
| 6214 | } |
| 6215 | lpFolder = GetFolderByName(FOLDER_SOURCE, GetDriverFilename(Picker_GetSelectedItem(hwndList)) ); |
| 6216 | _sntprintf(tmp,ARRAY_LENGTH(tmp),TEXT("Properties for %s"),lpFolder->m_lptTitle ); |
| 6217 | mii.fMask = MIIM_TYPE | MIIM_ID; |
| 6218 | mii.fType = MFT_STRING; |
| 6219 | mii.dwTypeData = tmp; |
| 6220 | mii.cch = _tcslen(mii.dwTypeData); |
| 6221 | mii.wID = ID_FOLDER_SOURCEPROPERTIES; |
| 6222 | |
| 6223 | |
| 6224 | // menu in resources has one default item |
| 6225 | // so overwrite this one |
| 6226 | SetMenuItemInfo(hBodyContextMenu,ID_FOLDER_SOURCEPROPERTIES,FALSE,&mii); |
| 6227 | if( ! DriverIsVector(Picker_GetSelectedItem(hwndList) ) ) |
| 6228 | EnableMenuItem(hBodyContextMenu, ID_FOLDER_VECTORPROPERTIES, MF_GRAYED); |
| 6229 | } |
| 6230 | |
| 6231 | |
| 6232 | void ToggleShowFolder(int folder) |
| 6233 | { |
| 6234 | int current_id = GetCurrentFolderID(); |
| 6235 | |
| 6236 | SetWindowRedraw(hwndList,FALSE); |
| 6237 | |
| 6238 | SetShowFolder(folder,!GetShowFolder(folder)); |
| 6239 | |
| 6240 | ResetTreeViewFolders(); |
| 6241 | SelectTreeViewFolder(current_id); |
| 6242 | |
| 6243 | SetWindowRedraw(hwndList,TRUE); |
| 6244 | } |
| 6245 | |
| 6246 | static LRESULT CALLBACK HistoryWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 6247 | { |
| 6248 | if (hBackground) |
| 6249 | { |
| 6250 | switch (uMsg) |
| 6251 | { |
| 6252 | case WM_MOUSEMOVE: |
| 6253 | { |
| 6254 | if (MouseHasBeenMoved()) |
| 6255 | ShowCursor(TRUE); |
| 6256 | break; |
| 6257 | } |
| 6258 | |
| 6259 | case WM_ERASEBKGND: |
| 6260 | return TRUE; |
| 6261 | case WM_PAINT: |
| 6262 | { |
| 6263 | POINT p = { 0, 0 }; |
| 6264 | |
| 6265 | /* get base point of background bitmap */ |
| 6266 | MapWindowPoints(hWnd,hTreeView,&p,1); |
| 6267 | PaintBackgroundImage(hWnd, NULL, p.x, p.y); |
| 6268 | /* to ensure our parent procedure repaints the whole client area */ |
| 6269 | InvalidateRect(hWnd, NULL, FALSE); |
| 6270 | break; |
| 6271 | } |
| 6272 | } |
| 6273 | } |
| 6274 | return CallWindowProc(g_lpHistoryWndProc, hWnd, uMsg, wParam, lParam); |
| 6275 | } |
| 6276 | |
| 6277 | static LRESULT CALLBACK PictureFrameWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 6278 | { |
| 6279 | switch (uMsg) |
| 6280 | { |
| 6281 | case WM_MOUSEMOVE: |
| 6282 | { |
| 6283 | if (MouseHasBeenMoved()) |
| 6284 | ShowCursor(TRUE); |
| 6285 | break; |
| 6286 | } |
| 6287 | |
| 6288 | case WM_NCHITTEST : |
| 6289 | { |
| 6290 | POINT pt; |
| 6291 | RECT rect; |
| 6292 | HWND hHistory = GetDlgItem(hMain, IDC_HISTORY); |
| 6293 | |
| 6294 | pt.x = LOWORD(lParam); |
| 6295 | pt.y = HIWORD(lParam); |
| 6296 | GetWindowRect(hHistory, &rect); |
| 6297 | // check if they clicked on the picture area (leave 6 pixel no man's land |
| 6298 | // by the history window to reduce mistaken clicks) |
| 6299 | // no more no man's land, the Cursor changes when Edit control is left, should be enough feedback |
| 6300 | if (have_history && |
| 6301 | ( ( (TabView_GetCurrentTab(hTabCtrl) == TAB_HISTORY) || |
| 6302 | (TabView_GetCurrentTab(hTabCtrl) == GetHistoryTab() && GetShowTab(TAB_HISTORY) == FALSE) || |
| 6303 | (TAB_ALL == GetHistoryTab() && GetShowTab(TAB_HISTORY) == FALSE) ) && |
| 6304 | // (rect.top - 6) < pt.y && pt.y < (rect.bottom + 6) ) ) |
| 6305 | PtInRect( &rect, pt ) ) ) |
| 6306 | |
| 6307 | { |
| 6308 | return HTTRANSPARENT; |
| 6309 | } |
| 6310 | else |
| 6311 | { |
| 6312 | return HTCLIENT; |
| 6313 | } |
| 6314 | } |
| 6315 | break; |
| 6316 | case WM_CONTEXTMENU: |
| 6317 | if ( HandleScreenShotContextMenu(hWnd, wParam, lParam)) |
| 6318 | return FALSE; |
| 6319 | break; |
| 6320 | } |
| 6321 | |
| 6322 | if (hBackground) |
| 6323 | { |
| 6324 | switch (uMsg) |
| 6325 | { |
| 6326 | case WM_ERASEBKGND : |
| 6327 | return TRUE; |
| 6328 | case WM_PAINT : |
| 6329 | { |
| 6330 | RECT rect,nodraw_rect; |
| 6331 | HRGN region,nodraw_region; |
| 6332 | POINT p = { 0, 0 }; |
| 6333 | |
| 6334 | /* get base point of background bitmap */ |
| 6335 | MapWindowPoints(hWnd,hTreeView,&p,1); |
| 6336 | |
| 6337 | /* get big region */ |
| 6338 | GetClientRect(hWnd,&rect); |
| 6339 | region = CreateRectRgnIndirect(&rect); |
| 6340 | |
| 6341 | if (IsWindowVisible(GetDlgItem(hMain,IDC_HISTORY))) |
| 6342 | { |
| 6343 | /* don't draw over this window */ |
| 6344 | GetWindowRect(GetDlgItem(hMain,IDC_HISTORY),&nodraw_rect); |
| 6345 | MapWindowPoints(HWND_DESKTOP,hWnd,(LPPOINT)&nodraw_rect,2); |
| 6346 | nodraw_region = CreateRectRgnIndirect(&nodraw_rect); |
| 6347 | CombineRgn(region,region,nodraw_region,RGN_DIFF); |
| 6348 | DeleteObject(nodraw_region); |
| 6349 | } |
| 6350 | if (IsWindowVisible(GetDlgItem(hMain,IDC_SSPICTURE))) |
| 6351 | { |
| 6352 | /* don't draw over this window */ |
| 6353 | GetWindowRect(GetDlgItem(hMain,IDC_SSPICTURE),&nodraw_rect); |
| 6354 | MapWindowPoints(HWND_DESKTOP,hWnd,(LPPOINT)&nodraw_rect,2); |
| 6355 | nodraw_region = CreateRectRgnIndirect(&nodraw_rect); |
| 6356 | CombineRgn(region,region,nodraw_region,RGN_DIFF); |
| 6357 | DeleteObject(nodraw_region); |
| 6358 | } |
| 6359 | |
| 6360 | PaintBackgroundImage(hWnd,region,p.x,p.y); |
| 6361 | |
| 6362 | DeleteObject(region); |
| 6363 | |
| 6364 | /* to ensure our parent procedure repaints the whole client area */ |
| 6365 | InvalidateRect(hWnd, NULL, FALSE); |
| 6366 | |
| 6367 | break; |
| 6368 | } |
| 6369 | } |
| 6370 | } |
| 6371 | return CallWindowProc(g_lpPictureFrameWndProc, hWnd, uMsg, wParam, lParam); |
| 6372 | } |
| 6373 | |
| 6374 | static LRESULT CALLBACK PictureWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 6375 | { |
| 6376 | switch (uMsg) |
| 6377 | { |
| 6378 | case WM_ERASEBKGND : |
| 6379 | return TRUE; |
| 6380 | case WM_PAINT : |
| 6381 | { |
| 6382 | PAINTSTRUCT ps; |
| 6383 | HDC hdc,hdc_temp; |
| 6384 | RECT rect; |
| 6385 | HBITMAP old_bitmap; |
| 6386 | |
| 6387 | int width,height; |
| 6388 | |
| 6389 | RECT rect2; |
| 6390 | HBRUSH hBrush; |
| 6391 | HBRUSH holdBrush; |
| 6392 | HRGN region1, region2; |
| 6393 | int nBordersize; |
| 6394 | nBordersize = GetScreenshotBorderSize(); |
| 6395 | hBrush = CreateSolidBrush(GetScreenshotBorderColor()); |
| 6396 | |
| 6397 | hdc = BeginPaint(hWnd,&ps); |
| 6398 | |
| 6399 | hdc_temp = CreateCompatibleDC(hdc); |
| 6400 | if (ScreenShotLoaded()) |
| 6401 | { |
| 6402 | width = GetScreenShotWidth(); |
| 6403 | height = GetScreenShotHeight(); |
| 6404 | |
| 6405 | old_bitmap = SelectObject(hdc_temp,GetScreenShotHandle()); |
| 6406 | } |
| 6407 | else |
| 6408 | { |
| 6409 | BITMAP bmp; |
| 6410 | |
| 6411 | GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp); |
| 6412 | width = bmp.bmWidth; |
| 6413 | height = bmp.bmHeight; |
| 6414 | |
| 6415 | old_bitmap = SelectObject(hdc_temp,hMissing_bitmap); |
| 6416 | } |
| 6417 | |
| 6418 | GetClientRect(hWnd,&rect); |
| 6419 | |
| 6420 | rect2 = rect; |
| 6421 | //Configurable Borders around images |
| 6422 | rect.bottom -= nBordersize; |
| 6423 | if( rect.bottom < 0) |
| 6424 | rect.bottom = rect2.bottom; |
| 6425 | rect.right -= nBordersize; |
| 6426 | if( rect.right < 0) |
| 6427 | rect.right = rect2.right; |
| 6428 | rect.top += nBordersize; |
| 6429 | if( rect.top > rect.bottom ) |
| 6430 | rect.top = rect2.top; |
| 6431 | rect.left += nBordersize; |
| 6432 | if( rect.left > rect.right ) |
| 6433 | rect.left = rect2.left; |
| 6434 | region1 = CreateRectRgnIndirect(&rect); |
| 6435 | region2 = CreateRectRgnIndirect(&rect2); |
| 6436 | CombineRgn(region2,region2,region1,RGN_DIFF); |
| 6437 | holdBrush = SelectObject(hdc, hBrush); |
| 6438 | |
| 6439 | FillRgn(hdc,region2, hBrush ); |
| 6440 | SelectObject(hdc, holdBrush); |
| 6441 | DeleteObject(hBrush); |
| 6442 | |
| 6443 | SetStretchBltMode(hdc,STRETCH_HALFTONE); |
| 6444 | StretchBlt(hdc,nBordersize,nBordersize,rect.right-rect.left,rect.bottom-rect.top, |
| 6445 | hdc_temp,0,0,width,height,SRCCOPY); |
| 6446 | SelectObject(hdc_temp,old_bitmap); |
| 6447 | DeleteDC(hdc_temp); |
| 6448 | |
| 6449 | EndPaint(hWnd,&ps); |
| 6450 | |
| 6451 | return TRUE; |
| 6452 | } |
| 6453 | } |
| 6454 | |
| 6455 | return CallWindowProc(g_lpPictureWndProc, hWnd, uMsg, wParam, lParam); |
| 6456 | } |
| 6457 | |
| 6458 | void RemoveCurrentGameCustomFolder(void) |
| 6459 | { |
| 6460 | RemoveGameCustomFolder(Picker_GetSelectedItem(hwndList)); |
| 6461 | } |
| 6462 | |
| 6463 | void RemoveGameCustomFolder(int driver_index) |
| 6464 | { |
| 6465 | int i; |
| 6466 | TREEFOLDER **folders; |
| 6467 | int num_folders; |
| 6468 | |
| 6469 | GetFolders(&folders,&num_folders); |
| 6470 | |
| 6471 | for (i=0;i<num_folders;i++) |
| 6472 | { |
| 6473 | if (folders[i]->m_dwFlags & F_CUSTOM && folders[i]->m_nFolderId == GetCurrentFolderID()) |
| 6474 | { |
| 6475 | int current_pick_index; |
| 6476 | |
| 6477 | RemoveFromCustomFolder(folders[i],driver_index); |
| 6478 | |
| 6479 | if (driver_index == Picker_GetSelectedItem(hwndList)) |
| 6480 | { |
| 6481 | /* if we just removed the current game, |
| 6482 | move the current selection so that when we rebuild the listview it |
| 6483 | leaves the cursor on next or previous one */ |
| 6484 | |
| 6485 | current_pick_index = GetSelectedPick(); |
| 6486 | Picker_SetSelectedPick(hwndList, GetSelectedPick() + 1); |
| 6487 | if (current_pick_index == GetSelectedPick()) /* we must have deleted the last item */ |
| 6488 | Picker_SetSelectedPick(hwndList, GetSelectedPick() - 1); |
| 6489 | } |
| 6490 | |
| 6491 | ResetListView(); |
| 6492 | return; |
| 6493 | } |
| 6494 | } |
| 6495 | MessageBox(GetMainWindow(), TEXT("Error searching for custom folder"), TEXT(MAMEUINAME), MB_OK | MB_ICONERROR); |
| 6496 | |
| 6497 | } |
| 6498 | |
| 6499 | |
| 6500 | void BeginListViewDrag(NM_LISTVIEW *pnmv) |
| 6501 | { |
| 6502 | LV_ITEM lvi; |
| 6503 | POINT pt; |
| 6504 | |
| 6505 | lvi.iItem = pnmv->iItem; |
| 6506 | lvi.mask = LVIF_PARAM; |
| 6507 | ListView_GetItem(hwndList, &lvi); |
| 6508 | |
| 6509 | game_dragged = lvi.lParam; |
| 6510 | |
| 6511 | pt.x = 0; |
| 6512 | pt.y = 0; |
| 6513 | |
| 6514 | /* Tell the list view control to create an image to use |
| 6515 | for dragging. */ |
| 6516 | himl_drag = ListView_CreateDragImage(hwndList,pnmv->iItem,&pt); |
| 6517 | |
| 6518 | /* Start the drag operation. */ |
| 6519 | ImageList_BeginDrag(himl_drag, 0, 0, 0); |
| 6520 | |
| 6521 | pt = pnmv->ptAction; |
| 6522 | ClientToScreen(hwndList,&pt); |
| 6523 | ImageList_DragEnter(GetDesktopWindow(),pt.x,pt.y); |
| 6524 | |
| 6525 | /* Hide the mouse cursor, and direct mouse input to the |
| 6526 | parent window. */ |
| 6527 | SetCapture(hMain); |
| 6528 | |
| 6529 | prev_drag_drop_target = NULL; |
| 6530 | |
| 6531 | g_listview_dragging = TRUE; |
| 6532 | |
| 6533 | } |
| 6534 | |
| 6535 | void MouseMoveListViewDrag(POINTS p) |
| 6536 | { |
| 6537 | HTREEITEM htiTarget; |
| 6538 | TV_HITTESTINFO tvht; |
| 6539 | |
| 6540 | POINT pt; |
| 6541 | pt.x = p.x; |
| 6542 | pt.y = p.y; |
| 6543 | |
| 6544 | ClientToScreen(hMain,&pt); |
| 6545 | |
| 6546 | ImageList_DragMove(pt.x,pt.y); |
| 6547 | |
| 6548 | MapWindowPoints(GetDesktopWindow(),hTreeView,&pt,1); |
| 6549 | |
| 6550 | tvht.pt = pt; |
| 6551 | htiTarget = TreeView_HitTest(hTreeView,&tvht); |
| 6552 | |
| 6553 | if (htiTarget != prev_drag_drop_target) |
| 6554 | { |
| 6555 | ImageList_DragShowNolock(FALSE); |
| 6556 | if (htiTarget != NULL) |
| 6557 | TreeView_SelectDropTarget(hTreeView,htiTarget); |
| 6558 | else |
| 6559 | TreeView_SelectDropTarget(hTreeView,NULL); |
| 6560 | ImageList_DragShowNolock(TRUE); |
| 6561 | |
| 6562 | prev_drag_drop_target = htiTarget; |
| 6563 | } |
| 6564 | } |
| 6565 | |
| 6566 | void ButtonUpListViewDrag(POINTS p) |
| 6567 | { |
| 6568 | POINT pt; |
| 6569 | HTREEITEM htiTarget; |
| 6570 | TV_HITTESTINFO tvht; |
| 6571 | TVITEM tvi; |
| 6572 | |
| 6573 | ReleaseCapture(); |
| 6574 | |
| 6575 | ImageList_DragLeave(hwndList); |
| 6576 | ImageList_EndDrag(); |
| 6577 | ImageList_Destroy(himl_drag); |
| 6578 | |
| 6579 | TreeView_SelectDropTarget(hTreeView,NULL); |
| 6580 | |
| 6581 | g_listview_dragging = FALSE; |
| 6582 | |
| 6583 | /* see where the game was dragged */ |
| 6584 | |
| 6585 | pt.x = p.x; |
| 6586 | pt.y = p.y; |
| 6587 | |
| 6588 | MapWindowPoints(hMain,hTreeView,&pt,1); |
| 6589 | |
| 6590 | tvht.pt = pt; |
| 6591 | htiTarget = TreeView_HitTest(hTreeView,&tvht); |
| 6592 | if (htiTarget == NULL) |
| 6593 | { |
| 6594 | LVHITTESTINFO lvhtti; |
| 6595 | LPTREEFOLDER folder; |
| 6596 | RECT rcList; |
| 6597 | |
| 6598 | /* the user dragged a game onto something other than the treeview */ |
| 6599 | /* try to remove if we're in a custom folder */ |
| 6600 | |
| 6601 | /* see if it was dragged within the list view; if so, ignore */ |
| 6602 | |
| 6603 | MapWindowPoints(hTreeView,hwndList,&pt,1); |
| 6604 | lvhtti.pt = pt; |
| 6605 | GetWindowRect(hwndList, &rcList); |
| 6606 | ClientToScreen(hwndList, &pt); |
| 6607 | if( PtInRect(&rcList, pt) != 0 ) |
| 6608 | return; |
| 6609 | |
| 6610 | folder = GetCurrentFolder(); |
| 6611 | if (folder->m_dwFlags & F_CUSTOM) |
| 6612 | { |
| 6613 | /* dragged out of a custom folder, so let's remove it */ |
| 6614 | RemoveCurrentGameCustomFolder(); |
| 6615 | } |
| 6616 | return; |
| 6617 | } |
| 6618 | |
| 6619 | |
| 6620 | tvi.lParam = 0; |
| 6621 | tvi.mask = TVIF_PARAM | TVIF_HANDLE; |
| 6622 | tvi.hItem = htiTarget; |
| 6623 | |
| 6624 | if (TreeView_GetItem(hTreeView, &tvi)) |
| 6625 | { |
| 6626 | LPTREEFOLDER folder = (LPTREEFOLDER)tvi.lParam; |
| 6627 | AddToCustomFolder(folder,game_dragged); |
| 6628 | } |
| 6629 | |
| 6630 | } |
| 6631 | |
| 6632 | static LPTREEFOLDER GetSelectedFolder(void) |
| 6633 | { |
| 6634 | HTREEITEM htree; |
| 6635 | TVITEM tvi; |
| 6636 | htree = TreeView_GetSelection(hTreeView); |
| 6637 | if(htree != NULL) |
| 6638 | { |
| 6639 | tvi.hItem = htree; |
| 6640 | tvi.mask = TVIF_PARAM; |
| 6641 | TreeView_GetItem(hTreeView,&tvi); |
| 6642 | return (LPTREEFOLDER)tvi.lParam; |
| 6643 | } |
| 6644 | return NULL; |
| 6645 | } |
| 6646 | |
| 6647 | static HICON GetSelectedFolderIcon(void) |
| 6648 | { |
| 6649 | HTREEITEM htree; |
| 6650 | TVITEM tvi; |
| 6651 | HIMAGELIST hSmall_icon; |
| 6652 | LPTREEFOLDER folder; |
| 6653 | htree = TreeView_GetSelection(hTreeView); |
| 6654 | |
| 6655 | if (htree != NULL) |
| 6656 | { |
| 6657 | tvi.hItem = htree; |
| 6658 | tvi.mask = TVIF_PARAM; |
| 6659 | TreeView_GetItem(hTreeView,&tvi); |
| 6660 | |
| 6661 | folder = (LPTREEFOLDER)tvi.lParam; |
| 6662 | //hSmall_icon = TreeView_GetImageList(hTreeView,(int)tvi.iImage); |
| 6663 | hSmall_icon = NULL; |
| 6664 | return ImageList_GetIcon(hSmall_icon, tvi.iImage, ILD_TRANSPARENT); |
| 6665 | } |
| 6666 | return NULL; |
| 6667 | } |
| 6668 | |
| 6669 | /* Updates all currently displayed Items in the List with the latest Data*/ |
| 6670 | void UpdateListView(void) |
| 6671 | { |
| 6672 | if( (GetViewMode() == VIEW_GROUPED) || (GetViewMode() == VIEW_DETAILS ) ) |
| 6673 | ListView_RedrawItems(hwndList,ListView_GetTopIndex(hwndList), |
| 6674 | ListView_GetTopIndex(hwndList)+ ListView_GetCountPerPage(hwndList) ); |
| 6675 | } |
| 6676 | |
| 6677 | void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height) |
| 6678 | { |
| 6679 | int destX, destY; |
| 6680 | int destW, destH; |
| 6681 | int nBorder; |
| 6682 | RECT rect; |
| 6683 | /* for scaling */ |
| 6684 | int x, y; |
| 6685 | int rWidth, rHeight; |
| 6686 | double scale; |
| 6687 | BOOL bReduce = FALSE; |
| 6688 | |
| 6689 | GetClientRect(hWnd, &rect); |
| 6690 | |
| 6691 | // Scale the bitmap to the frame specified by the passed in hwnd |
| 6692 | if (ScreenShotLoaded()) |
| 6693 | { |
| 6694 | x = GetScreenShotWidth(); |
| 6695 | y = GetScreenShotHeight(); |
| 6696 | } |
| 6697 | else |
| 6698 | { |
| 6699 | BITMAP bmp; |
| 6700 | GetObject(hMissing_bitmap,sizeof(BITMAP),&bmp); |
| 6701 | |
| 6702 | x = bmp.bmWidth; |
| 6703 | y = bmp.bmHeight; |
| 6704 | } |
| 6705 | rWidth = (rect.right - rect.left); |
| 6706 | rHeight = (rect.bottom - rect.top); |
| 6707 | |
| 6708 | /* Limit the screen shot to max height of 264 */ |
| 6709 | if (restrict_height == TRUE && rHeight > 264) |
| 6710 | { |
| 6711 | rect.bottom = rect.top + 264; |
| 6712 | rHeight = 264; |
| 6713 | } |
| 6714 | |
| 6715 | /* If the bitmap does NOT fit in the screenshot area */ |
| 6716 | if (x > rWidth - 10 || y > rHeight - 10) |
| 6717 | { |
| 6718 | rect.right -= 10; |
| 6719 | rect.bottom -= 10; |
| 6720 | rWidth -= 10; |
| 6721 | rHeight -= 10; |
| 6722 | bReduce = TRUE; |
| 6723 | /* Try to scale it properly */ |
| 6724 | /* assumes square pixels, doesn't consider aspect ratio */ |
| 6725 | if (x > y) |
| 6726 | scale = (double)rWidth / x; |
| 6727 | else |
| 6728 | scale = (double)rHeight / y; |
| 6729 | |
| 6730 | destW = (int)(x * scale); |
| 6731 | destH = (int)(y * scale); |
| 6732 | |
| 6733 | /* If it's still too big, scale again */ |
| 6734 | if (destW > rWidth || destH > rHeight) |
| 6735 | { |
| 6736 | if (destW > rWidth) |
| 6737 | scale = (double)rWidth / destW; |
| 6738 | else |
| 6739 | scale = (double)rHeight / destH; |
| 6740 | |
| 6741 | destW = (int)(destW * scale); |
| 6742 | destH = (int)(destH * scale); |
| 6743 | } |
| 6744 | } |
| 6745 | else |
| 6746 | { |
| 6747 | if (GetStretchScreenShotLarger()) |
| 6748 | { |
| 6749 | rect.right -= 10; |
| 6750 | rect.bottom -= 10; |
| 6751 | rWidth -= 10; |
| 6752 | rHeight -= 10; |
| 6753 | bReduce = TRUE; |
| 6754 | // Try to scale it properly |
| 6755 | // assumes square pixels, doesn't consider aspect ratio |
| 6756 | if (x < y) |
| 6757 | scale = (double)rWidth / x; |
| 6758 | else |
| 6759 | scale = (double)rHeight / y; |
| 6760 | |
| 6761 | destW = (int)(x * scale); |
| 6762 | destH = (int)(y * scale); |
| 6763 | |
| 6764 | // If it's too big, scale again |
| 6765 | if (destW > rWidth || destH > rHeight) |
| 6766 | { |
| 6767 | if (destW > rWidth) |
| 6768 | scale = (double)rWidth / destW; |
| 6769 | else |
| 6770 | scale = (double)rHeight / destH; |
| 6771 | |
| 6772 | destW = (int)(destW * scale); |
| 6773 | destH = (int)(destH * scale); |
| 6774 | } |
| 6775 | } |
| 6776 | else |
| 6777 | { |
| 6778 | // Use the bitmaps size if it fits |
| 6779 | destW = x; |
| 6780 | destH = y; |
| 6781 | } |
| 6782 | |
| 6783 | } |
| 6784 | |
| 6785 | |
| 6786 | destX = ((rWidth - destW) / 2); |
| 6787 | destY = ((rHeight - destH) / 2); |
| 6788 | |
| 6789 | if (bReduce) |
| 6790 | { |
| 6791 | destX += 5; |
| 6792 | destY += 5; |
| 6793 | } |
| 6794 | nBorder = GetScreenshotBorderSize(); |
| 6795 | if( destX > nBorder+1) |
| 6796 | pRect->left = destX - nBorder; |
| 6797 | else |
| 6798 | pRect->left = 2; |
| 6799 | if( destY > nBorder+1) |
| 6800 | pRect->top = destY - nBorder; |
| 6801 | else |
| 6802 | pRect->top = 2; |
| 6803 | if( rWidth >= destX + destW + nBorder) |
| 6804 | pRect->right = destX + destW + nBorder; |
| 6805 | else |
| 6806 | pRect->right = rWidth - pRect->left; |
| 6807 | if( rHeight >= destY + destH + nBorder) |
| 6808 | pRect->bottom = destY + destH + nBorder; |
| 6809 | else |
| 6810 | pRect->bottom = rHeight - pRect->top; |
| 6811 | } |
| 6812 | |
| 6813 | /* |
| 6814 | Switches to either fullscreen or normal mode, based on the |
| 6815 | current mode. |
| 6816 | |
| 6817 | POSSIBLE BUGS: |
| 6818 | Removing the menu might cause problems later if some |
| 6819 | function tries to poll info stored in the menu. Don't |
| 6820 | know if you've done that, but this was the only way I |
| 6821 | knew to remove the menu dynamically. |
| 6822 | */ |
| 6823 | |
| 6824 | void SwitchFullScreenMode(void) |
| 6825 | { |
| 6826 | LONG lMainStyle; |
| 6827 | |
| 6828 | if (GetRunFullScreen()) |
| 6829 | { |
| 6830 | // Return to normal |
| 6831 | |
| 6832 | // Restore the menu |
| 6833 | SetMenu(hMain, LoadMenu(hInst,MAKEINTRESOURCE(IDR_UI_MENU))); |
| 6834 | |
| 6835 | // Refresh the checkmarks |
| 6836 | CheckMenuItem(GetMenu(hMain), ID_VIEW_FOLDERS, GetShowFolderList() ? MF_CHECKED : MF_UNCHECKED); |
| 6837 | CheckMenuItem(GetMenu(hMain), ID_VIEW_TOOLBARS, GetShowToolBar() ? MF_CHECKED : MF_UNCHECKED); |
| 6838 | CheckMenuItem(GetMenu(hMain), ID_VIEW_STATUS, GetShowStatusBar() ? MF_CHECKED : MF_UNCHECKED); |
| 6839 | CheckMenuItem(GetMenu(hMain), ID_VIEW_PAGETAB, GetShowTabCtrl() ? MF_CHECKED : MF_UNCHECKED); |
| 6840 | |
| 6841 | // Add frame to dialog again |
| 6842 | lMainStyle = GetWindowLong(hMain, GWL_STYLE); |
| 6843 | lMainStyle = lMainStyle | WS_BORDER; |
| 6844 | SetWindowLong(hMain, GWL_STYLE, lMainStyle); |
| 6845 | |
| 6846 | // Show the window maximized |
| 6847 | if( GetWindowState() == SW_MAXIMIZE ) |
| 6848 | { |
| 6849 | ShowWindow(hMain, SW_NORMAL); |
| 6850 | ShowWindow(hMain, SW_MAXIMIZE); |
| 6851 | } |
| 6852 | else |
| 6853 | ShowWindow(hMain, SW_RESTORE); |
| 6854 | |
| 6855 | SetRunFullScreen(FALSE); |
| 6856 | } |
| 6857 | else |
| 6858 | { |
| 6859 | // Set to fullscreen |
| 6860 | |
| 6861 | // Remove menu |
| 6862 | SetMenu(hMain,NULL); |
| 6863 | |
| 6864 | // Frameless dialog (fake fullscreen) |
| 6865 | lMainStyle = GetWindowLong(hMain, GWL_STYLE); |
| 6866 | lMainStyle = lMainStyle & (WS_BORDER ^ 0xffffffff); |
| 6867 | SetWindowLong(hMain, GWL_STYLE, lMainStyle); |
| 6868 | if( IsMaximized(hMain) ) |
| 6869 | { |
| 6870 | ShowWindow(hMain, SW_NORMAL); |
| 6871 | SetWindowState( SW_MAXIMIZE ); |
| 6872 | } |
| 6873 | ShowWindow(hMain, SW_MAXIMIZE); |
| 6874 | |
| 6875 | SetRunFullScreen(TRUE); |
| 6876 | } |
| 6877 | } |
| 6878 | |
| 6879 | /* |
| 6880 | Checks to see if the mouse has been moved since this func |
| 6881 | was first called (which is at startup). The reason for |
| 6882 | storing the startup coordinates of the mouse is that when |
| 6883 | a window is created it generates WM_MOUSEOVER events, even |
| 6884 | though the user didn't actually move the mouse. So we need |
| 6885 | to know when the WM_MOUSEOVER event is user-triggered. |
| 6886 | |
| 6887 | POSSIBLE BUGS: |
| 6888 | Gets polled at every WM_MOUSEMOVE so it might cause lag, |
| 6889 | but there's probably another way to code this that's |
| 6890 | way better? |
| 6891 | |
| 6892 | */ |
| 6893 | |
| 6894 | BOOL MouseHasBeenMoved(void) |
| 6895 | { |
| 6896 | static int mouse_x = -1; |
| 6897 | static int mouse_y = -1; |
| 6898 | POINT p; |
| 6899 | |
| 6900 | GetCursorPos(&p); |
| 6901 | |
| 6902 | if (mouse_x == -1) // First time |
| 6903 | { |
| 6904 | mouse_x = p.x; |
| 6905 | mouse_y = p.y; |
| 6906 | } |
| 6907 | |
| 6908 | return (p.x != mouse_x || p.y != mouse_y); |
| 6909 | } |
| 6910 | |
| 6911 | /* End of source file */ |