• HomeBoards
  • RulesRules
  • HelpHelp
  • WikiWiki
  • Donate

Author Topic: [TEST RELEASE] RetroArch for GCW0  (Read 40965 times)

the_gama (OP)

  • Posts: 155
[TEST RELEASE] RetroArch for GCW0
« on: February 13, 2016, 12:55:15 am »
This is a test release of RetroArch for the GCW0.   I decided to post it in the Development forum, because it's not ready for a public release yet, and so I hope other devs can build the sources and improve the port or share their comments.




Updates:
Code: [Select]
02-06-2016
- I have uploaded a new version of the opk.  The most relevant changes are that the xmb menu has been updated, it is wroth to give it a try!  Unfortunately the ribbon shader effect is not working on the zero.

Since this is a nightly build, it may contain several bugs.  So if you would like to contribute, please report those to the official libretro team.

- Another relevant change, is that I enabled the auto-frameskip feature of the catsfc core.  When it is enabled most snes games will be playable.

27-05-2016
- A couple of months ago the gcw0 port changes were officially added to retroarch's repo, but it needs some minor changes to build successfully.
Please download the following patch if you want to build the latest version of retroarch: https://www.dropbox.com/s/69qc8mwrvi1sjcu/gcw0_build_fixes%20%2827052016%29.patch?dl=0.

- This is a work in progress core based on Nebuleon tempgba port: https://www.dropbox.com/s/jy2gx1d259azv3t/libretro-tempgba-unofficial.7z?dl=0. 
I re-ported the tempgba core, since the existing gpsp core doesn't work with dynarec enabled.  Unfortunately this core
will only work with the static version of RetroArch.

Changelog:
Code: [Select]
v0.1b
- Set xmb menu as default menu driver.  It is really nice, you should check it out.
- Bundled some cores, but the ones other users have uploaded should work too.
- Added a frameskip option to catsfc core.
- ...

v0.1
- Built using CFLAGS = -O2 -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float.
- Bundled assets and core files into OPK.
- Set glui as default menu driver.
- Set alsathread as default audio driver.
- Mapped Select button correctly.  You can exit RetroArch from menu.
- Enabled Menu toggle with Down + L1 + R1 + Y combo.
- Bundled some additional cores.

To test retroarch on the zero:

1) Download the following files: RetroArch.opk, and retroarch_gcw0.zip or retroarch_gcw0_lite.zip.  Or download one of the following: RetroArch_v0.1.opk, RetroArch_v0.1b.opk and skip to step 4.

2) Install RetroArch.opk on your zero.  Copy it to /media/data/apps or use the GCW Zero Manager to install it. 

3) On the zero, create a folder called .config in /usr/local/home/.  Then extract retroarch_gcw0.zip or retroarch_gcw0_lite.zip contents and copy them there.  Those archives contain the retroarch.cfg file, cores, and other optional files like assets, cheats, shaders, etc.

4) Run RetroArch from gmenu.  You should see the RGUI menu screen where you can select a core, load a game, etc.


And for those interested in compiling RetroArch, these are the steps to build it from sources:

1) Download the following patches file: libretro_gcw0_patches.zip, and extract it somewhere on your PC.

2) Clone the git repo:

Code: [Select]
git clone --depth 1 git://github.com/libretro/RetroArch.git
3) Enter the cloned sources directory and copy the opendingux_egl_driver_v0.1.patch file there.

Code: [Select]
cd RetroArch
4) Then, to apply the patch:

Code: [Select]
git apply opendingux_egl_driver_v0.1.patch
5) Before configuring the sources, we need to setup some cross-compilation variables:

Code: [Select]
export PATH=$PATH:/opt/gcw0-toolchain/usr/bin:/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin
export PKG_CONF_PATH=/opt/gcw0-toolchain/usr/bin/pkg-config
export PKG_CONFIG_PATH=/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot
export PKG_CONFIG_LIBDIR=/opt/gcw0-toolchain/usr/mipsel-gcw0-linux/uclibc/sysroot/usr/lib/pkgconfig

Additionally you can export CFLAGS variable to define custom optimization flags, for example:

Code: [Select]
export CFLAGS="-O2 -march=mips32 -mtune=mips32r2"
6) Now type the following to configure the sources:

Code: [Select]
./configure --global-config-dir=/mnt/RetroArch  --host=mipsel-gcw0-linux-uclibc --prefix=/tmp --enable-gles --disable-kms --enable-opendingux_fbdev --enable-alsa --with-gles_libs="-lGLESv2 -lEGL"
The --global-config-dir option is used to tell RetroArch to look for retroarch.cfg in the opk mount point.  That way we can bundle assets and core files into the opk.

