]> 4ch.mooo.com Git - 16.git/commitdiff
16_ca needs huge amounts of work and I should remember what needs to be done soon...
authorsparky4 <sparky4@cock.li>
Thu, 4 May 2017 00:29:35 +0000 (19:29 -0500)
committersparky4 <sparky4@cock.li>
Thu, 4 May 2017 00:29:35 +0000 (19:29 -0500)
19 files changed:
XCROLL.LOG
data/G.PAL
src/lib/16_ca.c
src/lib/16_dbg.c
src/lib/16_mm.c
src/lib/16_mm.h
src/lib/16_tail.h
src/lib/16_tdef.h
src/lib/16_vl.c
src/lib/16_vl.h
src/lib/16_vrs.c
src/lib/scroll16.c
src/lib/scroll16.h
src/palbomb.c
src/palettec.c
src/palettel.c
src/vidtest.c
src/vrstest.c
src/xcroll.c

index c4fea9446cf5dc7ddab154724cfde17ddafaa8d0..5b66a033c0aaa489c20c65bc1f9a7ab0f8f03383 100755 (executable)
@@ -9,28 +9,25 @@ Object 4's name: 'stump'
                      "walkable":"0"\r
                     }\r
                walkable: 0\r
-VRS_OpenVRS\r
-       vrl_size=515\r
-\r
 \r
 Project 16 xcroll.exe. This is just a test file!\r
-version May  3 2017 15:15:20\r
+version May  3 2017 19:14:27\r
 page[0]dxy: 16x16\r
 \r
 player vars:\r
-       xy: 160x128     txy: 10x8       triggxy: 10x9   value: 39\r
-       hp: 4   q: 1    info.dir: 2     d: 2    dire: 30        pdir: 0\r
-       delay=0\r
+       xy: 160x128     txy: 13x15      triggxy: 13x14  value: 11\r
+       hp: 4   q: 1    info.dir: 2     d: 2    dire: 11        pdir: 0\r
+       delay=1\r
 \r
 VL_PrintmodexmemInfo:\r
   Virtual Screen: 352x272      Tile: 22x17=((Virtual Screen)/16)\r
          Screen: 320x240       Tile: 20x15=((Screen)/16)\r
   stride: 80 draw_stride: 88 draw_stride_limit: 88\r
   Free Video Memory: 767\r
-  page [0]=(a000:0000) size=23936      w=352  h=272 sw=320  sh=240 pi=1408\r
-       [1]=(a000:5d80) size=23936      w=352  h=272 sw=320  sh=240 pi=1408\r
-       [2]=(a000:bb00) size=8448       w=352  h=96  sw=352  sh=96  pi=1408\r
-       [3]=(a000:dc00) size=8448       w=352  h=96  sw=352  sh=96  pi=1408\r
+  page [0]=(a000:268c) size=23936      w=352  h=272 sw=320  sh=240 pi=1408\r
+       [1]=(a000:840c) size=23936      w=352  h=272 sw=320  sh=240 pi=1408\r
+       [2]=(a000:e18c) size=8448       w=352  h=96  sw=352  sh=96  pi=1408\r
+       [3]=(a000:028c) size=8448       w=352  h=96  sw=352  sh=96  pi=1408\r
 gvar.video:\r
  r=0 bgps=1 \r
 \r
