misc bug fixes, enabled sleep from options menus
This commit is contained in:
parent
f9eee026f3
commit
4bb5bf11ba
2 changed files with 12 additions and 20 deletions
|
|
@ -291,12 +291,7 @@ int main(int argc , char* argv[]) {
|
||||||
|
|
||||||
GFX_flip(screen);
|
GFX_flip(screen);
|
||||||
}
|
}
|
||||||
else {
|
else GFX_sync();
|
||||||
// slow down to 60fps
|
|
||||||
uint32_t frame_duration = SDL_GetTicks() - frame_start;
|
|
||||||
#define kTargetFrameDuration 17
|
|
||||||
if (frame_duration<kTargetFrameDuration) SDL_Delay(kTargetFrameDuration-frame_duration);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_FreeSurface(digits);
|
SDL_FreeSurface(digits);
|
||||||
|
|
|
||||||
|
|
@ -2198,6 +2198,7 @@ static void video_refresh_callback(const void *data, unsigned width, unsigned he
|
||||||
|
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
||||||
|
// NOTE: sound must be disabled for fast forward to work...
|
||||||
static void audio_sample_callback(int16_t left, int16_t right) {
|
static void audio_sample_callback(int16_t left, int16_t right) {
|
||||||
if (!fast_forward) SND_batchSamples(&(const SND_Frame){left,right}, 1);
|
if (!fast_forward) SND_batchSamples(&(const SND_Frame){left,right}, 1);
|
||||||
}
|
}
|
||||||
|
|
@ -2632,9 +2633,9 @@ static MenuList options_shortcuts_menu = {
|
||||||
};
|
};
|
||||||
static char* getSaveDesc(void) {
|
static char* getSaveDesc(void) {
|
||||||
switch (config.loaded) {
|
switch (config.loaded) {
|
||||||
case CONFIG_NONE: return "No config loaded."; break;
|
case CONFIG_NONE: return "Using defaults."; break;
|
||||||
case CONFIG_GLOBAL: return "Global config loaded."; break;
|
case CONFIG_GLOBAL: return "Using global config."; break;
|
||||||
case CONFIG_GAME: return "Game config loaded."; break;
|
case CONFIG_GAME: return "Using game config."; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static int options_shortcuts_open(MenuList* list, int i) {
|
static int options_shortcuts_open(MenuList* list, int i) {
|
||||||
|
|
@ -2661,7 +2662,6 @@ static int options_shortcuts_open(MenuList* list, int i) {
|
||||||
if (button->mod) item->value += RETRO_BUTTON_COUNT;
|
if (button->mod) item->value += RETRO_BUTTON_COUNT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
options_shortcuts_menu.desc = getSaveDesc();
|
|
||||||
Menu_options(&options_shortcuts_menu);
|
Menu_options(&options_shortcuts_menu);
|
||||||
return MENU_CALLBACK_NOP;
|
return MENU_CALLBACK_NOP;
|
||||||
}
|
}
|
||||||
|
|
@ -2687,26 +2687,21 @@ static int options_save_confirm(MenuList* list, int i) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MESSAGE_WAIT_DELAY 250 // ms
|
GFX_setMode(MODE_MAIN);
|
||||||
uint32_t message_start = SDL_GetTicks();
|
|
||||||
int ready = 0;
|
|
||||||
int dirty = 1;
|
int dirty = 1;
|
||||||
while (1) {
|
while (1) {
|
||||||
GFX_startFrame();
|
GFX_startFrame();
|
||||||
PAD_poll();
|
PAD_poll();
|
||||||
|
|
||||||
if (!ready && SDL_GetTicks()-message_start>=MESSAGE_WAIT_DELAY) {
|
if (PAD_justPressed(BTN_A) || PAD_justPressed(BTN_B)) break;
|
||||||
ready = dirty = 1;
|
|
||||||
GFX_setMode(MODE_MAIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ready && (PAD_justPressed(BTN_A) || PAD_justPressed(BTN_B))) break;
|
|
||||||
|
|
||||||
|
POW_update(&dirty, NULL, Menu_beforeSleep, Menu_afterSleep);
|
||||||
if (dirty) {
|
if (dirty) {
|
||||||
dirty = 0;
|
dirty = 0;
|
||||||
GFX_clear(screen);
|
GFX_clear(screen);
|
||||||
GFX_blitMessage(message, screen, NULL);
|
GFX_blitMessage(message, screen, NULL);
|
||||||
if (ready) GFX_blitButtonGroup((char*[]){ "A","OKAY", NULL }, screen, 1);
|
GFX_blitButtonGroup((char*[]){ "A","OKAY", NULL }, screen, 1);
|
||||||
GFX_flip(screen);
|
GFX_flip(screen);
|
||||||
}
|
}
|
||||||
else GFX_sync();
|
else GFX_sync();
|
||||||
|
|
@ -2896,6 +2891,8 @@ static int Menu_options(MenuList* list) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POW_update(&dirty, NULL, Menu_beforeSleep, Menu_afterSleep);
|
||||||
|
|
||||||
if (dirty) {
|
if (dirty) {
|
||||||
dirty = 0;
|
dirty = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue