From 4846968ba4d9a17dd5d3988e70ac5857c3a14792 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sun, 11 Jan 2009 18:38:34 +0000 Subject: [PATCH] Corrected speed limits --- CHANGES.WII | 5 ++++- Src/C64_SDL.i | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGES.WII b/CHANGES.WII index a68d11d..9f0bff7 100644 --- a/CHANGES.WII +++ b/CHANGES.WII @@ -1,8 +1,11 @@ version 3: + * Various cleanup of the code + * Fixed a bug in the menu code which was triggered when there is more than one submenu - * Make speed configurable and change the menus a bit + * Make speed configurable (basically fast/normal/slow) and + change the menus a bit * Skip SDL_Delay and SDL_GetTicks() which seem to give strange results. Use gettime and usleep instead. diff --git a/Src/C64_SDL.i b/Src/C64_SDL.i index d32d685..b5d49da 100644 --- a/Src/C64_SDL.i +++ b/Src/C64_SDL.i @@ -345,14 +345,19 @@ void C64::other_options(Prefs *np) menu_t display_menu; int submenus[2] = { np->DisplayOption}; +#define SPEED_95 40 +#define SPEED_110 34 +#define SPEED_100 38 + switch (np->MsPerFrame) { - case 36: + case SPEED_95: submenus[1] = 0; break; - case 38: - submenus[1] = 1; break; - default: + case SPEED_110: submenus[1] = 2; break; + default: + /* If it has some other value... */ + submenus[1] = 1; break; } menu_init(&display_menu, this->menu_font, other_options_messages, 32, 32, MENU_SIZE_X, MENU_SIZE_Y); @@ -363,12 +368,12 @@ void C64::other_options(Prefs *np) switch(submenus[1]) { case 0: - np->MsPerFrame = 36; break; + np->MsPerFrame = SPEED_95; break; case 1: - np->MsPerFrame = 38; break; + np->MsPerFrame = SPEED_100; break; case 2: default: - np->MsPerFrame = 39; break; + np->MsPerFrame = SPEED_110; break; } this->prefs_changed = true; }