#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
- SDL_IndicatePC(boolean on);\r
+#if 0\r
+/*extern*/ void SDL_SetDS(void);\r
/*extern*/ void interrupt SDL_t0ExtremeAsmService(void),\r
SDL_t0FastAsmService(void),\r
SDL_t0SlowAsmService(void);\r
+#endif\r
+ void SDL_IndicatePC(boolean on);\r
\r
// Global variables\r
boolean SoundSourcePresent,\r
static boolean DigiMissed,DigiLastSegment;\r
static memptr DigiNextAddr;\r
static word DigiNextLen;\r
+ boolean pcindicate;\r
\r
#if 0\r
// SoundBlaster variables\r
static word alFXReg;\r
static ActiveTrack *tracks[sqMaxTracks];//,\r
//-- mytracks[sqMaxTracks];\r
-static word sqMode,sqFadeStep;\r
+//--static word sqMode,sqFadeStep;\r
word far *sqHack,far *sqHackPtr,sqHackLen,sqHackSeqLen;\r
long sqHackTime;\r
\r
SDL_SetTimer0(1192030 / ints);\r
}\r
\r
+#ifndef SD_USECATA3DSETTIMERSPEED\r
static void\r
SDL_SetTimerSpeed(void)\r
{\r
TimerRate = rate;\r
}\r
}\r
+#else\r
+static void\r
+SDL_SetTimerSpeed(void)\r
+{\r
+ word rate;\r
+\r
+ if (MusicMode == smm_AdLib)\r
+ rate = TickBase * 8;\r
+ else\r
+ rate = TickBase * 2;\r
+ SDL_SetIntsPerSec(rate);\r
+}\r
+#endif\r
\r
///////////////////////////////////////////////////////////////////////////\r
//\r
// SDL_SetInstrument() - Puts an instrument into a generator\r
//\r
///////////////////////////////////////////////////////////////////////////\r
-static void\r
+//static void\r
+void\r
SDL_SetInstrument(int track,int which,Instrument far *inst,boolean percussive)\r
{\r
byte c,m;\r
status1 = readstat();\r
alOut(2,0xff); // Set timer 1\r
alOut(4,0x21); // Start timer 1\r
-#if 0\r
SDL_Delay(TimerDelay100);\r
-#else\r
+\r
+#if 0\r
__asm {\r
mov dx,0x388\r
mov cx,100\r
return(false);\r
}\r
\r
-#if 0\r
///////////////////////////////////////////////////////////////////////////\r
//\r
// SDL_t0Service() - My timer 0 ISR which handles the different timings and\r
// dispatches to whatever other routines are appropriate\r
//\r
///////////////////////////////////////////////////////////////////////////\r
-static void interrupt\r
+//static void interrupt\r
+void interrupt\r
SDL_t0Service(void)\r
{\r
static word count = 1;\r
+ boolean myackflag = 0;\r
\r
-#if 1 // for debugging\r
+//00#if 0 // for debugging\r
asm mov dx,STATUS_REGISTER_1\r
asm in al,dx\r
asm mov dx,ATR_INDEX\r
asm out dx,al\r
asm mov al,4 // red\r
asm out dx,al\r
-#endif\r
+//00#endif\r
\r
HackCount++;\r
\r
if ((MusicMode == smm_AdLib) || (DigiMode == sds_SoundSource))\r
{\r
SDL_ALService();\r
- SDL_SSService();\r
+//SS SDL_SSService();\r
// if (!(++count & 7))\r
if (!(++count % 10))\r
{\r
}\r
}\r
\r
-asm mov ax,[WORD PTR TimerCount]\r
-asm add ax,[WORD PTR TimerDivisor]\r
-asm mov [WORD PTR TimerCount],ax\r
-asm jnc myack\r
- t0OldService(); // If we overflow a word, time to call old int handler\r
-asm jmp olddone\r
-myack:;\r
- outportb(0x20,0x20); // Ack the interrupt\r
-olddone:;\r
+ __asm {\r
+ mov ax,[WORD PTR TimerCount]\r
+ add ax,[WORD PTR TimerDivisor]\r
+ mov [WORD PTR TimerCount],ax\r
+ jnc myack\r
+ jmp end1\r
+#ifdef __BORLANDC__\r
+ }\r
+#endif\r
+myack:\r
+#ifdef __BORLANDC__\r
+ __asm {\r
+#endif\r
+ mov myackflag,1\r
+#ifdef __BORLANDC__\r
+ }\r
+#endif\r
+end1:\r
+#ifdef __WATCOMC__\r
+ }\r
+#endif\r
+ if(!myackflag)\r
+ t0OldService(); // If we overflow a word, time to call old int handler\r
+ else\r
+ outportb(0x20,0x20); // Ack the interrupt\r
\r
-#if 1 // for debugging\r
+//00#if 0 // for debugging\r
asm mov dx,STATUS_REGISTER_1\r
asm in al,dx\r
asm mov dx,ATR_INDEX\r
asm out dx,al\r
asm mov al,0x20 // normal\r
asm out dx,al\r
-#endif\r
+//00#endif\r
}\r
-#endif\r
\r
////////////////////////////////////////////////////////////////////////////\r
//\r
}\r
SoundNumber = SoundPriority = 0;\r
}\r
+#if 0\r
+static void\r
+SDL_SetTimerSpeed(void)\r
+{\r
+ word rate;\r
\r
+ if (MusicMode == smm_AdLib)\r
+ rate = TickBase * 8;\r
+ else\r
+ rate = TickBase * 2;\r
+ SDL_SetIntsPerSec(rate);\r
+}\r
+#endif\r
// Public routines\r
\r
///////////////////////////////////////////////////////////////////////////\r
if (SD_Started)\r
return;\r
\r
- SDL_SetDS();\r
+//?? SDL_SetDS();\r
\r
ssIsTandy = false;\r
//SS ssNoCheck = false;\r
\r
t0OldService = getvect(8); // Get old timer 0 ISR\r
\r
+ SDL_InitDelay(); // SDL_InitDelay() uses t0OldService\r
+\r
+ setvect(8,SDL_t0Service); // Set to my timer 0 ISR\r
LocalTime = TimeCount = alTimeCount = 0;\r
\r
SD_SetSoundMode(sdm_Off, gvar);\r
else\r
outp(0x20,0x20);\r
}\r
-\r
+#endif\r
void SDL_IndicatePC(boolean ind)\r
{\r
pcindicate=ind;\r
}\r
-\r
+#if 0\r
void\r
SDL_DigitizedDoneInIRQ(void)\r
{\r