]> 4ch.mooo.com Git - 16.git/commitdiff
/dev/zero done it again!! ^^
authorsparky4 <sparky4@cock.li>
Sat, 27 Jun 2015 00:03:14 +0000 (19:03 -0500)
committersparky4 <sparky4@cock.li>
Sat, 27 Jun 2015 00:03:14 +0000 (19:03 -0500)
modified:   16/cawat/16_mm.c

16/cawat/16_mm.c

index 2da0d65806a341f2e863bc953094fcb5fcf21f13..8c28277aff7580aa13504a9bf778e6bc3914e72a 100644 (file)
@@ -42,8 +42,8 @@ EMS / XMS unmanaged routines
 =============================================================================\r
 */\r
 \r
-//#include "LIB_HEAD.H"
-#include "16_mm.h"
+//#include "LIB_HEAD.H"\r
+#include "16_mm.h"\r
 \r
 /*\r
 =============================================================================\r
@@ -97,7 +97,7 @@ void          (* aftersort) (void);
 */\r
 \r
 boolean                mmstarted;\r
-
+\r
 void huge      *hugeheap;\r
 void far       *farheap;\r
 void           *nearheap;\r
@@ -125,12 +125,12 @@ unsigned  numUMBs,UMBbase[MAXUMBS];
 */\r
 \r
 boolean MML_CheckForEMS (void)\r
-{
-       boolean emmcfems;
-       char    emmname[] = "EMMXXXX0";
-
-       __asm {
-               mov     dx,OFF=emmname\r
+{\r
+       boolean emmcfems;\r
+       char    emmname[] = "EMMXXXX0";\r
+//             mov     dx,OFFSET emmname\r
+       __asm {\r
+               LEA     DX, emmname     //fix by andrius4669\r
                mov     ax,0x3d00\r
                int     0x21            // try to open EMMXXXX0 device\r
                jc      error\r
@@ -153,19 +153,19 @@ boolean MML_CheckForEMS (void)
 \r
                mov     ah,0x3e\r
                int     0x21            // close handle\r
-               jc      error
+               jc      error\r
                //\r
                // EMS is good\r
-               //
-               mov     emmcfems,1
-               jmp End
-               error:
+               //\r
+               mov     emmcfems,1\r
+               jmp End\r
+               error:\r
                //\r
                // EMS is bad\r
                //\r
-               mov     emmcfems,0
-               End:
-       }
+               mov     emmcfems,0\r
+               End:\r
+       }\r
        return(emmcfems);\r
 }\r
 \r
@@ -181,12 +181,12 @@ boolean MML_CheckForEMS (void)
 void MML_SetupEMS (void)\r
 {\r
        char    str[80],str2[10];\r
-       unsigned        err;
+       unsigned        err;\r
        struct REGS CPURegs;\r
 \r
        totalEMSpages = freeEMSpages = EMSpageframe = EMSpagesmapped = 0;\r
 \r
-       __asm
+       __asm\r
                {\r
                mov     ah,EMS_STATUS\r
                int     EMS_INT                                         // make sure EMS hardware is present\r
@@ -217,24 +217,24 @@ void MML_SetupEMS (void)
 \r
                cmp     bx,4\r
                jle     getpages                                        // there is only 1,2,3,or 4 pages\r
-               mov     bx,4                                            // we can't use more than 4 pages
-
-getpages:
+               mov     bx,4                                            // we can't use more than 4 pages\r
+\r
+getpages:\r
                mov     [EMSpagesmapped],bx\r
                mov     ah,EMS_ALLOCPAGES                       // allocate up to 64k of EMS\r
                int     EMS_INT\r
                or      ah,ah\r
                jnz     error\r
-               mov     [EMShandle],dx
-               jmp End
+               mov     [EMShandle],dx\r
+               jmp End\r
 error:\r
 //             err = CPURegs.h.ah;\r
 //             strcpy (str,"MML_SetupEMS: EMS error 0x");\r
 //             itoa(err,str2,16);\r
 //             strcpy (str,str2);\r
-//             printf("%s\n",str);
-               jmp End
-noEMS:
+//             printf("%s\n",str);\r
+               jmp End\r
+noEMS:\r
 End:\r
        }\r
 }\r
@@ -253,14 +253,14 @@ void MML_ShutdownEMS (void)
        if (!EMShandle)\r
                return;\r
 \r
-       __asm
+       __asm\r
        {\r
                mov     ah,EMS_FREEPAGES\r
                mov     dx,[EMShandle]\r
                int     EMS_INT\r
                or      ah,ah\r
-               jz      ok
-               printf("MML_ShutdownEMS: Error freeing EMS!");
+               jz      ok\r
+               printf("MML_ShutdownEMS: Error freeing EMS!");\r
                ok:\r
        }\r
 }\r
@@ -285,7 +285,7 @@ void MM_MapEMS (void)
 \r
        for (i=0;i<EMSpagesmapped;i++)\r
        {\r
-               __asm
+               __asm\r
                {\r
                        mov     ah,EMS_MAPPAGE\r
                        mov     bx,[i]                  // logical page\r
@@ -293,14 +293,14 @@ void MM_MapEMS (void)
                        mov     dx,[EMShandle]  // handle\r
                        int     EMS_INT\r
                        or      ah,ah\r
-                       jnz     error
-                       jmp End
+                       jnz     error\r
+                       jmp End\r
                        error:\r
                        error = _AH;\r
                        strcpy (str,"MM_MapEMS: EMS error 0x");\r
                        itoa(error,str2,16);\r
                        strcpy (str,str2);\r
-                       printf("%s\n",str);
+                       printf("%s\n",str);\r
                        End:\r
                }\r
        }\r
@@ -323,12 +323,12 @@ boolean MML_CheckForXMS (void)
 {\r
        numUMBs = 0;\r
 \r
-       __asm
+       __asm\r
        {\r
                mov     ax,0x4300\r
                int     0x2f                            // query status of installed diver\r
                cmp     al,0x80\r
-               je      good
+               je      good\r
                good:\r
        }\r
 /*     return false;\r
@@ -351,7 +351,7 @@ void MML_SetupXMS (void)
 {\r
        unsigned        base,size;\r
 \r
-       __asm
+       __asm\r
        {\r
                mov     ax,0x4310\r
                int     0x2f\r
@@ -375,7 +375,7 @@ getmemory:
 \r
 gotone:\r
        mov     [base],bx\r
-       mov     [size],dx
+       mov     [size],dx\r
        done:\r
        }\r
        MML_UseSpace (base,size);\r
@@ -403,11 +403,11 @@ void MML_ShutdownXMS (void)
        for (i=0;i<numUMBs;i++)\r
        {\r
                base = UMBbase[i];\r
-               __asm
+               __asm\r
                {\r
                        mov     ah,XMS_FREEUMB\r
                        mov     dx,[base]\r
-                       call    [DWORD PTR XMSaddr]
+                       call    [DWORD PTR XMSaddr]\r
                }\r
        }\r
 }\r