From: sparky4 Date: Tue, 21 Jul 2015 15:28:06 +0000 (-0500) Subject: ok! X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=c0ae467c0485d2b22069a67aef17cad58bd2aa96;p=16.git ok! modified: awoo.sh modified: exmmtest.exe modified: src/lib/16_mm.c modified: src/lib/16_mm.h --- diff --git a/awoo.sh b/awoo.sh index 9e26c560..5ef0ca15 100644 --- a/awoo.sh +++ b/awoo.sh @@ -1,3 +1,4 @@ #!/bin/bash git add . bash ./boop.sh +cp exmmtest.exe /var/www/html/ diff --git a/exmmtest.exe b/exmmtest.exe index d13e21ed..22a4fa56 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index e48ccf9f..fda0a9dd 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -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) @@ -330,9 +331,9 @@ byte MM_MapXEMS(mminfo_t *mm) // EMS.Error = (Regs.ax AND &HFF00&) \ &H100 //Store the status code //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 } // diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index 974af530..8b729644 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -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);