From: kub Date: Thu, 29 Sep 2022 23:24:43 +0000 (+0000) Subject: psp, enable using new pspdev, fix some bugs X-Git-Tag: v2.00~289 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2d1369cb5dc838f32edb16935a46731e5a762e3;p=picodrive.git psp, enable using new pspdev, fix some bugs --- diff --git a/platform/libpicofe b/platform/libpicofe index f5b32cc3..1889fe24 160000 --- a/platform/libpicofe +++ b/platform/libpicofe @@ -1 +1 @@ -Subproject commit f5b32cc30c98b1772cdfd4ed1ff5476dced770cc +Subproject commit 1889fe241c1c6059f8955a331dd07f08a47cd0b4 diff --git a/platform/psp/in_psp.c b/platform/psp/in_psp.c index c56173d2..f2751703 100644 --- a/platform/psp/in_psp.c +++ b/platform/psp/in_psp.c @@ -140,7 +140,6 @@ static struct { { PSP_CTRL_SQUARE, PBTN_MA3 }, { PSP_CTRL_LTRIGGER, PBTN_L }, { PSP_CTRL_RTRIGGER, PBTN_R }, - { PSP_CTRL_SELECT, PBTN_MENU }, }; #define KEY_PBTN_MAP_SIZE (sizeof(key_pbtn_map) / sizeof(key_pbtn_map[0])) diff --git a/platform/psp/menu.c b/platform/psp/menu.c index d1710a1b..034ef3ee 100644 --- a/platform/psp/menu.c +++ b/platform/psp/menu.c @@ -1,12 +1,12 @@ static const char *men_hscaling_opts[] = { "OFF", "4:3", "wide", "fullscreen", NULL }; static const char *men_vscaling_opts[] = { "OFF", "4:3", "fullscreen", NULL }; -static const char *men_filter_opts[] = { "nearest", "bilinear" }; +static const char *men_filter_opts[] = { "nearest", "bilinear", NULL }; #define MENU_OPTIONS_GFX \ mee_enum ("Horizontal scaling", MA_OPT_SCALING, currentConfig.scaling, men_hscaling_opts), \ mee_enum ("Vertical scaling", MA_OPT_VSCALING, currentConfig.vscaling, men_vscaling_opts), \ - mee_enum_h ("Scaler type", MA_OPT3_FILTERING, currentConfig.filter, men_filter_opts, NULL), \ + mee_enum ("Scaler type", MA_OPT3_FILTERING, currentConfig.filter, men_filter_opts), \ mee_range ("Gamma adjustment", MA_OPT3_GAMMAA, currentConfig.gamma, -4, 16), \ mee_range ("Black level", MA_OPT3_BLACKLVL, currentConfig.gamma2, 0, 2), \ mee_onoff ("Wait for vsync", MA_OPT3_VSYNC, currentConfig.EmuOpt, EOPT_VSYNC), \ diff --git a/platform/psp/plat.c b/platform/psp/plat.c index 287759b9..e5b4cf56 100644 --- a/platform/psp/plat.c +++ b/platform/psp/plat.c @@ -117,7 +117,7 @@ int plat_get_root_dir(char *dst, int len) /* base directory for emulator resources */ int plat_get_skin_dir(char *dst, int len) { - if (len > 4) + if (len > 5) strcpy(dst, "skin/"); else if (len > 0) *dst = 0; @@ -127,7 +127,7 @@ int plat_get_skin_dir(char *dst, int len) /* top directory for rom images */ int plat_get_data_dir(char *dst, int len) { - if (len > 4) + if (len > 5) strcpy(dst, "ms0:/"); else if (len > 0) *dst = 0; @@ -237,7 +237,7 @@ struct plat_target plat_target = { // .hwfilters = plat_hwfilters, }; - +#ifndef DT_DIR /* replacement libc stuff */ int alphasort(const struct dirent **a, const struct dirent **b) @@ -319,14 +319,6 @@ end: return ret; } -int _flush_cache (char *addr, const int size, const int op) -{ - //sceKernelDcacheWritebackAll(); - sceKernelDcacheWritebackRange(addr, size); - sceKernelIcacheInvalidateRange(addr, size); - return 0; -} - /* stubs for libflac (embedded in libchdr) */ #include #include @@ -336,3 +328,12 @@ int chmod(const char *pathname, mode_t mode) { return -1; } int utime(const char *filename, const struct utimbuf *times) { return -1; } int posix_memalign(void **memptr, size_t alignment, size_t size) { *memptr = memalign(alignment, size); return 0; } +#endif + +int _flush_cache (char *addr, const int size, const int op) +{ + //sceKernelDcacheWritebackAll(); + sceKernelDcacheWritebackRange(addr, size); + sceKernelIcacheInvalidateRange(addr, size); + return 0; +} diff --git a/platform/psp/psp.c b/platform/psp/psp.c index cf69ffa5..702d6658 100644 --- a/platform/psp/psp.c +++ b/platform/psp/psp.c @@ -196,7 +196,7 @@ void psp_video_flip(int wait_vsync, int other) { unsigned long fb = (unsigned long)psp_screen & ~0x40000000; if (other) fb ^= 0x44000; - if (wait_vsync) sceDisplayWaitVblankStart(); + //if (wait_vsync) sceDisplayWaitVblankStart(); sceDisplaySetFrameBuf((void *)fb, 512, PSP_DISPLAY_PIXEL_FORMAT_565, wait_vsync ? PSP_DISPLAY_SETBUF_IMMEDIATE : PSP_DISPLAY_SETBUF_NEXTFRAME); current_screen ^= 1;