kernels,typing-game: assume uptime does not start from zero
* on platform tha can re-run the game, the game will skip some beginning frames in the second run
This commit is contained in:
parent
9e19ebc991
commit
ade50b257a
1 changed files with 2 additions and 1 deletions
|
@ -151,8 +151,9 @@ int main() {
|
|||
printf("Type 'ESC' to exit\n");
|
||||
|
||||
int current = 0, rendered = 0;
|
||||
uint64_t t0 = io_read(AM_TIMER_UPTIME).us;
|
||||
while (1) {
|
||||
int frames = io_read(AM_TIMER_UPTIME).us / (1000000 / FPS);
|
||||
int frames = (io_read(AM_TIMER_UPTIME).us - t0) / (1000000 / FPS);
|
||||
|
||||
for (; current < frames; current++) {
|
||||
game_logic_update(current);
|
||||
|
|
Loading…
Reference in a new issue