PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

General GBZ-related chat goes here. Share ideas, tips and tricks, or ask questions that don't fit into the hardware/software help forums.
Post Reply
i_am_chap
Posts: 8
Joined: Fri Jun 30, 2017 10:21 am
Has thanked: 1 time
Been thanked: 2 times

PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by i_am_chap » Fri Jul 14, 2017 12:08 pm

Back when I first received my Raspberry Pi Zero, I racked my brains for hours trying to get it to run Playstation games without poor framerate and crackly sound. But after much blood, sweat and tears, I can confirm that the optional PCSX-Rearmed emulator does indeed appear to work well. Sound, graphics and all!

Note - I'm talking about pcsx-rearmed, which is available from the "optional packages" menu within Retropie Setup, and NOT lr-pcsx-rearmed which is the default PSX emulator that comes ready installed with Retropie. I don't know what it is about it being a standalone, non-libretro emulator, but from my own experience, it appears to be the superior PSX emulator on Raspberry Pi Zero. (And despite the many online discussions about how to optimise lr-pcsx-rearmed for Pi Zero, hardly anyone seems to mention using pcsx-rearmed instead...)

HOWEVER, since completing my Gameboy Zero build using Kite's superb SAIO board, I am no longer able to run pcsx-rearmed on my Pi-Zero. Instead of booting up and running the chosen game, it displays a few screens of blue vertical lines before turning to a shade of green. At this point, the whole system is unresponsive, not even to the safe shutdown switch. The Pi must be hard reset.

I've been trying all sorts of things to get this emulator working again as it did before but so far, no luck. I suspect it may be something to do with the display settings that seem to be causing it to crash, though I may be wrong. For the working version, I had used a Retropie 4.2 SD card image taken from the official webpage, then the Pi was connected to a computer monitor via HDMI. Since completing the Gameboy build, I am now using Kite's most-up to-date variant of the Retropie SD image (SAIO 20170401-1) and the Pi is now connected to a 320-240 LCD screen through the SAIO board itself.

Maybe the Pi's looking for a HDMI connection that isn't there. Maybe this emulator just doesn't work with a DPI screen. I don't know. I've tried tweaking the video mode and framebuffer res for the emulator but haven't seen any difference so far, and I haven't had any luck . Could there be one or two lines of code that might help? If anyone has any recommendations, or if you'd like to try this for yourself and see what you find, I'd really appreciate it!

Thanks

User avatar
kite
Posts: 972
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 246 times
Been thanked: 361 times
Contact:

Re:

Post by kite » Tue Jul 18, 2017 11:37 am

I suspect that the software is re configuring the screen like you say, with the DPI screen you can't reconfig it.. there might be another way to default to HDMI and then 'copy' the frame buffer over to DPI but I haven't fully done that yet, perhaps in the future I can look in to that way.. for the time being you need to see how/why it is reconfiguing the screen and prevent it from doing that!
Stock clearance - CLOSED: viewtopic.php?f=38&t=12064
Kite's Mailing List: https://goo.gl/forms/e97uUvPOfUxPWdz82
Kite's FAQ: https://kiteretro.com/faq/


ImageImageImageImageImage

timemaster
Posts: 40
Joined: Fri May 05, 2017 1:00 am
Location: UK
Has thanked: 4 times
Been thanked: 14 times

Re: PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by timemaster » Mon Sep 17, 2018 12:07 pm

Hi, I would like to refresh this issue because pcsx-rearmed is recommended emulator for Rpi 0 and 1 by Retropie wiki, so by solving this, we should have more PlayStation games on our Rpi zero builds with better performance :D

I have done some research and I think the problem is in frontend/plat_sdl.c. It could be really something with changing screen mode as kite mentioned but I cannot solve it. The only line was written by the emulator on start is:

plat_sdl: using 320x240 as fullscreen resolution

then the whole system crash

I tried to recompile an emulator for other platforms, other GPUs and every possible combination of configure flags today. I also tried to apply some patches from lr-pcsx-rearmed, for example, commit Add support for software framebuffer (65a0505f57d57ddedb89e3c66734fb3b0a69e1e8) but without success.. Sure because this commit updates libretro frontend code to support software framebuffer, not the SDL fronted. I think we need to take logic from this and apply it for SDL frontend but I am not that good.. :(

I have opened a bug on GitHub for it and also started a thread on the retro pi support forum. Any suggestions about my wording or some other details regarding this problem on the links below are very welcome.

https://github.com/notaz/pcsx_rearmed/issues/112
https://retropie.org.uk/forum/topic/193 ... pi-display

timemaster
Posts: 40
Joined: Fri May 05, 2017 1:00 am
Location: UK
Has thanked: 4 times
Been thanked: 14 times

Re: PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by timemaster » Mon Sep 17, 2018 4:55 pm


ChrisBreaksStuff
Posts: 14
Joined: Thu Nov 24, 2016 1:42 pm
Has thanked: 14 times
Been thanked: 3 times

Re: PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by ChrisBreaksStuff » Mon Sep 17, 2018 6:28 pm

An Interesting Topic for sure!
I actually read up about PCSX-Rearmed like a few Days ago since im planing to at least try to emulate PS1 Games whenever my build gets finished (I mean technically it didnt even really start yet, but hey, preparation is key, eh?)

Just some Questions that came to my mind:

Did you just install it from the Optional Sources and run it or did you make an further config changes?
I've heard of several problems with this Emulator, mostly related to blackscreens and frozen systems, but some of them seem fixable..
plat_sdl: using 320x240 as fullscreen resolution

then the whole system crash

I assume you probably already found this threads but I figured linking them again wont hurt, since its technically a similar problem (Freeplay Board tho, but thats the closest I found yet regarding this topic)

This guy got it solved on his Freeplay Device after finding a connection between his troubles with the emulator and the framebuffer settings

https://retropie.org.uk/forum/topic/189 ... ed-working

And the link the guy from the retropie forums above linked regarding his way of setting it up:
https://www.reddit.com/r/RetroPie/comme ... o_version/

It could be really something with changing screen mode as kite mentioned
I would think so too, but im in no ways an expert on that topic.. nor any good.. the term bloody noob describes it best I guess :lol:
But if I understood that propperly, then the reddit link adresses changing video mode, which I'd expect to be the culprit in this case :)

timemaster
Posts: 40
Joined: Fri May 05, 2017 1:00 am
Location: UK
Has thanked: 4 times
Been thanked: 14 times

Re: PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by timemaster » Tue Sep 18, 2018 2:21 am

Hi,

thanks for the links provided and also for your interest :)

