libretro: set up the FPU before the first frame

save_fpu() and restore_fpu() call the FPU emulation through function
pointers that fpu_reset() only sets up when the first m68k_go() resets
the CPU. A frontend may ask for the state size, or save or load a state,
before the first retro_run() - Kodi does when a game starts - and the
core crashed calling a null pointer.
This commit is contained in:
Chris committed 2026-11-05 08:24:25 +00:00
1 parent 25f488b166
commit 13b89304b2
1 file changed
+5
+5
View File
@@ -479,6 +479,11 @@ RETRO_API bool retro_load_game(const struct retro_game_info *game)
Retro_SetInputDescriptors();
/* The CPU, and with it the FPU emulation that save_fpu() and
* restore_fpu() call into, is only reset by the first m68k_go() in
* retro_run(), but a frontend may save or load a state before that. */
fpu_reset();
game_loaded = true;
return true;