index ebf070246a34cd165802552d2a0325c7df679385..2d98b0128562c26fe001558ea997e0603cc769c9 100755 (executable)
Binary files a/data/G.PAL and b/data/G.PAL differ
index f6ffafb66eef177fa5e2f94a7eee813dad09a076..4a039203e93cdd2d691b67bada601eb01f477e37 100755 (executable)
@@ -231,21 +231,9 @@ void CAL_GetGrChunkLength (int chunk,global_game_variables_t *gvar)
 boolean CA_FarRead(int handle, byte far *dest, dword length, global_game_variables_t *gvar)\r
 {\r
        boolean flag=0;\r
-       //dword fat=0;\r
-       //word segm=0;\r
-       if(gvar->pm.emm.EMSVer<0x40)\r
-       if(length>0xfffflu)\r
-       {\r
-               printf("File is a fat bakapee\n");\r
-               //segm=(length%0xfffflu)-1;\r
-               //fat=segm*0xfffflu;\r
-               //length-=fat;\r
-               printf("CA_FarRead doesn't support 64K reads yet!\n");\r
-               return 0;//TODO: EXPAND!!!\r
-       }\r
+       if (length>0xfffflu)\r
+               Quit (gvar, "CA_FarRead doesn't support 64K reads yet!");//TODO: EXPAND!!!\r
 \r
-       //if(!fat&&!segm)\r
-       //{\r
        __asm {\r
                push    ds\r
                mov     bx,[handle]\r
@@ -293,7 +281,7 @@ End:
 /*\r
 ==========================\r
 =\r
-= CA_SegWrite\r
+= CA_FarWrite\r
 =\r
 = Write from a file to a far pointer\r
 =\r
@@ -303,21 +291,9 @@ End:
 boolean CA_FarWrite(int handle, byte far *source, dword length, global_game_variables_t *gvar)\r
 {\r
        boolean flag=0;\r
-       //dword fat=0;\r
-       //word segm=0;\r
-       if(gvar->pm.emm.EMSVer<0x40)\r
-       if(length>0xfffflu)\r
-       {\r
-               printf("File is a fat bakapee\n");\r
-               //segm=(length%0xfffflu)-1;\r
-               //fat=segm*0xfffflu;\r
-               //length-=fat;\r
-               printf("CA_FarWrite doesn't support 64K reads yet!\n");\r
-               return 0;\r
-       }\r
+       if (length>0xfffflu)\r
+               Quit (gvar, "CA_FarWrite doesn't support 64K reads yet!");//TODO: EXPAND!!!\r
 \r
-       //if(!fat&&!segm)\r
-       //{\r
        __asm {\r
                push    ds\r
                mov     bx,[handle]\r
@@ -1451,7 +1427,6 @@ cachein:
 //===========================================================================\r
 \r
 //????#if GRMODE == EGAGR\r
-#if 1\r
 \r
 /*\r
 ======================\r
@@ -1462,10 +1437,9 @@ cachein:
 =\r
 ======================\r
 */\r
-\r
+/*++++\r
 unsigned       static  sheight,swidth;\r
 boolean static dothemask;\r
-unsigned       *shifttabletable[8];\r
 \r
 void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest,\r
        unsigned width, unsigned height, unsigned pixshift, boolean domask, global_game_variables_t *gvar)\r
@@ -1583,7 +1557,7 @@ dodatabyte:
 }\r
 \r
 #endif\r
-\r
+*/\r
 //===========================================================================\r
 \r
 /*\r
@@ -1595,7 +1569,7 @@ dodatabyte:
 =\r
 ======================\r
 */\r
-\r
+/*++++\r
 void CAL_CacheSprite (int chunk, byte far *compressed, global_game_variables_t *gvar)\r
 {\r
        int i;\r
@@ -1714,7 +1688,7 @@ void CAL_CacheSprite (int chunk, byte far *compressed, global_game_variables_t *
        }\r
 \r
 //#endif\r
-}\r
+}*/\r
 \r
 //===========================================================================\r
 \r
index 5a9173f7e807a914ec25576d171eb3200e7b66e2..ff7d0a8ea479287208c86866cb1c03df52534679 100755 (executable)
@@ -288,7 +288,7 @@ void ShowPalVal (global_game_variables_t *gvar)
        spv.i = 0;\r
 \r
 //     IN_UserInput(1, gvar);\r
-       modexpdump(&gvar->video.page[0]);\r
+       modexpdump(0, gvar);\r
 \r
        for (spv.oi = 1,done = false;!done;)\r
        {\r
@@ -310,13 +310,13 @@ void ShowPalVal (global_game_variables_t *gvar)
 \r
                if(spv.oi!=spv.i)\r
                {\r
-                       modexpdump(&gvar->video.page[0]);\r
+                       modexpdump(0, gvar);\r
                        modexClearRegion(&gvar->video.page[0], spv.palx+TILEWH, spv.paly+TILEWH, spv.mult, spv.mult, 5);\r
                        modexClearRegion(&gvar->video.page[0], spv.palx+TILEWH+1, spv.paly+TILEWH+1, spv.mult-2, spv.mult-2, spv.i);\r
                        spv.oi = spv.i;\r
                }\r
 \r
-#define SHOWPALVARPRINT modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 0, ccolor, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8;\r
+#define SHOWPALVARPRINT modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 1, ccolor, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8;\r
                sprintf(global_temp_status_text, "%03u", spv.i); SHOWPALVARPRINT\r
                sprintf(global_temp_status_text, "r %03u", gvar->video.palette[(spv.i*3)+0]/*>>2*/); SHOWPALVARPRINT\r
                sprintf(global_temp_status_text, "g %03u", gvar->video.palette[(spv.i*3)+1]/*>>2*/); SHOWPALVARPRINT\r
@@ -385,7 +385,7 @@ void ShowPalVal (global_game_variables_t *gvar)
                        break;\r
                }\r
        }\r
-       IN_UserInput(1, gvar);\r
+//     IN_UserInput(1, gvar);\r
 }\r
 #endif //debug vl\r
 #endif //watcomc\r
