don't save built-in cheats (vf4 dimm check)
This commit is contained in:
parent
e0058c17ff
commit
ac71970561
|
@ -398,6 +398,7 @@ void CheatManager::reset(const std::string& gameId)
|
||||||
{
|
{
|
||||||
setActive(true);
|
setActive(true);
|
||||||
cheats.emplace_back(Cheat::Type::setValue, "Skip DIMM version check", true, 16, 0x000205c6, 9);
|
cheats.emplace_back(Cheat::Type::setValue, "Skip DIMM version check", true, 16, 0x000205c6, 9);
|
||||||
|
cheats.back().builtIn = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config::WidescreenGameHacks)
|
if (config::WidescreenGameHacks)
|
||||||
|
@ -789,10 +790,11 @@ void CheatManager::saveCheatFile(const std::string& filename)
|
||||||
#ifndef LIBRETRO
|
#ifndef LIBRETRO
|
||||||
emucfg::ConfigFile cfg;
|
emucfg::ConfigFile cfg;
|
||||||
|
|
||||||
cfg.set_int("", "cheats", cheats.size());
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (const Cheat& cheat : cheats)
|
for (const Cheat& cheat : cheats)
|
||||||
{
|
{
|
||||||
|
if (cheat.builtIn)
|
||||||
|
continue;
|
||||||
std::string prefix = "cheat" + std::to_string(i) + "_";
|
std::string prefix = "cheat" + std::to_string(i) + "_";
|
||||||
cfg.set_int("", prefix + "address", cheat.address);
|
cfg.set_int("", prefix + "address", cheat.address);
|
||||||
cfg.set_int("", prefix + "address_bit_position", cheat.valueMask);
|
cfg.set_int("", prefix + "address_bit_position", cheat.valueMask);
|
||||||
|
@ -832,6 +834,7 @@ void CheatManager::saveCheatFile(const std::string& filename)
|
||||||
cfg.set_int("", prefix + "repeat_add_to_address", cheat.repeatAddressIncrement);
|
cfg.set_int("", prefix + "repeat_add_to_address", cheat.repeatAddressIncrement);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
cfg.set_int("", "cheats", i);
|
||||||
FILE *fp = nowide::fopen(filename.c_str(), "w");
|
FILE *fp = nowide::fopen(filename.c_str(), "w");
|
||||||
if (fp == nullptr)
|
if (fp == nullptr)
|
||||||
throw FlycastException("Can't save cheat file");
|
throw FlycastException("Can't save cheat file");
|
||||||
|
|
|
@ -53,12 +53,14 @@ struct Cheat
|
||||||
u32 repeatValueIncrement;
|
u32 repeatValueIncrement;
|
||||||
u32 repeatAddressIncrement;
|
u32 repeatAddressIncrement;
|
||||||
u32 destAddress;
|
u32 destAddress;
|
||||||
|
bool builtIn;
|
||||||
|
|
||||||
Cheat(Type type = Type::disabled, const std::string& description = "", bool enabled = false, u32 size = 0, u32 address = 0,
|
Cheat(Type type = Type::disabled, const std::string& description = "", bool enabled = false, u32 size = 0, u32 address = 0,
|
||||||
u8 valueMask = 0, u32 repeatCount = 1, u32 repeatValueIncrement = 0,
|
u8 valueMask = 0, u32 repeatCount = 1, u32 repeatValueIncrement = 0,
|
||||||
u32 repeatAddressIncrement = 0, u32 destAddress = 0)
|
u32 repeatAddressIncrement = 0, u32 destAddress = 0, bool builtIn = false)
|
||||||
: type(type), description(description), enabled(enabled), size(size), address(address), valueMask(valueMask),
|
: type(type), description(description), enabled(enabled), size(size), address(address), valueMask(valueMask),
|
||||||
repeatCount(repeatCount), repeatValueIncrement(repeatValueIncrement), repeatAddressIncrement(repeatAddressIncrement), destAddress(destAddress)
|
repeatCount(repeatCount), repeatValueIncrement(repeatValueIncrement), repeatAddressIncrement(repeatAddressIncrement),
|
||||||
|
destAddress(destAddress), builtIn(builtIn)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue