]> 4ch.mooo.com Git - 16.git/commitdiff
meh ca needs huge amounts of work
authorsparky4 <sparky4@cock.li>
Thu, 2 Mar 2017 01:18:44 +0000 (19:18 -0600)
committersparky4 <sparky4@cock.li>
Thu, 2 Mar 2017 01:18:44 +0000 (19:18 -0600)
HEAP.16W
src/lib/16_ca.c
src/lib/16_tdef.h
xxdiff.sh [new file with mode: 0755]

index e80b7862062617a32cc740a10c10d32f7778dfef..3401783318de200a2c2a327decd1cf9fabaeadf0 100755 (executable)
--- a/HEAP.16W
+++ b/HEAP.16W
@@ -34,8 +34,10 @@ OK - end of heap
 \r
 Memory Type         Total      Used       Free\r
 ----------------  --------   --------   --------\r
-Default                   47094Near               4886 496       4390\r
-Far               47094----------------  --------   --------   --------\r
+Default                   47094        208       46886\r
+Near              4886         496       4390\r
+Far               47094        208       46886\r
+----------------  --------   --------   --------\r
 HC_coreleft = 4388\r
 HC_farcoreleft = 458752\r
 HC_GetFreeSize = 46886\r
index c08ef4349eebdfa52354fdc280f62aecac05b710..6ef9806c0d37446c800cbdfb7bbf2c3f233529d6 100755 (executable)
@@ -132,17 +132,17 @@ void      CAL_DialogFinish (void);*/
 //void CAL_CarmackExpand (unsigned far *source, unsigned far *dest,unsigned length);\r
 \r
 \r
-/*++++#ifdef THREEBYTEGRSTARTS\r
+#ifdef THREEBYTEGRSTARTS\r
 #define FILEPOSSIZE    3\r
 //#define      GRFILEPOS(c) (*(long far *)(((byte far *)grstarts)+(c)*3)&0xffffff)\r
-long GRFILEPOS(int c)\r
+long GRFILEPOS(int c, global_game_variables_t *gvar)\r
 {\r
        long value;\r
        int     offset;\r
 \r
        offset = c*3;\r
 \r
-       value = *(long far *)(((byte far *)grstarts)+offset);\r
+       value = *(long far *)(((byte far *)gvar->ca.grstarts)+offset);\r
 \r
        value &= 0x00ffffffl;\r
 \r
@@ -153,8 +153,8 @@ long GRFILEPOS(int c)
 };\r
 #else\r
 #define FILEPOSSIZE    4\r
-#define        GRFILEPOS(c) (grstarts[c])\r
-#endif*/\r
+#define        GRFILEPOS(c) (gvar->ca.grstarts[c])\r
+#endif\r
 \r
 /*\r
 =============================================================================\r
@@ -2239,10 +2239,10 @@ void    CAL_DialogFinish (void)
 = CA_CacheMarks\r
 =\r
 ======================\r
-*//*\r
+*//*++++\r
 #define MAXEMPTYREAD   1024\r
 \r
-void CA_CacheMarks (char *title)\r
+void CAL_CacheMarks (char *title, global_game_variables_t *gvar)\r
 {\r
        boolean dialog;\r
        int     i,next,numcache;\r
@@ -2258,17 +2258,17 @@ void CA_CacheMarks (char *title)
 // go through and make everything not needed purgable\r
 //\r
        for (i=0;i<NUMCHUNKS;i++)\r
-               if (gvar->video.grneeded[i]&ca_levelbit)\r
+               if (gvar->ca.grneeded[i]&(gvar->ca.ca_levelbit))//if (grneeded[i]&ca_levelbit)\r
                {\r
-                       if (grsegs[i])                                  // its allready in memory, make\r
-                               MM_SetPurge(&grsegs[i],0);      // sure it stays there!\r
+                       if (gvar->ca.grsegs[i])                                 // its allready in memory, make\r
+                               MM_SetPurge(gvar->ca.grsegs[i],0,gvar); // sure it stays there!\r
                        else\r
                                numcache++;\r
                }\r
                else\r
                {\r
-                       if (grsegs[i])                                  // not needed, so make it purgeable\r
-                               MM_SetPurge(&grsegs[i],3);\r
+                       if (gvar->ca.grsegs[i])                                 // not needed, so make it purgeable\r
+                               MM_SetPurge(gvar->ca.grsegs[i],3,gvar);\r
                }\r
 \r
        if (!numcache)                  // nothing to cache!\r
@@ -2276,8 +2276,8 @@ void CA_CacheMarks (char *title)
 \r
 // MDM begin - (GAMERS EDGE)\r
 //\r
-       if (!FindFile("EGAGRAPH."EXT,NULL,2))\r
-               Quit (gvar, "CA_CacheMarks(): Can't find graphics files.");\r
+//     if (!FindFile("EGAGRAPH."EXT,NULL,2))\r
+//             Quit (gvar, "CA_CacheMarks(): Can't find graphics files.");\r
 //\r
 // MDM end\r
 \r
@@ -2297,7 +2297,7 @@ void CA_CacheMarks (char *title)
        bufferstart = bufferend = 0;            // nothing good in buffer now\r
 \r
        for (i=0;i<NUMCHUNKS;i++)\r
-               if ( (gvar->video.grneeded[i]&ca_levelbit) && !grsegs[i])\r
+               if ( (gvar->ca.grneeded[i]&(gvar->ca.ca_levelbit)) && !gvar->ca.grsegs[i])\r
                {\r
 //\r
 // update thermometer\r
@@ -2348,7 +2348,7 @@ void CA_CacheMarks (char *title)
                                        }\r
 \r
                                        lseek(grhandle,pos,SEEK_SET);\r
-                                       CA_FarRead(grhandle,bufferseg,endpos-pos);\r
+                                       CA_FarRead(grhandle,(gvar->mm.bufferseg),endpos-pos,gvar);\r
                                        bufferstart = pos;\r
                                        bufferend = endpos;\r
                                        source = bufferseg;\r
@@ -2357,12 +2357,12 @@ void CA_CacheMarks (char *title)
                        else\r
                        {\r
                        // big chunk, allocate temporary buffer\r
-                               MM_GetPtr(&bigbufferseg,compressed);\r
+                               MM_GetPtr(&bigbufferseg,compressed,gvar);\r
                                if (mmerror)\r
                                        return;\r
                                MM_SetLock (&bigbufferseg,true);\r
                                lseek(grhandle,pos,SEEK_SET);\r
-                               CA_FarRead(grhandle,bigbufferseg,compressed);\r
+                               CA_FarRead(grhandle,bigbufferseg,compressed,gvar);\r
                                source = bigbufferseg;\r
                        }\r
 \r
index dbda778a0b9fa4f49dbd188377d5be301c08ba75..2107a4de66c869420a259d146796be456d89dd03 100755 (executable)
@@ -538,6 +538,9 @@ typedef struct      //TODO: USE THIS!!!!
        byte            far             grneeded[NUMCHUNKS];\r
        memptr/*byte _seg*/     *audiosegs[NUMSNDCHUNKS];\r
 \r
+       long            _seg *grstarts; // array of offsets in egagraph, -1 for sparse\r
+       long            _seg *audiostarts;      // array of offsets in audio / audiot\r
+\r
        //misc memptr\r
        memptr tinf[4];\r
 \r
diff --git a/xxdiff.sh b/xxdiff.sh
new file mode 100755 (executable)
index 0000000..ab2c737
--- /dev/null
+++ b/xxdiff.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+xxdiff -wB "$1" "$2"