]> 4ch.mooo.com Git - 16.git/commitdiff
added stuff like repo call of dro2imf and imfplay actually uses the memory manager...
authorsparky4 <sparky4@cock.li>
Mon, 28 Aug 2017 18:15:42 +0000 (13:15 -0500)
committersparky4 <sparky4@cock.li>
Mon, 28 Aug 2017 18:15:42 +0000 (13:15 -0500)
.gitignore
.gitmodules
16/shitman [deleted submodule]
makefile
src/lib/16_sd.c
src/lib/16_sd.h
src/lib/vgmsnd/vgmSnd.c
src/lib/vgmsnd/vgmSnd.h
src/util/git/git_modu.les

index 70f8e2167ea24449a53f2543431905c3addb9c4d..bce92ec3b03900bfbc9c05842a430a9a2e02c6e5 100755 (executable)
@@ -34,6 +34,7 @@ pcxsscut
 vrl2vrs\r
 vrsdump\r
 vrldbg\r
+dro2imf\r
 ps.exe\r
 *.upx\r
 # except foo.html which is maintained by hand.\r
index 1805ff91fdffbf6f6adda80ce832405db740a9b5..ab23923cea042db02cd8644a5bb594002b46a551 100755 (executable)
@@ -25,3 +25,7 @@
 [submodule "shitman"]
         path = 16/shitman
         url = https://github.com/joncampbell123/shitman.git
+
+[submodule "dro2imf"]
+       path = "16/dro2imf"
+       url = https://github.com/Malvineous/dro2imf.git
diff --git a/16/shitman b/16/shitman
deleted file mode 160000 (submodule)
index 30235e5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 30235e5eabc57190c68d5b042a687295029026cc
index a655ce6c536a69f3f312b2cca0a7e761ca9c0967..8a8bd909d822c1d11035b5309a729a85e67f156c 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -236,7 +236,8 @@ SPRIUTILEXEC = &
        pcxsscut &
        vrl2vrs &
        vrsdump &
-       vrldbg
+       vrldbg &
+       dro2imf
 #UTILEXEC += $(SPRIUTILEXEC)
 !endif
 
@@ -473,6 +474,7 @@ clean: .symbolic
        @if exist *.OBJ $(REMOVECOMMAND) *.OBJ
        #@for %f in ($(SPRIUTILEXEC)) do @if exist %f $(REMOVECOMMAND) %f
        @if not exist vrl2vrs wmake -s -h pcx2vrl
+       @if not exist dro2imf wmake -s -h drotoimf
 !else
        @if exist *.o $(REMOVECOMMAND) *.o
 !endif
@@ -618,6 +620,7 @@ reinitlibs: .symbolic
        @$(REMOVECOMMAND) -rf 16/keen
        @$(REMOVECOMMAND) -rf 16/Catacomb3D
        @$(REMOVECOMMAND) -rf 16/shitman
+       @$(REMOVECOMMAND) -rf 16/dro2imf
        @wmake -s -h initlibs
 
 initlibs: .symbolic
@@ -628,6 +631,7 @@ initlibs: .symbolic
        @git clone https://github.com/id-Software/wolf3d.git
        @git clone https://github.com/keendreams/keen.git
        @git clone https://github.com/FlatRockSoft/Catacomb3D.git
+       @git clone https://github.com/Malvineous/dro2imf.git
        @cd $(BUILD_ROOT)
        @$(COPYCOMMAND) $(DOSLIBDIR)/make-lowercase .
 
@@ -666,6 +670,11 @@ mx_: .symbolic
        @cd $(BUILD_ROOT)
 
 !ifdef __LINUX__
+drotoimf: .symbolic
+       @cd 16/dro2imf
+       @make
+       @$(MOVECOMMAND) dro2imf ../..
+       @cd $(BUILD_ROOT)
 vrs: .symbolic
 vrl: .symbolic
 $(SPRIUTILEXEC):
index 4445bc4722fe9c24c1663454f10668244afaaa5c..b3349bc25e7bb3e8415129327f0f4062ea168007 100755 (executable)
@@ -223,6 +223,12 @@ void SD_Initimf(global_game_variables_t *gvar)
        shutdown_adlib_opl3(); // NTS: Apparently the music won't play otherwise\r
 }\r
 \r
+void SD_imf_reset_music(global_game_variables_t *gvar)\r
+{\r
+       gvar->ca.sd.imf_music = gvar->ca.sd.imf_play_ptr = gvar->ca.sd.imf_music_end = NULL;\r
+       gvar->ca.sd.imf_delay_countdown = 0;\r
+}\r
+\r
 void SD_imf_free_music(global_game_variables_t *gvar)\r
 {\r
 #ifndef SD_USESCAMMPM\r
@@ -230,8 +236,7 @@ void SD_imf_free_music(global_game_variables_t *gvar)
 #else\r
        MM_FreePtr(MEMPTRCONV gvar->ca.audiosegs[0], gvar);     //TODO make behave like id engine\r
 #endif\r
-       gvar->ca.sd.imf_music = gvar->ca.sd.imf_play_ptr = gvar->ca.sd.imf_music_end = NULL;\r
-       gvar->ca.sd.imf_delay_countdown = 0;\r
+       SD_imf_reset_music(gvar);\r
 }\r
 \r
 int SD_imf_load_music(const char *path, global_game_variables_t *gvar)\r
