From 30668a00a4e8d16e66e2c908215abf669faaa03d Mon Sep 17 00:00:00 2001 From: sparky4 Date: Tue, 23 Jun 2015 11:45:26 -0500 Subject: [PATCH] wwww modified: 16/cawat/16_mm.c modified: 16/cawat/cawat.bfproject modified: Project 16.bfproject --- 16/cawat/16_mm.c | 137 +++++++++++++++++++-------------------- 16/cawat/cawat.bfproject | 48 ++++++++------ Project 16.bfproject | 52 +++++++-------- 3 files changed, 121 insertions(+), 116 deletions(-) diff --git a/16/cawat/16_mm.c b/16/cawat/16_mm.c index 95e394b0..cf36d26c 100644 --- a/16/cawat/16_mm.c +++ b/16/cawat/16_mm.c @@ -130,7 +130,7 @@ boolean MML_CheckForEMS (void) char emmname[] = "EMMXXXX0"; __asm { - mov dx,OFF emmname + mov dx,OFF=emmname mov ax,0x3d00 int 0x21 // try to open EMMXXXX0 device jc error @@ -215,29 +215,26 @@ 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: -asm { - mov [EMSpagesmapped],bx - mov ah,EMS_ALLOCPAGES // allocate up to 64k of EMS - int EMS_INT - or ah,ah - jnz error - mov [EMShandle],dx - } - return; - + 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 error: - error = _AH; - strcpy (str,"MML_SetupEMS: EMS error 0x"); - itoa(error,str2,16); - strcpy (str,str2); - Quit (str); - -noEMS: -; + error = _AH; + strcpy (str,"MML_SetupEMS: EMS error 0x"); + itoa(error,str2,16); + strcpy (str,str2); + printf("%s\n",str); + jmp End +noEMS: +End: + } } @@ -254,18 +251,16 @@ void MML_ShutdownEMS (void) if (!EMShandle) return; - { - mov ah,EMS_FREEPAGES - mov dx,[EMShandle] - int EMS_INT - or ah,ah - jz ok + __asm + { + mov ah,EMS_FREEPAGES + mov dx,[EMShandle] + int EMS_INT + or ah,ah + jz ok + printf("MML_ShutdownEMS: Error freeing EMS!"); + ok: } - - Quit ("MML_ShutdownEMS: Error freeing EMS!"); - -ok: -; } /* @@ -288,25 +283,26 @@ void MM_MapEMS (void) for (i=0;i