]> 4ch.mooo.com Git - 16.git/commitdiff
worked on SD abit so the irq0 is not needed in imfplay anymore. I will need to merge...
authorsparky4 <sparky4@cock.li>
Fri, 1 Sep 2017 00:55:58 +0000 (19:55 -0500)
committersparky4 <sparky4@cock.li>
Fri, 1 Sep 2017 00:55:58 +0000 (19:55 -0500)
16 files changed:
.gitignore
.gitmodules
0.exe [new file with mode: 0755]
16/vgmtools [new submodule]
data/02.vgm [new file with mode: 0755]
dro2vgm
makefile
src/lib/.16_sd.h.kate-swp [deleted file]
src/lib/16_sd.h
src/lib/vgmsnd/imf2vgm.c [deleted file]
src/util/git/git_igno.re
src/util/git/git_modu.les
src/util/shbat/run.bat [new file with mode: 0755]
src/util/shbat/winnbuil.sh [new file with mode: 0755]
src/util/shbat/winrun.bat [new file with mode: 0755]
zcroll.exe [new file with mode: 0755]

index bce92ec3b03900bfbc9c05842a430a9a2e02c6e5..8fe488a58a526808731d0ba0c9c24c5a343d1439 100755 (executable)
@@ -35,6 +35,9 @@ vrl2vrs
 vrsdump\r
 vrldbg\r
 dro2imf\r
+dro2vgm\r
+imf2vgm\r
+raw2vgm\r
 ps.exe\r
 *.upx\r
 # except foo.html which is maintained by hand.\r
index ab23923cea042db02cd8644a5bb594002b46a551..657e577f94d606ea9f1f9b1695563e0b90d2406c 100755 (executable)
@@ -1,6 +1,6 @@
 [submodule "src/lib/doslib"]
-        path = src/lib/doslib
-        url = https://github.com/joncampbell123/doslib.git
+       path = src/lib/doslib
+       url = https://github.com/joncampbell123/doslib.git
 
 [submodule "src/lib/jsmn"]
        path = src/lib/jsmn
        url = https://github.com/FlatRockSoft/CatacombApocalypse.git
 
 [submodule "wolf3d"]
-        path = 16/wolf3d
-        url = https://github.com/id-Software/wolf3d.git
+       path = 16/wolf3d
+       url = https://github.com/id-Software/wolf3d.git
 
 [submodule "keen"]
-        path = 16/keen
+       path = 16/keen
        url = https://github.com/keendreams/keen.git
 
 [submodule "Catacomb3D"]
-        path = 16/Catacomb3D
+       path = 16/Catacomb3D
        url = https://github.com/FlatRockSoft/Catacomb3D.git
 
 [submodule "shitman"]
-        path = 16/shitman
-        url = https://github.com/joncampbell123/shitman.git
+       path = 16/shitman
+       url = https://github.com/joncampbell123/shitman.git
 
 [submodule "dro2imf"]
        path = "16/dro2imf"
        url = https://github.com/Malvineous/dro2imf.git
+
+[submodule "vgmtools"]
+       path = "16/vgmtools"
+       url = https://github.com/vgmrips/vgmtools.git
diff --git a/0.exe b/0.exe
new file mode 100755 (executable)
index 0000000..cf069ae
Binary files /dev/null and b/0.exe differ
diff --git a/16/vgmtools b/16/vgmtools
new file mode 160000 (submodule)
index 0000000..057e012
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 057e0126a66a4d287508d79f9a407a0a30293c5f
diff --git a/data/02.vgm b/data/02.vgm
new file mode 100755 (executable)
index 0000000..ae01d28
Binary files /dev/null and b/data/02.vgm differ
diff --git a/dro2vgm b/dro2vgm
index f924965c0a3621e6abe6e38ce3464c1bcd3a7527..09a12d632cc61d858e747163ba41b2411f5024c7 100755 (executable)
Binary files a/dro2vgm and b/dro2vgm differ
index b24edb2f8183d345fb33c6f121a7f289a58a234e..ac1cb527b909b0b5090c2bc6dd80195c9dd5e9e3 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -236,7 +236,10 @@ SPRIUTILEXEC = &
        vrl2vrs &
        vrsdump &
        vrldbg &
-       dro2imf
+       dro2imf &
+       dro2vgm &
+       imf2vgm &
+       raw2vgm
 #UTILEXEC += $(SPRIUTILEXEC)
 !endif
 
@@ -472,6 +475,7 @@ clean: .symbolic
        #@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
+       @if not exist raw2vgm wmake -s -h vgmtools
 !else
        @if exist *.o $(REMOVECOMMAND) *.o
 !endif
@@ -618,6 +622,7 @@ reinitlibs: .symbolic
        @$(REMOVECOMMAND) -rf 16/Catacomb3D
        @$(REMOVECOMMAND) -rf 16/shitman
        @$(REMOVECOMMAND) -rf 16/dro2imf
+       @$(REMOVECOMMAND) -rf 16/vgmtools
        @wmake -s -h initlibs
 
 initlibs: .symbolic
@@ -629,6 +634,7 @@ initlibs: .symbolic
        @git clone https://github.com/keendreams/keen.git
        @git clone https://github.com/FlatRockSoft/Catacomb3D.git
        @git clone https://github.com/Malvineous/dro2imf.git
+       @git clone https://github.com/vgmrips/vgmtools.git
        @cd $(BUILD_ROOT)
        @$(COPYCOMMAND) $(DOSLIBDIR)/make-lowercase .
 
@@ -672,6 +678,15 @@ drotoimf: .symbolic
        @make
        @$(MOVECOMMAND) dro2imf ../..
        @cd $(BUILD_ROOT)
+
+vgmtools: .symbolic
+       @cd 16/vgmtools
+       @make
+       @$(MOVECOMMAND) dro2vgm ../..
+       @$(MOVECOMMAND) imf2vgm ../..
+       @$(MOVECOMMAND) raw2vgm ../..
+       @cd $(BUILD_ROOT)
+
 vrs: .symbolic
 vrl: .symbolic
 $(SPRIUTILEXEC):
diff --git a/src/lib/.16_sd.h.kate-swp b/src/lib/.16_sd.h.kate-swp
deleted file mode 100755 (executable)
index 5680e70..0000000
Binary files a/src/lib/.16_sd.h.kate-swp and /dev/null differ
index 73600a11ad61f04004713d240558ed43751382e9..858ed74cfd40dc252c0e12457f53266df0d70f74 100755 (executable)
@@ -54,8 +54,6 @@ typedef struct{
        byte Feedback;                  /* feedback algorithm and strength  */\r
 } FMInstrument;\r
 \r
-//extern void interrupt        (*old_irq0)(void);\r
-\r
 void opl2out(word reg, word data);\r
 void opl3out(word reg, word data);\r
 void opl3exp(word data);\r
diff --git a/src/lib/vgmsnd/imf2vgm.c b/src/lib/vgmsnd/imf2vgm.c
deleted file mode 100755 (executable)
index 7d7c683..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-// imf2vgm.c - IMF -> VGM Converter
-//
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "stdtype.h"
-#include "VGMFile.h"
-#include "common.h"
-
-
-static UINT8 OpenIMFFile(const char* FileName);
-static void WriteVGMFile(const char* FileName);
-static void ConvertIMF2VGM(void);
-
-
-UINT8 IMFType;
-UINT16 IMFRate;
-VGM_HEADER VGMHead;
-UINT32 IMFDataLen;
-UINT8* IMFData;
-UINT32 IMFPos;
-UINT32 IMFDataStart;
-UINT32 IMFDataEnd;
-UINT32 VGMDataLen;
-UINT8* VGMData;
-UINT32 VGMPos;
-char FileBase[0x100];
-UINT8 LoopOn;
-
-int main(int argc, char* argv[])
-{
-       int argbase;
-       int ErrVal;
-       char FileName[0x100];
-       UINT16 ForceHz;
-       UINT8 ForceType;
-       
-       printf("IMF to VGM Converter\n--------------------\n\n");
-       
-       ErrVal = 0;
-       argbase = 1;
-       ForceHz = 0;
-       ForceType = 0xFF;
-       LoopOn = 0x00;
-       
-       while(argbase < argc && argv[argbase][0] == '-')
-       {
-               if (! stricmp(argv[argbase], "-help"))
-               {
-                       printf("Usage: imf2vgm [-Loop] [-Hz###] [-Type#] Input.imf [Output.vgm]\n");
-                       printf("\n");
-                       printf("Loop: Makes the song loop from beginning to end.\n");
-                       printf("Hz:   There are 3 known speeds: 280, 560 and 700\n");
-                       printf("      560 is default for .imf, 700 for .wlf files\n");
-                       printf("Type: Can be 0 (no header) or 1 (header with 2-byte file size)\n");
-                       return 0;
-               }
-               else if (! stricmp(argv[argbase], "-Loop"))
-               {
-                       LoopOn = 0x01;
-                       argbase ++;
-               }
-               else if (! strnicmp(argv[argbase], "-Hz", 3))
-               {
-                       ForceHz = (UINT16)strtoul(argv[argbase] + 3, NULL, 0);
-                       argbase ++;
-               }
-               else if (! strnicmp(argv[argbase], "-Type", 5))
-               {
-                       ForceType = (UINT8)strtoul(argv[argbase] + 5, NULL, 0);
-                       if (ForceType >= 0x02)
-                       {
-                               printf("Error: Type must be either 0 or 1!\n");
-                               return 2;
-                       }
-                       argbase ++;
-               }
-               else
-               {
-                       break;
-               }
-       }
-       
-       printf("File Name:\t");
-       if (argc <= argbase + 0)
-       {
-               ReadFilename(FileName, sizeof(FileName));
-       }
-       else
-       {
-               strcpy(FileName, argv[argbase + 0]);
-               printf("%s\n", FileName);
-       }
-       if (! strlen(FileName))
-               return 0;
-       
-       if (OpenIMFFile(FileName))
-       {
-               printf("Error opening the file!\n");
-               ErrVal = 1;
-               goto EndProgram;
-       }
-       printf("\n");
-       
-       if (ForceHz)
-               IMFRate = ForceHz;
-       if (ForceType < 0xFF)
-               IMFType = ForceType;
-       ConvertIMF2VGM();
-       
-       if (argc > argbase + 1)
-               strcpy(FileName, argv[argbase + 1]);
-       else
-               strcpy(FileName, "");
-       if (FileName[0] == '\0')
-       {
-               strcpy(FileName, FileBase);
-               strcat(FileName, ".vgm");
-       }
-       WriteVGMFile(FileName);
-       
-       free(IMFData);
-       free(VGMData);
-       
-EndProgram:
-       DblClickWait(argv[0]);
-       
-       return ErrVal;
-}
-
-static UINT8 OpenIMFFile(const char* FileName)
-{
-       FILE* hFile;
-       UINT16 TempSht;
-       char* TempPnt;
-       
-       hFile = fopen(FileName, "rb");
-       if (hFile == NULL)
-               return 0xFF;
-       
-       fseek(hFile, 0x00, SEEK_END);
-       IMFDataLen = ftell(hFile);
-       
-       // Read Data
-       IMFData = (UINT8*)malloc(IMFDataLen);
-       if (IMFData == NULL)
-               goto OpenErr;
-       fseek(hFile, 0x00, SEEK_SET);
-       IMFDataLen = fread(IMFData, 0x01, IMFDataLen, hFile);
-       
-       fclose(hFile);
-       
-       memcpy(&TempSht, &IMFData[0x00], 0x02);
-       if (! TempSht)
-               IMFType = 0x00;
-       else
-               IMFType = 0x01;
-       
-       strcpy(FileBase, FileName);
-       TempPnt = strrchr(FileBase, '.');
-       if (TempPnt != NULL)
-       {
-               *TempPnt = 0x00;
-               TempPnt ++;
-       }
-       else
-       {
-               TempPnt = FileBase + strlen(FileBase);
-       }
-       if (! stricmp(TempPnt, "wlf"))
-               IMFRate = 700;
-       else
-               IMFRate = 560;
-       
-       return 0x00;
-
-OpenErr:
-
-       fclose(hFile);
-       return 0x80;
-}
-
-static void WriteVGMFile(const char* FileName)
-{
-       FILE* hFile;
-       
-       hFile = fopen(FileName, "wb");
-       fwrite(VGMData, 0x01, VGMDataLen, hFile);
-       fclose(hFile);
-       
-       printf("File written.\n");
-       
-       return;
-}
-
-static void ConvertIMF2VGM(void)
-{
-       UINT16 CurDelay;
-       UINT32 CurTick;
-       UINT16 HalfRate;
-       UINT64 TempTick;
-       UINT32 VGMSmplL;
-       UINT32 VGMSmplC;
-       UINT32 SmplVal;
-       
-       VGMDataLen = sizeof(VGM_HEADER) + IMFDataLen * 0x02;
-       VGMData = (UINT8*)malloc(VGMDataLen);
-       
-       printf("IMF Type: %u, IMF Playback Rate: %u Hz\n", IMFType, IMFRate);
-       
-       memcpy(&CurDelay, &IMFData[0x00], 0x02);
-       if (IMFType == 0x00)
-       {
-               IMFDataStart = 0x0000;
-               IMFDataEnd = IMFDataLen;
-       }
-       else //if (IMFType == 0x01)
-       {
-               IMFDataStart = 0x0002;
-               IMFDataEnd = IMFDataStart + CurDelay;
-       }
-       
-       // Generate VGM Header
-       memset(&VGMHead, 0x00, sizeof(VGM_HEADER));
-       VGMHead.fccVGM = FCC_VGM;
-       VGMHead.lngVersion = 0x00000151;
-       VGMHead.lngRate = IMFRate;
-       VGMHead.lngDataOffset = 0x80;
-       VGMHead.lngHzYM3812 = 3579545;
-       
-       // Convert data
-       IMFPos = IMFDataStart;
-       VGMPos = VGMHead.lngDataOffset;
-       CurTick = 0;
-       VGMSmplL = 0;
-       HalfRate = IMFRate / 2; // for correct rounding
-       while(IMFPos < IMFDataEnd)
-       {
-               if (VGMPos >= VGMDataLen - 0x08)
-               {
-                       VGMDataLen += 0x8000;
-                       VGMData = (UINT8*)realloc(VGMData, VGMDataLen);
-               }
-               VGMData[VGMPos + 0x00] = 0x5A;
-               VGMData[VGMPos + 0x01] = IMFData[IMFPos + 0x00];        // register
-               VGMData[VGMPos + 0x02] = IMFData[IMFPos + 0x01];        // data
-               VGMPos += 0x03;
-               
-               memcpy(&CurDelay, &IMFData[IMFPos + 0x02], 0x02);
-               CurTick += CurDelay;
-               TempTick = (UINT64)CurTick * 44100 + HalfRate;
-               VGMSmplC = (UINT32)(TempTick / IMFRate);
-               IMFPos += 0x04;
-               
-               if (VGMSmplL < VGMSmplC)
-               {
-                       SmplVal = VGMSmplC - VGMSmplL;
-                       while(SmplVal)
-                       {
-                               if (SmplVal <= 0xFFFF)
-                                       CurDelay = (UINT16)SmplVal;
-                               else
-                                       CurDelay = 0xFFFF;
-                               
-                               if (VGMPos >= VGMDataLen - 0x08)
-                               {
-                                       VGMDataLen += 0x8000;
-                                       VGMData = (UINT8*)realloc(VGMData, VGMDataLen);
-                               }
-                               VGMData[VGMPos + 0x00] = 0x61;
-                               memcpy(&VGMData[VGMPos + 0x01], &CurDelay, 0x02);
-                               VGMPos += 0x03;
-                               SmplVal -= CurDelay;
-                       }
-                       VGMSmplL = VGMSmplC;
-               }
-       }
-       VGMData[VGMPos] = 0x66;
-       VGMPos += 0x01;
-       
-       VGMDataLen = VGMPos;
-       VGMHead.lngEOFOffset = VGMDataLen;
-       VGMHead.lngTotalSamples = VGMSmplL;
-       if (LoopOn)
-       {
-               VGMHead.lngLoopOffset = VGMHead.lngDataOffset;
-               VGMHead.lngLoopSamples = VGMHead.lngTotalSamples;
-       }
-       
-       SmplVal = VGMHead.lngDataOffset;
-       if (SmplVal > sizeof(VGM_HEADER))
-               SmplVal = sizeof(VGM_HEADER);
-       VGMHead.lngEOFOffset -= 0x04;
-       if (VGMHead.lngLoopOffset)
-               VGMHead.lngLoopOffset -= 0x1C;
-       VGMHead.lngDataOffset -= 0x34;
-       memcpy(&VGMData[0x00], &VGMHead, SmplVal);
-       
-       return;
-}
index bce92ec3b03900bfbc9c05842a430a9a2e02c6e5..8fe488a58a526808731d0ba0c9c24c5a343d1439 100755 (executable)
@@ -35,6 +35,9 @@ vrl2vrs
 vrsdump\r
 vrldbg\r
 dro2imf\r
