aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2021-03-22 15:11:21 +0000
committerneonloop2021-03-22 15:11:21 +0000
commit0688325a887ddfc24f5904204a4635af66d85444 (patch)
treefeec05e77559c2c190e1ffc04f3bf9f8c29b5453
parent17a4dac3f526e9894b64028c9b60b55471cf3155 (diff)
downloadpcsx_rearmed-0688325a887ddfc24f5904204a4635af66d85444.tar.gz
pcsx_rearmed-0688325a887ddfc24f5904204a4635af66d85444.tar.bz2
pcsx_rearmed-0688325a887ddfc24f5904204a4635af66d85444.zip
Adds per-game config when loading a game from args
Per-game config can only be loaded after the CD image is loaded, which has to happen after plugins are initialized, which has to happen after the config is loaded. This change loads the global config first, and tries to load per-game config after the CD is loaded. This may not work 100% of the time, but works better than it does right now.
-rw-r--r--frontend/main.c1
-rw-r--r--frontend/menu.c2
-rw-r--r--frontend/menu.h1
-rw-r--r--frontend/plat_trimui.c56
4 files changed, 31 insertions, 29 deletions
diff --git a/frontend/main.c b/frontend/main.c
index e2b00d6..c1f1cc4 100644
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -633,6 +633,7 @@ int main(int argc, char *argv[])
SysPrintf(_("Could not load CD-ROM!\n"));
return -1;
}
+ menu_load_config(1);
emu_on_new_cd(!loadst);
ready_to_go = 1;
}
diff --git a/frontend/menu.c b/frontend/menu.c
index 2196258..fc95294 100644
--- a/frontend/menu.c
+++ b/frontend/menu.c
@@ -595,7 +595,7 @@ static void parse_str_val(char *cval, const char *src)
static void keys_load_all(const char *cfg);
-static int menu_load_config(int is_game)
+int menu_load_config(int is_game)
{
char cfgfile[MAXPATHLEN];
int i, ret = -1;
diff --git a/frontend/menu.h b/frontend/menu.h
index 8f5acda..db9b665 100644
--- a/frontend/menu.h
+++ b/frontend/menu.h
@@ -2,6 +2,7 @@
#define __MENU_H__
void menu_init(void);
+int menu_load_config(int is_game);
void menu_prepare_emu(void);
void menu_loop(void);
void menu_finish(void);
diff --git a/frontend/plat_trimui.c b/frontend/plat_trimui.c
index 907a03a..6b1038a 100644
--- a/frontend/plat_trimui.c
+++ b/frontend/plat_trimui.c
@@ -176,34 +176,34 @@ void plat_minimize(void)
{
}
-#define make_flip_func(name, scale, blitfunc) \
-static void name(int doffs, const void *vram_, int w, int h, int sstride, int bgr24) \
-{ \
- const unsigned short *vram = vram_; \
- unsigned char *conv = (unsigned char *)cspace_buf; \
- unsigned char *dst = (unsigned char *)screen->pixels + \
- (fb_offset_y * 320 + fb_offset_x) * sizeof(uint16_t); \
- int dst_stride = 640; \
- int len = psx_src_width * psx_bpp / 8; \
- int i; \
- void (*convertfunc)(void *dst, const void *src, int bytes); \
- convertfunc = psx_bpp == 24 ? bgr888_to_rgb565 : bgr555_to_rgb565; \
- \
- SDL_LockSurface(screen); \
- vram += psx_offset_y * 1024 + psx_offset_x; \
- for (i = psx_src_height; i > 0; i--, \
- vram += psx_step * 1024, \
- dst += dst_stride, \
- conv += dst_stride) { \
- if (scale) { \
- convertfunc(conv, vram, len); \
- blitfunc(dst, conv, dst_stride); \
- } else { \
- convertfunc(dst, vram, len); \
- } \
- } \
- SDL_UnlockSurface(screen); \
-}
+#define make_flip_func(name, scale, blitfunc) \
+ static void name(int doffs, const void *vram_, int w, int h, int sstride, int bgr24) \
+ { \
+ const unsigned short *vram = vram_; \
+ unsigned char *conv = (unsigned char *)cspace_buf; \
+ unsigned char *dst = (unsigned char *)screen->pixels + \
+ (fb_offset_y * 320 + fb_offset_x) * sizeof(uint16_t); \
+ int dst_stride = 640; \
+ int len = psx_src_width * psx_bpp / 8; \
+ int i; \
+ void (*convertfunc)(void *dst, const void *src, int bytes); \
+ convertfunc = psx_bpp == 24 ? bgr888_to_rgb565 : bgr555_to_rgb565; \
+ \
+ SDL_LockSurface(screen); \
+ vram += psx_offset_y * 1024 + psx_offset_x; \
+ for (i = psx_src_height; i > 0; i--, \
+ vram += psx_step * 1024, \
+ dst += dst_stride, \
+ conv += dst_stride) { \
+ if (scale) { \
+ convertfunc(conv, vram, len); \
+ blitfunc(dst, conv, dst_stride); \
+ } else { \
+ convertfunc(dst, vram, len); \
+ } \
+ } \
+ SDL_UnlockSurface(screen); \
+ }
make_flip_func(raw_blit_soft, false, memcpy)
make_flip_func(raw_blit_soft_368, true, blit320_368)