RetroArch CE (Unofficial - Community Edition)

PS3 RetroArch CE (Unofficial - Community Edition) Beta 4

Hi @Hyllian, are you able to convert a (simple) glsl sharder to cg shader?
Snow pipeline shader exist in glsl format but not in cg format. If we convert it in cg format then we can add Snow pipeline shader (XBM menu).
pipeline_snow.glsl.frag.h:
Code:
#include "shaders_common.h"

static const char* stock_fragment_xmb_snow = GLSL(
   uniform float time;
   uniform vec2 OutputSize;

   float baseScale = 3.5;  /* [1.0  .. 10.0] */
   float density   = 0.7;  /* [0.01 ..  1.0] */
   float speed     = 0.25; /* [0.1  ..  1.0] */

   float rand(vec2 co)
   {
      return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
   }

   float dist_func(vec2 distv)
   {
      float dist = sqrt((distv.x * distv.x) + (distv.y * distv.y)) * (40.0 / baseScale);
      dist = clamp(dist, 0.0, 1.0);
      return cos(dist * (3.14159265358 * 0.5)) * 0.5;
   }

   float random_dots(vec2 co)
   {
      float part = 1.0 / 20.0;
      vec2 cd = floor(co / part);
      float p = rand(cd);

      if (p > 0.005 * (density * 40.0))
         return 0.0;

      vec2 dpos = (vec2(fract(p * 2.0) , p) + vec2(2.0, 2.0)) * 0.25;

      vec2 cellpos = fract(co / part);
      vec2 distv = (cellpos - dpos);

      return dist_func(distv);
   }

   float snow(vec2 pos, float time, float scale)
   {
      /* add wobble */
      pos.x += cos(pos.y * 1.2 + time * 3.14159 * 2.0 + 1.0 / scale) / (8.0 / scale) * 4.0;
      /* add gravity */
      pos += time * scale * vec2(-0.5, 1.0) * 4.0;
      return random_dots(pos / scale) * (scale * 0.5 + 0.5);
   }

   void main(void)
   {
      float tim = time * 0.4 * speed;
      vec2 pos = gl_FragCoord.xy / OutputSize.xx;
      float a = 0.0;
      /**
       * Each of these is a layer of snow
       * Remove some for better performance
       * Changing the scale (3rd value) will mess with the looping
       **/
      a += snow(pos, tim, 1.0);
      a += snow(pos, tim, 0.7);
      a += snow(pos, tim, 0.6);
      a += snow(pos, tim, 0.5);
      a += snow(pos, tim, 0.4);
      a += snow(pos, tim, 0.3);
      a += snow(pos, tim, 0.25);
      a += snow(pos, tim, 0.125);
      a = a * min(pos.y * 4.0, 1.0);
      gl_FragColor = vec4(1.0, 1.0, 1.0, a);
   }

);

pipeline_snow.glsl.vert.h:
Code:
#include "shaders_common.h"

/* Need to duplicate these to work around broken stuff on Android.
 * Must enforce alpha = 1.0 or 32-bit games can potentially go black. */
static const char *stock_vertex_xmb_snow = GLSL(
   attribute vec2 TexCoord;
   attribute vec2 VertexCoord;
   attribute vec4 Color;
   uniform mat4 MVPMatrix;
   varying vec2 tex_coord;

   void main() {
      gl_Position = MVPMatrix * vec4(VertexCoord, 0.0, 1.0);
      tex_coord = TexCoord;
   }
);

I only know to port those shaders (inside shaders folder) outside RA inner code. I mean, I only know how to change the glsl or cg files thenselves, I know nothing about the RA inner shader spec code. I don't know what happens behind the scene.

I can give you some tips, though. The cg shaders combine vertex and fragment in only one file. I see that you have vert and frag separated in two files. I don't know if it's possible to separate cg.

Some tips to you, you should change these functions and special words when converting from glsl to cg:

Code:
Special words or functions:
glsl  <-------->  cg
fract --------> frac
mix --------> lerp
vec2 --------> float2
vec3 --------> float3
vec4 --------> float4
mat2 --------> float2x2
mat3 --------> float3x3
mat4 --------> float4x4

Thread related: https://forums.libretro.com/t/glsl-to-cg-conversion-cheat-sheet/437


There's a python script tool that does exactly the contrary of what you need:

https://github.com/Themaister/RetroArch/blob/master/tools/cg2glsl.py

Though it won't help directly, you should look at its code, because it can help you in your conversion.
 
Last edited:
Im not sure if the actual code can do that, i know there is an option to "update core" that can download new versions of the cores from internet but...
1) It requires a previous installed core to compare his versions ?
2) It takes in consideration the presence of the playlists ?

Btw, the other day i was reading about retroarch and i realized they have a "dummy" core https://docs.libretro.com/library/dummy/
Im not sure how many things can be made with it or how to use it, but i think we dont have this core in the PS3 version

So I tried the idea to remove all *.SELF files from /cores but I'm always kicked back to the XMB. I also tried to leave an empty file named "dummy_ libretro_ps3 .SELF" file in the dir but same result. It seems to be a check that if cores are missing, RA doesn't boot.
I will try this afternoon :
1) remove only 1 core and see what happens ;
2) remove all but 1 core ;
3) replace all *.SELF files with empty files with same names, to simulate "dummy cores"

*

Edit :
1) I removed the last one alphabetically (jaguar... i don't remember the name :P ) and RA boots fine ;
2) I removed all cores but left 1 in folder : doesnt boot anymore.
 
Last edited:
So I tried the idea to remove all *.SELF files from /cores but I'm always kicked back to the XMB. I also tried to leave an empty file named "dummy_ libretro_ps3 .SELF" file in the dir but same result. It seems to be a check that if cores are missing, RA doesn't boot.
I will try this afternoon :
1) remove only 1 core and see what happens ;
2) remove all but 1 core ;
3) replace all *.SELF files with empty files with same names, to simulate "dummy cores"

*

Edit :
1) I removed the last one alphabetically (jaguar... i don't remember the name :P ) and RA boots fine ;
2) I removed all cores but left 1 in folder : doesnt boot anymore.
Cores aren't .so OR .dll libraries, but Retroarch layer + core layer in a SELF file. If you remove all SELFs... no retroarch.
EBOOT.BIN is the "salamander" prog that read retroarch-salamander.cfg where is saved last core started and start it. First time with no cfg it starts first core (i think 2048).
 
I edited the first post of the thread to update the info about changes in the Beta#3 release, i hope you dont mind @Crystal @STLcardsWS

Btw @Crystal the notes about a required bios (48.rom or 128.rom) for fuse core (ZX spectrum) are still needed ?. Im not sure what you did in Beta#2 to remove this requirement, but is working :encouragement:
In Beta#3 i can boot ZX spectrum games without any additional bios (only tryed a couple of games though)

We can remove materialUI (/assets/glui) from the release as it's optimised for touch screen devices so not a good fit on ps3, issues using it have also been reported and there's no advantage/reason to use over RGUI, Ozone or XMB.
I agree, "glui" is too much focused in touchscreens, there are 2 vertical bands at the sides completly unused, the icons looks too big, font too small, etc...
USRDIR\asssets\glui is 2MB

And i think the other interface named "rgui" looks too much... primitive, i dont think anyone is going to use it in PS3. Also the other day i was reading retroach documentation and as far i remember is mentioned somewhere that there are some options not avaiables in the rgui
USRDIR\asssets\rgui is 2.5MB

There seems to be another interface named "nxgui" that has been mentioned before as anotehr posible removal, i dont know anything about it, but it doesnt seems to be available in the retroarch PS3 port (i dont see any option to enable it)
USRDIR\asssets\nxrgui is 3.5MB

If we delete this ones we are not losing much, because the ozone and xmb interfaces are way better
 
Last edited:
Ok, here's a collection of shaders working fullspeed (tested with snes9x 1.60 at custom 1536x1120 (6x and 5x integers)). This version is the slowest snes9x available, so all others will run even better.

https://anonymousfiles.io/MjA7jAOs/

Do not load the shaders directly if you don't know what you're doing. Use the option "Load Shader Preset" in quick menu. I've tested all presets and they're working. You can put the collection on a USB stick and change shader directory inside Retroarch configuration menu to point to it.

Unfortunately, not all PC shaders work on PS3, or run too slow. I only insert those useful. I'll update if I find new shaders working 100%.
 
I edited the first post of the thread to update the info about changes in the Beta#3 release, i hope you dont mind @Crystal @STLcardsWS

Btw @Crystal the notes about a required bios (48.rom or 128.rom) for fuse core (ZX spectrum) are still needed ?. Im not sure what you did in Beta#2 to remove this requirement, but is working :encouragement:
In Beta#3 i can boot ZX spectrum games without any additional bios (only tryed a couple of games though)


I agree, "glui" is too much focused in touchscreens, there are 2 vertical bands at the sides completly unused, the icons looks too big, font too small, etc...
USRDIR\asssets\glui is 2MB

And i think the other interface named "rgui" looks too much... primitive, i dont think anyone is going to use it in PS3. Also the other day i was reading retroach documentation and as far i remember is mentioned somewhere that there are some options not avaiables in the rgui
USRDIR\asssets\rgui is 2.5MB

There seems to be another interface named "nxgui" that has been mentioned before as anotehr posible removal, i dont know anything about it, but it doesnt seems to be available in the retroarch PS3 port (i dont see any option to enable it)
USRDIR\asssets\nxrgui is 3.5MB

If we delete this ones we are not losing much, because the ozone and xmb interfaces are way better

Personally. I would not start removing menus and things, while you may not like one thing does not mean someone else will not.
Its an opinion type of thing and i do not think a few MBs is that huge of a deal for another option. Unless its buggy would not remove features. even if they would not be used much by many.
'
The only one that seems safe to remove is the nxgui as that for the switch i believe. So PS3 does not use that one at all.
 
Last edited:
So I tried the idea to remove all *.SELF files from /cores but I'm always kicked back to the XMB. I also tried to leave an empty file named "dummy_ libretro_ps3 .SELF" file in the dir but same result. It seems to be a check that if cores are missing, RA doesn't boot.
I will try this afternoon :
1) remove only 1 core and see what happens ;
2) remove all but 1 core ;
3) replace all *.SELF files with empty files with same names, to simulate "dummy cores"

*

Edit :
1) I removed the last one alphabetically (jaguar... i don't remember the name :P ) and RA boots fine ;
2) I removed all cores but left 1 in folder : doesnt boot anymore.
This is likely your issue with getting booted back to the XMB.

You getting kicked back to the XMB because of the RetroArch.cfg file.
Delete it should boot fine.(or manually edit the core path)
What its trying to do more then likely is booting a core that is no longer there.
So if the core that was last loaded and saved into the cfg file is missing then no UI. as the UI and everything is essentially in the self of each .
 
Last edited:
And i think the other interface named "rgui" looks too much... primitive, i dont think anyone is going to use it in PS3.
I remember RGUI from Wii releases and although there's probably little reason to choose it over Ozone or XMB, it still works and has been updated in the last couple of years so maybe the missing features mentioned are now available.
There seems to be another interface named "nxgui" that has been mentioned before as another posible removal
/assets/nxrgui, /assets/pkg/WiiU and /assets/switch could be removed as these are for Nintendo console(s) releases.
 
Last edited:
I think database files are needed. ?
Only if are used by one of the cores running in retroarch PS3

Btw, i forgot to mark for deletion "ScummVM.rdb" and "Sega - Dreamcast.rdb"



Edit:
The files i marked in the database list represents a PKG size reduction of around 28MB :rolleyes:
My selection is just an initial approach, because there are a lot of devices/consoles i never heard of them (also i dont know if there are retroarch PS3 cores to run that kind of games). If some of you know them please add more deletions to the list
 
Last edited:
@Crystal take a look at this images, are the backgrounds of the xmb themes i was mentioning here
The .7z im uploading contains 3 copies of them, the originals (for reference if you want to compare), an intermediate step where i resized them to 1920x1080, and the final version optimized (this ones uses indexed colors, it was made with pngoo/pngquant)

Im not modifying the visual look or the quality of this images, consider them "optimization patches". By applying this patches we are reducing the PKG size 11.5MB :)

Download ---> https://workupload.com/start/aSpDFjp9ghj
 
I made a new version of the PIC1.PNG image, i think the previous version was too much "crowded" with bright colors and this one is more "confortable". Lets say... my main goal in this new version is to reduce the "eye-bleeding factor" :)
vIITJxL.png