index 06338dbbb9ac92951fb50a8bd7af00488a58d4ae..324d0f54b1d3138c0825b62d7341af618fcf8d4b 100755 (executable)
@@ -789,9 +789,9 @@ void MML_ClearBlock (global_game_variables_t *gvar)
 \r
        while(scan)\r
        {\r
-               if(!(scan->attributes&LOCKBIT) && (scan->attributes&PURGEBITS))\r
+               if(!(scan->attributes&LOCKBIT) && (scan->attributes&PURGEBITS) )\r
                {\r
-                       MM_FreePtr(scan->useptr, gvar);\r
+                       MM_FreePtr (scan->useptr, gvar);\r
                        return;\r
                }\r
                scan = scan->next;\r
@@ -1010,14 +1010,21 @@ void MM_GetPtr (memptr *baseptr,dword size, global_game_variables_t *gvar)
        gvar->mm.mmnew->attributes = BASEATTRIBUTES;\r
        //if(gvar->mm.mmnew->useptr==NULL){\r
 #ifdef __DEBUG_MM__\r
-       printf("MM_GetPtr\n");\r
        if(dbg_debugmm>0){\r
+       printf("===============================================================================\n");\r
+       printf("                MM_GetPtr\n");\r
+       printf("===============================================================================\n");\r
                //%04x\r
-               printf("        baseptr=%Fp     ", baseptr); printf("useptr=%Fp\n", gvar->mm.mmnew->useptr);\r
-               printf("        *baseptr=%Fp    ", *baseptr); printf("*useptr=%Fp\n", *(gvar->mm.mmnew->useptr));\r
-               printf("        &baseptr=%Fp    ", &baseptr); printf("&useptr=%Fp\n", &(gvar->mm.mmnew->useptr));\r
+//             printf("        baseptr=%Fp     ", baseptr); printf("useptr=%Fp\n", gvar->mm.mmnew->useptr);\r
+//             //printf("      *baseptr=%Fp    ", *baseptr); printf("*useptr=%Fp\n", *(gvar->mm.mmnew->useptr));\r
+//             printf("        &baseptr=%Fp    ", &baseptr); printf("&useptr=%Fp\n", &(gvar->mm.mmnew->useptr));\r
+\r
+               printf("        baseptr=%04x    ", baseptr); printf("useptr=%04x\n", gvar->mm.mmnew->useptr);\r
+               //printf("      *baseptr=%04x   ", *baseptr); printf("*useptr=%04x\n", *(gvar->mm.mmnew->useptr));\r
+               printf("        &baseptr=%04u   ", &baseptr); printf("&useptr=%04u\n", &(gvar->mm.mmnew->useptr));\r
+\r
+               printf("        size is %lu\n", size);\r
        }\r
-       printf("        size is %lu\n", size);\r
 #endif\r
        //Quit (gvar, "gvar->mm.mmnew->useptr==NULL"); }\r
 \r
@@ -1498,6 +1505,17 @@ void MM_ShowMemory (global_game_variables_t *gvar)
        }\r
 #endif\r
 #ifdef MMSMSCANINFO\r
+       MM_ShowMemoryDetail (x, y, w, q, end, &scaninfo, gvar);\r
+#endif\r
+\r
+\r
+       if(gvar->video.VL_Started) IN_Ack(gvar);\r
+\r
+       gvar->video.BOFS = (byte __far *)temp;\r
+}\r
+\r
+#ifdef MMSMSCANINFO\r
+void MM_ShowMemoryDetail (unsigned x, unsigned y, unsigned w, unsigned q, sdword end, mmshowmemoryinfo_t *scaninfo, global_game_variables_t *gvar)\r
        {\r
                byte scratch1[4];\r
                unsigned                maxq = q;\r
@@ -1533,7 +1551,7 @@ void MM_ShowMemory (global_game_variables_t *gvar)
        struct mmblockstruct far *next;\r
 } mmblocktype;*/\r
                        //modexprint(page, x, y, t, tlsw, color, bgcolor, vidsw, const byte *str);\r
-#define MMSMPRINTMEMINFO modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 0, ccolor, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8;\r
+#define MMSMPRINTMEMINFO modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 1, ccolor, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8;\r
                        if(gvar->video.VL_Started)\r
                        {\r
                                VL_ShowPage(&gvar->video.page[0], 1, 0);\r
@@ -1541,7 +1559,8 @@ void MM_ShowMemory (global_game_variables_t *gvar)
                        }else clrscr();\r
                        sprintf(global_temp_status_text, "block #%04u", qq); MMSMPRINTMEMINFO\r
 //                     sprintf(global_temp_status_text, "%Fp", scaninfo[qq].scan->useptr); MMSMPRINTMEMINFO\r
