Created
October 26, 2022 13:04
-
-
Save LibretroAdmin/7a638319d039bd25e3c33d25d344f9db to your computer and use it in GitHub Desktop.
NXengine fix for music (windows)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/nxengine/extract-auto/extractorg.c b/nxengine/extract-auto/extractorg.c | |
index 0d2b3da..779a4ba 100644 | |
--- a/nxengine/extract-auto/extractorg.c | |
+++ b/nxengine/extract-auto/extractorg.c | |
@@ -89,7 +89,7 @@ files[] = | |
{ NULL, 0, 0, 0 } | |
}; | |
-char *org_data[42]; | |
+unsigned char *org_data[42]; | |
signed short wavetable[100][256]; | |
static int org_extracted = 0; | |
@@ -117,7 +117,7 @@ bool extract_org(RFILE *exefp) | |
// write out the file | |
- org_data[i] = (char *)malloc(files[i].length); | |
+ org_data[i] = (unsigned char *)malloc(files[i].length); | |
memcpy(org_data[i], buffer, files[i].length); | |
} | |
diff --git a/nxengine/sound/org.cpp b/nxengine/sound/org.cpp | |
index ed8114b..9dc928f 100644 | |
--- a/nxengine/sound/org.cpp | |
+++ b/nxengine/sound/org.cpp | |
@@ -173,7 +173,7 @@ void org_close(void) | |
if (drumtable[d].samples) free(drumtable[d].samples); | |
} | |
-int mgetc(char **fp) | |
+static int mgetc(unsigned char **fp) | |
{ | |
unsigned char volatile *f = *((unsigned char volatile **)fp); | |
unsigned char volatile c = *f; | |
@@ -181,33 +181,31 @@ int mgetc(char **fp) | |
return c; | |
} | |
-uint16_t mgeti(char **fp) | |
+static uint16_t mgeti(unsigned char **fp) | |
{ | |
-uint16_t a, b; | |
- a = mgetc(fp); | |
- b = mgetc(fp); | |
+ uint16_t a = mgetc(fp); | |
+ uint16_t b = mgetc(fp); | |
return (b << 8) | a; | |
} | |
-uint32_t mgetl(char **fp) | |
+static uint32_t mgetl(unsigned char **fp) | |
{ | |
-uint32_t a, b, c, d; | |
- a = mgetc(fp); | |
- b = mgetc(fp); | |
- c = mgetc(fp); | |
- d = mgetc(fp); | |
+ uint32_t a = mgetc(fp); | |
+ uint32_t b = mgetc(fp); | |
+ uint32_t c = mgetc(fp); | |
+ uint32_t d = mgetc(fp); | |
return (d<<24)|(c<<16)|(b<<8)|(a); | |
} | |
-extern "C" char *org_data[42]; | |
+extern "C" unsigned char *org_data[42]; | |
char org_load(int songno) | |
{ | |
static const char *magic = "Org-02"; | |
char buf[8]; | |
int i, j; | |
- char *f = org_data[songno]; | |
- char **fp = &f; | |
+ unsigned char *f = org_data[songno]; | |
+ unsigned char **fp = &f; | |
if (!fp) | |
return 1; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment