X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_timer.c;h=c4a80522f032500514909a5d45decb9addd40d37;hb=a565be31ce92d6168ae6983042da75b0b683e52b;hp=9b73b887f22f5db05b65a39efcdd121e05ad9092;hpb=631d2bde47de81ead5300f7aca378447387f254c;p=16.git diff --git a/src/lib/16_timer.c b/src/lib/16_timer.c index 9b73b887..c4a80522 100755 --- a/src/lib/16_timer.c +++ b/src/lib/16_timer.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -22,16 +22,18 @@ #include "src/lib/16_timer.h" +static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ + clock_t start_timer(global_game_variables_t *gv) { gv->kurokku.t = clock(); - gv->kurokku.tiku = 0; + gv->kurokku.tiku = 0; gv->video.sfip = 0; gv->kurokku.clock_start = *clockw; - gv->kurokku.clock = clockw; - //gv->kurokku.frames_per_second = 60; - gv->pee = _nmalloc(sizeof(byte)*16); + gv->kurokku.clock = (word *)clockw; + gv->kurokku.wcpu = WCPU_detectcpu(); + //turn this off if XT - switch(detectcpu()) + switch(gv->kurokku.wcpu) { case 0: gv->kurokku.fpscap=0; @@ -39,7 +41,7 @@ clock_t start_timer(global_game_variables_t *gv) break; default: gv->kurokku.fpscap=1; - gv->kurokku.frames_per_second=60; + gv->kurokku.frames_per_second=FPSVALUE; break; } return gv->kurokku.t; @@ -68,6 +70,7 @@ double time_in_seconds(global_game_variables_t *gv) return (in_t) / CLOCKS_PER_SEC; }*/ +#if 0 /* sync */ void shinkutxt(global_game_variables_t *gv) { @@ -75,8 +78,8 @@ void shinkutxt(global_game_variables_t *gv) if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second)) { //t=(((*(gv->clock))-gv->clock_start) /18.2); - sprintf(gv->pee, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv)); - fprintf(stderr, "%s\n", gv->pee); + sprintf(global_temp_status_text, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv)); + fprintf(stderr, "%s\n", global_temp_status_text); //(gv->clock_start)=*(gv->clock); gv->kurokku.tiku=0; } @@ -94,6 +97,7 @@ void shinkutxt(global_game_variables_t *gv) // } } +//#if 0 void WaitPee() { while(inp(INPUT_STATUS_1) & 8) { @@ -104,3 +108,4 @@ void WaitPee() /* spin */ } } +#endif