• HomeBoards
  • RulesRules
  • HelpHelp
  • WikiWiki
  • Donate

Author Topic: Mupen64Plus Retroarch core not working.  (Read 4895 times)

RuffTeckM (OP)

  • Posts: 7
Mupen64Plus Retroarch core not working.
« on: August 10, 2017, 11:15:33 pm »
Hello, today I got my GPD XD and directly installed the Legacy ROM without any issues and CWM working and all. Thanks for the development and great tutorials and support here! I've been reading here a lot but thought it was time to register now to share my issue.

Overall I'm happy with the device and I got about everything up and running however the mupen64 core isn't working on my GPD XD.

I get the message failed to load libretro core. However on my Galaxy S8+ everything just works fine with and so does the standalone mupen64 app from the play store on both device's.

Now the real issue is that I can't share my save game with my computer. I've found the directories on the GPD for the standalone mupen64 app but the extension of the save and state files are different from the Retroarch ones on my desktop.

Now I've loaded the other N64 core in Retroarch, ParaLLei, but that core doesn't support texture packs. Sharing the saved state doesn't seem to work either but sharing normal save games do work.

For me it looks like Android 4.4 isn't supported because my S8 on Android 7 runs the core just fine.

I've read some stuff to convert the save games so I can get them to work with the standalone app but maybe somebody else here knows why the Mupen64 core doesn't work. Or has a better work around to solve my issue.
« Last Edit: August 10, 2017, 11:36:03 pm by RuffTeckM »

CommanderKitler

  • Posts: 129
Re: Mupen64Plus Retroarch core not working.
« Reply #1 on: August 11, 2017, 02:28:23 am »
You're right Retroarchs mupen core won't run on the GPD XD  :o

And after I did some digging in logcat I found out you're also right about the version being the problem:

Code: [Select]
E/RetroArch(  7191): Failed to open core: "/data/data/com.retroarch/cores/mupen64plus_libretro_android.so"
E/RetroArch(  7191): dlopen failed: cannot locate symbol "srand" referenced by "mupen64plus_libretro_android.so"...

In android API 19 (android 4.4.X) the function "srand()" is a static inline function invoking the function "srand48()".
In android API 20 (android 5.X) srand is defined as "void srand(unsigned int)"

So either mupen64plus needs the new srand (I doubt that as AE and FZ edition work on 4.4.4) or the guy that compiled the core did mess up and should have used "std::srand()" instead of "srand()" and compile against API version 19 or lower.

As the core is opensource you could compile your own version or open up an issue thread on libretro's github page.
I might try both if I find the time to do so.

UPDATE: looks like the libretro guys are aware that some symbols arent exporting on something older than 5.0
             still opening an issue thread might be useful if a version using std::srand works on both pre- and
             post-api20 systems
« Last Edit: August 11, 2017, 02:41:58 am by CommanderKitler »

RuffTeckM (OP)

  • Posts: 7
Re: Mupen64Plus Retroarch core not working.
« Reply #2 on: August 11, 2017, 06:11:00 am »
Thanks for your very detailed answer. I'm not really a coder but have been able to do some editing someone's code with php and the Arduino environment. I can't find the issue on GitHub but I might not be looking in the right direction.

I'll have a closer look later today and report back my findings.

RuffTeckM (OP)

  • Posts: 7
Re: Mupen64Plus Retroarch core not working.
« Reply #3 on: August 11, 2017, 10:24:36 am »
I don't know where to start to compile my own core which could possibly work.

I've tried to search to convert the Retroarch srm save file the sra format which is used by Mupen64Plus FZ standalone app but I can only find converters the other way around so I guess I'm stuck with the ParaLLei core until this is fixed or someone can point me in the right direction.

I did found the function in the file mupen64plus-core\src\main\zip\crypt.h (line 112) but I've no clue how I can compile it to a .so file which can be used in Retroarch.
« Last Edit: August 11, 2017, 10:39:24 am by RuffTeckM »

skelton

  • Posts: 6894
Re: Mupen64Plus Retroarch core not working.
« Reply #4 on: August 11, 2017, 12:10:55 pm »
Try in retroarch forums, maybe they can fix easily so you don't neeed to compile.
Retired

CommanderKitler

  • Posts: 129
Re: Mupen64Plus Retroarch core not working.
« Reply #5 on: August 11, 2017, 05:01:56 pm »
Try in retroarch forums, maybe they can fix easily so you don't neeed to compile.

AFAIK the only fix for this issue is recompiling the mupen core with either utilizing the std namespace or compiling the retroarch app against api 19.

Sure, maybe someone on the RetroArch forum will recompile it or already has a working version to share still I
will try compiling the core with NDK and std::srand ASAP and will post an update if I have any success.
« Last Edit: August 12, 2017, 02:58:36 am by CommanderKitler »

RuffTeckM (OP)

  • Posts: 7
