]> 4ch.mooo.com Git - 16.git/commitdiff
====ems was broke on previous builds of this day so reverted something back====
authorsparky4 <sparky4@cock.li>
Wed, 28 Sep 2016 20:36:00 +0000 (15:36 -0500)
committersparky4 <sparky4@cock.li>
Wed, 28 Sep 2016 20:36:00 +0000 (15:36 -0500)
src/lib/16_pm.c

index 090145a17246750b83b0be5352e9a3e995e53a5d..26acb3b550e9e5bff4e3212e95328c6712abdc74 100755 (executable)
@@ -156,50 +156,50 @@ PML_StartupEMS(global_game_variables_t *gvar)
                mov     dx,OFFSET emmname       //fix by andrius4669\r
                mov     ax,0x3d00\r
                int     EMS_INT         // try to open EMMXXXX0 device\r
-               jc      erroreu\r
+               jc      error1\r
 \r
                mov     bx,ax\r
                mov     ax,0x4400\r
 \r
                int     EMS_INT         // get device info\r
-               jc      erroreu\r
+               jc      error1\r
 \r
                and     dx,0x80\r
-               jz      erroreu\r
+               jz      error1\r
 \r
                mov     ax,0x4407\r
 \r
                int     EMS_INT         // get status\r
-               jc      erroreu\r
+               jc      error1\r
                or      al,al\r
-               jz      erroreu\r
+               jz      error1\r
 \r
                mov     ah,0x3e\r
                int     EMS_INT         // close handle\r
-               jc      erroreu\r
+               jc      error1\r
 \r
                mov     ah,EMS_STATUS\r
                int     EMS_INT\r
-               jc      erroreu                 // make sure EMS hardware is present\r
+               jc      error                 // make sure EMS hardware is present\r
 \r
                mov     ah,EMS_VERSION\r
                int     EMS_INT                 // only work on EMS 3.2 or greater (silly, but...)\r
                or      ah,ah\r
-               jnz     erroreu\r
+               jnz     error1\r
                mov     [EMSVer],ax             //      set EMSVer\r
                cmp     al,0x32                 // only work on ems 3.2 or greater\r
-               jb      erroreu\r
+               jb      error1\r
 \r
                mov     ah,EMS_GETFRAME\r
                int     EMS_INT                 // find the page frame address\r
                or      ah,ah\r
-               jnz     erroreu\r
+               jnz     error1\r
                mov     [EMSPageFrame],bx\r
 \r
                mov     ah,EMS_GETPAGES\r
                int     EMS_INT                 // find out how much EMS is there\r
                or      ah,ah\r
-               jnz     erroreu\r
+               jnz     error1\r
                or      bx,bx\r
                jz      noEMS                   // no EMS at all to allocate\r
                cmp     bx,2\r
@@ -207,22 +207,22 @@ PML_StartupEMS(global_game_variables_t *gvar)
                mov     [totalEMSpages],dx\r
                mov     [freeEMSpages],bx\r
                mov     [EMSAvail],bx\r
-               jmp     Endeu\r
+               jmp End1\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
-               erroreu:\r
+       error1:\r
 #ifdef __BORLANDC__\r
        __asm {\r
 #endif\r
                mov     err,ah\r
                mov     errorflag,1\r
-               jmp     Endeu\r
+               jmp End1\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
-               noEMS:\r
-               Endeu:\r
+noEMS:\r
+End1:\r
 #ifdef __WATCOMC__\r
        }\r
 #endif\r
@@ -240,34 +240,32 @@ PML_StartupEMS(global_game_variables_t *gvar)
 */\r
        __asm {\r
                mov     ah,EMS_ALLOCPAGES\r
-               mov     bx,[EMSAvail]\r
+               mov     bx,[EMSAvail];\r
                int     EMS_INT\r
                or      ah,ah\r
-               jnz     erroreuu\r
+               jnz     error2\r
                mov     [EMSHandle],dx\r
-               jmp     Endeuu\r
+               jmp     End2\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
-               erroreuu:\r
+       error2:\r
 #ifdef __BORLANDC__\r
        __asm {\r
 #endif\r
                mov     err,ah\r
                mov     errorflag,1\r
-               jmp Endeuu\r
+               jmp End2\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
-               Endeuu:\r
+End2:\r
 #ifdef __WATCOMC__\r
        }\r
 #endif\r
 \r
        if(errorflag==false)\r
        {\r
-       //gvar->pm.emm.EMSAvail = EMSAvail;\r
-       //gvar->mmi.EMSmem = gvar->pm.emm.EMSAvail * (dword)EMSPageSize;\r
        gvar->mmi.EMSmem = EMSAvail * (dword)EMSPageSize;\r
 \r
        // Initialize EMS mapping cache\r
@@ -285,6 +283,7 @@ PML_StartupEMS(global_game_variables_t *gvar)
 \r
        gvar->pm.emm.EMSPresent = true;                 // We have EMS\r
        gvar->pm.emm.EMSPageFrame = EMSPageFrame;\r
+       gvar->pm.emm.EMSAvail = EMSAvail;\r
        gvar->pm.emm.EMSVer = EMSVer;\r
        gvar->pm.emm.EMSHandle = EMSHandle;\r
        gvar->pm.emm.freeEMSpages = freeEMSpages;\r