]> 4ch.mooo.com Git - 16.git/commitdiff
cache system ported!! ^^
authorsparky4 <sparky4@cock.li>
Thu, 2 Jul 2015 17:45:56 +0000 (12:45 -0500)
committersparky4 <sparky4@cock.li>
Thu, 2 Jul 2015 17:45:56 +0000 (12:45 -0500)
Signed-off-by: sparky4 <sparky4@cock.li>
12 files changed:
16.exe
exmmtest.exe
fmemtest.exe
fonttest.exe
inputest.exe
maptest.exe
palettec.exe
pcxtest.exe
src/lib/16_ca.c
src/lib/16_ca.h
test.exe
test2.exe

diff --git a/16.exe b/16.exe
index d407dac141d591d9fa2508db9ccc8bcbbb848d09..11b01a01e4470aabf51209c99c24a7f65febd6f0 100644 (file)
Binary files a/16.exe and b/16.exe differ
index 3b7d54aeea255b2d434d20ab40eb7c9cfe25c0cd..8deebf3a63b8b79213f77c1810a7336ab8c9c0ca 100644 (file)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
index f74dc944a130bb5cb4235dc1bbcfc31b405efef1..ef19d44531ac68759cd901179779d75ca85788fe 100644 (file)
Binary files a/fmemtest.exe and b/fmemtest.exe differ
index 12c438dd32a684b637ab5122e7c9cce7f547c6c6..9fd9ea35b94dc4d9a31c02e6221c5f8e3ad02b35 100644 (file)
Binary files a/fonttest.exe and b/fonttest.exe differ
index 2befbe0643eb2471f27f34a12fe1b73a17e406e3..25af2d3bb24b12827ac8e84a04155b5a616e0c85 100644 (file)
Binary files a/inputest.exe and b/inputest.exe differ
index ed045368a4287c97ed7f59fe3d316b18717c5432..aae060680170c54cb8ee9bc251ffecd415148ad9 100644 (file)
Binary files a/maptest.exe and b/maptest.exe differ
index ae8c257a59f61cd3dbabef5bb8c0f28a6387b960..fdbe4d525a09ab042a5e90220fea11d6d9dc2a6c 100644 (file)
Binary files a/palettec.exe and b/palettec.exe differ
index c1ec6d87d53155220466f73d10b06ae4e1a9b68a..a48d8ebe53697cf66ac2f7ff6aba3bf634ce6daa 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index bb65c4a25b98fc957b3b17aa2a9053ee5ca61f8b..0505972441967ccaf4ef38b4a881f1758ce1af4f 100644 (file)
@@ -29,7 +29,7 @@ loaded into the data segment
 \r
 =============================================================================\r
 */\r
-
+\r
 #include "src/lib/16_ca.h"\r
 //#include "ID_STRS.H"\r
 \r
@@ -217,12 +217,12 @@ void CAL_GetGrChunkLength (int chunk)
 */\r
 \r
 boolean CA_FarRead (int handle, byte far *dest, dword length)\r