+dro2vgm\r
+imf2vgm\r
+raw2vgm\r
 ps.exe\r
 *.upx\r
 # except foo.html which is maintained by hand.\r
index ab23923cea042db02cd8644a5bb594002b46a551..657e577f94d606ea9f1f9b1695563e0b90d2406c 100755 (executable)
@@ -1,6 +1,6 @@
 [submodule "src/lib/doslib"]
-        path = src/lib/doslib
-        url = https://github.com/joncampbell123/doslib.git
+       path = src/lib/doslib
+       url = https://github.com/joncampbell123/doslib.git
 
 [submodule "src/lib/jsmn"]
        path = src/lib/jsmn
        url = https://github.com/FlatRockSoft/CatacombApocalypse.git
 
 [submodule "wolf3d"]
-        path = 16/wolf3d
-        url = https://github.com/id-Software/wolf3d.git
+       path = 16/wolf3d
+       url = https://github.com/id-Software/wolf3d.git
 
 [submodule "keen"]
-        path = 16/keen
+       path = 16/keen
        url = https://github.com/keendreams/keen.git
 
 [submodule "Catacomb3D"]
-        path = 16/Catacomb3D
+       path = 16/Catacomb3D
        url = https://github.com/FlatRockSoft/Catacomb3D.git
 
 [submodule "shitman"]