I have seen them but especially on Reddit, I don't see any connection between our problem and their solution :) They are just linking BIOS directory to the right place and disabling custom config file which is empty in my case...These changes have been (as I know) implemented in retro pie setup script.

The first link is more useful and I found something regarding this last debugging night :) The interesting thing is that he was able to run an emulator again with 320x240 framebuffer after one start with 640x480. That looks like some configuration file has been created during a successful start.

What I found last night is that the problem is not directly in pcsx-rearmed but in the library for SDL frontend written also by notaz (pcsx author), here is a link https://github.com/notaz/libpicofe and especially in sdl_plat.c where you can see a hardcoded resolution of 640x480...

So now I am a little bit smarter about this issue which is more or less feature than a bug, I should probably close my bug on pcsx-rearmed Github and open similar on libpicofe. Also today I would like to do some experiments with this piece of code and we will see... Also, my tries with applying framebuffer patches were a totally bad way...
ChrisBreaksStuff wrote:
Mon Sep 17, 2018 6:28 pm
Did you just install it from the Optional Sources and run it or did you make an further config changes?
to be correct I have just downloaded it through Optional Sources, then I have done the rest from console manually (./configure, make)

timemaster
Posts: 40
Joined: Fri May 05, 2017 1:00 am
Location: UK
Has thanked: 4 times
Been thanked: 14 times

Re: PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by timemaster » Wed Sep 19, 2018 11:58 am

Ok, I have some progress here... I can run the emulator from a console and play a game on SAIO :) (rpi zero 320x240 DPI display)

I can also confirm that game and sound are both without any performance issues which is really great, compared to lr-pcsx-rearmed.

I tried Worms World party and Worms Armageddon earlier today...

The main problem is in this line

ret = plat_sdl_change_video_mode(g_menuscreen_w, g_menuscreen_h, 1);

in frontend/lippicofe/plat_sdl.c

which needs to be commented (// at the start of this line) for the emulator to start correctly.

I have done many experiments with the rest of the code to achieve the best menu resolution - 320x240 and it was working somehow (some segfaults, sometimes did not work with -cdfile cmd option, and so on, I can also run the emulator with 640x480 with not so much problems but then the menu is not usable. I have seen the menu in some edge conditions nicely in 320x240 and the game was also perfect but the other problems like segfaults raised with this).

The problem is with my knowledge of C and SDL. It should be really fast for someone who has some insight into it. Is here somebody interested who can help me with this? I can provide my patches to show what is working and how but I think I am nearly at the end with everything that I can do here.

timemaster
Posts: 40
Joined: Fri May 05, 2017 1:00 am
Location: UK
Has thanked: 4 times
Been thanked: 14 times

Re: PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by timemaster » Thu Sep 20, 2018 2:24 pm

Today, I have some great news :) The emulator is now fully functional. The only thing you need to do is to update git repository line in RetroPie-Setup/scriptmodules/emulators/pcsx-rearmed.sh

from
gitPullOrClone "$md_build" https://github.com/notaz/pcsx_rearmed.git

to
gitPullOrClone "$md_build" https://github.com/timemaster5/pcsx_rearmed.git saio

and then run update pcsx-rearmed from source in retropie-setup script

Then you will be able to run this emulator without performance issues but only with USB keyboard. I am now struggling with key bindings, I am not able to bind UP/DOWN/LEFT/RIGHT buttons of GBZ SAIO.. probably because they are not buttons but hat... I don't know now.

Another issue is with the mouse cursor being visible in some games, but this could be hopefully easily fixable.

And for the record, the main problem has been caused by one commit to libpicofe adds SDL_DOUBLEBUF flag.

McGyver
Posts: 226
Joined: Tue Jan 31, 2017 11:06 am
Location: Tianjin / China
Has thanked: 25 times
Been thanked: 53 times

Re: PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by McGyver » Thu Sep 20, 2018 5:29 pm

Sounds nice! Do you belive this setup will work as well for users like me with Kedei HDMI screen and HDMI sound output?

And Minty Pi?

timemaster
Posts: 40
Joined: Fri May 05, 2017 1:00 am
Location: UK
Has thanked: 4 times
Been thanked: 14 times

Re: PCSX-Rearmed: A great emulator for Pi-Zero but will it work with a Gameboy Zero?

Post by timemaster » Fri Sep 21, 2018 1:02 am

Hi,
Yes, I think so. At least for MintyPi. With the HDMI screen, there is a chance that also the original version will work.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest