From: sparky4 Date: Thu, 2 Jul 2015 17:45:56 +0000 (-0500) Subject: cache system ported!! ^^ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=30b59dda179a11477b5e7787720d83395bd61520;p=16.git cache system ported!! ^^ Signed-off-by: sparky4 --- diff --git a/16.exe b/16.exe index d407dac1..11b01a01 100644 Binary files a/16.exe and b/16.exe differ diff --git a/exmmtest.exe b/exmmtest.exe index 3b7d54ae..8deebf3a 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/fmemtest.exe b/fmemtest.exe index f74dc944..ef19d445 100644 Binary files a/fmemtest.exe and b/fmemtest.exe differ diff --git a/fonttest.exe b/fonttest.exe index 12c438dd..9fd9ea35 100644 Binary files a/fonttest.exe and b/fonttest.exe differ diff --git a/inputest.exe b/inputest.exe index 2befbe06..25af2d3b 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/maptest.exe b/maptest.exe index ed045368..aae06068 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/palettec.exe b/palettec.exe index ae8c257a..fdbe4d52 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index c1ec6d87..a48d8ebe 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index bb65c4a2..05059724 100644 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -29,7 +29,7 @@ loaded into the data segment ============================================================================= */ - + #include "src/lib/16_ca.h" //#include "ID_STRS.H" @@ -217,12 +217,12 @@ void CAL_GetGrChunkLength (int chunk) */ boolean CA_FarRead (int handle, byte far *dest, dword length) -{ +{ boolean flag; if (length>0xffffl) printf("CA_FarRead doesn't support 64K reads yet!\n"); - - __asm + + __asm { push ds mov bx,[handle] @@ -232,19 +232,19 @@ boolean CA_FarRead (int handle, byte far *dest, dword length) mov ah,0x3f // READ w/handle int 21h pop ds - jnc good - mov errno,ax - mov flag,0 - jmp End + jnc good + mov errno,ax + mov flag,0 + jmp End good: cmp ax,[WORD PTR length] je done // errno = EINVFMT; // user manager knows this is bad read - mov flag,0 - jmp End -done: - mov flag,1 -End: + mov flag,0 + jmp End +done: + mov flag,1 +End: } return flag; } @@ -261,12 +261,12 @@ End: */ boolean CA_FarWrite (int handle, byte far *source, dword length) -{ +{ boolean flag; if (length>0xffffl) - printf("CA_FarWrite doesn't support 64K reads yet!\n"); + printf("CA_FarWrite doesn't support 64K reads yet!\n"); - __asm + __asm { push ds mov bx,[handle] @@ -276,20 +276,20 @@ boolean CA_FarWrite (int handle, byte far *source, dword length) mov ah,0x40 // WRITE w/handle int 21h pop ds - jnc good + jnc good mov errno,ax - mov flag,0 + mov flag,0 jmp End good: cmp ax,[WORD PTR length] je done - //errno = ENOMEM; // user manager knows this is bad write - mov flag,0 + //errno = ENOMEM; // user manager knows this is bad write + mov flag,0 jmp End -done: - mov flag,1 +done: + mov flag,1 End: - } + } return flag; } @@ -334,7 +334,7 @@ boolean CA_ReadFile(char *filename, memptr *ptr) ========================== */ -boolean CA_LoadFile(char *filename, memptr *ptr) +boolean CA_LoadFile(char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi) { int handle; long size; @@ -343,10 +343,10 @@ boolean CA_LoadFile(char *filename, memptr *ptr) return false; size = filelength (handle); - MM_GetPtr (ptr,size); - if(!CA_FarRead (handle,*ptr,size)) + MM_GetPtr(ptr,size, mm, mmi); + if(!CA_FarRead(handle,*ptr,size)) { - close (handle); + close(handle); return false; } close(handle); @@ -436,8 +436,8 @@ void CAL_OptimizeNodes(huffnode *table) //-------------------------- // expand less than 64k of data //-------------------------- - - __asm + + __asm { mov bx,[headptr] @@ -481,7 +481,7 @@ asm inc di // write a decopmpressed byte out asm mov bx,[headptr] // back to the head node for next bit asm cmp di,ax // done? -asm jne expandshort +asm jne expandshort } } else @@ -492,8 +492,8 @@ asm jne expandshort //-------------------------- length--; - - __asm + + __asm { asm mov bx,[headptr] asm mov cl,1 @@ -551,11 +551,11 @@ asm dec [WORD PTR ss:length+2] asm jns expand // when length = ffff ffff, done } } - - __asm + + __asm { mov ax,ss - mov ds,ax + mov ds,ax } }*/ @@ -1101,7 +1101,7 @@ void CA_Shutdown(void) = ====================== */ -/*++++ +/*++++ void CA_CacheAudioChunk (int chunk) { long pos,compressed; @@ -1182,7 +1182,7 @@ done: = ====================== */ -/*++++ +/*++++ void CA_LoadAllSounds (void) { unsigned start,i; diff --git a/src/lib/16_ca.h b/src/lib/16_ca.h index 49a3e91e..87c90fba 100644 --- a/src/lib/16_ca.h +++ b/src/lib/16_ca.h @@ -18,13 +18,14 @@ // ID_CA.H #ifndef __16_CA__ -#define __16_CA__ - -#include -#include - -#ifndef __16_MM__ -#include "src/lib/16_head.h" +#define __16_CA__ + +#include +#include +#include + +#ifndef __16_MM__ +#include "src/lib/16_head.h" #include "src/lib/16_mm.h" #endif @@ -88,7 +89,7 @@ void CA_CloseDebug (void); boolean CA_FarRead (int handle, byte far *dest, dword length); boolean CA_FarWrite (int handle, byte far *source, dword length); boolean CA_ReadFile (char *filename, memptr *ptr); -boolean CA_LoadFile (char *filename, memptr *ptr); +boolean CA_LoadFile (char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi); //long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,unsigned rlewtag); diff --git a/test.exe b/test.exe index 754df675..2d34c0e7 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 53173f24..8170641b 100644 Binary files a/test2.exe and b/test2.exe differ