]> 4ch.mooo.com Git - 16.git/commitdiff
fixed wwww now i need to work on map system stuff wwwwwwwwwwwwwww i am also going...
authorsparky4 <sparky4@cock.li>
Fri, 3 Feb 2017 21:43:27 +0000 (15:43 -0600)
committersparky4 <sparky4@cock.li>
Fri, 3 Feb 2017 21:43:27 +0000 (15:43 -0600)
ZCROLL.L16 [deleted file]
src/lib/16_enti.c
src/lib/16_spri.c
src/lib/16_tail.h
src/lib/16_vl.c
src/lib/16_vl.h
src/lib/scroll16.c

diff --git a/ZCROLL.L16 b/ZCROLL.L16
deleted file mode 100755 (executable)
index 5bd0bdd..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-\r
-Project 16 zcroll.exe. This is just a test file!\r
-version Feb  3 2017 13:00:59\r
-[0]txy: 0x0    [1]txy: 0x0\r
-\r
-player vars:\r
-       xy: 160x128     txy: 10x8       triggxy: 10x9   value: 0\r
-       hp: 4   q: 1    info.dir: 2     d: 2    dire: 30        pdir: 0\r
-       delay=0\r
-\r
-VL_PrintmodexmemInfo:\r
-  Virtual Screen: 352x272      Tile: 22x17=((Virtual Screen)/16)\r
-         Screen: 320x240       Tile: 20x15=((Screen)/16)\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
-gvar.video:\r
- r=0 bgps=1 \r
-\r
-detected CPU type: 80386 or newer\r
-detected FPU type: 80387\r
index 45f5472204310f0053010c141e14dfb0a62621de..cc4197965e7f6b4fff1cfefeb166ab4975212051 100755 (executable)
@@ -73,7 +73,7 @@ void EN_initplayer(player_t *player, word pn, video_t *video)
        player[pn].enti.spri->y = player[0].enti.y-16;\r
        player[pn].walktype=0;\r
        player[pn].enti.dire=30;\r
-       vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = video->page[0].stridew;\r
+       vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = video->page[0].stridew;//skewing bug\r
 \r
        video->sprifilei =      set_anim_by_id(player[pn].enti.spri, player[pn].enti.dire);\r
        animate_spri(&player[pn].enti, video);\r
index 9474db20876271468f601c0a6a5e6928625b4d8b..5029636edda5e92d209d07cc032060b90218fd69 100755 (executable)
@@ -215,4 +215,5 @@ void animate_spri(entity_t *enti, video_t *video)
        vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = video->page[0].stridew;\r
 \r
        vga_state.vga_graphics_ram = video->omemptr;\r
+       video->dorender=1;\r
 }\r
index b250e15582830a43c35db4a026ed4c31c92cf579..f200f05904042faf70d0cb8c0c73b5f44d1a4740 100755 (executable)
@@ -47,7 +47,6 @@
        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
index 169bbf8cc8d92f7aef40b0b78aceb698ee48a23d..ab9a143b045cef28e6188fde8234f4ef3763862e 100755 (executable)
@@ -1118,7 +1118,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons
        word s, o, w;\r
        word x_draw = x;\r
        //word addr = (word) romFontsData.l;\r
-       word addrq = (page->width/4) * y + (x / 4) + ((word)page->data);\r
+       word addrq = (page->stridew) * y + (x / 4) + ((word)page->data);\r
        word addrr = addrq;\r
        byte c;\r
 \r
@@ -1134,7 +1134,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons
        {\r
                x = x_draw;\r
                romFontsData.chw = 0;\r
-               addrq += (page->width / 4) * 8;\r
+               addrq += (page->stridew) * 8;\r
                addrr = addrq;\r
                y += 8;\r
                continue;\r
@@ -1343,6 +1343,15 @@ modexWaitBorder_start()
 \r
 }\r
 \r
+void\r
+modexWaitBorder_end()\r
+{\r
+       while(!(inp(INPUT_STATUS_1)  & 8))  {\r
+       // spin\r
+       }\r
+\r
+}\r
+\r
 //\r
 // printings of video memory information\r
 //\r
index d2d75fb79f49ec5f255ea2acfc091ca79c11885a..de5c85769a1f04b7ada00507c09f4c3ea5b4095b 100755 (executable)
@@ -174,6 +174,7 @@ void modexcls(page_t *page, byte color, byte *Where);
 void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
 void modexWaitBorder();\r
 void modexWaitBorder_start();\r
+void modexWaitBorder_end();\r
 void VL_PrintmodexmemInfo(video_t *v);\r
 \r
 #endif\r
index 948c9f8aaa202b6176145f55ad485cd38cb725cd..a353ccd8200e1f684f8d79e65669c3cecf2693e4 100755 (executable)
@@ -348,7 +348,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
 //             else\r
 //                     if(mv[0].video->bgps)\r
 //                             modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height);\r
