From: sparky4 Date: Wed, 4 May 2016 21:07:13 +0000 (-0500) Subject: joncambell321 please help test.exe creates garbage if the 2nd rendering page is writt... X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=c4938b26e71facac986fcccc2334223273293d86;p=16.git joncambell321 please help test.exe creates garbage if the 2nd rendering page is written writing beyon the 2nd page sw size breaks the program of all programs wwwwwwwww --- diff --git a/src/lib/modex16.c b/src/lib/modex16.c index e7085e63..ee7f156c 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -185,7 +185,7 @@ modexDefaultPage(page_t *p) page.tilesh=page.height/TILEWH; page.tilemidposscreenx = page.tw/2; page.tilemidposscreeny = (page.th/2)+1; - page.pagesize = (sdiword)page.width*page.height; + page.pagesize = (sdiword)(page.width/4)*page.height; page.id = 0; return page; @@ -198,7 +198,7 @@ page_t modexNextPage(page_t *p) { page_t result; - result.data = p->data + (byte)(p->width/4)*p->height; + result.data = p->data + (p->pagesize); result.dx = 0; result.dy = 0; result.width = p->width; @@ -219,7 +219,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) { page_t result; - result.data = p->data + (byte)(p->width/4)*p->height; /* compute the offset */ + result.data = p->data + (p->pagesize); /* compute the offset */ result.dx = 0; result.dy = 0; result.width = x; @@ -229,7 +229,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) result.tilesw=result.width/TILEWH; result.tilesh=result.height/TILEWH; result.id = p->id+1; - result.pagesize = (sdiword)result.width*result.height; + result.pagesize = (sdiword)(result.width/4)*result.height; return result; } @@ -252,8 +252,8 @@ void modexHiganbanaPageSetup(video_t *video) (video->page[0]) = modexDefaultPage(&(video->page[0])); video->num_of_pages++; //video->page[0].width += (TILEWHD); video->page[0].height += (TILEWHD); (video->page[1]) = modexNextPage(&(video->page[0])); video->num_of_pages++; - (video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), video->page[0].width, video->page[0].sh-40); video->num_of_pages++; - (video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), TILEWH, TILEWH); video->num_of_pages++; + //(video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), video->page[0].width, video->page[0].sh-40); video->num_of_pages++; + //(video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), TILEWH, TILEWH); video->num_of_pages++; modexCalcVmemRemain(video); video->p=0; } diff --git a/src/test.c b/src/test.c index bb0fb201..5b9603a3 100755 --- a/src/test.c +++ b/src/test.c @@ -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); modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128); modexShowPage(&gvar.video.page[0]); - modexCopyPageRegion(&gvar.video.page[1], &gvar.video.page[0], 0, 0, 0, 0, gvar.video.page[0].width, gvar.video.page[0].height); + modexCopyPageRegion(&gvar.video.page[1], &gvar.video.page[0], 0, 0, 0, 0, gvar.video.page[0].width+32, gvar.video.page[0].height); /* fade in */ modexFadeOn(1, pal2); @@ -106,8 +106,10 @@ void main(int argc, char *argv[]) switch (k) { case 0: + pee: /* go right */ gvar.video.page[p].dx++; + if(i==5){ if(j>=31){ i++; j=0; goto baka; }else j++; }else if(j>=32){ k++; j=0; }else j++; break; case 1: @@ -129,8 +131,16 @@ void main(int argc, char *argv[]) break; }}else{ + if(i==5) goto pee; + baka: + i++; modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width-32, 16, 45); if(IN_KeyDown(6)) modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width, 16, 45); + if(IN_KeyDown(4+1)){ + modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 128); + modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 42); + modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128); + } } if(IN_KeyDown(2)) p=0; if(IN_KeyDown(3)) p=1; @@ -151,7 +161,9 @@ void main(int argc, char *argv[]) for(i=0; i