]> 4ch.mooo.com Git - 16.git/commitdiff
==== animation fram walk ==== i polished the shit out of it and it works MUCH better...
authorsparky4 <sparky4@cock.li>
Wed, 25 Jan 2017 23:23:44 +0000 (17:23 -0600)
committersparky4 <sparky4@cock.li>
Wed, 25 Jan 2017 23:23:44 +0000 (17:23 -0600)
28 files changed:
16/src/lib/oldwalk.c [new file with mode: 0755]
ca_use.txt
doc/planarNotes.txt [moved from planarNotes.txt with 100% similarity]
fontgfx.exe
makefile
mm_use.txt
pm_use.txt
pm_use_.txt [new file with mode: 0755]
qkeen.sh [new file with mode: 0755]
src/0.c
src/bakapi.c
src/lib/16_enti.c
src/lib/16_mm.h
src/lib/16_rf.c [new file with mode: 0755]
src/lib/16_rf.h [new file with mode: 0755]
src/lib/16_sprit.c
src/lib/16_tail.h
src/lib/16_tdef.h
src/lib/16_vl.c
src/lib/16_vl.h
src/lib/bitmap.c
src/lib/scroll16.c
src/lib/scroll16.h
src/lib/testpatt.h [new file with mode: 0755]
src/scroll.c
src/tesuto.h
src/vrstest.c
src/zcroll.c

diff --git a/16/src/lib/oldwalk.c b/16/src/lib/oldwalk.c
new file mode 100755 (executable)
index 0000000..a4dabfa
--- /dev/null
@@ -0,0 +1,187 @@
+void oldwalk(map_view_t *pip, player_t *player, word pn)\r
+{\r
+       //printf("player[%d].d=%d\n", pn, player[pn].enti.d);\r
+       switch(player[pn].enti.d)\r
+       {\r
+               //no direction\r
+               case 2:\r
+                       //0000pip[0].video->startclk = (*clockw);\r
+               break;\r
+               //right movement\r
+               case 3:\r
+                       //printf("pip[0].page->tilesw=%d        ", pip[0].page->tilesw); printf("pip[0].page->tw=%d\n", pip[0].page->tw);\r
+                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))  //collision detection!\r
+                       {\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
+                               {\r
+                                       INC_PER_FRAME;\r
+                                       ANIMATESPRIFUN(pip, player, pn, 1);\r
+                                       ScrollRight(pip, player, 3, pn);\r
+                                       ScrollRight(pip, player, 2, pn);\r
+                                       //mapScrollRight(pip, player, !(pip[0].video->p), pn);\r
+                                       mapScrollRight(pip, player, (pip[0].video->p), pn);\r
+                                       if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                                       player[pn].enti.q++;\r
+                                       //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
+                       }\r
+                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
+                       {\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
+                               {\r
+                                       INC_PER_FRAME;\r
+                                       player[pn].enti.x+=(player[pn].enti.speed);\r
+                                       ANIMATESPRIFUN(pip, player, pn, 0);\r
+                                       if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
+                       }\r
+                       else\r
+                       {\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
+#ifdef SPRITE\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
+#else\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 14);\r
+#endif\r
+                               if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                               player[pn].enti.d = 2;\r
+                       }\r
+                       player[pn].enti.triggerx = player[pn].enti.tx+1;\r
+                       player[pn].enti.triggery = player[pn].enti.ty;\r
+               break;\r
+\r
+               //left movement\r
+               case 1:\r
+                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))        //collision detection!\r
+                       {\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
+                               {\r
+                                       INC_PER_FRAME;\r
+                                       ANIMATESPRIFUN(pip, player, pn, 1);\r
+                                       ScrollLeft(pip, player, 3, pn);\r
+                                       ScrollLeft(pip, player, 2, pn);\r
+                                       //mapScrollLeft(pip, player, !(pip[0].video->p), pn);\r
+                                       mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
+                                       if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                                       player[pn].enti.q++;\r
+                                       //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
+                       }\r
+                       else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
+                       {\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
+                               {\r
+                                       INC_PER_FRAME;\r
+                                       player[pn].enti.x-=(player[pn].enti.speed);\r
+                                       ANIMATESPRIFUN(pip, player, pn, 0);\r
+                                       if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
+                       }\r
+                       else\r
+                       {\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
+#ifdef SPRITE\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
+#else\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 10);\r
+#endif\r
+                               if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                               player[pn].enti.d = 2;\r
+                       }\r
+                       player[pn].enti.triggerx = player[pn].enti.tx-1;\r
+                       player[pn].enti.triggery = player[pn].enti.ty;\r
+               break;\r
+\r
+               //down movement\r
+               case 4:\r
+                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))  //collision detection!\r
+                       {\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
+                               {\r
+                                       INC_PER_FRAME;\r
+                                       ANIMATESPRIFUN(pip, player, pn, 1);\r
+                                       ScrollDown(pip, player, 3, pn);\r
+                                       ScrollDown(pip, player, 2, pn);\r
+                                       //mapScrollDown(pip, player, !(pip[0].video->p), pn);\r
+                                       mapScrollDown(pip, player, (pip[0].video->p), pn);\r
+                                       if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                                       player[pn].enti.q++;\r
+                                       //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
+                       }\r
+                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
+                       {\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
+                               {\r
+                                       INC_PER_FRAME;\r
+                                       player[pn].enti.y+=(player[pn].enti.speed);\r
+                                       ANIMATESPRIFUN(pip, player, pn, 0);\r
+                                       if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
+                       }\r
+                       else\r
+                       {\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
+#ifdef SPRITE\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
+#else\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 9);\r
+#endif\r
+                               if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                               player[pn].enti.d = 2;\r
+                       }\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty+1;\r
+               break;\r
+\r
+               //up movement\r
+               case 0:\r
+                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))        //collision detection!\r
+                       {\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
+                               {\r
+                                       INC_PER_FRAME;\r
+                                       ANIMATESPRIFUN(pip, player, pn, 1);\r
+                                       ScrollUp(pip, player, 3, pn);\r
+                                       ScrollUp(pip, player, 2, pn);\r
+                                       //mapScrollUp(pip, player, !(pip[0].video->p), pn);\r
+                                       mapScrollUp(pip, player, (pip[0].video->p), pn);\r
+                                       if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                                       player[pn].enti.q++;\r
+                                       //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
+                       }\r
+                       else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX &&  player[pn].enti.ty-1 == TRIGGY))\r
+                       {\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
+                               {\r
+                                       INC_PER_FRAME;\r
+                                       player[pn].enti.y-=(player[pn].enti.speed);\r
+                                       ANIMATESPRIFUN(pip, player, pn, 0);\r
+                                       if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
+                       }\r
+                       else\r
+                       {\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
+#ifdef SPRITE\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
+#else\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 12);\r
+#endif\r
+                               if(!pageflipflop) VL_ShowPage(pip[1].page, 0, 0);\r
+                               player[pn].enti.d = 2;\r
+                       }\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty-1;\r
+               break;\r
+       }\r
+}\r
index 0de6c37bdebbd10cd758357b9b3c16a69b456965..6f0f01bad7000d1f1ea55f1ed22b914f45341b85 100755 (executable)
@@ -1,5 +1,3 @@
-16/16/16_mm.c:CA_OpenDebug ();
-16/16/16_mm.c:CA_CloseDebug ();
 16/CatacombApocalypse/C6_DEBUG.C:                              CA_CacheGrChunk(LEVEL1TEXT+mapon);\r
 16/CatacombApocalypse/C6_DEBUG.C:              CA_CacheGrChunk(LEVEL1TEXT+mapon);\r
 16/CatacombApocalypse/C6_GAME.C:       CA_CacheGrChunk(LEVEL1TEXT+mapon);\r
 16/CatacombApocalypse/GELIB.C:                                                 CA_MarkGrChunk(pi_shape_table[loop].shapenum);\r
 16/CatacombApocalypse/GELIB.C:                                                 CA_MarkGrChunk(shapenum+loop);\r
 16/CatacombApocalypse/GELIB.C: CA_CacheMarks(NULL);\r