-                       sprintf(global_temp_status_text, "%04x", (unsigned)scaninfo[qq].scan->useptr); MMSMPRINTMEMINFO\r
+                       sprintf(global_temp_status_text, "start:  %04x", (unsigned)scaninfo[qq].scan->start); MMSMPRINTMEMINFO\r
+                       sprintf(global_temp_status_text, "useptr: %04x", (unsigned)scaninfo[qq].scan->useptr); MMSMPRINTMEMINFO\r
                        sprintf(global_temp_status_text, "size: %05u", (unsigned)scaninfo[qq].scan->length); MMSMPRINTMEMINFO\r
                        if (scaninfo[qq].scan->next && scaninfo[qq].scan->next->start > end+1)\r
                        {\r
@@ -1583,8 +1602,8 @@ void MM_ShowMemory (global_game_variables_t *gvar)
                        if(gvar->video.VL_Started)\r
                        {\r
                                //if (scan->next && scan->next->start > end+1) free\r
-                               xpos = 16;\r
-                               ypos = 16;//(gvar->video.page[0].sh-(32));//8*4\r
+                               xpos = gvar->video.page[0].dx;\r
+                               ypos = gvar->video.page[0].dy;//(gvar->video.page[0].sh-(32));//8*4\r
                        }\r
                        else\r
                        {\r
@@ -1605,6 +1624,14 @@ void MM_ShowMemory (global_game_variables_t *gvar)
                                        if(qq<maxq) qq++;\r
                                        else qq = 0;\r
                                break;\r
+/*                             case sc_UpArrow:\r
+                                       if(qq>0) qq-=100;\r
+                                       else    qq = maxq;\r
+                               break;\r
+                               case sc_DownArrow:\r
+                                       if(qq<maxq) qq+=100;\r
+                                       else qq = 0;\r
+                               break;*/\r
                                case sc_Escape:\r
                                        done = true;\r
                                break;\r
@@ -1613,11 +1640,6 @@ void MM_ShowMemory (global_game_variables_t *gvar)
        }\r
 #endif\r
 \r
-       if(gvar->video.VL_Started) IN_Ack(gvar);\r
-\r
-       gvar->video.BOFS = (byte __far *)temp;\r
-}\r
-\r
 //==========================================================================\r
 \r
 /*\r
index c003b54b8429603e3abe2e158e0088fd03f5b4ce..510dadae13d68dc55ae49403d59034a531462e0b 100755 (executable)
@@ -199,6 +199,7 @@ void MM_SetPurge (memptr *baseptr, int purge, global_game_variables_t *gvar);
 void MM_SetLock (memptr *baseptr, boolean locked, global_game_variables_t *gvar);\r
 void MM_SortMem (global_game_variables_t *gvar);\r
 void MM_ShowMemory (global_game_variables_t *gvar);\r
+void MM_ShowMemoryDetail (unsigned x, unsigned y, unsigned w, unsigned q, sdword end, mmshowmemoryinfo_t *scaninfo, global_game_variables_t *gvar);\r
 void MM_DumpData (global_game_variables_t *gvar);\r
 dword MM_UnusedMemory (global_game_variables_t *gvar);\r
 dword MM_TotalFree (global_game_variables_t *gvar);\r
index 93022c261b8c47492ba9a79f4ce25243538c6467..d106d0ef1b3b05d24c31129bb3222ef88863a6e4 100755 (executable)
        if(gvar.in.inst->Keyboard[sc_F7]){ ZC_ShowMV(&gvar.mv, 0, 1);                                           IN_UserInput(1, &gvar); } \\r
        if(gvar.in.inst->Keyboard[sc_F6]){ ZC_ShowMV(&gvar.mv, 0, 0);                                           IN_UserInput(1, &gvar); } \\r
        if(gvar.in.inst->Keyboard[sc_T]){ gvar.video.vga_state.rss=!gvar.video.vga_state.rss;                   IN_UserInput(1, &gvar); } \\r
-       if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(&gvar.video.page[0]);                                      IN_UserInput(1, &gvar); } \\r
+       if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(0, &gvar);                                                 IN_UserInput(1, &gvar); } \\r
        if(gvar.in.inst->Keyboard[sc_Y]){ dbg_delayanimation=!dbg_delayanimation;                               IN_UserInput(1, &gvar); } \\r
        if(gvar.in.inst->Keyboard[sc_Q]){ VL_modexPrintTextBox(&gvar);                                          IN_UserInput(1, &gvar); } \\r
        if(gvar.in.inst->Keyboard[sc_W]){ VL_MemToScreen((byte __far *)&gvar, 64, 64, 16, 16, &gvar);   IN_UserInput(1, &gvar); } \\r
+       if(gvar.in.inst->Keyboard[sc_LBrkt]){ ShowPalVal (&gvar);                                                       IN_UserInput(1, &gvar); } \\r
+       if(gvar.in.inst->Keyboard[sc_M]){ MM_ShowMemory(&gvar);                                                 IN_UserInput(1, &gvar); } \\r
        RFDEBUGFUNCTIONS\r
 //FIZZLEFADEFUNCTION\r
 \r
index b1e68e10f379c53c32ac9b3fabbf2e9a456ed9c1..cd94df84bdc09fa1df7fe30baf57317706ca1fdf 100755 (executable)
@@ -408,10 +408,10 @@ typedef struct
 \r
 typedef struct\r
 {\r
-       //ylookup[MAXSCANLINES],\r
+//---- ylookup[MAXSCANLINES],\r
        unsigned int offscreen_ofs;\r
        unsigned int pattern_ofs;\r
-//     unsigned        bufferofs,linewidth,displayofs;\r
+//+-+- unsigned        bufferofs,linewidth,displayofs;\r
        pan_t           pan;\r
 \r
 } ofs_t;       //unfinished\r
@@ -454,8 +454,9 @@ typedef struct
        boolean fastpalette;\r
        byte            far     palette1[256][3],far palette2[256][3];\r
        pictabletype    _seg *pictable;\r
-       spritetabletype _seg *spritetable;\r
-       unsigned        *shifttabletable[8];\r
+       //keen/cata vars\r
+//     spritetabletype _seg *spritetable;\r
+//     unsigned        *shifttabletable[8];\r
 } video_t;\r
 \r
 //from scroll16\r
index 5b73ac5c5240ea28464c74263091b0c4b2ff1e34..2c3fc766df37efe84f32ee076e86372e2cedf9b8 100755 (executable)
@@ -879,11 +879,11 @@ void modexPalSave(byte *palette)
 /*byte *\r
 modexNewPal() {\r
        byte *ptr;\r
-       ptr = m a l l o c(PAL_SIZE);\r
+       ptr = mAlloc(PAL_SIZE);\r
 \r
        // handle errors\r
        if(!ptr) {\r
-               printf("Could not allocate palette.\n");\r
+               printf("Could not Allocate palette.\n");\r
        }\r
 \r
        return ptr;\r
@@ -937,8 +937,8 @@ void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, word
 void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar)\r
 {\r
        VLL_LoadPalFilewithoffset(filename, palette,\r
-               0,\r
-//             9,\r
+               0,      //overwrite core/system palette\r
+//             9,      //preserved core/system palette\r
                PAL_SIZE, gvar);\r
 }\r
 \r
@@ -1135,7 +1135,7 @@ void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word color
                break;\r
                case 1:\r
                        if(tlsw){ x-=page->tlx; y-=page->tly; }\r
-                       x_draw = x/4;\r
+                       x_draw = x>>2;\r
                        addrq = (page->stridew) * y + (word)(x_draw) +\r
                                ((word)page->data);\r
                        addrr = addrq;\r
@@ -1264,7 +1264,7 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c
 }\r
 \r
 /* palette dump on display! */\r
-void modexpdump(page_t *pee)\r
+void modexpdump(nibble pagenum, global_game_variables_t *gvar)\r
 {\r
        int mult=(QUADWH);\r
        int palq=(mult)*TILEWH;\r
@@ -1272,10 +1272,11 @@ void modexpdump(page_t *pee)
        int palx, paly;\r
        for(paly=TILEWH*8; paly<palq+TILEWH*8; paly+=mult){\r
                for(palx=TILEWH*12; palx<palq+TILEWH*12; palx+=mult){\r
-                               modexClearRegion(pee, palx+TILEWH, paly+TILEWH, mult, mult, palcol);\r
+                               modexClearRegion(&gvar->video.page[pagenum], palx+TILEWH, paly+TILEWH, mult, mult, palcol);\r
                        palcol++;\r
                }\r
        }\r
+       modexPalSave(gvar->video.palette);\r
 }\r
 #if 0\r
 /////////////////////////////////////////////////////////////////////////////\r
index 91db3049fc66befde000d91ac286ae4cfbbd4265..078a5080b487a8a6d6e115c5106216cf3bb9970e 100755 (executable)
@@ -254,7 +254,7 @@ void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, wor
 void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word color, word bgcolor, boolean vidsw, const byte *str);\r
 void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);\r
 void VL_modexPrintTextBox(global_game_variables_t *gvar);\r
-void modexpdump(page_t *pee);\r
+void modexpdump(nibble pagenum, global_game_variables_t *gvar);\r
 void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
 void modexWaitBorder();\r
 void modexWaitBorder_start();\r
index 0edcf627dc6fa83505673ff14c96c1a33994d966..056366afd27a848d6f4a3bda074defbbc6a2f6ab 100755 (executable)
@@ -59,8 +59,16 @@ void VRS_OpenVRS(char *filename, entity_t *enti, boolean rlsw, global_game_varia
 #ifndef VRS_USECAMMPM\r
        vrl_line_offsets = malloc(sizeof(vrl1_vgax_offset_t *)*num_of_vrl);//TODO: USE MM_ CA_ AND PM_\r
 #else\r
-       MM_GetPtr(MEMPTRCONV gvar->ca.grsegs, sizeof(vrl1_vgax_offset_t *)*num_of_vrl, gvar);\r
-       enti->spri.spritesheet.vrl_line_offsets = (vrl1_vgax_offset_t **)gvar->ca.grsegs;\r
+       switch(rlsw)\r
+       {\r
+               case 0:\r
+#ifdef __DEBUG_MM__\r
+                       dbg_debugmm=0;\r
+#endif\r
+                       MM_GetPtr(MEMPTRCONV gvar->ca.grsegs, sizeof(vrl1_vgax_offset_t *)*num_of_vrl, gvar);\r
+                       enti->spri.spritesheet.vrl_line_offsets = (vrl1_vgax_offset_t **)gvar->ca.grsegs;\r
+               break;\r
+       }\r
 #endif\r
 \r
        vrl_headers_offsets = (uint32_t far *)(enti->spri.spritesheet.buffer + enti->spri.spritesheet.vrs_hdr->offset_table[VRS_HEADER_OFFSET_VRS_LIST]);\r
index 496f485483b65608c472b53ff1017572f959a201..0aad37a257eb17c156c87dce74bfd380e4631109 100755 (executable)
@@ -614,16 +614,16 @@ void ZC_mapScroll(map_view_t *mv, player_t *player, word pn)
 //===========================================================================\r
 //TODO: put player in starting position of assigned spot on map\r
 //default player position on the viewable map\r
-void ZC_PlayerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn, boolean defaultsw)\r
+void ZC_PlayerXYpos(int x, int y, player_t *player, map_view_t *pip, boolean defaultsw)\r
 {\r
-       player[pn].enti.tx = x + pip[0].tx;\r
-       player[pn].enti.ty = y + pip[0].ty;\r
+       player->enti.tx = x + pip[0].tx;\r
+       player->enti.ty = y + pip[0].ty;\r
 \r
        switch(defaultsw)\r
        {\r
                case 1:\r
-                       player[pn].enti.tx += pip[0].page->ti.tilemidposscreenx;\r
-                       player[pn].enti.ty += pip[0].page->ti.tilemidposscreeny;\r
+                       player->enti.tx += pip[0].page->ti.tilemidposscreenx;\r
+                       player->enti.ty += pip[0].page->ti.tilemidposscreeny;\r
                break;\r
                case 0:\r
                break;\r
@@ -1091,3 +1091,11 @@ void mapScroll(map_view_t *mv, player_t *player)
                        break;\r
        }\r
 }\r
+\r
+void ZC_GirdChk (global_game_variables_t *gvar, player_t *player)\r
+{\r
+       if((player->enti.q==1) &&\r
+               !(player->enti.x%gvar->mv[0].map->tiles->tileWidth==0 && player->enti.y%gvar->mv[0].map->tiles->tileHeight==0))\r
+               ZC_PlayerXYpos(0, 0, player, gvar->mv, 1);\r
+               //TODO: MAKE SURE TO RESYNC PLAYER IN WALKABLE SPOT\r
+}\r
index 6a36737c52772ecc9396d95fb37be1f5e1fc3d97..67641fac320daa329762209762e2e937a9d13089 100755 (executable)
@@ -115,7 +115,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid);
 void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid);\r
 void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid);\r
 void ZC_mapScroll(map_view_t *mv, player_t *player, word pn);\r
-void ZC_PlayerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn, boolean defaultsw);\r
+void ZC_PlayerXYpos(int x, int y, player_t *player, map_view_t *pip, boolean defaultsw);\r
 sword chkmap(map_t *map, word q);\r
 void mapGoTo(map_view_t *mv, int tx, int ty);\r
 void ZC_mapinitMV(map_view_t *mv, int tx, int ty);\r
@@ -208,4 +208,6 @@ void walk_player(player_t *player, map_view_t *map_v);
 // Scroll map in one direction (assumed from gvar.player's movement)\r
 void mapScroll(map_view_t *mv, player_t *player);\r
 \r
+void ZC_GirdChk (global_game_variables_t *gvar, player_t *player);\r
+\r
 #endif /*__SCROLL16_H_*/\r