There are other options you can use with configure, but I let pkg-config choose the necessary packages.  Look for qb/qb.params.sh in RetroArch sources for more options.

7) Finally, to compile RetroArch:

Code: [Select]
make V=1
If everything goes well, there should be a retroarch executable in the same folder.

8 ) Additionally you can build video and audio software filters.  They are located in RetroArch/audio/audio_filters and RetroArch/gfx/video_filters.  Enter one of those folders and type:

Code: [Select]
make compiler=/opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc extra_flags="-O2 -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float"
Some .so files will be generated.  Copy the .so, .filt and .dsp files somewhere on the sdcard, and load them from RetroArch settings menu.


Now we need a core to test the frontend, so let's build picodrive:

1) Clone the repo:

Code: [Select]
git clone https://github.com/libretro/picodrive.git
2) Then enter the directory and copy the picodrive_libretro_gcw0.patch file there.

Code: [Select]
cd picodrive
3) Now, build the sources:

Code: [Select]
make -f Makefile.libretro platform=gcw0
Again, if there is no error, there should be a working picodrive_libretro.so file in picodrive folder.


Copy those files somewhere on your sdcard, and you can run retroarch from telnet with the following command:

Code: [Select]
./retroarch -L picodrive_libretro.so "Castlevania - Bloodlines (USA).zip"

If you would like to test another core, just go to https://github.com/libretro, and clone it's sources.
Then, you need to add some gcw0 platform changes to the Makefile.  Look for GCW0 on the patched picodrive/Makefile.libretro file to use it as example.
« Last Edit: June 03, 2016, 01:56:20 am by the_gama »

care16la20

  • Posts: 178
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #1 on: February 13, 2016, 01:11:05 am »


Very nice !!!!
Curious question: Does it run PSX system / PSP / Virtual Boy ?



Regards

thefifthgiant

  • Posts: 108
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #2 on: February 13, 2016, 04:17:38 pm »
Could you elaborate on what is different between the standard and lite versions?

Aeter

  • Posts: 328
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #3 on: February 14, 2016, 01:07:15 am »


Very nice !!!!
Curious question: Does it run PSX system / PSP / Virtual Boy ?



Regards
Only one to find out.
~cucullus non facit monachum~

David Knight

  • Posts: 577
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #4 on: February 14, 2016, 01:03:00 pm »
4) Then, to apply the patch:

Code: [Select]
git apply opendingux_egl_driver_v0.1.patch

Hi, well done for getting retroarch built, I'm getting some build errors when following your instructions:

Code: [Select]
[email protected]:~/Projects/RetroArch$ git apply opendingux_egl_driver_v0.1.patcherror: patch failed: gfx/video_context_driver.c:43
error: gfx/video_context_driver.c: patch does not apply
error: patch failed: gfx/video_context_driver.h:165
error: gfx/video_context_driver.h: patch does not apply
error: patch failed: qb/config.params.sh:25
error: qb/config.params.sh: patch does not apply
error: gfx/drivers_context/opendingux_fbdev_ctx.c: already exists in working directory
[email protected]:~/Projects/RetroArch$

Perhaps the codebase has changed? I'll manually apply the patch instead.

EDIT I ealised that the patch had already been applied but there was initially a whitespace error.

Alll compiled and working now, I added -funroll-loops as my testing indicates a performance improvement at least on Genesis-plus GX.

If it wasn't Valentines day I would be happily building cores this evening :)
« Last Edit: February 14, 2016, 01:34:44 pm by David Knight »

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #5 on: February 14, 2016, 01:28:06 pm »
Long time no visiting this forum, but it's a great achievement. Thanks for sharing your work once again,  the_gama ;D

Perhaps the codebase has changed? I'll manually apply the patch instead.
No problem here using the git patch.

David Knight

  • Posts: 577
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #6 on: February 14, 2016, 01:35:49 pm »
Long time no visiting this forum, but it's a great achievement. Thanks for sharing your work once again,  the_gama ;D

Perhaps the codebase has changed? I'll manually apply the patch instead.
No problem here using the git patch.

Shin-Nil! Great to see you again :)

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #7 on: February 14, 2016, 02:05:45 pm »
Is just for me or the screen blinks every time I press a button and every input is ignored?

Shin-Nil! Great to see you again :)
Thank you David, I'm glad to see that you managed to keep the community alive  ;)


David Knight

  • Posts: 577
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #8 on: February 14, 2016, 02:10:44 pm »
I get the same issue, I suspect related to the use of SDL2 in terminal mode?