Re: Mupen64Plus Retroarch core not working.
« Reply #6 on: August 11, 2017, 11:59:23 pm »
That would be awesome! Good luck with the process and thanks for your help a lot.

I have however made a similar post on the RetroArch forums and quoted your founding on the srand function. I wanted to do that in the first place but wasn't able to post over there. Had to read some posts first and upload an avatar to be approved to make a topic. Today I received some badges and was allowed to make a topic hehe.

No replies there yet though.

CommanderKitler

  • Posts: 129
Re: Mupen64Plus Retroarch core not working.
« Reply #7 on: August 12, 2017, 05:33:05 am »
Ok here's a little update on how far I got.

So there is a "libretro-super"-repo for compiling retroarch for different platforms.

After downloading and installing the android SDK and NDK needed for compiling c++ code and downloading the (around 3gb large)'libretro-super'-repo for android (a horribly slow process) I used grep to find the files using srand() which are 'OpenGL.cpp' and 'crypt.h' and changed it to std::srand()
(without knowing if it would work). To compile retroarch for android you first run 'libretro-build-android-mk.sh' to build the cores so I did that and to my surprise it build most cores but not mupen  - in fact it didn't even attempt to  :(.

So after opening the file in a text editor I found out that it actually specifies which cores to build and some cores (for instance mupen or PPSSPP) are not on that list- so I added it just to find out that it is missing some files like a libretro.so and a jni folder with some .mk files needed by the NDK making it skip mupen when building because it doesn't know what to do with it. 

So after that I tried 'libretro-build-android-armeabi_v7a.sh' which tries to build retroarch itself requiring all the cores including, yes indeed: mupen  >:(

Theres a tutorial for building retroarch for android but it seems to ignore the cores missing. So all-in-all the situation looks pretty bad. Lets hope for some replies on that retroarch forum thread.

I'll try again tomorrow by following the tutorial and compiling against android API 14. it's a bit desperate but maybe thats enough to make it work.

RuffTeckM (OP)

  • Posts: 7
Re: Mupen64Plus Retroarch core not working.
« Reply #8 on: August 12, 2017, 09:32:53 am »
Well at least you tried and got something going.

The topic I made on the RetroArch forums can be found here:
https://forums.libretro.com/t/mupen64plus-core-broken-on-android-4-4/11662

Not much activity going on there it seems.

CommanderKitler

  • Posts: 129
Re: Mupen64Plus Retroarch core not working.
« Reply #9 on: August 19, 2017, 08:31:39 am »
Kept you waiting huh?

So I've put a couple of days of work into this and I've made some discoveries about retroarch and android itself...

Ok my first assumption about srand being the culprit was right... kinda. srand() is a problem indeed, so is rand(), atof(), stdcpy(), stdin(), stdout(), stderr() and some more. This whole core uses references to functions that aren't implemented in android 4.4's c++ libraries  :-\  . And this whole misery is not entirely retroarch's fault; Android 4.4 is missing some pretty elementary libraries (like basic input/output-streams) which are found on most Platforms/Operating-Systems since C++11. Some of those functions where already deprecated when added to android 5.0  :o .

So after finding out how to compile the mupen core (It compiles against an Android NDK standalone Toolchain duuuh  ::) ) I got myself into a huge mess with dozens of refences that only work with 5.0 and up , this might be fixable but don't get your hopes up as I am stuck at the moment (can't find the stpcpy() reference in the code) and might not be able to compile a functioning version.

Your best bet right now is searching for an older Mupen Core version (looks like Mupen was still working on 4.4 in 2016)
and hope that it works with recent retroarch versions  :( I haven't  had any luck myself though as libretro/retroarch doesn't keep deprecated cores.

It's crazy to think most of the cores are running even on windows 98 but android 4.4 is having problems.

RuffTeckM (OP)

  • Posts: 7
Re: Mupen64Plus Retroarch core not working.
« Reply #10 on: August 19, 2017, 07:03:32 pm »
No problem you kept me/us waiting, you've done quite some research it seems. Thanks for your time and efforts, if it isn't possible it is how it is. At least I can play N64 games and let's just hope more cores don't break in the future.

I'm on holiday now so won't be able to test older cores but will do once I'm back.

CommanderKitler

  • Posts: 129
Re: Mupen64Plus Retroarch core not working.
« Reply #11 on: August 21, 2017, 09:57:11 pm »
THIS: https://buildbot.libretro.com/stable/archive/stable/android/armebi-v7a/1.0.0.2/cores/mupen64plus_libretro_android.so.zip

Looks like there are still some old versions of retroarch in the buildbot repo. I tested this one with retroarch 1.6.7 (newest as of now) and it seems to be working like a charm (for now at least).

should have tried looking for this sooner


I wish I had the source code for this version though, because without the source and without mirrors, this core version might get lost forever sometime in the future.

 

Post a new topic