mirror of
https://github.com/libretro/hatari.git
synced 2026-11-07 10:36:00 -10:00
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:
1 parent
25f488b166
commit
13b89304b2
1 file changed
+5
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user