aboutsummaryrefslogtreecommitdiff
path: root/content.h
diff options
context:
space:
mode:
authorneonloop2021-09-06 23:44:53 +0000
committerneonloop2021-09-06 23:44:53 +0000
commit7032dd1ce78e03f1f50475be76ef8b5c642c9d01 (patch)
treea232c4674a942da0bcfceaaddb5e60356a0ab183 /content.h
parent05c5d66301f14bd8ae50490ebdc7e32e371f851b (diff)
downloadpicoarch-7032dd1ce78e03f1f50475be76ef8b5c642c9d01.tar.gz
picoarch-7032dd1ce78e03f1f50475be76ef8b5c642c9d01.tar.bz2
picoarch-7032dd1ce78e03f1f50475be76ef8b5c642c9d01.zip
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)
Diffstat (limited to 'content.h')
-rw-r--r--content.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/content.h b/content.h
new file mode 100644
index 0000000..a57c039
--- /dev/null
+++ b/content.h
@@ -0,0 +1,23 @@
+#ifndef CONTENT_H
+#define CONTENT_H
+
+#include "libretro.h"
+#include "main.h"
+
+struct content {
+ const char path[MAX_PATH];
+
+ char *tmpfile;
+ void *data;
+ size_t size;
+};
+
+struct content *content_init(const char *path);
+void content_based_name(const struct content *content,
+ char *buf, size_t len,
+ const char *basedir, const char *subdir,
+ const char *new_extension);
+int content_load_game_info(struct content *content, struct retro_game_info *info, bool needs_fullpath);
+void content_free(struct content *content);
+
+#endif