@@ -240,7 +245,11 @@ int SD_imf_load_music(const char *path, global_game_variables_t *gvar)
        unsigned char buf[8];\r
        int fd;\r
 \r
+#ifndef SD_USESCAMMPM\r
        SD_imf_free_music(gvar);\r
+#else\r
+       SD_imf_reset_music(gvar);\r
+#endif\r
 \r
        fd = open(path,O_RDONLY|O_BINARY);\r
        if (fd < 0) return 0;\r
index 54a2e73edda18b040bf4592492bfd76868668795..117ab0c4dfe5be784404800357e075f615672bef 100755 (executable)
@@ -31,7 +31,7 @@
 #include <hw/dos/dos.h>\r
 #include <hw/8259/8259.h>\r
 \r
-//#define SD_USESCAMMPM\r
+#define SD_USESCAMMPM\r
 \r
 #define MIN_REGISTER                   0x01\r
 #define MAX_REGISTER                   0xF5\r
@@ -66,6 +66,7 @@ void FMKeyOn(int voice, int freq, int octave);
 void FMSetVoice(int voiceNum, FMInstrument *ins);\r
 \r
 void SD_Initimf(global_game_variables_t *gvar);\r
+void SD_imf_reset_music(global_game_variables_t *gvar);\r
 void SD_imf_free_music(global_game_variables_t *gvar);\r
 int SD_imf_load_music(const char *path, global_game_variables_t *gvar);\r
 void interrupt SD_irq0(void);\r
index 2cfd8690c36a008a07cdd7df39d383de07a833f9..c46b0b76a6e9d561a89ed502135fadb6ea3b5dd2 100755 (executable)
@@ -171,9 +171,12 @@ UINT8 OpenVGMFile(const char* FileName, VGM_FILE* vgmFile, global_game_variables
        }\r
 \r
        vgmFile->dataLen = vgmBaseHdr.lngEOFOffset + 0x04;\r
-       //vgmFile->data = (UINT8*)malloc(vgmFile->dataLen);\r
+#ifndef VGM_USESCAMMPM\r
+       vgmFile->data = (UINT8*)malloc(vgmFile->dataLen);\r
+#else\r
        MM_GetPtr(MEMPTRCONV gvar->ca.audiosegs[0], vgmFile->dataLen, gvar);\r
        vgmFile->data = (UINT8*)gvar->ca.audiosegs[0];\r
+#endif\r
        if (vgmFile->data == NULL)\r
        {\r
                fclose(hFile);\r
@@ -216,12 +219,15 @@ UINT8 OpenVGMFile(const char* FileName, VGM_FILE* vgmFile, global_game_variables
 \r
 void FreeVGMFile(VGM_FILE* vgmFile, global_game_variables_t *gvar)\r
 {\r
-       //if(vgmFile->data){ free(vgmFile->data);       vgmFile->data = NULL; }\r
+#ifndef VGM_USESCAMMPM\r
+       if(vgmFile->data){ free(vgmFile->data); vgmFile->data = NULL; }\r
+#else\r
        MM_FreePtr(MEMPTRCONV gvar->ca.audiosegs[0], gvar);\r
-       if(vgmFile->data) free(vgmFile->data);\r
+#endif\r
+//     if(vgmFile->data) free(vgmFile->data);\r
        vgmFile->dataLen = 0;\r
 \r
-//     return;\r
+       return;\r
 }\r
 \r
 \r
index 5cadbe18ba433d28c0f02d35d17c04b018ae695d..da9fcec90e49c590420f326463b70863466173f9 100755 (executable)
@@ -1,6 +1,8 @@
 #ifndef __VGMSNDDRV_H__\r
 #define __VGMSNDDRV_H__\r
 \r
+//#define VGM_USESCAMMPM\r
+\r
 #ifdef __cplusplus\r
 extern "C"\r
 {\r
index 1805ff91fdffbf6f6adda80ce832405db740a9b5..ab23923cea042db02cd8644a5bb594002b46a551 100755 (executable)
@@ -25,3 +25,7 @@
 [submodule "shitman"]
         path = 16/shitman
         url = https://github.com/joncampbell123/shitman.git
+
+[submodule "dro2imf"]
+       path = "16/dro2imf"
+       url = https://github.com/Malvineous/dro2imf.git