Speed is slow as expected with Virtua Racing. I'd suggest recompiling with SDL1 libs as it seems to give faster rendering than SDL2.

the_gama (OP)

  • Posts: 155
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #9 on: February 15, 2016, 03:20:06 am »
Long time no visiting this forum, but it's a great achievement. Thanks for sharing your work once again,  the_gama ;D

Hi Shin, it's nice to see you again here in the forum.  It was a shame we could not release anything last time, so I had some free time and wanted to post it now.

About the screen flickering, I noticed that too.  It only happens when testing the app from telnet, running the Terminal app.  So as David wrote, that must be the cause.

RetroArch has continued to evolve, there are many new cores now and new features were added, so I think it is still worth it to have it on the zero. But unfortunately, the firmware and toolchain of the zero have not been updated since 2014.  At least it would be nice to have the latest version of the etnaviv driver.


Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #10 on: February 15, 2016, 10:06:07 am »
Thanks for the tips, I'll try run it again via the app launcher. I agree it's really sad to see that there was no update on GCW-Zero firmware since 2014 :'(

I'm back, but only as a visitor, unfortunately. I think David Knight could help you a lot, since he done a great job polishing my ancient Genesis Plus GX port  ;)

pcercuei

  • Posts: 1702
    • My devblog
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #11 on: February 16, 2016, 02:59:15 pm »
What we use now, is the open-source kernel module by Vivante, + the user-space etnaviv OpenGL (within Mesa).
The etnaviv guys are working hard on replacing the kernel module from Vivante by a clean & working DRM driver. But the user-space part of etnaviv did not change that much; so right now using a more upstream version of etnaviv would probably give us a worse performance and more graphical glitches and crashes.

Besides, the new DRM driver for etnaviv requires us to ditch our framebuffer driver and all its nifty features (triple buffering, perfect 60 Hz, automatic scaling with the IPU, etc) and re-implement everything in a KMS driver. Sure, that would be an improvement (that's where all Linux video drivers are going), and unlock the HDMI / TV-out situation, but it requires an awful lot of work. It is on my TODO list, but for *after* the next firmware release.

thefifthgiant

  • Posts: 108
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #12 on: February 16, 2016, 03:09:02 pm »
So we are talking a few years until that particular change comes into play? I imagine it won't be easy. On a side note, any hints on what improvements to expect in the next firmware release?

Probably wrong thread, just latching onto the current conversation..

Quickman

  • Posts: 220
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #13 on: February 16, 2016, 07:23:24 pm »
So we are talking a few years until that particular change comes into play? I imagine it won't be easy. On a side note, any hints on what improvements to expect in the next firmware release?

Probably wrong thread, just latching onto the current conversation..
I'm with @thefifthgiant
...this whole conversation/back-and-forth has made me very curious. Either way, it also made me want to state: thank you so much for continuously working to make these things happen!  It's good to know it's not just on the back burner nor has been forgotten. @pcercuei :) @David Knight
« Last Edit: February 16, 2016, 07:25:24 pm by Quickman »

zhongtiao1

  • Posts: 249
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #14 on: February 17, 2016, 06:03:32 pm »
Do you put the the gcw0 optimizations in the Makefile instead of Makefile.libretro? In virtual jaguar and mednafen VB, there is no Makefile.libretro file. Also, where exactly would I put the gcw0 modifications? Do I put them after the end endif statement? Or do I have to make a copy of Makefile.libretro and move it to the folder.

zhongtiao1

  • Posts: 249
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #15 on: February 18, 2016, 01:05:10 am »
Here is Atari Jaguar :)

It runs extremely slow (at least on Atari Karts, which is the only one I tested). It seems B is select and A is accelerate (for Atari Karts). I have no idea if there is a way to optimise it or not, but the core would really benefit from some optimisations.

Zhongtiao1

libretro so file for GCW-Zero: https://www.dropbox.com/s/cfq7ao5roq1ui81/virtualjaguar_libretro.so?dl=0


UPDATE: I can't get pcsx rearmed to run when it is built for retroarch, and the mednafen based cores just don't build.
« Last Edit: February 18, 2016, 02:39:08 am by zhongtiao1 »

David Knight

  • Posts: 577
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #16 on: February 18, 2016, 11:37:16 am »
Here is Atari Jaguar :)

It runs extremely slow (at least on Atari Karts, which is the only one I tested). It seems B is select and A is accelerate (for Atari Karts). I have no idea if there is a way to optimise it or not, but the core would really benefit from some optimisations.

