AZO234 / NP2kai

Neko Project II kai
http://domisan.sakura.ne.jp/article/np2kai/np2kai.html
MIT License
246 stars 61 forks source link

[Libretro] Fix saving states #163

Closed yoshisuga closed 1 year ago

yoshisuga commented 1 year ago

I was running the core on iOS, and noticed that it would crash on saving the state. I compiled the core with DEBUG=1, and ran RetroArch in Xcode with exception breakpoints set so I can see where in the code the crash was happening.

It crashes here: https://github.com/AZO234/NP2kai/blob/master/sdl/dosio.c#L298

It crashes on executing the fileno command:

Screenshot 2023-01-21 at 10 52 24 PM

From the stack trace, it cannot get a mutex lock on the file handle. I don't know why that's happening, but I suspect that this is happening only in libretro builds, and it looks like it's happening for other platforms on libretro as well.

I removed the fileno call for libretro, and it results in saving states successfully. I was able to load states successfully as well.

yoshisuga commented 1 year ago

stdioやfilenoの事は詳しく知らないのですが、多分これでlibretroでのセーブステートは動くと思います。

yoshisuga commented 1 year ago

This could fix #138

AZO234 commented 1 year ago

ありがとうございます。 これで様子を見たいと思います。

Gamesirvictim commented 2 months ago

Could you fix android core. Can you upload it.