RAM Search: added "Search ROM" checkbox

This commit is contained in:
thezlomus 2012-12-26 23:09:11 +00:00
parent afd4675104
commit baf366f1f2
3 changed files with 16 additions and 5 deletions

View File

@ -45,16 +45,23 @@
#include "stdint.h" #include "stdint.h"
#endif #endif
bool ShowROM = false;
bool IsHardwareAddressValid(HWAddressType address) bool IsHardwareAddressValid(HWAddressType address)
{ {
if (!GameInfo) if (!GameInfo)
return false; return false;
if ((address <= 0x07ff) || (address >= 0x6000 && address <= 0x7FFF)) if(!ShowROM)
return true; if ((address >= 0x0000 && address < 0x0800) || (address >= 0x6000 && address < 0x8000))
return true;
else
return false;
else else
return false; if (address >= 0x8000 && address < 0x10000)
return true;
else
return false;
} }
#define INVALID_HARDWARE_ADDRESS ((HWAddressType) -1) #define INVALID_HARDWARE_ADDRESS ((HWAddressType) -1)
@ -1469,6 +1476,7 @@ LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
s_prevValuesNeedUpdate = true; s_prevValuesNeedUpdate = true;
SendDlgItemMessage(hDlg,IDC_C_AUTOSEARCH,BM_SETCHECK,AutoSearch?BST_CHECKED:BST_UNCHECKED,0); SendDlgItemMessage(hDlg,IDC_C_AUTOSEARCH,BM_SETCHECK,AutoSearch?BST_CHECKED:BST_UNCHECKED,0);
SendDlgItemMessage(hDlg,IDC_C_SEARCHROM,BM_SETCHECK,ShowROM?BST_CHECKED:BST_UNCHECKED,0);
//const char* names[5] = {"Address","Value","Previous","Changes","Notes"}; //const char* names[5] = {"Address","Value","Previous","Changes","Notes"};
//int widths[5] = {62,64,64,55,55}; //int widths[5] = {62,64,64,55,55};
const char* names[] = {"Address","Value","Previous","Changes"}; const char* names[] = {"Address","Value","Previous","Changes"};
@ -1766,6 +1774,8 @@ LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
} }
} {rv = true; break;} } {rv = true; break;}
case IDC_C_SEARCHROM:
ShowROM = SendDlgItemMessage(hDlg, IDC_C_SEARCHROM, BM_GETCHECK, 0, 0) != 0;
case IDC_C_RESET: case IDC_C_RESET:
{ {
RamSearchSaveUndoStateIfNotTooBig(RamSearchHWnd); RamSearchSaveUndoStateIfNotTooBig(RamSearchHWnd);

View File

@ -1834,6 +1834,7 @@ BEGIN
PUSHBUTTON "&Clear Change Counts",IDC_C_RESET_CHANGES,226,46,52,20,BS_MULTILINE PUSHBUTTON "&Clear Change Counts",IDC_C_RESET_CHANGES,226,46,52,20,BS_MULTILINE
PUSHBUTTON "&Undo",IDC_C_UNDO,226,69,52,16,WS_DISABLED PUSHBUTTON "&Undo",IDC_C_UNDO,226,69,52,16,WS_DISABLED
LTEXT "Is",IDC_STATIC,92,270,12,8 LTEXT "Is",IDC_STATIC,92,270,12,8
CONTROL "Search ROM",IDC_C_SEARCHROM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,226,91,52,11
END END
IDD_RAMWATCH DIALOGEX 0, 0, 269, 298 IDD_RAMWATCH DIALOGEX 0, 0, 269, 298

View File

@ -681,7 +681,7 @@
#define IDC_EDIT_LUAARGS 1256 #define IDC_EDIT_LUAARGS 1256
#define CB_PARTIALVISUALTHEME 1257 #define CB_PARTIALVISUALTHEME 1257
#define DEBUGLOADDEB 1258 #define DEBUGLOADDEB 1258
#define IDC_CHECK2 1258 #define IDC_C_SEARCHROM 1258
#define IDC_SINGLEINSTANCE 1258 #define IDC_SINGLEINSTANCE 1258
#define IDC_MOVIE_CLOSEAFTERPLAYBACK 1258 #define IDC_MOVIE_CLOSEAFTERPLAYBACK 1258
#define IDC_C_WATCH_SEPARATE 1259 #define IDC_C_WATCH_SEPARATE 1259