]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/exmm/emm.c
^o^ cleaned~
[16.git] / src / lib / exmm / emm.c
index a20809918dcaaf6901789e4a72898823e4ae4cd8..c7ad3496897c047172d9932b891b4a4986cbcc1e 100644 (file)
 #include <mem.h>\r
 #include <conio.h>
 \r
-#include "memory.h"\r
+#include "memory.h"
+#include "../types.h"
+
+#define PEMMDATAPAGENUM        4\r
 \r
 void TransformData(char *pEmmData, unsigned int len)\r
 {\r
@@ -71,22 +74,14 @@ int main(int argc, char *argv[])
 
 
        printf("Map 1st 4 pages\n");\r
-       MapEMM(hEData, 0, 4);   // load 1st 4 pages into page frame: 0-3\r
+       MapEMM(hEData, 0, PEMMDATAPAGENUM);   // load 1st 4 pages into page frame: 0-3\r
        //memset(pEmmData, 0x0e, 64000u);
 //0000 printf("(advi*EMMPAGESIZE)=%lu\n", advi);
        memset(pEmmData, atoi(argv[1]), 0xffff);//sizeof(atoi(argv[1])));//((EMMCoreLeft())*EMMPAGESIZE));
+//qqqq memset(pEmmData+0x10000, atoi(argv[1]), 0xffff);//sizeof(atoi(argv[1])));//((EMMCoreLeft())*EMMPAGESIZE));
 //---- UnmapEMM(hEData, 0, 4);          // not absolutely necessary
-//     printf("*pEmmData=%c\n", *pEmmData);
        printf("%p= %c %c %c %c %c %c %c %c\n", pEmmData,
 *pEmmData, *(pEmmData+1), *(pEmmData+2), *(pEmmData+3), *(pEmmData+4), *(pEmmData+5), *(pEmmData+6), *(pEmmData+7));
-       /*memset(pEmmData, atoi(argv[1]), 0x40001U);//sizeof(atoi(argv[1])));//((EMMCoreLeft())*EMMPAGESIZE));
-       printf("*pEmmData=%c\n", *pEmmData);
-       memset(pEmmData, atoi(argv[1]), 0x40001L);//sizeof(atoi(argv[1])));//((EMMCoreLeft())*EMMPAGESIZE));
-       printf("*pEmmData=%c\n", *pEmmData);
-       memset(pEmmData, atoi(argv[1]), 0x40001UL);//sizeof(atoi(argv[1])));//((EMMCoreLeft())*EMMPAGESIZE));
-       printf("*pEmmData=%c\n", *pEmmData);
-       memset(pEmmData, atoi(argv[1]), sizeof(byte)*4);//sizeof(atoi(argv[1])));//((EMMCoreLeft())*EMMPAGESIZE));
-       printf("*pEmmData=%c\n", *pEmmData);*/
 \r
        /*printf("Map next 2 pages\n");\r
        MapEMM(hEData, 4, 2);            // map last 2 pages: 4-5\r
@@ -115,11 +110,23 @@ int main(int argc, char *argv[])
                        i++;
                        p++;
                }
-               //free(p);
        }
+       /*if(atoi(argv[3]))
+               p =(char huge *)(GetEMMSeg0()*0x20000);
+               while(p<(char huge *)((GetEMMSeg0()*0x20000)+0xffff) && !kbhit())
+               {
+                       if((i%16)==0) printf("%p= %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c\n", p,
+*p, *(p+1), *(p+2), *(p+3), *(p+4), *(p+5), *(p+6), *(p+7),
+*(p+8), *(p+9), *(p+10), *(p+11), *(p+12), *(p+13), *(p+14), *(p+15));
+       //              (*p)++;
+                       i++;
+                       p++;
+               }
+               //free(p);
+       }*/
        if(!atoi(argv[3]))
        {\r
-               UnmapEMM(hEData, 0, 4);  // should unmap before freeing
+               UnmapEMM(hEData, 0, PEMMDATAPAGENUM);  // should unmap before freeing
                //printf("after EMS     *pEmmData=%c\n", *pEmmData);\r
                printf("Close emm\n");\r
                EMMFree(hEData);     // finished with the file data\r