From: sparky4 Date: Fri, 2 Sep 2016 18:22:24 +0000 (-0500) Subject: ca_t added X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=df811deaa93167e875e18b390db924c3f93db9b2;p=16.git ca_t added --- diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index f5893d81..d9dc6a1f 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -1713,7 +1713,7 @@ void CA_CacheGrChunk (int chunk) byte far *source; int next; - grneeded[chunk] |= ca_levelbit; // make sure it doesn't get removed + gvar->video.grneeded[chunk] |= ca_levelbit; // make sure it doesn't get removed if (grsegs[chunk]) { MM_SetPurge (&grsegs[chunk],0); @@ -1937,15 +1937,13 @@ void CA_DownLevel (void) = ====================== */ -/* -void CA_ClearMarks (void) +void CA_ClearMarks (global_game_variables_t *gvar) { int i; for (i=0;ivideo.grneeded[i]&=~gvar->ca.ca_levelbit; } -*/ //=========================================================================== @@ -1958,14 +1956,12 @@ void CA_ClearMarks (void) = ====================== */ -/* -void CA_ClearAllMarks (void) +void CA_ClearAllMarks (global_game_variables_t *gvar) { - _fmemset (grneeded,0,sizeof(grneeded)); - ca_levelbit = 1; - ca_levelnum = 0; + _fmemset (gvar->video.grneeded,0,sizeof(gvar->video.grneeded)); + gvar->ca.ca_levelbit = 1; + gvar->ca.ca_levelnum = 0; } -*/ //=========================================================================== @@ -2192,7 +2188,7 @@ void CA_CacheMarks (char *title) // go through and make everything not needed purgable // for (i=0;ivideo.grneeded[i]&ca_levelbit) { if (grsegs[i]) // its allready in memory, make MM_SetPurge(&grsegs[i],0); // sure it stays there! @@ -2231,7 +2227,7 @@ void CA_CacheMarks (char *title) bufferstart = bufferend = 0; // nothing good in buffer now for (i=0;ivideo.grneeded[i]&ca_levelbit) && !grsegs[i]) { // // update thermometer @@ -2265,7 +2261,7 @@ void CA_CacheMarks (char *title) while ( next < NUMCHUNKS ) { while (next < NUMCHUNKS && - !(grneeded[next]&ca_levelbit && !grsegs[next])) + !(gvar->video.grneeded[next]&ca_levelbit && !grsegs[next])) next++; if (next == NUMCHUNKS) continue; diff --git a/src/lib/16_ca.h b/src/lib/16_ca.h index a5c016d2..a193a645 100755 --- a/src/lib/16_ca.h +++ b/src/lib/16_ca.h @@ -104,12 +104,12 @@ void CA_Shutdown (global_game_variables_t *gvar); void CA_DownLevel (void); void CA_SetGrPurge (void); -void CA_SetAllPurge (void); +void CA_SetAllPurge (void);*/ -void CA_ClearMarks (void); -void CA_ClearAllMarks (void); +void CA_ClearMarks (global_game_variables_t *gvar); +void CA_ClearAllMarks (global_game_variables_t *gvar); -#define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit +/*#define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit void CA_CacheGrChunk (int chunk); void CA_CacheMap (int mapnum); diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 18e57009..5be1ab60 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -120,9 +120,13 @@ typedef struct word pn; } pan_t; +//video +#define NUMCHUNKS 3016 //keen + typedef struct { char old_mode; //old video mode before game! + byte grneeded[NUMCHUNKS]; page_t page[MAXPAGE]; //pointer to root page[0] word vmem_remain; //remaining video memory byte num_of_pages; //number of actual pages @@ -177,10 +181,17 @@ typedef struct //========================================================================== +//16_ca.h +typedef struct +{ + byte ca_levelbit,ca_levelnum; +} ca_t; + //actual global game varables! typedef struct { - video_t video; // video settings variable + video_t video; // video settings variable + ca_t ca; // ca stuff byte *pee; // message for fps handle_t handle; //handles for file logging kurokku_t kurokku; //clock struct