Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling the libretro core #32

Open
golder55 opened this issue Oct 20, 2024 · 9 comments
Open

Compiling the libretro core #32

golder55 opened this issue Oct 20, 2024 · 9 comments

Comments

@golder55
Copy link

Hello,
Could you add any instructions for compiling the device-specific libretro core? or If you could include the compiled core, it would be really helpful.
I tried to compile it as-is however the core didnt work (tried to run it on muOS).
Thank you for including support for libretro.

@YuriSizuku YuriSizuku assigned YuriSizuku and unassigned YuriSizuku Oct 21, 2024
@YuriSizuku
Copy link
Owner

Thank you for your question.
The description of libretro is here #30.
As I am not very familiar with libretro, you can ask @iyzsong, the contributor of libretro for more detials.

@golder55
Copy link
Author

Thank you for addressing this,

Hello @iyzsong, I tried to compile the core as per your instructions, however it doesn't seem to work on muOS. Anything different I should be doing?

@iyzsong
Copy link

iyzsong commented Oct 21, 2024

however it doesn't seem to work on muOS. Anything different I should be doing?

Did you built onsyuri_libretro.so then it not running on muOS, or it doesn't build? Could you provide some error log?

To build, first you need git submodules, eg via: git clone --recurse-submodules https://github.com/YuriSizuku/Ons cripterYuri.git, then you just use cmake with src/onsyuri_libretro as the project directory, eg: cd src/onsyuri_libretro; mkdir build; cd build; cmake ...

To cross build for muOS, the easier way is use a cmake toolchain file via cmake -DCMAKE_TOOLCHAIN_FILE=/PATH/TO/TOOLCHAINFILE.cmake .., I think muOS's SDK should provide that, something like (this is a example cmake toolchain file I use for armv7, not for muOS):

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_SYSROOT /opt/rk3128/sysroot)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_C_COMPILER /opt/rk3128/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_C_FLAGS "-march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard -ftree-vectorizer-verbose=2")
set(CMAKE_CXX_COMPILER /opt/rk3128/bin/arm-linux-gnueabihf-g++)
set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})

Or sometimes just set CMAKE_CXX_COMPILER and CMAKE_C_COMPILER should be enough.

@golder55
Copy link
Author

So, I did not use any toolchains for building, just your instructions and built the .so libretro core.
I then installed that core on my muOS device, but the core didn't work.

Now that you have mentioned using a toolchain, I did some online searches and found a guide to build the muOS toolchain (https://muos.muzuwi.dev/dev_setup.html) but that didn't work for me, I also saw some toolchain docker images in the discord chats, i will try to see if i can somehow use them. other than that i have added a request on the discord server to obtain the toolchain.

Will update here if i make any progress

@golder55
Copy link
Author

okay so @iyzsong,
apparently this is the toolchain: Toolchain muOS

my build process:
tar -xzf aarch64-buildroot-linux-gnu_sdk-buildroot.tar.gz
source aarch64-buildroot-linux-gnu_sdk-buildroot/relocate-sdk.sh
git clone --recurse-submodules https://github.com/YuriSizuku/OnscripterYuri.git
cd OnscripterYuri/src/onsyuri_libretro
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/home/ubuntu/Downloads/aarch64-buildroot-linux-gnu_sdk-buildroot/share/buildroot/toolchainfile.cmake ..

I first tried this on colab but i was getting errors, so i switched to ubuntu and I'm getting the same error. what might I be doing wrong?

the error I am getting:
image

Thank You!

@iyzsong
Copy link

iyzsong commented Oct 22, 2024

That toolchain dosen't look like a right one.. You can try this build, which should works if muOS have glibc>=2.38
onsyuri_libretro.zip Make sure you also install the info file into the correct location.

Or you can ask in muOS's support channel to see if someone know the thing could build this core.

@golder55
Copy link
Author

Oh! That Worked!

Using OnsYuri also fixed the text wrapping issue.
I went ahead and did some testing.
I was successfully able to test run Narcissu and a few small visual novels
there were some VNs that crash or don't run however.

giniro crashes immediately.
higanbana 2 crashes after some dialogues.
umineko says files are missing.
tsukihime gives black screen after loading.
a note: these exact crashes also happened for @iyzsong's old (now deleted) onscripter libretro core build

Although I am unsure at what layer the errors are occurring I have retrieved the logs and am attaching them here for reference.

Device : Anbernic RG35XXSP
muOS Version: 2410.1 BANANA
Logs: retroarch_onsyuri_logs.zip

Thank you for your awesome work guys!

@iyzsong
Copy link

iyzsong commented Oct 24, 2024

giniro crashes immediately.
higanbana 2 crashes after some dialogues.
umineko says files are missing.
tsukihime gives black screen after loading.

Um, does those games work on the native OnscripterYuri? Some games may require a English specified version eg: https://github.com/Galladite27/ONScripter-en

@golder55
Copy link
Author

Um, does those games work on the native OnscripterYuri?

Oh, you are actually correct I tested the 4 games on Onsyuri web and i am getting the same issues.

same message for Umineko
Giniro doesn't work
black screen for Tsukihime title screen (although i did get a different intro sequence which i didnt in the muOS version)
and even Higanbana 2 stops working at the same point as it did for muOS version

I was able to log the exact error using dev tools:

Higanbana 2:
image

Tsukihime:
image

Giniro:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants