From: sparky4 Date: Fri, 9 Dec 2016 15:47:44 +0000 (-0600) Subject: no idea why bcexmm.exe is broke w tweaked zcroll.exe a bit X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=d1ad125567c999bff1adeff2e0f5b1ada15ebd2d;p=16.git no idea why bcexmm.exe is broke w tweaked zcroll.exe a bit --- diff --git a/WHAT_WAS_CHANGED b/WHAT_WAS_CHANGED index 2036327b..e97a9ccf 100755 --- a/WHAT_WAS_CHANGED +++ b/WHAT_WAS_CHANGED @@ -9,6 +9,9 @@ broke much code w 1. Rewrite scroll16 to use only one player, instead of 1 of 4 6. Instead of drawing map as a rectangle of tiles and a few strips to fill the black area of partially visible tiles, draw just a slightly bigger rectangle, with it's edges a bit out of the screen. That shouldn't be too resourse-consuming, I believe, but requires less explicit calls and reads. Probably. // as long as it is faster do it! also make a graphical representation of it w --sparky4 broke way too much code with this wwww7. As stuff did not quite initialize properly, I have disabled keyboard interrupt vector override to be able to shut down program prematurely in case something goes wrong. So, in case you just want to replace these new files with the older and working ones, please remember to re-enable that, or you won't be able to controll the game without it. // YOU BROKE 16_IN WITH ONE PLAYER INSTEAD OF USING AN ARRAY OF 1 WWWWWWW --sparky4 +Read This: +https://en.wikipedia.org/wiki/Adaptive_tile_refresh + ==== changed or planned ones by sparky4 ==== planned ones: diff --git a/src/.scroll.c.kate-swp b/src/.scroll.c.kate-swp new file mode 100755 index 00000000..29d7843f Binary files /dev/null and b/src/.scroll.c.kate-swp differ diff --git a/src/lib/16_scr.h b/src/lib/16_scr.h index 2b66f85b..94af24e6 100755 --- a/src/lib/16_scr.h +++ b/src/lib/16_scr.h @@ -84,6 +84,42 @@ typedef struct #define MAPW 40 #define MAPH 30 + //if(player[0].hp==0) printf("%d wwww\n", player[0].y+8); + //else printf("\nplayer[0].y: %d\n", player[0].y); +// 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("mv[%u].tx: %d", pan.pn, mv[pan.pn].tx); printf(" mv[%u].ty: %d ", pan.pn, mv[pan.pn].ty); +//printf("gvar.kurokku: "); printf("%.0f ", clock()); printf("tiku=%lu ", gvar.kurokku.tiku); printf("t=%.0f ", gvar.kurokku.t); printf("ticktock()=%f ", ticktock(&gvar)); printf("%.0f fps", (double)gvar.kurokku.tiku/ticktock(&gvar)); +//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]); +#define SCROLLEXITMESG printf("tx: %d ", mv[0].tx);\ + printf("ty: %d\n", mv[0].ty);\ + printf("\n");\ + printf("player vars:\n");\ + printf(" x: %d", player[0].x); printf(" y: %d\n", player[0].y);\ + \ + 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("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 ", 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("gvar.video.p=%u ", gvar.video.p); printf("gvar.video.r=%u ", gvar.video.r);\ + printf("pageflipflop=%u\n", pageflipflop);\ +\ + printf("&global_temp_status_text = %Fp\n", &global_temp_status_text);\ +\ + printf("\n"); + extern boolean pageflipflop, pageploop; extern unsigned char shinku_fps_indicator_page; diff --git a/src/scroll.c b/src/scroll.c index 70c3f40b..03859245 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -29,7 +29,7 @@ //#define FADE #define MODEX //this is for mode x initiating -boolean dbg_nommpmca=1; +extern boolean dbg_nommpmca; //word far *clock= (word far*) 0x046C; /* 18.2hz clock */ //bitmap_t *p; @@ -60,7 +60,7 @@ boolean panswitch=0;//1 void main(int argc, char *argv[]) { - //byte *mesg=malloc(sizeof(dword)); + dbg_nommpmca=1; if(argv[1]) bakapee = atoi(argv[1]); else bakapee = 1; @@ -151,7 +151,6 @@ void main(int argc, char *argv[]) player[0].tx = mv[0].tx + mv[0].page->tilemidposscreenx; player[0].ty = mv[0].ty + mv[0].page->tilemidposscreeny; IN_initplayer(&player, 0); - //IN_initplayer(&player, 1); #ifndef SPRITE modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15); @@ -293,38 +292,7 @@ void main(int argc, char *argv[]) Shutdown16(&gvar); printf("\nProject 16 scroll.exe. This is just a test file!\n"); printf("version %s\n", VERSION); - printf("tx: %d ", mv[0].tx); - printf("ty: %d\n", mv[0].ty); - printf("\n"); - 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(" 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 ", 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 ", 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("gvar.kurokku: "); printf("%.0f ", clock()); printf("tiku=%lu ", gvar.kurokku.tiku); printf("t=%.0f ", gvar.kurokku.t); printf("ticktock()=%f ", ticktock(&gvar)); printf("%.0f fps", (double)gvar.kurokku.tiku/ticktock(&gvar)); - printf("&global_temp_status_text = %Fp\n", &global_temp_status_text); - 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]); - - printf("\n"); + SCROLLEXITMESG; switch(detectcpu()) { case 0: cpus = "8086/8088 or 186/88"; break; diff --git a/src/zcroll.c b/src/zcroll.c index 0ec3b847..a28522d7 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -27,7 +27,6 @@ #include "src/lib/16_dbg.h" #define MODEXZ -boolean dbg_noplayerinpu=0; //TODO: known issues the array dependent mv stuff and player arrays global_game_variables_t gvar; @@ -63,7 +62,7 @@ void main(int argc, char *argv[]) pan.pn=0; // OK, this one takes hellova time and needs to be done in farmalloc or MM_... - //TODO: USE MM AND CA AND PM WWWWWWWW + //IN CA i think you use CAL_SetupGrFile but i do think we should work together on this part --sparky4 player[0].ent = malloc(sizeof(entity_t)); player[0].ent->spri = malloc(sizeof(struct sprite)); player[0].ent->spri->spritesheet = malloc(sizeof(struct vrs_container)); @@ -79,7 +78,6 @@ void main(int argc, char *argv[]) read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].ent->spri->spritesheet); // input! -if(!dbg_noplayerinpu) IN_Default(0, &player,ctrl_Keyboard1); // save the palette @@ -90,6 +88,9 @@ if(!dbg_noplayerinpu) #endif textInit(); VGAmodeX(bakapee, 1, &gvar); + //strcpy(global_temp_status_text, "press enter for video setup\nescape to quit"); + //modexprint(&gvar.video.page[0], 64, 64, 1, 7, 0, global_temp_status_text); + //while(!IN_KeyDown(sc_Enter)){ if(IN_KeyDown(sc_Escape)) goto quit; } IN_UserInput(1,1); //wwww #ifdef MODEXZ #ifdef FADE modexPalBlack(); //reset the palette~ @@ -102,19 +103,28 @@ if(!dbg_noplayerinpu) #endif // setup camera and screen~ - strcpy(global_temp_status_text, "press a key for video setup"); - modexprint(mv[0].page, 0, 64, 1, 7, 0, global_temp_status_text); - + strcpy(global_temp_status_text, "press enter for page setup\nescape to quit"); + modexprint(&gvar.video.page[0], 64, 64, 1, 7, 0, global_temp_status_text); + while(!IN_KeyDown(sc_Enter)){ if(IN_KeyDown(sc_Escape)) goto quit; } IN_UserInput(1,1); //wwww modexHiganbanaPageSetup(&gvar.video); - mv[0].page = &gvar.video.page[0]; - mv[0].map = ↦ - mv[0].video = &gvar.video; - mv[0].pan = &pan; + for(i=0;ispri->x = player[0].ent->spri->y = 20; + strcpy(global_temp_status_text, "press enter for mapGoTo setup\nescape to quit"); + modexprint(mv[0].page/*&gvar.video.page[0]*/, 64, 64, 1, 7, 0, global_temp_status_text); + while(!IN_KeyDown(sc_Enter)){ if(IN_KeyDown(sc_Escape)) goto quit; } IN_UserInput(1,1); //wwww // set up paging //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen mapGoTo(mv, 0, 0); + strcpy(global_temp_status_text, "press enter for final initiation setup\nescape to quit"); + modexprint(&gvar.video.page[0], 64, 64, 1, 7, 0, global_temp_status_text); + while(!IN_KeyDown(sc_Enter)){ if(IN_KeyDown(sc_Escape)) goto quit; } IN_UserInput(1,1); //wwww #endif //TODO: put player in starting position of spot @@ -145,7 +155,6 @@ if(!dbg_noplayerinpu) #ifdef FADE modexFadeOn(4, gpal); #endif - if(!dbg_noplayerinpu) while(!IN_KeyDown(sc_Escape))// && player[0].hp>0) { shinku(&gvar); @@ -222,14 +231,9 @@ if(!dbg_noplayerinpu) player[0].hp = 0; } - else - while(!kbhit()) - { - shinku(&gvar); - } - /* fade back to text mode */ /* but 1st lets save the game palette~ */ + quit: #ifdef FADE modexPalSave(gpal); modexSavePalFile("data/g.pal", gpal); @@ -239,31 +243,7 @@ if(!dbg_noplayerinpu) Shutdown16(&gvar); printf("\nProject 16 zcroll.exe. This is just a test file!\n"); printf("version %s\n", VERSION); - printf("tx: %d ", mv[0].tx); - printf("ty: %d\n", mv[0].ty); - printf("\n"); - 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(" 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("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 ", 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("\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]); - - printf("\n"); + SCROLLEXITMESG; switch(detectcpu()) { case 0: cpus = "8086/8088 or 186/88"; break;