]> 4ch.mooo.com Git - 16.git/commitdiff
no idea how to get sdtest to play music. i got math homework and work work to do 1st
authorsparky4 <sparky4@cock.li>
Fri, 15 Sep 2017 17:38:59 +0000 (12:38 -0500)
committersparky4 <sparky4@cock.li>
Fri, 15 Sep 2017 17:38:59 +0000 (12:38 -0500)
src/lib/16_sd.c
src/lib/16_sd.h
src/lib/16_t.h
src/lib/16_tail.c
src/lib/16_tail.h
src/lib/16_tdef.h
src/paltest.c
src/sdtest.c

index f09028382262294041d36ed2100f1e81f14facbc..e77fb92a533d8fd0c471aa3a4c03db8d6275e327 100755 (executable)
@@ -70,8 +70,6 @@
 #define        writereg(n)     outportb(alFMData,n)\r
 #define        readstat()      inportb(alFMStatus)\r
 \r
-//#define SD_USECATA3DSETTIMERSPEED\r
-\r
 //     Imports from ID_SD_A.ASM\r
 /*extern*/     void                    SDL_SetDS(void);\r
 /*extern*/     void interrupt  SDL_t0ExtremeAsmService(void);//,\r
@@ -461,7 +459,7 @@ SDL_InitDelay(void)
        int             i;\r
        word    timer;\r
 \r
-       setvect(8,SDL_TimingService);           // Set to my timer 0 ISR\r
+//++++ setvect(8,SDL_TimingService);           // Set to my timer 0 ISR\r
 \r
        SDL_SetIntsPerSec(1000);                        // Time 1ms\r
 \r
@@ -1709,7 +1707,7 @@ SD_Startup(global_game_variables_t *gvar)
 \r
        t0OldService = getvect(8);      // Get old timer 0 ISR\r
 #ifdef SD_USECATA3DSETTIMERSPEED\r
-//++++ SDL_InitDelay();                        // SDL_InitDelay() uses t0OldService\r
+       SDL_InitDelay();                        // SDL_InitDelay() uses t0OldService\r
 \r
        setvect(8,SDL_t0Service);       // Set to my timer 0 ISR\r
 #endif\r
index 12558e66bb45d3e76e6063c63aa6abb6ddf635d7..53beec8c254434e53618b90a1be5591e85f91307 100755 (executable)
@@ -34,6 +34,8 @@
 #include "src/lib/16_head.h"\r
 #include "src/lib/16_pm.h"\r
 \r
+//#define SD_USECATA3DSETTIMERSPEED\r
+\r
 void   alOut(byte n,byte b);\r
 \r
 #ifdef __DEBUG__\r
@@ -260,4 +262,3 @@ extern      void    SDL_PCPlaySound(PCSound far *sound, global_game_variables_t *gvar),
 #endif\r
 \r
 #endif\r
-\r
index de709bdfc0789096d692f0c06f8cf93544e5da3c..a935d8cd5f1ba9e8eb6b39ea8dff697c76ed4b97 100755 (executable)
@@ -133,4 +133,6 @@ inline void gotoxy(int x,int y)
 }\r
 #endif\r
 \r
+#define PFDT   printf(".");\r
+\r
 #endif/*_TYPE_H_*/\r
index 11c5765ed21beee4458d3e2db9076de132a97939..4d6040cb640fcbb51a9907bf805aeb7998b76c3d 100755 (executable)
@@ -409,6 +409,69 @@ noxor:
 \r
 //===========================================================================\r
 \r
+/*\r
+=============================================================================\r
+\r
+                                               MUSIC STUFF\r
+\r
+=============================================================================\r
+*/\r
+\r
+\r
+/*\r
+=================\r
+=\r
+= StopMusic\r
+=\r
+=================\r
+*/\r
+\r
+void TL_StopMusic(global_game_variables_t *gvar)\r
+{\r
+       int     i;\r
+\r
+       SD_MusicOff();\r
+       for (i = 0;i < LASTMUSIC;i++)\r
+               if (gvar->ca.audiosegs[STARTMUSIC + i])\r
+               {\r
+                       MM_SetPurge(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + i],3, gvar);\r
+                       MM_SetLock(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + i],false, gvar);\r
+               }\r
+}\r
+\r
+//==========================================================================\r
+\r
+\r
+/*\r
+=================\r
+=\r
+= StartMusic\r
+=\r
+=================\r
+*/\r
+\r
+void TL_StartMusic(global_game_variables_t *gvar)\r
+{\r
+       musicnames      chunk;\r
+\r
+       SD_MusicOff();\r
+       chunk = 0;//++++songs[gamestate.mapon+gamestate.episode*10];\r
+\r
+//     if ((chunk == -1) || (MusicMode != smm_AdLib))\r
+//DEBUG control panel          return;\r
+\r
+//++++ MM_BombOnError (false,gvar);\r
+//++++ CA_CacheAudioChunk(STARTMUSIC + chunk, gvar);\r
+//++++ MM_BombOnError (true,gvar);\r
+//++++ if (gvar->mm.mmerror)\r
+//++++         gvar->mm.mmerror = false;\r
+//++++ else\r
+//++++ {\r
+               MM_SetLock(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + chunk],true, gvar);\r
+               SD_StartMusic((MusicGroup far *)gvar->ca.audiosegs[STARTMUSIC + chunk]);\r
+//++++ }\r
+}\r
+\r
 /*\r
 ==================\r
 =\r
index 4f8ed486b562c1bc9fb39acb1c061edc04645100..1a8e48a483ab19a9657ce8618938ac464927bf13 100755 (executable)
@@ -29,6 +29,7 @@
 #include "src/lib/16_mm.h"\r
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_in.h"\r
+#include "src/lib/16_sd.h"\r
 #include "src/lib/16_dbg.h"\r
 #include "src/lib/16_vl.h"\r
 #include "src/lib/testpatt.h"\r
@@ -134,6 +135,8 @@ void        Shutdown16(global_game_variables_t *gvar),
 void TL_DosLibStartup(global_game_variables_t *gvar);\r
 void TL_VidInit(global_game_variables_t *gvar);\r
 boolean FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar);\r
+void TL_StartMusic(global_game_variables_t *gvar);\r
+void TL_StopMusic(global_game_variables_t *gvar);\r
 void DebugMemory_(global_game_variables_t *gvar, boolean q);\r
 void ClearMemory (global_game_variables_t *gvar);\r
 void Quit (global_game_variables_t *gvar, char *error);\r
index 902225268101cbf35aaf29d2de8e8a6d9fc7c2fd..f6b3e68c7c5092486108e06dbe3204430f8b0785 100755 (executable)
@@ -678,7 +678,7 @@ typedef enum {
 #define STARTPCSOUNDS          0\r
 #define STARTADLIBSOUNDS       87\r
 #define STARTDIGISOUNDS                174\r
-#define STARTMUSIC             261\r
+#define STARTMUSIC             0//++++261\r
 \r
 //\r
 // Music names & indexes\r
index dff2f9a013db4708c4a1f4951f0eb250f881e205..21f6a8119da8a3897189bb04a96f82a1ef178356 100755 (executable)
@@ -47,7 +47,7 @@ void copyboxesmodex(page_t *page, boolean pn)
 void main(int argc, char *argv[])\r
 {\r
        static word paloffset=0;\r
-       static global_game_variables_t gvar;\r
+       global_game_variables_t gvar;\r
 \r
 //     map_view_t mv[4];\r
        map_t map;\r
index 8511cac91ae8e221e9bbda73e208e8b796113e16..4e11d113308b9a558eda3cb3510e341f3193af9c 100755 (executable)
  */\r
 \r
 #include "src/lib/16_sd.h"\r
+#include "src/lib/16_tail.h"\r
 \r
-void main()\r
+void main(int argc,char **argv)\r
 {\r
-       /*static */global_game_variables_t gvar;\r
+       ScanCode scancode;\r
+       static global_game_variables_t gvar;\r
+       StartupCAMMPM(&gvar);\r
+       if(!CA_LoadFile(argv[1], MEMPTRCONV gvar.ca.audiosegs[0], &gvar))\r
+       {\r
+               printf("Failed to load IMF Music\n");\r
+               ShutdownCAMMPM(&gvar);\r
+               return;\r
+       }\r
+       IN_Startup(&gvar);\r
        printf("start\n");\r
        SD_Startup(&gvar);\r
+       TL_StartMusic (&gvar);\r
+       while (!(scancode = gvar.in.inst->LastScan)){}\r
        printf("shutdown\n");\r
+       TL_StopMusic(&gvar);\r
        SD_Shutdown(&gvar);\r
+       IN_Shutdown(&gvar);\r
+       ShutdownCAMMPM(&gvar);\r
 }\r