First thing i did was to darken the background, there is also a blur effect added to remove the focus of attention from the tenths of characters that appears in it (some of them are not much retro, like the guy from the assassin's creeds)

The "Retroarch PS3" text on previous version was overlapping a bit with the frame of the clock so i wanted to reduce it a bit, but that frame of the clock have 60 pixels height by default, and it increases his height in down direction to 82 pixels when there is some text scrolling inside the frame. So the new position and size of the "Retroarch PS3" text is intended to dont overlap that frame of the clock at any time or any of the other XMB icons... lets say now is located in a safe area
Also, the black outline is a lot more precise (in the previous version there was a mistake related with it), and the main color has been changed from 0xFFFFFF to 0xEEEEEE to soften it a bit

The "PSX-Place" logo had a shadow effect added by me that was excesive, this has been removed, also now the layer "merges" with the background a lot better

The "Box" logo had an annoying horizontal "cut" at top (because the original logo had it and was tricky to clean it up)... to fix that cut i erased some borders of it, and created an additional visual effect with an "sphere" in color degrades. Also the brightness of this logo has been reduced too

Te white rectangle is like the background of the ICON0.PNG this is something i added at the end to create some color contrast for the ICON0.PNG is simple but i like the result, additionaly i was trying to add some special visual effects to merge with the ICON0.PNG ...like a couple of red eyes for the alien but i removed them because im not sure if you was going to like it and in the way i was doing it it was not working fine, for something like that i would need to dedicate more time to find the correct alignments, also it requires to do another version of the ICON0.PNG to remove the shadows inside the eyes (and also to make it 100% opaque)

DOWNLOAD ---> https://workupload.com/start/nDpJSJrB5AH
Are you sure about white rectangle ? With transparent ICON0 that white region is not very nice.
 
Looks like there's some issue involving endianess. I've tested the ntsc shaders and the results are wrong colors though geometrically correct. These shaders depend on subpixels I think, so probably is an endianess issue.
 
Last edited:
Hi, my review about this Community Edition.

- Gearsystem core just freeze the console.
- Gambette, Mame 2000, Prboom need to reload the core to change the game (gambette just freeze).
- Mame2003 (Plus too), FBA2012 maybe freeze if no reload the core when change the game.
- BlueMSX runs Coleco games just needs the correct machine setup.
- Sega CD games runs in CHD format but they need to be in usb000, for some reason if runs from the hdd cause slowdowns.
- All working cores runs multi shaders bur some are broken.
- The PCE core (not fast) runs very slow the Supergrafx and PE CDs games, please restore the Supergrafx core.
- Snes9x 2005 Plus and 2010 savestates is broken.
- FBA2012: NeoGeo games needs default settings manage (Universal BIOS 3.0 or beyond better).

Untested:
- Vices cores (no clue how is works).
- Fuse.
- PUAE.
- FBNeo (needs correct romset)
- Hatari (no clue how is works).
- 2048
- Cap32
- Dosbox
- hme
- mu
- o2em
- pokemini
- squirrejlme
- virtualjaguar

All others cores tested and runs fine.

Thats all for now, sorry for my english (i´m from Venezuela).

Thank you all!
 
Has anyone had any luck with running Atari 5200 on Atari800?
I have had luck i can get the emu to boot but only to this screen.

I have bios in system folder.
View attachment 29650


Edit: (just add another detail)
Have not been able to get ColecoVision working on blueMSX (it has worked before on the PS3 for reference, but never directlty you always had to boot a MSX / MSX II game to have access to the ingame Options (or edit the cfg file for that game manually) to change the emulated setting to coleco. When RA scan and creates a playlist they do not autoboot or by the method i just detailed.


As i continue to play around with this, It's by far one of the best builds i seen in a long time in regards to retroarch. Its very very very close to where it needs to be. Nice work @Crystal

Unluckily Retroarch hasn't per folder core options (.opt files), but only per core and per game. Cores like atari800 and blueMSX that need subplatforms specific oprtion chaanged, you can only save core options every game.
A folder core options should be very nice.
 
Are you sure about white rectangle ? With transparent ICON0 that white region is not very nice.
Without it the ICON0 was barelly visible because the ICON0 is made with very dark colors, and gets confused with the PIC1. The idea of filling that rectangle with white was to achieve the max colors contrast in between the ICON0 (in black) and the rectangle (in white)
But other colors in the rectangle could work to achieve the same effect, the only requirement is it needs to be a bright color
 
Sega CD games runs in CHD format but they need to be in usb000, for some reason if runs from the hdd cause slowdowns.
I noticed a similar possibly related issue testing Sega CD bin/cue game with the genesis plus gx core. Music (the CD tracks) glitches every few seconds and doesn't seem to be streaming perfectly. I didn't notice any game slowdown though I only played for a few minutes. I loaded the bin/cue from my dev_hdd0/ROMS directory.
 
Last edited:
Back
Top