From 56ee8ef55f51e619a256c01e06643a3055fde39a Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 2 Jul 2015 11:51:16 -0500 Subject: [PATCH] starting to port cache system .-. modified: exmmtest.exe modified: src/lib/16_ca.c modified: src/lib/16_mm.c --- exmmtest.exe | Bin 40636 -> 40633 bytes src/lib/16_ca.c | 46 ++++++++++++++++++++++++++-------------------- src/lib/16_mm.c | 6 ++---- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/exmmtest.exe b/exmmtest.exe index 138b13c0edf8d2454c2a6a5d41598a517488ab90..3b7d54aeea255b2d434d20ab40eb7c9cfe25c0cd 100644 GIT binary patch delta 104 zcmdn9mucr-rVU5f7`rzgWxE{2IBW9ENM**allMldvsSn=FfdR47$iLTPow}#HIO&C zFj9E3a+DxzJCIWZlG^MO^_idX&1Q!zbv>pYrpdfBBquk`n8?a%%`A0(v-HfltSp>v G3=9Aw&LndH delta 107 zcmdnFmub&lrVU5f7-wug%62)3aqi@qk;;reChv_@XRUT+U|^p7F-UmwpGX0gIv{Uy zVWjY6Qm>N7v%`^^qn>UvE5Op|$MNKS5=F_DACnwi6%S#0xffffl) printf("CA_FarRead doesn't support 64K reads yet!\n"); - -asm push ds -asm mov bx,[handle] -asm mov cx,[WORD PTR length] -asm mov dx,[WORD PTR dest] -asm mov ds,[WORD PTR dest+2] -asm mov ah,0x3f // READ w/handle -asm int 21h -asm pop ds -asm jnc good - errno = _AX; - return false; + + __asm + { + push ds + mov bx,[handle] + mov cx,[WORD PTR length] + mov dx,[WORD PTR dest] + mov ds,[WORD PTR dest+2] + mov ah,0x3f // READ w/handle + int 21h + pop ds + jnc good + } + errno = CPURegs.x.ax; + return false; + __asm + { good: -asm cmp ax,[WORD PTR length] -asm je done - errno = EINVFMT; // user manager knows this is bad read + cmp ax,[WORD PTR length] + je done + errno = EINVFMT; // user manager knows this is bad read return false; done: return true; diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index 45411033..9802e4d8 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -335,16 +335,14 @@ void MML_SetupXMS(mminfo_t *mm, mminfotype *mmi) { unsigned base,size; +getmemory: __asm { mov ax,0x4310 int 0x2f mov [WORD PTR XMSaddr],bx mov [WORD PTR XMSaddr+2],es // function pointer to XMS driver - } -getmemory: - __asm - { + mov ah,XMS_ALLOCUMB mov dx,0xffff // try for largest block possible call [DWORD PTR XMSaddr] -- 2.39.5