commit cheat perks patch from rimsky82 [ https://sourceforge.net/p/fceultra/bugs/512/ ]
This commit is contained in:
parent
32774646fd
commit
3acb751ea4
|
@ -217,7 +217,6 @@ static void BMCFK23CPower(void)
|
||||||
GenMMC3Power();
|
GenMMC3Power();
|
||||||
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
|
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
|
||||||
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
|
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
|
||||||
GenMMC3Power();
|
|
||||||
SetWriteHandler(0x5000,0x5fff,BMCFK23CWrite);
|
SetWriteHandler(0x5000,0x5fff,BMCFK23CWrite);
|
||||||
SetWriteHandler(0x8000,0xFFFF,BMCFK23CHiWrite);
|
SetWriteHandler(0x8000,0xFFFF,BMCFK23CHiWrite);
|
||||||
FixMMC3PRG(MMC3_cmd);
|
FixMMC3PRG(MMC3_cmd);
|
||||||
|
@ -226,8 +225,8 @@ static void BMCFK23CPower(void)
|
||||||
|
|
||||||
static void BMCFK23CAPower(void)
|
static void BMCFK23CAPower(void)
|
||||||
{
|
{
|
||||||
GenMMC3Power();
|
|
||||||
dipswitch = 0;
|
dipswitch = 0;
|
||||||
|
GenMMC3Power();
|
||||||
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
|
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
|
||||||
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
|
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
|
||||||
SetWriteHandler(0x5000,0x5fff,BMCFK23CWrite);
|
SetWriteHandler(0x5000,0x5fff,BMCFK23CWrite);
|
||||||
|
|
|
@ -596,7 +596,7 @@ int FCEUI_DecodePAR(const char *str, int *a, int *v, int *c, int *type)
|
||||||
/* name can be NULL if the name isn't going to be changed. */
|
/* name can be NULL if the name isn't going to be changed. */
|
||||||
/* same goes for a, v, and s(except the values of each one must be <0) */
|
/* same goes for a, v, and s(except the values of each one must be <0) */
|
||||||
|
|
||||||
int FCEUI_SetCheat(uint32 which, const char *name, int32 a, int32 v, int compare,int s, int type)
|
int FCEUI_SetCheat(uint32 which, const char *name, int32 a, int32 v, int c, int s, int type)
|
||||||
{
|
{
|
||||||
struct CHEATF *next=cheats;
|
struct CHEATF *next=cheats;
|
||||||
uint32 x=0;
|
uint32 x=0;
|
||||||
|
@ -608,8 +608,7 @@ int FCEUI_SetCheat(uint32 which, const char *name, int32 a, int32 v, int compare
|
||||||
if(name)
|
if(name)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
if((t=(char *)realloc(next->name, strlen(name)+1)))
|
||||||
if((t=(char *)realloc(next->name,strlen(name)+1)))
|
|
||||||
{
|
{
|
||||||
next->name=t;
|
next->name=t;
|
||||||
strcpy(next->name,name);
|
strcpy(next->name,name);
|
||||||
|
@ -623,8 +622,8 @@ int FCEUI_SetCheat(uint32 which, const char *name, int32 a, int32 v, int compare
|
||||||
next->val=v;
|
next->val=v;
|
||||||
if(s>=0)
|
if(s>=0)
|
||||||
next->status=s;
|
next->status=s;
|
||||||
if(compare>=0)
|
if(c>=-1)
|
||||||
next->compare=compare;
|
next->compare=c;
|
||||||
next->type=type;
|
next->type=type;
|
||||||
|
|
||||||
savecheats=1;
|
savecheats=1;
|
||||||
|
|
|
@ -60,6 +60,8 @@ char GGcode[10];
|
||||||
int GGlist[GGLISTSIZE];
|
int GGlist[GGLISTSIZE];
|
||||||
static int dontupdateGG; //this eliminates recursive crashing
|
static int dontupdateGG; //this eliminates recursive crashing
|
||||||
|
|
||||||
|
bool dodecode;
|
||||||
|
|
||||||
HWND hGGConv;
|
HWND hGGConv;
|
||||||
|
|
||||||
void EncodeGG(char *str, int a, int v, int c);
|
void EncodeGG(char *str, int a, int v, int c);
|
||||||
|
@ -91,13 +93,19 @@ char *U8ToStr(uint8 a) {
|
||||||
|
|
||||||
static HWND hwndLB;
|
static HWND hwndLB;
|
||||||
//int RedoCheatsCallB(char *name, uint32 a, uint8 v, int s) { //bbit edited: this commented out line was changed to the below for the new fceud
|
//int RedoCheatsCallB(char *name, uint32 a, uint8 v, int s) { //bbit edited: this commented out line was changed to the below for the new fceud
|
||||||
int RedoCheatsCallB(char *name, uint32 a, uint8 v, int compare,int s,int type,void*data) {
|
int RedoCheatsCallB(char *name, uint32 a, uint8 v, int c, int s, int type, void*data) {
|
||||||
char str[259] = { 0 };
|
char str[259] = { 0 };
|
||||||
|
|
||||||
//strcpy(str,(s?"* ":" "));
|
strcpy(str,(s?"* ":" "));
|
||||||
//strcat(str,name);
|
if(name[0] == 0) {
|
||||||
if(name[0] == 0)sprintf(str,"%s%04X=%02X",s?"* ":" ",(int)a,(int)v);
|
if(a >= 0x8000) {
|
||||||
else sprintf(str,"%s%s",s?"* ":" ",name);
|
EncodeGG(str+2, a, v, c);
|
||||||
|
} else {
|
||||||
|
if(c == -1) sprintf(str+2,"%04X:%02X",(int)a,(int)v);
|
||||||
|
else sprintf(str+2,"%04X?%02X:%02X",(int)a,(int)c,(int)v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else strcat(str,name);
|
||||||
|
|
||||||
SendDlgItemMessage(hwndLB,IDC_LIST_CHEATS,LB_ADDSTRING,0,(LPARAM)(LPSTR)str);
|
SendDlgItemMessage(hwndLB,IDC_LIST_CHEATS,LB_ADDSTRING,0,(LPARAM)(LPSTR)str);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -157,6 +165,7 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
char *name;
|
char *name;
|
||||||
uint32 a;
|
uint32 a;
|
||||||
uint8 v;
|
uint8 v;
|
||||||
|
int c;
|
||||||
int s;
|
int s;
|
||||||
|
|
||||||
switch (uMsg) {
|
switch (uMsg) {
|
||||||
|
@ -175,6 +184,7 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_ADDR,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_ADDR,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
||||||
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_COM,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL_KNOWN,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL_KNOWN,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_LIST_POSSIBILITIES,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_LIST_POSSIBILITIES,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL_NE_BY,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL_NE_BY,WM_SETFONT,(WPARAM)hNewFont,FALSE);
|
||||||
|
@ -184,6 +194,7 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
//text limits
|
//text limits
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_ADDR,EM_SETLIMITTEXT,4,0);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_ADDR,EM_SETLIMITTEXT,4,0);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL,EM_SETLIMITTEXT,2,0);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL,EM_SETLIMITTEXT,2,0);
|
||||||
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_COM,EM_SETLIMITTEXT,2,0);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_NAME,EM_SETLIMITTEXT,256,0);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_NAME,EM_SETLIMITTEXT,256,0);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL_KNOWN,EM_SETLIMITTEXT,2,0);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL_KNOWN,EM_SETLIMITTEXT,2,0);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL_NE_BY,EM_SETLIMITTEXT,2,0);
|
SendDlgItemMessage(hwndDlg,IDC_CHEAT_VAL_NE_BY,EM_SETLIMITTEXT,2,0);
|
||||||
|
@ -402,14 +413,34 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDC_BTN_CHEAT_ADD:
|
case IDC_BTN_CHEAT_ADD:
|
||||||
|
dodecode = true;
|
||||||
|
|
||||||
GetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,str,5);
|
GetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,str,5);
|
||||||
|
if(str[0] != 0) dodecode = false;
|
||||||
a=StrToU16(str);
|
a=StrToU16(str);
|
||||||
GetDlgItemText(hwndDlg,IDC_CHEAT_VAL,str,3);
|
GetDlgItemText(hwndDlg,IDC_CHEAT_VAL,str,3);
|
||||||
|
if(str[0] != 0) dodecode = false;
|
||||||
v=StrToU8(str);
|
v=StrToU8(str);
|
||||||
|
GetDlgItemText(hwndDlg,IDC_CHEAT_COM,str,3);
|
||||||
|
if(str[0] != 0) dodecode = false;
|
||||||
|
c=(str[0] == 0)?-1:StrToU8(str);
|
||||||
GetDlgItemText(hwndDlg,IDC_CHEAT_NAME,str,256);
|
GetDlgItemText(hwndDlg,IDC_CHEAT_NAME,str,256);
|
||||||
|
if(dodecode && (strlen(str) == 6 || strlen(str) == 8)) {
|
||||||
|
if(FCEUI_DecodeGG(str, &GGaddr, &GGval, &GGcomp)) {
|
||||||
|
a = GGaddr;
|
||||||
|
v = GGval;
|
||||||
|
c = GGcomp;
|
||||||
|
}
|
||||||
|
}
|
||||||
// if (FCEUI_AddCheat(str,a,v)) { //bbit edited: replaced this with the line below
|
// if (FCEUI_AddCheat(str,a,v)) { //bbit edited: replaced this with the line below
|
||||||
if (FCEUI_AddCheat(str,a,v,-1,1)) {
|
if (FCEUI_AddCheat(str,a,v,c,1)) {
|
||||||
if(str[0] == 0)sprintf(str,"%04X=%02X",(int)a,(int)v); //bbit edited: added this line to give your cheat a name if you didn't supply one
|
if(str[0] == 0) {
|
||||||
|
if(a >= 0x8000) EncodeGG(str, a, v, c);
|
||||||
|
else {
|
||||||
|
if(c == -1) sprintf(str,"%04X:%02X",(int)a,(int)v); //bbit edited: added this line to give your cheat a name if you didn't supply one
|
||||||
|
else sprintf(str,"%04X?%02X:%02X",(int)a,(int)c,(int)v);
|
||||||
|
}
|
||||||
|
}
|
||||||
strcpy(str2,"* ");
|
strcpy(str2,"* ");
|
||||||
strcat(str2,str);
|
strcat(str2,str);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_ADDSTRING,0,(LPARAM)(LPSTR)str2);
|
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_ADDSTRING,0,(LPARAM)(LPSTR)str2);
|
||||||
|
@ -417,9 +448,11 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_SETCURSEL,selcheat,0);
|
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_SETCURSEL,selcheat,0);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_SETSEL,(WPARAM)1,selcheat);
|
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_SETSEL,(WPARAM)1,selcheat);
|
||||||
|
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)U16ToStr(a));
|
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)"");
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)U8ToStr(v));
|
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)"");
|
||||||
|
SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)"");
|
||||||
|
SetDlgItemText(hwndDlg,IDC_CHEAT_NAME,(LPTSTR)"");
|
||||||
|
|
||||||
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_DEL),TRUE);
|
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_DEL),TRUE);
|
||||||
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_UPD),TRUE);
|
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_UPD),TRUE);
|
||||||
}
|
}
|
||||||
|
@ -439,6 +472,7 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
}
|
}
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)"");
|
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)"");
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)"");
|
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)"");
|
||||||
|
SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)"");
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_NAME,(LPTSTR)"");
|
SetDlgItemText(hwndDlg,IDC_CHEAT_NAME,(LPTSTR)"");
|
||||||
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_DEL),FALSE);
|
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_DEL),FALSE);
|
||||||
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_UPD),FALSE);
|
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_UPD),FALSE);
|
||||||
|
@ -452,6 +486,7 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
selcheat=-1;
|
selcheat=-1;
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)"");
|
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)"");
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)"");
|
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)"");
|
||||||
|
SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)"");
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_NAME,(LPTSTR)"");
|
SetDlgItemText(hwndDlg,IDC_CHEAT_NAME,(LPTSTR)"");
|
||||||
}
|
}
|
||||||
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_DEL),FALSE);
|
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_DEL),FALSE);
|
||||||
|
@ -461,19 +496,38 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDC_BTN_CHEAT_UPD:
|
case IDC_BTN_CHEAT_UPD:
|
||||||
if (selcheat < 0) break;
|
dodecode = true;
|
||||||
|
|
||||||
|
if (selcheat < 0) break;
|
||||||
GetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,str,5);
|
GetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,str,5);
|
||||||
|
if(str[0] != 0) dodecode = false;
|
||||||
a=StrToU16(str);
|
a=StrToU16(str);
|
||||||
GetDlgItemText(hwndDlg,IDC_CHEAT_VAL,str,3);
|
GetDlgItemText(hwndDlg,IDC_CHEAT_VAL,str,3);
|
||||||
|
if(str[0] != 0) dodecode = false;
|
||||||
v=StrToU8(str);
|
v=StrToU8(str);
|
||||||
|
GetDlgItemText(hwndDlg,IDC_CHEAT_COM,str,3);
|
||||||
|
if(str[0] != 0) dodecode = false;
|
||||||
|
c=(str[0] == 0)?-1:StrToU8(str);
|
||||||
GetDlgItemText(hwndDlg,IDC_CHEAT_NAME,str,256);
|
GetDlgItemText(hwndDlg,IDC_CHEAT_NAME,str,256);
|
||||||
|
if(dodecode && (strlen(str) == 6 || strlen(str) == 8)) {
|
||||||
|
if(FCEUI_DecodeGG(str, &GGaddr, &GGval, &GGcomp)) {
|
||||||
|
a = GGaddr;
|
||||||
|
v = GGval;
|
||||||
|
c = GGcomp;
|
||||||
|
}
|
||||||
|
}
|
||||||
// FCEUI_SetCheat(selcheat,str,a,v,-1); //bbit edited: replaced this with the line below
|
// FCEUI_SetCheat(selcheat,str,a,v,-1); //bbit edited: replaced this with the line below
|
||||||
FCEUI_SetCheat(selcheat,str,a,v,-1,-1,1);
|
FCEUI_SetCheat(selcheat,str,a,v,c,-1,1);
|
||||||
// FCEUI_GetCheat(selcheat,&name,&a,&v,&s); //bbit edited: replaced this with the line below
|
// FCEUI_GetCheat(selcheat,&name,&a,&v,&s); //bbit edited: replaced this with the line below
|
||||||
FCEUI_GetCheat(selcheat,&name,&a,&v,NULL,&s,NULL);
|
FCEUI_GetCheat(selcheat,&name,&a,&v,&c,&s,NULL);
|
||||||
strcpy(str2,(s?"* ":" "));
|
strcpy(str2,(s?"* ":" "));
|
||||||
if(str[0] == 0)sprintf(str,"%04X=%02X",(int)a,(int)v); //bbit edited: added this line to give your cheat a name if you didn't supply one
|
if(str[0] == 0) {
|
||||||
|
if(a >= 0x8000) EncodeGG(str, a, v, c);
|
||||||
|
else {
|
||||||
|
if(c == -1) sprintf(str,"%04X:%02X",(int)a,(int)v); //bbit edited: added this line to give your cheat a name if you didn't supply one
|
||||||
|
else sprintf(str,"%04X?%02X:%02X",(int)a,(int)c,(int)v);
|
||||||
|
}
|
||||||
|
}
|
||||||
strcat(str2,str);
|
strcat(str2,str);
|
||||||
|
|
||||||
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_DELETESTRING,selcheat,0);
|
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_DELETESTRING,selcheat,0);
|
||||||
|
@ -483,6 +537,8 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)U16ToStr(a));
|
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)U16ToStr(a));
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)U8ToStr(v));
|
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)U8ToStr(v));
|
||||||
|
if(c == -1) SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)"");
|
||||||
|
else SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)U8ToStr(c));
|
||||||
if(hMemView)UpdateColorTable(); //if the memory viewer is open then update any blue freeze locations in it as well
|
if(hMemView)UpdateColorTable(); //if the memory viewer is open then update any blue freeze locations in it as well
|
||||||
break;
|
break;
|
||||||
case IDC_BTN_CHEAT_RESET:
|
case IDC_BTN_CHEAT_RESET:
|
||||||
|
@ -554,13 +610,18 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
for (int selcheattemp=SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_GETCOUNT,0,0)-1;selcheattemp>=0;selcheattemp--) {
|
for (int selcheattemp=SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_GETCOUNT,0,0)-1;selcheattemp>=0;selcheattemp--) {
|
||||||
if (SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_GETSEL,selcheattemp,0)) {
|
if (SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_GETSEL,selcheattemp,0)) {
|
||||||
// FCEUI_GetCheat(selcheattemp,&name,&a,&v,&s); //bbit edited: replaced this with the line below
|
// FCEUI_GetCheat(selcheattemp,&name,&a,&v,&s); //bbit edited: replaced this with the line below
|
||||||
FCEUI_GetCheat(selcheattemp,&name,&a,&v,NULL,&s,NULL);
|
FCEUI_GetCheat(selcheattemp,&name,&a,&v,&c,&s,NULL);
|
||||||
// FCEUI_SetCheat(selcheattemp,0,-1,-1,s^=1);//bbit edited: replaced this with the line below
|
// FCEUI_SetCheat(selcheattemp,0,-1,-1,s^=1);//bbit edited: replaced this with the line below
|
||||||
FCEUI_SetCheat(selcheattemp,0,-1,-1,-1,s^=1,1);
|
FCEUI_SetCheat(selcheattemp,0,-1,-1,-1,s^=1,1);
|
||||||
if(name[0] == 0)sprintf(str,"%s%04X=%02X",s?"* ":" ",(unsigned int)a,(unsigned int)v);
|
strcpy(str,(s?"* ":" "));
|
||||||
else sprintf(str,"%s%s",s?"* ":" ",name);
|
if(name[0] == 0) {
|
||||||
//strcpy(str,(s?"* ":" "));
|
if(a >= 0x8000) EncodeGG(str+2, a, v, c);
|
||||||
//strcat(str,name);
|
else {
|
||||||
|
if(c == -1) sprintf(str+2,"%04X:%02X",(int)a,(int)v); //bbit edited: added this line to give your cheat a name if you didn't supply one
|
||||||
|
else sprintf(str+2,"%04X?%02X:%02X",(int)a,(int)c,(int)v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else strcat(str,name);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_DELETESTRING,selcheattemp,0);
|
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_DELETESTRING,selcheattemp,0);
|
||||||
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_INSERTSTRING,selcheattemp,(LPARAM)(LPSTR)str);
|
SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_INSERTSTRING,selcheattemp,(LPARAM)(LPSTR)str);
|
||||||
}
|
}
|
||||||
|
@ -579,10 +640,12 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
selcheatcount = SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_GETSELCOUNT,0,0);
|
selcheatcount = SendDlgItemMessage(hwndDlg,IDC_LIST_CHEATS,LB_GETSELCOUNT,0,0);
|
||||||
if (selcheat < 0) break;
|
if (selcheat < 0) break;
|
||||||
|
|
||||||
FCEUI_GetCheat(selcheat,&name,&a,&v,NULL,&s,NULL);
|
FCEUI_GetCheat(selcheat,&name,&a,&v,&c,&s,NULL);
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_NAME,(LPTSTR)name);
|
SetDlgItemText(hwndDlg,IDC_CHEAT_NAME,(LPTSTR)name);
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)U16ToStr(a));
|
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)U16ToStr(a));
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)U8ToStr(v));
|
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)U8ToStr(v));
|
||||||
|
if(c == -1) SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)"");
|
||||||
|
else SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)U8ToStr(c));
|
||||||
|
|
||||||
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_DEL),TRUE);
|
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_DEL),TRUE);
|
||||||
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_UPD),TRUE);
|
EnableWindow(GetDlgItem(hwndDlg,IDC_BTN_CHEAT_UPD),TRUE);
|
||||||
|
@ -601,6 +664,7 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)str2);
|
SetDlgItemText(hwndDlg,IDC_CHEAT_ADDR,(LPTSTR)str2);
|
||||||
strcpy(str2,str+13);
|
strcpy(str2,str+13);
|
||||||
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)str2);
|
SetDlgItemText(hwndDlg,IDC_CHEAT_VAL,(LPTSTR)str2);
|
||||||
|
SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)"");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -802,6 +866,8 @@ BOOL CALLBACK GGConvCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
SetDlgItemText(hCheat,IDC_CHEAT_ADDR,(LPTSTR)U16ToStr(GGaddr));
|
SetDlgItemText(hCheat,IDC_CHEAT_ADDR,(LPTSTR)U16ToStr(GGaddr));
|
||||||
SetDlgItemText(hCheat,IDC_CHEAT_VAL,(LPTSTR)U8ToStr(GGval));
|
SetDlgItemText(hCheat,IDC_CHEAT_VAL,(LPTSTR)U8ToStr(GGval));
|
||||||
|
if(GGcomp == -1) SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)"");
|
||||||
|
else SetDlgItemText(hwndDlg,IDC_CHEAT_COM,(LPTSTR)U8ToStr(GGcomp));
|
||||||
|
|
||||||
EnableWindow(GetDlgItem(hCheat,IDC_BTN_CHEAT_DEL),TRUE);
|
EnableWindow(GetDlgItem(hCheat,IDC_BTN_CHEAT_DEL),TRUE);
|
||||||
EnableWindow(GetDlgItem(hCheat,IDC_BTN_CHEAT_UPD),TRUE);
|
EnableWindow(GetDlgItem(hCheat,IDC_BTN_CHEAT_UPD),TRUE);
|
||||||
|
|
|
@ -1667,15 +1667,17 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_
|
||||||
CAPTION "Cheat Search"
|
CAPTION "Cheat Search"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
GROUPBOX "Active Cheats",201,3,1,133,168,WS_TABSTOP
|
GROUPBOX "Active Cheats",201,1,1,133,168,WS_TABSTOP
|
||||||
GROUPBOX "Cheat Search",202,139,1,238,168,WS_TABSTOP
|
GROUPBOX "Cheat Search",202,139,1,238,168,WS_TABSTOP
|
||||||
LISTBOX IDC_LIST_CHEATS,12,14,115,110,LBS_EXTENDEDSEL | WS_VSCROLL
|
LISTBOX IDC_LIST_CHEATS,12,14,115,110,LBS_EXTENDEDSEL | WS_VSCROLL
|
||||||
LTEXT "Name:",IDC_STATIC,12,118,22,10
|
LTEXT "Name:",IDC_STATIC,12,118,22,10
|
||||||
LTEXT "Address:",IDC_STATIC,12,134,28,10
|
LTEXT "A:",IDC_STATIC,12,134,8,10
|
||||||
LTEXT "Value:",IDC_STATIC,85,134,21,10
|
LTEXT "V:",IDC_STATIC,59,134,8,10
|
||||||
|
LTEXT "C:",IDC_STATIC,96,134,8,10
|
||||||
EDITTEXT IDC_CHEAT_NAME,35,116,92,12,ES_AUTOHSCROLL | ES_WANTRETURN
|
EDITTEXT IDC_CHEAT_NAME,35,116,92,12,ES_AUTOHSCROLL | ES_WANTRETURN
|
||||||
EDITTEXT IDC_CHEAT_ADDR,42,132,30,12,ES_UPPERCASE | ES_WANTRETURN
|
EDITTEXT IDC_CHEAT_ADDR,21,132,32,12,ES_UPPERCASE | ES_WANTRETURN
|
||||||
EDITTEXT IDC_CHEAT_VAL,107,132,20,12,ES_UPPERCASE | ES_WANTRETURN
|
EDITTEXT IDC_CHEAT_VAL,70,132,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||||
|
EDITTEXT IDC_CHEAT_COM,107,132,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||||
DEFPUSHBUTTON "Add",IDC_BTN_CHEAT_ADD,12,148,35,16
|
DEFPUSHBUTTON "Add",IDC_BTN_CHEAT_ADD,12,148,35,16
|
||||||
PUSHBUTTON "Delete",IDC_BTN_CHEAT_DEL,52,148,35,16
|
PUSHBUTTON "Delete",IDC_BTN_CHEAT_DEL,52,148,35,16
|
||||||
PUSHBUTTON "Update",IDC_BTN_CHEAT_UPD,92,148,35,16
|
PUSHBUTTON "Update",IDC_BTN_CHEAT_UPD,92,148,35,16
|
||||||
|
|
|
@ -126,6 +126,8 @@
|
||||||
#define IDC_CHECK_LOG_PROCESSOR_STATUS 111
|
#define IDC_CHECK_LOG_PROCESSOR_STATUS 111
|
||||||
#define IDC_DEBUGGER_RELOAD_SYMS 111
|
#define IDC_DEBUGGER_RELOAD_SYMS 111
|
||||||
#define IDC_ROMPATCHER_BTN_SAVE 111
|
#define IDC_ROMPATCHER_BTN_SAVE 111
|
||||||
|
#define IDC_CHEAT_VAL2 111
|
||||||
|
#define IDC_CHEAT_COM 111
|
||||||
#define BTN_AUTO_HOLD 112
|
#define BTN_AUTO_HOLD 112
|
||||||
#define IDC_BTN_LOG_BROWSE 112
|
#define IDC_BTN_LOG_BROWSE 112
|
||||||
#define IDC_DEBUGGER_BOOKMARK_ADD 112
|
#define IDC_DEBUGGER_BOOKMARK_ADD 112
|
||||||
|
|
Loading…
Reference in New Issue