diff --git a/Src/Display.h b/Src/Display.h index 422c1c0..a25933e 100644 --- a/Src/Display.h +++ b/Src/Display.h @@ -147,7 +147,7 @@ private: char networktraffic_string[80]; // Speedometer text void draw_string(SDL_Surface *s, int x, int y, const char *str, uint8 front_color, uint8 back_color); char *on_screen_message; - int on_screen_message_start_time; + Uint32 on_screen_message_start_time; int on_screen_message_time; #endif diff --git a/Src/Display_SDL.h b/Src/Display_SDL.h index 38c2c2f..1782b50 100644 --- a/Src/Display_SDL.h +++ b/Src/Display_SDL.h @@ -229,12 +229,11 @@ void C64Display::Update(uint8 *src_pixels) draw_string(real_screen, 0, 0, networktraffic_string, black, fill_gray); if (this->on_screen_message) { - struct timeval tv; - gettimeofday(&tv, NULL); + Uint32 time_now = SDL_GetTicks(); draw_string(real_screen, 60, 30, this->on_screen_message, black, fill_gray); - if (tv.tv_sec - this->on_screen_message_start_time > this->on_screen_message_time) + if (time_now - this->on_screen_message_start_time > this->on_screen_message_time * 1000) this->on_screen_message = NULL; } @@ -248,11 +247,10 @@ void C64Display::Update() void C64Display::display_status_string(char *str, int seconds) { - struct timeval tv; - gettimeofday(&tv, NULL); + Uint32 time_now = SDL_GetTicks(); this->on_screen_message = str; - this->on_screen_message_start_time = tv.tv_sec; + this->on_screen_message_start_time = time_now; this->on_screen_message_time = seconds; }