]> 4ch.mooo.com Git - 16.git/commitdiff
joncambell321 please help test.exe creates garbage if the 2nd rendering page is writt...
authorsparky4 <sparky4@cock.li>
Wed, 4 May 2016 21:07:13 +0000 (16:07 -0500)
committersparky4 <sparky4@cock.li>
Wed, 4 May 2016 21:07:13 +0000 (16:07 -0500)
src/lib/modex16.c
src/test.c

index e7085e6345eb5c8e06b3b890fd01c4d7a9d2ed2c..ee7f156c0558ebc66cca31e31493d7f06e9224b1 100755 (executable)
@@ -185,7 +185,7 @@ modexDefaultPage(page_t *p)
        page.tilesh=page.height/TILEWH;\r
        page.tilemidposscreenx = page.tw/2;\r
        page.tilemidposscreeny = (page.th/2)+1;\r
-       page.pagesize = (sdiword)page.width*page.height;\r
+       page.pagesize = (sdiword)(page.width/4)*page.height;\r
        page.id = 0;\r
 \r
     return page;\r
@@ -198,7 +198,7 @@ page_t
 modexNextPage(page_t *p) {\r
     page_t result;\r
 \r
-    result.data = p->data + (byte)(p->width/4)*p->height;\r
+    result.data = p->data + (p->pagesize);\r
     result.dx = 0;\r
     result.dy = 0;\r
     result.width = p->width;\r
@@ -219,7 +219,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
 {\r
        page_t result;\r
 \r
-       result.data = p->data + (byte)(p->width/4)*p->height;  /* compute the offset */\r
+       result.data = p->data + (p->pagesize);  /* compute the offset */\r
        result.dx = 0;\r
        result.dy = 0;\r
        result.width = x;\r
@@ -229,7 +229,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
        result.tilesw=result.width/TILEWH;\r
        result.tilesh=result.height/TILEWH;\r
        result.id = p->id+1;\r
-       result.pagesize = (sdiword)result.width*result.height;\r
+       result.pagesize = (sdiword)(result.width/4)*result.height;\r
 \r
        return result;\r
 }\r
@@ -252,8 +252,8 @@ void modexHiganbanaPageSetup(video_t *video)
        (video->page[0]) = modexDefaultPage(&(video->page[0])); video->num_of_pages++;\r
        //video->page[0].width += (TILEWHD); video->page[0].height += (TILEWHD);\r
        (video->page[1]) = modexNextPage(&(video->page[0]));    video->num_of_pages++;\r
-       (video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), video->page[0].width, video->page[0].sh-40);    video->num_of_pages++;\r
-       (video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), TILEWH, TILEWH);        video->num_of_pages++;\r
+       //(video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), video->page[0].width, video->page[0].sh-40);  video->num_of_pages++;\r
+       //(video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), TILEWH, TILEWH);      video->num_of_pages++;\r
        modexCalcVmemRemain(video);\r
        video->p=0;\r
 }\r
index bb0fb201f10850eaa5fbcb4cc76669bb406f7123..5b9603a3ae9e6d3f92280f31a9d98025aa9e6263 100755 (executable)
@@ -92,7 +92,7 @@ void main(int argc, char *argv[])
        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
        modexShowPage(&gvar.video.page[0]);\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
+       modexCopyPageRegion(&gvar.video.page[1], &gvar.video.page[0], 0, 0, 0, 0, gvar.video.page[0].width+32, gvar.video.page[0].height);\r
 \r
        /* fade in */\r
        modexFadeOn(1, pal2);\r
@@ -106,8 +106,10 @@ void main(int argc, char *argv[])
                switch (k)\r
                {\r
                        case 0:\r
+                               pee:\r
                                /* go right */\r
                                gvar.video.page[p].dx++;\r
+                               if(i==5){ if(j>=31){ i++; j=0; goto baka; }else j++; }else\r
                                if(j>=32){ k++; j=0; }else j++;\r
                        break;\r
                        case 1:\r
@@ -129,8 +131,16 @@ void main(int argc, char *argv[])
 \r
                        break;\r
                }}else{\r
+                       if(i==5) goto pee;\r
+                       baka:\r
+                       i++;\r
                        modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width-32, 16, 45);\r
                        if(IN_KeyDown(6)) modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width, 16, 45);\r
+                       if(IN_KeyDown(4+1)){\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
                }\r
                if(IN_KeyDown(2)) p=0;\r
                if(IN_KeyDown(3)) p=1;\r
@@ -151,7 +161,9 @@ void main(int argc, char *argv[])
        for(i=0; i<gvar.video.num_of_pages;i++)\r
        {\r
                printf("        [%u]=", i);\r
-               printf("(%Fp)\n", (gvar.video.page[i].data));\r
+               printf("(%Fp)", (gvar.video.page[i].data));\r
+               printf(" size=%ld", gvar.video.page[i].pagesize);\r
+               printf("\n");\r
        }\r
        IN_Shutdown();\r
        modexPalBlack();\r