From 7032dd1ce78e03f1f50475be76ef8b5c642c9d01 Mon Sep 17 00:00:00 2001 From: neonloop Date: Mon, 6 Sep 2021 23:44:53 +0000 Subject: Adds ips/bps softpatching Patches named like the content will be auto-applied in memory when the game is loaded. Example: /roms/game.gba will apply patches named /roms/game.ips, /roms/game.ips1, /roms/game.IPS2, /roms/game.bps, etc. This only happens in memory, original files are unmodified. Patches are loaded in case-insensitive alphabetical order. Note that .ips12 loads before .ips2, but after .ips02. Only supports cores that load from memory (see libretro page at https://docs.libretro.com/guides/softpatching/ for compatibility list) --- core.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core.h') diff --git a/core.h b/core.h index 8958e9e..847510b 100644 --- a/core.h +++ b/core.h @@ -2,6 +2,7 @@ #define _CORE_H__ #include "cheat.h" +#include "content.h" #include "libretro.h" #include "main.h" @@ -32,7 +33,7 @@ struct core_cbs { extern struct core_cbs current_core; extern char core_path[MAX_PATH]; -extern char content_path[MAX_PATH]; +extern struct content *content; extern struct cheats *cheats; extern double sample_rate; @@ -60,8 +61,9 @@ bool disc_switch_index(unsigned index); bool disc_replace_index(unsigned index, const char *content_path); void core_extract_name(const char* core_file, char *buf, size_t len); -int core_load(const char *corefile); -int core_load_content(const char *path); +int core_open(const char *corefile); +void core_load(void); +int core_load_content(struct content *content); void core_apply_cheats(struct cheats *cheats); void core_unload_content(void); const char **core_extensions(void); -- cgit v1.2.3