X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_timer.c;h=5cb216c19b48f47ce61eff49b157f55e9c382636;hb=704ec571885c6255ead65280428ad72510cfe218;hp=e45ee9484c4e6fe5d6b3c2322ebafea830815c55;hpb=47cdc66151d973d975d0e31fb8a786eb639bebdb;p=16.git diff --git a/src/lib/16_timer.c b/src/lib/16_timer.c index e45ee948..5cb216c1 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 + * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -22,6 +22,8 @@ #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(); @@ -29,8 +31,8 @@ clock_t start_timer(global_game_variables_t *gv) gv->kurokku.clock_start = *clockw; gv->kurokku.clock = clockw; //gv->kurokku.frames_per_second = 60; - gv->pee = _nmalloc(sizeof(byte)*16); - //turn this off if XT + + //turn this off if XT switch(detectcpu()) { case 0: @@ -63,6 +65,9 @@ double time_in_seconds(global_game_variables_t *gv) return (gv->kurokku.t) / CLOCKS_PER_SEC; } +// big global status text buffer +char global_temp_status_text[512]; + /*double time_in_seconds(time_t in_t) { return (in_t) / CLOCKS_PER_SEC; @@ -75,8 +80,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; }