-{
+{\r
        boolean flag;\r
        if (length>0xffffl)\r
                printf("CA_FarRead doesn't support 64K reads yet!\n");\r
-
-       __asm
+\r
+       __asm\r
        {\r
                push    ds\r
                mov     bx,[handle]\r
@@ -232,19 +232,19 @@ boolean CA_FarRead (int handle, byte far *dest, dword length)
                mov     ah,0x3f                         // READ w/handle\r
                int     21h\r
                pop     ds\r
-               jnc     good
-               mov     errno,ax
-               mov     flag,0
-               jmp End
+               jnc     good\r
+               mov     errno,ax\r
+               mov     flag,0\r
+               jmp End\r
 good:\r
                cmp     ax,[WORD PTR length]\r
                je      done\r
 //             errno = EINVFMT;                        // user manager knows this is bad read\r
-               mov     flag,0
-               jmp End
-done:
-               mov     flag,1
-End:
+               mov     flag,0\r
+               jmp End\r
+done:\r
+               mov     flag,1\r
+End:\r
        }\r
        return flag;\r
 }\r
@@ -261,12 +261,12 @@ End:
 */\r
 \r
 boolean CA_FarWrite (int handle, byte far *source, dword length)\r
-{
+{\r
        boolean flag;\r
        if (length>0xffffl)\r
-               printf("CA_FarWrite doesn't support 64K reads yet!\n");
+               printf("CA_FarWrite doesn't support 64K reads yet!\n");\r
 \r
-       __asm
+       __asm\r
        {\r
                push    ds\r
                mov     bx,[handle]\r
@@ -276,20 +276,20 @@ boolean CA_FarWrite (int handle, byte far *source, dword length)
                mov     ah,0x40                 // WRITE w/handle\r
                int     21h\r
                pop     ds\r
-               jnc     good
+               jnc     good\r
                mov     errno,ax\r
-               mov flag,0
+               mov flag,0\r
                jmp End\r
 good:\r
                cmp     ax,[WORD PTR length]\r
                je      done\r
-       //errno = ENOMEM;                               // user manager knows this is bad write
-               mov     flag,0
+       //errno = ENOMEM;                               // user manager knows this is bad write\r
+               mov     flag,0\r
                jmp End\r
-done:
-               mov     flag,1
+done:\r
+               mov     flag,1\r
 End:\r
-       }
+       }\r
        return flag;\r
 }\r
 \r
@@ -334,7 +334,7 @@ boolean CA_ReadFile(char *filename, memptr *ptr)
 ==========================\r
 */\r
 \r
-boolean CA_LoadFile(char *filename, memptr *ptr)\r
+boolean CA_LoadFile(char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi)\r
 {\r
        int handle;\r
        long size;\r
@@ -343,10 +343,10 @@ boolean CA_LoadFile(char *filename, memptr *ptr)
                return false;\r
 \r
        size = filelength (handle);\r
-       MM_GetPtr (ptr,size);\r
-       if(!CA_FarRead (handle,*ptr,size))\r
+       MM_GetPtr(ptr,size, mm, mmi);\r
+       if(!CA_FarRead(handle,*ptr,size))\r
        {\r
-               close (handle);\r
+               close(handle);\r
                return false;\r
        }\r
        close(handle);\r
@@ -436,8 +436,8 @@ void CAL_OptimizeNodes(huffnode *table)
 //--------------------------\r
 // expand less than 64k of data\r
 //--------------------------\r
-
-       __asm
+\r
+       __asm\r
        {\r
                mov     bx,[headptr]\r
 \r
@@ -481,7 +481,7 @@ asm inc     di                                      // write a decopmpressed byte out
 asm    mov     bx,[headptr]            // back to the head node for next bit\r
 \r
 asm    cmp     di,ax                           // done?\r
-asm    jne     expandshort
+asm    jne     expandshort\r
        }\r
        }\r
        else\r
@@ -492,8 +492,8 @@ asm jne     expandshort
 //--------------------------\r
 \r
   length--;\r
-
-       __asm
+\r
+       __asm\r
        {\r
 asm mov        bx,[headptr]\r
 asm    mov     cl,1\r
@@ -551,11 +551,11 @@ asm       dec     [WORD PTR ss:length+2]
 asm    jns     expand          // when length = ffff ffff, done\r
        }\r
        }\r
-
-       __asm
+\r
+       __asm\r
        {\r
                mov     ax,ss\r
-               mov     ds,ax
+               mov     ds,ax\r
        }\r
 \r
 }*/\r
@@ -1101,7 +1101,7 @@ void CA_Shutdown(void)
 =\r
 ======================\r
 */\r
-/*++++
+/*++++\r
 void CA_CacheAudioChunk (int chunk)\r
 {\r
        long    pos,compressed;\r
@@ -1182,7 +1182,7 @@ done:
 =\r
 ======================\r
 */\r
-/*++++
+/*++++\r
 void CA_LoadAllSounds (void)\r
 {\r
        unsigned        start,i;\r
index 49a3e91e2d7b8711bb8caa5946dcb29807673ca3..87c90fba569d141aa82dabe6f274a53ee14dde60 100644 (file)
 \r
 // ID_CA.H\r
 #ifndef __16_CA__\r
-#define __16_CA__
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef __16_MM__
-#include "src/lib/16_head.h"
+#define __16_CA__\r
+\r
+#include <unistd.h>\r
+#include <fcntl.h>\r
+#include <sys/stat.h>\r
+\r
+#ifndef __16_MM__\r
+#include "src/lib/16_head.h"\r
 #include "src/lib/16_mm.h"\r
 #endif\r
 \r
@@ -88,7 +89,7 @@ void CA_CloseDebug (void);
 boolean CA_FarRead (int handle, byte far *dest, dword length);\r
 boolean CA_FarWrite (int handle, byte far *source, dword length);\r
 boolean CA_ReadFile (char *filename, memptr *ptr);\r
-boolean CA_LoadFile (char *filename, memptr *ptr);\r
+boolean CA_LoadFile (char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi);\r
 \r
 //long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,unsigned rlewtag);\r
 \r
index 754df6756f8235706a3eeb4cbca84afd6368ecad..2d34c0e72cf11ceab7fa295a3ad494d039704d7c 100644 (file)
Binary files a/test.exe and b/test.exe differ
index 53173f24550509cf820107f951affde5cd65e707..8170641b4429d6f9d32cc6d289f9b510cae16688 100644 (file)
Binary files a/test2.exe and b/test2.exe differ