frameskip_type current_frameskip_type = auto_frameskip;
u32 global_cycles_per_instruction = 1;
u32 random_skip = 0;
+u32 fps_debug = 0;
#ifdef GP2X_BUILD
u32 frameskip_value = 2;
u64 frame_count_initial_timestamp = 0;
u64 last_frame_interval_timestamp;
-u32 gp2x_fps_debug = 0;
void gp2x_init(void);
void gp2x_quit(void);
sceKernelRegisterSubIntrHandler(PSP_VBLANK_INT, 0,
vblank_interrupt_handler, NULL);
sceKernelEnableSubIntr(PSP_VBLANK_INT, 0);
-#elif !defined(GP2X_BUILD)
- freopen("CON", "wb", stdout);
#endif
extern char *cpu_mode_names[];
exit(-1);
}
+ set_clock_speed();
set_gba_resolution(screen_scale);
video_resolution_small();
update_gbc_sound(cpu_ticks);
- if(gp2x_fps_debug)
+ if(fps_debug)
{
char print_buffer[32];
sprintf(print_buffer, "%d (%d)", fps, frames_drawn);
{
printf(str, val);
}
+
+void set_clock_speed()
+{
+ static u32 clock_speed_old = default_clock_speed;
+ if (clock_speed != clock_speed_old)
+ {
+ printf("about to set CPU clock to %iMHz\n", clock_speed);
+ #ifdef PSP_BUILD
+ scePowerSetClockFrequency(clock_speed, clock_speed, clock_speed / 2);
+ #elif defined(GP2X_BUILD)
+ set_FCLK(clock_speed);
+ #endif
+ clock_speed_old = clock_speed;
+ }
+}
+