-        path = 16/shitman
-        url = https://github.com/joncampbell123/shitman.git
+       path = 16/shitman
+       url = https://github.com/joncampbell123/shitman.git
 
 [submodule "dro2imf"]
        path = "16/dro2imf"
        url = https://github.com/Malvineous/dro2imf.git
+
+[submodule "vgmtools"]
+       path = "16/vgmtools"
+       url = https://github.com/vgmrips/vgmtools.git
diff --git a/src/util/shbat/run.bat b/src/util/shbat/run.bat
new file mode 100755 (executable)
index 0000000..093735f
--- /dev/null
@@ -0,0 +1,5 @@
+@echo off\r
+wmake clean\r
+wmake exmmtest.exe > exmmtest.16\r
+@rem wmake\ 2scroll.exe > scroll.16\r
+@rem wmake maptest.exe\ 2maptest.exe > maptest.16\r
diff --git a/src/util/shbat/winnbuil.sh b/src/util/shbat/winnbuil.sh
new file mode 100755 (executable)
index 0000000..e665230
--- /dev/null
@@ -0,0 +1,2 @@
+wmake -h clean
+wmake -h inntest.exe
diff --git a/src/util/shbat/winrun.bat b/src/util/shbat/winrun.bat
new file mode 100755 (executable)
index 0000000..6717a78
--- /dev/null
@@ -0,0 +1,2 @@
+db\dosbox -conf data\winrun.cfg -exit
+exit
diff --git a/zcroll.exe b/zcroll.exe
new file mode 100755 (executable)
index 0000000..1896348
Binary files /dev/null and b/zcroll.exe differ