Added Ram Search hot keys. Replaces previous committed Cheat Dialog hot keys.

This commit is contained in:
ugetab 2010-05-12 03:09:56 +00:00
parent 952320e1df
commit 6131a6ea79
5 changed files with 144 additions and 2 deletions

View File

@ -1,5 +1,5 @@
11-may-2010 - ugetab - Win32 - Added Ram Search hotkeys for the first 6 search types in the list.
10-may-2010 - adelikat - Loadstate while in record mode update input display
10-may-2010 - ugetab - Win32 - Added hotkey options for the cheat dialog buttons Equal, Not Equal, Greater Than, and Less Than.
10-may-2010 - ugetab - Added gui.getpixel() which gets any gui.pixel() set pixel colors, and possibly other functions. Added emu.getscreenpixel() which gets the RGB and Palette of any pixel on the screen.
08-may-2010 - ugetab - Added savestate.object() which is savestate.create() with intuitive numbering under windows
08-may-2010 - ugetab - Added emu.addgamegenie() and emu.delgamegenie() LUA functions.

View File

@ -1335,7 +1335,6 @@ static BOOL SelectingByKeyboard()
return (a | b | c | d) & 0x80;
}
LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RECT r;
@ -2053,3 +2052,55 @@ void init_list_box(HWND Box, const char* Strs[], int numColumns, int *columnWidt
ListView_SetExtendedListViewStyle(Box, LVS_EX_FULLROWSELECT);
}
void SetSearchType(int SearchType) {
EnableWindow(GetDlgItem(RamSearchHWnd,IDC_EDIT_DIFFBY),false);
EnableWindow(GetDlgItem(RamSearchHWnd,IDC_EDIT_MODBY),false);
SendDlgItemMessage(RamSearchHWnd, IDC_LESSTHAN, BM_SETCHECK, SearchType == 0 ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(RamSearchHWnd, IDC_MORETHAN, BM_SETCHECK, SearchType == 1 ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(RamSearchHWnd, IDC_NOMORETHAN, BM_SETCHECK, SearchType == 2 ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(RamSearchHWnd, IDC_NOLESSTHAN, BM_SETCHECK, SearchType == 3 ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(RamSearchHWnd, IDC_EQUALTO, BM_SETCHECK, SearchType == 4 ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(RamSearchHWnd, IDC_DIFFERENTFROM, BM_SETCHECK, SearchType == 5 ? BST_CHECKED : BST_UNCHECKED, 0);
switch(SearchType)
{
case 0:
// Less Than
//SendDlgItemMessage(RamSearchHWnd, IDC_LESSTHAN, BM_SETCHECK, BST_CHECKED, 0);
rs_o = '<';
break;
case 1:
// Greater Than
//SendDlgItemMessage(RamSearchHWnd, IDC_MORETHAN, BM_SETCHECK, BST_CHECKED, 0);
rs_o = '>';
break;
case 2:
// Less Than or Equal
//SendDlgItemMessage(RamSearchHWnd, IDC_NOMORETHAN, BM_SETCHECK, BST_CHECKED, 0);
rs_o = 'l';
break;
case 3:
// Greater Than or Equal
//SendDlgItemMessage(RamSearchHWnd, IDC_NOLESSTHAN, BM_SETCHECK, BST_CHECKED, 0);
rs_o = 'm';
break;
case 4:
// Equal
//SendDlgItemMessage(RamSearchHWnd, IDC_EQUALTO, BM_SETCHECK, BST_CHECKED, 0);
rs_o = '=';
break;
case 5:
// Not Equal
//SendDlgItemMessage(RamSearchHWnd, IDC_DIFFERENTFROM, BM_SETCHECK, BST_CHECKED, 0);
rs_o = '!';
break;
}
return;
}
void DoRamSearchOperation() {
RamSearchProc(RamSearchHWnd, WM_COMMAND, IDC_C_SEARCH, 0);
return;
}

View File

@ -26,6 +26,9 @@ void CloseRamWindows(); //Close the Ram Search & Watch windows when rom closes
void ReopenRamWindows(); //Reopen them when a new Rom is loaded
void Update_RAM_Search(); //keeps RAM values up to date in the search and watch windows
void SetSearchType(int SearchType); //Set the search type
void DoRamSearchOperation(); //Perform a search
extern HWND RamSearchHWnd;
extern LRESULT CALLBACK RamSearchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);

View File

@ -632,10 +632,19 @@ static void LaunchTraceLogger(void);
static void LaunchCodeDataLogger(void);
static void LaunchRamWatch(void);
static void LaunchRamSearch(void);
<<<<<<< .mine
static void RamSearchOpLT(void);
static void RamSearchOpGT(void);
static void RamSearchOpLTE(void);
static void RamSearchOpGTE(void);
static void RamSearchOpEQ(void);
static void RamSearchOpNE(void);
=======
static void CheatSearchEQ(void);
static void CheatSearchNE(void);
static void CheatSearchGT(void);
static void CheatSearchLT(void);
>>>>>>> .r1856
static void FA_SkipLag(void);
static void OpenRom(void);
static void CloseRom(void);
@ -758,10 +767,19 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
{ EMUCMD_MISC_TOGGLEFULLSCREEN, EMUCMDTYPE_MISC, ToggleFullscreen, 0, 0, "Toggle Fullscreen", 0},
{ EMUCMD_TOOL_OPENRAMWATCH, EMUCMDTYPE_TOOL, LaunchRamWatch, 0, 0, "Open Ram Watch", 0},
{ EMUCMD_TOOL_OPENRAMSEARCH, EMUCMDTYPE_TOOL, LaunchRamSearch, 0, 0, "Open Ram Search", 0},
<<<<<<< .mine
{ EMUCMD_TOOL_RAMSEARCHLT, EMUCMDTYPE_TOOL, RamSearchOpLT, 0, 0, "Ram Search - Less Than", 0},
{ EMUCMD_TOOL_RAMSEARCHGT, EMUCMDTYPE_TOOL, RamSearchOpGT, 0, 0, "Ram Search - Greater Than", 0},
{ EMUCMD_TOOL_RAMSEARCHLTE, EMUCMDTYPE_TOOL, RamSearchOpLTE, 0, 0, "Ram Search - Less Than or Equal", 0},
{ EMUCMD_TOOL_RAMSEARCHGTE, EMUCMDTYPE_TOOL, RamSearchOpGTE, 0, 0, "Ram Search - Greater Than or Equal", 0},
{ EMUCMD_TOOL_RAMSEARCHEQ, EMUCMDTYPE_TOOL, RamSearchOpEQ, 0, 0, "Ram Search - Equal", 0},
{ EMUCMD_TOOL_RAMSEARCHNE, EMUCMDTYPE_TOOL, RamSearchOpNE, 0, 0, "Ram Search - Not Equal", 0},
=======
{ EMUCMD_CHEAT_SEARCHEQ, EMUCMDTYPE_TOOL, CheatSearchEQ, 0, 0, "Cheat Search Equal", 0},
{ EMUCMD_CHEAT_SEARCHNE, EMUCMDTYPE_TOOL, CheatSearchNE, 0, 0, "Cheat Search Not Equal", 0},
{ EMUCMD_CHEAT_SEARCHGT, EMUCMDTYPE_TOOL, CheatSearchGT, 0, 0, "Cheat Search Greater Than", 0},
{ EMUCMD_CHEAT_SEARCHLT, EMUCMDTYPE_TOOL, CheatSearchLT, 0, 0, "Cheat Search Less Than", 0},
>>>>>>> .r1856
};
#define NUM_EMU_CMDS (sizeof(FCEUI_CommandTable)/sizeof(FCEUI_CommandTable[0]))
@ -962,6 +980,16 @@ static void LaunchRamSearch(void)
#endif
}
<<<<<<< .mine
static void RamSearchOpLT(void) {
#ifdef WIN32
extern void SetSearchType(int SearchType);
extern void DoRamSearchOperation();
SetSearchType(0);
DoRamSearchOperation();
#endif
}
=======
static void CheatSearchEQ(void)
{
#ifdef WIN32
@ -969,7 +997,18 @@ static void CheatSearchEQ(void)
CheatDialogSearchEQ();
#endif
}
>>>>>>> .r1856
<<<<<<< .mine
static void RamSearchOpGT(void) {
#ifdef WIN32
extern void SetSearchType(int SearchType);
extern void DoRamSearchOperation();
SetSearchType(1);
DoRamSearchOperation();
#endif
}
=======
static void CheatSearchNE(void)
{
#ifdef WIN32
@ -977,7 +1016,46 @@ static void CheatSearchNE(void)
CheatDialogSearchNE();
#endif
}
>>>>>>> .r1856
<<<<<<< .mine
static void RamSearchOpLTE(void) {
#ifdef WIN32
extern void SetSearchType(int SearchType);
extern void DoRamSearchOperation();
SetSearchType(2);
DoRamSearchOperation();
#endif
}
static void RamSearchOpGTE(void) {
#ifdef WIN32
extern void SetSearchType(int SearchType);
extern void DoRamSearchOperation();
SetSearchType(3);
DoRamSearchOperation();
#endif
}
static void RamSearchOpEQ(void) {
#ifdef WIN32
extern void SetSearchType(int SearchType);
extern void DoRamSearchOperation();
SetSearchType(4);
DoRamSearchOperation();
#endif
}
static void RamSearchOpNE(void) {
#ifdef WIN32
extern void SetSearchType(int SearchType);
extern void DoRamSearchOperation();
SetSearchType(5);
DoRamSearchOperation();
#endif
}
=======
static void CheatSearchGT(void)
{
#ifdef WIN32
@ -996,6 +1074,7 @@ static void CheatSearchLT(void)
>>>>>>> .r1856
static void FA_SkipLag(void)
{
frameAdvanceLagSkip ^= 1;

View File

@ -221,10 +221,19 @@ enum EMUCMD
EMUCMD_MISC_TOGGLEFULLSCREEN,
EMUCMD_TOOL_OPENRAMWATCH,
EMUCMD_TOOL_OPENRAMSEARCH,
<<<<<<< .mine
EMUCMD_TOOL_RAMSEARCHLT,
EMUCMD_TOOL_RAMSEARCHGT,
EMUCMD_TOOL_RAMSEARCHLTE,
EMUCMD_TOOL_RAMSEARCHGTE,
EMUCMD_TOOL_RAMSEARCHEQ,
EMUCMD_TOOL_RAMSEARCHNE,
=======
EMUCMD_CHEAT_SEARCHEQ,
EMUCMD_CHEAT_SEARCHNE,
EMUCMD_CHEAT_SEARCHLT,
EMUCMD_CHEAT_SEARCHGT,
>>>>>>> .r1856
EMUCMD_MAX
};