From 6556e86810e8560cb88a0c0042c7366240ab4e60 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 8 Dec 2016 14:33:05 -0600 Subject: [PATCH] scroll.exe works again but the fps thingy dose not work because of MM --- src/inputest.c | 8 ++++++-- src/lib/16_dbg.c | 1 + src/lib/16_dbg.h | 1 + src/lib/16_tail.c | 22 +++++++++++++++++++--- src/scroll.c | 16 ++++------------ 5 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/inputest.c b/src/inputest.c index cd566a34..c4b59fd9 100755 --- a/src/inputest.c +++ b/src/inputest.c @@ -36,6 +36,8 @@ main(int argc, char *argv[]) dbg_noplayerinpu=0; if(!dbg_noplayerinpu) { + start_timer(&gvar); + //Startup16(&gvar); IN_Startup(); //IN_Default(0,&player,ctrl_Joystick1); //IN_SetControlType(0,&player,ctrl_Joystick1); @@ -46,7 +48,7 @@ main(int argc, char *argv[]) player[0].d=2; player[0].persist_aniframe=0; player[0].speed=4; - start_timer(&gvar); + nibbletest(); if(dbg_noplayerinpu) getch(); booleantest(); @@ -113,7 +115,9 @@ main(int argc, char *argv[]) //IN_Ack(); } } - IN_Shutdown(); } + IN_Shutdown(); + //Shutdown16(&gvar); + } //printf("%u\n", in.Keyboard[sc_Escape]); printf("inputest.exe "); printf("version %s\n", VERSION); diff --git a/src/lib/16_dbg.c b/src/lib/16_dbg.c index 960e7604..9594b6cf 100755 --- a/src/lib/16_dbg.c +++ b/src/lib/16_dbg.c @@ -9,6 +9,7 @@ boolean dbg_debugpm=0; #ifdef __DEBUG_InputMgr__ boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0,dbg_noplayerinpu=0; #endif +boolean dbg_nommpmca=0; #endif diff --git a/src/lib/16_dbg.h b/src/lib/16_dbg.h index 32c89b59..381ed567 100755 --- a/src/lib/16_dbg.h +++ b/src/lib/16_dbg.h @@ -18,6 +18,7 @@ extern boolean dbg_debugpm; #ifdef __DEBUG_InputMgr__ extern boolean dbg_testkeyin,dbg_testcontrolnoisy,dbg_noplayerinpu; #endif +extern boolean dbg_nommpmca; #endif # ifdef DEBUGSERIAL diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index 414e51a1..02216ce6 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -38,6 +38,8 @@ void Startup16(global_game_variables_t *gvar) { #ifdef __WATCOMC__ + start_timer(gvar); + // DOSLIB: check our environment probe_dos(); @@ -69,16 +71,21 @@ void Startup16(global_game_variables_t *gvar) #endif gvar->mm.mmstarted=0; gvar->pm.PMStarted=0; +#ifdef __DEBUG__ + if(!dbg_nommpmca) +#endif MM_Startup(gvar); if(!dbg_noplayerinpu) IN_Startup(gvar); +#ifdef __DEBUG__ + if(!dbg_nommpmca){ +#endif PM_Startup(gvar); PM_UnlockMainMem(gvar); CA_Startup(gvar); -#ifdef __WATCOMC__ - start_timer(gvar); +#ifdef __DEBUG__ + } #endif - } //=========================================================================== @@ -95,11 +102,20 @@ if(!dbg_noplayerinpu) void Shutdown16(global_game_variables_t *gvar) { +#ifdef __DEBUG__ + if(!dbg_nommpmca) +#endif PM_Shutdown(gvar); if(!dbg_noplayerinpu) IN_Shutdown(gvar); +#ifdef __DEBUG__ + if(!dbg_nommpmca){ +#endif CA_Shutdown(gvar); MM_Shutdown(gvar); +#ifdef __DEBUG__ + } +#endif } diff --git a/src/scroll.c b/src/scroll.c index 114cad0f..bb086304 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_noplayerinpu=1; +boolean dbg_nommpmca=1; //word far *clock= (word far*) 0x046C; /* 18.2hz clock */ //bitmap_t *p; @@ -69,8 +69,6 @@ void main(int argc, char *argv[]) pan.pn=1; - start_timer(&gvar); - /* create the map */ fprintf(stderr, "testing map load~ "); loadmap("data/test.map", &map); @@ -96,11 +94,7 @@ void main(int argc, char *argv[]) #endif /* input! */ if(!dbg_noplayerinpu) - { - IN_Startup(); IN_Default(0,&player,ctrl_Keyboard1); - //IN_Default(1,&player,ctrl_Joystick); - } /* save the palette */ #ifdef MODEX @@ -205,7 +199,7 @@ void main(int argc, char *argv[]) if(!panswitch){ walk(mv, &player, 0); }else{ - panpagemanual(mv, player, 0); + panpagemanual(mv, &player, 0); //printf(" player[0].q: %d", player[0].q); printf(" player[0].d: %d\n", player[0].d); } @@ -303,8 +297,7 @@ void main(int argc, char *argv[]) #endif VGAmodeX(0, 1, &gvar); #endif - if(!dbg_noplayerinpu) - IN_Shutdown(); + 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); @@ -333,8 +326,7 @@ void main(int argc, char *argv[]) //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); - //0000printf("\ngvar.video.tickclk=%f\n", gvar.video.tickclk); - //0000printf("gvar.video.clk=%f", gvar.video.clk); + //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("\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]); -- 2.39.5