fake-08 icon indicating copy to clipboard operation
fake-08 copied to clipboard

Compile as Retroarch core for Miyoo Mini

Open schmurtzm opened this issue 2 years ago • 8 comments

Hi,

Will it be possible to compile Fake-08 as Retroarch core for Miyoo Mini ? Save state and rewind would be awesome 😉

I tried to compile it but it seems to be only for android for now, isn't it ?

Thank you !

schmurtzm avatar Aug 27 '22 23:08 schmurtzm

Yes, I do plan to compile the libretro core for a few other platforms after its working as expected. Miyoo Mini and Opendingux are at the top of my list, possibly others. I'm not sure when that will be, but it is planned.

jtothebell avatar Aug 28 '22 22:08 jtothebell

That's awesome @jtothebell , do not hesitate if we can help !

Schmurtz (from Onion's Team)

schmurtzm avatar Aug 29 '22 08:08 schmurtzm

@schmurtzm i got this building for the Miyoo mini, but it's not fully working. If I start it using a script through the normal UI, it seems to close as soon as any audio starts to play. If I start retroarch by itself and then load the core and then load a rom, it doesn't close when sound starts but some games don't seem to load (just a black screen). I'll investigate further when I have time.

jtothebell avatar Aug 31 '22 03:08 jtothebell

No in fact there are no difference between command line and when running from Retroarch menu 😉 . I've been fooled too ! When you use Retroarch menu it runs "retro8_libretro.so" because there is an association between .png files and retro8 core which doesn't exist for "fake08_libretro_miyoomini.so". So it runs the wrong core by default and retro8 has a pretty bad compatibility ;) I don't know, may be the file association is made by the .info next to the core ?

Some games are running (starbase for example) but it crash when we press a key (or may be when audio start) . I see that on UART when it crash :

terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_M_create
Aborted (core dumped)

Some others (like shelled shinobi) just crash at start (or may be when audio start ?) : Segmentation fault (core dumped)

Disabling sound in retroarch doesn't make things better...

schmurtzm avatar Sep 01 '22 00:09 schmurtzm

I poked around at this a little bit more today. I verified that just turning off audio (not in retroarch, but by disabling the music and sfx api calls) does make it work, and once I did that everything I tried worked (save states, filters, fast forward, resuming, etc) on various games. I think the next step is probably to sprinkle logs all over to try to track down the crash

jtothebell avatar Sep 17 '22 19:09 jtothebell

#worksonmymachine https://github.com/jtothebell/fake-08/actions/runs/3075769965

jtothebell avatar Sep 18 '22 04:09 jtothebell

Awesome ! Thank you ! I've tested with some games and it works pretty well ! Save state are working directly with Onion 🤩 !

Some feedback even if it is a little soon :

  • restart or close game from Retroarch menu doesn't work (it does nothing)
  • On shelled shinobi, after a state resume some animations of the character doesn't work anymore
  • I miss select to change screen ratio so I took a look in key mapping and it doesn't seems possible to modify it for now.
  • rewind is working, as always it has a bad impact on performance , with SDL audio output the sound is less chopy (we are not far from being able to enable it)

We will do more tests to give more feedback but it seems more than promising 😄

schmurtzm avatar Sep 18 '22 20:09 schmurtzm

I appreciate the testing and feedback. I've at least looked into each item:

  • Restart should be fixed in the latest commit on that branch (restart wasn't implemented). Close game worked for me as well, but I think that worked before? Haven't gone back to double check that.
  • That sounds like an issue saving the lua state, which is definitely the trickiest part of saving state, but it will take some more thorough investigation. Any more specifics could be helpful
  • I think this is out of my control when FAKE-08 is running as a libretro core. It doesn't look like its possible to change scaling modes via a keyboard shortcut.
  • I'm not sure that serialization will be able to be fast enough to enable rewind on the miyoo mini. Saving the lua state is fairly intensive. Its possible that it could be optimized, but thats not a big priority, especially since I"m not sure how much it could be optimized
  • I played several levels of celeste and did not notice anything like this, and am unsure what could possibly cause something like that to happen.

jtothebell avatar Sep 21 '22 01:09 jtothebell

I've played around hundred or more games on the Miyoo Mini and all worked fine (including save states) which is just amazing and all I ever wanted for PICO-8 games.

Two notes though:

  • "Take screenshot" from the RetroArch quick menu doesn't seem to do anything
  • For the resolution and aspect ratio things (interscaling, stretching, pixel perfect and so on) you could put them into "Core options" from within the quick menu as well. Don't know if that's too much effort. However they are also adjustable by going to settings -> video in RetroArch

If I can drop a wish here: Could you please also compile a core for the Switch version of RetroArch (aka a .nro core). I could do some further testing on a bigger screen that way. Since you released the standalone version for the Switch, you already have the build pipeline and it could take not that much effort from you hopefully to do so. Please correct me if I'm wrong.

tarikalmashni avatar Oct 08 '22 20:10 tarikalmashni

Wow, that is really great to hear that that the core is working. I really appreciate that amount of testing as I haven't had the bandwidth to do that much testing, but that should mean I can include the core in the next release.

As far as screenshots, I'm not aware of anything specifically that needs to be implemented on a core to make screenshots work, but I'll do some investigation into that. And for scaling options etc, the core doesn't have direct control over those things. For standalone builds, the various stretching options are already in the fancy menu that can be accessed when a game isn't loaded. I think to add options like that to the pause menu I'd want to work on it to make those options nested so there isn't too many extra options at the top level. That may be an option at some point, but there are so many other things to do I don't think that one is going to get my attention any time soon.

As far as a Switch libretro build, yes you are correct that it shouldn't be a big lift to add, and I do plan on adding that

jtothebell avatar Oct 11 '22 04:10 jtothebell

Feel free to mention me when you have a test build ready for the Switch and I'll happily go into some deep testing.

tarikalmashni avatar Oct 14 '22 12:10 tarikalmashni

@jtothebell Hello there :) Any news on a Switch core yet?

tarikalmashni avatar Jun 20 '23 12:06 tarikalmashni

@tarikalmashni hi! Sorry, I had started work on this and then completely forgotten about it. I just got my switch updated to the latest atmosphere and retroarch, dug up my branch and rebased it to the current code and gave it a go, and it seems to be working. Sorry! That probably means I had it to this point months ago and just got sidetracked. I haven't merged it or put it in an official release yet, but here is the build artifact from the latest run: https://github.com/jtothebell/fake-08/suites/13839174252/artifacts/768472003 . You should just need to copy retroarch/fake08_libretro_libnx.nro into your cores directory (I think it should b SDCARD/retroarch/cores)

jtothebell avatar Jun 24 '23 20:06 jtothebell

@tarikalmashni hi! Sorry, I had started work on this and then completely forgotten about it. I just got my switch updated to the latest atmosphere and retroarch, dug up my branch and rebased it to the current code and gave it a go, and it seems to be working. Sorry! That probably means I had it to this point months ago and just got sidetracked. I haven't merged it or put it in an official release yet, but here is the build artifact from the latest run: https://github.com/jtothebell/fake-08/suites/13839174252/artifacts/768472003 . You should just need to copy retroarch/fake08_libretro_libnx.nro into your cores directory (I think it should b SDCARD/retroarch/cores)

No worries. I enjoyed it on the Miyoo Mini (Plus) for months so no complains here. Thank you very much for the Horizon core, I'll give it a go soon! Much appreciated!

That being said, it would be nice if you could officially streamline it to the Libretro team too so it gets included in future Switch builds for the public. :)

tarikalmashni avatar Jun 24 '23 22:06 tarikalmashni