]> 4ch.mooo.com Git - 16.git/commitdiff
ok!
authorsparky4 <sparky4@cock.li>
Tue, 21 Jul 2015 15:28:06 +0000 (10:28 -0500)
committersparky4 <sparky4@cock.li>
Tue, 21 Jul 2015 15:28:06 +0000 (10:28 -0500)
modified:   awoo.sh
modified:   exmmtest.exe
modified:   src/lib/16_mm.c
modified:   src/lib/16_mm.h

awoo.sh
exmmtest.exe
src/lib/16_mm.c
src/lib/16_mm.h

diff --git a/awoo.sh b/awoo.sh
index 9e26c560dbbd41830da5d0e8d28897f8eb408b03..5ef0ca1556a539dedbc726c179d6a5ea5b3884af 100644 (file)
--- a/awoo.sh
+++ b/awoo.sh
@@ -1,3 +1,4 @@
 #!/bin/bash
 git add .
 bash ./boop.sh
+cp exmmtest.exe /var/www/html/
index d13e21ed3fc608108fbc1e8d66997ae2849ba83e..22a4fa56d6dad04c5d383a827a6832d25e3ca6b5 100644 (file)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
index e48ccf9f0caa5e1a7ba44b6622ae21c217c40b78..fda0a9ddc8aa5eba65ab9f0efb5386426cac163e 100644 (file)
@@ -264,10 +264,10 @@ void MML_ShutdownEMS(mminfo_t *mm)
 ====================
 */
 
-byte MM_MapEMS(mminfo_t *mm)
+byte MM_MapEMS(mminfo_t *mm, mminfotype *mmi)
 {
-       char    str[80];//,str2[10];
-       unsigned        /*err, */EMShandle;
+       char    str[80];
+       unsigned        EMShandle;
        byte err;
        boolean errorflag=false;
        int     i;
@@ -302,10 +302,11 @@ byte MM_MapEMS(mminfo_t *mm)
                        return err;
                }
        }
+       mmi->EMSmem = (i)*0x4000lu;
        return 0;
 }
 
-byte MM_MapXEMS(mminfo_t *mm)
+byte MM_MapXEMS(mminfo_t *mm, mminfotype *mmi)
 {
 
 //SUB EMS.MapXPages (PhysicalStart, LogicalStart, NumPages, Handle)\r
@@ -330,9 +331,9 @@ byte MM_MapXEMS(mminfo_t *mm)
 //     EMS.Error = (Regs.ax AND &HFF00&) \ &H100  //Store the status code\r
 \r
 //END SUB
-       char    str[80];//,str2[10];
-       unsigned        EMShandle;
+       char    str[80];
        byte err;
+       word    EMShandle;
        boolean errorflag=false;
        int     i;
        EMShandle=mm->EMShandle;
@@ -344,7 +345,7 @@ byte MM_MapXEMS(mminfo_t *mm)
        {
                __asm
                {
-                       mov     ah,EMS_MAPXPAGE
+                       mov     ax,EMS_MAPXPAGE
                        mov     cx,[i]                  // logical page
                        mov     al,bl                   // physical page
                        mov     dx,[EMShandle]  // handle
@@ -369,6 +370,7 @@ byte MM_MapXEMS(mminfo_t *mm)
                        return err;
                }
        }
+       mmi->EMSmem = (i)*0x4000lu;
        return 0;
 }
 
@@ -698,7 +700,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi)
 //
 // detect EMS and allocate up to 64K at page frame
 //
-       printf("EMS!\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");       //bug!
+       printf("EMS1\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");       //bug!
        mmi->EMSmem = 0;
        for(i = 1;i < __argc;i++)
        {
@@ -708,16 +710,17 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi)
        printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");     //bug!
        if(MML_CheckForEMS())
        {
-printf("EMS1\n");
-               MML_SetupEMS(mm);                                       // allocate space
 printf("EMS2\n");
+               MML_SetupEMS(mm);                                       // allocate space
+printf("EMS3\n");
                printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");     //bug!
                //TODO: EMS4! AND EMS 3.2 MASSIVE DATA HANDLMENT!
                MML_UseSpace(mm->EMSpageframe,(MAPPAGES)*0x4000lu, mm);
-printf("EMS3\n");
-               MM_MapEMS(mm);                                  // map in used pages
 printf("EMS4\n");
-               mmi->EMSmem = (MAPPAGES)*0x4000lu;
+               if(mm->EMSVer<0x40)
+                       MM_MapEMS(mm, mmi);                                     // map in used pages
+               else
+                       MM_MapXEMS(mm, mmi);                                    // map in used pages
        }
 
 //
index 974af530d5b1b3e3609dede54e1b0cba09267b36..8b729644ef84636c26d4c26c0f61622a581843eb 100644 (file)
@@ -54,7 +54,7 @@
 #define        EMS_GETPAGES    0x42
 #define        EMS_ALLOCPAGES  0x43
 #define        EMS_MAPPAGE             0x44
-#define        EMS_MAPXPAGE            0x50
+#define        EMS_MAPXPAGE            0x5000
 #define        EMS_FREEPAGES   0x45
 #define        EMS_VERSION             0x46
 
@@ -166,8 +166,8 @@ typedef struct
 boolean MML_CheckForEMS(void);
 byte MML_SetupEMS(mminfo_t *mm);
 void MML_ShutdownEMS(mminfo_t *mm);
-byte MM_MapEMS(mminfo_t *mm);
-byte MM_MapXEMS(mminfo_t *mm);
+byte MM_MapEMS(mminfo_t *mm, mminfotype *mmi);
+byte MM_MapXEMS(mminfo_t *mm, mminfotype *mmi);
 boolean MML_CheckForXMS(mminfo_t *mm);
 void MML_SetupXMS(mminfo_t *mm, mminfotype *mmi);
 void MML_ShutdownXMS(mminfo_t *mm);