-16/CatacombApocalypse/ID_CA.C:= CA_OpenDebug / CA_CloseDebug\r
-16/CatacombApocalypse/ID_CA.C:void CA_OpenDebug (void)\r
-16/CatacombApocalypse/ID_CA.C:void CA_CloseDebug (void)\r
-16/CatacombApocalypse/ID_CA.C:= CA_FarRead\r
-16/CatacombApocalypse/ID_CA.C:boolean CA_FarRead (int handle, byte far *dest, long length)\r
-16/CatacombApocalypse/ID_CA.C:         Quit ("CA_FarRead doesn't support 64K reads yet!");\r
-16/CatacombApocalypse/ID_CA.C:= CA_SegWrite\r
-16/CatacombApocalypse/ID_CA.C:boolean CA_FarWrite (int handle, byte far *source, long length)\r
-16/CatacombApocalypse/ID_CA.C:         Quit ("CA_FarWrite doesn't support 64K reads yet!");\r
-16/CatacombApocalypse/ID_CA.C:= CA_ReadFile\r
-16/CatacombApocalypse/ID_CA.C:boolean CA_ReadFile (char *filename, memptr *ptr)\r
-16/CatacombApocalypse/ID_CA.C: if (!CA_FarRead (handle,*ptr,size))\r
-16/CatacombApocalypse/ID_CA.C:= CA_LoadFile\r
-16/CatacombApocalypse/ID_CA.C:boolean CA_LoadFile (char *filename, memptr *ptr)\r
-16/CatacombApocalypse/ID_CA.C: if (!CA_FarRead (handle,*ptr,size))\r
-16/CatacombApocalypse/ID_CA.C:= CA_RLEWcompress\r
-16/CatacombApocalypse/ID_CA.C:long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,\r
-16/CatacombApocalypse/ID_CA.C:= CA_RLEWexpand\r
-16/CatacombApocalypse/ID_CA.C:void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,\r
-16/CatacombApocalypse/ID_CA.C: CA_FarRead(handle, (memptr)grstarts, (NUMCHUNKS+1)*FILEPOSSIZE);\r
-16/CatacombApocalypse/ID_CA.C: CA_FarRead (grhandle,compseg,chunkcomplen);\r
-16/CatacombApocalypse/ID_CA.C: CA_FarRead (grhandle,compseg,chunkcomplen);\r
-16/CatacombApocalypse/ID_CA.C: CA_FarRead (grhandle,compseg,chunkcomplen);\r
-16/CatacombApocalypse/ID_CA.C: CA_FarRead(handle, tinf, length);\r
-16/CatacombApocalypse/ID_CA.C: CA_FarRead(handle, (byte far *)audiostarts, length);\r
-16/CatacombApocalypse/ID_CA.C:= CA_Startup\r
-16/CatacombApocalypse/ID_CA.C:void CA_Startup (void)\r
-16/CatacombApocalypse/ID_CA.C:         Quit("CA_Startup(): Can't find audio files.");\r
-16/CatacombApocalypse/ID_CA.C:         Quit("CA_Startup(): Can't find level files.");\r
-16/CatacombApocalypse/ID_CA.C:         Quit("CA_Startup(): Can't find graphics files.");\r
-16/CatacombApocalypse/ID_CA.C:= CA_Shutdown\r
-16/CatacombApocalypse/ID_CA.C:void CA_Shutdown (void)\r
-16/CatacombApocalypse/ID_CA.C:= CA_CacheAudioChunk\r
-16/CatacombApocalypse/ID_CA.C:void CA_CacheAudioChunk (int chunk)\r
-16/CatacombApocalypse/ID_CA.C:         Quit("CA_CacheAudioChunk(): Can't find audio files.");\r
-16/CatacombApocalypse/ID_CA.C: CA_FarRead(audiohandle,audiosegs[chunk],compressed);\r
-16/CatacombApocalypse/ID_CA.C:         CA_FarRead(audiohandle,bufferseg,compressed);\r
-16/CatacombApocalypse/ID_CA.C:         CA_FarRead(audiohandle,bigbufferseg,compressed);\r
-16/CatacombApocalypse/ID_CA.C:= CA_LoadAllSounds\r
-16/CatacombApocalypse/ID_CA.C:void CA_LoadAllSounds (void)\r
-16/CatacombApocalypse/ID_CA.C:         CA_CacheAudioChunk (start);\r
-16/CatacombApocalypse/ID_CA.C:         CA_FarRead(grhandle,bufferseg,compressed);\r
-16/CatacombApocalypse/ID_CA.C:         CA_FarRead(grhandle,bigbufferseg,compressed);\r
-16/CatacombApocalypse/ID_CA.C:= CA_CacheGrChunk\r
-16/CatacombApocalypse/ID_CA.C:void CA_CacheGrChunk (int chunk)\r
-16/CatacombApocalypse/ID_CA.C:         Quit("CA_CacheGrChunk(): Can't find graphics files.");\r
-16/CatacombApocalypse/ID_CA.C:         CA_FarRead(grhandle,bufferseg,compressed);\r
-16/CatacombApocalypse/ID_CA.C:         CA_FarRead(grhandle,bigbufferseg,compressed);\r
-16/CatacombApocalypse/ID_CA.C:= CA_CacheMap\r
-16/CatacombApocalypse/ID_CA.C:void CA_CacheMap (int mapnum)\r
-16/CatacombApocalypse/ID_CA.C:         Quit("CA_CacheMap(): Can't find level files.");\r
-16/CatacombApocalypse/ID_CA.C:           Quit ("CA_CacheMap: Tried to load a non existent map!");\r
-16/CatacombApocalypse/ID_CA.C:         CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype));\r
-16/CatacombApocalypse/ID_CA.C:         CA_FarRead(maphandle,(byte far *)source,compressed);\r
-16/CatacombApocalypse/ID_CA.C:         CA_RLEWexpand (((unsigned far *)buffer2seg)+1,*dest,size,\r
-16/CatacombApocalypse/ID_CA.C:         CA_RLEWexpand (source+1, *dest,size,\r
-16/CatacombApocalypse/ID_CA.C:= CA_UpLevel\r
-16/CatacombApocalypse/ID_CA.C:void CA_UpLevel (void)\r
-16/CatacombApocalypse/ID_CA.C:         Quit ("CA_UpLevel: Up past level 7!");\r
-16/CatacombApocalypse/ID_CA.C:= CA_DownLevel\r
-16/CatacombApocalypse/ID_CA.C:void CA_DownLevel (void)\r
-16/CatacombApocalypse/ID_CA.C:         Quit ("CA_DownLevel: Down past level 0!");\r
-16/CatacombApocalypse/ID_CA.C: CA_CacheMarks(NULL);\r
-16/CatacombApocalypse/ID_CA.C:= CA_ClearMarks\r
-16/CatacombApocalypse/ID_CA.C:void CA_ClearMarks (void)\r
-16/CatacombApocalypse/ID_CA.C:= CA_ClearAllMarks\r
-16/CatacombApocalypse/ID_CA.C:void CA_ClearAllMarks (void)\r
-16/CatacombApocalypse/ID_CA.C:= CA_FreeGraphics\r
-16/CatacombApocalypse/ID_CA.C:void CA_FreeGraphics (void)\r
-16/CatacombApocalypse/ID_CA.C:= CA_SetAllPurge\r
-16/CatacombApocalypse/ID_CA.C:void CA_SetAllPurge (void)\r
-16/CatacombApocalypse/ID_CA.C: CA_ClearMarks ();\r
-16/CatacombApocalypse/ID_CA.C: CA_FreeGraphics ();\r
-16/CatacombApocalypse/ID_CA.C:void CA_SetGrPurge (void)\r
-16/CatacombApocalypse/ID_CA.C:= CA_CacheMarks\r
-16/CatacombApocalypse/ID_CA.C:void CA_CacheMarks (char *title)\r
-16/CatacombApocalypse/ID_CA.C:         Quit("CA_CacheMarks(): Can't find graphics files.");\r
-16/CatacombApocalypse/ID_CA.C:                                 CA_FarRead(grhandle,bufferseg,endpos-pos);\r
-16/CatacombApocalypse/ID_CA.C:                         CA_FarRead(grhandle,bigbufferseg,compressed);\r
 16/CatacombApocalypse/ID_MM.C://CA_OpenDebug ();\r
 16/CatacombApocalypse/ID_MM.C://CA_CloseDebug ();\r
 16/CatacombApocalypse/ID_RF.C:                 CA_MarkGrChunk(STARTTILE16+tile);\r
 16/CatacombApocalypse/SOFT.C:                  CA_LoadFile(SourceFile,&SrcPtr);\r
 16/CatacombApocalypse/SOFT.C:          CA_LoadFile(SourceFile,DstPtr);\r
 16/CatacombApocalypse/SOFT.C:                          if (!CA_FarRead(handle,MK_FP(*MemPtr,0),ChunkLen))\r
-16/ID_MM.C://CA_OpenDebug ();\r
-16/ID_MM.C://CA_CloseDebug ();\r
-16/keen/id_ca.c:= CA_FarRead\r
-16/keen/id_ca.c:boolean CA_FarRead (int handle, byte far *dest, long length)\r
-16/keen/id_ca.c:               Quit ("CA_FarRead doesn't support 64K reads yet!");\r
-16/keen/id_ca.c:= CA_SegWrite\r
-16/keen/id_ca.c:boolean CA_FarWrite (int handle, byte far *source, long length)\r
-16/keen/id_ca.c:               Quit ("CA_FarWrite doesn't support 64K reads yet!");\r
-16/keen/id_ca.c:= CA_LoadFile\r
-16/keen/id_ca.c:boolean CA_LoadFile (char *filename, memptr *ptr)\r
-16/keen/id_ca.c:       if (!CA_FarRead (handle,*ptr,size))\r
-16/keen/id_ca.c:= CA_RLEWcompress\r
-16/keen/id_ca.c:long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,\r
-16/keen/id_ca.c:= CA_RLEWexpand\r
-16/keen/id_ca.c:void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,\r
-16/keen/id_ca.c:       CA_FarRead(handle, (memptr)grstarts, (NUMCHUNKS+1)*4);\r
-16/keen/id_ca.c:       CA_FarRead (grhandle,compseg,chunkcomplen);\r
-16/keen/id_ca.c:       CA_FarRead (grhandle,compseg,chunkcomplen);\r
-16/keen/id_ca.c:       CA_FarRead (grhandle,compseg,chunkcomplen);\r
-16/keen/id_ca.c:       CA_FarRead(handle, tinf, length);\r
-16/keen/id_ca.c:       CA_FarRead(handle, (byte far *)audiostarts, length);\r
-16/keen/id_ca.c:= CA_Startup\r
-16/keen/id_ca.c:void CA_Startup (void)\r
-16/keen/id_ca.c:= CA_Shutdown\r
-16/keen/id_ca.c:void CA_Shutdown (void)\r
-16/keen/id_ca.c:= CA_CacheAudioChunk\r
-16/keen/id_ca.c:void CA_CacheAudioChunk (int chunk)\r
-16/keen/id_ca.c:       CA_FarRead(audiohandle,audiosegs[chunk],compressed);\r
-16/keen/id_ca.c:               CA_FarRead(audiohandle,bufferseg,compressed);\r
-16/keen/id_ca.c:               CA_FarRead(audiohandle,bigbufferseg,compressed);\r
-16/keen/id_ca.c:= CA_LoadAllSounds\r
-16/keen/id_ca.c:void CA_LoadAllSounds (void)\r
-16/keen/id_ca.c:               CA_CacheAudioChunk (start);\r
-16/keen/id_ca.c:               CA_FarRead(grhandle,bufferseg,compressed);\r
-16/keen/id_ca.c:               CA_FarRead(grhandle,bigbufferseg,compressed);\r
-16/keen/id_ca.c:= CA_CacheGrChunk\r
-16/keen/id_ca.c:void CA_CacheGrChunk (int chunk)\r
-16/keen/id_ca.c:               CA_FarRead(grhandle,bufferseg,compressed);\r
-16/keen/id_ca.c:               CA_FarRead(grhandle,bigbufferseg,compressed);\r
-16/keen/id_ca.c:= CA_CacheMap\r
-16/keen/id_ca.c:void CA_CacheMap (int mapnum)\r
-16/keen/id_ca.c:                 Quit ("CA_CacheMap: Tried to load a non existant map!");\r
-16/keen/id_ca.c:               CA_FarRead (maphandle,bufferseg,((mapfiletype   _seg *)tinf)->headersize[mapnum]);\r
-16/keen/id_ca.c:               CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype));\r
-16/keen/id_ca.c:               CA_FarRead(maphandle,(byte far *)source,compressed);\r
-16/keen/id_ca.c:               CA_RLEWexpand (((unsigned far *)buffer2seg)+1,*dest,size,\r
-16/keen/id_ca.c:               CA_RLEWexpand (source+1, *dest,size,\r
-16/keen/id_ca.c:= CA_UpLevel\r
-16/keen/id_ca.c:void CA_UpLevel (void)\r
-16/keen/id_ca.c:               Quit ("CA_UpLevel: Up past level 7!");\r
-16/keen/id_ca.c:= CA_DownLevel\r
-16/keen/id_ca.c:void CA_DownLevel (void)\r
-16/keen/id_ca.c:               Quit ("CA_DownLevel: Down past level 0!");\r
-16/keen/id_ca.c:       CA_CacheMarks(titleptr[ca_levelnum], 1);\r
-16/keen/id_ca.c:= CA_ClearMarks\r
-16/keen/id_ca.c:void CA_ClearMarks (void)\r
-16/keen/id_ca.c:= CA_ClearAllMarks\r
-16/keen/id_ca.c:void CA_ClearAllMarks (void)\r
-16/keen/id_ca.c:= CA_CacheMarks\r
-16/keen/id_ca.c:void CA_CacheMarks (char *title, boolean cachedownlevel)\r
-16/keen/id_ca.c:                                       CA_FarRead(grhandle,bufferseg,endpos-pos);\r
-16/keen/id_ca.c:                               CA_FarRead(grhandle,bigbufferseg,compressed);\r
+\r
+\r
 16/keen/id_rf.c:                       CA_MarkGrChunk(STARTTILE16+tile);\r
 16/keen/id_rf.c:                                       CA_MarkGrChunk(STARTTILE16+next);\r
 16/keen/id_rf.c:                       CA_MarkGrChunk(STARTTILE16M+tile);\r
 16/keen/soft.c:                        CA_LoadFile(SourceFile,&SrcPtr);\r
 16/keen/soft.c:                CA_LoadFile(SourceFile,DstPtr);\r
 16/keen/soft.c:                                if (!CA_FarRead(handle,MK_FP(*MemPtr,0),ChunkLen))\r
-16/wf3d8086/id_ca.c:void CA_CannotOpen(char *string);\r
-16/wf3d8086/id_ca.c:= CA_OpenDebug / CA_CloseDebug\r
-16/wf3d8086/id_ca.c:void CA_OpenDebug (void)\r
-16/wf3d8086/id_ca.c:void CA_CloseDebug (void)\r
-16/wf3d8086/id_ca.c:= CA_FarRead\r
-16/wf3d8086/id_ca.c:boolean CA_FarRead (int handle, byte far *dest, long length)\r
-16/wf3d8086/id_ca.c:           Quit ("CA_FarRead doesn't support 64K reads yet!");\r
-16/wf3d8086/id_ca.c:= CA_SegWrite\r
-16/wf3d8086/id_ca.c:boolean CA_FarWrite (int handle, byte far *source, long length)\r
-16/wf3d8086/id_ca.c:           Quit ("CA_FarWrite doesn't support 64K reads yet!");\r
-16/wf3d8086/id_ca.c:= CA_ReadFile\r
-16/wf3d8086/id_ca.c:boolean CA_ReadFile (char *filename, memptr *ptr)\r
-16/wf3d8086/id_ca.c:   if (!CA_FarRead (handle,*ptr,size))\r
-16/wf3d8086/id_ca.c:= CA_WriteFile\r
-16/wf3d8086/id_ca.c:boolean CA_WriteFile (char *filename, void far *ptr, long length)\r
-16/wf3d8086/id_ca.c:   if (!CA_FarWrite (handle,ptr,length))\r
-16/wf3d8086/id_ca.c:= CA_LoadFile\r
-16/wf3d8086/id_ca.c:boolean CA_LoadFile (char *filename, memptr *ptr)\r
-16/wf3d8086/id_ca.c:   if (!CA_FarRead (handle,*ptr,size))\r
-16/wf3d8086/id_ca.c:= CA_RLEWcompress\r
-16/wf3d8086/id_ca.c:long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,\r
-16/wf3d8086/id_ca.c:= CA_RLEWexpand\r
-16/wf3d8086/id_ca.c:void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,\r
-16/wf3d8086/id_ca.c:           CA_CannotOpen(fname);\r
-16/wf3d8086/id_ca.c:           CA_CannotOpen(fname);\r
-16/wf3d8086/id_ca.c:   CA_FarRead(handle, (memptr)grstarts, (NUMCHUNKS+1)*FILEPOSSIZE);\r
-16/wf3d8086/id_ca.c:           CA_CannotOpen(fname);\r
-16/wf3d8086/id_ca.c:   CA_FarRead (grhandle,compseg,chunkcomplen);\r
-16/wf3d8086/id_ca.c:           CA_CannotOpen(fname);\r
-16/wf3d8086/id_ca.c:   CA_FarRead(handle, tinf, length);\r
-16/wf3d8086/id_ca.c:           CA_CannotOpen(fname);\r
-16/wf3d8086/id_ca.c:           CA_CannotOpen(fname);\r
-16/wf3d8086/id_ca.c:           CA_FarRead (maphandle,(memptr)mapheaderseg[i],sizeof(maptype));\r
-16/wf3d8086/id_ca.c:           CA_CannotOpen(fname);\r
-16/wf3d8086/id_ca.c:   CA_FarRead(handle, (byte far *)audiostarts, length);\r
-16/wf3d8086/id_ca.c:           CA_CannotOpen(fname);\r
-16/wf3d8086/id_ca.c:= CA_Startup\r
-16/wf3d8086/id_ca.c:void CA_Startup (void)\r
-16/wf3d8086/id_ca.c:= CA_Shutdown\r
-16/wf3d8086/id_ca.c:void CA_Shutdown (void)\r
-16/wf3d8086/id_ca.c:= CA_CacheAudioChunk\r
-16/wf3d8086/id_ca.c:void CA_CacheAudioChunk (int chunk)\r
-16/wf3d8086/id_ca.c:   CA_FarRead(audiohandle,audiosegs[chunk],compressed);\r
-16/wf3d8086/id_ca.c:           CA_FarRead(audiohandle,bufferseg,compressed);\r
-16/wf3d8086/id_ca.c:           CA_FarRead(audiohandle,bigbufferseg,compressed);\r
-16/wf3d8086/id_ca.c:= CA_LoadAllSounds\r
-16/wf3d8086/id_ca.c:void CA_LoadAllSounds (void)\r
-16/wf3d8086/id_ca.c:           CA_CacheAudioChunk (start);\r
-16/wf3d8086/id_ca.c:= CA_CacheGrChunk\r
-16/wf3d8086/id_ca.c:void CA_CacheGrChunk (int chunk)\r
-16/wf3d8086/id_ca.c:           CA_FarRead(grhandle,bufferseg,compressed);\r
-16/wf3d8086/id_ca.c:           CA_FarRead(grhandle,bigbufferseg,compressed);\r
-16/wf3d8086/id_ca.c:= CA_CacheScreen\r
-16/wf3d8086/id_ca.c:void CA_CacheScreen (int chunk)\r
-16/wf3d8086/id_ca.c:   CA_FarRead(grhandle,bigbufferseg,compressed);\r
-16/wf3d8086/id_ca.c:= CA_CacheMap\r
-16/wf3d8086/id_ca.c:void CA_CacheMap (int mapnum)\r
-16/wf3d8086/id_ca.c:           CA_FarRead(maphandle,(byte far *)source,compressed);\r
-16/wf3d8086/id_ca.c:           CA_RLEWexpand (((unsigned far *)buffer2seg)+1,*dest,size,\r
-16/wf3d8086/id_ca.c:           CA_RLEWexpand (source+1, *dest,size,\r
-16/wf3d8086/id_ca.c:= CA_UpLevel\r
-16/wf3d8086/id_ca.c:void CA_UpLevel (void)\r
-16/wf3d8086/id_ca.c:           Quit ("CA_UpLevel: Up past level 7!");\r
-16/wf3d8086/id_ca.c:= CA_DownLevel\r
-16/wf3d8086/id_ca.c:void CA_DownLevel (void)\r
-16/wf3d8086/id_ca.c:           Quit ("CA_DownLevel: Down past level 0!");\r
-16/wf3d8086/id_ca.c:   CA_CacheMarks();\r
-16/wf3d8086/id_ca.c:= CA_ClearMarks\r
-16/wf3d8086/id_ca.c:void CA_ClearMarks (void)\r
-16/wf3d8086/id_ca.c:= CA_ClearAllMarks\r
-16/wf3d8086/id_ca.c:void CA_ClearAllMarks (void)\r
-16/wf3d8086/id_ca.c:= CA_FreeGraphics\r
-16/wf3d8086/id_ca.c:void CA_SetGrPurge (void)\r
-16/wf3d8086/id_ca.c:   CA_ClearMarks ();\r
-16/wf3d8086/id_ca.c:= CA_SetAllPurge\r
-16/wf3d8086/id_ca.c:void CA_SetAllPurge (void)\r
-16/wf3d8086/id_ca.c:   CA_SetGrPurge ();\r
-16/wf3d8086/id_ca.c:= CA_CacheMarks\r
-16/wf3d8086/id_ca.c:void CA_CacheMarks (void)\r
-16/wf3d8086/id_ca.c:                                   CA_FarRead(grhandle,bufferseg,endpos-pos);\r
-16/wf3d8086/id_ca.c:                           CA_FarRead(grhandle,bigbufferseg,compressed);\r
-16/wf3d8086/id_ca.c:void CA_CannotOpen(char *string)\r
+\r
+\r
 16/wf3d8086/id_pm.c:   if (!CA_FarRead(PageFile,buf,length))\r
 16/wf3d8086/id_pm.c:   if (!CA_FarRead(PageFile,(byte far *)buf,size))\r
 16/wf3d8086/id_pm.c:   if (!CA_FarRead(PageFile,(byte far *)buf,size))\r
 16/wf3d8086/id_vh.c:   CA_CacheGrChunk (STARTTILE8);\r
 16/wf3d8086/id_vh.c:           CA_CacheGrChunk (STARTTILE16+i);\r
 16/wf3d8086/id_vh.c:           CA_CacheGrChunk (i);\r
-16/wf3d8086/obj/wolf3d.map: 1710:000B 1752 C=CODE   S=ID_CA_TEXT     G=(none)  M=ID_CA.C    ACBP=28\r
 16/wf3d8086/wl_act2.c: CA_UpLevel ();\r
 16/wf3d8086/wl_act2.c: CA_CacheScreen(C_LETSSEEPIC);\r
 16/wf3d8086/wl_act2.c: CA_DownLevel ();\r
 16/wf3d8086/wl_text.c: CA_CacheGrChunk (artnum);\r
 16/wf3d8086/wl_text.c: CA_LoadFile (endfilename,&layout);\r
 16/wf3d8086/wl_text.c: CA_DownLevel ();\r
-16/wf3d8086/wolf3d.map: 160F:0008 16B9 C=CODE   S=ID_CA_TEXT     G=(none)  M=ID_CA.C    ACBP=28\r
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_CannotOpen(char *string);
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_OpenDebug / CA_CloseDebug
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_OpenDebug (void)
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_CloseDebug (void)
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_FarRead
-16/wolf3d/WOLFSRC/ID_CA.C:boolean CA_FarRead (int handle, byte far *dest, long length)
-16/wolf3d/WOLFSRC/ID_CA.C:             Quit ("CA_FarRead doesn't support 64K reads yet!");
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_SegWrite
-16/wolf3d/WOLFSRC/ID_CA.C:boolean CA_FarWrite (int handle, byte far *source, long length)
-16/wolf3d/WOLFSRC/ID_CA.C:             Quit ("CA_FarWrite doesn't support 64K reads yet!");
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_ReadFile
-16/wolf3d/WOLFSRC/ID_CA.C:boolean CA_ReadFile (char *filename, memptr *ptr)
-16/wolf3d/WOLFSRC/ID_CA.C:     if (!CA_FarRead (handle,*ptr,size))
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_WriteFile
-16/wolf3d/WOLFSRC/ID_CA.C:boolean CA_WriteFile (char *filename, void far *ptr, long length)
-16/wolf3d/WOLFSRC/ID_CA.C:     if (!CA_FarWrite (handle,ptr,length))
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_LoadFile
-16/wolf3d/WOLFSRC/ID_CA.C:boolean CA_LoadFile (char *filename, memptr *ptr)
-16/wolf3d/WOLFSRC/ID_CA.C:     if (!CA_FarRead (handle,*ptr,size))
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_RLEWcompress
-16/wolf3d/WOLFSRC/ID_CA.C:long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_RLEWexpand
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CannotOpen(fname);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CannotOpen(fname);
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_FarRead(handle, (memptr)grstarts, (NUMCHUNKS+1)*FILEPOSSIZE);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CannotOpen(fname);
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_FarRead (grhandle,compseg,chunkcomplen);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CannotOpen(fname);
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_FarRead(handle, tinf, length);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CannotOpen(fname);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CannotOpen(fname);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_FarRead (maphandle,(memptr)mapheaderseg[i],sizeof(maptype));
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CannotOpen(fname);
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_FarRead(handle, (byte far *)audiostarts, length);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CannotOpen(fname);
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_Startup
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_Startup (void)
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_Shutdown
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_Shutdown (void)
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_CacheAudioChunk
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_CacheAudioChunk (int chunk)
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_FarRead(audiohandle,audiosegs[chunk],compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_FarRead(audiohandle,bufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_FarRead(audiohandle,bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_LoadAllSounds
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_LoadAllSounds (void)
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_CacheAudioChunk (start);
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_CacheGrChunk
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_CacheGrChunk (int chunk)
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_FarRead(grhandle,bufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_FarRead(grhandle,bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_CacheScreen
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_CacheScreen (int chunk)
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_FarRead(grhandle,bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_CacheMap
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_CacheMap (int mapnum)
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_FarRead(maphandle,(byte far *)source,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_RLEWexpand (((unsigned far *)buffer2seg)+1,*dest,size,
-16/wolf3d/WOLFSRC/ID_CA.C:             CA_RLEWexpand (source+1, *dest,size,
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_UpLevel
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_UpLevel (void)
-16/wolf3d/WOLFSRC/ID_CA.C:             Quit ("CA_UpLevel: Up past level 7!");
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_DownLevel
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_DownLevel (void)
-16/wolf3d/WOLFSRC/ID_CA.C:             Quit ("CA_DownLevel: Down past level 0!");
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_CacheMarks();
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_ClearMarks
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_ClearMarks (void)
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_ClearAllMarks
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_ClearAllMarks (void)
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_FreeGraphics
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_SetGrPurge (void)
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_ClearMarks ();
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_SetAllPurge
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_SetAllPurge (void)
-16/wolf3d/WOLFSRC/ID_CA.C:     CA_SetGrPurge ();
-16/wolf3d/WOLFSRC/ID_CA.C:= CA_CacheMarks
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_CacheMarks (void)
-16/wolf3d/WOLFSRC/ID_CA.C:                                     CA_FarRead(grhandle,bufferseg,endpos-pos);
-16/wolf3d/WOLFSRC/ID_CA.C:                             CA_FarRead(grhandle,bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:void CA_CannotOpen(char *string)
-16/wolf3d/WOLFSRC/ID_PM.C:     if (!CA_FarRead(PageFile,buf,length))
-16/wolf3d/WOLFSRC/ID_PM.C:     if (!CA_FarRead(PageFile,(byte far *)buf,size))
-16/wolf3d/WOLFSRC/ID_PM.C:     if (!CA_FarRead(PageFile,(byte far *)buf,size))
-16/wolf3d/WOLFSRC/ID_VH.C:     CA_CacheGrChunk (STARTTILE8);
-16/wolf3d/WOLFSRC/ID_VH.C:             CA_CacheGrChunk (STARTTILE16+i);
-16/wolf3d/WOLFSRC/ID_VH.C:             CA_CacheGrChunk (i);
-16/wolf3d/WOLFSRC/WL_ACT2.C:   CA_UpLevel ();
-16/wolf3d/WOLFSRC/WL_ACT2.C:   CA_CacheScreen(C_LETSSEEPIC);
-16/wolf3d/WOLFSRC/WL_ACT2.C:   CA_DownLevel ();
-16/wolf3d/WOLFSRC/WL_DEBUG.C:  CA_SetAllPurge();
-16/wolf3d/WOLFSRC/WL_GAME.C:   CA_CacheMap (gamestate.mapon+10*gamestate.episode);
-16/wolf3d/WOLFSRC/WL_GAME.C:   CA_LoadAllSounds ();
-16/wolf3d/WOLFSRC/WL_GAME.C:   CA_CacheGrChunk (STATUSBARPIC);
-16/wolf3d/WOLFSRC/WL_GAME.C:                   CA_WriteFile (demoname,(void far *)demobuffer,length);
-16/wolf3d/WOLFSRC/WL_GAME.C:   CA_CacheGrChunk(STARTFONT);
-16/wolf3d/WOLFSRC/WL_GAME.C:   CA_CacheGrChunk(dems[demonumber]);
-16/wolf3d/WOLFSRC/WL_GAME.C:   CA_LoadFile (demoname,&demobuffer);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheScreen (screen);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (palette);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheScreen (ENDSCREEN3PIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (END3PALETTE);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(BJCOLLAPSE1PIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(BJCOLLAPSE2PIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(BJCOLLAPSE3PIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(BJCOLLAPSE4PIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(STARTFONT);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(C_TIMECODEPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(C_ENDRATIOSPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (PG13PIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(C_INTERMISSIONPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:          CA_CacheGrChunk (STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_INTER.C:          CA_CacheGrChunk (STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_INTER.C://        CA_CacheGrChunk (C_CODEPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (HIGHSCORESPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (STARTFONT);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (C_LEVELPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (C_SCOREPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (C_NAMEPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(C_BACKDROPPIC);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_INTER.C:  CA_LoadAllSounds();
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&gamestate,sizeof(gamestate));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*20);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*8);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)tilemap,sizeof(tilemap));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)actorat,sizeof(actorat));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)areaconnect,sizeof(areaconnect));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)areabyplayer,sizeof(areabyplayer));
-16/wolf3d/WOLFSRC/WL_MAIN.C:    CA_FarWrite (file,(void far *)ob,sizeof(*ob));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&nullobj,sizeof(nullobj));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&laststatobj,sizeof(laststatobj));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)statobjlist,sizeof(statobjlist));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)doorposition,sizeof(doorposition));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)doorobjlist,sizeof(doorobjlist));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwallstate,sizeof(pwallstate));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwallx,sizeof(pwallx));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwally,sizeof(pwally));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwalldir,sizeof(pwalldir));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwallpos,sizeof(pwallpos));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&checksum,sizeof(checksum));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&gamestate,sizeof(gamestate));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*20);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*8);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)tilemap,sizeof(tilemap));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)actorat,sizeof(actorat));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)areaconnect,sizeof(areaconnect));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)areabyplayer,sizeof(areabyplayer));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)player,sizeof(*player));
-16/wolf3d/WOLFSRC/WL_MAIN.C:           CA_FarRead (file,(void far *)&nullobj,sizeof(nullobj));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&laststatobj,sizeof(laststatobj));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)statobjlist,sizeof(statobjlist));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)doorposition,sizeof(doorposition));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)doorobjlist,sizeof(doorobjlist));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwallstate,sizeof(pwallstate));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwallx,sizeof(pwallx));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwally,sizeof(pwally));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwalldir,sizeof(pwalldir));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwallpos,sizeof(pwallpos));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&oldchecksum,sizeof(oldchecksum));
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_Shutdown ();
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_CacheGrChunk (STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_LoadAllSounds ();
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_Startup ();
-16/wolf3d/WOLFSRC/WL_MAIN.C:           CA_CacheGrChunk (ERRORSCREEN);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_CacheGrChunk(STARTFONT);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_UpLevel ();
-16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_DownLevel ();
-16/wolf3d/WOLFSRC/WL_MAIN.C:    CA_CacheGrChunk (ORDERSCREEN);
-16/wolf3d/WOLFSRC/WL_MAIN.C:    CA_CacheGrChunk (ERRORSCREEN);
-16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheGrChunk (TITLEPALETTE);
-16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheGrChunk (TITLE1PIC);
-16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheGrChunk (TITLE2PIC);
-16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheScreen (TITLEPIC);
-16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheScreen (CREDITSPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk (IDGUYS1PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk (IDGUYS2PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk (IDGUYSPALETTE);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_OPTIONSPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:           CA_CacheGrChunk(C_MRETGAMEPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:           CA_CacheGrChunk(C_MENDGAMEPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:           CA_CacheGrChunk(C_MRETDEMOPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:           CA_CacheGrChunk(C_MSCORESPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR1PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR2PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_DISKLOADING1PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_DISKLOADING2PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_SAVEGAMEPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_MOUSELBACKPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR1PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR1PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR2PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_DISKLOADING1PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_DISKLOADING2PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_LOADGAMEPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_MOUSELBACKPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR1PIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_EPISODEPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_SKILLPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:                                   CA_LoadAllSounds();
-16/wolf3d/WOLFSRC/WL_MENU.C:                                   CA_LoadAllSounds();
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_SOUNDPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_MOUSESENSPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_CONTROLPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_CUSTOMPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_CHANGEPIC);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheGrChunk(i);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheGrChunk(STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MENU.C:           CA_LoadAllSounds();
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheGrChunk(pic);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheGrChunk (STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheAudioChunk(STARTMUSIC + chunk);
-16/wolf3d/WOLFSRC/WL_PLAY.C:           CA_CacheGrChunk (STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_PLAY.C:    CA_CacheGrChunk (STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_PLAY.C:    CA_CacheGrChunk (STARTFONT+1);
-16/wolf3d/WOLFSRC/WL_PLAY.C:           CA_CacheGrChunk (STARTFONT);
-16/wolf3d/WOLFSRC/WL_PLAY.C:   CA_CacheAudioChunk(STARTMUSIC + chunk);
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk(H_TOPWINDOWPIC);
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk(H_LEFTWINDOWPIC);
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk(H_RIGHTWINDOWPIC);
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk(H_BOTTOMINFOPIC);
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_CacheMarks ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk (picnum);
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk (picnum);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_MarkGrChunk(STARTFONT);
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_CacheScreen(snames[pagenum - 1]);
-16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_CacheScreen(enames[which*2 + pagenum - 1]);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_UpLevel ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_DownLevel ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_CacheGrChunk (artnum);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_LoadFile (helpfilename,&layout);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_DownLevel ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_UpLevel ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_DownLevel ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_CacheGrChunk (artnum);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_LoadFile (endfilename,&layout);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_DownLevel ();
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 160F:0008 16B9 C=CODE   S=ID_CA_TEXT     G=(none)  M=ID_CA.C    ACBP=28
+\r
+\r
+16/wolf3d/WOLFSRC/ID_PM.C:     if (!CA_FarRead(PageFile,buf,length))\r
+16/wolf3d/WOLFSRC/ID_PM.C:     if (!CA_FarRead(PageFile,(byte far *)buf,size))\r
+16/wolf3d/WOLFSRC/ID_PM.C:     if (!CA_FarRead(PageFile,(byte far *)buf,size))\r
+16/wolf3d/WOLFSRC/ID_VH.C:     CA_CacheGrChunk (STARTTILE8);\r
+16/wolf3d/WOLFSRC/ID_VH.C:             CA_CacheGrChunk (STARTTILE16+i);\r
+16/wolf3d/WOLFSRC/ID_VH.C:             CA_CacheGrChunk (i);\r
+16/wolf3d/WOLFSRC/WL_ACT2.C:   CA_UpLevel ();\r
+16/wolf3d/WOLFSRC/WL_ACT2.C:   CA_CacheScreen(C_LETSSEEPIC);\r
+16/wolf3d/WOLFSRC/WL_ACT2.C:   CA_DownLevel ();\r
+16/wolf3d/WOLFSRC/WL_DEBUG.C:  CA_SetAllPurge();\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   CA_CacheMap (gamestate.mapon+10*gamestate.episode);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   CA_LoadAllSounds ();\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   CA_CacheGrChunk (STATUSBARPIC);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:                   CA_WriteFile (demoname,(void far *)demobuffer,length);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   CA_CacheGrChunk(STARTFONT);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   CA_CacheGrChunk(dems[demonumber]);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   CA_LoadFile (demoname,&demobuffer);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheScreen (screen);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (palette);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheScreen (ENDSCREEN3PIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (END3PALETTE);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(BJCOLLAPSE1PIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(BJCOLLAPSE2PIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(BJCOLLAPSE3PIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(BJCOLLAPSE4PIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(STARTFONT);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(C_TIMECODEPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(C_ENDRATIOSPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (PG13PIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(C_INTERMISSIONPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:          CA_CacheGrChunk (STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:          CA_CacheGrChunk (STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_INTER.C://        CA_CacheGrChunk (C_CODEPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (HIGHSCORESPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (STARTFONT);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (C_LEVELPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (C_SCOREPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (C_NAMEPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk (STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(C_BACKDROPPIC);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  CA_LoadAllSounds();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&gamestate,sizeof(gamestate));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*20);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*8);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)tilemap,sizeof(tilemap));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)actorat,sizeof(actorat));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)areaconnect,sizeof(areaconnect));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)areabyplayer,sizeof(areabyplayer));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:    CA_FarWrite (file,(void far *)ob,sizeof(*ob));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&nullobj,sizeof(nullobj));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&laststatobj,sizeof(laststatobj));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)statobjlist,sizeof(statobjlist));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)doorposition,sizeof(doorposition));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)doorobjlist,sizeof(doorobjlist));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwallstate,sizeof(pwallstate));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwallx,sizeof(pwallx));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwally,sizeof(pwally));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwalldir,sizeof(pwalldir));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&pwallpos,sizeof(pwallpos));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarWrite (file,(void far *)&checksum,sizeof(checksum));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&gamestate,sizeof(gamestate));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*20);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*8);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)tilemap,sizeof(tilemap));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)actorat,sizeof(actorat));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)areaconnect,sizeof(areaconnect));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)areabyplayer,sizeof(areabyplayer));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)player,sizeof(*player));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:           CA_FarRead (file,(void far *)&nullobj,sizeof(nullobj));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&laststatobj,sizeof(laststatobj));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)statobjlist,sizeof(statobjlist));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)doorposition,sizeof(doorposition));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)doorobjlist,sizeof(doorobjlist));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwallstate,sizeof(pwallstate));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwallx,sizeof(pwallx));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwally,sizeof(pwally));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwalldir,sizeof(pwalldir));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&pwallpos,sizeof(pwallpos));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_FarRead (file,(void far *)&oldchecksum,sizeof(oldchecksum));\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_Shutdown ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_CacheGrChunk (STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_LoadAllSounds ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_Startup ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:           CA_CacheGrChunk (ERRORSCREEN);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_CacheGrChunk(STARTFONT);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_UpLevel ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   CA_DownLevel ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:    CA_CacheGrChunk (ORDERSCREEN);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:    CA_CacheGrChunk (ERRORSCREEN);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheGrChunk (TITLEPALETTE);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheGrChunk (TITLE1PIC);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheGrChunk (TITLE2PIC);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheScreen (TITLEPIC);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:                   CA_CacheScreen (CREDITSPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk (IDGUYS1PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk (IDGUYS2PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk (IDGUYSPALETTE);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_OPTIONSPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:           CA_CacheGrChunk(C_MRETGAMEPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:           CA_CacheGrChunk(C_MENDGAMEPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:           CA_CacheGrChunk(C_MRETDEMOPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:           CA_CacheGrChunk(C_MSCORESPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR1PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR2PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_DISKLOADING1PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_DISKLOADING2PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_SAVEGAMEPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_MOUSELBACKPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR1PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR1PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR2PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_DISKLOADING1PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_DISKLOADING2PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_LOADGAMEPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_MOUSELBACKPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           CA_CacheGrChunk(C_CURSOR1PIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                   CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_EPISODEPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_SKILLPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                                   CA_LoadAllSounds();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                                   CA_LoadAllSounds();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_SOUNDPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_MOUSESENSPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_CONTROLPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_CUSTOMPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheScreen(S_CHANGEPIC);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheGrChunk(i);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheGrChunk(STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:           CA_LoadAllSounds();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheGrChunk(pic);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheGrChunk (STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   CA_CacheAudioChunk(STARTMUSIC + chunk);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:           CA_CacheGrChunk (STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:    CA_CacheGrChunk (STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:    CA_CacheGrChunk (STARTFONT+1);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:           CA_CacheGrChunk (STARTFONT);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:   CA_CacheAudioChunk(STARTMUSIC + chunk);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk(H_TOPWINDOWPIC);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk(H_LEFTWINDOWPIC);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk(H_RIGHTWINDOWPIC);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk(H_BOTTOMINFOPIC);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_CacheMarks ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk (picnum);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_MarkGrChunk (picnum);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_MarkGrChunk(STARTFONT);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_CacheScreen(snames[pagenum - 1]);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:                           CA_CacheScreen(enames[which*2 + pagenum - 1]);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_UpLevel ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_DownLevel ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_CacheGrChunk (artnum);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_LoadFile (helpfilename,&layout);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_DownLevel ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_UpLevel ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_DownLevel ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_CacheGrChunk (artnum);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_LoadFile (endfilename,&layout);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   CA_DownLevel ();\r
similarity index 100%
rename from planarNotes.txt
rename to doc/planarNotes.txt
index eb0e3f8969aa1c2967b9a2d31dda1766dc074e7a..d1b24cf848f562245b822c7ea29b87a51c1ee423 100755 (executable)
Binary files a/fontgfx.exe and b/fontgfx.exe differ
index 5695c6800fb17968b5b57b296e2ecf6d3ab2d739..2f6803af3af80c8ca58b5f5b9567a08ce16ce2ba 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -107,7 +107,7 @@ UPXQ=-qqq
 S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768
 Z_FLAGS=-zk0 -zc -zp8 -zm
 O_FLAGS=-opmilr -oe=24 -outback -ei -ohnl+                             -zp4
-T_FLAGS=-bt=dos -wx -m$(MEMORYMODE) -0 -fpi87 -d1##-fo=.$(OBJ) -e=65536
+T_FLAGS=-bt=dos -wx -m$(MEMORYMODE) -0 -fpi87 -d1 -e28#65536##-fo=.$(OBJ)
 
 DBUGFLAGS=-fm=$^&.mah -fd=$^&
 CPPFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1
@@ -185,14 +185,14 @@ TESTEXEC = &
        scroll.exe &
        zcroll.exe &
        inputest.exe &
-       pcxtest.exe &
-       vrstest.exe
+       pcxtest.exe
 TESTEXEC2 = &
        maptest.exe &
        fmemtest.exe &
        fonttest.exe &
        fontgfx.exe &
        test0.exe &
+       vrstest.exe &
        $(EXTERNTESTEXEC)
 TESTEXEC3= &
        pcxtest2.exe
@@ -335,9 +335,10 @@ mapread.$(OBJ):$(SRCLIB)/mapread.c $(SRCLIB)/mapread.h
 16_map.$(OBJ):$(SRCLIB)/16_map.c $(SRCLIB)/16_map.h
 16_timer.$(OBJ):$(SRCLIB)/16_timer.c $(SRCLIB)/16_timer.h
 16_in.$(OBJ):   $(SRCLIB)/16_in.c $(SRCLIB)/16_in.h
-16_mm.$(OBJ):   $(SRCLIB)/16_mm.c $(SRCLIB)/16_mm.h
-16_pm.$(OBJ):   $(SRCLIB)/16_pm.c $(SRCLIB)/16_pm.h
-16_ca.$(OBJ):   $(SRCLIB)/16_ca.c $(SRCLIB)/16_ca.h
+16_rf.$(OBJ):   $(SRCLIB)/16_rf.c      $(SRCLIB)/16_rf.h
+16_mm.$(OBJ):   $(SRCLIB)/16_mm.c      $(SRCLIB)/16_mm.h
+16_pm.$(OBJ):   $(SRCLIB)/16_pm.c      $(SRCLIB)/16_pm.h
+16_ca.$(OBJ):   $(SRCLIB)/16_ca.c      $(SRCLIB)/16_ca.h
 16_dbg.$(OBJ): $(SRCLIB)/16_dbg.c $(SRCLIB)/16_dbg.h
 midi.$(OBJ):   $(SRCLIB)/midi.c $(SRCLIB)/midi.h
 16_head.$(OBJ):$(SRCLIB)/16_head.c $(SRCLIB)/16_head.h
index 7b0739a6b3aa73a51e779a24032183e210526f78..9d0622f7ff67cdf76dced27e2d5c4b6e7085b487 100755 (executable)
@@ -1,76 +1,3 @@
-16/16/16_mm.c:MM_SizePtr to change the size of a given pointer
-16/16/16_mm.c:         strcpy(str,"MM_SetupEMS: EMS error ");
-16/16/16_mm.c:         MM_EMSerr(&str, err);
-16/16/16_mm.c:= MM_MapEMS
-16/16/16_mm.c:byte MM_MapEMS(mminfo_t *mm, mminfotype *mmi)
-16/16/16_mm.c:                 strcpy(str,"MM_MapEMS: EMS error ");
-16/16/16_mm.c:                 MM_EMSerr(str, err);
-16/16/16_mm.c:byte MM_MapXEMS(mminfo_t *mm, mminfotype *mmi)
-16/16/16_mm.c:                 //strcpy(str,"MM_MapXEMS: EMS error 0x");
-16/16/16_mm.c:                 strcpy(str,"MM_MapXEMS: EMS error ");
-16/16/16_mm.c:                 MM_EMSerr(&str, err);
-16/16/16_mm.c:         MM_FreeBlock(scan, mm);
-16/16/16_mm.c:         MM_GetNewBlock(mm);
-16/16/16_mm.c:                 MM_FreePtr(scan->useptr, mm);
-16/16/16_mm.c: printf("MM_ClearBlock: No purgable blocks!\n");
-16/16/16_mm.c:= MM_Startup
-16/16/16_mm.c:void MM_Startup(mminfo_t *mm, mminfotype *mmi)
-16/16/16_mm.c:         MM_Shutdown(mm);
-16/16/16_mm.c: MM_GetNewBlock(mm);
-16/16/16_mm.c:                 MM_MapEMS(mm, mmi);                                     // map in used pages
-16/16/16_mm.c:                 //MM_MapXEMS(mm, mmi);                                  // map in used pages
-16/16/16_mm.c: MM_GetPtr(&(mm->bufferseg),BUFFERSIZE, mm, mmi);
-16/16/16_mm.c:= MM_Shutdown
-16/16/16_mm.c:void MM_Shutdown(mminfo_t *mm)
-16/16/16_mm.c:= MM_GetPtr
-16/16/16_mm.c:void MM_GetPtr(memptr *baseptr,dword size, mminfo_t *mm, mminfotype *mmi)
-16/16/16_mm.c: MM_GetNewBlock(mm);                             // fill in start and next after a spot is found
-16/16/16_mm.c:                 MM_SortMem(mm);
-16/16/16_mm.c:                                 MM_FreeBlock(purge, mm);
-16/16/16_mm.c:         MM_Shutdown(mm);
-16/16/16_mm.c:= MM_FreePtr
-16/16/16_mm.c:void MM_FreePtr(memptr *baseptr, mminfo_t *mm)
-16/16/16_mm.c:         printf("MM_FreePtr: Block not found!\n");
-16/16/16_mm.c: MM_FreeBlock(scan, mm);
-16/16/16_mm.c:= MM_SetPurge
-16/16/16_mm.c:void MM_SetPurge(memptr *baseptr, int purge, mminfo_t *mm)
-16/16/16_mm.c:                 printf("MM_SetPurge: Block not found!");
-16/16/16_mm.c:= MM_SetLock
-16/16/16_mm.c:void MM_SetLock(memptr *baseptr, boolean locked, mminfo_t *mm)
-16/16/16_mm.c:                 printf("MM_SetLock: Block not found!");
-16/16/16_mm.c:= MM_SortMem
-16/16/16_mm.c:void MM_SortMem(mminfo_t *mm)
-16/16/16_mm.c:         MM_SetLock(&(memptr)audiosegs[playing],true);
-16/16/16_mm.c:                         MM_FreeBlock(scan, mm);
-16/16/16_mm.c:         MM_SetLock(&(memptr)audiosegs[playing],false);*/
-16/16/16_mm.c:= MM_ShowMemory
-16/16/16_mm.c:void MM_ShowMemory(/*page_t *page, */mminfo_t *mm)
-16/16/16_mm.c:                 write(debughandle,"\nMM_ShowMemory: Memory block order currupted!\n",strlen("\nMM_ShowMemory: Memory block order currupted!\n"));
-16/16/16_mm.c:                 //modexprint(&page, chx, chy, 1, 0, 24, "\nMM_ShowMemory: Memory block order currupted!\n");
-16/16/16_mm.c:= MM_DumpData
-16/16/16_mm.c:void MM_DumpData(mminfo_t *mm)
-16/16/16_mm.c:         printf("MM_DumpData: Couldn't open MMDUMP.16!\n");
-16/16/16_mm.c:= MM_UnusedMemory
-16/16/16_mm.c:dword MM_UnusedMemory(mminfo_t *mm)
-16/16/16_mm.c:= MM_TotalFree
-16/16/16_mm.c:dword MM_TotalFree(mminfo_t *mm)
-16/16/16_mm.c:= MM_Report
-16/16/16_mm.c:void MM_Report(/*page_t *page, */mminfo_t *mm, mminfotype *mmi)
-16/16/16_mm.c: printf("UnusedMemory=%lu\n", MM_UnusedMemory(mm));
-16/16/16_mm.c: printf("TotalFree=%lu\n", MM_TotalFree(mm));
-16/16/16_mm.c://       printf("UnusedMemory=%lu kb\n", MM_UnusedMemory()/10248);
-16/16/16_mm.c://       printf("TotalFree=%lu kb\n", MM_TotalFree()/10248);
-16/16/16_mm.c:= MM_EMSerr
-16/16/16_mm.c:void MM_EMSerr(byte *stri, byte err)
-16/16/16_mm.c:= MM_BombOnError
-16/16/16_mm.c:void MM_BombOnError(boolean bomb, mminfo_t *mm)
-16/16/16_mm.c:void MM_GetNewBlock(mminfo_t *mm)
-16/16/16_mm.c:         printf("MM_GETNEWBLOCK: No free blocks!\n");
-16/16/16_mm.c:void MM_FreeBlock(mmblocktype *x, mminfo_t *mm)
-16/16/16_mm.c:void MM_seguin(void)
-16/16/16_mm.c:void MM_segude(void)
-16/16/src/lib/16_in.c: MM_GetPtr((memptr *)&DemoBuffer,bufsize);
-16/16/src/lib/16_in.c:         MM_FreePtr((memptr *)&DemoBuffer);
 16/CatacombApocalypse/C6_DEBUG.C:                                      MM_SetPurge(&grsegs[LEVEL1TEXT+mapon],3);\r
 16/CatacombApocalypse/C6_DEBUG.C:                                      MM_SetPurge(&grsegs[LEVEL1TEXT+mapon],3);\r
 16/CatacombApocalypse/C6_DEBUG.C:              MM_SetPurge(&grsegs[LEVEL1TEXT+mapon],3);\r
 16/CatacombApocalypse/ID_CA.C:                         MM_FreePtr(&bigbufferseg);\r
 16/CatacombApocalypse/ID_IN.C: MM_GetPtr((memptr *)&DemoBuffer,bufsize);\r
 16/CatacombApocalypse/ID_IN.C:         MM_FreePtr((memptr *)&DemoBuffer);\r
-16/CatacombApocalypse/ID_MM.C:MM_SizePtr to change the size of a given pointer\r
-16/CatacombApocalypse/ID_MM.C:#define OUT_OF_MEM_MSG   "MM_GetPtr: Out of memory!\nYou were short :%ld bytes"\r
-16/CatacombApocalypse/ID_MM.C://#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!")\\r
-16/CatacombApocalypse/ID_MM.C:void             MM_MapEMS (void);\r
-16/CatacombApocalypse/ID_MM.C:= MM_MapEMS\r
-16/CatacombApocalypse/ID_MM.C:void MM_MapEMS (void)\r
-16/CatacombApocalypse/ID_MM.C: strcpy (str,"MM_MapEMS: EMS error 0x");\r
-16/CatacombApocalypse/ID_MM.C:                 MM_FreePtr(scan->useptr);\r
-16/CatacombApocalypse/ID_MM.C: Quit ("MM_ClearBlock: No purgable blocks!");\r
-16/CatacombApocalypse/ID_MM.C:= MM_Startup\r
-16/CatacombApocalypse/ID_MM.C:void MM_Startup (void)\r
-16/CatacombApocalypse/ID_MM.C:         MM_Shutdown ();\r
-16/CatacombApocalypse/ID_MM.C:         MM_MapEMS();                                    // map in used pages\r
-16/CatacombApocalypse/ID_MM.C: MM_GetPtr (&bufferseg,BUFFERSIZE);\r
-16/CatacombApocalypse/ID_MM.C:= MM_Shutdown\r
-16/CatacombApocalypse/ID_MM.C:void MM_Shutdown (void)\r
-16/CatacombApocalypse/ID_MM.C:= MM_GetPtr\r
-16/CatacombApocalypse/ID_MM.C:void MM_GetPtr (memptr *baseptr,unsigned long size)\r
-16/CatacombApocalypse/ID_MM.C:                 MM_SortMem ();\r
-16/CatacombApocalypse/ID_MM.C:= MM_FreePtr\r
-16/CatacombApocalypse/ID_MM.C:void MM_FreePtr (memptr *baseptr)\r
-16/CatacombApocalypse/ID_MM.C:         Quit ("MM_FreePtr: Block not found!");\r
-16/CatacombApocalypse/ID_MM.C:= MM_SetPurge\r
-16/CatacombApocalypse/ID_MM.C:void MM_SetPurge (memptr *baseptr, int purge)\r
-16/CatacombApocalypse/ID_MM.C:                 Quit ("MM_SetPurge: Block not found!");\r
-16/CatacombApocalypse/ID_MM.C:= MM_SetLock\r
-16/CatacombApocalypse/ID_MM.C:void MM_SetLock (memptr *baseptr, boolean locked)\r
-16/CatacombApocalypse/ID_MM.C:                 Quit ("MM_SetLock: Block not found!");\r
-16/CatacombApocalypse/ID_MM.C:= MM_SortMem\r
-16/CatacombApocalypse/ID_MM.C:void MM_SortMem (void)\r
-16/CatacombApocalypse/ID_MM.C:         MM_SetLock(&(memptr)audiosegs[playing],true);\r
-16/CatacombApocalypse/ID_MM.C:         MM_SetLock(&(memptr)audiosegs[playing],false);\r
-16/CatacombApocalypse/ID_MM.C:= MM_ShowMemory\r
-16/CatacombApocalypse/ID_MM.C:void MM_ShowMemory (void)\r
-16/CatacombApocalypse/ID_MM.C:                 Quit ("MM_ShowMemory: Memory block order currupted!");\r
-16/CatacombApocalypse/ID_MM.C:= MM_UnusedMemory\r
-16/CatacombApocalypse/ID_MM.C:long MM_UnusedMemory (void)\r
-16/CatacombApocalypse/ID_MM.C:= MM_TotalFree\r
-16/CatacombApocalypse/ID_MM.C:long MM_TotalFree (void)\r
-16/CatacombApocalypse/ID_MM.C:= MM_BombOnError\r
-16/CatacombApocalypse/ID_MM.C:void MM_BombOnError (boolean bomb)\r
 16/CatacombApocalypse/ID_US.C: MM_GetPtr(save,(w * h) * CHARWIDTH);\r
 16/CatacombApocalypse/ID_US.C: MM_FreePtr(save);\r
 16/CatacombApocalypse/ID_US.C: MM_GetPtr(&LineOffsets,MaxHelpLines * sizeof(word));\r
 16/CatacombApocalypse/SOFT.C:                  MM_GetPtr(&SHP->Data,size);\r
 16/CatacombApocalypse/SOFT.C:          MM_FreePtr(&IFFfile);\r
 16/CatacombApocalypse/SOFT.C:                  MM_GetPtr(MemPtr,FileEntry.OrginalLength);\r
-16/ID_MM.C:MM_SizePtr to change the size of a given pointer\r
-16/ID_MM.C:#define OUT_OF_MEM_MSG      "MM_GetPtr: Out of memory!\nYou were short :%ld bytes"\r
-16/ID_MM.C://#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!")\\r
-16/ID_MM.C:void                MM_MapEMS (void);\r
-16/ID_MM.C:= MM_MapEMS\r
-16/ID_MM.C:void MM_MapEMS (void)\r
-16/ID_MM.C:    strcpy (str,"MM_MapEMS: EMS error 0x");\r
-16/ID_MM.C:                    MM_FreePtr(scan->useptr);\r
-16/ID_MM.C:    Quit ("MM_ClearBlock: No purgable blocks!");\r
-16/ID_MM.C:= MM_Startup\r
-16/ID_MM.C:void MM_Startup (void)\r
-16/ID_MM.C:            MM_Shutdown ();\r
-16/ID_MM.C:            MM_MapEMS();                                    // map in used pages\r
-16/ID_MM.C:    MM_GetPtr (&bufferseg,BUFFERSIZE);\r
-16/ID_MM.C:= MM_Shutdown\r
-16/ID_MM.C:void MM_Shutdown (void)\r
-16/ID_MM.C:= MM_GetPtr\r
-16/ID_MM.C:void MM_GetPtr (memptr *baseptr,unsigned long size)\r
-16/ID_MM.C:                    MM_SortMem ();\r
-16/ID_MM.C:= MM_FreePtr\r
-16/ID_MM.C:void MM_FreePtr (memptr *baseptr)\r
-16/ID_MM.C:            Quit ("MM_FreePtr: Block not found!");\r
-16/ID_MM.C:= MM_SetPurge\r
-16/ID_MM.C:void MM_SetPurge (memptr *baseptr, int purge)\r
-16/ID_MM.C:                    Quit ("MM_SetPurge: Block not found!");\r
-16/ID_MM.C:= MM_SetLock\r
-16/ID_MM.C:void MM_SetLock (memptr *baseptr, boolean locked)\r
-16/ID_MM.C:                    Quit ("MM_SetLock: Block not found!");\r
-16/ID_MM.C:= MM_SortMem\r
-16/ID_MM.C:void MM_SortMem (void)\r
-16/ID_MM.C:            MM_SetLock(&(memptr)audiosegs[playing],true);\r
-16/ID_MM.C:            MM_SetLock(&(memptr)audiosegs[playing],false);\r
-16/ID_MM.C:= MM_ShowMemory\r
-16/ID_MM.C:void MM_ShowMemory (void)\r
-16/ID_MM.C:                    Quit ("MM_ShowMemory: Memory block order currupted!");\r
-16/ID_MM.C:= MM_UnusedMemory\r
-16/ID_MM.C:long MM_UnusedMemory (void)\r
-16/ID_MM.C:= MM_TotalFree\r
-16/ID_MM.C:long MM_TotalFree (void)\r
-16/ID_MM.C:= MM_BombOnError\r
-16/ID_MM.C:void MM_BombOnError (boolean bomb)\r
-16/ID_MMw.C:MM_SizePtr to change the size of a given pointer\r
-16/ID_MMw.C://#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!")\\r
-16/ID_MMw.C:void               MM_MapEMS (void);\r
-16/ID_MMw.C:                   MM_FreePtr(scan->useptr);\r
-16/ID_MMw.C:   Quit ("MM_ClearBlock: No purgable blocks!");\r
-16/ID_MMw.C:= MM_Startup\r
-16/ID_MMw.C:void MM_Startup (void)\r
-16/ID_MMw.C:           MM_Shutdown ();\r
-16/ID_MMw.C:   MM_GetPtr (&bufferseg,BUFFERSIZE);\r
-16/ID_MMw.C:= MM_Shutdown\r
-16/ID_MMw.C:void MM_Shutdown (void)\r
-16/ID_MMw.C:= MM_GetPtr\r
-16/ID_MMw.C:void MM_GetPtr (memptr *baseptr,unsigned long size)\r
-16/ID_MMw.C:                   MM_SortMem ();\r
-16/ID_MMw.C:           Quit ("MM_GetPtr: Out of memory!");\r
-16/ID_MMw.C:= MM_FreePtr\r
-16/ID_MMw.C:void MM_FreePtr (memptr *baseptr)\r
-16/ID_MMw.C:           Quit ("MM_FreePtr: Block not found!");\r
-16/ID_MMw.C:= MM_SetPurge\r
-16/ID_MMw.C:void MM_SetPurge (memptr *baseptr, int purge)\r
-16/ID_MMw.C:                   Quit ("MM_SetPurge: Block not found!");\r
-16/ID_MMw.C:= MM_SetLock\r
-16/ID_MMw.C:void MM_SetLock (memptr *baseptr, boolean locked)\r
-16/ID_MMw.C:                   Quit ("MM_SetLock: Block not found!");\r
-16/ID_MMw.C:= MM_SortMem\r
-16/ID_MMw.C:void MM_SortMem (void)\r
-16/ID_MMw.C:           MM_SetLock(&(memptr)audiosegs[playing],true);\r
-16/ID_MMw.C:           MM_SetLock(&(memptr)audiosegs[playing],false);\r
-16/ID_MMw.C:= MM_ShowMemory\r
-16/ID_MMw.C:void MM_ShowMemory (void)\r
-16/ID_MMw.C:                   Quit ("MM_ShowMemory: Memory block order currupted!");\r
-16/ID_MMw.C:= MM_DumpData\r
-16/ID_MMw.C:void MM_DumpData (void)\r
-16/ID_MMw.C:           Quit ("MM_DumpData: Couldn't open MMDUMP.TXT!");\r
-16/ID_MMw.C:= MM_UnusedMemory\r
-16/ID_MMw.C:long MM_UnusedMemory (void)\r
-16/ID_MMw.C:= MM_TotalFree\r
-16/ID_MMw.C:long MM_TotalFree (void)\r
-16/ID_MMw.C:= MM_BombOnError\r
-16/ID_MMw.C:void MM_BombOnError (boolean bomb)\r
-16/ID_SD.C:    MM_GetPtr(&list,PMPageSize);\r
-16/ID_SD.C:    MM_GetPtr((memptr *)&DigiList,i * sizeof(word) * 2);\r
-16/ID_SD.C:    MM_FreePtr(&list);\r
+\r
+\r
 16/keen/gelib.c:               MM_FreePtr(&shape->Data);\r
 16/keen/gelib.c:       MM_GetPtr(&bio->buffer,BIO_BUFFER_LEN);\r
 16/keen/gelib.c:               MM_FreePtr(&bio->buffer);\r
 16/keen/id_ca.c:                               MM_FreePtr(&bigbufferseg);\r
 16/keen/id_in.c:       MM_GetPtr((memptr *)&DemoBuffer,bufsize);\r
 16/keen/id_in.c:               MM_FreePtr((memptr *)&DemoBuffer);\r
-16/keen/id_mm.c:MM_SizePtr to change the size of a given pointer\r
-16/keen/id_mm.c:#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!")\\r
-16/keen/id_mm.c:void           MM_MapEMS (void);\r
-16/keen/id_mm.c:= MM_MapEMS\r
-16/keen/id_mm.c:void MM_MapEMS (void)\r
-16/keen/id_mm.c:= MM_Startup\r
-16/keen/id_mm.c:void MM_Startup (void)\r
-16/keen/id_mm.c:               MM_Shutdown ();\r
-16/keen/id_mm.c:               MM_MapEMS();                                    // map in used pages\r
-16/keen/id_mm.c:       MM_GetPtr (&bufferseg,BUFFERSIZE);\r
-16/keen/id_mm.c:= MM_Shutdown\r
-16/keen/id_mm.c:void MM_Shutdown (void)\r
-16/keen/id_mm.c:= MM_GetPtr\r
-16/keen/id_mm.c:void MM_GetPtr (memptr *baseptr,unsigned long size)\r
-16/keen/id_mm.c:                       MM_SortMem ();\r
-16/keen/id_mm.c:= MM_FreePtr\r
-16/keen/id_mm.c:void MM_FreePtr (memptr *baseptr)\r
-16/keen/id_mm.c:               Quit ("MM_FreePtr: Block not found!");\r
-16/keen/id_mm.c:= MM_SetPurge\r
-16/keen/id_mm.c:void MM_SetPurge (memptr *baseptr, int purge)\r
-16/keen/id_mm.c:                       Quit ("MM_SetPurge: Block not found!");\r
-16/keen/id_mm.c:= MM_SetLock\r
-16/keen/id_mm.c:void MM_SetLock (memptr *baseptr, boolean locked)\r
-16/keen/id_mm.c:                       Quit ("MM_SetLock: Block not found!");\r
-16/keen/id_mm.c:= MM_SortMem\r
-16/keen/id_mm.c:void MM_SortMem (void)\r
-16/keen/id_mm.c:= MM_ShowMemory\r
-16/keen/id_mm.c:void MM_ShowMemory (void)\r
-16/keen/id_mm.c:                       Quit ("MM_ShowMemory: Memory block order currupted!");\r
-16/keen/id_mm.c:= MM_UnusedMemory\r
-16/keen/id_mm.c:long MM_UnusedMemory (void)\r
-16/keen/id_mm.c:= MM_TotalFree\r
-16/keen/id_mm.c:long MM_TotalFree (void)\r
 16/keen/id_us.c:       MM_GetPtr(save,(w * h) * CHARWIDTH);\r
 16/keen/id_us.c:       MM_FreePtr(save);\r
 16/keen/id_us.c:       MM_GetPtr(&LineOffsets,MaxHelpLines * sizeof(word));\r
 16/keen/soft.c:                        MM_GetPtr(&SHP->Data,size);\r
 16/keen/soft.c:                MM_FreePtr(&IFFfile);\r
 16/keen/soft.c:                        MM_GetPtr(MemPtr,FileEntry.OrginalLength);\r
+\r
+\r
 16/wf3d8086/id_ca.c:   MM_GetPtr (ptr,size);\r
 16/wf3d8086/id_ca.c:   MM_GetPtr (&(memptr)grstarts,(NUMCHUNKS+1)*FILEPOSSIZE);\r
 16/wf3d8086/id_ca.c:   MM_GetPtr(&(memptr)pictable,NUMPICS*sizeof(pictabletype));\r
 16/wf3d8086/id_ca.c:                           MM_GetPtr(&bigbufferseg,compressed);\r
 16/wf3d8086/id_ca.c:                           MM_SetLock (&bigbufferseg,true);\r
 16/wf3d8086/id_ca.c:                           MM_FreePtr(&bigbufferseg);\r
-16/wf3d8086/id_mm.c:MM_SizePtr to change the size of a given pointer\r
-16/wf3d8086/id_mm.c://#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!")\\r
-16/wf3d8086/id_mm.c:void               MM_MapEMS (void);\r
-16/wf3d8086/id_mm.c:                   MM_FreePtr(scan->useptr);\r
-16/wf3d8086/id_mm.c:   Quit ("MM_ClearBlock: No purgable blocks!");\r
-16/wf3d8086/id_mm.c:= MM_Startup\r
-16/wf3d8086/id_mm.c:void MM_Startup (void)\r
-16/wf3d8086/id_mm.c:           MM_Shutdown ();\r
-16/wf3d8086/id_mm.c:   MM_GetPtr (&bufferseg,BUFFERSIZE);\r
-16/wf3d8086/id_mm.c:= MM_Shutdown\r
-16/wf3d8086/id_mm.c:void MM_Shutdown (void)\r
-16/wf3d8086/id_mm.c:= MM_GetPtr\r
-16/wf3d8086/id_mm.c:void MM_GetPtr (memptr *baseptr,unsigned long size)\r
-16/wf3d8086/id_mm.c:                   MM_SortMem ();\r
-16/wf3d8086/id_mm.c:           Quit ("MM_GetPtr: Out of memory!");\r
-16/wf3d8086/id_mm.c:= MM_FreePtr\r
-16/wf3d8086/id_mm.c:void MM_FreePtr (memptr *baseptr)\r
-16/wf3d8086/id_mm.c:           Quit ("MM_FreePtr: Block not found!");\r
-16/wf3d8086/id_mm.c:= MM_SetPurge\r
-16/wf3d8086/id_mm.c:void MM_SetPurge (memptr *baseptr, int purge)\r
-16/wf3d8086/id_mm.c:                   Quit ("MM_SetPurge: Block not found!");\r
-16/wf3d8086/id_mm.c:= MM_SetLock\r
-16/wf3d8086/id_mm.c:void MM_SetLock (memptr *baseptr, boolean locked)\r
-16/wf3d8086/id_mm.c:                   Quit ("MM_SetLock: Block not found!");\r
-16/wf3d8086/id_mm.c:= MM_SortMem\r
-16/wf3d8086/id_mm.c:void MM_SortMem (void)\r
-16/wf3d8086/id_mm.c:           MM_SetLock(&(memptr)audiosegs[playing],true);\r
-16/wf3d8086/id_mm.c:           MM_SetLock(&(memptr)audiosegs[playing],false);\r
-16/wf3d8086/id_mm.c:= MM_ShowMemory\r
-16/wf3d8086/id_mm.c:void MM_ShowMemory (void)\r
-16/wf3d8086/id_mm.c:                   Quit ("MM_ShowMemory: Memory block order currupted!");\r
-16/wf3d8086/id_mm.c:= MM_DumpData\r
-16/wf3d8086/id_mm.c:void MM_DumpData (void)\r
-16/wf3d8086/id_mm.c:           Quit ("MM_DumpData: Couldn't open MMDUMP.TXT!");\r
-16/wf3d8086/id_mm.c:= MM_UnusedMemory\r
-16/wf3d8086/id_mm.c:long MM_UnusedMemory (void)\r
-16/wf3d8086/id_mm.c:= MM_TotalFree\r
-16/wf3d8086/id_mm.c:long MM_TotalFree (void)\r
-16/wf3d8086/id_mm.c:= MM_BombOnError\r
-16/wf3d8086/id_mm.c:void MM_BombOnError (boolean bomb)\r
-16/wf3d8086/id_pm.c:                   MM_SetPurge(&MainMemPages[i],level);\r
-16/wf3d8086/id_pm.c:                           MM_BombOnError(false);\r
-16/wf3d8086/id_pm.c:                           MM_GetPtr(p,PMPageSize);                // Try to reallocate\r
-16/wf3d8086/id_pm.c:                           MM_BombOnError(true);\r
-16/wf3d8086/id_pm.c:   MM_BombOnError(false);\r
-16/wf3d8086/id_pm.c:           MM_GetPtr(p,PMPageSize);\r
-16/wf3d8086/id_pm.c:   MM_BombOnError(true);\r
-16/wf3d8086/id_pm.c:                   MM_FreePtr(p);\r
-16/wf3d8086/id_pm.c:   MM_GetPtr(&(memptr)PMSegPages,sizeof(PageListStruct) * PMNumBlocks);\r
-16/wf3d8086/id_pm.c:   MM_SetLock(&(memptr)PMSegPages,true);\r
-16/wf3d8086/id_pm.c:   MM_GetPtr(&buf,size);\r
-16/wf3d8086/id_pm.c:   MM_FreePtr(&buf);\r
-16/wf3d8086/id_pm.c:   MM_GetPtr(&buf,size);\r
-16/wf3d8086/id_pm.c:   MM_FreePtr(&buf);\r
-16/wf3d8086/id_pm.c:           MM_SetLock(&(memptr)PMSegPages,false);\r
-16/wf3d8086/id_pm.c:           MM_FreePtr(&(void _seg *)PMSegPages);\r
 16/wf3d8086/id_sd.c:   MM_GetPtr(&list,PMPageSize);\r
 16/wf3d8086/id_sd.c:   MM_GetPtr((memptr *)&DigiList,i * sizeof(word) * 2);\r
 16/wf3d8086/id_sd.c:   MM_FreePtr(&list);\r
 16/wf3d8086/id_vh.c:#define UNCACHEGRCHUNK(chunk)      {MM_FreePtr(&grsegs[chunk]);grneeded[chunk]&=~ca_levelbit;}\r
 16/wf3d8086/id_vh.c:   MM_GetPtr (&(memptr)temp,size);\r
 16/wf3d8086/id_vh.c:   MM_FreePtr (&(memptr)temp);\r
-16/wf3d8086/obj/wolf3d.map: 193E:0001 0E87 C=CODE   S=ID_MM_TEXT     G=(none)  M=ID_MM.C    ACBP=28\r
 16/wf3d8086/oldscale.c:                        MM_FreePtr (&(memptr)scaledirectory[i]);\r
 16/wf3d8086/oldscale.c:        MM_SortMem ();\r
 16/wf3d8086/oldscale.c:        MM_GetPtr (&(memptr)work,20000);\r
 16/wf3d8086/wl_text.c: MM_FreePtr (&grsegs[artnum]);\r
 16/wf3d8086/wl_text.c: MM_FreePtr (&layout);\r
 16/wf3d8086/wl_text.c: MM_SortMem ();\r
-16/wf3d8086/wolf3d.map: 182E:0000 0E47 C=CODE   S=ID_MM_TEXT     G=(none)  M=ID_MM.C    ACBP=28\r
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (ptr,size);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)grstarts,(NUMCHUNKS+1)*FILEPOSSIZE);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr(&(memptr)pictable,NUMPICS*sizeof(pictabletype));
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr(&compseg,chunkcomplen);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_FreePtr(&compseg);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)tinf,length);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr(&(memptr)mapheaderseg[i],sizeof(maptype));
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetLock(&(memptr)mapheaderseg[i],true);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr (&(memptr)mapsegs[i],64*64*2);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetLock (&(memptr)mapsegs[i],true);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)audiostarts,length);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetPurge (&(memptr)audiosegs[chunk],0);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)audiosegs[chunk],compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr(&bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetLock (&bigbufferseg,true);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)audiosegs[chunk],expanded);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_FreePtr(&bigbufferseg);
-16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetPurge (&(memptr)audiosegs[start],3);              // make purgable
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&grsegs[chunk],expanded);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetPurge (&grsegs[chunk],0);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr(&bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetLock (&bigbufferseg,true);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_FreePtr(&bigbufferseg);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr(&bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_SetLock (&bigbufferseg,true);
-16/wolf3d/WOLFSRC/ID_CA.C:     MM_FreePtr(&bigbufferseg);
-16/wolf3d/WOLFSRC/ID_CA.C:                     MM_GetPtr(&bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetLock (&bigbufferseg,true);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr (&buffer2seg,expanded);
-16/wolf3d/WOLFSRC/ID_CA.C:             MM_FreePtr (&buffer2seg);
-16/wolf3d/WOLFSRC/ID_CA.C:                     MM_FreePtr(&bigbufferseg);
-16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetPurge (&(memptr)grsegs[i],3);
-16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetPurge (&(memptr)grsegs[i],3);
-16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetPurge (&(memptr)audiosegs[i],3);
-16/wolf3d/WOLFSRC/ID_CA.C:                             MM_SetPurge(&grsegs[i],0);      // sure it stays there!
-16/wolf3d/WOLFSRC/ID_CA.C:                             MM_SetPurge(&grsegs[i],3);
-16/wolf3d/WOLFSRC/ID_CA.C:                             MM_GetPtr(&bigbufferseg,compressed);
-16/wolf3d/WOLFSRC/ID_CA.C:                             MM_SetLock (&bigbufferseg,true);
-16/wolf3d/WOLFSRC/ID_CA.C:                             MM_FreePtr(&bigbufferseg);
-16/wolf3d/WOLFSRC/ID_MM.C:MM_SizePtr to change the size of a given pointer
-16/wolf3d/WOLFSRC/ID_MM.C://#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!")\
-16/wolf3d/WOLFSRC/ID_MM.C:void                 MM_MapEMS (void);
-16/wolf3d/WOLFSRC/ID_MM.C:                     MM_FreePtr(scan->useptr);
-16/wolf3d/WOLFSRC/ID_MM.C:     Quit ("MM_ClearBlock: No purgable blocks!");
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_Startup
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_Startup (void)
-16/wolf3d/WOLFSRC/ID_MM.C:             MM_Shutdown ();
-16/wolf3d/WOLFSRC/ID_MM.C:     MM_GetPtr (&bufferseg,BUFFERSIZE);
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_Shutdown
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_Shutdown (void)
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_GetPtr
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_GetPtr (memptr *baseptr,unsigned long size)
-16/wolf3d/WOLFSRC/ID_MM.C:                     MM_SortMem ();
-16/wolf3d/WOLFSRC/ID_MM.C:             Quit ("MM_GetPtr: Out of memory!");
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_FreePtr
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_FreePtr (memptr *baseptr)
-16/wolf3d/WOLFSRC/ID_MM.C:             Quit ("MM_FreePtr: Block not found!");
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_SetPurge
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_SetPurge (memptr *baseptr, int purge)
-16/wolf3d/WOLFSRC/ID_MM.C:                     Quit ("MM_SetPurge: Block not found!");
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_SetLock
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_SetLock (memptr *baseptr, boolean locked)
-16/wolf3d/WOLFSRC/ID_MM.C:                     Quit ("MM_SetLock: Block not found!");
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_SortMem
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_SortMem (void)
-16/wolf3d/WOLFSRC/ID_MM.C:             MM_SetLock(&(memptr)audiosegs[playing],true);
-16/wolf3d/WOLFSRC/ID_MM.C:             MM_SetLock(&(memptr)audiosegs[playing],false);
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_ShowMemory
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_ShowMemory (void)
-16/wolf3d/WOLFSRC/ID_MM.C:                     Quit ("MM_ShowMemory: Memory block order currupted!");
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_DumpData
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_DumpData (void)
-16/wolf3d/WOLFSRC/ID_MM.C:             Quit ("MM_DumpData: Couldn't open MMDUMP.TXT!");
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_UnusedMemory
-16/wolf3d/WOLFSRC/ID_MM.C:long MM_UnusedMemory (void)
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_TotalFree
-16/wolf3d/WOLFSRC/ID_MM.C:long MM_TotalFree (void)
-16/wolf3d/WOLFSRC/ID_MM.C:= MM_BombOnError
-16/wolf3d/WOLFSRC/ID_MM.C:void MM_BombOnError (boolean bomb)
-16/wolf3d/WOLFSRC/ID_PM.C:                     MM_SetPurge(&MainMemPages[i],level);
-16/wolf3d/WOLFSRC/ID_PM.C:                             MM_BombOnError(false);
-16/wolf3d/WOLFSRC/ID_PM.C:                             MM_GetPtr(p,PMPageSize);                // Try to reallocate
-16/wolf3d/WOLFSRC/ID_PM.C:                             MM_BombOnError(true);
-16/wolf3d/WOLFSRC/ID_PM.C:     MM_BombOnError(false);
-16/wolf3d/WOLFSRC/ID_PM.C:             MM_GetPtr(p,PMPageSize);
-16/wolf3d/WOLFSRC/ID_PM.C:     MM_BombOnError(true);
-16/wolf3d/WOLFSRC/ID_PM.C:                     MM_FreePtr(p);
-16/wolf3d/WOLFSRC/ID_PM.C:     MM_GetPtr(&(memptr)PMSegPages,sizeof(PageListStruct) * PMNumBlocks);
-16/wolf3d/WOLFSRC/ID_PM.C:     MM_SetLock(&(memptr)PMSegPages,true);
-16/wolf3d/WOLFSRC/ID_PM.C:     MM_GetPtr(&buf,size);
-16/wolf3d/WOLFSRC/ID_PM.C:     MM_FreePtr(&buf);
-16/wolf3d/WOLFSRC/ID_PM.C:     MM_GetPtr(&buf,size);
-16/wolf3d/WOLFSRC/ID_PM.C:     MM_FreePtr(&buf);
-16/wolf3d/WOLFSRC/ID_PM.C:             MM_SetLock(&(memptr)PMSegPages,false);
-16/wolf3d/WOLFSRC/ID_PM.C:             MM_FreePtr(&(void _seg *)PMSegPages);
-16/wolf3d/WOLFSRC/ID_SD.C:     MM_GetPtr(&list,PMPageSize);
-16/wolf3d/WOLFSRC/ID_SD.C:     MM_GetPtr((memptr *)&DigiList,i * sizeof(word) * 2);
-16/wolf3d/WOLFSRC/ID_SD.C:     MM_FreePtr(&list);
-16/wolf3d/WOLFSRC/ID_VH.C:#define UNCACHEGRCHUNK(chunk)        {MM_FreePtr(&grsegs[chunk]);grneeded[chunk]&=~ca_levelbit;}
-16/wolf3d/WOLFSRC/ID_VH.C:     MM_GetPtr (&(memptr)temp,size);
-16/wolf3d/WOLFSRC/ID_VH.C:     MM_FreePtr (&(memptr)temp);
-16/wolf3d/WOLFSRC/OLDSCALE.C:                  MM_FreePtr (&(memptr)scaledirectory[i]);
-16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_SortMem ();
-16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_GetPtr (&(memptr)work,20000);
-16/wolf3d/WOLFSRC/OLDSCALE.C:                  MM_FreePtr (&(memptr)work);
-16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_FreePtr (&(memptr)work);
-16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_SortMem ();
-16/wolf3d/WOLFSRC/OLDSCALE.C:          MM_SetLock (&(memptr)scaledirectory[i],true);
-16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_GetPtr (finalspot,totalsize);
-16/wolf3d/WOLFSRC/WL_DEBUG.C:  US_PrintUnsigned (MM_UnusedMemory()/1024);
-16/wolf3d/WOLFSRC/WL_DEBUG.C:  US_PrintUnsigned (MM_TotalFree()/1024);
-16/wolf3d/WOLFSRC/WL_DEBUG.C:  MM_GetPtr (&buffer,64000);
-16/wolf3d/WOLFSRC/WL_GAME.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_GAME.C:   MM_GetPtr (&demobuffer,MAXDEMOSIZE);
-16/wolf3d/WOLFSRC/WL_GAME.C:   MM_SetLock (&demobuffer,true);
-16/wolf3d/WOLFSRC/WL_GAME.C:   MM_FreePtr (&demobuffer);
-16/wolf3d/WOLFSRC/WL_GAME.C:   MM_SetLock (&grsegs[dems[demonumber]],true);
-16/wolf3d/WOLFSRC/WL_GAME.C:   MM_SetLock (&demobuffer,true);
-16/wolf3d/WOLFSRC/WL_GAME.C:   MM_FreePtr (&demobuffer);
-16/wolf3d/WOLFSRC/WL_INTER.C:  MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_INTER.C:                          MM_FreePtr ((memptr *)&audiosegs[start]);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_Shutdown ();
-16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_Startup ();                  // so the signon screen can be freed
-16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_SetLock (&grsegs[STARTFONT],true);
-16/wolf3d/WOLFSRC/WL_MAIN.C:// MM_BombOnError (false);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_BombOnError (true);
-16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_MAIN.C:// MM_GetPtr(&nullblock,nsize);
-16/wolf3d/WOLFSRC/WL_MAIN.C:                   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_MENU.C:                   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_MENU.C:                                                           MM_SetPurge (&(memptr)audiosegs[start],3);              // make purgable
-16/wolf3d/WOLFSRC/WL_MENU.C:                           MM_SortMem();
-16/wolf3d/WOLFSRC/WL_MENU.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_MENU.C:           MM_FreePtr ((memptr *)&audiosegs[STARTMUSIC + lastmusic]);
-16/wolf3d/WOLFSRC/WL_MENU.C:   MM_BombOnError (false);
-16/wolf3d/WOLFSRC/WL_MENU.C:   MM_BombOnError (true);
-16/wolf3d/WOLFSRC/WL_MENU.C:           MM_SetLock(&((memptr)audiosegs[STARTMUSIC + chunk]),true);
-16/wolf3d/WOLFSRC/WL_MENU.C:           MM_FreePtr ((memptr *)&audiosegs[STARTMUSIC + lastmusic]);
-16/wolf3d/WOLFSRC/WL_PLAY.C:                   MM_SetPurge(&((memptr)audiosegs[STARTMUSIC + i]),3);
-16/wolf3d/WOLFSRC/WL_PLAY.C:                   MM_SetLock(&((memptr)audiosegs[STARTMUSIC + i]),false);
-16/wolf3d/WOLFSRC/WL_PLAY.C:   MM_BombOnError (false);
-16/wolf3d/WOLFSRC/WL_PLAY.C:   MM_BombOnError (true);
-16/wolf3d/WOLFSRC/WL_PLAY.C:           MM_SetLock(&((memptr)audiosegs[STARTMUSIC + chunk]),true);
-16/wolf3d/WOLFSRC/WL_SCALE.C:                  MM_FreePtr (&(memptr)scaledirectory[i]);
-16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_GetPtr (&(memptr)work,20000);
-16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_FreePtr (&(memptr)work);
-16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_SCALE.C:          MM_SetLock (&(memptr)scaledirectory[i],true);
-16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_GetPtr (finalspot,totalsize);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SetLock (&grsegs[artnum], true);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SetLock (&layout, true);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_FreePtr (&grsegs[artnum]);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_FreePtr (&layout);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SetLock (&grsegs[artnum], true);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SetLock (&layout, true);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_FreePtr (&grsegs[artnum]);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_FreePtr (&layout);
-16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 182E:0000 0E47 C=CODE   S=ID_MM_TEXT     G=(none)  M=ID_MM.C    ACBP=28
+\r
+\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (ptr,size);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)grstarts,(NUMCHUNKS+1)*FILEPOSSIZE);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr(&(memptr)pictable,NUMPICS*sizeof(pictabletype));\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr(&compseg,chunkcomplen);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_FreePtr(&compseg);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)tinf,length);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr(&(memptr)mapheaderseg[i],sizeof(maptype));\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetLock(&(memptr)mapheaderseg[i],true);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr (&(memptr)mapsegs[i],64*64*2);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetLock (&(memptr)mapsegs[i],true);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)audiostarts,length);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetPurge (&(memptr)audiosegs[chunk],0);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)audiosegs[chunk],compressed);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr(&bigbufferseg,compressed);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetLock (&bigbufferseg,true);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&(memptr)audiosegs[chunk],expanded);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_FreePtr(&bigbufferseg);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetPurge (&(memptr)audiosegs[start],3);              // make purgable\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr (&grsegs[chunk],expanded);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetPurge (&grsegs[chunk],0);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr(&bigbufferseg,compressed);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_SetLock (&bigbufferseg,true);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_FreePtr(&bigbufferseg);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_GetPtr(&bigbufferseg,compressed);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_SetLock (&bigbufferseg,true);\r
+16/wolf3d/WOLFSRC/ID_CA.C:     MM_FreePtr(&bigbufferseg);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                     MM_GetPtr(&bigbufferseg,compressed);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetLock (&bigbufferseg,true);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_GetPtr (&buffer2seg,expanded);\r
+16/wolf3d/WOLFSRC/ID_CA.C:             MM_FreePtr (&buffer2seg);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                     MM_FreePtr(&bigbufferseg);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetPurge (&(memptr)grsegs[i],3);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetPurge (&(memptr)grsegs[i],3);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                     MM_SetPurge (&(memptr)audiosegs[i],3);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                             MM_SetPurge(&grsegs[i],0);      // sure it stays there!\r
+16/wolf3d/WOLFSRC/ID_CA.C:                             MM_SetPurge(&grsegs[i],3);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                             MM_GetPtr(&bigbufferseg,compressed);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                             MM_SetLock (&bigbufferseg,true);\r
+16/wolf3d/WOLFSRC/ID_CA.C:                             MM_FreePtr(&bigbufferseg);\r
+16/wolf3d/WOLFSRC/ID_PM.C:                     MM_SetPurge(&MainMemPages[i],level);\r
+16/wolf3d/WOLFSRC/ID_PM.C:                             MM_BombOnError(false);\r
+16/wolf3d/WOLFSRC/ID_PM.C:                             MM_GetPtr(p,PMPageSize);                // Try to reallocate\r
+16/wolf3d/WOLFSRC/ID_PM.C:                             MM_BombOnError(true);\r
+16/wolf3d/WOLFSRC/ID_PM.C:     MM_BombOnError(false);\r
+16/wolf3d/WOLFSRC/ID_PM.C:             MM_GetPtr(p,PMPageSize);\r
+16/wolf3d/WOLFSRC/ID_PM.C:     MM_BombOnError(true);\r
+16/wolf3d/WOLFSRC/ID_PM.C:                     MM_FreePtr(p);\r
+16/wolf3d/WOLFSRC/ID_PM.C:     MM_GetPtr(&(memptr)PMSegPages,sizeof(PageListStruct) * PMNumBlocks);\r
+16/wolf3d/WOLFSRC/ID_PM.C:     MM_SetLock(&(memptr)PMSegPages,true);\r
+16/wolf3d/WOLFSRC/ID_PM.C:     MM_GetPtr(&buf,size);\r
+16/wolf3d/WOLFSRC/ID_PM.C:     MM_FreePtr(&buf);\r
+16/wolf3d/WOLFSRC/ID_PM.C:     MM_GetPtr(&buf,size);\r
+16/wolf3d/WOLFSRC/ID_PM.C:     MM_FreePtr(&buf);\r
+16/wolf3d/WOLFSRC/ID_PM.C:             MM_SetLock(&(memptr)PMSegPages,false);\r
+16/wolf3d/WOLFSRC/ID_PM.C:             MM_FreePtr(&(void _seg *)PMSegPages);\r
+16/wolf3d/WOLFSRC/ID_SD.C:     MM_GetPtr(&list,PMPageSize);\r
+16/wolf3d/WOLFSRC/ID_SD.C:     MM_GetPtr((memptr *)&DigiList,i * sizeof(word) * 2);\r
+16/wolf3d/WOLFSRC/ID_SD.C:     MM_FreePtr(&list);\r
+16/wolf3d/WOLFSRC/ID_VH.C:#define UNCACHEGRCHUNK(chunk)        {MM_FreePtr(&grsegs[chunk]);grneeded[chunk]&=~ca_levelbit;}\r
+16/wolf3d/WOLFSRC/ID_VH.C:     MM_GetPtr (&(memptr)temp,size);\r
+16/wolf3d/WOLFSRC/ID_VH.C:     MM_FreePtr (&(memptr)temp);\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:                  MM_FreePtr (&(memptr)scaledirectory[i]);\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_SortMem ();\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_GetPtr (&(memptr)work,20000);\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:                  MM_FreePtr (&(memptr)work);\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_FreePtr (&(memptr)work);\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_SortMem ();\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:          MM_SetLock (&(memptr)scaledirectory[i],true);\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:  MM_GetPtr (finalspot,totalsize);\r
+16/wolf3d/WOLFSRC/WL_DEBUG.C:  US_PrintUnsigned (MM_UnusedMemory()/1024);\r
+16/wolf3d/WOLFSRC/WL_DEBUG.C:  US_PrintUnsigned (MM_TotalFree()/1024);\r
+16/wolf3d/WOLFSRC/WL_DEBUG.C:  MM_GetPtr (&buffer,64000);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   MM_GetPtr (&demobuffer,MAXDEMOSIZE);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   MM_SetLock (&demobuffer,true);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   MM_FreePtr (&demobuffer);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   MM_SetLock (&grsegs[dems[demonumber]],true);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   MM_SetLock (&demobuffer,true);\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   MM_FreePtr (&demobuffer);\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_INTER.C:                          MM_FreePtr ((memptr *)&audiosegs[start]);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_Shutdown ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_Startup ();                  // so the signon screen can be freed\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_SetLock (&grsegs[STARTFONT],true);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:// MM_BombOnError (false);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_BombOnError (true);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:// MM_GetPtr(&nullblock,nsize);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:                   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                                                           MM_SetPurge (&(memptr)audiosegs[start],3);              // make purgable\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           MM_SortMem();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:           MM_FreePtr ((memptr *)&audiosegs[STARTMUSIC + lastmusic]);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   MM_BombOnError (false);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:   MM_BombOnError (true);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:           MM_SetLock(&((memptr)audiosegs[STARTMUSIC + chunk]),true);\r
+16/wolf3d/WOLFSRC/WL_MENU.C:           MM_FreePtr ((memptr *)&audiosegs[STARTMUSIC + lastmusic]);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:                   MM_SetPurge(&((memptr)audiosegs[STARTMUSIC + i]),3);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:                   MM_SetLock(&((memptr)audiosegs[STARTMUSIC + i]),false);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:   MM_BombOnError (false);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:   MM_BombOnError (true);\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:           MM_SetLock(&((memptr)audiosegs[STARTMUSIC + chunk]),true);\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:                  MM_FreePtr (&(memptr)scaledirectory[i]);\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_GetPtr (&(memptr)work,20000);\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_FreePtr (&(memptr)work);\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:          MM_SetLock (&(memptr)scaledirectory[i],true);\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:  MM_GetPtr (finalspot,totalsize);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SetLock (&grsegs[artnum], true);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SetLock (&layout, true);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_FreePtr (&grsegs[artnum]);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_FreePtr (&layout);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SetLock (&grsegs[artnum], true);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SetLock (&layout, true);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_FreePtr (&grsegs[artnum]);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_FreePtr (&layout);\r
+16/wolf3d/WOLFSRC/WL_TEXT.C:   MM_SortMem ();\r
index 651d085cc2677ec95dd3c7f8a8785d17576c18e2..f944a7e47e45a0e04177a563ee974a19d64a7aea 100755 (executable)
@@ -1,64 +1,5 @@
 16/wf3d8086/contigsc.c:        shape = PM_GetSpritePage (shapenum);\r
 16/wf3d8086/contigsc.c:        shape = PM_GetSpritePage (shapenum);\r
-16/wf3d8086/id_pm.c:// PM_SetMainMemPurge() - Sets the purge level for all allocated main memory\r
-16/wf3d8086/id_pm.c://         blocks. This shouldn't be called directly - the PM_LockMainMem() and\r
-16/wf3d8086/id_pm.c://         PM_UnlockMainMem() macros should be used instead.\r
-16/wf3d8086/id_pm.c:PM_SetMainMemPurge(int level)\r
-16/wf3d8086/id_pm.c:// PM_CheckMainMem() - If something besides the Page Mgr makes requests of\r
-16/wf3d8086/id_pm.c:// This routine now calls PM_LockMainMem() to make sure that any allocation\r
-16/wf3d8086/id_pm.c://         of the other blocks. Because PM_LockMainMem() is called,\r
-16/wf3d8086/id_pm.c://         PM_UnlockMainMem() needs to be called before any other part of the\r
-16/wf3d8086/id_pm.c:PM_CheckMainMem(void)\r
-16/wf3d8086/id_pm.c:   PM_LockMainMem();\r
-16/wf3d8086/id_pm.c://         necessary to make requests of the Memory Mgr, PM_UnlockMainMem()\r
-16/wf3d8086/id_pm.c:           Quit("PM_SetupMainMem: Not enough main memory");\r
-16/wf3d8086/id_pm.c:// PM_GetPageAddress() - Returns the address of a given page\r
-16/wf3d8086/id_pm.c:PM_GetPageAddress(int pagenum)\r
-16/wf3d8086/id_pm.c:   PML_CopyToXMS(PM_GetPageAddress(pagenum),page->xmsPage,page->length);\r
-16/wf3d8086/id_pm.c:   addr = PM_GetPageAddress(orig);\r
-16/wf3d8086/id_pm.c:// PM_GetPage() - Returns the address of the page, loading it if necessary\r
-16/wf3d8086/id_pm.c:PM_GetPage(int pagenum)\r
-16/wf3d8086/id_pm.c:           Quit("PM_GetPage: Invalid page request");\r
-16/wf3d8086/id_pm.c:   if (!(result = PM_GetPageAddress(pagenum)))\r
-16/wf3d8086/id_pm.c:                   result = PM_GetPageAddress(pagenum);\r
-16/wf3d8086/id_pm.c:// PM_SetPageLock() - Sets the lock type on a given page\r
-16/wf3d8086/id_pm.c:PM_SetPageLock(int pagenum,PMLockType lock)\r
-16/wf3d8086/id_pm.c:           Quit("PM_SetPageLock: Locking/unlocking non-sound page");\r
-16/wf3d8086/id_pm.c:// PM_Preload() - Loads as many pages as possible into all types of memory.\r
-16/wf3d8086/id_pm.c:PM_Preload(boolean (*update)(word current,word total))\r
-16/wf3d8086/id_pm.c:                   Quit ("PM_Preload: Pages>=ChunksInFile");\r
-16/wf3d8086/id_pm.c:           PM_GetPage(page);\r
-16/wf3d8086/id_pm.c:           addr = PM_GetPage(oogypage);\r
-16/wf3d8086/id_pm.c:                   Quit("PM_Preload: XMS buffer failed");\r
-16/wf3d8086/id_pm.c:                           Quit ("PM_Preload: Pages>=ChunksInFile");\r
-16/wf3d8086/id_pm.c:                           Quit("PM_Preload: Exceeded XMS pages");\r
-16/wf3d8086/id_pm.c:                           Quit("PM_Preload: Page too long");\r
-16/wf3d8086/id_pm.c:// PM_NextFrame() - Increments the frame counter and adjusts the thrash\r
-16/wf3d8086/id_pm.c:PM_NextFrame(void)\r
-16/wf3d8086/id_pm.c:                   sprintf(buf,"PM_NextFrame: Page %d is locked",i);\r
-16/wf3d8086/id_pm.c:// PM_Reset() - Sets up caching structures\r
-16/wf3d8086/id_pm.c:PM_Reset(void)\r
-16/wf3d8086/id_pm.c:// PM_Startup() - Start up the Page Mgr\r
-16/wf3d8086/id_pm.c:PM_Startup(void)\r
-16/wf3d8086/id_pm.c:           Quit("PM_Startup: No main or EMS");\r
-16/wf3d8086/id_pm.c:   PM_Reset();\r
-16/wf3d8086/id_pm.c:// PM_Shutdown() - Shut down the Page Mgr\r
-16/wf3d8086/id_pm.c:PM_Shutdown(void)\r
-16/wf3d8086/id_pm.h:#define    PM_GetSoundPage(v)      PM_GetPage(PMSoundStart + (v))\r
-16/wf3d8086/id_pm.h:#define    PM_GetSpritePage(v)     PM_GetPage(PMSpriteStart + (v))\r
-16/wf3d8086/id_pm.h:#define    PM_LockMainMem()        PM_SetMainMemPurge(0)\r
-16/wf3d8086/id_pm.h:#define    PM_UnlockMainMem()      PM_SetMainMemPurge(3)\r
-16/wf3d8086/id_pm.h:extern     void    PM_Startup(void),\r
-16/wf3d8086/id_pm.h:                           PM_Shutdown(void),\r
-16/wf3d8086/id_pm.h:                           PM_Reset(void),\r
-16/wf3d8086/id_pm.h:                           PM_Preload(boolean (*update)(word current,word total)),\r
-16/wf3d8086/id_pm.h:                           PM_NextFrame(void),\r
-16/wf3d8086/id_pm.h:                           PM_SetPageLock(int pagenum,PMLockType lock),\r
-16/wf3d8086/id_pm.h:                           PM_SetMainPurge(int level),\r
-16/wf3d8086/id_pm.h:                           PM_CheckMainMem(void);\r
-16/wf3d8086/id_pm.h:extern     memptr  PM_GetPageAddress(int pagenum),\r
-16/wf3d8086/id_pm.h:                           PM_GetPage(int pagenum);                // Use this one to cache page\r
-16/wf3d8086/id_pm.h:void PM_SetMainMemPurge(int level);\r
 16/wf3d8086/id_sd.c:   addr = PM_GetSoundPage(page);\r
 16/wf3d8086/id_sd.c:   PM_SetPageLock(PMSoundStart + page,pml_Locked);\r
 16/wf3d8086/id_sd.c:           PM_SetPageLock(i + PMSoundStart,pml_Unlocked);\r
 16/wf3d8086/id_sd.c:   PM_CheckMainMem();\r
 16/wf3d8086/id_sd.c:   p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0);\r
 16/wf3d8086/id_sd.c:   PM_UnlockMainMem();\r
-Binary file 16/wf3d8086/obj/wolf3d.exe matches\r
-16/wf3d8086/obj/wolf3d.map: 1A268H 1B44AH 011E3H ID_PM_TEXT         CODE\r
-16/wf3d8086/obj/wolf3d.map: 1A26:0008 11E3 C=CODE   S=ID_PM_TEXT     G=(none)  M=ID_PM.C    ACBP=28\r
-16/wf3d8086/obj/wolf3d.map: 1A26:02F3       _PM_CheckMainMem\r
-16/wf3d8086/obj/wolf3d.map: 1A26:0CDE       _PM_GetPage\r
-16/wf3d8086/obj/wolf3d.map: 1A26:080D       _PM_GetPageAddress\r
-16/wf3d8086/obj/wolf3d.map: 1A26:1036       _PM_NextFrame\r
-16/wf3d8086/obj/wolf3d.map: 1A26:0DD0       _PM_Preload\r
-16/wf3d8086/obj/wolf3d.map: 1A26:10B0 idle  _PM_Reset\r
-16/wf3d8086/obj/wolf3d.map: 1A26:02CA       _PM_SetMainMemPurge\r
-16/wf3d8086/obj/wolf3d.map: 1A26:0DA0       _PM_SetPageLock\r
-16/wf3d8086/obj/wolf3d.map: 1A26:11CF       _PM_Shutdown\r
-16/wf3d8086/obj/wolf3d.map: 1A26:111E       _PM_Startup\r
-16/wf3d8086/obj/wolf3d.map: 1A26:02CA       _PM_SetMainMemPurge\r
-16/wf3d8086/obj/wolf3d.map: 1A26:02F3       _PM_CheckMainMem\r
-16/wf3d8086/obj/wolf3d.map: 1A26:080D       _PM_GetPageAddress\r
-16/wf3d8086/obj/wolf3d.map: 1A26:0CDE       _PM_GetPage\r
-16/wf3d8086/obj/wolf3d.map: 1A26:0DA0       _PM_SetPageLock\r
-16/wf3d8086/obj/wolf3d.map: 1A26:0DD0       _PM_Preload\r
-16/wf3d8086/obj/wolf3d.map: 1A26:1036       _PM_NextFrame\r
-16/wf3d8086/obj/wolf3d.map: 1A26:10B0 idle  _PM_Reset\r
-16/wf3d8086/obj/wolf3d.map: 1A26:111E       _PM_Startup\r
-16/wf3d8086/obj/wolf3d.map: 1A26:11CF       _PM_Shutdown\r
 16/wf3d8086/oldscale.c:        shape = PM_GetSpritePage (shapenum);\r
-16/wf3d8086/oldscale.c:        shape = PM_GetSpritePage (shapenum);
-
-\r
+16/wf3d8086/oldscale.c:        shape = PM_GetSpritePage (shapenum);\r
 16/wf3d8086/wl_act2.c: PM_UnlockMainMem ();\r
-16/wf3d8086/wl_act2.c: PM_CheckMainMem ();
+16/wf3d8086/wl_act2.c: PM_CheckMainMem ();\r
 16/wf3d8086/wl_debug.c:                addr = PM_GetPageAddress(i);\r
 16/wf3d8086/wl_debug.c:                                PM_GetPage(j);\r
-16/wf3d8086/wl_debug.c:                        PM_GetPage(i);
+16/wf3d8086/wl_debug.c:                        PM_GetPage(i);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
-16/wf3d8086/wl_draw.c: PM_NextFrame();
+16/wf3d8086/wl_draw.c: PM_NextFrame();\r
 16/wf3d8086/wl_game.c: PM_UnlockMainMem();\r
 16/wf3d8086/wl_game.c: PM_CheckMainMem ();\r
 16/wf3d8086/wl_game.c: PM_CheckMainMem ();\r
@@ -122,160 +38,6 @@ Binary file 16/wf3d8086/obj/wolf3d.exe matches
 16/wf3d8086/wl_play.c:         PM_CheckMainMem ();\r
 16/wf3d8086/wl_play.c:         PM_CheckMainMem ();\r
 16/wf3d8086/wl_scale.c:        shape = PM_GetSpritePage (shapenum);\r
-16/wf3d8086/wl_scale.c:        shape = PM_GetSpritePage (shapenum);
-
-\r
-16/wf3d8086/wolf3d.map: 19127H 1A286H 01160H ID_PM_TEXT         CODE\r
-16/wf3d8086/wolf3d.map: 1912:0007 1160 C=CODE   S=ID_PM_TEXT     G=(none)  M=ID_PM.C    ACBP=28\r
-16/wf3d8086/wolf3d.map: 1912:02DF       _PM_CheckMainMem\r
-16/wf3d8086/wolf3d.map: 1912:0C71       _PM_GetPage\r
-16/wf3d8086/wolf3d.map: 1912:07BF       _PM_GetPageAddress\r
-16/wf3d8086/wolf3d.map: 1912:0FBA       _PM_NextFrame\r
-16/wf3d8086/wolf3d.map: 1912:0D60       _PM_Preload\r
-16/wf3d8086/wolf3d.map: 1912:1034 idle  _PM_Reset\r
-16/wf3d8086/wolf3d.map: 1912:02B8       _PM_SetMainMemPurge\r
-16/wf3d8086/wolf3d.map: 1912:0D31       _PM_SetPageLock\r
-16/wf3d8086/wolf3d.map: 1912:114B       _PM_Shutdown\r
-16/wf3d8086/wolf3d.map: 1912:10A0       _PM_Startup\r
-16/wf3d8086/wolf3d.map: 1912:02B8       _PM_SetMainMemPurge\r
-16/wf3d8086/wolf3d.map: 1912:02DF       _PM_CheckMainMem\r
-16/wf3d8086/wolf3d.map: 1912:07BF       _PM_GetPageAddress\r
-16/wf3d8086/wolf3d.map: 1912:0C71       _PM_GetPage\r
-16/wf3d8086/wolf3d.map: 1912:0D31       _PM_SetPageLock\r
-16/wf3d8086/wolf3d.map: 1912:0D60       _PM_Preload\r
-16/wf3d8086/wolf3d.map: 1912:0FBA       _PM_NextFrame\r
-16/wf3d8086/wolf3d.map: 1912:1034 idle  _PM_Reset\r
-16/wf3d8086/wolf3d.map: 1912:10A0       _PM_Startup\r
-16/wf3d8086/wolf3d.map: 1912:114B       _PM_Shutdown\r
+16/wf3d8086/wl_scale.c:        shape = PM_GetSpritePage (shapenum);\r
 16/wf3d8086/wolfhack.c:        src = PM_GetPage(0);\r
 16/wf3d8086/wolfhack.c:        src = PM_GetPage(1);\r
-16/wolf3d/WOLFSRC/CONTIGSC.C:  shape = PM_GetSpritePage (shapenum);\r
-16/wolf3d/WOLFSRC/CONTIGSC.C:  shape = PM_GetSpritePage (shapenum);\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_SetMainMemPurge() - Sets the purge level for all allocated main memory\r
-16/wolf3d/WOLFSRC/ID_PM.C://           blocks. This shouldn't be called directly - the PM_LockMainMem() and\r
-16/wolf3d/WOLFSRC/ID_PM.C://           PM_UnlockMainMem() macros should be used instead.\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_SetMainMemPurge(int level)\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_CheckMainMem() - If something besides the Page Mgr makes requests of\r
-16/wolf3d/WOLFSRC/ID_PM.C://   This routine now calls PM_LockMainMem() to make sure that any allocation\r
-16/wolf3d/WOLFSRC/ID_PM.C://           of the other blocks. Because PM_LockMainMem() is called,\r
-16/wolf3d/WOLFSRC/ID_PM.C://           PM_UnlockMainMem() needs to be called before any other part of the\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_CheckMainMem(void)\r
-16/wolf3d/WOLFSRC/ID_PM.C:     PM_LockMainMem();\r
-16/wolf3d/WOLFSRC/ID_PM.C://           necessary to make requests of the Memory Mgr, PM_UnlockMainMem()\r
-16/wolf3d/WOLFSRC/ID_PM.C:             Quit("PM_SetupMainMem: Not enough main memory");\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_GetPageAddress() - Returns the address of a given page\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_GetPageAddress(int pagenum)\r
-16/wolf3d/WOLFSRC/ID_PM.C:     PML_CopyToXMS(PM_GetPageAddress(pagenum),page->xmsPage,page->length);\r
-16/wolf3d/WOLFSRC/ID_PM.C:     addr = PM_GetPageAddress(orig);\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_GetPage() - Returns the address of the page, loading it if necessary\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_GetPage(int pagenum)\r
-16/wolf3d/WOLFSRC/ID_PM.C:             Quit("PM_GetPage: Invalid page request");\r
-16/wolf3d/WOLFSRC/ID_PM.C:     if (!(result = PM_GetPageAddress(pagenum)))\r
-16/wolf3d/WOLFSRC/ID_PM.C:                     result = PM_GetPageAddress(pagenum);\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_SetPageLock() - Sets the lock type on a given page\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_SetPageLock(int pagenum,PMLockType lock)\r
-16/wolf3d/WOLFSRC/ID_PM.C:             Quit("PM_SetPageLock: Locking/unlocking non-sound page");\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_Preload() - Loads as many pages as possible into all types of memory.\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_Preload(boolean (*update)(word current,word total))\r
-16/wolf3d/WOLFSRC/ID_PM.C:                     Quit ("PM_Preload: Pages>=ChunksInFile");\r
-16/wolf3d/WOLFSRC/ID_PM.C:             PM_GetPage(page);\r
-16/wolf3d/WOLFSRC/ID_PM.C:             addr = PM_GetPage(oogypage);\r
-16/wolf3d/WOLFSRC/ID_PM.C:                     Quit("PM_Preload: XMS buffer failed");\r
-16/wolf3d/WOLFSRC/ID_PM.C:                             Quit ("PM_Preload: Pages>=ChunksInFile");\r
-16/wolf3d/WOLFSRC/ID_PM.C:                             Quit("PM_Preload: Exceeded XMS pages");\r
-16/wolf3d/WOLFSRC/ID_PM.C:                             Quit("PM_Preload: Page too long");\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_NextFrame() - Increments the frame counter and adjusts the thrash\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_NextFrame(void)\r
-16/wolf3d/WOLFSRC/ID_PM.C:                     sprintf(buf,"PM_NextFrame: Page %d is locked",i);\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_Reset() - Sets up caching structures\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_Reset(void)\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_Startup() - Start up the Page Mgr\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_Startup(void)\r
-16/wolf3d/WOLFSRC/ID_PM.C:             Quit("PM_Startup: No main or EMS");\r
-16/wolf3d/WOLFSRC/ID_PM.C:     PM_Reset();\r
-16/wolf3d/WOLFSRC/ID_PM.C://   PM_Shutdown() - Shut down the Page Mgr\r
-16/wolf3d/WOLFSRC/ID_PM.C:PM_Shutdown(void)\r
-16/wolf3d/WOLFSRC/ID_PM.H:#define      PM_GetSoundPage(v)      PM_GetPage(PMSoundStart + (v))\r
-16/wolf3d/WOLFSRC/ID_PM.H:#define      PM_GetSpritePage(v)     PM_GetPage(PMSpriteStart + (v))\r
-16/wolf3d/WOLFSRC/ID_PM.H:#define      PM_LockMainMem()        PM_SetMainMemPurge(0)\r
-16/wolf3d/WOLFSRC/ID_PM.H:#define      PM_UnlockMainMem()      PM_SetMainMemPurge(3)\r
-16/wolf3d/WOLFSRC/ID_PM.H:extern       void    PM_Startup(void),\r
-16/wolf3d/WOLFSRC/ID_PM.H:                             PM_Shutdown(void),\r
-16/wolf3d/WOLFSRC/ID_PM.H:                             PM_Reset(void),\r
-16/wolf3d/WOLFSRC/ID_PM.H:                             PM_Preload(boolean (*update)(word current,word total)),\r
-16/wolf3d/WOLFSRC/ID_PM.H:                             PM_NextFrame(void),\r
-16/wolf3d/WOLFSRC/ID_PM.H:                             PM_SetPageLock(int pagenum,PMLockType lock),\r
-16/wolf3d/WOLFSRC/ID_PM.H:                             PM_SetMainPurge(int level),\r
-16/wolf3d/WOLFSRC/ID_PM.H:                             PM_CheckMainMem(void);\r
-16/wolf3d/WOLFSRC/ID_PM.H:extern       memptr  PM_GetPageAddress(int pagenum),\r
-16/wolf3d/WOLFSRC/ID_PM.H:                             PM_GetPage(int pagenum);                // Use this one to cache page\r
-16/wolf3d/WOLFSRC/ID_PM.H:void PM_SetMainMemPurge(int level);\r
-16/wolf3d/WOLFSRC/ID_SD.C:     addr = PM_GetSoundPage(page);\r
-16/wolf3d/WOLFSRC/ID_SD.C:     PM_SetPageLock(PMSoundStart + page,pml_Locked);\r
-16/wolf3d/WOLFSRC/ID_SD.C:             PM_SetPageLock(i + PMSoundStart,pml_Unlocked);\r
-16/wolf3d/WOLFSRC/ID_SD.C:     PM_UnlockMainMem();\r
-16/wolf3d/WOLFSRC/ID_SD.C:     PM_CheckMainMem();\r
-16/wolf3d/WOLFSRC/ID_SD.C:     p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0);\r
-16/wolf3d/WOLFSRC/ID_SD.C:     PM_UnlockMainMem();\r
-16/wolf3d/WOLFSRC/OLDSCALE.C:  shape = PM_GetSpritePage (shapenum);\r
-16/wolf3d/WOLFSRC/OLDSCALE.C:  shape = PM_GetSpritePage (shapenum);\r
-16/wolf3d/WOLFSRC/WL_ACT2.C:   PM_UnlockMainMem ();\r
-16/wolf3d/WOLFSRC/WL_ACT2.C:   PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_DEBUG.C:          addr = PM_GetPageAddress(i);\r
-16/wolf3d/WOLFSRC/WL_DEBUG.C:                          PM_GetPage(j);\r
-16/wolf3d/WOLFSRC/WL_DEBUG.C:                  PM_GetPage(i);\r
-16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
-16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
-16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage);\r
-16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1);\r
-16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
-16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
-16/wolf3d/WOLFSRC/WL_DRAW.C:   PM_NextFrame();\r
-16/wolf3d/WOLFSRC/WL_GAME.C:   PM_UnlockMainMem();\r
-16/wolf3d/WOLFSRC/WL_GAME.C:   PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_GAME.C:   PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_GAME.C:           PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_GAME.C:                   PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_INTER.C:  PM_Preload (PreloadUpdate);\r
-16/wolf3d/WOLFSRC/WL_MAIN.C:   PM_Shutdown ();\r
-16/wolf3d/WOLFSRC/WL_MAIN.C:   PM_Startup ();\r
-16/wolf3d/WOLFSRC/WL_MAIN.C:   PM_UnlockMainMem ();\r
-16/wolf3d/WOLFSRC/WL_MENU.C:                           PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_MENU.C:                           PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_PLAY.C:           PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_PLAY.C:    PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_PLAY.C:    PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_PLAY.C:           PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_PLAY.C:           PM_CheckMainMem ();\r
-16/wolf3d/WOLFSRC/WL_SCALE.C:  shape = PM_GetSpritePage (shapenum);\r
-16/wolf3d/WOLFSRC/WL_SCALE.C:  shape = PM_GetSpritePage (shapenum);\r
-Binary file 16/wolf3d/WOLFSRC/WOLF3D.EXE matches\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 19127H 1A286H 01160H ID_PM_TEXT         CODE\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0007 1160 C=CODE   S=ID_PM_TEXT     G=(none)  M=ID_PM.C    ACBP=28\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02DF       _PM_CheckMainMem\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0C71       _PM_GetPage\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:07BF       _PM_GetPageAddress\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0FBA       _PM_NextFrame\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D60       _PM_Preload\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:1034 idle  _PM_Reset\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02B8       _PM_SetMainMemPurge\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D31       _PM_SetPageLock\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:114B       _PM_Shutdown\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:10A0       _PM_Startup\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02B8       _PM_SetMainMemPurge\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02DF       _PM_CheckMainMem\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:07BF       _PM_GetPageAddress\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0C71       _PM_GetPage\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D31       _PM_SetPageLock\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D60       _PM_Preload\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0FBA       _PM_NextFrame\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:1034 idle  _PM_Reset\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:10A0       _PM_Startup\r
-16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:114B       _PM_Shutdown\r
-16/wolf3d/WOLFSRC/WOLFHACK.C:  src = PM_GetPage(0);\r
-16/wolf3d/WOLFSRC/WOLFHACK.C:  src = PM_GetPage(1);\r
-\r
-16/wf3d8086/id_pm.c:           longword last = MAXLONG;\r
-16/wf3d8086/id_pm.c:   for (i = 0,page = PMPages,lru = -1,last = MAXLONG;i < ChunksInFile;i++,page++)\r
-16/wf3d8086/id_pm.c:   for (i = 0,page = PMPages,lru = -1,last = MAXLONG;i < ChunksInFile;i++,page++)\r
-16/wf3d8086/id_pm.c:   if (++PMFrameCount >= MAXLONG - 4)\r
diff --git a/pm_use_.txt b/pm_use_.txt
new file mode 100755 (executable)
index 0000000..0904161
--- /dev/null
@@ -0,0 +1,43 @@
+16/wolf3d/WOLFSRC/CONTIGSC.C:  shape = PM_GetSpritePage (shapenum);\r
+16/wolf3d/WOLFSRC/CONTIGSC.C:  shape = PM_GetSpritePage (shapenum);\r
+16/wolf3d/WOLFSRC/ID_SD.C:     addr = PM_GetSoundPage(page);\r
+16/wolf3d/WOLFSRC/ID_SD.C:     PM_SetPageLock(PMSoundStart + page,pml_Locked);\r
+16/wolf3d/WOLFSRC/ID_SD.C:             PM_SetPageLock(i + PMSoundStart,pml_Unlocked);\r
+16/wolf3d/WOLFSRC/ID_SD.C:     PM_UnlockMainMem();\r
+16/wolf3d/WOLFSRC/ID_SD.C:     PM_CheckMainMem();\r
+16/wolf3d/WOLFSRC/ID_SD.C:     p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0);\r
+16/wolf3d/WOLFSRC/ID_SD.C:     PM_UnlockMainMem();\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:  shape = PM_GetSpritePage (shapenum);\r
+16/wolf3d/WOLFSRC/OLDSCALE.C:  shape = PM_GetSpritePage (shapenum);\r
+16/wolf3d/WOLFSRC/WL_ACT2.C:   PM_UnlockMainMem ();\r
+16/wolf3d/WOLFSRC/WL_ACT2.C:   PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_DEBUG.C:          addr = PM_GetPageAddress(i);\r
+16/wolf3d/WOLFSRC/WL_DEBUG.C:                          PM_GetPage(j);\r
+16/wolf3d/WOLFSRC/WL_DEBUG.C:                  PM_GetPage(i);\r
+16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
+16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
+16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage);\r
+16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1);\r
+16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
+16/wolf3d/WOLFSRC/WL_DRAW.C:           *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
+16/wolf3d/WOLFSRC/WL_DRAW.C:   PM_NextFrame();\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   PM_UnlockMainMem();\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_GAME.C:   PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_GAME.C:           PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_GAME.C:                   PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_INTER.C:  PM_Preload (PreloadUpdate);\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   PM_Shutdown ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   PM_Startup ();\r
+16/wolf3d/WOLFSRC/WL_MAIN.C:   PM_UnlockMainMem ();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_MENU.C:                           PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:           PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:    PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:    PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:           PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_PLAY.C:           PM_CheckMainMem ();\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:  shape = PM_GetSpritePage (shapenum);\r
+16/wolf3d/WOLFSRC/WL_SCALE.C:  shape = PM_GetSpritePage (shapenum);\r
+16/wolf3d/WOLFSRC/WOLFHACK.C:  src = PM_GetPage(0);\r
+16/wolf3d/WOLFSRC/WOLFHACK.C:  src = PM_GetPage(1);\r
diff --git a/qkeen.sh b/qkeen.sh
new file mode 100755 (executable)
index 0000000..fffb4af
--- /dev/null
+++ b/qkeen.sh
@@ -0,0 +1,4 @@
+grep "$1" 16/keen/*.c
+grep "$1" 16/keen/*.h
+grep "$1" 16/keen/lib/*.c
+grep "$1" 16/keen/lib/*.h
diff --git a/src/0.c b/src/0.c
index b909273f88d9376857d75ab9a1e0f549d75c09e6..3ac991ed292a913f52d36c3639c313813ad976bc 100755 (executable)
--- a/src/0.c
+++ b/src/0.c
@@ -12,7 +12,6 @@
 \r
 #define INITTNUM 1\r
 \r
-static byte palette[768];\r
 player_t player[MaxPlayers];\r
 map_view_t mv[4];\r
 \r
@@ -29,7 +28,7 @@ int main(int argc,char **argv)
        //nibble i;\r
        char *bakapee1,*bakapee2;\r
 \r
-       boolean anim=1,noanim=0;\r
+       boolean anim=1,noanim=0,zerostoppause=1;\r
 \r
        gvar.video.panp=0;\r
 \r
@@ -75,11 +74,10 @@ int main(int argc,char **argv)
                return 1;\r
        }\r
        VGAmodeX(1, 1, &gvar);\r
-\r
-       modexPalUpdate0(palette);\r
+       modexPalUpdate0(gvar.video.palette);\r
 \r
        /* load color palette */\r
-       VL_LoadPalFile(bakapee2, &palette);\r
+       VL_LoadPalFile(bakapee2, &gvar.video.palette);\r
 \r
        /* preprocess the sprite to generate line offsets */\r
        vrl_lineoffs = vrl1_vgax_genlineoffsets(vrl_header,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header));\r
@@ -92,10 +90,12 @@ int main(int argc,char **argv)
        /* setup camera and screen~ */\r
        modexHiganbanaPageSetup(&gvar.video);\r
        ZC_MVSetup(&mv, &map, &gvar);\r
-       //VL_ShowPage(&(gvar.video.page[gvar.video.panp]), 0, 0);\r
-       ZC_ShowMV(&mv, 0, 0);\r
+       ZC_ShowMV(&mv, gvar.video.panp, 0);\r
 \r
-       //DRAWCORNERBOXES;\r
+//     VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
+       VL_PatternDraw(&gvar.video, 0/*gvar.video.panp*/, 0, 1);\r
+       TESTBG34\r
+       DRAWCORNERBOXES\r
 \r
        /* make distinctive pattern offscreen, render sprite, copy onscreen.\r
         * this time, we render the distinctive pattern to another offscreen location and just copy.\r
@@ -108,16 +108,10 @@ int main(int argc,char **argv)
                VGA_RAM_PTR omemptr;\r
                int xdir=1,ydir=1;\r
 \r
-               int j;\r
-               /* fill pattern offset with a distinctive pattern */\r
-               for (i=0;i < gvar.video.page[0].width;i++) {\r
-                       o = (i >> 2) + (0x10000UL - (uint16_t)gvar.video.page[0].data);\r
-                       vga_write_sequencer(0x02/*map mask*/,1 << (i&3));\r
-                       for (j=0;j < gvar.video.page[0].height;j++,o += gvar.video.page[0].stridew)\r
-                               vga_state.vga_graphics_ram[o] = (i^j)&15; // VRL samples put all colors in first 15!\r
-               }\r
-               TESTBG;\r
-               //DRAWCORNERBOXES;\r
+//             VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
+//             VL_PatternDraw(&gvar.video, 0, 1, 1);\r
+//             TESTBG;\r
+//             DRAWCORNERBOXES;\r
 \r
                /* starting coords. note: this technique is limited to x coordinates of multiple of 4 */\r
                x = -(gvar.video.page[0].dx);\r
@@ -131,21 +125,19 @@ int main(int argc,char **argv)
                        IN_ReadControl(0,&player);\r
                        if(IN_KeyDown(68)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1,1); } //f10\r
                        PANKEYFUN;\r
-                       if(IN_KeyDown(sc_Space)       //space\r
+                       if(IN_KeyDown(sc_Space) || zerostoppause)       //space\r
                        {\r
                                anim=!anim;\r
                                DRAWCORNERBOXES;\r
-                               IN_UserInput(1,1);\r
+                               if(!zerostoppause) IN_UserInput(1,1); else zerostoppause=0;\r
                        }\r
                        if(IN_KeyDown(sc_R)){\r
                                gvar.video.page[0].dx=gvar.video.page[0].dy=gvar.video.page[1].dx=gvar.video.page[1].dy=16;\r
                                mv[0].tx = mv[0].ty = mv[1].tx = mv[1].ty = INITTNUM;\r
-                               modexShowPage(&(gvar.video.page[gvar.video.panp]));\r
+\r
                                player[0].enti.q = 1; player[0].enti.d = 2;\r
                                x=y=0;\r
                                xdir=ydir=1;\r
-                               //TESTBG;\r
-                               DRAWCORNERBOXES;\r
                        } //R\r
                        FUNCTIONKEYFUNCTIONS0EXE;\r
 \r
@@ -207,7 +199,6 @@ draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header
 \r
 //===========================================================================//\r
 \r
-       //modexShowPage(&(gvar.video.page[0]));\r
        ZC_ShowMV(&mv, 0, 0);\r
 if(!noanim) {\r
        /* another handy "demo" effect using VGA write mode 1.\r
index e7adbd22275b56e13d987c08efb3cafbe68bcfc8..f787933a136589d69567cd4692809aff51355826 100755 (executable)
@@ -122,7 +122,7 @@ main(int argc, char *argvar[])
        //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____\r
        //getch(); //____\r
 \r
-       modexShowPage(&gvar.video.page[0]);\r
+       VL_ShowPage(&gvar.video.page[0], 0, 0);\r
 \r
 // screen savers\r
 #ifdef BOINK\r
@@ -150,7 +150,7 @@ main(int argc, char *argvar[])
                                        if(panq<=(TILEWH/(4)))\r
                                        {\r
                                                gvar.video.page[0].dx++;\r
-                                               modexShowPage(&gvar.video.page[0]);\r
+                                               VL_ShowPage(&gvar.video.page[0], 0, 0);\r
                                                panq++;\r
                                        } else { panq = 1; pand = 0; }\r
                                }\r
@@ -161,7 +161,7 @@ main(int argc, char *argvar[])
                                        if(panq<=(TILEWH/(4)))\r
                                        {\r
                                                gvar.video.page[0].dx--;\r
-                                               modexShowPage(&gvar.video.page[0]);\r
+                                               VL_ShowPage(&gvar.video.page[0], 0, 0);\r
                                                panq++;\r
                                        } else { panq = 1; pand = 0; }\r
                                }\r
@@ -172,7 +172,7 @@ main(int argc, char *argvar[])
                                        if(panq<=(TILEWH/(4)))\r
                                        {\r
                                                gvar.video.page[0].dy++;\r
-                                               modexShowPage(&gvar.video.page[0]);\r
+                                               VL_ShowPage(&gvar.video.page[0], 0, 0);\r
                                                panq++;\r
                                        } else { panq = 1; pand = 0; }\r
                                }\r
@@ -183,7 +183,7 @@ main(int argc, char *argvar[])
                                        if(panq<=(TILEWH/(4)))\r
                                        {\r
                                                gvar.video.page[0].dy--;\r
-                                               modexShowPage(&gvar.video.page[0]);\r
+                                               VL_ShowPage(&gvar.video.page[0], 0, 0);\r
                                                panq++;\r
                                        } else { panq = 1; pand = 0; }\r
                                }\r
@@ -272,7 +272,7 @@ pee:
                                        gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);\r
                // this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in.\r
                // we'll integrate DOSLIB vga into that part of the code instead for less disruption. -- J.C.\r
-                                       modexShowPage(&gvar.video.page[0]);\r
+                                       VL_ShowPage(&gvar.video.page[0], 0, 0);\r
                                        break;\r
                                case '-':\r
                                        if(bakapee.bonk>0)\r
index d0a3de5190a93f90f1370a24a83f0e8e9a206716..1c89d9b75d8f80f3e9e146288388c7f329f915ea 100755 (executable)
@@ -35,7 +35,6 @@ void EN_initentity(entity_t *enti)
        enti->speed=4;\r
        enti->persist_aniframe = enti->q;\r
        enti->spt=(TILEWH/(enti->speed));       //speed per tile wwww\r
-       enti->invq=1;\r
        enti->pred = enti->d;\r
        enti->overdraww=0;\r
        enti->overdrawh=4;\r
index abcf48aa05720451433f95e3354484c88b18da82..b30f9df8fd3eddea5783818155d8dc2abee086a4 100755 (executable)
@@ -18,8 +18,8 @@
 \r
 // ID_MM.H\r
 \r
-#ifndef __16_EXMM__\r
-#define __16_EXMM__\r
+#ifndef __16_MM__\r
+#define __16_MM__\r
 \r
 #include <string.h>\r
 #include <malloc.h>\r
diff --git a/src/lib/16_rf.c b/src/lib/16_rf.c
new file mode 100755 (executable)
index 0000000..05ea5ae
--- /dev/null
@@ -0,0 +1,3110 @@
+/* Keen Dreams Source Code\r
+ * Copyright (C) 2014 Javier M. Chavez\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License along\r
+ * with this program; if not, write to the Free Software Foundation, Inc.,\r
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+ */\r
+\r
+// 16_RF.C\r
+\r
+/*\r
+=============================================================================\r
+\r
+notes\r
+-----\r
+\r
+scrolling more than one tile / refresh forces a total redraw\r
+\r
+two overlapping sprites of equal priority can change drawing order when\r
+updated\r
+\r
+=============================================================================\r
+*/\r
+\r
+#include "src/lib/16_rf.h"\r
+#pragma hdrstop\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                                LOCAL CONSTANTS\r
+\r
+=============================================================================\r
+*/\r
+\r
+#define        SCREENTILESWIDE 20\r
+#define        SCREENTILESHIGH 13\r
+\r
+#define        SCREENSPACE             (SCREENWIDTH*240)\r
+#define FREEEGAMEM             (0x10000l-3l*SCREENSPACE)\r
+\r
+//\r
+// the update array must have enough space for two screens that can float\r
+// up two two tiles each way\r
+//\r
+// (PORTTILESWIDE+1)*PORTTILESHIGH must be even so the arrays can be cleared\r
+// by word width instructions\r
+\r
+#define        UPDATESCREENSIZE        (UPDATEWIDE*PORTTILESHIGH+2)\r
+#define        UPDATESPARESIZE         (UPDATEWIDE*2+4)\r
+#define UPDATESIZE                     (UPDATESCREENSIZE+2*UPDATESPARESIZE)\r
+\r
+#define G_EGASX_SHIFT  7       // global >> ?? = screen x\r
+#define G_CGASX_SHIFT  6       // global >> ?? = screen x\r
+#define G_SY_SHIFT             4       // global >> ?? = screen y\r
+\r
+unsigned       SX_T_SHIFT;             // screen x >> ?? = tile EGA = 1, CGA = 2;\r
+#define        SY_T_SHIFT              4       // screen y >> ?? = tile\r
+\r
+\r
+#define        EGAPORTSCREENWIDE       42\r
+#define        CGAPORTSCREENWIDE       84\r
+#define        PORTSCREENHIGH  224\r
+\r
+#define        UPDATESCREENSIZE        (UPDATEWIDE*PORTTILESHIGH+2)\r
+#define        UPDATESPARESIZE         (UPDATEWIDE*2+4)\r
+#define UPDATESIZE                     (UPDATESCREENSIZE+2*UPDATESPARESIZE)\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                                  LOCAL TYPES\r
+\r
+=============================================================================\r
+*/\r
+\r
+typedef        struct spriteliststruct\r
+{\r
+       int                     screenx,screeny;\r
+       int                     width,height;\r
+\r
+       unsigned        grseg,sourceofs,planesize;\r
+       drawtype        draw;\r
+       unsigned        tilex,tiley,tilewide,tilehigh;\r
+       int                     priority,updatecount;\r
+       struct spriteliststruct **prevptr,*nextsprite;\r
+} spritelisttype;\r
+\r
+\r
+typedef struct\r
+{\r
+       int                     screenx,screeny;\r
+       int                     width,height;\r
+} eraseblocktype;\r
+\r
+\r
+typedef struct\r
+{\r
+       unsigned        current;                // foreground tiles have high bit set\r
+       int                     count;\r
+} tiletype;\r
+\r
+\r
+typedef struct animtilestruct\r
+{\r
+       unsigned        x,y,tile;\r
+       tiletype        *chain;\r
+       unsigned        far *mapplane;\r
+       struct animtilestruct **prevptr,*nexttile;\r
+} animtiletype;\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                                GLOBAL VARIABLES\r
+\r
+=============================================================================\r
+*/\r
+\r
+unsigned       tics;\r
+long           lasttimecount;\r
+\r
+boolean                compatability;                  // crippled refresh for wierdo SVGAs\r
+\r
+unsigned       mapwidth,mapheight,mapbyteswide,mapwordswide\r
+                       ,mapbytesextra,mapwordsextra;\r
+unsigned       mapbwidthtable[MAXMAPHEIGHT];\r
+\r
+//\r
+// Global : Actor coordinates are in this, at 1/16 th of a pixel, to allow\r
+// for fractional movement and acceleration.\r
+//\r
+// Tiles  : Tile offsets from the upper left corner of the current map.\r
+//\r
+// Screen : Graphics level offsets from map origin, x in bytes, y in pixels.\r
+// originxscreen is the same spot as originxtile, just with extra precision\r
+// so graphics don't need to be done in tile boundaries.\r
+//\r
+\r
+unsigned       originxglobal,originyglobal;\r
+unsigned       originxtile,originytile;\r
+unsigned       originxscreen,originyscreen;\r
+unsigned       originmap;\r
+unsigned       originxmin,originxmax,originymin,originymax;\r
+unsigned       originxtile,originytile;\r
+\r
+unsigned       masterofs;\r
+\r
+//\r
+// Table of the offsets from bufferofs of each tile spot in the\r
+// view port.  The extra wide tile should never be drawn, but the space\r
+// is needed to account for the extra 0 in the update arrays.  Built by\r
+// RF_Startup\r
+//\r
+\r
+unsigned       blockstarts[UPDATEWIDE*UPDATEHIGH];\r
+unsigned       updatemapofs[UPDATEWIDE*UPDATEHIGH];\r
+\r
+unsigned       uwidthtable[PORTTILESHIGH];             // lookup instead of multiply\r
+\r
+byte           update[2][UPDATESIZE];\r
+byte           *updateptr,*baseupdateptr,                                              // current start of update window\r
+                       *updatestart[2],\r
+                       *baseupdatestart[2];\r
+\r
+//from others\r
+cardtype       videocard;              // set by VW_Startup\r
+grtype         grmode;                 // CGAgr, EGAgr, VGAgr\r
+\r
+unsigned       bufferofs;              // hidden area to draw to before displaying\r
+unsigned       displayofs;             // origin of the visable screen\r
+//\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                                LOCAL VARIABLES\r
+\r
+=============================================================================\r
+*/\r
+#ifdef PROFILE\r
+static         char    scratch[20],str[20];\r
+#endif\r
+\r
+tiletype       allanims[MAXANIMTYPES];\r
+unsigned       numanimchains;\r
+\r
+void           (*refreshvector) (void);\r
+\r
+unsigned       screenstart[3] =\r
+       {0,SCREENSPACE,SCREENSPACE*2};\r
+\r
+unsigned       xpanmask;                       // prevent panning to odd pixels\r
+\r
+unsigned       screenpage;                     // screen currently being displayed\r
+unsigned       otherpage;\r
+\r
+#if GRMODE == EGAGR\r
+unsigned       tilecache[NUMTILE16];\r
+#endif\r
+\r
+spritelisttype spritearray[MAXSPRITES],*prioritystart[PRIORITIES],\r
+                               *spritefreeptr;\r
+\r
+animtiletype   animarray[MAXANIMTILES],*animhead,*animfreeptr;\r
+\r
+int                            animfreespot;\r
+\r
+eraseblocktype eraselist[2][MAXSPRITES],*eraselistptr[2];\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                                LOCAL PROTOTYPES\r
+\r
+=============================================================================\r
+*/\r
+\r
+void RFL_NewTile (unsigned updateoffset);\r
+void RFL_MaskForegroundTiles (void);\r
+void RFL_UpdateTiles (void);\r
+\r
+void RFL_CalcOriginStuff (long x, long y);\r
+void RFL_InitSpriteList (void);\r
+void RFL_InitAnimList (void);\r
+void RFL_CheckForAnimTile (unsigned x, unsigned y);\r
+void RFL_AnimateTiles (void);\r
+void RFL_RemoveAnimsOnX (unsigned x);\r
+void RFL_RemoveAnimsOnY (unsigned y);\r
+void RFL_EraseBlocks (void);\r
+void RFL_UpdateSprites (void);\r
+\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                        GRMODE INDEPENDANT ROUTINES\r
+\r
+=============================================================================\r
+*/\r
+\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_Startup\r
+=\r
+=====================\r
+*/\r
+\r
+static char *ParmStrings[] = {"comp",""};\r
+\r
+void RF_Startup (void)\r
+{\r
+       int i,x,y;\r
+       unsigned        *blockstart;\r
+\r
+       if (grmode == EGAGR)\r
+               for (i = 1;i < _argc;i++)\r
+                       if (US_CheckParm(_argv[i],ParmStrings) == 0)\r
+                       {\r
+                               compatability = true;\r
+                               break;\r
+                       }\r
+\r
+       for (i=0;i<PORTTILESHIGH;i++)\r
+               uwidthtable[i] = UPDATEWIDE*i;\r
+\r
+       originxmin = originymin = MAPBORDER*TILEGLOBAL;\r
+\r
+       eraselistptr[0] = &eraselist[0][0];\r
+       eraselistptr[1] = &eraselist[1][0];\r
+\r
+\r
+\r
+       if (grmode == EGAGR)\r
+       {\r
+               SX_T_SHIFT = 1;\r
+\r
+               baseupdatestart[0] = &update[0][UPDATESPARESIZE];\r
+               baseupdatestart[1] = &update[1][UPDATESPARESIZE];\r
+\r
+               screenpage = 0;\r
+               otherpage = 1;\r
+               displayofs = screenstart[screenpage];\r
+               bufferofs = screenstart[otherpage];\r
+               masterofs = screenstart[2];\r
+\r
+               updateptr = baseupdatestart[otherpage];\r
+\r
+               blockstart = &blockstarts[0];\r
+               for (y=0;y<UPDATEHIGH;y++)\r
+                       for (x=0;x<UPDATEWIDE;x++)\r
+                               *blockstart++ = SCREENWIDTH*16*y+x*TILEWIDTH;\r
+\r
+               xpanmask = 6;   // dont pan to odd pixels\r
+       }\r
+\r
+       else if (grmode == CGAGR)\r
+       {\r
+               SX_T_SHIFT = 2;\r
+\r
+               updateptr = baseupdateptr = &update[0][UPDATESPARESIZE];\r
+\r
+               bufferofs = 0;\r
+               masterofs = 0x8000;\r
+\r
+               blockstart = &blockstarts[0];\r
+               for (y=0;y<UPDATEHIGH;y++)\r
+                       for (x=0;x<UPDATEWIDE;x++)\r
+                               *blockstart++ = SCREENWIDTH*16*y+x*TILEWIDTH;\r
+       }\r
+}\r
+\r
+\r
+\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_Shutdown\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_Shutdown (void)\r
+{\r
+\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_NewMap\r
+=\r
+= Makes some convienient calculations based on maphead->\r
+=\r
+=====================\r
+*/\r
+/*++++\r
+void RF_NewMap (void)\r
+{\r
+       int i,x,y;\r
+       unsigned spot,*table;\r
+\r
+       mapwidth = mapheaderseg[mapon]->width;\r
+       mapbyteswide = 2*mapwidth;\r
+       mapheight = mapheaderseg[mapon]->height;\r
+       mapwordsextra = mapwidth-PORTTILESWIDE;\r
+       mapbytesextra = 2*mapwordsextra;\r
+\r
+//\r
+// make a lookup table for the maps left edge\r
+//\r
+       spot = 0;\r
+       for (i=0;i<mapheight;i++)\r
+       {\r
+         mapbwidthtable[i] = spot;\r
+         spot += mapbyteswide;\r
+       }\r
+\r
+//\r
+// fill in updatemapofs with the new width info\r
+//\r
+       table = &updatemapofs[0];\r
+       for (y=0;y<PORTTILESHIGH;y++)\r
+               for (x=0;x<UPDATEWIDE;x++)\r
+                       *table++ = mapbwidthtable[y]+x*2;\r
+\r
+\r
+//\r
+// the y max value clips off the bottom half of a tile so a map that is\r
+// 13 + MAPBORDER*2 tile high will not scroll at all vertically\r
+//\r
+       originxmax = (mapwidth-MAPBORDER-SCREENTILESWIDE)*TILEGLOBAL;\r
+       originymax = (mapheight-MAPBORDER-SCREENTILESHIGH)*TILEGLOBAL;\r
+       if (originxmax<originxmin)              // for very small maps\r
+               originxmax=originxmin;\r
+       if (originymax<originymin)\r
+               originymax=originymin;\r
+\r
+//\r
+// clear out the lists\r
+//\r
+       RFL_InitSpriteList ();\r
+       RFL_InitAnimList ();\r
+\r
+\r
+       lasttimecount = TimeCount;              // setup for adaptive timing\r
+       tics = 1;\r
+}\r
+*/\r
+//===========================================================================\r
+\r
+/*\r
+==========================\r
+=\r
+= RF_MarkTileGraphics\r
+=\r
+= Goes through mapplane[0/1] and marks all background/foreground tiles\r
+= needed, then follows all animation sequences to make sure animated\r
+= tiles get all the stages.  Every unique animating tile is given an\r
+= entry in allanims[], so every instance of that tile will animate at the\r
+= same rate.  The info plane for each animating tile will hold a pointer\r
+= into allanims[], therefore you can't have both an animating foreground\r
+= and background tile in the same spot!\r
+=\r
+==========================\r
+*/\r
+/*++++\r
+void RF_MarkTileGraphics (void)\r
+{\r
+       unsigned        size;\r
+       int                     tile,next,anims;\r
+       unsigned        far     *start,far *end,far *info;\r
+       unsigned        i,tilehigh;\r
+\r
+       memset (allanims,0,sizeof(allanims));\r
+       numanimchains = 0;\r
+\r
+       size = mapwidth*mapheight;\r
+\r
+//\r
+// background plane\r
+//\r
+       start = mapsegs[0];\r
+       info = mapsegs[2];\r
+       end = start+size;\r
+       do\r
+       {\r
+               tile = *start++;\r
+               if (tile>=0)                    // <0 is a tile that is never drawn\r
+               {\r
+                       CA_MarkGrChunk(STARTTILE16+tile);\r
+                       if (tinf[ANIM+tile])\r
+                       {\r
+                               // this tile will animated\r
+\r
+                               for (i=0;i<numanimchains;i++)\r
+                                       if (allanims[i].current == tile)\r
+                                       {\r
+                                               *info = (unsigned)&allanims[i];\r
+                                               goto nextback;\r
+                                       }\r
+\r
+                               // new chain of animating tiles\r
+\r
+                               if (i>=MAXANIMTYPES)\r
+                                       //Quit ("RF_MarkTileGraphics: Too many unique animated tiles!");\r
+                               allanims[i].current = tile;\r
+                               allanims[i].count = tinf[SPEED+tile];\r
+\r
+                               *info = (unsigned)&allanims[i];\r
+                               numanimchains++;\r
+\r
+                               anims = 0;\r
+                               next = tile+(signed char)(tinf[ANIM+tile]);\r
+                               while (next != tile)\r
+                               {\r
+                                       CA_MarkGrChunk(STARTTILE16+next);\r
+                                       next += (signed char)(tinf[ANIM+next]);\r
+                                       if (++anims > 20)\r
+                                               //Quit ("MarkTileGraphics: Unending animation!");\r
+                               }\r
+\r
+                       }\r
+               }\r
+nextback:\r
+               info++;\r
+       } while (start<end);\r
+\r
+//\r
+// foreground plane\r
+//\r
+       start = mapsegs[1];\r
+       info = mapsegs[2];\r
+       end = start+size;\r
+       do\r
+       {\r
+               tile = *start++;\r
+               if (tile>=0)                    // <0 is a tile that is never drawn\r
+               {\r
+                       CA_MarkGrChunk(STARTTILE16M+tile);\r
+                       if (tinf[MANIM+tile])\r
+                       {\r
+                               // this tile will animated\r
+\r
+                               tilehigh = tile | 0x8000;       // foreground tiles have high bit\r
+                               for (i=0;i<numanimchains;i++)\r
+                                       if (allanims[i].current == tilehigh)\r
+                                       {\r
+                                               *info = (unsigned)&allanims[i];\r
+                                               goto nextfront;\r
+                                       }\r
+\r
+                               // new chain of animating tiles\r
+\r
+                               if (i>=MAXANIMTYPES)\r
+                                       //Quit ("RF_MarkTileGraphics: Too many unique animated tiles!");\r
+                               allanims[i].current = tilehigh;\r
+                               allanims[i].count = tinf[MSPEED+tile];\r
+\r
+                               *info = (unsigned)&allanims[i];\r
+                               numanimchains++;\r
+\r
+                               anims = 0;\r
+                               next = tile+(signed char)(tinf[MANIM+tile]);\r
+                               while (next != tile)\r
+                               {\r
+                                       CA_MarkGrChunk(STARTTILE16M+next);\r
+                                       next += (signed char)(tinf[MANIM+next]);\r
+                                       if (++anims > 20)\r
+                                               //Quit ("MarkTileGraphics: Unending animation!");\r
+                               }\r
+\r
+                       }\r
+               }\r
+nextfront:\r
+               info++;\r
+       } while (start<end);\r
+}\r
+*/\r
+\r
+//===========================================================================\r
+\r
+\r
+/*\r
+=========================\r
+=\r
+= RFL_InitAnimList\r
+=\r
+= Call to clear out the entire animating tile list and return all of them to\r
+= the free list.\r
+=\r
+=========================\r
+*/\r
+\r
+void RFL_InitAnimList (void)\r
+{\r
+       int     i;\r
+\r
+       animfreeptr = &animarray[0];\r
+\r
+       for (i=0;i<MAXANIMTILES-1;i++)\r
+               animarray[i].nexttile = &animarray[i+1];\r
+\r
+       animarray[i].nexttile = NULL;\r
+\r
+       animhead = NULL;                        // nothing in list\r
+}\r
+\r
+\r
+/*\r
+====================\r
+=\r
+= RFL_CheckForAnimTile\r
+=\r
+====================\r
+*/\r
+/*++++\r
+void RFL_CheckForAnimTile (unsigned x, unsigned y)\r
+{\r
+       unsigned        tile,offset,speed,lasttime,thistime,timemissed;\r
+       unsigned        far *map;\r
+       animtiletype    *anim,*next;\r
+\r
+// the info plane of each animating tile has a near pointer into allanims[]\r
+// which gives the current state of all concurrently animating tiles\r
+\r
+       offset = mapbwidthtable[y]/2+x;\r
+\r
+//\r
+// background\r
+//\r
+       map = mapsegs[0]+offset;\r
+       tile = *map;\r
+       if (tinf[ANIM+tile])\r
+       {\r
+               if (!animfreeptr)\r
+                       //Quit ("RF_CheckForAnimTile: No free spots in tilearray!");\r
+               anim = animfreeptr;\r
+               animfreeptr = animfreeptr->nexttile;\r
+               next = animhead;                                // stick it at the start of the list\r
+               animhead = anim;\r
+               if (next)\r
+                       next->prevptr = &anim->nexttile;\r
+               anim->nexttile = next;\r
+               anim->prevptr = &animhead;\r
+\r
+               anim->x = x;\r
+               anim->y = y;\r
+               anim->tile = tile;\r
+               anim->mapplane = map;\r
+               anim->chain = (tiletype *)*(mapsegs[2]+offset);\r
+       }\r
+\r
+//\r
+// foreground\r
+//\r
+       map = mapsegs[1]+offset;\r
+       tile = *map;\r
+       if (tinf[MANIM+tile])\r
+       {\r
+               if (!animfreeptr)\r
+                       //Quit ("RF_CheckForAnimTile: No free spots in tilearray!");\r
+               anim = animfreeptr;\r
+               animfreeptr = animfreeptr->nexttile;\r
+               next = animhead;                                // stick it at the start of the list\r
+               animhead = anim;\r
+               if (next)\r
+                       next->prevptr = &anim->nexttile;\r
+               anim->nexttile = next;\r
+               anim->prevptr = &animhead;\r
+\r
+               anim->x = x;\r
+               anim->y = y;\r
+               anim->tile = tile;\r
+               anim->mapplane = map;\r
+               anim->chain = (tiletype *)*(mapsegs[2]+offset);\r
+       }\r
+\r
+}\r
+*/\r
+\r
+/*\r
+====================\r
+=\r
+= RFL_RemoveAnimsOnX\r
+=\r
+====================\r
+*/\r
+\r
+void RFL_RemoveAnimsOnX (unsigned x)\r
+{\r
+       animtiletype *current,*next;\r
+\r
+       current = animhead;\r
+       while (current)\r
+       {\r
+               if (current->x == x)\r
+               {\r
+                       *(void **)current->prevptr = current->nexttile;\r
+                       if (current->nexttile)\r
+                               current->nexttile->prevptr = current->prevptr;\r
+                       next = current->nexttile;\r
+                       current->nexttile = animfreeptr;\r
+                       animfreeptr = current;\r
+                       current = next;\r
+               }\r
+               else\r
+                       current = current->nexttile;\r
+       }\r
+}\r
+\r
+\r
+/*\r
+====================\r
+=\r
+= RFL_RemoveAnimsOnY\r
+=\r
+====================\r
+*/\r
+\r
+void RFL_RemoveAnimsOnY (unsigned y)\r
+{\r
+       animtiletype *current,*next;\r
+\r
+       current = animhead;\r
+       while (current)\r
+       {\r
+               if (current->y == y)\r
+               {\r
+                       *(void **)current->prevptr = current->nexttile;\r
+                       if (current->nexttile)\r
+                               current->nexttile->prevptr = current->prevptr;\r
+                       next = current->nexttile;\r
+                       current->nexttile = animfreeptr;\r
+                       animfreeptr = current;\r
+                       current = next;\r
+               }\r
+               else\r
+                       current = current->nexttile;\r
+       }\r
+}\r
+\r
+\r
+/*\r
+====================\r
+=\r
+= RFL_AnimateTiles\r
+=\r
+====================\r
+*/\r
+/*++++\r
+void RFL_AnimateTiles (void)\r
+{\r
+       animtiletype *current;\r
+       unsigned        updateofs,tile,x,y;\r
+       tiletype        *anim;\r
+\r
+//\r
+// animate the lists of tiles\r
+//\r
+       anim = &allanims[0];\r
+       while (anim->current)\r
+       {\r
+               anim->count-=tics;\r
+               while ( anim->count < 1)\r
+               {\r
+                       if (anim->current & 0x8000)\r
+                       {\r
+                               tile = anim->current & 0x7fff;\r
+                               tile += (signed char)tinf[MANIM+tile];\r
+                               anim->count += tinf[MSPEED+tile];\r
+                               tile |= 0x8000;\r
+                       }\r
+                       else\r
+                       {\r
+                               tile = anim->current;\r
+                               tile += (signed char)tinf[ANIM+tile];\r
+                               anim->count += tinf[SPEED+tile];\r
+                       }\r
+                       anim->current = tile;\r
+               }\r
+               anim++;\r
+       }\r
+\r
+\r
+//\r
+// traverse the list of animating tiles\r
+//\r
+       current = animhead;\r
+       while (current)\r
+       {\r
+               tile =current->chain->current;\r
+               if ( tile != current->tile)\r
+               {\r
+               // tile has animated\r
+               //\r
+               // remove tile from master screen cache,\r
+               // change a tile to its next state, set the structure up for\r
+               // next animation, and post an update region to both update pages\r
+               //\r
+                       current->tile = tile;\r
+\r
+                       *(current->mapplane) = tile & 0x7fff;           // change in map\r
+\r
+#if GRMODE == EGAGR\r
+                       if (tile<0x8000)                // background\r
+                               tilecache[tile] = 0;\r
+#endif\r
+\r
+                       x = current->x-originxtile;\r
+                       y = current->y-originytile;\r
+\r
+                       if (x>=PORTTILESWIDE || y>=PORTTILESHIGH)\r
+                               //Quit ("RFL_AnimateTiles: Out of bounds!");\r
+\r
+                       updateofs = uwidthtable[y] + x;\r
+                       RFL_NewTile(updateofs);                         // puts "1"s in both pages\r
+               }\r
+               current = current->nexttile;\r
+       }\r
+}\r
+*/\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=========================\r
+=\r
+= RFL_InitSpriteList\r
+=\r
+= Call to clear out the entire sprite list and return all of them to\r
+= the free list.\r
+=\r
+=========================\r
+*/\r
+\r
+void RFL_InitSpriteList (void)\r
+{\r
+       int     i;\r
+\r
+       spritefreeptr = &spritearray[0];\r
+       for (i=0;i<MAXSPRITES-1;i++)\r
+               spritearray[i].nextsprite = &spritearray[i+1];\r
+\r
+       spritearray[i].nextsprite = NULL;\r
+\r
+// NULL in all priority levels\r
+\r
+       memset (prioritystart,0,sizeof(prioritystart));\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=================\r
+=\r
+= RFL_CalcOriginStuff\r
+=\r
+= Calculate all the global variables for a new position\r
+= Long parms so position can be clipped to a maximum near 64k\r
+=\r
+=================\r
+*/\r
+\r
+void RFL_CalcOriginStuff (long x, long y)\r
+{\r
+       if (x<originxmin)\r
+         x=originxmin;\r
+       else if (x>originxmax)\r
+         x=originxmax;\r
+\r
+       if (y<originymin)\r
+         y=originymin;\r
+       else if (y>originymax)\r
+         y=originymax;\r
+\r
+       originxglobal = x;\r
+       originyglobal = y;\r
+       originxtile = originxglobal>>G_T_SHIFT;\r
+       originytile = originyglobal>>G_T_SHIFT;\r
+       originxscreen = originxtile<<SX_T_SHIFT;\r
+       originyscreen = originytile<<SY_T_SHIFT;\r
+       originmap = mapbwidthtable[originytile] + originxtile*2;\r
+\r
+#if GRMODE == EGAGR\r
+       panx = (originxglobal>>G_P_SHIFT) & 15;\r
+       pansx = panx & 8;\r
+       pany = pansy = (originyglobal>>G_P_SHIFT) & 15;\r
+       panadjust = panx/8 + ylookup[pany];\r
+#endif\r
+\r
+#if GRMODE == CGAGR\r
+       panx = (originxglobal>>G_P_SHIFT) & 15;\r
+       pansx = panx & 12;\r
+       pany = pansy = (originyglobal>>G_P_SHIFT) & 15;\r
+       panadjust = pansx/4 + ylookup[pansy];\r
+#endif\r
+\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_SetRefreshHook\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_SetRefreshHook (void (*func) (void) )\r
+{\r
+       refreshvector = func;\r
+}\r
+\r
+\r
+\r
+/*\r
+=================\r
+=\r
+= RFL_NewRow\r
+=\r
+= Bring a new row of tiles onto the port, spawning animating tiles\r
+=\r
+=================\r
+*/\r
+\r
+void   RFL_NewRow (int dir)\r
+{\r
+       unsigned count,updatespot,updatestep;\r
+       int             x,y,xstep,ystep;\r
+\r
+       switch (dir)\r
+       {\r
+       case 0:         // top row\r
+               updatespot = 0;\r
+               updatestep = 1;\r
+               x = originxtile;\r
+               y = originytile;\r
+               xstep = 1;\r
+               ystep = 0;\r
+               count = PORTTILESWIDE;\r
+               break;\r
+\r
+       case 1:         // right row\r
+               updatespot = PORTTILESWIDE-1;\r
+               updatestep = UPDATEWIDE;\r
+               x = originxtile + PORTTILESWIDE-1;\r
+               y = originytile;\r
+               xstep = 0;\r
+               ystep = 1;\r
+               count = PORTTILESHIGH;\r
+               break;\r
+\r
+       case 2:         // bottom row\r
+               updatespot = UPDATEWIDE*(PORTTILESHIGH-1);\r
+               updatestep = 1;\r
+               x = originxtile;\r
+               y = originytile + PORTTILESHIGH-1;\r
+               xstep = 1;\r
+               ystep = 0;\r
+               count = PORTTILESWIDE;\r
+               break;\r
+\r
+       case 3:         // left row\r
+               updatespot = 0;\r
+               updatestep = UPDATEWIDE;\r
+               x = originxtile;\r
+               y = originytile;\r
+               xstep = 0;\r
+               ystep = 1;\r
+               count = PORTTILESHIGH;\r
+               break;\r
+       //default:\r
+               //Quit ("RFL_NewRow: Bad dir!");\r
+       }\r
+\r
+       while (count--)\r
+       {\r
+               RFL_NewTile(updatespot);\r
+               RFL_CheckForAnimTile (x,y);\r
+               updatespot+=updatestep;\r
+               x+=xstep;\r
+               y+=ystep;\r
+       }\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_ForceRefresh\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_ForceRefresh (void)\r
+{\r
+       RF_NewPosition (originxglobal,originyglobal);\r
+       RF_Refresh ();\r
+       RF_Refresh ();\r
+}\r
+\r
+\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                       EGA specific routines\r
+\r
+=============================================================================\r
+*/\r
+\r
+#if GRMODE == EGAGR\r
+\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_NewPosition EGA\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_NewPosition (unsigned x, unsigned y)\r
+{\r
+       int mx,my;\r
+       byte    *page0ptr,*page1ptr;\r
+       unsigned        updatenum;\r
+\r
+//\r
+// calculate new origin related globals\r
+//\r
+       RFL_CalcOriginStuff (x,y);\r
+\r
+//\r
+// clear out all animating tiles\r
+//\r
+       RFL_InitAnimList ();\r
+\r
+//\r
+// set up the new update arrays at base position\r
+//\r
+       memset (tilecache,0,sizeof(tilecache));         // old cache is invalid\r
+\r
+       updatestart[0] = baseupdatestart[0];\r
+       updatestart[1] = baseupdatestart[1];\r
+\r
+       page0ptr = updatestart[0]+PORTTILESWIDE;        // used to stick "0"s after rows\r
+       page1ptr = updatestart[1]+PORTTILESWIDE;\r
+\r
+       updatenum = 0;                          // start at first visable tile\r
+\r
+       for (my=0;my<PORTTILESHIGH;my++)\r
+       {\r
+               for (mx=0;mx<PORTTILESWIDE;mx++)\r
+               {\r
+                       RFL_NewTile(updatenum);                 // puts "1"s in both pages\r
+                       RFL_CheckForAnimTile(mx+originxtile,my+originytile);\r
+                       updatenum++;\r
+               }\r
+               updatenum++;\r
+               *page0ptr = *page1ptr = 0; // set a 0 at end of a line of tiles\r
+               page0ptr+=(PORTTILESWIDE+1);\r
+               page1ptr+=(PORTTILESWIDE+1);\r
+       }\r
+       *(word *)(page0ptr-PORTTILESWIDE)\r
+               = *(word *)(page1ptr-PORTTILESWIDE) = UPDATETERMINATE;\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=================\r
+=\r
+= RFL_OldRow EGA\r
+=\r
+= Uncache the trailing row of tiles\r
+=\r
+=================\r
+*/\r
+\r
+void   RFL_OldRow (unsigned updatespot,unsigned count,unsigned step)\r
+{\r
+\r
+asm    mov     si,[updatespot]                 // pointer inside each map plane\r
+asm    mov     cx,[count]                              // number of tiles to clear\r
+asm    mov     dx,[step]                               // move to next tile\r
+asm    mov     es,[WORD PTR mapsegs]                   // background plane\r
+asm    mov     ds,[WORD PTR mapsegs+2]                 // foreground plane\r
+\r
+clearcache:\r
+asm    mov     bx,[si]\r
+asm    or      bx,bx\r
+asm    jnz     blockok                                 // if a foreground tile, block wasn't cached\r
+asm    mov     bx,[es:si]\r
+asm    shl     bx,1\r
+asm    mov     [WORD PTR ss:tilecache+bx],0  //tile is no longer in master screen cache\r
+blockok:\r
+asm    add     si,dx\r
+asm    loop    clearcache\r
+\r
+asm    mov     ax,ss\r
+asm    mov     ds,ax\r
+\r
+}\r
+\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_Scroll  EGA\r
+=\r
+= Move the origin x/y global coordinates, readjust the screen panning, and\r
+= scroll if needed.  If the scroll distance is greater than one tile, the\r
+= entire screen will be redrawn (this could be generalized, but scrolling\r
+= more than one tile per refresh is a bad idea!).\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_Scroll (int x, int y)\r
+{\r
+       long            neworgx,neworgy;\r
+       int                     i,deltax,deltay,absdx,absdy;\r
+       int                     oldxt,oldyt,move,yy;\r
+       unsigned        updatespot;\r
+       byte            *update0,*update1;\r
+       unsigned        oldpanx,oldpanadjust,oldoriginmap,oldscreen,newscreen,screencopy;\r
+       int                     screenmove;\r
+\r
+       oldxt = originxtile;\r
+       oldyt = originytile;\r
+       oldoriginmap = originmap;\r
+       oldpanadjust = panadjust;\r
+       oldpanx = panx;\r
+\r
+       RFL_CalcOriginStuff ((long)originxglobal + x,(long)originyglobal + y);\r
+\r
+       deltax = originxtile - oldxt;\r
+       absdx = abs(deltax);\r
+       deltay = originytile - oldyt;\r
+       absdy = abs(deltay);\r
+\r
+       if (absdx>1 || absdy>1)\r
+       {\r
+       //\r
+       // scrolled more than one tile, so start from scratch\r
+       //\r
+               RF_NewPosition(originxglobal,originyglobal);\r
+               return;\r
+       }\r
+\r
+       if (!absdx && !absdy)\r
+               return;                                 // the screen has not scrolled an entire tile\r
+\r
+\r
+//\r
+// adjust screens and handle SVGA crippled compatability mode\r
+//\r
+       screenmove = deltay*16*SCREENWIDTH + deltax*TILEWIDTH;\r
+       for (i=0;i<3;i++)\r
+       {\r
+               screenstart[i]+= screenmove;\r
+               if (compatability && screenstart[i] > (0x10000l-SCREENSPACE) )\r
+               {\r
+                       //\r
+                       // move the screen to the opposite end of the buffer\r
+                       //\r
+                       screencopy = screenmove>0 ? FREEEGAMEM : -FREEEGAMEM;\r
+                       oldscreen = screenstart[i] - screenmove;\r
+                       newscreen = oldscreen + screencopy;\r
+                       screenstart[i] = newscreen + screenmove;\r
+                       VW_ScreenToScreen (oldscreen,newscreen,\r
+                               PORTTILESWIDE*2,PORTTILESHIGH*16);\r
+\r
+                       if (i==screenpage)\r
+                               VW_SetScreen(newscreen+oldpanadjust,oldpanx & xpanmask);\r
+               }\r
+       }\r
+       bufferofs = screenstart[otherpage];\r
+       displayofs = screenstart[screenpage];\r
+       masterofs = screenstart[2];\r
+\r
+\r
+//\r
+// float the update regions\r
+//\r
+       move = deltax;\r
+       if (deltay==1)\r
+         move += UPDATEWIDE;\r
+       else if (deltay==-1)\r
+         move -= UPDATEWIDE;\r
+\r
+       updatestart[0]+=move;\r
+       updatestart[1]+=move;\r
+\r
+//\r
+// draw the new tiles just scrolled on to the master screen, and\r
+// mark them as needing to be copied to each screen next refreshes\r
+// Make sure a zero is at the end of each row in update\r
+//\r
+\r
+       if (deltax)\r
+       {\r
+               if (deltax==1)\r
+               {\r
+                       RFL_NewRow (1);                 // new right row\r
+                       RFL_OldRow (oldoriginmap,PORTTILESHIGH,mapbyteswide);\r
+                       RFL_RemoveAnimsOnX (originxtile-1);\r
+               }\r
+               else\r
+               {\r
+                       RFL_NewRow (3);                 // new left row\r
+                       RFL_OldRow (oldoriginmap+(PORTTILESWIDE-1)*2,PORTTILESHIGH\r
+                       ,mapbyteswide);\r
+                       RFL_RemoveAnimsOnX (originxtile+PORTTILESWIDE);\r
+               }\r
+\r
+               update0 = updatestart[0]+PORTTILESWIDE;\r
+               update1 = updatestart[1]+PORTTILESWIDE;\r
+               for     (yy=0;yy<PORTTILESHIGH;yy++)\r
+               {\r
+                       *update0 = *update1 = 0;        // drop a 0 at end of each row\r
+                       update0+=UPDATEWIDE;\r
+                       update1+=UPDATEWIDE;\r
+               }\r
+       }\r
+\r
+//----------------\r
+\r
+       if (deltay)\r
+       {\r
+               if (deltay==1)\r
+               {\r
+                       RFL_NewRow (2);                 // new bottom row\r
+                       RFL_OldRow (oldoriginmap,PORTTILESWIDE,2);\r
+                       updatespot = UPDATEWIDE*(PORTTILESHIGH-1);\r
+                       RFL_RemoveAnimsOnY (originytile-1);\r
+               }\r
+               else\r
+               {\r
+                       RFL_NewRow (0);                 // new top row\r
+                       RFL_OldRow (oldoriginmap+mapbwidthtable[PORTTILESHIGH-1]\r
+                       ,PORTTILESWIDE,2);\r
+                       updatespot = 0;\r
+                       RFL_RemoveAnimsOnY (originytile+PORTTILESHIGH);\r
+               }\r
+\r
+               *(updatestart[0]+updatespot+PORTTILESWIDE) =\r
+                       *(updatestart[1]+updatespot+PORTTILESWIDE) = 0;\r
+       }\r
+\r
+//----------------\r
+\r
+       //\r
+       // place a new terminator\r
+       //\r
+       update0 = updatestart[0]+UPDATEWIDE*PORTTILESHIGH-1;\r
+       update1 = updatestart[1]+UPDATEWIDE*PORTTILESHIGH-1;\r
+       *update0++ = *update1++ = 0;\r
+       *(unsigned *)update0 = *(unsigned *)update1 = UPDATETERMINATE;\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_PlaceSprite   EGA\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_PlaceSprite (void **user,unsigned globalx,unsigned globaly,\r
+       unsigned spritenumber, drawtype draw, int priority)\r
+{\r
+       spritelisttype  register *sprite,*next;\r
+       spritetabletype far *spr;\r
+       spritetype /*_seg*/     *block;\r
+       unsigned        shift,pixx;\r
+\r
+       if (!spritenumber)\r
+       {\r
+               RF_RemoveSprite (user);\r
+               return;\r
+       }\r
+\r
+       sprite = (spritelisttype *)*user;\r
+\r
+       if      (sprite)\r
+       {\r
+       // sprite allready exists in the list, so we can use it's block\r
+\r
+       //\r
+       // post an erase block to both pages by copying screenx,screeny,width,height\r
+       // both pages may not need to be erased if the sprite just changed last frame\r
+       //\r
+               if (sprite->updatecount<2)\r
+               {\r
+                       if (!sprite->updatecount)\r
+                               memcpy (eraselistptr[otherpage]++,sprite,sizeof(eraseblocktype));\r
+                       memcpy (eraselistptr[screenpage]++,sprite,sizeof(eraseblocktype));\r
+               }\r
+\r
+               if (priority != sprite->priority)\r
+               {\r
+               // sprite mvoed to another priority, so unlink the old one and\r
+               // relink it in the new priority\r
+\r
+                       next = sprite->nextsprite;                      // cut old links\r
+                       if (next)\r
+                               next->prevptr = sprite->prevptr;\r
+                       *sprite->prevptr = next;\r
+                       goto linknewspot;\r
+               }\r
+       }\r
+       else\r
+       {\r
+       // this is a brand new sprite, so allocate a block from the array\r
+\r
+               if (!spritefreeptr)\r
+                       //Quit ("RF_PlaceSprite: No free spots in spritearray!");\r
+\r
+               sprite = spritefreeptr;\r
+               spritefreeptr = spritefreeptr->nextsprite;\r
+\r
+linknewspot:\r
+               next = prioritystart[priority];         // stick it in new spot\r
+               if (next)\r
+                       next->prevptr = &sprite->nextsprite;\r
+               sprite->nextsprite = next;\r
+               prioritystart[priority] = sprite;\r
+               sprite->prevptr = &prioritystart[priority];\r
+       }\r
+\r
+//\r
+// write the new info to the sprite\r
+//\r
+       spr = &spritetable[spritenumber-STARTSPRITES];\r
+       block = (spritetype /*_seg*/ *)grsegs[spritenumber];\r
+\r
+       globaly+=spr->orgy;\r
+       globalx+=spr->orgx;\r
+\r
+       pixx = globalx >> G_SY_SHIFT;\r
+       shift = (pixx&7)/2;\r
+\r
+       sprite->screenx = pixx >> (G_EGASX_SHIFT-G_SY_SHIFT);\r
+       sprite->screeny = globaly >> G_SY_SHIFT;\r
+       sprite->width = block->width[shift];\r
+       sprite->height = spr->height;\r
+       sprite->grseg = spritenumber;\r
+       sprite->sourceofs = block->sourceoffset[shift];\r
+       sprite->planesize = block->planesize[shift];\r
+       sprite->draw = draw;\r
+       sprite->priority = priority;\r
+       sprite->tilex = sprite->screenx >> SX_T_SHIFT;\r
+       sprite->tiley = sprite->screeny >> SY_T_SHIFT;\r
+       sprite->tilewide = ( (sprite->screenx + sprite->width -1) >> SX_T_SHIFT )\r
+               - sprite->tilex + 1;\r
+       sprite->tilehigh = ( (sprite->screeny + sprite->height -1) >> SY_T_SHIFT )\r
+               - sprite->tiley + 1;\r
+\r
+       sprite->updatecount = 2;                // draw on next two refreshes\r
+\r
+// save the sprite pointer off in the user's pointer so it can be moved\r
+// again later\r
+\r
+       *user = sprite;\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_RemoveSprite  EGA\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_RemoveSprite (void **user)\r
+{\r
+       spritelisttype  *sprite,*next;\r
+\r
+       sprite = (spritelisttype *)*user;\r
+       if (!sprite)\r
+               return;\r
+\r
+//\r
+// post an erase block to both pages by copying screenx,screeny,width,height\r
+// both pages may not need to be erased if the sprite just changed last frame\r
+//\r
+       if (sprite->updatecount<2)\r
+       {\r
+               if (!sprite->updatecount)\r
+                       memcpy (eraselistptr[otherpage]++,sprite,sizeof(eraseblocktype));\r
+               memcpy (eraselistptr[screenpage]++,sprite,sizeof(eraseblocktype));\r
+       }\r
+\r
+//\r
+// unlink the sprite node\r
+//\r
+       next = sprite->nextsprite;\r
+       if (next)                                               // if (!next), sprite is last in chain\r
+               next->prevptr = sprite->prevptr;\r
+       *sprite->prevptr = next;\r
+\r
+//\r
+// add it back to the free list\r
+//\r
+       sprite->nextsprite = spritefreeptr;\r
+       spritefreeptr = sprite;\r
+\r
+//\r
+// null the users pointer, so next time that actor gets placed, it will\r
+// allocate a new block\r
+//\r
+\r
+       *user = 0;\r
+}\r
+\r
+\r
+//===========================================================================\r
+\r
+\r
+/*\r
+====================\r
+=\r
+= RFL_EraseBlocks  EGA\r
+=\r
+= Write mode 1 should be set\r
+=\r
+====================\r
+*/\r
+\r
+void RFL_EraseBlocks (void)\r
+{\r
+       eraseblocktype  *block,*done;\r
+       int                     screenxh,screenyh;\r
+       unsigned        pos,xtl,ytl,xth,yth,x,y;\r
+       byte            *updatespot;\r
+       unsigned        updatedelta;\r
+       unsigned        erasecount;\r
+\r
+#ifdef PROFILE\r
+       erasecount = 0;\r
+#endif\r
+\r
+       block = otherpage ? &eraselist[1][0] : &eraselist[0][0];\r
+\r
+       done = eraselistptr[otherpage];\r
+\r
+       while (block != done)\r
+       {\r
+\r
+       //\r
+       // clip the block to the current screen view\r
+       //\r
+               block->screenx -= originxscreen;\r
+               block->screeny -= originyscreen;\r
+\r
+               if (block->screenx < 0)\r
+               {\r
+                       block->width += block->screenx;\r
+                       if (block->width<1)\r
+                               goto next;\r
+                       block->screenx = 0;\r
+               }\r
+\r
+               if (block->screeny < 0)\r
+               {\r
+                       block->height += block->screeny;\r
+                       if (block->height<1)\r
+                               goto next;\r
+                       block->screeny = 0;\r
+               }\r
+\r
+               screenxh = block->screenx + block->width;\r
+               screenyh = block->screeny + block->height;\r
+\r
+               if (screenxh > EGAPORTSCREENWIDE)\r
+               {\r
+                       block->width = EGAPORTSCREENWIDE-block->screenx;\r
+                       screenxh = block->screenx + block->width;\r
+               }\r
+\r
+               if (screenyh > PORTSCREENHIGH)\r
+               {\r
+                       block->height = PORTSCREENHIGH-block->screeny;\r
+                       screenyh = block->screeny + block->height;\r
+               }\r
+\r
+               if (block->width<1 || block->height<1)\r
+                       goto next;\r
+\r
+       //\r
+       // erase the block by copying from the master screen\r
+       //\r
+               pos = ylookup[block->screeny]+block->screenx;\r
+               VW_ScreenToScreen (masterofs+pos,bufferofs+pos,\r
+                       block->width,block->height);\r
+\r
+       //\r
+       // put 2s in update where the block was, to force sprites to update\r
+       //\r
+               xtl = block->screenx >> SX_T_SHIFT;\r
+               xth = (block->screenx+block->width-1) >> SX_T_SHIFT;\r
+               ytl = block->screeny >> SY_T_SHIFT;\r
+               yth = (block->screeny+block->height-1) >> SY_T_SHIFT;\r
+\r
+               updatespot = updateptr + uwidthtable[ytl] + xtl;\r
+               updatedelta = UPDATEWIDE - (xth-xtl+1);\r
+\r
+               for (y=ytl;y<=yth;y++)\r
+               {\r
+                       for (x=xtl;x<=xth;x++)\r
+                               *updatespot++ = 2;\r
+                       updatespot += updatedelta;              // down to next line\r
+               }\r
+#ifdef PROFILE\r
+               erasecount++;\r
+#endif\r
+\r
+next:\r
+               block++;\r
+       }\r
+       eraselistptr[otherpage] = otherpage ? &eraselist[1][0] : &eraselist[0][0];\r
+#ifdef PROFILE\r
+       strcpy (scratch,"\tErase:");\r
+       itoa (erasecount,str,10);\r
+       strcat (scratch,str);\r
+       write (profilehandle,scratch,strlen(scratch));\r
+#endif\r
+\r
+}\r
+\r
+\r
+/*\r
+====================\r
+=\r
+= RFL_UpdateSprites EGA\r
+=\r
+= NOTE: Implement vertical clipping!\r
+=\r
+====================\r
+*/\r
+\r
+void RFL_UpdateSprites (void)\r
+{\r
+       spritelisttype  *sprite;\r
+       int     portx,porty,x,y,xtl,xth,ytl,yth;\r
+       int     priority;\r
+       unsigned dest;\r
+       byte            *updatespot,*baseupdatespot;\r
+       unsigned        updatedelta;\r
+       unsigned        updatecount;\r
+       unsigned        height,sourceofs;\r
+\r
+#ifdef PROFILE\r
+       updatecount = 0;\r
+#endif\r
+\r
+       for (priority=0;priority<PRIORITIES;priority++)\r
+       {\r
+               if (priority==MASKEDTILEPRIORITY)\r
+                       RFL_MaskForegroundTiles ();\r
+\r
+               for (sprite = prioritystart[priority]; sprite ;\r
+                       sprite = (spritelisttype *)sprite->nextsprite)\r
+               {\r
+               //\r
+               // see if the sprite has any visable area in the port\r
+               //\r
+\r
+                       portx = sprite->screenx - originxscreen;\r
+                       porty = sprite->screeny - originyscreen;\r
+                       xtl = portx >> SX_T_SHIFT;\r
+                       xth = (portx + sprite->width-1) >> SX_T_SHIFT;\r
+                       ytl = porty >> SY_T_SHIFT;\r
+                       yth = (porty + sprite->height-1) >> SY_T_SHIFT;\r
+\r
+                       if (xtl<0)\r
+                         xtl = 0;\r
+                       if (xth>=PORTTILESWIDE)\r
+                         xth = PORTTILESWIDE-1;\r
+                       if (ytl<0)\r
+                         ytl = 0;\r
+                       if (yth>=PORTTILESHIGH)\r
+                         yth = PORTTILESHIGH-1;\r
+\r
+                       if (xtl>xth || ytl>yth)\r
+                               continue;\r
+\r
+               //\r
+               // see if it's visable area covers any non 0 update tiles\r
+               //\r
+                       updatespot = baseupdatespot = updateptr + uwidthtable[ytl] + xtl;\r
+                       updatedelta = UPDATEWIDE - (xth-xtl+1);\r
+\r
+                       if (sprite->updatecount)\r
+                       {\r
+                               sprite->updatecount--;                  // the sprite was just placed,\r
+                               goto redraw;                                    // so draw it for sure\r
+                       }\r
+\r
+                       for (y=ytl;y<=yth;y++)\r
+                       {\r
+                               for (x=xtl;x<=xth;x++)\r
+                                       if (*updatespot++)\r
+                                               goto redraw;\r
+                               updatespot += updatedelta;              // down to next line\r
+                       }\r
+                       continue;                                                       // no need to update\r
+\r
+redraw:\r
+               //\r
+               // set the tiles it covers to 3, because those tiles are being\r
+               // updated\r
+               //\r
+                       updatespot = baseupdatespot;\r
+                       for (y=ytl;y<=yth;y++)\r
+                       {\r
+                               for (x=xtl;x<=xth;x++)\r
+                                       *updatespot++ = 3;\r
+                               updatespot += updatedelta;              // down to next line\r
+                       }\r
+               //\r
+               // draw it!\r
+               //\r
+                       height = sprite->height;\r
+                       sourceofs = sprite->sourceofs;\r
+                       if (porty<0)\r
+                       {\r
+                               height += porty;                                        // clip top off\r
+                               sourceofs -= porty*sprite->width;\r
+                               porty = 0;\r
+                       }\r
+                       else if (porty+height>PORTSCREENHIGH)\r
+                       {\r
+                               height = PORTSCREENHIGH - porty;    // clip bottom off\r
+                       }\r
+\r
+                       dest = bufferofs + ylookup[porty] + portx;\r
+\r
+                       switch (sprite->draw)\r
+                       {\r
+                       case spritedraw:\r
+                               VW_MaskBlock(grsegs[sprite->grseg], sourceofs,\r
+                                       dest,sprite->width,height,sprite->planesize);\r
+                               break;\r
+\r
+                       case maskdraw:\r
+                               break;\r
+\r
+                       }\r
+#ifdef PROFILE\r
+                       updatecount++;\r
+#endif\r
+\r
+\r
+               }\r
+       }\r
+#ifdef PROFILE\r
+       strcpy (scratch,"\tSprites:");\r
+       itoa (updatecount,str,10);\r
+       strcat (scratch,str);\r
+       write (profilehandle,scratch,strlen(scratch));\r
+#endif\r
+\r
+}\r
+\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_Refresh   EGA\r
+=\r
+= All routines will draw at the port at bufferofs, possibly copying from\r
+= the port at masterofs.  The EGA version then page flips, while the\r
+= CGA version updates the screen from the buffer port.\r
+=\r
+= Screenpage is the currently displayed page, not the one being drawn\r
+= Otherpage is the page to be worked with now\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_Refresh (void)\r
+{\r
+       byte    *newupdate;\r
+       long    newtime;\r
+\r
+       updateptr = updatestart[otherpage];\r
+\r
+       RFL_AnimateTiles ();            // DEBUG\r
+\r
+//\r
+// update newly scrolled on tiles and animated tiles from the master screen\r
+//\r
+       EGAWRITEMODE(1);\r
+       EGAMAPMASK(15);\r
+       RFL_UpdateTiles ();\r
+       RFL_EraseBlocks ();\r
+\r
+//\r
+// Update is all 0 except where sprites have changed or new area has\r
+// been scrolled on.  Go through all sprites and update the ones that cover\r
+// a non 0 update tile\r
+//\r
+       EGAWRITEMODE(0);\r
+       RFL_UpdateSprites ();\r
+\r
+//\r
+// if the main program has a refresh hook set, call their function before\r
+// displaying the new page\r
+//\r
+       if (refreshvector)\r
+               refreshvector();\r
+\r
+//\r
+// display the changed screen\r
+//\r
+       VW_SetScreen(bufferofs+panadjust,panx & xpanmask);\r
+\r
+//\r
+// prepare for next refresh\r
+//\r
+// Set the update array to the middle position and clear it out to all "0"s\r
+// with an UPDATETERMINATE at the end\r
+//\r
+       updatestart[otherpage] = newupdate = baseupdatestart[otherpage];\r
+asm    mov     ax,ds\r
+asm    mov     es,ax\r
+asm    xor     ax,ax\r
+asm    mov     cx,(UPDATESCREENSIZE-2)/2\r
+asm    mov     di,[newupdate]\r
+asm    rep     stosw\r
+asm    mov     [WORD PTR es:di],UPDATETERMINATE\r
+\r
+       screenpage ^= 1;\r
+       otherpage ^= 1;\r
+       bufferofs = screenstart[otherpage];\r
+       displayofs = screenstart[screenpage];\r
+\r
+//\r
+// calculate tics since last refresh for adaptive timing\r
+//\r
+       if (lasttimecount > TimeCount)\r
+               lasttimecount = TimeCount;              // if the game was paused a LONG time\r
+       do\r
+       {\r
+               newtime = TimeCount;\r
+               tics = newtime-lasttimecount;\r
+       } while (tics<MINTICS);\r
+       lasttimecount = newtime;\r
+\r
+#ifdef PROFILE\r
+       strcpy (scratch,"\tTics:");\r
+       itoa (tics,str,10);\r
+       strcat (scratch,str);\r
+       strcat (scratch,"\n");\r
+       write (profilehandle,scratch,strlen(scratch));\r
+#endif\r
+\r
+       if (tics>MAXTICS)\r
+       {\r
+               TimeCount -= (tics-MAXTICS);\r
+               tics = MAXTICS;\r
+       }\r
+}\r
+\r
+#endif         // GRMODE == EGAGR\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                       CGA specific routines\r
+\r
+=============================================================================\r
+*/\r
+\r
+#if GRMODE == CGAGR\r
+\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_NewPosition   CGA\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_NewPosition (unsigned x, unsigned y)\r
+{\r
+       int mx,my;\r
+       byte    *spotptr;\r
+       unsigned        updatenum;\r
+\r
+//\r
+// calculate new origin related globals\r
+//\r
+       RFL_CalcOriginStuff (x,y);\r
+\r
+//\r
+// clear out all animating tiles\r
+//\r
+       RFL_InitAnimList ();\r
+\r
+//\r
+// set up the new update arrays at base position\r
+//\r
+       updateptr = baseupdateptr;\r
+\r
+       spotptr = updateptr + PORTTILESWIDE;    // used to stick "0"s after rows\r
+\r
+       updatenum = 0;                          // start at first visable tile\r
+\r
+       for (my=0;my<PORTTILESHIGH;my++)\r
+       {\r
+               for (mx=0;mx<PORTTILESWIDE;mx++)\r
+               {\r
+                       RFL_NewTile(updatenum);                 // puts "1"s in both pages\r
+                       RFL_CheckForAnimTile(mx+originxtile,my+originytile);\r
+                       updatenum++;\r
+               }\r
+               updatenum++;\r
+               *spotptr = 0; // set a 0 at end of a line of tiles\r
+               spotptr +=(PORTTILESWIDE+1);\r
+       }\r
+       *(word *)(spotptr-PORTTILESWIDE) = UPDATETERMINATE;\r
+}\r
+\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_Scroll       CGA\r
+=\r
+= Move the origin x/y global coordinates, readjust the screen panning, and\r
+= scroll if needed.  If the scroll distance is greater than one tile, the\r
+= entire screen will be redrawn (this could be generalized, but scrolling\r
+= more than one tile per refresh is a bad idea!).\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_Scroll (int x, int y)\r
+{\r
+       long            neworgx,neworgy;\r
+       int                     i,deltax,deltay,absdx,absdy;\r
+       int                     oldxt,oldyt,move,yy;\r
+       unsigned        updatespot;\r
+       byte            *spotptr;\r
+       unsigned        oldoriginmap,oldscreen,newscreen,screencopy;\r
+       int                     screenmove;\r
+\r
+       oldxt = originxtile;\r
+       oldyt = originytile;\r
+\r
+       RFL_CalcOriginStuff ((long)originxglobal + x,(long)originyglobal + y);\r
+\r
+       deltax = originxtile - oldxt;\r
+       absdx = abs(deltax);\r
+       deltay = originytile - oldyt;\r
+       absdy = abs(deltay);\r
+\r
+       if (absdx>1 || absdy>1)\r
+       {\r
+       //\r
+       // scrolled more than one tile, so start from scratch\r
+       //\r
+               RF_NewPosition(originxglobal,originyglobal);\r
+               return;\r
+       }\r
+\r
+       if (!absdx && !absdy)\r
+               return;                                 // the screen has not scrolled an entire tile\r
+\r
+\r
+//\r
+// float screens\r
+//\r
+       screenmove = deltay*16*SCREENWIDTH + deltax*TILEWIDTH;\r
+       bufferofs += screenmove;\r
+       masterofs += screenmove;\r
+\r
+\r
+//\r
+// float the update regions\r
+//\r
+       move = deltax;\r
+       if (deltay==1)\r
+         move += UPDATEWIDE;\r
+       else if (deltay==-1)\r
+         move -= UPDATEWIDE;\r
+\r
+       updateptr+=move;\r
+\r
+//\r
+// draw the new tiles just scrolled on to the master screen, and\r
+// mark them as needing to be copied to each screen next refreshes\r
+// Make sure a zero is at the end of each row in update\r
+//\r
+\r
+       if (deltax)\r
+       {\r
+               if (deltax==1)\r
+               {\r
+                       RFL_NewRow (1);                 // new right row\r
+                       RFL_RemoveAnimsOnX (originxtile-1);\r
+               }\r
+               else\r
+               {\r
+                       RFL_NewRow (3);                 // new left row\r
+                       RFL_RemoveAnimsOnX (originxtile+PORTTILESWIDE);\r
+               }\r
+\r
+               spotptr = updateptr+PORTTILESWIDE;\r
+               for     (yy=0;yy<PORTTILESHIGH;yy++)\r
+               {\r
+                       *spotptr = 0;           // drop a 0 at end of each row\r
+                       spotptr+=UPDATEWIDE;\r
+               }\r
+       }\r
+\r
+//----------------\r
+\r
+       if (deltay)\r
+       {\r
+               if (deltay==1)\r
+               {\r
+                       RFL_NewRow (2);                 // new bottom row\r
+                       *(updateptr+UPDATEWIDE*(PORTTILESHIGH-1)+PORTTILESWIDE) = 0;\r
+                       RFL_RemoveAnimsOnY (originytile-1);\r
+               }\r
+               else\r
+               {\r
+                       RFL_NewRow (0);                 // new top row\r
+                       *(updateptr+PORTTILESWIDE) = 0;\r
+                       RFL_RemoveAnimsOnY (originytile+PORTTILESHIGH);\r
+               }\r
+       }\r
+\r
+//----------------\r
+\r
+       //\r
+       // place a new terminator\r
+       //\r
+       spotptr = updateptr+UPDATEWIDE*PORTTILESHIGH-1;\r
+       *spotptr++ = 0;\r
+       *(unsigned *)spotptr = UPDATETERMINATE;\r
+}\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_PlaceSprite  CGA\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_PlaceSprite (void **user,unsigned globalx,unsigned globaly,\r
+       unsigned spritenumber, drawtype draw, int priority)\r
+{\r
+       spritelisttype  register *sprite,*next;\r
+       spritetabletype far *spr;\r
+       spritetype /*_seg*/     *block;\r
+       unsigned        shift,pixx;\r
+\r
+       if (!spritenumber)\r
+       {\r
+               RF_RemoveSprite (user);\r
+               return;\r
+       }\r
+\r
+       sprite = (spritelisttype *)*user;\r
+\r
+       if      (sprite)\r
+       {\r
+       // sprite allready exists in the list, so we can use it's block\r
+\r
+       //\r
+       // post an erase block to erase the old position by copying\r
+       // screenx,screeny,width,height\r
+       //\r
+               if (!sprite->updatecount)               // may not have been drawn at all yet\r
+                       memcpy (eraselistptr[0]++,sprite,sizeof(eraseblocktype));\r
+\r
+               if (priority != sprite->priority)\r
+               {\r
+               // sprite moved to another priority, so unlink the old one and\r
+               // relink it in the new priority\r
+\r
+                       next = sprite->nextsprite;                      // cut old links\r
+                       if (next)\r
+                               next->prevptr = sprite->prevptr;\r
+                       *sprite->prevptr = next;\r
+                       goto linknewspot;\r
+               }\r
+       }\r
+       else\r
+       {\r
+       // this is a brand new sprite, so allocate a block from the array\r
+\r
+               if (!spritefreeptr)\r
+                       //Quit ("RF_PlaceSprite: No free spots in spritearray!");\r
+\r
+               sprite = spritefreeptr;\r
+               spritefreeptr = spritefreeptr->nextsprite;\r
+\r
+linknewspot:\r
+               next = prioritystart[priority];         // stick it in new spot\r
+               if (next)\r
+                       next->prevptr = &sprite->nextsprite;\r
+               sprite->nextsprite = next;\r
+               prioritystart[priority] = sprite;\r
+               sprite->prevptr = &prioritystart[priority];\r
+       }\r
+\r
+//\r
+// write the new info to the sprite\r
+//\r
+       spr = &spritetable[spritenumber-STARTSPRITES];\r
+       block = (spritetype /*_seg*/ *)grsegs[spritenumber];\r
+\r
+       globaly+=spr->orgy;\r
+       globalx+=spr->orgx;\r
+\r
+       sprite->screenx = globalx >> G_CGASX_SHIFT;\r
+       sprite->screeny = globaly >> G_SY_SHIFT;\r
+       sprite->width = block->width[0];\r
+       sprite->height = spr->height;\r
+       sprite->grseg = spritenumber;\r
+       sprite->sourceofs = block->sourceoffset[0];\r
+       sprite->planesize = block->planesize[0];\r
+       sprite->draw = draw;\r
+       sprite->priority = priority;\r
+       sprite->tilex = sprite->screenx >> SX_T_SHIFT;\r
+       sprite->tiley = sprite->screeny >> SY_T_SHIFT;\r
+       sprite->tilewide = ( (sprite->screenx + sprite->width -1) >> SX_T_SHIFT )\r
+               - sprite->tilex + 1;\r
+       sprite->tilehigh = ( (sprite->screeny + sprite->height -1) >> SY_T_SHIFT )\r
+               - sprite->tiley + 1;\r
+\r
+       sprite->updatecount = 1;                // draw on next refresh\r
+\r
+// save the sprite pointer off in the user's pointer so it can be moved\r
+// again later\r
+\r
+       *user = sprite;\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_RemoveSprite CGA\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_RemoveSprite (void **user)\r
+{\r
+       spritelisttype  *sprite,*next;\r
+\r
+       sprite = (spritelisttype *)*user;\r
+       if (!sprite)\r
+               return;\r
+\r
+//\r
+// post an erase block to erase the old position by copying\r
+// screenx,screeny,width,height\r
+//\r
+       if (!sprite->updatecount)\r
+       {\r
+               memcpy (eraselistptr[0]++,sprite,sizeof(eraseblocktype));\r
+       }\r
+\r
+//\r
+// unlink the sprite node\r
+//\r
+       next = sprite->nextsprite;\r
+       if (next)                                               // if (!next), sprite is last in chain\r
+               next->prevptr = sprite->prevptr;\r
+       *sprite->prevptr = next;\r
+\r
+//\r
+// add it back to the free list\r
+//\r
+       sprite->nextsprite = spritefreeptr;\r
+       spritefreeptr = sprite;\r
+\r
+//\r
+// null the users pointer, so next time that actor gets placed, it will\r
+// allocate a new block\r
+//\r
+\r
+       *user = 0;\r
+}\r
+\r
+\r
+/*\r
+====================\r
+=\r
+= RFL_EraseBlocks CGA\r
+=\r
+= Write mode 1 should be set\r
+=\r
+====================\r
+*/\r
+\r
+void RFL_EraseBlocks (void)\r
+{\r
+       eraseblocktype  *block,*done;\r
+       int                     screenxh,screenyh;\r
+       unsigned        pos,xtl,ytl,xth,yth,x,y;\r
+       byte            *updatespot;\r
+       unsigned        updatedelta;\r
+\r
+       block = &eraselist[0][0];\r
+\r
+       done = eraselistptr[0];\r
+\r
+       while (block != done)\r
+       {\r
+\r
+       //\r
+       // clip the block to the current screen view\r
+       //\r
+               block->screenx -= originxscreen;\r
+               block->screeny -= originyscreen;\r
+\r
+               if (block->screenx < 0)\r
+               {\r
+                       block->width += block->screenx;\r
+                       if (block->width<1)\r
+                               goto next;\r
+                       block->screenx = 0;\r
+               }\r
+\r
+               if (block->screeny < 0)\r
+               {\r
+                       block->height += block->screeny;\r
+                       if (block->height<1)\r
+                               goto next;\r
+                       block->screeny = 0;\r
+               }\r
+\r
+               screenxh = block->screenx + block->width;\r
+               screenyh = block->screeny + block->height;\r
+\r
+               if (screenxh > CGAPORTSCREENWIDE)\r
+               {\r
+                       block->width = CGAPORTSCREENWIDE-block->screenx;\r
+                       screenxh = block->screenx + block->width;\r
+               }\r
+\r
+               if (screenyh > PORTSCREENHIGH)\r
+               {\r
+                       block->height = PORTSCREENHIGH-block->screeny;\r
+                       screenyh = block->screeny + block->height;\r
+               }\r
+\r
+               if (block->width<1 || block->height<1)\r
+                       goto next;\r
+\r
+       //\r
+       // erase the block by copying from the master screen\r
+       //\r
+               pos = ylookup[block->screeny]+block->screenx;\r
+               block->width = (block->width + (pos&1) + 1)& ~1;\r
+               pos &= ~1;                              // make sure a word copy gets used\r
+               VW_ScreenToScreen (masterofs+pos,bufferofs+pos,\r
+                       block->width,block->height);\r
+\r
+       //\r
+       // put 2s in update where the block was, to force sprites to update\r
+       //\r
+               xtl = block->screenx >> SX_T_SHIFT;\r
+               xth = (block->screenx+block->width-1) >> SX_T_SHIFT;\r
+               ytl = block->screeny >> SY_T_SHIFT;\r
+               yth = (block->screeny+block->height-1) >> SY_T_SHIFT;\r
+\r
+               updatespot = updateptr + uwidthtable[ytl] + xtl;\r
+               updatedelta = UPDATEWIDE - (xth-xtl+1);\r
+\r
+               for (y=ytl;y<=yth;y++)\r
+               {\r
+                       for (x=xtl;x<=xth;x++)\r
+                               *updatespot++ = 2;\r
+                       updatespot += updatedelta;              // down to next line\r
+               }\r
+\r
+next:\r
+               block++;\r
+       }\r
+       eraselistptr[0] = &eraselist[0][0];\r
+}\r
+\r
+\r
+/*\r
+====================\r
+=\r
+= RFL_UpdateSprites      CGA\r
+=\r
+= NOTE: Implement vertical clipping!\r
+=\r
+====================\r
+*/\r
+\r
+void RFL_UpdateSprites (void)\r
+{\r
+       spritelisttype  *sprite;\r
+       int     portx,porty,x,y,xtl,xth,ytl,yth;\r
+       int     priority;\r
+       unsigned dest;\r
+       byte            *updatespot,*baseupdatespot;\r
+       unsigned        updatedelta;\r
+\r
+       unsigned        updatecount;\r
+       unsigned        height,sourceofs;\r
+\r
+#ifdef PROFILE\r
+       updatecount = 0;\r
+#endif\r
+\r
+\r
+       for (priority=0;priority<PRIORITIES;priority++)\r
+       {\r
+               if (priority==MASKEDTILEPRIORITY)\r
+                       RFL_MaskForegroundTiles ();\r
+\r
+               for (sprite = prioritystart[priority]; sprite ;\r
+                       sprite = (spritelisttype *)sprite->nextsprite)\r
+               {\r
+               //\r
+               // see if the sprite has any visable area in the port\r
+               //\r
+\r
+                       portx = sprite->screenx - originxscreen;\r
+                       porty = sprite->screeny - originyscreen;\r
+                       xtl = portx >> SX_T_SHIFT;\r
+                       xth = (portx + sprite->width-1) >> SX_T_SHIFT;\r
+                       ytl = porty >> SY_T_SHIFT;\r
+                       yth = (porty + sprite->height-1) >> SY_T_SHIFT;\r
+\r
+                       if (xtl<0)\r
+                         xtl = 0;\r
+                       if (xth>=PORTTILESWIDE)\r
+                         xth = PORTTILESWIDE-1;\r
+                       if (ytl<0)\r
+                         ytl = 0;\r
+                       if (yth>=PORTTILESHIGH)\r
+                         yth = PORTTILESHIGH-1;\r
+\r
+                       if (xtl>xth || ytl>yth)\r
+                               continue;\r
+\r
+               //\r
+               // see if it's visable area covers any non 0 update tiles\r
+               //\r
+                       updatespot = baseupdatespot = updateptr + uwidthtable[ytl] + xtl;\r
+                       updatedelta = UPDATEWIDE - (xth-xtl+1);\r
+\r
+                       if (sprite->updatecount)\r
+                       {\r
+                               sprite->updatecount--;                  // the sprite was just placed,\r
+                               goto redraw;                                    // so draw it for sure\r
+                       }\r
+\r
+                       for (y=ytl;y<=yth;y++)\r
+                       {\r
+                               for (x=xtl;x<=xth;x++)\r
+                                       if (*updatespot++)\r
+                                               goto redraw;\r
+                               updatespot += updatedelta;              // down to next line\r
+                       }\r
+                       continue;                                                       // no need to update\r
+\r
+redraw:\r
+               //\r
+               // set the tiles it covers to 3, because those tiles are being\r
+               // updated\r
+               //\r
+                       updatespot = baseupdatespot;\r
+                       for (y=ytl;y<=yth;y++)\r
+                       {\r
+                               for (x=xtl;x<=xth;x++)\r
+                                       *updatespot++ = 3;\r
+                               updatespot += updatedelta;              // down to next line\r
+                       }\r
+               //\r
+               // draw it!\r
+               //\r
+                       height = sprite->height;\r
+                       sourceofs = sprite->sourceofs;\r
+                       if (porty<0)\r
+                       {\r
+                               height += porty;                                        // clip top off\r
+                               sourceofs -= porty*sprite->width;\r
+                               porty = 0;\r
+                       }\r
+                       else if (porty+height>PORTSCREENHIGH)\r
+                       {\r
+                               height = PORTSCREENHIGH - porty;    // clip bottom off\r
+                       }\r
+\r
+                       dest = bufferofs + ylookup[porty] + portx;\r
+\r
+                       switch (sprite->draw)\r
+                       {\r
+                       case spritedraw:\r
+                               VW_MaskBlock(grsegs[sprite->grseg], sourceofs,\r
+                                       dest,sprite->width,height,sprite->planesize);\r
+                               break;\r
+\r
+                       case maskdraw:\r
+                               break;\r
+\r
+                       }\r
+#ifdef PROFILE\r
+                       updatecount++;\r
+#endif\r
+\r
+\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*\r
+=====================\r
+=\r
+= RF_Refresh        CGA\r
+=\r
+= All routines will draw at the port at bufferofs, possibly copying from\r
+= the port at masterofs.  The EGA version then page flips, while the\r
+= CGA version updates the screen from the buffer port.\r
+=\r
+= Screenpage is the currently displayed page, not the one being drawn\r
+= Otherpage is the page to be worked with now\r
+=\r
+=====================\r
+*/\r
+\r
+void RF_Refresh (void)\r
+{\r
+       long newtime;\r
+\r
+       RFL_AnimateTiles ();\r
+\r
+//\r
+// update newly scrolled on tiles and animated tiles from the master screen\r
+//\r
+       RFL_UpdateTiles ();\r
+       RFL_EraseBlocks ();\r
+\r
+//\r
+// Update is all 0 except where sprites have changed or new area has\r
+// been scrolled on.  Go through all sprites and update the ones that cover\r
+// a non 0 update tile\r
+//\r
+       RFL_UpdateSprites ();\r
+\r
+//\r
+// if the main program has a refresh hook set, call their function before\r
+// displaying the new page\r
+//\r
+       if (refreshvector)\r
+               refreshvector();\r
+\r
+//\r
+// update everything to the screen\r
+//\r
+       VW_CGAFullUpdate ();\r
+\r
+//\r
+// calculate tics since last refresh for adaptive timing\r
+//\r
+       if (lasttimecount > TimeCount)\r
+               lasttimecount = TimeCount;              // if the game was paused a LONG time\r
+       do\r
+       {\r
+               newtime = TimeCount;\r
+               tics = newtime-lasttimecount;\r
+       } while (tics<MINTICS);\r
+       lasttimecount = newtime;\r
+\r
+#ifdef PROFILE\r
+       itoa (tics,str,10);\r
+       strcat (str,"\t");\r
+       ltoa (TimeCount,str2,10);\r
+       strcat (str,str2);\r
+       strcat (str,"\t");\r
+       ltoa (LocalTime,str2,10);\r
+       strcat (str,str2);\r
+       strcat (str,"\n");\r
+       write (profile,str,strlen(str));\r
+#endif\r
+       if (tics>MAXTICS)\r
+               tics = MAXTICS;\r
+\r
+}\r
+\r
+#endif         // GRMODE == CGAGR\r
+//===============================\r
+/*\r
+; Keen Dreams Source Code\r
+; Copyright (C) 2014 Javier M. Chavez\r
+;\r
+; This program is free software; you can redistribute it and/or modify\r
+; it under the terms of the GNU General Public License as published by\r
+; the Free Software Foundation; either version 2 of the License, or\r
+; (at your option) any later version.\r
+;\r
+; This program is distributed in the hope that it will be useful,\r
+; but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+; GNU General Public License for more details.\r
+;\r
+; You should have received a copy of the GNU General Public License along\r
+; with this program; if not, write to the Free Software Foundation, Inc.,\r
+; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+\r
+; ID_RF_A.ASM\r
+\r
+IDEAL\r
+MODEL  MEDIUM,C\r
+\r
+INCLUDE        "ID_ASM.EQU"\r
+\r
+CACHETILES     = 1             ;enable master screen tile caching\r
+\r
+;============================================================================\r
+\r
+TILESWIDE      =       21\r
+TILESHIGH      =       14\r
+\r
+UPDATESIZE     =       (TILESWIDE+1)*TILESHIGH+1\r
+\r
+DATASEG\r
+\r
+EXTRN  screenseg:WORD\r
+EXTRN  updateptr:WORD\r
+EXTRN  updatestart:WORD\r
+EXTRN  masterofs:WORD          ;start of master tile port\r
+EXTRN  bufferofs:WORD          ;start of current buffer port\r
+EXTRN  screenstart:WORD        ;starts of three screens (0/1/master) in EGA mem\r
+EXTRN  grsegs:WORD\r
+EXTRN  mapsegs:WORD\r
+EXTRN  originmap:WORD\r
+EXTRN  updatemapofs:WORD\r
+EXTRN  tilecache:WORD\r
+EXTRN  tinf:WORD                       ;seg pointer to map header and tile info\r
+EXTRN  blockstarts:WORD        ;offsets from bufferofs for each update block\r
+\r
+planemask      db      ?\r
+planenum       db      ?\r
+\r
+CODESEG\r
+\r
+screenstartcs  dw      ?               ;in code segment for accesability\r
+\r
+\r
+\r
+\r
+IFE GRMODE-CGAGR\r
+;============================================================================\r
+;\r
+; CGA refresh routines\r
+;\r
+;============================================================================\r
+\r
+TILEWIDTH      =       4\r
+\r
+;=================\r
+;\r
+; RFL_NewTile\r
+;\r
+; Draws a composit two plane tile to the master screen and sets the update\r
+; spot to 1 in both update pages, forcing the tile to be copied to the\r
+; view pages the next two refreshes\r
+;\r
+; Called to draw newlly scrolled on strips and animating tiles\r
+;\r
+;=================\r
+\r
+PROC   RFL_NewTile     updateoffset:WORD\r
+PUBLIC RFL_NewTile\r
+USES   SI,DI\r
+\r
+;\r
+; mark both update lists at this spot\r
+;\r
+       mov     di,[updateoffset]\r
+\r
+       mov     bx,[updateptr]                  ;start of update matrix\r
+       mov     [BYTE bx+di],1\r
+\r
+       mov     dx,SCREENWIDTH-TILEWIDTH                ;add to get to start of next line\r
+\r
+;\r
+; set di to the location in screenseg to draw the tile\r
+;\r
+       shl     di,1\r
+       mov     si,[updatemapofs+di]    ;offset in map from origin\r
+       add     si,[originmap]\r
+       mov     di,[blockstarts+di]             ;screen location for tile\r
+       add     di,[masterofs]\r
+\r
+;\r
+; set BX to the foreground tile number and SI to the background number\r
+; If either BX or SI = 0xFFFF, the tile does not need to be masked together\r
+; as one of the planes totally eclipses the other\r
+;\r
+       mov     es,[mapsegs+2]                  ;foreground plane\r
+       mov     bx,[es:si]\r
+       mov     es,[mapsegs]                    ;background plane\r
+       mov     si,[es:si]\r
+\r
+       mov     es,[screenseg]\r
+\r
+       or      bx,bx\r
+       jz      @@singletile\r
+       jmp     @@maskeddraw                    ;draw both together\r
+\r
+;=============\r
+;\r
+; Draw single background tile from main memory\r
+;\r
+;=============\r
+\r
+@@singletile:\r
+       shl     si,1\r
+       mov     ds,[grsegs+STARTTILE16*2+si]\r
+\r
+       xor     si,si                                   ;block is segment aligned\r
+\r
+REPT   15\r
+       movsw\r
+       movsw\r
+       add     di,dx\r
+ENDM\r
+       movsw\r
+       movsw\r
+\r
+       mov     ax,ss\r
+       mov     ds,ax                                   ;restore turbo's data segment\r
+       ret\r
+\r
+\r
+;=========\r
+;\r
+; Draw a masked tile combo\r
+; Interupts are disabled and the stack segment is reassigned\r
+;\r
+;=========\r
+@@maskeddraw:\r
+       cli                                                     ; don't allow ints when SS is set\r
+       shl     bx,1\r
+       mov     ss,[grsegs+STARTTILE16M*2+bx]\r
+       shl     si,1\r
+       mov     ds,[grsegs+STARTTILE16*2+si]\r
+\r
+       xor     si,si                                   ;first word of tile data\r
+\r
+REPT   16\r
+       mov     ax,[si]                                 ;background tile\r
+       and     ax,[ss:si]                              ;mask\r
+       or      ax,[ss:si+64]                   ;masked data\r
+       stosw\r
+       mov     ax,[si+2]                               ;background tile\r
+       and     ax,[ss:si+2]                    ;mask\r
+       or      ax,[ss:si+66]                   ;masked data\r
+       stosw\r
+       add     si,4\r
+       add     di,dx\r
+ENDM\r
+\r
+       mov     ax,@DATA\r
+       mov     ss,ax\r
+       sti\r
+       mov     ds,ax\r
+       ret\r
+ENDP\r
+\r
+ENDIF\r
+\r
+\r
+\r
+IFE GRMODE-EGAGR\r
+;===========================================================================\r
+;\r
+; EGA refresh routines\r
+;\r
+;===========================================================================\r
+\r
+TILEWIDTH      =       2\r
+\r
+;=================\r
+;\r
+; RFL_NewTile\r
+;\r
+; Draws a composit two plane tile to the master screen and sets the update\r
+; spot to 1 in both update pages, forcing the tile to be copied to the\r
+; view pages the next two refreshes\r
+;\r
+; Called to draw newlly scrolled on strips and animating tiles\r
+;\r
+; Assumes write mode 0\r
+;\r
+;=================\r
+\r
+PROC   RFL_NewTile     updateoffset:WORD\r
+PUBLIC RFL_NewTile\r
+USES   SI,DI\r
+\r
+;\r
+; mark both update lists at this spot\r
+;\r
+       mov     di,[updateoffset]\r
+\r
+       mov     bx,[updatestart]                ;page 0 pointer\r
+       mov     [BYTE bx+di],1\r
+       mov     bx,[updatestart+2]              ;page 1 pointer\r
+       mov     [BYTE bx+di],1\r
+\r
+;\r
+; set screenstartcs to the location in screenseg to draw the tile\r
+;\r
+       shl     di,1\r
+       mov     si,[updatemapofs+di]    ;offset in map from origin\r
+       add     si,[originmap]\r
+       mov     di,[blockstarts+di]             ;screen location for tile\r
+       add     di,[masterofs]\r
+       mov     [cs:screenstartcs],di\r
+\r
+;\r
+; set BX to the foreground tile number and SI to the background number\r
+; If either BX or SI = 0xFFFF, the tile does not need to be masked together\r
+; as one of the planes totally eclipses the other\r
+;\r
+       mov     es,[mapsegs+2]                  ;foreground plane\r
+       mov     bx,[es:si]\r
+       mov     es,[mapsegs]                    ;background plane\r
+       mov     si,[es:si]\r
+\r
+       mov     es,[screenseg]\r
+       mov     dx,SC_INDEX                             ;for stepping through map mask planes\r
+\r
+       or      bx,bx\r
+       jz      @@singletile\r
+       jmp     @@maskeddraw                    ;draw both together\r
+\r
+;=========\r
+;\r
+; No foreground tile, so draw a single background tile.\r
+; Use the master screen cache if possible\r
+;\r
+;=========\r
+@@singletile:\r
+\r
+       mov     bx,SCREENWIDTH-2                ;add to get to start of next line\r
+       shl     si,1\r
+\r
+IFE CACHETILES\r
+       jmp     @@singlemain\r
+ENDIF\r
+\r
+       mov     ax,[tilecache+si]\r
+       or      ax,ax\r
+       jz      @@singlemain\r
+;=============\r
+;\r
+; Draw single tile from cache\r
+;\r
+;=============\r
+\r
+       mov     si,ax\r
+\r
+       mov     ax,SC_MAPMASK + 15*256  ;all planes\r
+       WORDOUT\r
+\r
+       mov     dx,GC_INDEX\r
+       mov     ax,GC_MODE + 1*256              ;write mode 1\r
+       WORDOUT\r
+\r
+       mov     di,[cs:screenstartcs]\r
+       mov     ds,[screenseg]\r
+\r
+REPT   15\r
+       movsb\r
+       movsb\r
+       add     si,bx\r
+       add     di,bx\r
+ENDM\r
+       movsb\r
+       movsb\r
+\r
+       xor     ah,ah                                   ;write mode 0\r
+       WORDOUT\r
+\r
+       mov     ax,ss\r
+       mov     ds,ax                                   ;restore turbo's data segment\r
+       ret\r
+\r
+;=============\r
+;\r
+; Draw single tile from main memory\r
+;\r
+;=============\r
+\r
+@@singlemain:\r
+       mov     ax,[cs:screenstartcs]\r
+       mov     [tilecache+si],ax               ;next time it can be drawn from here with latch\r
+       mov     ds,[grsegs+STARTTILE16*2+si]\r
+\r
+       xor     si,si                                   ;block is segment aligned\r
+\r
+       mov     ax,SC_MAPMASK+0001b*256 ;map mask for plane 0\r
+\r
+       mov     cx,4                                    ;draw four planes\r
+@@planeloop:\r
+       mov     dx,SC_INDEX\r
+       WORDOUT\r
+\r
+       mov     di,[cs:screenstartcs]   ;start at same place in all planes\r
+\r
+REPT   15\r
+       movsw\r
+       add     di,bx\r
+ENDM\r
+       movsw\r
+\r
+       shl     ah,1                                    ;shift plane mask over for next plane\r
+       loop    @@planeloop\r
+\r
+       mov     ax,ss\r
+       mov     ds,ax                                   ;restore turbo's data segment\r
+       ret\r
+\r
+\r
+;=========\r
+;\r
+; Draw a masked tile combo\r
+; Interupts are disabled and the stack segment is reassigned\r
+;\r
+;=========\r
+@@maskeddraw:\r
+       cli                                                     ; don't allow ints when SS is set\r
+       shl     bx,1\r
+       mov     ss,[grsegs+STARTTILE16M*2+bx]\r
+       shl     si,1\r
+       mov     ds,[grsegs+STARTTILE16*2+si]\r
+\r
+       xor     si,si                                   ;first word of tile data\r
+\r
+       mov     ax,SC_MAPMASK+0001b*256 ;map mask for plane 0\r
+\r
+       mov     di,[cs:screenstartcs]\r
+@@planeloopm:\r
+       WORDOUT\r
+tileofs                =       0\r
+lineoffset     =       0\r
+REPT   16\r
+       mov     bx,[si+tileofs]                 ;background tile\r
+       and     bx,[ss:tileofs]                 ;mask\r
+       or      bx,[ss:si+tileofs+32]   ;masked data\r
+       mov     [es:di+lineoffset],bx\r
+tileofs                =       tileofs + 2\r
+lineoffset     =       lineoffset + SCREENWIDTH\r
+ENDM\r
+       add     si,32\r
+       shl     ah,1                                    ;shift plane mask over for next plane\r
+       cmp     ah,10000b\r
+       je      @@done                                  ;drawn all four planes\r
+       jmp     @@planeloopm\r
+\r
+@@done:\r
+       mov     ax,@DATA\r
+       mov     ss,ax\r
+       sti\r
+       mov     ds,ax\r
+       ret\r
+ENDP\r
+\r
+ENDIF\r
+\r
+IFE GRMODE-VGAGR\r
+;============================================================================\r
+;\r
+; VGA refresh routines\r
+;\r
+;============================================================================\r
+\r
+\r
+ENDIF\r
+\r
+\r
+;============================================================================\r
+;\r
+; reasonably common refresh routines\r
+;\r
+;============================================================================\r
+\r
+\r
+;=================\r
+;\r
+; RFL_UpdateTiles\r
+;\r
+; Scans through the update matrix pointed to by updateptr, looking for 1s.\r
+; A 1 represents a tile that needs to be copied from the master screen to the\r
+; current screen (a new row or an animated tiled).  If more than one adjacent\r
+; tile in a horizontal row needs to be copied, they will be copied as a group.\r
+;\r
+; Assumes write mode 1\r
+;\r
+;=================\r
+\r
+\r
+; AX   0/1 for scasb, temp for segment register transfers\r
+; BX    width for block copies\r
+; CX   REP counter\r
+; DX   line width deltas\r
+; SI   source for copies\r
+; DI   scas dest / movsb dest\r
+; BP   pointer to UPDATETERMINATE\r
+;\r
+; DS\r
+; ES\r
+; SS\r
+\r
+PROC   RFL_UpdateTiles\r
+PUBLIC RFL_UpdateTiles\r
+USES   SI,DI,BP\r
+\r
+       jmp     SHORT @@realstart\r
+@@done:\r
+;\r
+; all tiles have been scanned\r
+;\r
+       ret\r
+\r
+@@realstart:\r
+       mov     di,[updateptr]\r
+       mov     bp,(TILESWIDE+1)*TILESHIGH+1\r
+       add     bp,di                                   ; when di = bx, all tiles have been scanned\r
+       push    di\r
+       mov     cx,-1                                   ; definately scan the entire thing\r
+\r
+;\r
+; scan for a 1 in the update list, meaning a tile needs to be copied\r
+; from the master screen to the current screen\r
+;\r
+@@findtile:\r
+       pop     di                                              ; place to continue scaning from\r
+       mov     ax,ss\r
+       mov     es,ax                                   ; search in the data segment\r
+       mov     ds,ax\r
+       mov al,1\r
+       repne   scasb\r
+       cmp     di,bp\r
+       je      @@done\r
+\r
+       cmp     [BYTE di],al\r
+       jne     @@singletile\r
+       jmp     @@tileblock\r
+\r
+;============\r
+;\r
+; copy a single tile\r
+;\r
+;============\r
+EVEN\r
+@@singletile:\r
+       inc     di                                              ; we know the next tile is nothing\r
+       push    di                                      ; save off the spot being scanned\r
+       sub     di,[updateptr]\r
+       shl     di,1\r
+       mov     di,[blockstarts-4+di]   ; start of tile location on screen\r
+       mov     si,di\r
+       add     di,[bufferofs]                  ; dest in current screen\r
+       add     si,[masterofs]                  ; source in master screen\r
+\r
+       mov     dx,SCREENWIDTH-TILEWIDTH\r
+       mov     ax,[screenseg]\r
+       mov     ds,ax\r
+       mov     es,ax\r
+\r
+;--------------------------\r
+\r
+IFE GRMODE-CGAGR\r
+\r
+REPT   15\r
+       movsw\r
+       movsw\r
+       add     si,dx\r
+       add     di,dx\r
+ENDM\r
+       movsw\r
+       movsw\r
+\r
+ENDIF\r
+\r
+;--------------------------\r
+\r
+IFE GRMODE-EGAGR\r
+\r
+REPT   15\r
+       movsb\r
+       movsb\r
+       add     si,dx\r
+       add     di,dx\r
+ENDM\r
+       movsb\r
+       movsb\r
+\r
+ENDIF\r
+\r
+;--------------------------\r
+\r
+       jmp     @@findtile\r
+\r
+;============\r
+;\r
+; more than one tile in a row needs to be updated, so do it as a group\r
+;\r
+;============\r
+EVEN\r
+@@tileblock:\r
+       mov     dx,di                                   ; hold starting position + 1 in dx\r
+       inc     di                                              ; we know the next tile also gets updated\r
+       repe    scasb                           ; see how many more in a row\r
+       push    di                                      ; save off the spot being scanned\r
+\r
+       mov     bx,di\r
+       sub     bx,dx                                   ; number of tiles in a row\r
+       shl     bx,1                                    ; number of bytes / row\r
+\r
+       mov     di,dx                                   ; lookup position of start tile\r
+       sub     di,[updateptr]\r
+       shl     di,1\r
+       mov     di,[blockstarts-2+di]   ; start of tile location\r
+       mov     si,di\r
+       add     di,[bufferofs]                  ; dest in current screen\r
+       add     si,[masterofs]                  ; source in master screen\r
+\r
+       mov     dx,SCREENWIDTH\r
+       sub     dx,bx                                   ; offset to next line on screen\r
+IFE GRMODE-CGAGR\r
+       sub     dx,bx                                   ; bx is words wide in CGA tiles\r
+ENDIF\r
+\r
+       mov     ax,[screenseg]\r
+       mov     ds,ax\r
+       mov     es,ax\r
+\r
+REPT   15\r
+       mov     cx,bx\r
+IFE GRMODE-CGAGR\r
+       rep     movsw\r
+ENDIF\r
+IFE GRMODE-EGAGR\r
+       rep     movsb\r
+ENDIF\r
+       add     si,dx\r
+       add     di,dx\r
+ENDM\r
+       mov     cx,bx\r
+IFE GRMODE-CGAGR\r
+       rep     movsw\r
+ENDIF\r
+IFE GRMODE-EGAGR\r
+       rep     movsb\r
+ENDIF\r
+\r
+       dec     cx                                              ; was 0 from last rep movsb, now $ffff for scasb\r
+       jmp     @@findtile\r
+\r
+ENDP\r
+\r
+\r
+;============================================================================\r
+\r
+\r
+;=================\r
+;\r
+; RFL_MaskForegroundTiles\r
+;\r
+; Scan through update looking for 3's.  If the foreground tile there is a\r
+; masked foreground tile, draw it to the screen\r
+;\r
+;=================\r
+\r
+PROC   RFL_MaskForegroundTiles\r
+PUBLIC RFL_MaskForegroundTiles\r
+USES   SI,DI,BP\r
+       jmp     SHORT @@realstart\r
+@@done:\r
+;\r
+; all tiles have been scanned\r
+;\r
+       ret\r
+\r
+@@realstart:\r
+       mov     di,[updateptr]\r
+       mov     bp,(TILESWIDE+1)*TILESHIGH+2\r
+       add     bp,di                                   ; when di = bx, all tiles have been scanned\r
+       push    di\r
+       mov     cx,-1                                   ; definately scan the entire thing\r
+;\r
+; scan for a 3 in the update list\r
+;\r
+@@findtile:\r
+       mov     ax,ss\r
+       mov     es,ax                                   ; scan in the data segment\r
+       mov     al,3\r
+       pop     di                                              ; place to continue scaning from\r
+       repne   scasb\r
+       cmp     di,bp\r
+       je      @@done\r
+\r
+;============\r
+;\r
+; found a tile, see if it needs to be masked on\r
+;\r
+;============\r
+\r
+       push    di\r
+\r
+       sub     di,[updateptr]\r
+       shl     di,1\r
+       mov     si,[updatemapofs-2+di]  ; offset from originmap\r
+       add     si,[originmap]\r
+\r
+       mov     es,[mapsegs+2]                  ; foreground map plane segment\r
+       mov     si,[es:si]                              ; foreground tile number\r
+\r
+       or      si,si\r
+       jz      @@findtile                              ; 0 = no foreground tile\r
+\r
+       mov     bx,si\r
+       add     bx,INTILE                               ;INTILE tile info table\r
+       mov     es,[tinf]\r
+       test    [BYTE PTR es:bx],80h            ;high bit = masked tile\r
+       jz      @@findtile\r
+\r
+;-------------------\r
+\r
+IFE GRMODE-CGAGR\r
+;=================\r
+;\r
+; mask the tile CGA\r
+;\r
+;=================\r
+\r
+       mov     di,[blockstarts-2+di]\r
+       add     di,[bufferofs]\r
+       mov     es,[screenseg]\r
+       shl     si,1\r
+       mov     ds,[grsegs+STARTTILE16M*2+si]\r
+\r
+       mov     bx,64                                   ;data starts 64 bytes after mask\r
+\r
+       xor     si,si\r
+\r
+lineoffset     =       0\r
+REPT   16\r
+       mov     ax,[es:di+lineoffset]   ;background\r
+       and     ax,[si]                                 ;mask\r
+       or      ax,[si+bx]                              ;masked data\r
+       mov     [es:di+lineoffset],ax   ;background\r
+       inc     si\r
+       inc     si\r
+       mov     ax,[es:di+lineoffset+2] ;background\r
+       and     ax,[si]                                 ;mask\r
+       or      ax,[si+bx]                              ;masked data\r
+       mov     [es:di+lineoffset+2],ax ;background\r
+       inc     si\r
+       inc     si\r
+lineoffset     =       lineoffset + SCREENWIDTH\r
+ENDM\r
+ENDIF\r
+\r
+;-------------------\r
+\r
+IFE GRMODE-EGAGR\r
+;=================\r
+;\r
+; mask the tile\r
+;\r
+;=================\r
+\r
+       mov     [BYTE planemask],1\r
+       mov     [BYTE planenum],0\r
+\r
+       mov     di,[blockstarts-2+di]\r
+       add     di,[bufferofs]\r
+       mov     [cs:screenstartcs],di\r
+       mov     es,[screenseg]\r
+       shl     si,1\r
+       mov     ds,[grsegs+STARTTILE16M*2+si]\r
+\r
+       mov     bx,32                                   ;data starts 32 bytes after mask\r
+\r
+@@planeloopm:\r
+       mov     dx,SC_INDEX\r
+       mov     al,SC_MAPMASK\r
+       mov     ah,[ss:planemask]\r
+       WORDOUT\r
+       mov     dx,GC_INDEX\r
+       mov     al,GC_READMAP\r
+       mov     ah,[ss:planenum]\r
+       WORDOUT\r
+\r
+       xor     si,si\r
+       mov     di,[cs:screenstartcs]\r
+lineoffset     =       0\r
+REPT   16\r
+       mov     cx,[es:di+lineoffset]   ;background\r
+       and     cx,[si]                                 ;mask\r
+       or      cx,[si+bx]                              ;masked data\r
+       inc     si\r
+       inc     si\r
+       mov     [es:di+lineoffset],cx\r
+lineoffset     =       lineoffset + SCREENWIDTH\r
+ENDM\r
+       add     bx,32                                   ;the mask is now further away\r
+       inc     [ss:planenum]\r
+       shl     [ss:planemask],1                ;shift plane mask over for next plane\r
+       cmp     [ss:planemask],10000b   ;done all four planes?\r
+       je      @@drawn                                 ;drawn all four planes\r
+       jmp     @@planeloopm\r
+\r
+@@drawn:\r
+ENDIF\r
+\r
+;-------------------\r
+\r
+       mov     ax,ss\r
+       mov     ds,ax\r
+       mov     cx,-1                                   ;definately scan the entire thing\r
+\r
+       jmp     @@findtile\r
+\r
+ENDP\r
+\r
+\r
+END\r
+\r
+*/\r
diff --git a/src/lib/16_rf.h b/src/lib/16_rf.h
new file mode 100755 (executable)
index 0000000..7dff0b1
--- /dev/null
@@ -0,0 +1,177 @@
+/* Keen Dreams Source Code\r
+ * Copyright (C) 2014 Javier M. Chavez\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License along\r
+ * with this program; if not, write to the Free Software Foundation, Inc.,\r
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+ */\r
+\r
+// 16_RF.H\r
+\r
+#define __16_RF__\r
+\r
+#ifndef __16_MM__\r
+#include "src/lib/16_mm.h"\r
+#endif\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                                       CONSTANTS\r
+\r
+=============================================================================\r
+*/\r
+\r
+#define        MINTICS                         2\r
+#define        MAXTICS                         6\r
+\r
+#define        MAPBORDER                       2               // map border must be at least 1\r
+\r
+#define        MAXSPRITES                      100             // max tracked sprites\r
+#define        MAXANIMTILES            90              // max animating tiles on screen\r
+#define MAXANIMTYPES           50              // max different unique anim tiles on map\r
+\r
+#define        MAXMAPHEIGHT            128\r
+\r
+#define        PRIORITIES                      4\r
+#define        MASKEDTILEPRIORITY      3               // planes go: 0,1,2,MTILES,3\r
+\r
+#define TILEGLOBAL                     256\r
+#define PIXGLOBAL                      16\r
+\r
+#define        G_T_SHIFT                       8               // global >> ?? = tile\r
+#define        G_P_SHIFT                       4               // global >> ?? = pixels\r
+#define P_T_SHIFT                      4               // pixels >> ?? = tile\r
+\r
+#define        PORTTILESWIDE           21      // all drawing takes place inside a\r
+#define        PORTTILESHIGH           14              // non displayed port of this size\r
+\r
+//#define      PORTGLOBALWIDE          (21*TILEGLOBAL)\r
+//#define      PORTGLOBALHIGH          (14*TILEGLOBAL)\r
+\r
+#define UPDATEWIDE                     (PORTTILESWIDE+1)\r
+#define UPDATEHIGH                     PORTTILESHIGH\r
+\r
+//from others\r
+#define SCREENWIDTH    64\r
+#define NUMTILE16      1440\r
+#define STARTTILE16  370\r
+#define STARTTILE16M 1810\r
+#define NUMTILE16M   1206\r
+#define        SPEED   502\r
+#define ANIM   (SPEED+NUMTILE16)\r
+\r
+#define NORTHWALL      (ANIM+NUMTILE16)\r
+#define EASTWALL       (NORTHWALL+NUMTILE16M)\r
+#define SOUTHWALL   (EASTWALL+NUMTILE16M)\r
+#define WESTWALL    (SOUTHWALL+NUMTILE16M)\r
+#define MANIM       (WESTWALL+NUMTILE16M)\r
+#define INTILE      (MANIM+NUMTILE16M)\r
+#define MSPEED      (INTILE+NUMTILE16M)\r
+#define        CGAGR   1\r
+#define        EGAGR   2\r
+#define        MAXSHIFTS       1\r
+#define        TILEWIDTH       TILEWH\r
+typedef enum {NOcard,MDAcard,CGAcard,EGAcard,MCGAcard,VGAcard,\r
+                 HGCcard=0x80,HGCPcard,HICcard} cardtype;\r
+typedef enum {CGAgr,EGAgr,VGAgr} grtype;\r
+typedef struct\r
+{\r
+  int  width,\r
+       height,\r
+       orgx,orgy,\r
+       xl,yl,xh,yh,\r
+       shifts;\r
+} spritetabletype;\r
+\r
+typedef        struct\r
+{\r
+       unsigned        sourceoffset[MAXSHIFTS];\r
+       unsigned        planesize[MAXSHIFTS];\r
+       unsigned        width[MAXSHIFTS];\r
+       byte            data[];\r
+} spritetype;          // the memptr for each sprite points to this\r
+//\r
+\r
+//===========================================================================\r
+\r
+typedef enum {spritedraw,maskdraw} drawtype;\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                                PUBLIC VARIABLES\r
+\r
+=============================================================================\r
+*/\r
+\r
+\r
+extern boolean         compatability;                  // crippled refresh for wierdo SVGAs\r
+\r
+extern unsigned        tics;\r
+extern long            lasttimecount;\r
+\r
+extern unsigned        originxglobal,originyglobal;\r
+extern unsigned        originxtile,originytile;\r
+extern unsigned        originxscreen,originyscreen;\r
+\r
+extern unsigned        mapwidth,mapheight,mapbyteswide,mapwordswide\r
+                                       ,mapbytesextra,mapwordsextra;\r
+extern unsigned        mapbwidthtable[MAXMAPHEIGHT];\r
+\r
+extern unsigned        originxmin,originxmax,originymin,originymax;\r
+\r
+extern unsigned        masterofs;\r
+\r
+//\r
+// the floating update window is also used by the view manager for\r
+// double buffer tracking\r
+//\r
+\r
+extern byte            *updateptr;                             // current start of update window\r
+\r
+#if GRMODE == CGAGR\r
+extern byte            *baseupdateptr;\r
+#endif\r
+\r
+extern unsigned        blockstarts[UPDATEWIDE*UPDATEHIGH];\r
+extern unsigned        updatemapofs[UPDATEWIDE*UPDATEHIGH];\r
+extern unsigned        uwidthtable[UPDATEHIGH];                // lookup instead of multiple\r
+\r
+#define        UPDATETERMINATE 0x0301\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                                PUBLIC FUNCTIONS\r
+\r
+=============================================================================\r
+*/\r
+\r
+void RF_Startup (void);\r
+void RF_Shutdown (void);\r
+\r
+void RF_NewMap (void);\r
+void RF_MarkTileGraphics (void);\r
+void RF_NewPosition (unsigned x, unsigned y);\r
+void RF_Scroll (int x, int y);\r
+\r
+void RF_PlaceSprite (void **user,unsigned globalx,unsigned globaly,\r
+       unsigned spritenumber, drawtype draw, int priority);\r
+void RF_RemoveSprite (void **user);\r
+\r
+void RF_Refresh (void);\r
+void RF_ForceRefresh (void);\r
+void RF_SetRefreshHook (void (*func) (void) );\r
+\r
+\r
index 189c3cf47c151130c9ff230037fa57b89736ad6b..c584f9d3bcc747436e87ee3812973a03402ba891 100755 (executable)
@@ -98,6 +98,8 @@ void print_anim_ids(struct sprite *spri)
 \r
 void animate_spri(entity_t *enti, video_t *video)\r
 {\r
+#define INC_PER_FRAME if(enti->q&1) enti->persist_aniframe++; if(enti->persist_aniframe>4) enti->persist_aniframe = 1;\r
+\r
 #define GVARVIDEO video\r
 #define VMEMPAGESIZE2  GVARVIDEO->page[0].pagesize+GVARVIDEO->page[1].pagesize\r
 #define VMEMPAGEDATA2  GVARVIDEO->page[2].data\r
@@ -112,31 +114,25 @@ void animate_spri(entity_t *enti, video_t *video)
 //#define FRAME3 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 0, player[pn].enti.dire, 24, 32,       PLAYERBMPDATAPTR);\r
 //#define FRAME4 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32,      PLAYERBMPDATAPTR); stand\r
        switch(enti->spri->delay)\r
-{\r
+       {\r
                // Delay = 0 means that sprite should loop. Nothing to change here\r
                case 0:\r
                break;\r
 \r
                // Delay = 1 means that on next time unit sprite should be changed\r
                case 1:\r
-                       if(enti->invq)  enti->spri->curr_anim_spri++;\r
-                       else                    enti->spri->curr_anim_spri--;\r
-//printf("1[%u]        %u", enti->invq, enti->spri->curr_anim_spri);\r
+                       INC_PER_FRAME\r
+                       enti->spri->curr_anim_spri++;\r
+\r
                        // If we hit the end of an animation sequence, restart it\r
                        if(!(   enti->spri->curr_spri_id = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].sprite_id)){\r
-                               //enti->spri->curr_anim_spri = 1;\r
-                               enti->invq=!enti->invq;\r
-                               if(enti->invq)                          enti->spri->curr_anim_spri+=2;\r
-                               else if(enti->spri->curr_anim_spri)     enti->spri->curr_anim_spri-=2;\r
+                               enti->spri->curr_anim_spri = 0;\r
                                enti->spri->curr_spri_id = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].sprite_id;\r
-//printf("     enti->spri->curr_anim_spri=%u   ", enti->spri->curr_anim_spri);\r
                        }\r
                        enti->spri->delay = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].delay;\r
-//printf("\n");\r
-//break;\r
+\r
                // Delay > 1 means that we should not change sprite yet. Decrease delay\r
                default:\r
-//printf("2[%u]        %u\n", enti->invq, enti->spri->curr_anim_spri);\r
                        enti->spri->delay--;\r
                break;\r
        }\r
index 97a5f8279e0b4e576c86c5dc340ad5f057dfaa0c..6f10530b10d9911b0fc999c21e6bd897bd3c8706 100755 (executable)
 #include "src/lib/16_mm.h"\r
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_in.h"\r
+#include "src/lib/testpatt.h"\r
+\r
+//VL_ShowPage(&gvar.video.page[gvar.video.panp], 0, 1);\r
+//VL_ShowPage(&gvar.video.page[gvar.video.panp], 0, 0);\r
 \r
 #define FUNCTIONKEYFUNCTIONS \\r
-       if(IN_KeyDown(sc_F6)){ VL_ShowPage(&gvar.video.page[0], 0, 0); IN_UserInput(1,1); } \\r
-       if(IN_KeyDown(sc_F7)){ VL_ShowPage(&gvar.video.page[0], 0, 1); IN_UserInput(1,1); } \\r
-       if(IN_KeyDown(sc_T)){ gvar.video.rss=!gvar.video.rss; IN_UserInput(1,1); }\r
+       if(IN_KeyDown(88)){ panswitch=!panswitch;                                                       IN_UserInput(1,1); } \\r
+       FUNCTIONKEYFUNCTIONS0EXE\r
+\r
 #define FUNCTIONKEYFUNCTIONS0EXE \\r
-       if(IN_KeyDown(sc_F6)){ VL_ShowPage(&gvar.video.page[gvar.video.panp], 0, 0); IN_UserInput(1,1); } \\r
-       if(IN_KeyDown(sc_F7)){ VL_ShowPage(&gvar.video.page[gvar.video.panp], 0, 1); IN_UserInput(1,1); }\r
+       if(IN_KeyDown(87/*sc_F11*/)){ pageflipflop=!pageflipflop;                                       IN_UserInput(1,1); } \\r
+       if(IN_KeyDown(68/*sc_F10*/)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap;         IN_UserInput(1,1); } \\r
+       if(IN_KeyDown(sc_F9)){ pagenorendermap=!pagenorendermap;                                IN_UserInput(1,1); } \\r
+       if(IN_KeyDown(sc_F7)){ ZC_ShowMV(&mv, 0, 1);                                                    IN_UserInput(1,1); } \\r
+       if(IN_KeyDown(sc_F6)){ ZC_ShowMV(&mv, 0, 0);                                                    IN_UserInput(1,1); } \\r
+       if(IN_KeyDown(sc_T)){ gvar.video.rss=!gvar.video.rss;                                           IN_UserInput(1,1); } \\r
+       if(IN_KeyDown(sc_P)){ modexpdump(&gvar.video.page[0]);                                  IN_UserInput(1,1); }\r
+\r
+//VL_ShowPage(page_t *page, boolean vsync, boolean sr)\r
+#define PANKEYFUN \\r
+       PANKEYFUNZC \\r
+       FUNCTIONKEYDRAWJUNK\r
+\r
+#define PANKEYFUNZC \\r
+       ZC_panPageManual(&mv, &player, 0);\r
+\r
+#define FUNCTIONKEYDRAWJUNK \\r
+       if(IN_KeyDown(1+1)){ gvar.video.panp=0; ZC_ShowMV(&mv, 0, 0); } \\r
+       if(IN_KeyDown(2+1)){ gvar.video.panp=1; ZC_ShowMV(&mv, 0, 0); } \\r
+       if(IN_KeyDown(3+1)){ gvar.video.panp=2; ZC_ShowMV(&mv, 0, 1); } \\r
+       if(IN_KeyDown(4+1)){ gvar.video.panp=3; ZC_ShowMV(&mv, 0, 1); } \\r
+\\r
+       if(IN_KeyDown(sc_A)) modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 3); \\r
+       if(IN_KeyDown(sc_S)) modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 4); \\r
+\\r
+       if(IN_KeyDown(sc_Z)){ DRAWCORNERBOXES } \\r
+       if(IN_KeyDown(sc_X)){ TESTBG12 } \\r
+       if(IN_KeyDown(sc_C)){ TESTBG34 } \\r
+       if(IN_KeyDown(sc_V)) VL_PatternDraw(&gvar.video, 0, 1, 1);\r
 \r
 void DebugMemory_(global_game_variables_t *gvar, boolean q);\r
 void Shutdown16(global_game_variables_t *gvar);\r
index 9ddb45816dd527b5512b77d0f33d84f55a8de573..730e7f964c016cf523b9766df95f5dd23553f39a 100755 (executable)
@@ -141,14 +141,13 @@ typedef   struct
        nibble pred;    //prev. direction for animation changing\r
        word dire;              //sprite in use\r
        nibble q;               //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www\r
-       boolean invq;   //animation inversing\r
        word speed;             //entity speed!\r
        word spt;               //speed per tile\r
        struct sprite *spri; // sprite used by entity\r
        sword hp; //hitpoints of the entity\r
        nibble overdraww, overdrawh;    // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks.\r
                                                // if the sprite's edge pixels are clear anyway, you can set this to 0.\r
-       int persist_aniframe;    // gonna be increased to 1 before being used, so 0 is ok for default\r
+       nibble /*int*/ persist_aniframe;    // gonna be increased to 1 before being used, so 0 is ok for default\r
 } entity_t;\r
 \r
 //TODO: MAKE THIS WWWW\r
@@ -262,6 +261,7 @@ typedef struct
 typedef struct\r
 {\r
        char old_mode;          //old video mode before game!\r
+       byte palette[768];              //palette array\r
        page_t page[MAXPAGE];   //can be used as a pointer to root page[0]\r
        word vmem_remain;       //remaining video memory\r
        byte num_of_pages;      //number of actual pages\r
@@ -269,15 +269,16 @@ typedef struct
        byte far * omemptr;\r
        byte vga_draw_stride;\r
        byte vga_draw_stride_limit;             // further X clipping\r
-//\r
+       //end of doslib origi vars\r
        boolean __near rss;                     //render sprite switch\r
        sword __near sprifilei;         //player file's i\r
        boolean __near p;                       //render page number //BLEH\r
-       boolean __near r;                       //page flip if true\r
+       boolean __near r;                       //page flip, showpage, or render        if true\r
        word pr[MAXPAGE][4];    //render sections of pages (this is supposed to be set up to draw sections of the screen if updated)\r
 \r
-       nibble sfip;//shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible.\r
+       nibble sfip;            //shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible.\r
        nibble panp;            //pan_t replacement\r
+       word    vh;             //video combined height\r
        //0000word startclk; float clk, tickclk;        //timer\r
 //newer vars\r
 //TODO: find out how they are used\r
index c3ecaa126e7e9bc4176aef2d2561ee240aea66b5..eda0f4d25df9741001db13e02c5c0e30764a4ed4 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
  *\r
  * This file is part of Project 16.\r
  *\r
@@ -292,6 +292,7 @@ void modexHiganbanaPageSetup(video_t *video)
        modexCalcVmemRemain(video);\r
        video->p=0;\r
        video->r=1;\r
+       video->vh=video->page[0].height+video->page[1].height+video->page[2].height+video->page[3].height;\r
        //doslib origi var\r
        video->omemptr=                 vga_state.vga_graphics_ram;\r
        video->vga_draw_stride= vga_state.vga_draw_stride;\r
@@ -339,8 +340,6 @@ modexShowPage(page_t *page) {
        outp(AC_INDEX, 0x33);\r
        outp(AC_INDEX, (page[0].dx & 0x03) << 1);\r
 }\r
-\r
-//another variant\r
 //args: page, vertical sync switch, screen resolution switch, page0 switch\r
 void\r
 VL_ShowPage(page_t *page, boolean vsync, boolean sr) {\r
@@ -1260,6 +1259,56 @@ void modexcls(page_t *page, byte color, byte *Where)
        _fmemset(Where, color, page->width*(page->height)/4);\r
 }\r
 \r
+//\r
+// pattern filler from joncampbell123's code\r
+//\r
+void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw)\r
+{\r
+       unsigned int i,j,o,     d,h,s;\r
+       word w;\r
+\r
+       switch(sw)\r
+       {\r
+               case 0:\r
+                       w=vga_state.vga_width;\r
+                       d=0;\r
+                       s=vga_state.vga_stride;\r
+                       switch(allsw)\r
+                       {\r
+                               case 0:\r
+                                       h=vga_state.vga_height;\r
+                               break;\r
+                               case 1:\r
+                                       h=video->vh;\r
+                               break;\r
+                       }\r
+               break;\r
+               default:\r
+                       w=video->page[pn].width;\r
+                       d=(0x10000UL - (uint16_t)video->page[pn].data);\r
+                       s=video->page[pn].stridew;\r
+                       switch(allsw)\r
+                       {\r
+                               case 0:\r
+                                       h=video->page[pn].height;\r
+                               break;\r
+                               case 1:\r
+                                       if(!pn) h=video->vh;\r
+                                       else h=video->page[pn].height;\r
+                               break;\r
+                       }\r
+               break;\r
+       }\r
+\r
+       /* fill screen/pattern with a distinctive pattern */\r
+       for (i=0;i < w;i++) {\r
+               o = (i >> 2) + d;\r
+               vga_write_sequencer(0x02/*map mask*/,1 << (i&3));\r
+               for (j=0;j < h;j++,o += s)\r
+                       vga_state.vga_graphics_ram[o] = (i^j)&15; // VRL samples put all colors in first 15!\r
+       }\r
+}\r
+\r
 void\r
 modexWaitBorder() {\r
        while(inp(INPUT_STATUS_1)  & 8)  {\r
index 8a63781b6d4b3652325f29c8f2c210a1b6d93e6e..b79b86d80237d152b9f81086e1015db36b200d6e 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
  *\r
  * This file is part of Project 16.\r
  *\r
@@ -103,7 +103,7 @@ page_t modexNextPage(page_t *p);
 page_t modexNextPageFlexibleSize(page_t *p, word x, word y);\r
 void modexCalcVmemRemain(video_t *video);\r
 void modexHiganbanaPageSetup(video_t *video);\r
-void modexShowPage(page_t *page);\r
+//void modexShowPage(page_t *page);\r
 void VL_ShowPage(page_t *page, boolean vsync, boolean sr);\r
 void modexPanPage(page_t *page, int dx, int dy);\r
 void modexSelectPlane(byte plane);\r
@@ -168,6 +168,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons
 void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);\r
 void modexpdump(page_t *pee);\r
 void modexcls(page_t *page, byte color, byte *Where);\r
+void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
 void modexWaitBorder();\r
 void modexprintmeminfo(video_t *v);\r
 \r
index fba6fb05b06bc1c5982554f5c81107a551e57b2d..e8ad461c2a22bcaef0cda0d30db469ec0040385e 100755 (executable)
@@ -105,7 +105,7 @@ bitmapLoadPcx(char *filename, global_game_variables_t *gv) {
        file = fopen(filename, "rb");\r
        if(!file) {\r
                printf("Could not open %s for reading.\n", filename);\r
-               exit(-2);\r
+               //exit(-2);\r
        }\r
 \r
        /* load the first part of the pcx file */\r
@@ -129,7 +129,7 @@ bitmapLoadPcx(char *filename, global_game_variables_t *gv) {
        if(!result.data) {\r
                fprintf(stderr, "Could not allocate memory for bitmap data.");\r
                fclose(file);\r
-               exit(-1);\r
+               //exit(-1);\r
        }\r
 \r
        /*  read the buffer in */\r
index 8d02cacd465adef995e86326298ce58ce1a95097..b1d60d498ca5fd059e06e16b8157e2102672b7ee 100755 (executable)
@@ -24,7 +24,7 @@
 */\r
 #include "src/lib/scroll16.h"\r
 \r
-#define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1;\r
+//#define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1;\r
 \r
 void ZC_walk(map_view_t *pip, player_t *player, word pn)\r
 {\r
@@ -42,7 +42,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
-                                       INC_PER_FRAME;\r
+                                       //INC_PER_FRAME;\r
                                        ANIMATESPRIFUN(pip, player, pn, 2);\r
                                        ScrollRight(pip, player, 3, pn);\r
                                        ScrollRight(pip, player, 2, pn);\r
@@ -56,7 +56,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
-                                       INC_PER_FRAME;\r
+                                       //INC_PER_FRAME;\r
                                        player[pn].enti.x+=(player[pn].enti.speed);\r
                                        ANIMATESPRIFUN(pip, player, pn, 1);\r
                                        player[pn].enti.q++;\r
@@ -79,7 +79,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
-                                       INC_PER_FRAME;\r
+                                       //INC_PER_FRAME;\r
                                        ANIMATESPRIFUN(pip, player, pn, 2);\r
                                        ScrollLeft(pip, player, 3, pn);\r
                                        ScrollLeft(pip, player, 2, pn);\r
@@ -93,7 +93,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
-                                       INC_PER_FRAME;\r
+                                       //INC_PER_FRAME;\r
                                        player[pn].enti.x-=(player[pn].enti.speed);\r
                                        ANIMATESPRIFUN(pip, player, pn, 1);\r
                                        player[pn].enti.q++;\r
@@ -116,7 +116,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
-                                       INC_PER_FRAME;\r
+                                       //INC_PER_FRAME;\r
                                        ANIMATESPRIFUN(pip, player, pn, 2);\r
                                        ScrollDown(pip, player, 3, pn);\r
                                        ScrollDown(pip, player, 2, pn);\r
@@ -130,7 +130,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
-                                       INC_PER_FRAME;\r
+                                       //INC_PER_FRAME;\r
                                        player[pn].enti.y+=(player[pn].enti.speed);\r
                                        ANIMATESPRIFUN(pip, player, pn, 1);\r
                                        player[pn].enti.q++;\r
@@ -153,7 +153,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
-                                       INC_PER_FRAME;\r
+                                       //INC_PER_FRAME;\r
                                        ANIMATESPRIFUN(pip, player, pn, 2);\r
                                        ScrollUp(pip, player, 3, pn);\r
                                        ScrollUp(pip, player, 2, pn);\r
@@ -167,7 +167,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
-                                       INC_PER_FRAME;\r
+                                       //INC_PER_FRAME;\r
                                        player[pn].enti.y-=(player[pn].enti.speed);\r
                                        ANIMATESPRIFUN(pip, player, pn, 1);\r
                                        player[pn].enti.q++;\r
@@ -186,203 +186,6 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
 }\r
 \r
 \r
-/*\r
-src/lib/scroll16.c:    mv[0].video->r=1;\r
-src/lib/scroll16.c:    mv[0].video->r=1;\r
-src/lib/scroll16.c:    mv[0].video->r=1;\r
-src/lib/scroll16.c:    mv[0].video->r=1;\r
-src/lib/scroll16.c:    pip->video->r=1;\r
-src/lib/scroll16.c:    mv->video->r=1;\r
- */\r
-\r
-void oldwalk(map_view_t *pip, player_t *player, word pn)\r
-{\r
-       //printf("player[%d].d=%d\n", pn, player[pn].enti.d);\r
-       switch(player[pn].enti.d)\r
-       {\r
-               //no direction\r
-               case 2:\r
-                       //0000pip[0].video->startclk = (*clockw);\r
-               break;\r
-               //right movement\r
-               case 3:\r
-                       //printf("pip[0].page->tilesw=%d        ", pip[0].page->tilesw); printf("pip[0].page->tw=%d\n", pip[0].page->tw);\r
-                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))  //collision detection!\r
-                       {\r
-                               if(player[pn].enti.q<=player[pn].enti.spt)\r
-                               {\r
-                                       INC_PER_FRAME;\r
-                                       ANIMATESPRIFUN(pip, player, pn, 1);\r
-                                       ScrollRight(pip, player, 3, pn);\r
-                                       ScrollRight(pip, player, 2, pn);\r
-                                       //mapScrollRight(pip, player, !(pip[0].video->p), pn);\r
-                                       mapScrollRight(pip, player, (pip[0].video->p), pn);\r
-                                       if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].enti.q++;\r
-                                       //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
-                       }\r
-                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
-                       {\r
-                               if(player[pn].enti.q<=player[pn].enti.spt)\r
-                               {\r
-                                       INC_PER_FRAME;\r
-                                       player[pn].enti.x+=(player[pn].enti.speed);\r
-                                       ANIMATESPRIFUN(pip, player, pn, 0);\r
-                                       if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].enti.q++;\r
-                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
-                       }\r
-                       else\r
-                       {\r
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
-#ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
-#else\r
-                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 14);\r
-#endif\r
-                               if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].enti.d = 2;\r
-                       }\r
-                       player[pn].enti.triggerx = player[pn].enti.tx+1;\r
-                       player[pn].enti.triggery = player[pn].enti.ty;\r
-               break;\r
-\r
-               //left movement\r
-               case 1:\r
-                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))        //collision detection!\r
-                       {\r
-                               if(player[pn].enti.q<=player[pn].enti.spt)\r
-                               {\r
-                                       INC_PER_FRAME;\r
-                                       ANIMATESPRIFUN(pip, player, pn, 1);\r
-                                       ScrollLeft(pip, player, 3, pn);\r
-                                       ScrollLeft(pip, player, 2, pn);\r
-                                       //mapScrollLeft(pip, player, !(pip[0].video->p), pn);\r
-                                       mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
-                                       if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].enti.q++;\r
-                                       //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
-                       }\r
-                       else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
-                       {\r
-                               if(player[pn].enti.q<=player[pn].enti.spt)\r
-                               {\r
-                                       INC_PER_FRAME;\r
-                                       player[pn].enti.x-=(player[pn].enti.speed);\r
-                                       ANIMATESPRIFUN(pip, player, pn, 0);\r
-                                       if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].enti.q++;\r
-                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
-                       }\r
-                       else\r
-                       {\r
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
-#ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
-#else\r
-                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 10);\r
-#endif\r
-                               if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].enti.d = 2;\r
-                       }\r
-                       player[pn].enti.triggerx = player[pn].enti.tx-1;\r
-                       player[pn].enti.triggery = player[pn].enti.ty;\r
-               break;\r
-\r
-               //down movement\r
-               case 4:\r
-                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))  //collision detection!\r
-                       {\r
-                               if(player[pn].enti.q<=player[pn].enti.spt)\r
-                               {\r
-                                       INC_PER_FRAME;\r
-                                       ANIMATESPRIFUN(pip, player, pn, 1);\r
-                                       ScrollDown(pip, player, 3, pn);\r
-                                       ScrollDown(pip, player, 2, pn);\r
-                                       //mapScrollDown(pip, player, !(pip[0].video->p), pn);\r
-                                       mapScrollDown(pip, player, (pip[0].video->p), pn);\r
-                                       if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].enti.q++;\r
-                                       //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
-                       }\r
-                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
-                       {\r
-                               if(player[pn].enti.q<=player[pn].enti.spt)\r
-                               {\r
-                                       INC_PER_FRAME;\r
-                                       player[pn].enti.y+=(player[pn].enti.speed);\r
-                                       ANIMATESPRIFUN(pip, player, pn, 0);\r
-                                       if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].enti.q++;\r
-                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
-                       }\r
-                       else\r
-                       {\r
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
-#ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
-#else\r
-                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 9);\r
-#endif\r
-                               if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].enti.d = 2;\r
-                       }\r
-                       player[pn].enti.triggerx = player[pn].enti.tx;\r
-                       player[pn].enti.triggery = player[pn].enti.ty+1;\r
-               break;\r
-\r
-               //up movement\r
-               case 0:\r
-                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))        //collision detection!\r
-                       {\r
-                               if(player[pn].enti.q<=player[pn].enti.spt)\r
-                               {\r
-                                       INC_PER_FRAME;\r
-                                       ANIMATESPRIFUN(pip, player, pn, 1);\r
-                                       ScrollUp(pip, player, 3, pn);\r
-                                       ScrollUp(pip, player, 2, pn);\r
-                                       //mapScrollUp(pip, player, !(pip[0].video->p), pn);\r
-                                       mapScrollUp(pip, player, (pip[0].video->p), pn);\r
-                                       if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].enti.q++;\r
-                                       //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
-                       }\r
-                       else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX &&  player[pn].enti.ty-1 == TRIGGY))\r
-                       {\r
-                               if(player[pn].enti.q<=player[pn].enti.spt)\r
-                               {\r
-                                       INC_PER_FRAME;\r
-                                       player[pn].enti.y-=(player[pn].enti.speed);\r
-                                       ANIMATESPRIFUN(pip, player, pn, 0);\r
-                                       if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].enti.q++;\r
-                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
-                       }\r
-                       else\r
-                       {\r
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
-#ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
-#else\r
-                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 12);\r
-#endif\r
-                               if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].enti.d = 2;\r
-                       }\r
-                       player[pn].enti.triggerx = player[pn].enti.tx;\r
-                       player[pn].enti.triggery = player[pn].enti.ty-1;\r
-               break;\r
-       }\r
-}\r
-\r
 //panning page\r
 void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)\r
 {\r
@@ -868,7 +671,7 @@ void mapGoTo(map_view_t *mv, int tx, int ty)
                mapDrawWRow(&mv[0], tx-1, ty, py);\r
        i+=mv->map->width - tx;\r
        }\r
