From: sparky4 Date: Wed, 8 Feb 2017 14:15:20 +0000 (-0600) Subject: added resetting palette in cmem part of modexenter X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=a114e86d527fe3b20409e7a8f01611024b722dab;p=16.git added resetting palette in cmem part of modexenter --- diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index 8b9aab83..dcdcaa1c 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -1102,25 +1102,25 @@ dinorm: void CAL_SetupMapFile (global_game_variables_t *gvar) { -// int handle; -// long length; +/* int handle; + long length; // // load maphead.ext (offsets and tileinfo for map file) // -// #ifndef MAPHEADERLINKED -// if ((handle = open("MAPHEAD."EXT, -// O_RDONLY | O_BINARY, S_IREAD)) == -1) -// printf("Can't open MAPHEAD."EXT"!"); -// length = filelength(handle); -// MM_GetPtr (&(memptr)tinf,length); -// CA_FarRead(handle, tinf, length); -// close(handle); -// //#else -// -// tinf = (byte _seg *)FP_SEG(&maphead); -// -// #endif +#ifndef MAPHEADERLINKED + if ((handle = open("MAPHEAD."EXT, + O_RDONLY | O_BINARY, S_IREAD)) == -1) + printf("Can't open MAPHEAD."EXT"!"); + length = filelength(handle); + MM_GetPtr (&(memptr)tinf,length); + CA_FarRead(handle, tinf, length); + close(handle); +//#else + + tinf = (byte _seg *)FP_SEG(&maphead); + +#endif*/ // // open the data file @@ -1856,32 +1856,33 @@ void CA_CacheMap (global_game_variables_t *gvar) // // free up memory from last map // - if (gvar->ca.map.mapon>-1 && gvar->ca.map.mapheaderseg[gvar->ca.map.mapon]) - MM_SetPurge (&((memptr)gvar->ca.map.mapheaderseg[(gvar->ca.map.mapon)]), 3, &(gvar->mm)); + if (gvar->ca.camap.mapon>-1 && gvar->ca.camap.mapheaderseg[gvar->ca.camap.mapon]) + MM_SetPurge (((memptr)gvar->ca.camap.mapheaderseg[(gvar->ca.camap.mapon)]), 3, gvar); for (plane=0;planeca.map.mapsegs[plane]) - MM_FreePtr (&(memptr)gvar->ca.map.mapsegs[plane], &(gvar->mm)); + if (gvar->ca.camap.mapsegs[plane]) + MM_FreePtr ((memptr)gvar->ca.camap.mapsegs[plane], gvar); - gvar->ca.map.mapon = gvar->ca.map.mapnum; + gvar->ca.camap.mapon = gvar->ca.camap.mapnum; // // load map header // The header will be cached if it is still around // - if (!gvar->ca.map.mapheaderseg[gvar->ca.map.mapnum]) - { - //pos = ((mapfiletype _seg *)tinf)->headeroffsets[mapnum]; - pos = ((_seg *)gvar->ca.map.tinf)->headeroffsets[gvar->ca.map.mapnum]; - if (pos<0) // $FFFFFFFF start is a sparse map - printf("CA_CacheMap: Tried to load a non existent map!"); +// if (!gvar->ca.camap.mapheaderseg[gvar->ca.camap.mapnum]) +// { +// //pos = ((mapfiletype _seg *)tinf)->headeroffsets[mapnum]; +// //pos = ((_seg *)gvar->ca.camap.tinf)->headeroffsets[gvar->ca.camap.mapnum]; +// pos = ((memptr)gvar->ca.camap.tinf)->headeroffsets[gvar->ca.camap.mapnum]; +// if (pos<0) // $FFFFFFFF start is a sparse map +// printf("CA_CacheMap: Tried to load a non existent map!"); - MM_GetPtr(&(memptr)gvar->ca.mapheaderseg[mapnum],sizeof(maptype)); - lseek(maphandle,pos,SEEK_SET); - CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype)); - } - else - MM_SetPurge (&(memptr)mapheaderseg[mapnum], 0, &(gvar->mm)); +// MM_GetPtr(&(memptr)gvar->ca.camapheaderseg[mapnum],sizeof(maptype)); +// lseek(maphandle,pos,SEEK_SET); +// CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype)); +// } +// else +// MM_SetPurge (&(memptr)mapheaderseg[mapnum], 0, &(gvar->mm)); // // load the planes in @@ -1893,8 +1894,8 @@ void CA_CacheMap (global_game_variables_t *gvar) for (plane = 0; planeplanestart[plane]; - compressed = mapheaderseg[mapnum]->planelength[plane]; + //pos = mapheaderseg[mapnum]->planestart[plane]; + //compressed = mapheaderseg[mapnum]->planelength[plane]; if (!compressed) continue; // the plane is not used in this game diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index a0b58723..0da3771b 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -158,16 +158,11 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */ vga_write_sequencer(2/*map mask register*/,0xf/*all 4 planes*/); for(i = 0;i < 0x4000; i++) ptr[i] = 0x0000; // 0x4000 x dword = 64KB + /* fix up the palette and everything */ + modexPalBlack(); //reset the palette~ } break; } - -// gv->video.page[0].ti.tw = gv->video.page[0].sw/TILEWH; -// gv->video.page[0].ti.th = gv->video.page[0].sh/TILEWH; - - //TODO MAKE FLEXIBLE~ -// gv->video.page[0].ti.tilemidposscreenx = gv->video.page[0].ti.tilesw; -// gv->video.page[0].ti.tilemidposscreeny = (gv->video.page[0].ti.tilesh/2)+1; } void diff --git a/src/lib/doslib b/src/lib/doslib index 757ace2b..9fa17541 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit 757ace2b7f7887731a0b7aaf00306b6682fe5fac +Subproject commit 9fa1754125e085f823438c4ac18378b385a5dd0c diff --git a/src/zcroll.c b/src/zcroll.c index c5688601..3723b201 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -103,11 +103,6 @@ void main(int argc, char *argv[]) VGAmodeX(1/*bakapee*/, 1, &gvar); - /* fix up the palette and everything */ -#ifdef FADE - modexPalBlack(); //reset the palette~ -#endif - /* load color palette */ VL_LoadPalFile(bakapee1p, &gvar.video.palette);