summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/music.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/music.cpp b/src/music.cpp
index a687d35..6a92a23 100644
--- a/src/music.cpp
+++ b/src/music.cpp
@@ -44,6 +44,8 @@ inline char *BrsarInfoOffset(u32 offset) {
return (char*)(*(u32*)(((u32)SoundRelatedClass) + 0x5CC)) + offset;
}
+void FixFilesize(u32 streamNameOffset);
+
extern "C" u8 after_course_getMusicForZone(u8 realThemeID) {
if (realThemeID < 100)
return realThemeID;
@@ -73,11 +75,35 @@ extern "C" u8 after_course_getMusicForZone(u8 realThemeID) {
sprintf(BrsarInfoOffset(stream->stringOffset), "stream/theme%03d.brstm", realThemeID);
sprintf(BrsarInfoOffset(stream->stringOffsetFast), "stream/theme%03d_fast.brstm", realThemeID);
+ // update filesizes
+ FixFilesize(stream->stringOffset);
+ FixFilesize(stream->stringOffsetFast);
+
// done!
return stream->originalID;
}
+//oh for fuck's sake
+#include "fileload.h"
+//#include <rvl/dvd.h>
+
+void FixFilesize(u32 streamNameOffset) {
+ char *streamName = BrsarInfoOffset(streamNameOffset);
+
+ char nameWithSound[80];
+ snprintf(nameWithSound, 79, "/Sound/%s", streamName);
+
+ s32 entryNum;
+ DVDHandle info;
+
+ if ((entryNum = DVDConvertPathToEntrynum(nameWithSound)) >= 0) {
+ if (DVDFastOpen(entryNum, &info)) {
+ u32 *lengthPtr = (u32*)(streamName - 0x1C);
+ *lengthPtr = info.length;
+ }
+ }
+}