]> 4ch.mooo.com Git - 16.git/commitdiff
wwww yakuji wwww ca use to load maps w hmmm cachemap wwww
authorsparky4 <sparky4@cock.li>
Thu, 8 Sep 2016 15:20:10 +0000 (10:20 -0500)
committersparky4 <sparky4@cock.li>
Thu, 8 Sep 2016 15:20:10 +0000 (10:20 -0500)
src/lib/16_ca.c
src/lib/16_ca.h

index 6511ef176ab649739d61e14ed50b1645c4c27108..762a6bb72da5d6f9a3b8ab598f12e25a506704fc 100755 (executable)
@@ -724,7 +724,7 @@ dinorm:
 =\r
 ======================\r
 */\r
-/*++++\r
+\r
 #define NEARTAG        0xa7\r
 #define FARTAG 0xa8\r
 \r
@@ -747,13 +747,13 @@ void CAL_CarmackExpand (unsigned far *source, unsigned far *dest, unsigned lengt
                        count = ch&0xff;\r
                        if (!count)\r
                        {                               // have to insert a word containing the tag byte\r
-                               ch |= *((unsigned char far *)inptr)++;\r
+                               ch |= *(/*(unsigned char far *)*/inptr)++;\r
                                *outptr++ = ch;\r
                                length--;\r
                        }\r
                        else\r
                        {\r
-                               offset = *((unsigned char far *)inptr)++;\r
+                               offset = *(/*(unsigned char far *)*/inptr)++;\r
                                copyptr = outptr - offset;\r
                                length -= count;\r
                                while (count--)\r
@@ -765,7 +765,7 @@ void CAL_CarmackExpand (unsigned far *source, unsigned far *dest, unsigned lengt
                        count = ch&0xff;\r
                        if (!count)\r
                        {                               // have to insert a word containing the tag byte\r
-                               ch |= *((unsigned char far *)inptr)++;\r
+                               ch |= *(/*(unsigned char far *)*/inptr)++;\r
                                *outptr++ = ch;\r
                                length --;\r
                        }\r
@@ -785,7 +785,6 @@ void CAL_CarmackExpand (unsigned far *source, unsigned far *dest, unsigned lengt
                }\r
        }\r
 }\r
-*/\r
 \r
 \r
 /*\r
@@ -795,7 +794,7 @@ void CAL_CarmackExpand (unsigned far *source, unsigned far *dest, unsigned lengt
 =\r
 ======================\r
 */\r
-/*++++\r
+\r
 long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,\r
   unsigned rlewtag)\r
 {\r
@@ -842,7 +841,7 @@ long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,
   complength = 2*(dest-start);\r
   return complength;\r
 }\r
-*/\r
+\r
 \r
 /*\r
 ======================\r
@@ -852,7 +851,7 @@ long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,
 =\r
 ======================\r
 */\r
-/*++++\r
+\r
 void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,\r
   unsigned rlewtag)\r
 {\r
@@ -903,64 +902,88 @@ void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,
 //\r
 // NOTE: A repeat count that produces 0xfff0 bytes can blow this!\r
 //\r
-\r
-asm    mov     bx,rlewtag\r
-asm    mov     si,sourceoff\r
-asm    mov     di,destoff\r
-asm    mov     es,destseg\r
-asm    mov     ds,sourceseg\r
-\r
+       __asm{\r
+               mov     bx,rlewtag\r
+               mov     si,sourceoff\r
+               mov     di,destoff\r
+               mov     es,destseg\r
+               mov     ds,sourceseg\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 expand:\r
-asm    lodsw\r
-asm    cmp     ax,bx\r
-asm    je      repeat\r
-asm    stosw\r
-asm    jmp     next\r
-\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               lodsw\r
+               cmp     ax,bx\r
+               je      repeat\r
+               stosw\r
+               jmp     next\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 repeat:\r
-asm    lodsw\r
-asm    mov     cx,ax           // repeat count\r
-asm    lodsw                   // repeat value\r
-asm    rep stosw\r
-\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               lodsw\r
+               mov     cx,ax           // repeat count\r
+               lodsw                   // repeat value\r
+               rep stosw\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 next:\r
-\r
-asm    cmp     si,0x10         // normalize ds:si\r
-asm    jb      sinorm\r
-asm    mov     ax,si\r
-asm    shr     ax,1\r
-asm    shr     ax,1\r
-asm    shr     ax,1\r
-asm    shr     ax,1\r
-asm    mov     dx,ds\r
-asm    add     dx,ax\r
-asm    mov     ds,dx\r
-asm    and     si,0xf\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               cmp     si,0x10         // normalize ds:si\r
+               jb      sinorm\r
+               mov     ax,si\r
+               shr     ax,1\r
+               shr     ax,1\r
+               shr     ax,1\r
+               shr     ax,1\r
+               mov     dx,ds\r
+               add     dx,ax\r
+               mov     ds,dx\r
+               and     si,0xf\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 sinorm:\r
-asm    cmp     di,0x10         // normalize es:di\r
-asm    jb      dinorm\r
-asm    mov     ax,di\r
-asm    shr     ax,1\r
-asm    shr     ax,1\r
-asm    shr     ax,1\r
-asm    shr     ax,1\r
-asm    mov     dx,es\r
-asm    add     dx,ax\r
-asm    mov     es,dx\r
-asm    and     di,0xf\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               cmp     di,0x10         // normalize es:di\r
+               jb      dinorm\r
+               mov     ax,di\r
+               shr     ax,1\r
+               shr     ax,1\r
+               shr     ax,1\r
+               shr     ax,1\r
+               mov     dx,es\r
+               add     dx,ax\r
+               mov     es,dx\r
+               and     di,0xf\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
 dinorm:\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               cmp     di,ss:endoff\r
+               jne     expand\r
+               mov     ax,es\r
+               cmp     ax,ss:endseg\r
+               jb      expand\r
 \r
-asm    cmp     di,ss:endoff\r
-asm    jne     expand\r
-asm    mov     ax,es\r
-asm    cmp     ax,ss:endseg\r
-asm    jb      expand\r
-\r
-asm    mov     ax,ss\r
-asm    mov     ds,ax\r
-\r
+               mov     ax,ss\r
+               mov     ds,ax\r
+       }\r
 }\r
-*/\r
 \r
 \r
 /*\r
index 54a125ae0da512c74417a8f53a2d192b52fe81bb..5d8675ca887e2cb53ec5d08939516a686bde0d70 100755 (executable)
@@ -90,9 +90,9 @@ boolean CA_ReadFile (char *filename, memptr *ptr, mminfo_t *mm);
 boolean CA_WriteFile (char *filename, void far *ptr, long length, mminfo_t *mm);\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
+long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,unsigned rlewtag);\r
 \r
-//void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,unsigned rlewtag);\r
+void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,unsigned rlewtag);\r
 \r
 void CA_Startup (global_game_variables_t *gvar);\r
 void CA_Shutdown (global_game_variables_t *gvar);\r