Raised the maximum number of cheats allowed from 100 to 16384.

This commit is contained in:
skidau 2015-05-18 05:37:37 +00:00
parent fb83452291
commit 77de248b71
7 changed files with 19 additions and 15 deletions

View File

@ -14,6 +14,8 @@
# include <getopt.h>
#endif // ! __GNUC__
#define MAX_CHEATS 16384
extern bool cpuIsMultiBoot;
extern bool mirroringEnable;
extern bool parseDebug;
@ -137,7 +139,6 @@ extern u32 movieLastJoypad;
extern u32 movieNextJoypad;
extern int throttle;
#define MAX_CHEATS 100
extern int preparedCheats;
extern const char* preparedCheatCodes[MAX_CHEATS];

View File

@ -12,7 +12,7 @@
#include "gb.h"
#include "../common/ConfigManager.h"
gbCheat gbCheatList[100];
gbCheat gbCheatList[MAX_CHEATS];
int gbCheatNumber = 0;
int gbNextCheat = 0;
bool gbCheatMap[0x10000];

View File

@ -2,6 +2,7 @@
#define GBCHEATS_H
#include "../System.h"
#include "../common/ConfigManager.h"
struct gbXxCheat {
char cheatDesc[100];
@ -38,7 +39,7 @@ bool gbVerifyGgCode(const char *code);
extern int gbCheatNumber;
extern gbCheat gbCheatList[100];
extern gbCheat gbCheatList[MAX_CHEATS];
extern bool gbCheatMap[0x10000];
#endif // GBCHEATS_H

View File

@ -178,7 +178,7 @@
#define CHEATS_16_BIT_WRITE 114
#define CHEATS_32_BIT_WRITE 115
CheatsData cheatsList[100];
CheatsData cheatsList[MAX_CHEATS];
int cheatsNumber = 0;
u32 rompatch2addr [4];
u16 rompatch2val [4];
@ -1314,7 +1314,7 @@ void cheatsAdd(const char *codeStr,
int code,
int size)
{
if(cheatsNumber < 100) {
if(cheatsNumber < MAX_CHEATS) {
int x = cheatsNumber;
cheatsList[x].code = code;
cheatsList[x].size = size;

View File

@ -1,6 +1,8 @@
#ifndef CHEATS_H
#define CHEATS_H
#include "../common/ConfigManager.h"
struct CheatsData {
int code;
int size;
@ -36,6 +38,6 @@ void cheatsWriteByte(u32 address, u8 value);
int cheatsCheckKeys(u32 keys, u32 extended);
extern int cheatsNumber;
extern CheatsData cheatsList[100];
extern CheatsData cheatsList[MAX_CHEATS];
#endif // CHEATS_H

View File

@ -33,17 +33,17 @@ typedef struct {
} RTCCLOCKDATA;
static RTCCLOCKDATA rtcClockData;
static bool rtcEnabled = true;
static bool rtcClockEnabled = true;
static bool rtcRumbleEnabled = false;
void rtcEnable(bool e)
{
rtcEnabled = e;
rtcClockEnabled = e;
}
bool rtcIsEnabled()
{
return rtcEnabled;
return rtcClockEnabled;
}
void rtcEnableRumble(bool e)
@ -80,7 +80,7 @@ u16 rtcRead(u32 address)
return ((v >> rtcClockData.reserved[11]) & 1) << 2;
}
// Real Time Clock
else if (rtcEnabled) {
else if (rtcClockEnabled) {
//sprintf(DebugStr, "Reading RTC %02x, %02x, %02x", rtcClockData.byte0, rtcClockData.byte1, rtcClockData.byte2);
return rtcClockData.byte0;
}

View File

@ -267,7 +267,7 @@ public:
{
wxString line = text.ReadLine().Trim();
if (line.Contains(wxT("[")))
if (line.Contains(wxT("[")) && !line.Contains(wxT("=")))
{
cheat_desc = line.AfterFirst('[').BeforeLast(']');
}
@ -599,10 +599,10 @@ public:
if (ncodes > id + 1)
{
wxString codes[100];
wxString descs[100];
bool checked[100];
bool v3[100];
wxString codes[MAX_CHEATS];
wxString descs[MAX_CHEATS];
bool checked[MAX_CHEATS];
bool v3[MAX_CHEATS];
for (int i = id + 1; i < ncodes; i++)
{