X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fpsp%2Fpsp.c;h=e740f2158a48966ca9595feb98fedddc71982bb1;hb=70357ce52578dee0dd3b3663902cf872c3d34258;hp=48e5e63e36795e61d341333770d8a3ac6b9eead8;hpb=7d4906bfc93ced40a544534f433f06b00add52b0;p=picodrive.git diff --git a/platform/psp/psp.c b/platform/psp/psp.c index 48e5e63..e740f21 100644 --- a/platform/psp/psp.c +++ b/platform/psp/psp.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "psp.h" @@ -76,7 +77,8 @@ void psp_finish(void) void psp_video_flip(int wait_vsync) { if (wait_vsync) sceDisplayWaitVblankStart(); - sceDisplaySetFrameBuf(psp_screen, 512, PSP_DISPLAY_PIXEL_FORMAT_565, PSP_DISPLAY_SETBUF_NEXTFRAME); + sceDisplaySetFrameBuf(psp_screen, 512, PSP_DISPLAY_PIXEL_FORMAT_565, + wait_vsync ? PSP_DISPLAY_SETBUF_IMMEDIATE : PSP_DISPLAY_SETBUF_NEXTFRAME); current_screen ^= 1; psp_screen = current_screen ? PSP_VRAM_BASE0 : PSP_VRAM_BASE1; } @@ -108,6 +110,19 @@ unsigned int psp_pad_read(int blocking) return pad.Buttons; } +int psp_get_cpu_clock(void) +{ + return scePowerGetCpuClockFrequencyInt(); +} + +int psp_set_cpu_clock(int clock) +{ + int ret = scePowerSetClockFrequency(clock, clock, clock/2); + if (ret != 0) lprintf("failed to set clock: %i\n", ret); + + return ret; +} + /* alt logging */ #define LOG_FILE "log.log"