index fbfa7251c7df07b878e17a85c1ee0d7d7ce94b43..1da8abb1ff33eafdfda22e1ed584e54df7d8f32b 100755 (executable)
@@ -28,7 +28,7 @@ void main(int argc, char *argv[]) {
 \r
        PALPROGRAMSNEWPAGE\r
        VL_ShowPage(&gvar.video.page[0], 1, 0);\r
-       modexpdump(&gvar.video.page[0]);\r
+       modexpdump(0, &gvar);\r
        while(!kbhit()){ VL_modexPalScramble(&gvar.video.palette); }\r
        modexPalSave(&gvar.video.palette);\r
        VGAmodeX(0, 0, &gvar);\r
index 1e55aca51a6cec568742e991ed9f4f962b5e3917..e2a918564a9ef044af491d94eddbc9c28520b46b 100755 (executable)
@@ -28,7 +28,7 @@ void main(int argc, char *argv[]) {
        modexSavePalFile(bakapee, &gvar.video.palette);\r
        PALPROGRAMSNEWPAGE\r
        VL_ShowPage(&gvar.video.page[0], 1, 0);\r
-       modexpdump(&gvar.video.page[0]);\r
+       modexpdump(0, &gvar);\r
        while(!kbhit()){ /*VL_modexPalScramble(&gvar.video.palette);*/ }\r
 //     modexPalSave(&gvar.video.palette);\r
        VGAmodeX(0, 0, &gvar);\r
index 7f5489341fa37d1c3225a18291b0dcaa56e19e6b..1fbd0de6d92d9c8b0d8ff326d193b96545760454 100755 (executable)
@@ -29,7 +29,7 @@ void main(int argc, char *argv[])
        VL_LoadPalFile(bakapee, &gvar.video.palette, &gvar);            //modexLoadPalFile(bakapee, &(gvar.video.palette));\r
        PALPROGRAMSNEWPAGE\r
        VL_ShowPage(&gvar.video.page[0], 1, 0);\r
-       modexpdump(&gvar.video.page[0]);\r
+       modexpdump(0, &gvar);\r
        while(!kbhit()){ /*VL_modexPalScramble(&gvar.video.palette);*/ }\r
        modexPalSave(&gvar.video.palette);\r
        VGAmodeX(0, 0, &gvar);\r
index 8995f1d857b224a49a5f19aa357a309e0fa62997..c957ef62a42962c7ad569761672334d0ae14903c 100755 (executable)
@@ -170,7 +170,7 @@ void main(int argc, char *argv[])
                        }\r
 //                     if(i>PAL_SIZE) i=0;\r
                }//9*/\r
-               if(gvar.in.inst->Keyboard[25]){ modexpdump(&gvar.video.page[gvar.video.sp]); IN_UserInput(1, &gvar); }//p\r
+               if(gvar.in.inst->Keyboard[25]){ modexpdump(gvar.video.sp, &gvar); IN_UserInput(1, &gvar); }//p\r
                if(gvar.in.inst->Keyboard[sc_I]){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1, &gvar); }//i\r
                if(gvar.in.inst->Keyboard[sc_O]){ copyboxesmodex(&gvar.video.page, !gvar.video.sp); IN_UserInput(1, &gvar); }//o\r
                //VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);\r
index 7ab82a4cfd87abe1c9078847e6e772241f3e529c..6ba75ee767c825af1822132cc436dc1a227c093b 100755 (executable)
@@ -151,7 +151,7 @@ void main()
                TAIL_FUNCTIONKEYDRAWJUNKNOMV\r
                if(gvar.in.inst->Keyboard[sc_F7]){ VL_ShowPage(&gvar.video.page[0], 1, 1);                                                      IN_UserInput(1, &gvar); }\r
                if(gvar.in.inst->Keyboard[sc_F6]){ VL_ShowPage(&gvar.video.page[0], 1, 0);                                                      IN_UserInput(1, &gvar); }\r
-               if(gvar.in.inst->Keyboard[25]){ modexpdump(&gvar.video.page[0]);  IN_UserInput(1, &gvar); } //p\r
+               if(gvar.in.inst->Keyboard[25]){ modexpdump(0, &gvar);  IN_UserInput(1, &gvar); } //p\r
        }\r
        VGAmodeX(0, 1, &gvar);\r
        MM_ShowMemory(&gvar);\r
index 9416cf9ee5ab38a1477f7931a4bfd8eab5e0b113..a8c8e2eaaaf83ff9d670bca4f360a7b8866c2b80 100755 (executable)
@@ -40,7 +40,8 @@ unsigned int i;
 //static word paloffset=0;\r
 #endif\r
 byte *ptr;\r
-memptr pal;\r
+//memptr pal;\r
+boolean spriteswitch=0;\r
 \r
 #define FILENAME_1     "data/spri/chikyuu.vrs"\r
 #define FILENAME_1P    "data/spri/chikyuu.pal"\r
@@ -134,7 +135,7 @@ void main(int argc, char *argv[])
        //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen\r
        mapGoTo(&gvar.mv, 0, 0);\r
 \r
