From 9049174a85146e1b5d3eb669214b1cb8f8a48a39 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Thu, 7 Jul 2005 12:01:44 +0000 Subject: [PATCH] Made 2nd ST loader smart about headers (even though there should never be any.) --- zsnes/src/initc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/zsnes/src/initc.c b/zsnes/src/initc.c index e686089e..dcbb9e49 100755 --- a/zsnes/src/initc.c +++ b/zsnes/src/initc.c @@ -930,6 +930,8 @@ void loadZipFile(char *filename) void load_file_fs(char *path) { + unsigned char *ROM = (unsigned char *)romdata; + unsigned int pathlen = strlen(path); const char *ext = path+pathlen-4; if (pathlen >= 5 && !strcasecmp(ext, ".jma")) @@ -948,6 +950,12 @@ void load_file_fs(char *path) { loadFile(path); } + + if ((curromspace & 0x7FFF) == 512) + { + memmove(ROM, ROM+512, addOnStart); + curromspace -= 512; + } } char *STCart2 = 0; @@ -970,18 +978,13 @@ void SplitSetup(char *basepath, char *basefile, unsigned int MirrorSystem) if (!*basepath) { - loadZipFile(basefile); + load_file_fs(basefile); } else { load_file_fs(basepath); } - if ((curromspace & 0x7FFF) == 512) - { - memmove(ROM, ROM+512, addOnStart); - curromspace -= 512; - } if (!curromspace) { return; } switch (MirrorSystem)