-       //if(!pageploop)\r
+       if(!pageploop)\r
                modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height);\r
 //     {\r
 //             unsigned int k,j,o;\r
@@ -906,7 +709,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y)
        if(i==0)\r
        {\r
                //wwww\r
-               modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, 0); //currently the over scan color!\r
+               modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, 1); //currently the over scan color!\r
        }\r
        else\r
        {\r
@@ -919,7 +722,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y)
                        case 0:\r
 #endif\r
 #ifndef TILERENDER\r
-                               modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, ((dbg_mapdata[i])+1));\r
+                               if(!pagenorendermap) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, ((dbg_mapdata[i])+1));\r
                                //modexprint(page, x, y, 1, 15, 0, (char const *)(t->debug_data[i]));\r
 #else\r
                                modexDrawBmpRegion              (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data));\r
@@ -1024,13 +827,14 @@ void mapDrawWCol(map_view_t *mv, int tx, int ty, word x)
 \r
 boolean pageflipflop = 1;\r
 boolean pageploop = 1;\r
+boolean pagenorendermap = 0;\r
 \r
 /*     sync    */\r
 void shinku(global_game_variables_t *gv)\r
 {\r
        word x = (0) + gv->video.page[/*!*/(gv->video.p)].dx; // follow the screen\r
        word y = (0) + gv->video.page[/*!*/(gv->video.p)].dy; // follow the screen\r
-       word col = 7, bgcol = 0, type = 1;//w = 64, h = 8,\r
+       word col = 2, bgcol = 1, type = 1;//w = 64, h = 8, //col7bgcol0\r
        //byte o,o2,i;\r
        //modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4);\r
        /* block copy to visible RAM from offscreen */\r
@@ -1044,9 +848,9 @@ void shinku(global_game_variables_t *gv)
        if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second))\r
        {\r
         // NTS: For some bizarre reason, gv->pee is not initialized, but the pointer is not NULL even\r
-        //      though it should be. Instead it's NULL as a near pointer but contains a non-null\r
+        //      though it should be. Instead it's NULL as a neAr pointer but contains a non-null\r
         //      segment value, so testing against NULL doesn't work. It is initialized properly if\r
-        //      you call start_timer() though which uses near malloc. Rather than fight with that,\r
+        //      you call start_timer() though which uses neAr malloc. Rather than fight with that,\r
         //      I decided it would be better to declare a temp buffer statically and sprintf to that.\r
         //\r
         //      This fixes *** Null pointer assignment detected error message in ZCROLL.EXE on exit.\r
@@ -1074,19 +878,20 @@ void shinku(global_game_variables_t *gv)
                case 1:\r
                        //turn this off if XT\r
                        //modexWaitBorder();\r
-                       vga_wait_for_vsync();\r
+                       //vga_wait_for_vsync();\r
                        gv->kurokku.frames_per_second=60;\r
                break;\r
        }\r
+       //render!!\r
        if(pageflipflop){\r
-       if(gv->video.r){\r
+       if(gv->video.r ){//r=1\r
                //vga_setup_wm1_block_copy();\r
                //_fmemcpy((gv->video.page[(gv->video.p)]).data, (gv->video.page[(!gv->video.p)]).data, gv->video.page[(!gv->video.p)].pagesize);\r
                //vga_restore_rm0wm0();\r
                if(!pageploop) modexCopyPageRegion(&(gv->video.page[(gv->video.p)]), &(gv->video.page[(!gv->video.p)]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height);\r
-               modexShowPage(&(gv->video.page[gv->video.p]));\r
+               VL_ShowPage(&(gv->video.page[gv->video.panp]), gv->kurokku.fpscap, 0);//VL_ShowPage(&(gv->video.page[gv->video.p]), gv->kurokku.fpscap, 0);\r
                if(!pageploop) gv->video.p=!gv->video.p;\r
-               gv->video.r=!gv->video.r;\r
+               gv->video.r =!gv->video.r ;\r
                //0000gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2;\r
        }\r
        }\r
@@ -1120,7 +925,7 @@ void near ZC_drawframe(map_view_t *pip, entity_t *enti, sword x, sword y)
 #define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+player[pn].enti.dire);\r
 #endif\r
 \r
-void /*near*/ animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
+void animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
 {\r
        sword x = player[pn].enti.x;\r
        sword y = player[pn].enti.y;\r
@@ -1270,7 +1075,7 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr
 \r
        //draw sprite\r
        ZC_drawframe(pip, &player[pn].enti, x, y);\r
-//if(player[pn].enti.q<4) delay(500);\r
+//0000if(player[pn].enti.q<2) delay(200);\r
        pip->video->r=1;\r
 }\r
 \r
@@ -1330,7 +1135,7 @@ void player_walk(player_t *player, map_view_t *map_v){
        }\r
 }\r
 \r
-void /*near*/ mapScroll(map_view_t *mv, player_t *player)\r
+void mapScroll(map_view_t *mv, player_t *player)\r
 {\r
        //word x, y;  /* coordinate for drawing */\r
        int c = 1;\r
index 75f8eda33245d3dcf447062499c5dab573c1b8e6..9947c449248d098b20499ac3a412f78560360fa3 100755 (executable)
@@ -118,23 +118,14 @@ printf("\n\n");\
        printf("pageflipflop=%u\n", pageflipflop);\\r
        printf("\n");\r
 \r
-#define SHOWMVFUN ZC_ShowMV(&mv, 0, 0);\r
-#define PANKEYFUN \\r
-                       ZC_panPageManual(&mv, &player, 0); \\r
-                       if(IN_KeyDown(1+1) || IN_KeyDown(sc_Z)){ gvar.video.panp=0; SHOWMVFUN; } \\r
-                       if(IN_KeyDown(2+1) || IN_KeyDown(sc_X)){ gvar.video.panp=1; SHOWMVFUN; } \\r
-                       if(IN_KeyDown(3+1) || IN_KeyDown(sc_C)){ gvar.video.panp=2; SHOWMVFUN; if(IN_KeyDown(sc_C)) modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 47); } \\r
-                       if(IN_KeyDown(4+1) || IN_KeyDown(sc_V)){ gvar.video.panp=3; SHOWMVFUN; if(IN_KeyDown(sc_V)) modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 45); } \\r
-                       if(IN_KeyDown(25)){ modexpdump(mv[1].page); modexShowPage(&(gvar.video.page[1])); IN_UserInput(1,1); }\r
-\r
-extern boolean pageflipflop, pageploop;\r
+extern boolean pageflipflop, pageploop, pagenorendermap;\r
 \r
 extern char global_temp_status_text[512];\r
 \r
 //map_t allocMap(int w, int h);\r
 //void initMap(map_t *map);\r
 void ZC_walk(map_view_t *pip, player_t *player, word pn);\r
-void oldwalk(map_view_t *pip, player_t *player, word pn);\r
+//void oldwalk(map_view_t *pip, player_t *player, word pn);\r
 void ZC_panPageManual(map_view_t *pip, player_t *player, word pn);\r
 void ZC_MVSetup(map_view_t *pip, map_t *map, global_game_variables_t *gv);\r
 void ZC_MVInit(map_view_t *pip, int tx, int ty);\r
@@ -159,7 +150,7 @@ void mapDrawWCol(map_view_t *mv, int tx, int ty, word x);
 //void qclean();\r
 void shinku(global_game_variables_t *gv);\r
 void near ZC_drawframe(map_view_t *pip, entity_t *enti, sword x, sword y);\r
-void /*near*/ animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch);\r
+void animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch);\r
 void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch);\r
 \r
 // Move an entity around. Should actually be in 16_entity\r
@@ -169,97 +160,6 @@ boolean ZC_walk2(entity_t *ent, map_view_t *map_v);
 void walk_player(player_t *player, map_view_t *map_v);\r
 \r
 // Scroll map in one direction (assumed from player's movement)\r
-void /*near*/ mapScroll(map_view_t *mv, player_t *player);\r
+void mapScroll(map_view_t *mv, player_t *player);\r
 \r
 #endif /*__SCROLL16_H_*/\r
-//older zc_animate\r
-//#define SPRITO\r
-/*void near ZC_animatePlayer_(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
-{\r
-       sword x = player[pn].enti.x;\r
-       sword y = player[pn].enti.y;\r
-       word dire=10; //direction\r
-       sword qq; //scroll offset\r
-       word ls = player[pn].enti.persist_aniframe;\r
-#ifndef SPRITO\r
-       int i=0;\r
-#endif\r
-       switch(scrollswitch)\r
-       {\r
-               case 0:\r
-                       qq = 0;\r
-               break;\r
-               default:\r
-                       qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
-               break;\r
-       }\r
-#ifdef SPRITE\r
-       x-=4;\r
-#endif\r
-       y-=pip[0].map->tiles->tileHeight;\r
-       switch (player[pn].enti.d)\r
-       {\r
-               case 0:\r
-                       //up\r
-                       dire*=player[pn].enti.d+1;\r
-                       y-=qq;\r
-               break;\r
-               case 3:\r
-                       // right\r
-                       dire*=(player[pn].enti.d-1);\r
-                       x+=qq;\r
-               break;\r
-               case 2:\r
-               break;\r
-               case 4:\r
-                       //down\r
-                       dire*=(player[pn].enti.d-1);\r
-                       y+=qq;\r
-               break;\r
-               case 1:\r
-                       //left\r
-                       dire*=(player[pn].enti.d+3);\r
-                       x-=qq;\r
-               break;\r
-       }\r
-\r
-       //setting xy position\r
-       player[pn].ent->spri->x = x;\r
-       player[pn].ent->spri->y = y;\r
-\r
-#ifndef SPRITO\r
-//#define DRAWFRAME if (i == -1) return; oldanimate_spri(player[pn].ent->spri, pip->video)\r
-#define DRAWFRAME if (i == -1) return; animate_spri(player[pn].ent->spri, pip->video)\r
-#define NFRAME1 i = set_anim_by_id(player[pn].ent->spri, 2+dire);      DRAWFRAME;\r
-#define NFRAME2 i = set_anim_by_id(player[pn].ent->spri, 1+dire);      DRAWFRAME;\r
-#define NFRAME3 i = set_anim_by_id(player[pn].ent->spri, dire);        DRAWFRAME;\r
-#define NFRAME4 i = set_anim_by_id(player[pn].ent->spri, 2+dire);      DRAWFRAME;\r
-#else\r
-#define NFRAME1 modexClearRegion(pip[(pip->video->p)].page, x, y, 16, 32, 2+dire);\r
-#define NFRAME2 modexClearRegion(pip[(pip->video->p)].page, x, y, 16, 32, 1+dire);\r
-#define NFRAME3 modexClearRegion(pip[(pip->video->p)].page, x, y, 16, 32, dire);\r
-#define NFRAME4 modexClearRegion(pip[(pip->video->p)].page, x, y, 16, 32, 1+dire);\r
-#endif\r
-\r
-       switch(ls)\r
-       {\r
-               case 1:\r
-                       NFRAME1\r
-               break;\r
-               case 2:\r
-                       NFRAME2\r
-               break;\r
-               case 3:\r
-                       NFRAME3\r
-               break;\r
-               case 4:\r
-                       NFRAME4\r
-               break;\r
-       }\r
-       pip->video->r=1;\r
-}*/\r
-\r
-//modexDrawSpritePBufRegion\r
-//modexDrawBmpPBufRegion\r
-//#define PBUFSFUN             modexDrawSpriteRegion\r
-//#define PBUFBFUN             modexDrawBmpRegion\r
diff --git a/src/lib/testpatt.h b/src/lib/testpatt.h
new file mode 100755 (executable)
index 0000000..0b90861
--- /dev/null
@@ -0,0 +1,94 @@
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
+#ifndef __TESTPATT_H__\r
+#define __TESTPATT_H__\r
+\r
+////corner markers\r
+#define GVPO gvar.video.page[0]\r
+#define GVPI gvar.video.page[1]\r
+#define OW     GVPO.width-16\r
+#define OH     GVPO.height-16\r
+#define OE     GVPO.sw\r
+#define OJ     GVPO.sh\r
+#define IW     GVPI.width-16\r
+#define IH     GVPI.height-16\r
+#define IE     GVPI.sw\r
+#define IJ     GVPI.sh\r
+#define DCBO modexClearRegion(&GVPO\r
+#define DCBI modexClearRegion(&GVPI\r
+\r
+#define DRAWOTHERCORNERBOX_TOPLEFT \\r
+DCBO,  0,      0,      16, 16, 0); \\r
+DCBO,  16,     16,     16, 16, 1); \\r
+DCBI,          0,      0,      16, 16, 8); \\r
+DCBI,          16,     16,     16, 16, 9);\r
+\r
+#define DRAWOTHERCORNERBOX_TOPRIGHT \\r
+DCBO,  OW,     0,      16, 16, 2); \\r
+DCBO,  OE,     16,     16, 16, 3); \\r
+DCBI,          IW,     0,      16, 16, 10); \\r
+DCBI,          IE,     16,     16, 16, 11);\r
+\r
+#define DRAWOTHERCORNERBOX_BOTTOMLEFT \\r
+DCBO,  0,      OH,     16, 16, 4); \\r
+DCBO,  16,     OJ,     16, 16, 5); \\r
+DCBI,          0,      IH,     16, 16, 12); \\r
+DCBI,          16,     IJ,     16, 16, 13);\r
+\r
+#define DRAWOTHERCORNERBOX_BOTTOMRIGHT \\r
+DCBO,  OE,     OJ,     16, 16, 6); \\r
+DCBO,  OW,     OH,     16, 16, 7); \\r
+DCBI,          IE,     IJ,     16, 16, 14);\\r
+DCBI,          IW,     IH,     16, 16, 15);\r
+\r
+#define DRAWCORNERBOXES \\r
+DRAWOTHERCORNERBOX_TOPLEFT; \\r
+DRAWOTHERCORNERBOX_TOPRIGHT; \\r
+DRAWOTHERCORNERBOX_BOTTOMLEFT; \\r
+DRAWOTHERCORNERBOX_BOTTOMRIGHT;\r
+\r
+#define TESTBG1 \\r
+       modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 15); \\r
+       modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 128); \\r
+       modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 42); \\r
+       modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128);\r
+\r
+#define TESTBG2 \\r
+       modexClearRegion(&gvar.video.page[1], 0, 0, gvar.video.page[1].width, gvar.video.page[1].height, 20); \\r
+       modexClearRegion(&gvar.video.page[1], 16, 16, gvar.video.page[1].sw, gvar.video.page[1].sh, 133); \\r
+       modexClearRegion(&gvar.video.page[1], 32, 32, gvar.video.page[1].sw-32, gvar.video.page[1].sh-32, 47); \\r
+       modexClearRegion(&gvar.video.page[1], 48, 48, gvar.video.page[1].sw-64, gvar.video.page[1].sh-64, 133);\r
+\r
+#define TESTBG12 \\r
+       TESTBG1 \\r
+       TESTBG2\r
+\r
+#define TESTBG34 \\r
+       modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 45); \\r
+       modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 47);\r
+\r
+#define TESTBG \\r
+       TESTBG12 \\r
+       TESTBG34\r
+\r
+#endif\r
index 9c532d51af60b62419aa8dd1b59744f060d54c1c..7cfc324876efd17fd202bb79ff13072dba771343 100755 (executable)
@@ -34,6 +34,7 @@ sword bakapee;
 //debugswitches\r
 boolean panswitch=0;//1\r
 //extern boolean pageflipflop=1;\r
+boolean pagenorendermap = 1;\r
 unsigned int i;\r
 //#ifdef FADE\r
        static word paloffset=0;\r
@@ -166,7 +167,7 @@ void main(int argc, char *argv[])
        if(!panswitch){\r
                ZC_walk(&mv, &player, 0);\r
        }else{\r
-               PANKEYFUN;//panPageManual(&mv, &player, 0);\r
+               PANKEYFUNZC;//panPageManual(&mv, &player, 0);\r
                //printf("      player[0].enti.q: %d", player[0].enti.q);       printf("        player[0].d: %d\n", player[0].d);\r
        }\r
 \r
@@ -197,25 +198,7 @@ void main(int argc, char *argv[])
 #endif\r
 #endif\r
        //pan switch\r
-       if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);}    //f12\r
-       if(IN_KeyDown(87))      //f11\r
-       {\r
-               pageflipflop=!pageflipflop;\r
-               IN_UserInput(1,1);\r
-//             VGAmodeX(0, 0, &gvar);\r
-//             IN_Shutdown();\r
-//             __asm\r
-//             {\r
-//                     mov ah,31h\r
-//                     int 21h\r
-//             }\r
-       }\r
-       if(IN_KeyDown(68))      //f10\r
-       {\r
-               gvar.kurokku.fpscap=!gvar.kurokku.fpscap;\r
-               IN_UserInput(1,1);\r
-       }\r
-       if(IN_KeyDown(67))      //f9\r
+       if(IN_KeyDown(62))      //f3\r
        {\r
                modexClearRegion(mv[1].page, 0, 0, mv[1].page->width, mv[1].page->height, 2);\r
                modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 3);\r
@@ -230,7 +213,8 @@ void main(int argc, char *argv[])
                modexDrawSprite(mv[0].page, 32+72, 16, (PCXBMPVAR));\r
        }\r
 #endif\r
-       FUNCTIONKEYFUNCTIONS;\r
+       FUNCTIONKEYFUNCTIONS\r
+       FUNCTIONKEYDRAWJUNK\r
        if(IN_KeyDown(sc_L)){ modexClearRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y, 16, 16, 1); }\r
 \r
        //9\r
index bcd211bc17064cbd7ccda02e5e76807e0c0463df..54baf61a7a302502e047f8d699c6cfd69fe570aa 100755 (executable)
@@ -1,6 +1,7 @@
 #ifndef __TESUTO_H__\r
 #define __TESUTO_H__\r
 \r
+#include "src/lib/testpatt.h"\r
 #include "src/lib/16_head.h"\r
 #include "src/lib/16_vl.h"\r
 #include "src/lib/16_in.h"\r
 #include <hw/vga/vga.h>\r
 #include <hw/vga/vrl.h>\r
 \r
-////corner markers\r
-#define GVPO gvar.video.page[0]\r
-#define GVPI gvar.video.page[1]\r
-#define OW     GVPO.width-16\r
-#define OH     GVPO.height-16\r
-#define OE     GVPO.sw\r
-#define OJ     GVPO.sh\r
-#define IW     GVPI.width-16\r
-#define IH     GVPI.height-16\r
-#define IE     GVPI.sw\r
-#define IJ     GVPI.sh\r
-#define DCBO modexClearRegion(&GVPO\r
-#define DCBI modexClearRegion(&GVPI\r
-\r
-#define DRAWOTHERCORNERBOX_TOPLEFT \\r
-DCBO,  0,      0,      16, 16, 0); \\r
-DCBO,  16,     16,     16, 16, 1); \\r
-DCBI,          0,      0,      16, 16, 8); \\r
-DCBI,          16,     16,     16, 16, 9);\r
-\r
-#define DRAWOTHERCORNERBOX_TOPRIGHT \\r
-DCBO,  OW,     0,      16, 16, 2); \\r
-DCBO,  OE,     16,     16, 16, 3); \\r
-DCBI,          IW,     0,      16, 16, 10); \\r
-DCBI,          IE,     16,     16, 16, 11);\r
-\r
-#define DRAWOTHERCORNERBOX_BOTTOMLEFT \\r
-DCBO,  0,      OH,     16, 16, 4); \\r
-DCBO,  16,     OJ,     16, 16, 5); \\r
-DCBI,          0,      IH,     16, 16, 12); \\r
-DCBI,          16,     IJ,     16, 16, 13);\r
-\r
-#define DRAWOTHERCORNERBOX_BOTTOMRIGHT \\r
-DCBO,  OE,     OJ,     16, 16, 6); \\r
-DCBO,  OW,     OH,     16, 16, 7); \\r
-DCBI,          IE,     IJ,     16, 16, 14);\\r
-DCBI,          IW,     IH,     16, 16, 15);\r
-\r
-#define DRAWCORNERBOXES \\r
-DRAWOTHERCORNERBOX_TOPLEFT; \\r
-DRAWOTHERCORNERBOX_TOPRIGHT; \\r
-DRAWOTHERCORNERBOX_BOTTOMLEFT; \\r
-DRAWOTHERCORNERBOX_BOTTOMRIGHT; \\r
-\r
-#define TESTBG \\r
-       modexClearRegion(&gvar.video.page[1], 0, 0, gvar.video.page[1].width, gvar.video.page[1].height, 15); \\r
-       modexClearRegion(&gvar.video.page[1], 16, 16, gvar.video.page[1].sw, gvar.video.page[1].sh, 128); \\r
-       modexClearRegion(&gvar.video.page[1], 32, 32, gvar.video.page[1].sw-32, gvar.video.page[1].sh-32, 42); \\r
-       modexClearRegion(&gvar.video.page[1], 48, 48, gvar.video.page[1].sw-64, gvar.video.page[1].sh-64, 128); \\r
-       modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 47); \\r
-       modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 45);\r
-\r
-#define TESTBGFULL \\r
-       modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 15); \\r
-       modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 128); \\r
-       modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 42); \\r
-       modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128); \\r
-       modexCopyPageRegion(&gvar.video.page[1], &gvar.video.page[0], 0, 0, 0, 0, gvar.video.page[0].width, gvar.video.page[0].height); \\r
-       modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 47); \\r
-       modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 45);\r
-\r
 typedef unsigned char far *VGA_RAM_PTR;\r
 //VGA_RAM_PTR vga_graphics_ram = (VGA_RAM_PTR)MK_FP(0xA000,0x0000);\r
 //unsigned char vga_stride = 80; // 80 x 4 = 320 for 320-pixel wide modes\r
index 14baca184f71fe280f1b25722aa7ed1547f3dcab..fbc111df8bbe56d7ee849989852adbfbcbcb1a6b 100755 (executable)
@@ -29,6 +29,7 @@
 #include "src/lib/16_mm.h"\r
 \r
 extern boolean dbg_nointest;\r
+boolean panswitch;\r
 \r
 static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
 static byte palette[768];\r
@@ -95,7 +96,7 @@ void main()
        i = set_anim_by_id((enti.spri), 31);\r
        if (i == -1)\r
        {\r
-               return;\r
+               printf("glitch!\n");\r
        }\r
        enti.spri->x = TILEWH-4;\r
        enti.spri->y = TILEWH;\r
@@ -141,7 +142,7 @@ void main()
                        break;\r
                }*/\r
                if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[0]);  IN_UserInput(1,1); } //p\r
-FUNCTIONKEYFUNCTIONS;\r
+//FUNCTIONKEYFUNCTIONS;\r
        }\r
        VGAmodeX(0, 1, &gvar);\r
        MM_ShowMemory(&gvar);\r
index 147555b8dd90e1c814e0579b7fa532a3fa88655b..a6b3bcc9009a87a2de2a81d0577095eae67ceec3 100755 (executable)
 #include "src/lib/16render.h"\r
 #include "src/lib/16_dbg.h"\r
 \r
-//bitmap_t p;\r
 static map_t map;\r
 map_view_t mv[4];\r
 float t;\r
-sword bakapee;\r
+\r
 //debugswitches\r
 boolean panswitch=0,baka=0;\r
 //extern boolean pageflipflop=1;\r
+boolean pagenorendermap = 1;   //default: 0\r
 unsigned int i;\r
 \r
 #ifdef FADE\r
@@ -43,19 +43,39 @@ byte *gpal;
 byte *ptr;\r
 memptr pal;\r
 \r
-bitmap_t       *ptmpdata;\r
+//bitmap_t     *ptmpdata;\r
+\r
+#define FILENAME_1     "data/spri/chikyuu.vrs"\r
+#define FILENAME_1P    "data/spri/chikyuu.pal"\r
+#define FILENAME_2     "data/spri/ptmp.vrs"\r
+#define FILENAME_2P    "data/spri/ptmp.pal"\r
 \r
 void main(int argc, char *argv[])\r
 {\r
        static global_game_variables_t gvar;\r
        static player_t player[MaxPlayers];\r
-       if(argv[1]) bakapee = atoi(argv[1]);\r
-       else bakapee = 1;\r
+       char *bakapee1,*bakapee1p;\r
+//     sword bakapee;\r
+//     if(argv[1]) bakapee = atoi(argv[1]);\r
+//     else bakapee = 1;\r
 \r
        Startup16(&gvar);\r
 \r
        gvar.video.panp=0;\r
 \r
+       bakapee1=malloc(64);\r
+       bakapee1p=malloc(64);\r
+\r
+       if (argc < 2) {\r
+               //fprintf(stderr,"drawvrl <VRL file> <palette file>\n palette file optional\n");\r
+               bakapee1 =              FILENAME_2;\r
+               bakapee1p =     FILENAME_2P;\r
+\r
+       }else{\r
+               if(argv[1]) bakapee1 = argv[1];\r
+               if(argv[2]) bakapee1p = argv[2];\r
+       }\r
+\r
        // OK, this one takes hellova time and needs to be done in farmalloc or MM_...\r
        //IN CA i think you use CAL_SetupGrFile but i do think we should work together on this part --sparky4\r
        //player[0].ent = malloc(sizeof(entity_t));\r
@@ -70,8 +90,7 @@ void main(int argc, char *argv[])
 //     fprintf(stderr, "yay map loaded~~\n");\r
 \r
        // data\r
-       read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].enti.spri->spritesheet);\r
-       PCXBMP = bitmapLoadPcx("data/chikyuu.pcx", &gvar); // load sprite\r
+       read_vrs(&gvar, bakapee1, player[0].enti.spri->spritesheet);\r
 \r
        // input!\r
        IN_Default(0, &player,ctrl_Keyboard1);\r
@@ -83,14 +102,16 @@ void main(int argc, char *argv[])
        modexFadeOff(4, dpal);\r
 #endif\r
 \r
-       VGAmodeX(bakapee, 1, &gvar);\r
+       VGAmodeX(1/*bakapee*/, 1, &gvar);\r
 \r
        /* fix up the palette and everything */\r
 #ifdef FADE\r
        modexPalBlack();        //reset the palette~\r
 #endif\r
-       modexPalUpdate1(&PCXBMP->palette);\r
-//     CA_LoadFile("data/spri/chikyuu.pal", &pal, &gvar);\r
+\r
+       /* load color palette */\r
+       VL_LoadPalFile(bakapee1p, &gvar.video.palette);\r
+//     CA_LoadFile("data/spri/"BAKAPEEFILE1".pal", &pal, &gvar);\r
 //     modexPalUpdate1(pal);\r
 #ifdef FADE\r
        gpal = modexNewPal();\r
@@ -149,10 +170,14 @@ void main(int argc, char *argv[])
                if(!panswitch){\r
                        //ZC_walk2(player[0].ent, mv);\r
                        ZC_walk(&mv, &player, 0);\r
+               }else{\r
+                       PANKEYFUNZC;\r
+                       //printf("      player[0].enti.q: %d", player[0].enti.q);       printf("        player[0].d: %d\n", player[0].d);\r
                }\r
 \r
                //the scripting stuff....\r
-/*             if(((mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].tx == 5 && player[0].ty == 5))\r
+               //if(((player[0].enti.triggerx == TRIGGX && player[0].enti.triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
+               if(((mv[0].map->data[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
                {\r
                        short i;\r
                        for(i=800; i>=400; i--)\r
@@ -161,32 +186,13 @@ void main(int argc, char *argv[])
                        }\r
                        nosound();\r
                }\r
-               if(player[0].enti.q == (TILEWH/(player[0].speed))+1 && player[0].info.dir != 2 && (player[0].triggerx == 5 && player[0].triggery == 5)){ player[0].enti.hp--; }\r
-*/             //debugging binds!\r
-               if(IN_KeyDown(2)){ modexShowPage(mv[0].page); gvar.video.panp=0; }\r
-               if(IN_KeyDown(25)){ modexpdump(mv[0].page);\r
-                        IN_UserInput(1,1);\r
-               }       //p\r
+               if(player[0].enti.q == (TILEWH/(player[0].enti.speed))+1 && player[0].info.dir != 2 && (player[0].enti.triggerx == 5 && player[0].enti.triggery == 5)){ player[0].enti.hp--; }\r
+               //debugging binds!\r
 \r
                if(IN_KeyDown(24)){ modexPalUpdate0(gpal); /*paloffset=0;*/ modexpdump(mv[0].page); IN_UserInput(1,1); } //o\r
                if(IN_KeyDown(22)){ modexPalUpdate0(gpal); } //u\r
 \r
                //pan switch\r
-               //if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);}  //f12\r
-               if(IN_KeyDown(87))      //f11\r
-               {\r
-                       pageflipflop=!pageflipflop;\r
-                       IN_UserInput(1,1);\r
-               }\r
-               if(IN_KeyDown(68))      //f10\r
-               {\r
-                       gvar.kurokku.fpscap=!gvar.kurokku.fpscap;\r
-                       IN_UserInput(1,1);\r
-               }\r
-               if(IN_KeyDown(67))      //f9\r
-               {\r
-                       modexClearRegion(mv[0].page, 0, 0, mv[0].page->width, mv[0].page->height, 2);\r
-               }\r
                if(IN_KeyDown(66))      //f8\r
                {\r
 //                     modexDrawSprite(mv[0].page, 16, 16, &p);\r
@@ -202,12 +208,24 @@ void main(int argc, char *argv[])
                                break;\r
                        }\r
                }\r
-               FUNCTIONKEYFUNCTIONS;\r
+               FUNCTIONKEYFUNCTIONS\r
+               FUNCTIONKEYDRAWJUNK\r
                if(IN_KeyDown(sc_L)){ modexClearRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y, 16, 16, 1); }\r
-               if(IN_KeyDown(sc_J)){ read_vrs(&gvar, "data/spri/ptmp.vrs", player[0].enti.spri->spritesheet);  *ptmpdata = bitmapLoadPcx("data/ptmp.pcx", &gvar);      modexPalUpdate1(ptmpdata->palette); }\r
-               if(IN_KeyDown(sc_K)){ read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].enti.spri->spritesheet);       PCXBMP = bitmapLoadPcx("data/chikyuu.pcx", &gvar);      modexPalUpdate1(&PCXBMP->palette); }\r
-\r
-               //9\r
+               if(IN_KeyDown(sc_J) || IN_KeyDown(sc_K))\r
+               {\r
+                       if(IN_KeyDown(sc_J))\r
+                       {\r
+                               bakapee1=FILENAME_1;\r
+                               bakapee1p=FILENAME_1P;\r
+                       }\r
+                       if(IN_KeyDown(sc_K))\r
+                       {\r
+                               bakapee1=FILENAME_2;\r
+                               bakapee1p=FILENAME_2P;\r
+                       }\r
+                       read_vrs(&gvar, bakapee1, player[0].enti.spri->spritesheet);\r
+                       VL_LoadPalFile(bakapee1p, &gvar.video.palette);\r
+               }//JK\r
 #ifdef FADE\r
                if(IN_KeyDown(10)){ modexPalOverscan(rand()%56); modexPalUpdate1(dpal); IN_UserInput(1,1); }\r
 #endif\r