-       ZC_PlayerXYpos(0, 0, &gvar.player, &gvar.mv, 0, 1);\r
+       ZC_PlayerXYpos(0, 0, &gvar.player[0], &gvar.mv, 1);\r
        EN_initPlayer(&gvar.player[0], &gvar.video);\r
        //print_anim_ids(gvar.player[0].enti.spri);\r
        if (gvar.video.sprifilei == -1)\r
@@ -189,14 +190,12 @@ void main(int argc, char *argv[])
                }\r
                if(gvar.player[0].enti.q == (TILEWH/(gvar.player[0].enti.speed))+1 && gvar.player[0].info.dir != 2 && (gvar.player[0].enti.triggerx == 5 && gvar.player[0].enti.triggery == 5)){ gvar.player[0].enti.hp--; }\r
                //debugging binds!\r
-\r
-               if(gvar.in.inst->Keyboard[24]){ VL_modexPalScramble(&gvar.video.palette); /*paloffset=0;*/ VL_LoadPalFileCore(&gvar.video.palette, &gvar); modexpdump(gvar.mv[0].page); IN_UserInput(1, &gvar); } //o\r
+//             if(gvar.in.inst->Keyboard[24]){ VL_modexPalScramble(&gvar.video.palette); /*paloffset=0;*/ VL_LoadPalFileCore(&gvar.video.palette, &gvar); modexpdump(gvar.mv[0].page); IN_UserInput(1, &gvar); } //o\r
                if(gvar.in.inst->Keyboard[22]){ VL_modexPalScramble(&gvar.video.palette); VL_LoadPalFileCore(&gvar.video.palette, &gvar); } //u\r
 \r
                TAIL_FUNCTIONKEYFUNCTIONS\r
                TAIL_FUNCTIONKEYDRAWJUNK\r
                if(gvar.in.inst->Keyboard[sc_L]){ modexClearRegion(&gvar.video.page[0], gvar.player[0].enti.x, gvar.player[0].enti.y, 16, 16, 1); }\r
-               if(gvar.in.inst->Keyboard[sc_LBrkt]){ ShowPalVal (&gvar);                                                               IN_UserInput(1, &gvar); }\r
 \r
 //===============================================================================\r
 #if 0\r
@@ -215,31 +214,36 @@ void main(int argc, char *argv[])
 #endif\r
 //===============================================================================\r
 \r
-               if(gvar.in.inst->Keyboard[sc_J] || gvar.in.inst->Keyboard[sc_K])\r
+               if(gvar.in.inst->Keyboard[sc_J])// || gvar.in.inst->Keyboard[sc_K])\r
                {\r
-                       if(gvar.in.inst->Keyboard[sc_J])\r
+                       if(spriteswitch)//gvar.in.inst->Keyboard[sc_J])\r
                        {\r
                                strcpy(bakapee, FILENAME_1);\r
                                strcpy(bakapeep, FILENAME_1P);\r
                                gvar.player[0].enti.overdraww=0;\r
                        }\r
-                       if(gvar.in.inst->Keyboard[sc_K])\r
+                       else//if(gvar.in.inst->Keyboard[sc_K])\r
                        {\r
                                strcpy(bakapee, FILENAME_2);\r
                                strcpy(bakapeep, FILENAME_2P);\r
                                gvar.player[0].enti.overdraww=2;\r
                        }\r
+                       spriteswitch=!spriteswitch;\r
+\r
                        //read_vrs(&gvar, bakapee, gvar.player[0].enti.spri->spritesheet);\r
                        VRS_ReadVRS(bakapee, &gvar.player[0].enti, &gvar);\r
                        VL_LoadPalFile(bakapeep, &gvar.video.palette, &gvar);\r
                        ZC_animatePlayer(&gvar.mv, &gvar.player, 0);\r
+                       IN_UserInput(1, &gvar);\r
                }//JK\r
 //#ifdef FADE\r
 //             if(gvar.in.inst->Keyboard[10]){ modexPalOverscan(rand()%56); modexPalUpdate(gvar.video.dpal); IN_UserInput(1, &gvar); }\r
 //#endif\r
                if(gvar.in.inst->Keyboard[sc_R]){ VL_modexPalOverscan(&gvar.video.palette, rand()%32); } //r\r
 \r
-               if((gvar.player[0].enti.q==1) && !(gvar.player[0].enti.x%TILEWH==0 && gvar.player[0].enti.y%TILEWH==0)) Quit (&gvar, "PLAYER OFF THE RAILS!");//break;  //incase things go out of sync!\r
+\r
+               //if((gvar.player[0].enti.q==1) && !(gvar.player[0].enti.x%TILEWH==0 && gvar.player[0].enti.y%TILEWH==0)) Quit (&gvar, "PLAYER OFF THE RAILS!");//break;        //incase things go out of sync!\r
+               ZC_GirdChk(&gvar, &gvar.player[0]);\r
        }\r
 \r
        /* fade back to text mode */\r