bugfix: [1959910] Cheats menu - add - double click ram address sends to mwatch

This commit is contained in:
mauzus 2008-05-16 02:49:38 +00:00
parent 0b112b5ef4
commit e85df098d6
4 changed files with 29 additions and 4 deletions

View File

@ -21,6 +21,7 @@
#include "common.h"
#include "cheat.h"
#include "memview.h"
#include "memwatch.h"
#include "debugger.h"
#include "..\..\fceu.h"
#include "..\..\cart.h"
@ -424,6 +425,13 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
break;
case LBN_DBLCLK:
switch (LOWORD(wParam)) { //disable/enable cheat
case 106:
lbfocus=1;
SendDlgItemMessage(hwndDlg,106,LB_GETTEXT,SendDlgItemMessage(hwndDlg,106,LB_GETCURSEL,0,0),(LPARAM)(LPCTSTR)str);
strcpy(str2,str+1);
str2[4] = 0;
AddMemWatch(str2);
break;
case 101:
// FCEUI_GetCheat(selcheat,&name,&a,&v,&s); //bbit edited: replaced this with the line below
FCEUI_GetCheat(selcheat,&name,&a,&v,NULL,&s,NULL);

View File

@ -500,7 +500,9 @@ static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
}
//Open the Memory Watch dialog
void CreateMemWatch(HWND parent)
void CreateMemWatch()
//void CreateMemWatch(HWND parent) - adelikat: old code made use of this but parent was only used in a line commented out. Taking out for my own needs :P
{
if(NeedsInit) //Clear the strings
{
@ -538,4 +540,18 @@ void CreateMemWatch(HWND parent)
}
}
}
void AddMemWatch(char memaddress[32])
{
char TempArray[32];
int i;
CreateMemWatch();
for(i = 0; i < 24; i++)
{
GetDlgItemText(hwndMemWatch,1001+i*3,TempArray,32);
if (TempArray[0] == 0)
{
SetDlgItemText(hwndMemWatch,1001+i*3,memaddress);
break;
}
}
}

View File

@ -1,3 +1,4 @@
void UpdateMemWatch();
void CreateMemWatch(HWND parent);
void CreateMemWatch();
void AddMemWatch(char memaddress[32]);
extern char * MemWatchDir;

View File

@ -1004,7 +1004,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
//case 204:ConfigAddCheat(hWnd);break; //mbg merge TODO 7/17/06 - had to remove this
case MENU_MEMORY_WATCH:
CreateMemWatch(hWnd);
CreateMemWatch();
break;
case MENU_OPEN_FILE: