- if (vol < 5 && (PicoOpt&8) && prev_frame == Pico.m.frame_count - 1 && wait_frames < 12)\r
- wait_frames++;\r
- else {\r
- if (is_up) {\r
- if (vol < 99) vol++;\r
- } else {\r
- if (vol > 0) vol--;\r
- }\r
- wait_frames = 0;\r
- sndout_oss_setvol(vol, vol);\r
- currentConfig.volume = vol;\r
- }\r
- sprintf(noticeMsg, "VOL: %02i", vol);\r
- gettimeofday(¬iceMsgTime, 0);\r
- prev_frame = Pico.m.frame_count;\r
- }\r
-\r
- // set the right mixer func\r
- if (!(PicoOpt&8)) return; // just use defaults for mono\r
- if (vol >= 5)\r
- PsndMix_32_to_16l = mix_32_to_16l_stereo;\r
- else {\r
- mix_32_to_16l_level = 5 - vol;\r
- PsndMix_32_to_16l = mix_32_to_16l_stereo_lvl;\r
- }\r
-}\r
-\r
-static void RunEvents(unsigned int which)\r
-{\r
- if (which & 0x1800) // save or load (but not both)\r
- {\r
- int do_it = 1;\r
- if ( emu_checkSaveFile(state_slot) &&\r
- (( (which & 0x1000) && (currentConfig.EmuOpt & 0x800)) || // load\r
- (!(which & 0x1000) && (currentConfig.EmuOpt & 0x200))) ) { // save\r
-#if 0\r
- unsigned long keys;\r
- blit("", (which & 0x1000) ? "LOAD STATE? (Y=yes, X=no)" : "OVERWRITE SAVE? (Y=yes, X=no)");\r
- while ( !((keys = gp2x_joystick_read(1)) & (GP2X_X|GP2X_Y)) )\r
- usleep(50*1024);\r
- if (keys & GP2X_X) do_it = 0;\r
- while ( gp2x_joystick_read(1) & (GP2X_X|GP2X_Y) ) // wait for release\r
- usleep(50*1024);\r
- clearArea(0);\r
-#endif\r
- }\r
- if (do_it) {\r
- osd_text(4, g_screen_height-16, (which & 0x1000) ? "LOADING GAME" : "SAVING GAME");\r
- PicoStateProgressCB = emu_state_cb;\r
- //gp2x_memcpy_all_buffers(g_screen_ptr, 0, g_screen_width*g_screen_height*2);\r
- emu_SaveLoadGame((which & 0x1000) >> 12, 0);\r
- PicoStateProgressCB = NULL;\r
- }\r
-\r
- reset_timing = 1;\r
- }\r
- if (which & 0x0400) // switch renderer\r
- {\r
- if ( PicoOpt&0x10) { PicoOpt&=~0x10; currentConfig.EmuOpt |= 0x80; }\r
- else if (!(currentConfig.EmuOpt&0x80)) PicoOpt|= 0x10;\r
- else currentConfig.EmuOpt &= ~0x80;\r
-\r
- vidResetMode();\r
-\r
- if (PicoOpt&0x10) {\r
- strcpy(noticeMsg, " 8bit fast renderer");\r
- } else if (currentConfig.EmuOpt&0x80) {\r
- strcpy(noticeMsg, "16bit accurate renderer");\r
- } else {\r
- strcpy(noticeMsg, " 8bit accurate renderer");\r
- }\r
-\r
- gettimeofday(¬iceMsgTime, 0);\r
- }\r
- if (which & 0x0300)\r
- {\r
- if(which&0x0200) {\r
- state_slot -= 1;\r
- if(state_slot < 0) state_slot = 9;\r