mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
RiivolutionParser: Add code to read and write the Riivolution config XMLs that remember the last selection.
This commit is contained in:
@ -199,9 +199,33 @@ struct Disc
|
||||
std::vector<Patch> GeneratePatches(const std::string& game_id) const;
|
||||
};
|
||||
|
||||
// Config format that remembers which patches are enabled/disabled for the next run.
|
||||
// Some patches ship with pre-made config XMLs instead of baking their defaults into the actual
|
||||
// patch XMLs, so it makes sense to support this format directly.
|
||||
struct ConfigOption
|
||||
{
|
||||
// The identifier for the referenced Option.
|
||||
std::string m_id;
|
||||
|
||||
// The selected Choice index.
|
||||
u32 m_default;
|
||||
};
|
||||
|
||||
struct Config
|
||||
{
|
||||
// Config version. Riivolution itself only accepts '2' here.
|
||||
int m_version = 2;
|
||||
std::vector<ConfigOption> m_options;
|
||||
};
|
||||
|
||||
std::optional<Disc> ParseFile(const std::string& filename);
|
||||
std::optional<Disc> ParseString(std::string_view xml, std::string xml_path);
|
||||
std::vector<Patch> GenerateRiivolutionPatchesFromGameModDescriptor(
|
||||
const GameModDescriptorRiivolution& descriptor, const std::string& game_id,
|
||||
std::optional<u16> revision, std::optional<u8> disc_number);
|
||||
std::optional<Config> ParseConfigFile(const std::string& filename);
|
||||
std::optional<Config> ParseConfigString(std::string_view xml);
|
||||
std::string WriteConfigString(const Config& config);
|
||||
bool WriteConfigFile(const std::string& filename, const Config& config);
|
||||
void ApplyConfigDefaults(Disc* disc, const Config& config);
|
||||
} // namespace DiscIO::Riivolution
|
||||
|
Reference in New Issue
Block a user