Major overhaul to cheats, most processing has been moved to Cheats_Preprocessor

Cheat has received the ability to have Special Option (Address replacement) and Multiple Option (Both Address and Value replacement)
These are internal names for reference only, it will still use _O and .exten (cdb and rds respectively) for the files

The interface for the Cheat Manager also received a slight overhaul, it should better handle input (There were cases that caused crashes) and it takes into account the new formats (To disable/enable the interface buttons appropriately)

Cheat support for Ranges has been dropped, these were never used so I saw no reason to keep it

As always this is a work in progress and issues will be corrected as they are found.
This commit is contained in:
rgarciaz80
2021-06-17 08:39:32 -05:00
parent 5a041430f4
commit a40e398a1f
137 changed files with 19084 additions and 1378 deletions

View File

@ -198,9 +198,7 @@ void FileStuff::AddSettingValue(char* id, char* setting, char* value) {
strcpy(delstr, setting);
if (value != NULL && strlen(value) != 0)
sprintf(delstr, "%s=", setting);
else
sprintf(delstr, "%s", setting);
strcat(delstr, "=");
RemoveSetting(id, delstr);
@ -730,7 +728,7 @@ bool Entry::IsGameHeader(string str) {
continue;
else {
if (format[i] == 'X') {
if ((str[i] >= '0' && str[i] <= '9') || (str[i] >= 'A' && str[i] <= 'F') || (str[i] >= 'a' && str[i] <= 'f'))
if (isxdigit(str[i]))
continue;
}
@ -769,7 +767,17 @@ Entry::read_states Entry::StoreData(string str) {
if (str.length() >= 2 && str[0] == '/' && str[1] == '/')
can_be_sorted = false;
data.push_back(str);
if (can_be_sorted) {
// Basic insertion sort
for (int i = 0; i < data.size(); i++) {
if ((*(data.begin() + i)).compare(str) == 0) {
}
}
data.insert(data.begin(), str);
}
else
data.push_back(str);
return read_states::GOOD;
}
}