Cheat console:

1. Added a global switch for all cheats, it is checked by default. Check or uncheck it can quickly tweak all cheats enabled or disabled. It's not game specific and effective to all games.
2. Added a checkmark to check behaviour of automatically load cheats.
3. Fixed a wierd bug in loading names of cheats from file.
iNES Header Editor:
4. Disable iNES header editor menu when currently loaded game is not in iNES format.
Others:
5. Some of the checkbox passed parameter MF_CHECKED, the right one is BST_CHECKED, though they have the same value.
6. Code/Data Logger is created by CreateDialog(), but destroyed by EndDialog()? A non-modal window should be destroy by DestroyWindow(), EndDialog() is for DialogBox(). It seems nobody noticed this bug for years.
7. Detail.

Currently there are some opposite tweaks in the config file for the new feature in cheat console, for example the unchcecked state is 1 in config file, that's for backward compatibility.
The iNES header editor might not quite stable as newly baked from the oven, there might be some improvements to its code.
This commit is contained in:
owomomo 2019-06-12 22:16:01 +08:00
parent fb1d489cfa
commit 29b36a801d
5 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,5 @@
#ifndef CHEAT_H
#define CHEAT_H
void FCEU_CheatResetRAM(void);
void FCEU_CheatAddRAM(int s, uint32 A, uint8 *p);
@ -59,3 +61,4 @@ struct SEARCHPOSSIBLE {
for (int i = 0; i < numsubcheats && count < size; ++i) \
if (SubCheats[i].addr >= address && SubCheats[i].addr < address + size) \
++count
#endif

View File

@ -192,7 +192,6 @@ int FCEUI_AddCheat(const char *name, uint32 addr, uint8 val, int compare, int ty
int FCEUI_DelCheat(uint32 which);
int FCEUI_ToggleCheat(uint32 which);
int FCEUI_GlobalToggleCheat(int global_enable);
void FCEU_SaveGameCheats(FILE *fp, int release = 0);
int32 FCEUI_CheatSearchGetCount(void);
void FCEUI_CheatSearchGetRange(uint32 first, uint32 last, int (*callb)(uint32 a, uint8 last, uint8 current));

View File

@ -17,5 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef COMMON_CHEAT_H
#define COMMON_CHEAT_H
void DoConsoleCheatConfig(void);
#endif

View File

@ -975,8 +975,9 @@ void UpdateCheatListGroupBoxUI()
EnableWindow(GetDlgItem(hCheat, IDC_BTN_CHEAT_ADD), FALSE);
EnableWindow(GetDlgItem(hCheat, IDC_BTN_CHEAT_ADDFROMFILE), FALSE);
}
SetDlgItemText(hCheat, IDC_GROUPBOX_CHEATLIST, temp);
EnableWindow(GetDlgItem(hCheat, IDC_BTN_CHEAT_EXPORTTOFILE), cheats != 0);
}
//Used by cheats and external dialogs such as hex editor to update items in the cheat search dialog

View File

@ -1,5 +1,7 @@
//--
//mbg merge 7/18/06 had to make these extern
#ifndef WIN_CHEAT_H
#define WIN_CHEAT_H
extern int CheatWindow,CheatStyle; //bbit edited: this line added
extern HWND hCheat;
@ -44,4 +46,4 @@ SetDlgItemText(hwnd, IDC_CHEAT_VAL, (LPTSTR)"") & \
SetDlgItemText(hwnd, IDC_CHEAT_COM, (LPTSTR)"") & \
SetDlgItemText(hwnd, IDC_CHEAT_NAME, (LPTSTR)"") & \
SetDlgItemText(hwnd, IDC_CHEAT_TEXT, (LPTSTR)""))
#endif