mirror of
https://github.com/EmiiBytee/np2kai-ps4.git
synced 2026-10-27 21:01:01 +01:00
44 lines
1.5 KiB
Diff
44 lines
1.5 KiB
Diff
--- /tmp/libretro.c.orig 2026-07-28 03:06:00.035007442 +0000
|
|
+++ third_party/NP2kai/sdl/libretro/libretro.c 2026-07-28 03:06:10.236972347 +0000
|
|
@@ -93,6 +93,9 @@
|
|
|
|
static void update_variables(void);
|
|
|
|
+/* NP2KAI_PS4_RELOAD_FIX */
|
|
+extern int firstcall;
|
|
+
|
|
/* media swap support */
|
|
struct retro_disk_control_callback dskcb;
|
|
extern char np2_main_disk_images_paths[50][MAX_PATH];
|
|
@@ -827,7 +830,19 @@
|
|
//dummy functions
|
|
void retro_set_audio_sample(retro_audio_sample_t cb){}
|
|
bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info){return false;}
|
|
-void retro_unload_game (void){}
|
|
+void retro_unload_game (void)
|
|
+{
|
|
+ /* NP2KAI_PS4_RELOAD_FIX
|
|
+ * firstcall es un static que solo se pone a 0 y nunca vuelve a 1, asi que
|
|
+ * pre_main() -la inicializacion de verdad de la maquina- solo corria una vez
|
|
+ * por proceso. Al volver a la biblioteca y cargar otra vez, retro_deinit()
|
|
+ * ya habia llamado a np2_end() y destruido la maquina, pero pre_main() no
|
|
+ * se volvia a ejecutar: el core seguia corriendo sobre estado destruido y la
|
|
+ * aplicacion se caia. Descargar el juego tiene que dejarlo listo para la
|
|
+ * siguiente carga. */
|
|
+ firstcall = 1;
|
|
+ did_reset = false;
|
|
+}
|
|
|
|
void retro_set_video_refresh(retro_video_refresh_t cb)
|
|
{
|
|
@@ -1711,7 +1726,8 @@
|
|
}
|
|
extern void playretro();
|
|
|
|
-static int firstcall=1;
|
|
+/* NP2KAI_PS4_RELOAD_FIX: definido aqui, declarado arriba */
|
|
+int firstcall=1;
|
|
|
|
/* NP2KAI_PS4_ADAPTIVE_DRAW_CONTROL */
|
|
#if defined(__PS4__) || defined(PS4)
|