]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_mm.c
__seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd...
[16.git] / src / lib / 16_mm.c
index 67059b39c245d74d1123270f8e2bb4f019b87adf..fb308db63950e31230d3658e29ec93156f802cfc 100755 (executable)
@@ -90,17 +90,18 @@ boolean MML_CheckForEMS(void)
 {
        boolean emmcfems = false;
        word            EMSPageFrame = 0;
+       byte    err=0, str[64];
        static char     emmname[] = "EMMXXXX0"; //fix by andrius4669
        __asm {
                mov     dx,OFFSET emmname       //fix by andrius4669
                mov     ax,0x3d00
-               int     0x21            // try to open EMMXXXX0 device
+               int     EMM_INT         // try to open EMMXXXX0 device
                jc      error
 
                mov     bx,ax
                mov     ax,0x4400
 
-               int     0x21            // get device info
+               int     EMM_INT         // get device info
                jc      error
 
                and     dx,0x80
@@ -108,13 +109,13 @@ boolean MML_CheckForEMS(void)
 
                mov     ax,0x4407
 
-               int     0x21            // get status
+               int     EMM_INT         // get status
                jc      error
                or      al,al
                jz      error
 
                mov     ah,0x3e
-               int     0x21            // close handle
+               int     EMM_INT         // close handle
                jc      error
 
                //
@@ -141,6 +142,7 @@ boolean MML_CheckForEMS(void)
                //
                // EMS is bad
                //
+               mov     err,ah
                mov     emmcfems,0
 #ifdef __BORLANDC__
        }
@@ -159,7 +161,13 @@ boolean MML_CheckForEMS(void)
 #if defined(__DEBUG_PM__) || defined(__DEBUG_MM__)
                printf("MML_CheckForEMS: EMS error No Pageframe!\nAddress detected to be %04x\n", EMSPageFrame);
 #endif
+       }else   if(!emmcfems)// if there is an error and page frame is not 0000
+       {
+               strcpy(str,"MML_CheckForEMS: EMS error ");
+               MM_EMSerr(str, err);
+               printf("%s\n",str);
        }
+
        return(emmcfems);
 }
 
@@ -1160,7 +1168,7 @@ void MM_SortMem(global_game_variables_t *gvar)
                        playing += STARTADLIBSOUNDS;
                        break;
                }
-               MM_SetLock(&(memptr)audiosegs[playing],true);
+               MM_SetLock((memptr *)&audiosegs[playing],true);
        }
 
 
@@ -1236,7 +1244,7 @@ void MM_SortMem(global_game_variables_t *gvar)
 //     VW_ColorBorder (oldborder);
 
 /*++++ if(playing)
-               MM_SetLock(&(memptr)audiosegs[playing],false);*/
+               MM_SetLock((memptr *)&audiosegs[playing],false);*/
 }
 
 //==========================================================================