From: sparky4 Date: Sat, 27 Jun 2015 00:03:14 +0000 (-0500) Subject: /dev/zero done it again!! ^^ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=456d6fac30509ba7a286d1c409e826fe1393608c;p=16.git /dev/zero done it again!! ^^ modified: 16/cawat/16_mm.c --- diff --git a/16/cawat/16_mm.c b/16/cawat/16_mm.c index 2da0d658..8c28277a 100644 --- a/16/cawat/16_mm.c +++ b/16/cawat/16_mm.c @@ -42,8 +42,8 @@ EMS / XMS unmanaged routines ============================================================================= */ -//#include "LIB_HEAD.H" -#include "16_mm.h" +//#include "LIB_HEAD.H" +#include "16_mm.h" /* ============================================================================= @@ -97,7 +97,7 @@ void (* aftersort) (void); */ boolean mmstarted; - + void huge *hugeheap; void far *farheap; void *nearheap; @@ -125,12 +125,12 @@ unsigned numUMBs,UMBbase[MAXUMBS]; */ boolean MML_CheckForEMS (void) -{ - boolean emmcfems; - char emmname[] = "EMMXXXX0"; - - __asm { - mov dx,OFF=emmname +{ + boolean emmcfems; + char emmname[] = "EMMXXXX0"; +// mov dx,OFFSET emmname + __asm { + LEA DX, emmname //fix by andrius4669 mov ax,0x3d00 int 0x21 // try to open EMMXXXX0 device jc error @@ -153,19 +153,19 @@ boolean MML_CheckForEMS (void) mov ah,0x3e int 0x21 // close handle - jc error + jc error // // EMS is good - // - mov emmcfems,1 - jmp End - error: + // + mov emmcfems,1 + jmp End + error: // // EMS is bad // - mov emmcfems,0 - End: - } + mov emmcfems,0 + End: + } return(emmcfems); } @@ -181,12 +181,12 @@ boolean MML_CheckForEMS (void) void MML_SetupEMS (void) { char str[80],str2[10]; - unsigned err; + unsigned err; struct REGS CPURegs; totalEMSpages = freeEMSpages = EMSpageframe = EMSpagesmapped = 0; - __asm + __asm { mov ah,EMS_STATUS int EMS_INT // make sure EMS hardware is present @@ -217,24 +217,24 @@ void MML_SetupEMS (void) cmp bx,4 jle getpages // there is only 1,2,3,or 4 pages - mov bx,4 // we can't use more than 4 pages - -getpages: + mov bx,4 // we can't use more than 4 pages + +getpages: mov [EMSpagesmapped],bx mov ah,EMS_ALLOCPAGES // allocate up to 64k of EMS int EMS_INT or ah,ah jnz error - mov [EMShandle],dx - jmp End + mov [EMShandle],dx + jmp End error: // err = CPURegs.h.ah; // strcpy (str,"MML_SetupEMS: EMS error 0x"); // itoa(err,str2,16); // strcpy (str,str2); -// printf("%s\n",str); - jmp End -noEMS: +// printf("%s\n",str); + jmp End +noEMS: End: } } @@ -253,14 +253,14 @@ void MML_ShutdownEMS (void) if (!EMShandle) return; - __asm + __asm { mov ah,EMS_FREEPAGES mov dx,[EMShandle] int EMS_INT or ah,ah - jz ok - printf("MML_ShutdownEMS: Error freeing EMS!"); + jz ok + printf("MML_ShutdownEMS: Error freeing EMS!"); ok: } } @@ -285,7 +285,7 @@ void MM_MapEMS (void) for (i=0;i