#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
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
\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
#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
#endif\r
\r
#endif\r
-\r
}\r
#endif\r
\r
+#define PFDT printf(".");\r
+\r
#endif/*_TYPE_H_*/\r
\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
#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
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
#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
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
*/\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