From: sparky4 Date: Thu, 16 Jun 2016 16:29:01 +0000 (-0500) Subject: optimize for XT i did ww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=0f9b18eec27fe5c3fabe82216fa6af177bae7ac4;p=16.git optimize for XT i did ww --- diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 5f5aa9c3..c36c5f3f 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -32,7 +32,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { //no direction case 2: - pip[0].video->startclk = (*clockw); + //0000pip[0].video->startclk = (*clockw); break; //right movement case 3: @@ -50,7 +50,7 @@ void walk(map_view_t *pip, player_t *player, word pn) mapScrollRight(pip, player, (pip[0].video->p), pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; - pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; + //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; } } else if(player[pn].tx < pip[0].map->width && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY)) @@ -94,7 +94,7 @@ void walk(map_view_t *pip, player_t *player, word pn) mapScrollLeft(pip, player, (pip[0].video->p), pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; - pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; + //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; } } else if(player[pn].tx > 1 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY)) @@ -138,7 +138,7 @@ void walk(map_view_t *pip, player_t *player, word pn) mapScrollDown(pip, player, (pip[0].video->p), pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; - pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; + //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; } } else if(player[pn].ty < pip[0].map->height && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY)) @@ -182,7 +182,7 @@ void walk(map_view_t *pip, player_t *player, word pn) mapScrollUp(pip, player, (pip[0].video->p), pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; - pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; + //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; } } else if(player[pn].ty > 1 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY)) @@ -818,15 +818,15 @@ void shinku(global_game_variables_t *gv) if(pageflipflop){ if(gv->video.r){ /* block copy pattern to where we will draw the sprite */ - vga_setup_wm1_block_copy(); + //vga_setup_wm1_block_copy(); //_fmemmove((gv->video.page[(gv->video.p)]).data, (gv->video.page[(!gv->video.p)]).data, gv->video.page[(!gv->video.p)].pagesize); 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); /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */ - vga_restore_rm0wm0(); + //vga_restore_rm0wm0(); modexShowPage(&(gv->video.page[gv->video.p])); gv->video.p=!gv->video.p; gv->video.r=!gv->video.r; - gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2; + //0000gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2; } } } diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 7dbe38a1..2f8d7a45 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -118,7 +118,7 @@ typedef struct boolean __near p; //render page number boolean __near r; //page flip if true word pr[MAXPAGE][4]; //render sections of pages - word startclk; float clk, tickclk; //timer + //0000word startclk; float clk, tickclk; //timer } video_t; typedef struct diff --git a/src/scroll.c b/src/scroll.c index 9d6cd0a3..3a7d694d 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -322,34 +322,35 @@ void main(int argc, char *argv[]) VGAmodeX(0, 1, &gvar); #endif IN_Shutdown(); - printf("Project 16 scroll.exe. This is just a test file!\n"); + printf("\n\n\n\nProject 16 scroll.exe. This is just a test file!\n"); printf("version %s\n", VERSION); - printf("tx: %d\n", mv[0].tx); + printf("tx: %d ", mv[0].tx); printf("ty: %d\n", mv[0].ty); - printf("player.x: %d", player[0].x); printf(" player.y: %d\n", player[0].y); + printf("player vars:\n"); + printf(" x: %d", player[0].x); printf(" y: %d\n", player[0].y); //if(player[0].hp==0) printf("%d wwww\n", player[0].y+8); //else printf("\nplayer[0].y: %d\n", player[0].y); - printf("player.tx: %d", player[0].tx); printf(" player.ty: %d\n", player[0].ty); - printf("player.triggx: %d", player[0].triggerx); printf(" player.triggy: %d\n", player[0].triggery); - printf("player.hp: %d", (player[0].hp)); printf(" player.q: %d", player[0].q); printf(" player.info.dir: %d", player[0].info.dir); printf(" player.d: %d ", player[0].d); - printf("pdir=%d\n", player[0].pdir); - printf("tile data value at player trigger position: %d\n", mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]); + printf(" tx: %d", player[0].tx); printf(" ty: %d\n", player[0].ty); + printf(" triggx: %d", player[0].triggerx); printf(" triggy: %d\n", player[0].triggery); + printf(" hp: %d", (player[0].hp)); printf(" q: %d", player[0].q); printf(" player.info.dir: %d", player[0].info.dir); printf(" player.d: %d ", player[0].d); + printf(" pdir=%d\n", player[0].pdir); + printf("tile data value at player trigger position: %d\n\n", mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]); // printf("palette offset: %d\n", paloffset/3); //++++ printf("Total used: %zu\n", oldfreemem-GetFreeSize()); //++++ printf("Total free: %zu\n", GetFreeSize()); //not used now printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n"); //not used now printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n"); - printf("Virtual Screen: %dx", gvar.video.page[0].width); printf("%d\n", gvar.video.page[0].height); + printf("Virtual Screen: %dx", gvar.video.page[0].width); printf("%d ", gvar.video.page[0].height); printf("Screen: %dx", gvar.video.page[0].sw); printf("%d\n", gvar.video.page[0].sh); - printf("virtual tile resolution: %dx", gvar.video.page[0].tilesw); printf("%d\n", gvar.video.page[0].tilesh); - printf("tile resolution: %dx", gvar.video.page[0].tw); printf("%d \n", gvar.video.page[0].th); + printf("virtual tile resolution: %dx", gvar.video.page[0].tilesw); printf("%d ", gvar.video.page[0].tilesh); + printf("tile resolution: %dx", gvar.video.page[0].tw); printf("%d\n", gvar.video.page[0].th); printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx); printf("%d\n", gvar.video.page[0].tilemidposscreeny); modexprintmeminfo(&gvar.video); //printf("mv[%u].tx: %d", pan.pn, mv[pan.pn].tx); printf(" mv[%u].ty: %d ", pan.pn, mv[pan.pn].ty); printf("gvar.video.p=%u ", gvar.video.p); printf("gvar.video.r=%u ", gvar.video.r); printf("pageflipflop=%u\n", pageflipflop); - printf("\ngvar.video.tickclk=%f\n", gvar.video.tickclk); - printf("gvar.video.clk=%f", gvar.video.clk); + //0000printf("\ngvar.video.tickclk=%f\n", gvar.video.tickclk); + //0000printf("gvar.video.clk=%f", gvar.video.clk); printf("\n"); //printf("map.width=%d map.height=%d map.data[0]=%d\n", mv[0].map->width, mv[0].map->height, mv[0].map->data[0]);