-       mv[0].video->dorender=1;\r
+       //mv[0].video->dorender=1;//ScrollRight\r
 }\r
 \r
 \r
@@ -370,7 +370,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
 //             else\r
 //                     if(mv[0].video->bgps)\r
 //                             modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height);\r
-       mv[0].video->dorender=1;\r
+       //mv[0].video->dorender=1;//ScrollLeft\r
 }\r
 \r
 \r
@@ -392,7 +392,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
 //             else\r
 //                     if(mv[0].video->bgps)\r
 //                             modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight);\r
-       mv[0].video->dorender=1;\r
+       //mv[0].video->dorender=1;//ScrollUp\r
 }\r
 \r
 \r
@@ -414,7 +414,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 //             else\r
 //                     if(mv[0].video->bgps)\r
 //                             modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight);\r
-       mv[0].video->dorender=1;\r
+       //mv[0].video->dorender=1;//ScrollDown\r
 }\r
 \r
 void ZC_mapScroll(map_view_t *mv, player_t *player, word pn)\r
@@ -449,7 +449,7 @@ void ZC_mapScroll(map_view_t *mv, player_t *player, word pn)
                        if(b)   mapScrollUp(mv, player, (1), pn);\r
                break;\r
        }\r
-       mv[0].video->dorender=1;\r
+       //mv[0].video->dorender=1;//ZC_mapScroll\r
 }\r
 \r
 //===========================================================================\r
@@ -699,20 +699,22 @@ void shinku(global_game_variables_t *gv)
         //      This fixes *** Null pointer assignment detected error message in ZCROLL.EXE on exit.\r
                sprintf(global_temp_status_text, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
                modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, col, bgcol, global_temp_status_text);\r
+//0000printf("dx=%u    dy=%u\n", gv->video.page[/*!*/(gv->video.p)].dx, gv->video.page[/*!*/(gv->video.p)].dy);\r
                gv->kurokku.tiku=0;\r
        }else //copy dat sheet\r
        gv->kurokku.tiku++;\r
 \r
        switch(gv->kurokku.fpscap)\r
        {\r
-               case 0:\r
+               case 0: //turn this off if XT\r
                        //modexprint(&(gv->video.page[0]), x, y+8, type, col, bgcol, "sanic!");\r
                        gv->kurokku.frames_per_second=1;\r
                break;\r
                case 1:\r
-                       //turn this off if XT\r
-                       modexWaitBorder_start();\r
+                       //modexWaitBorder();\r
+                       //modexWaitBorder_start();\r
                        //vga_wait_for_vsync();\r
+                       vga_wait_for_vsync_end();\r
                        gv->kurokku.frames_per_second=60;\r
                break;\r
        }\r
@@ -781,23 +783,30 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn)
                break;\r
        }\r
        player[pn].enti.dire+=dd;\r
-       if((player[pn].enti.q==1 && player[pn].enti.pred != player[pn].enti.d) || !dd)\r
+       //setting xy position\r
+       player[pn].enti.spri->x = x;\r
+       player[pn].enti.spri->y = y;\r
+\r
+       if((player[pn].enti.q==1 && player[pn].enti.pred != player[pn].enti.d) || !dd)//when dir changed OR when player change face direction\r
        {\r
                //0000printf("  q=%u    pred=%u d=%u    dd=%u\n", player[pn].enti.q, player[pn].enti.pred, player[pn].enti.d, dd);\r
                set_anim_by_id(player[pn].enti.spri, player[pn].enti.dire); //pip->video->sprifilei = set_anim_by_id(player[pn].enti.spri, player[pn].enti.dire);       if(pip->video->sprifilei == -1){ printf("ERROR! %u\n", player[pn].enti.dire); return; }\r
                player[pn].enti.pred = player[pn].enti.d;\r
+               if(!dd)//changed direction while NOT moving!\r
+               {\r
+                       modexCopyPageRegion(pip[0].page, pip[1].page, x-4, y-4, x-4, y-4, 28, 40);\r
+                       animate_spri(&player[pn].enti, pip[0].video);\r
+               }\r
        }\r
 \r
-       //setting xy position\r
-       player[pn].enti.spri->x = x;\r
-       player[pn].enti.spri->y = y;\r
-\r
-       if(pip[0].video->bgps)\r
+       if(pip[0].video->bgps && dd)//if moving wwww\r
+       {\r
                modexCopyPageRegion(pip[0].page, pip[1].page, x-4, y-4, x-4, y-4, 28, 40);\r
-       //draw sprite\r
-       animate_spri(&player[pn].enti, pip[0].video);\r
+\r
+               //draw sprite\r
+               animate_spri(&player[pn].enti, pip[0].video);\r
+       }\r
 //0000if(player[pn].enti.q<4) delay(200);\r
-       pip[0].video->dorender = 1;\r
 }\r
 \r
 /*\r