GameDB: key patches by their CRC or `default` to prevent duplicates

GameDB: Regenerate GameDB file


GameDB: Fix typos in gamefix names
This commit is contained in:
Tyler Wilding 2020-11-19 19:53:29 -05:00 committed by refractionpcsx2
parent 279dfd741a
commit e90046d8a2
3 changed files with 1763 additions and 520 deletions

View File

@ -69,15 +69,13 @@ SERIAL-12345: # !required! Serial number for the game, this is how games are loo
- "SERIAL-123"
- "SERIAL-456"
# You can define multple patches, but they are identified by the CRC.
# A duplicate CRC will throw a validation error at startup in the console
# If the CRC is omitted, the crc will be set internally to 'default'
patches:
- crc: "CRC-1"
default: # Default CRC!
author: "Some Person"
content: |- # !required! This allows for multi-line strings in YAML, this type preserves new-line characters
comment=Sample Patch
patch=1,EE,00000002,word,00000000
- crc: "CRC-2"
"crc-1": # Specific CRC Patch!
author: "Some Person"
content: |-
comment=Another Sample
@ -136,7 +134,7 @@ These values are case-sensitive so take care. If you incorrectly specify a Game
- `SkipMPEGHack`
- Finds sceMpegIsEnd pattern in games and then recompiles code to say the videos are finished.
- `OPHFlagHack`
- Bleach Bankais and others
- Bleach Bankais and others.
- `DMABusyHack`
- Mana Khemia, Metal Saga. Denies writes to the DMAC when it's busy.
- `VIFFIFOHack`
@ -146,7 +144,7 @@ These values are case-sensitive so take care. If you incorrectly specify a Game
- `GIFFIFOHack`
- Enables the GIF FIFO. Needed for Wallace & Grommit, Hot Wheels, DJ Hero.
- `FMVinSoftwareHack`
- Silent Hill 2-3. Fixes FMVs that are obscured when using hardware rendering by switching to software rendering whil
- Silent Hill 2-3. Fixes FMVs that are obscured when using hardware rendering by switching to software rendering.
- `ScarfaceIbitHack`
- VU I bit Hack avoid constant recompilation (Scarface The World Is Yours).
- `CrashTagTeamRacingIbitHack`
@ -174,7 +172,7 @@ This works fine for the vast majority of games, but fails in some cases, for whi
## Patches
The patch that corresponds with the running game's CRC will take precedence over the defaults. Multiple patches for the same CRC cannot be defined and this will throw an invalidation errors.
The patch that corresponds to the running game's CRC will take precedence over the `default`. Multiple patches for the same CRC cannot be defined and this will throw an invalidation errors.
Patches should be defined as multi-line string blocks, where each line would correspond with a line in a conventional `*.pnach` file

File diff suppressed because it is too large Load Diff

View File

@ -132,21 +132,15 @@ GameDatabaseSchema::GameEntry YamlGameDatabaseImpl::entryFromYaml(const std::str
if (YAML::Node patches = node["patches"])
{
for (YAML::const_iterator it = patches.begin(); it != patches.end(); ++it)
for (YAML::const_iterator entry = patches.begin(); entry != patches.end(); entry++)
{
const YAML::Node& node = *it;
std::string crc = safeGetString(node, "crc", "default");
if (gameEntry.patches.count(crc) == 1)
{
Console.Error(fmt::format("[GameDB] Patch with duplicate CRC: '{}' detected for serial: '{}'. Skipping patch.", crc, serial));
continue;
}
std::string crc = entry->first.as<std::string>();
YAML::Node patchNode = entry->second;
GameDatabaseSchema::Patch patchCol;
patchCol.author = safeGetString(node, "author");
patchCol.patchLines = safeGetMultilineString(node, "content");
patchCol.author = safeGetString(patchNode, "author");
patchCol.patchLines = safeGetMultilineString(patchNode, "content");
gameEntry.patches[crc] = patchCol;
}
}