Zhongtiao1

libretro so file for GCW-Zero: https://www.dropbox.com/s/cfq7ao5roq1ui81/virtualjaguar_libretro.so?dl=0


UPDATE: I can't get pcsx rearmed to run when it is built for retroarch, and the mednafen based cores just don't build.

What's the approximate framerate? I would expect a Jaguar emulator to require frameskip at least.

zhongtiao1

  • Posts: 249
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #17 on: February 18, 2016, 03:52:55 pm »
Here is Atari Jaguar :)

It runs extremely slow (at least on Atari Karts, which is the only one I tested). It seems B is select and A is accelerate (for Atari Karts). I have no idea if there is a way to optimise it or not, but the core would really benefit from some optimisations.

Zhongtiao1

libretro so file for GCW-Zero: https://www.dropbox.com/s/cfq7ao5roq1ui81/virtualjaguar_libretro.so?dl=0


UPDATE: I can't get pcsx rearmed to run when it is built for retroarch, and the mednafen based cores just don't build.

What's the approximate framerate? I would expect a Jaguar emulator to require frameskip at least.

The framerate is about 1 to 3 fps. So, yeah :) it needs frameskipping. Atari Karts is one of the least CPU intensive games for the Jaguar too. I imagine Tempest 2000 will run close to 0.5 to 1 fps :P :)
« Last Edit: February 18, 2016, 04:10:39 pm by zhongtiao1 »

the_gama (OP)

  • Posts: 155
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #18 on: February 18, 2016, 04:58:04 pm »
Here is Atari Jaguar :)

It runs extremely slow (at least on Atari Karts, which is the only one I tested). It seems B is select and A is accelerate (for Atari Karts). I have no idea if there is a way to optimise it or not, but the core would really benefit from some optimisations.

Zhongtiao1

libretro so file for GCW-Zero: https://www.dropbox.com/s/cfq7ao5roq1ui81/virtualjaguar_libretro.so?dl=0


UPDATE: I can't get pcsx rearmed to run when it is built for retroarch, and the mednafen based cores just don't build.

Great, it's good to see interest from other people :).   Can you post the patch/changes to the Makefile?

Can you post the error when building mednafen cores?

There are two options in retroarch gui that can help improve the overall performance in all cores: 

- Settings->Driver->Audio Driver = alsathread.
- Settings->Driver->Audio Resampler Driver = nearest.

RetroArch frontend does not support frameskip, so there will be many cores that won't run well on the zero.  But Frameskip may be implemented inside the core, I am not sure.  I think there is already a core with frameskip option implemented.

zhongtiao1

  • Posts: 249
Re: [TEST RELEASE] RetroArch for GCW0
« Reply #19 on: February 18, 2016, 05:30:24 pm »
Here is Atari Jaguar :)

It runs extremely slow (at least on Atari Karts, which is the only one I tested). It seems B is select and A is accelerate (for Atari Karts). I have no idea if there is a way to optimise it or not, but the core would really benefit from some optimisations.

Zhongtiao1

libretro so file for GCW-Zero: https://www.dropbox.com/s/cfq7ao5roq1ui81/virtualjaguar_libretro.so?dl=0


UPDATE: I can't get pcsx rearmed to run when it is built for retroarch, and the mednafen based cores just don't build.

Great, it's good to see interest from other people :).   Can you post the patch/changes to the Makefile?

Can you post the error when building mednafen cores?

There are two options in retroarch gui that can help improve the overall performance in all cores: 

- Settings->Driver->Audio Driver = alsathread.
- Settings->Driver->Audio Resampler Driver = nearest.

RetroArch frontend does not support frameskip, so there will be many cores that won't run well on the zero.  But Frameskip may be implemented inside the core, I am not sure.  I think there is already a core with frameskip option implemented.


The modifications I made were just adding the GCW-Zero parts of the picodrive patch (anything below the #gcw0 part).
 
Here is the Makefile (it's in txt form because otherwise dropbox keeps timing out on upload): https://www.dropbox.com/s/4x9p5eumv4u95hj/Makefile.txt?dl=0

I tried the same thing with pcsx rearmed, which compiled but crashed RetroArch on running games. pcsx rearmed crashing may just have something to do with the game I tried though. I also tried the beetle-vb core, which screamed errors at me every time I tried to compile. I'm not at home at the moment, but when I get there in a couple hours, I'll post them.

I'll try the audio driver edits and get back on that later today :)
« Last Edit: February 18, 2016, 05:32:50 pm by zhongtiao1 »

 

Post a new topic