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

Favorites? Last Played? #12

Open
Dantasstic opened this issue Jan 28, 2021 · 106 comments
Open

Favorites? Last Played? #12

Dantasstic opened this issue Jan 28, 2021 · 106 comments

Comments

@Dantasstic
Copy link

Is it possible to add or create a Favorites list of games (or a Last Played), either per system or for the entire unit combined?

I find I am wading through a lot of titles to get to my preferred ones, but I would rather not have to pare down my collection to more easily access my most used games.

@deusxmach1na
Copy link

I think a lot of your asks has to be firmware driven. The only thing we can mess with is RA configs, but the S30 UI would have to change to let you mark a game as favorite or load favorites unfortunately :(. I'm bummed too, cause I think it's a cool device with potential but it needs a complete UI overhaul and way more functionality. Let me know if the person working on the new firmware needs help, I'm not much of a system level coder but can try to help out if needed.

@retrogamecorps
Copy link
Owner

@deusxmach1na the developer behind Retro Arena is now working on it, but we have one big issue if you'd like to see what you can do (not related to favorites, unfortunately). We have a working N64 core now but cannot get the analog stick to register. If you have the time, it would be awesome if you could take a look -- the more eyes we get on it the better. I worry that we're not going to be able to figure it out via the limited RetroArch config options we have, much like L2/R2 on PS1. Either way, here you go: https://drive.google.com/file/d/1NqLgp6d_aCcrQPUc1tciNeGo1zUernnU/view?usp=sharing

Thanks!

@bkacjios
Copy link
Contributor

bkacjios commented Feb 3, 2021

IMG_20210202_225328134_HDR

RetroArch v1.9.0

So hey, I wasn't entirely sure where to post this, but this is something I have been working on all day today.

retroarch_sd.zip

This is a proper port of retroarch v1.9.0. Yes, that means it has the fully working menu system with all the bells and whistles. I made it so it completely replaces the god awful gmenu2x in it's entirety. If anyone would like me to tell you how I setup an environment to compile for this system, message me and I'll try to explain it.

Anyway, you can clearly see there is a major issue at the moment, the menu is rotated 90 degrees. Games will play in the correct orientation thanks to the video_rotation setting, but it's really awful to navigate. I'm going to work on editing the render backend and hopefully implement a way to rotate all of retroarch, but for now, feel free to mess around with this.

I'd recommend using a new SD card to test this, since I did a lot of file reorganization.
Then, extract the contents to your SD card, and place your cores in sd:/retroarch/cores and bios files in sd:/retroarch/system

Load up a core and select a rom, and it will be like the usual retroarch experience. You can press the power button to open the menu while playing a game as well.

Other thoughts

Now that we have access to the menu system, I decided to mess around with how it handles input. The device it detects, the mcu_ts, just straight up doesn't seem to handle specific buttons on the device. I'm not sure why this is, but the trigger buttons don't seem to work at all along with select. I'm not sure why this is.. I need to investigate that further. I may have to write a driver for it.

RetroArch also seems to be capable of reading the battery level of the device too, which is pretty cool. So hopefully once I sort out the kinks, this can be a good replacement menu.

@retrogamecorps
Copy link
Owner

Wow, this is incredible! Really well done. I'm going to share this with some others and see what they can do. Thanks for your hard work on this!

@slaminger
Copy link

slaminger commented Feb 3, 2021

Hi, I've been working on this too. I've got the toolchain from the company for cross compiling and I've got a bunch of new cores for it. Ive got a hunch the rotation issue might have help on the hard kernel forums. On the Odroid Go Advance handheld the screen is rotated and I recall an issue with retroarch needing to be rotated on that screen too.

@bkacjios
Copy link
Contributor

bkacjios commented Feb 3, 2021

Ah. I couldn't find the toolchain so I just built it myself by looking up which version of GCC the internal libraries used.

I couldn't find a way to rotate the screen at a kernel level, so I'm just modifying RetroArch's sdl2_gl driver to rotate it there. Since I posted my first preview, I've pretty much got it working. Still need to iron out a few issues.

IMG_20210203_045831927_HDR

@slaminger
Copy link

slaminger commented Feb 3, 2021

can i get the rotated binary please? I dont need everthing. just the actual file named retroarch. also if you want the toolchain i can share it.

@bkacjios
Copy link
Contributor

bkacjios commented Feb 3, 2021

retroarch.zip

Sure, but like I said it's incomplete. Only the menu is properly rotated at the moment on the sdl2 render driver. I think I messed something up too because the fps has dropped significantly. Going to try and fix it all tomorrow. I've been up all night trying to get this to work right.

But yeah, if you could share the toolchain that would be great. My solution is rather hacky at the moment.

@slaminger
Copy link

slaminger commented Feb 3, 2021

thanks. they actually sent me this, its an in development n64, the version of retroarch with a menu i asked them for, but like yours its rotated(menu only), and the toolchain. its rgui only which is fine, so long as it works, which it does so far, ive been playing with screen scaling. hopefully this will help you enable the buttons(which work on theirs) can you share either your sources or details on how you rotated the screen so i can share it with bitboy?
https://drive.google.com/file/d/12RYfRtfjidcNI2v2J6HHwxztBS7ze4-8/view?usp=sharing

@bkacjios
Copy link
Contributor

bkacjios commented Feb 3, 2021

I'll be making a repo with the changes I've made to retroarch in the morning. I don't see their version of retroarch in there though, just the n64 core.

@slaminger
Copy link

wrong link. oops.
https://drive.google.com/file/d/1DT1TPZd79jQeNwelKxg8f096tPllSE4a/view?usp=sharing this is for retroarch, hopefully you can combine the sources and toolchain and see what they are doing, and use it to finish yours with the buttons working. theirs has buttons working, and is rgui only, but is rotated sideways.

@bkacjios
Copy link
Contributor

bkacjios commented Feb 3, 2021

Nice. I'll diff their source against mine and see what they changed. Thanks a lot for all this. I'll hopefully have a fully working retroarch in the next few days.

@slaminger
Copy link

awesome. happy to help. I'm the guy who makes Retro Arena mentioned above btw. :)

@slaminger
Copy link

slaminger commented Feb 4, 2021

having fun yet?

@bkacjios
Copy link
Contributor

bkacjios commented Feb 4, 2021

retroarch.zip

I made a bit more progress. The sdl2 driver is properly rotated and all the buttons now work thanks to the source. I found out why the L2 and R2 buttons weren't working in their build too, since they never defined them in retroarch's input_keymaps.c file. They will now work on mine. I can't seem to get the analog stick to work still either.

The last problem is more advanced emulators like n64 use the gl graphics backend, which isn't rotated properly at the moment. I don't really know much about opengl, so I'm pretty much stuck here. I think the best bet would be to figure out how to rotate the screen at a kernel level. Sadly changing the /sys/class/graphics/fb0/rotate file doesn't seem to have any effect.

https://github.com/bkacjios/RetroArch/commits/pocketgo-s30

Here's my repo with the changes I made. It's not a lot, but figuring out the math behind rotating and positioning the output was a bit of a pain lol.

@slaminger
Copy link

you can rotate the screen bro, they sent me retroarch and n64 and it was sideways too. you must go to user interface and enable advanced options before you can rotate the screen. Unless you mean a stand alone n64 non core.

@slaminger
Copy link

can you share the binary so i dont have to compile please

@bkacjios
Copy link
Contributor

bkacjios commented Feb 4, 2021

I was talking about rotating the screen in the driver so the menus are correct. I know you can rotate the screen via the settings. I don't want that. I want the menus to be rotated correctly too. I'm trying to make it so everything just works. Like I said, the GL driver has issues in my build. This would way easier if I could just rotate the screen in the kernel

Also the binary is literally at the top of the post lol

@slaminger
Copy link

oh boy lol. my excuse is that ive been with my kids all day and its now after 11pm haha

@slaminger
Copy link

slaminger commented Feb 4, 2021

is it possible to compile it so that it does not have to replace the front end? i can use it in a normal build, but then power exits the emu instead of bringing up the gui. I know the front end here is pretty bad but it still supports scrapes and graphics, some people like that more than an rgui menu

@bkacjios
Copy link
Contributor

bkacjios commented Feb 4, 2021

I'm not sure what you're asking. If you want to use it with the original gmenu2x frontend, you can definitely do so without needing to recompile anything.

All I did was delete the original frontend and replace it with a script to launch retroarch. If you don't want that, use the original firmware and replace their retroarch binary with mine.

@slaminger
Copy link

i did try using the firmware and replacing the binary, but the menu button exits the game instead of opening the retro arch menu that way. also i dont want to lose the stand alone psx emulator if possible

@bkacjios
Copy link
Contributor

bkacjios commented Feb 4, 2021

You need to edit your config then.

input_exit_emulator should be nul
input_menu_toggle should be escape

The buttons and what key they press differ on my build.

@bkacjios
Copy link
Contributor

bkacjios commented Feb 4, 2021

Also, you mind sharing your contact of the developer with me? I'd really like to ask them if they can provide the kernel and android related source files. If we could edit the kernel to rotate the screen and flash it, that would be a godsend.

@slaminger
Copy link

[email protected] is the email, ask for vincent. Also, your retroarch has no close retroarch option i just noticed haha. not for in game, but not good if someone wants to enter the menu to make changes and leave or use scumm vm

@bkacjios
Copy link
Contributor

bkacjios commented Feb 4, 2021

Thanks. I'll shoot him an email.

You can enable quit retroarch in settings->user interface->menu item visibility

@slaminger
Copy link

slaminger commented Feb 4, 2021

my settings m match what you said but it still exits. it cant be hard coded in the front end because the company RA works but its sideways. But when i swap to your config start button becomes A to change setting and i have no back button. and still exit during game

@slaminger
Copy link

the strange thing is if i put your retroarch over mine and keep my config, the buttons dont work and its rotated lol, including the menu. if i swap to your config in the build which is based on stock, still no buttons but the retroarch menu rotates the right way. is the option to rotate retroarch menu in the config?

@deusxmach1na
Copy link

@slaminger and @bkacjios Looks like it's coming along, keep going! I wish I knew C better so I could help. Thanks for all your hard work!

@slaminger
Copy link

slaminger commented Feb 4, 2021

bkacjios ive noticed in your retroarch i cant map or move with the joystick, but in the factory provided retroarch with the sideways menu, i can configure and use the joystick, so whatever is missing is in the toolchain and sources we have. I was able to get most everything else working and integrated to keep the gxmenu front end and have the newer retroarch thats rotated correctly in the back end.

@slaminger
Copy link

Awesome! I'll check it out now. Thank you :)

@slaminger
Copy link

I've been able to install a lot of libs and start getting stand alones and ports going.

@slaminger
Copy link

mp3s work ok, videos seem to not play/freeze the device, I tried going down as low as 320 but it didnt work, i only tried with mp4 tho.

@ronaegis
Copy link

If anyone would like me to tell you how I setup an environment to compile for this system, message me and I'll try to explain it.

@slaminger I would really like some documentation/pointers on how to setup the cross compile environment, thanks :)

@bkacjios
Copy link
Contributor

bkacjios commented Feb 15, 2021

https://drive.google.com/file/d/1DT1TPZd79jQeNwelKxg8f096tPllSE4a/view?usp=sharing

Download that onto a Linux system and extract it into a folder. cd into said folder and run the command source env_setup.sh to setup the toolchain.

It should then be as easy as running make, cmake, configure, or whatever in the project you are trying to compile. Some projects are easier than others. Just look out for setting the correct prefix, host, and target variables for the toolchain.

@bkacjios
Copy link
Contributor

For anyone having joystick issues, mind giving this little program I made a test? Will show you the raw joystick values and any button presses. The tiny grey circle in the joystick display is where the joystick was reporting center when the program was opened. Holding start will exit the program.

joytest.zip

screenshot

After reverse engineering the manufacturers's joystick calibration program, I found that all it does is set an environment variable SDL_JS_CORRECT that isn't actually used at all.. At least it isn't used by their build of SDL2 which is what we use for retroarch.

I'm going to try to make this a calibration program and integrate it with my build of retroarch.

@fcorbier
Copy link

fcorbier commented Feb 16, 2021

@bkacjios Thanks again for the toolchain! The native port of Super Mario 64 is off to a good start :)

Literally the first run of the binary on the device:
image0
image1

@bkacjios
Copy link
Contributor

Oh nice! I was actually just thinking of doing the same thing!

@retrogamecorps
Copy link
Owner

Thanks everyone so much for your active work on this! I still need to update my GitHub repo to reflect the changes I've made to my 'Simple30' sd card image. Can't wait to try SM64 :)

@bkacjios
Copy link
Contributor

bkacjios commented Feb 17, 2021

joycalib.zip

I finished my joystick calibration program. It requires my version of SDL2 library and custom build of retroarch as well. It works by creating a calibration.dat file on the SD card. My version of SDL2/retroarch will load that file and apply the transformations necessary on the joystick. Hopefully this fixes the walking issues that @slaminger was having. You could theoretically replace zkjoycalib with this.

Pressing SELECT will enter calibration mode.

While in calibration mode, if you rotate your joystick, it will fetch the maximum ranges of each axis as displayed by little grey lines.
You can finish calibration by pressing START or reset/recenter the joystick by pressing SELECT.

While out of calibration mode, you can then see that the teal dot will show the scaled output that will be used by retroarch.

Hold start to save/quit.

@retrogamecorps
Copy link
Owner

I've moved my new Simple30 "firmware" to a new GitHub repo to avoid confusion, which you can find here. It's a compilation of the work done so far and streamlined into a single user experience.

@bkacjios I would like to incorporate your new calibration tool into my image if you're good with that. I had tried adding in your ffmpeg updates to my Simple30 but it ended up losing all menu button inputs in RetroArch, so I have to figure out how to get all that implemented. Thanks for your work on this!

@bkacjios
Copy link
Contributor

Go for it. The program actually has a secret easteregg that contains my credits in it, so yeah.

But also, yeah, my version of SDL2 has a different keyboard layout than the one the manufacturer used. That's why your buttons stopped working.

The keyboard keys will now match the button names. Like the ABXY buttons will be ABXY on the keyboard rather than the strange ASZX layout or whatever it was. The trigger buttons are now {}() as well. You would just have to rebind everything in the input settings.

https://github.com/bkacjios/SDL-mirror/blob/9199675acf6ebd37c411e671a2cf910868c6cea2/src/events/scancodes_pocketgos30.h#L88

Here's the file where I set the scancodes for the S30.

@fcorbier
Copy link

@bkacjios Is it okay if I start a repo for hosting your toolchain? That way I can have a Dockerfile that automatically builds binaries and should work on Windows, Linux and Mac.

@bkacjios
Copy link
Contributor

It's not my toolchain. @slaminger got it from the manufacturer. But still, that does sound like a good idea.

@slaminger
Copy link

@bkacjios Is it okay if I start a repo for hosting your toolchain? That way I can have a Dockerfile that automatically builds binaries and should work on Windows, Linux and Mac.

sure, go ahead

@bkacjios
Copy link
Contributor

Hey, think we should maybe setup a discord server to discuss development and such outside of a single github issue thread? lol

@fcorbier
Copy link

fcorbier commented Feb 17, 2021

Hey, think we should maybe setup a discord server to discuss development and such outside of a single github issue thread? lol

Haha, looks like most of us are here: https://discord.com/invite/p4uRmCd

In #pocket-go-s30: https://discord.com/channels/529983248114122762/779295877951914005

@bkacjios
Copy link
Contributor

Can you link a server invite? I'm not in whatever server that channel is in.

@fcorbier
Copy link

@bkacjios
Copy link
Contributor

Ah, you updated your post, thanks!

@Dantasstic
Copy link
Author

@bkacjios , @slaminger Do you know anything about the left channel audio only issue and whether it is hardware or can be addressed via software? It would sure suck if it was literally wired this way....

https://github.com/retrogamecorps/Simple30/issues/2

It appears that the only audio being output is the left channel audio. It is not a true mono combined track, as it is completely missing the right track information entirely.

Even with headphones plugged in, it simply plays the left side audio channel out of both speakers, instead of a left and right channel audio or a proper combined mono track from both ears.

EDIT: Here is a video I made regarding this issue, using beside a GBA for an example of a single speaker sound setup

https://youtu.be/L0o4sMfLWoE

@bkacjios
Copy link
Contributor

bkacjios commented Mar 6, 2021

retroarch-audio-filters.zip

Here are some DSP filters you can add to your SD card. One of them is mono audio. You can enable them in Settings->Audio->DSP Plugin

@Dantasstic
Copy link
Author

Dantasstic commented Mar 6, 2021

retroarch-audio-filters.zip

Here are some DSP filters you can add to your SD card. One of them is mono audio. You can enable them in Settings->Audio->DSP Plugin

Tested, and the audio is still left channel only. (FYI, this audio issue occurs even on the stock SD card and OS that ships with the S30)

@bkacjios
Copy link
Contributor

bkacjios commented Mar 6, 2021

They seem to be working for me. Setting it to wahwah is a really good DSP to use to make sure DSP is functioning. I also tested it in Pokemon Fire Red by setting the DSP to mono and changing the in-game audio setting back and forth between stereo and mono, and the audio was always mono.

@Dantasstic
Copy link
Author

Hmmm ok, after another attempt and a reboot of the device, I can get the mono.dsp to work in game. I appreciate the help!

So......does that mean this device is not only incapable of stereo output through the headphone jack, but also that it was wired up in such a way that it requires a damn plugin in RetroArch to get proper mono sound? ...smh

@retrogamecorps
Copy link
Owner

sound-setting.zip

Bittboy just sent me this file, which they said will allow your previously-saved sound settings to persist between shutdowns. I'll ask them if they know anything about the left channel audio issue.

@acmeplus
Copy link

acmeplus commented Apr 28, 2021

Hopefully we can get the full code. It would be a godsend for the device. It has a lot of untapped potential. Also, as for debugging and what not, I really recommend installing android development tools, specifically ADB.

You can connect to a console on the device using the command adb shell and you can even open retroarch on it and see the log output in real time. It's how I've been doing development for it. I've been toying with building a version of GDB for debugging as well, but haven't had a need for it yet.

Like, this is my current command for building and immediately running retroarch.

make; adb push retroarch /mnt/extsd/bin; adb shell "/mnt/extsd/bin/retroarch -v -c /mnt/extsd/retroarch/retroarch.cfg"

This single line will build any changes I made to retroarch, upload the binary to my SD card through USB, then run and open the output of the program in my terminal on my Linux PC. It's great!

I was also thinking about building emulation station for it, but the toolchain has been holding me back. Building any big and complex libraries really likes to break it. Like even just trying to compile a newer version of SDL2 has been problematic for me.

I wasted a lot of time thinking adb was not working, until realizing that it was the linux driver getting mixed up with adb. I finally got adb working, and it's much easier (tried to get UART working but all I got was pseudo random characters).

I managed to get OpenBOR and other tools, but of course it's a pain to have to rotate the screen individually. It would be much better to do it at the SDL2 level like the OGA. I also got ES compiled, but of course it breaks due to the strange SDL2 library.

Did you notice the pandora driver embedded on the SDL2? I know you reversed engineered their SDL library, but I saw that you created a dedicated pocketgo s30 video driver instead.

@bkacjios
Copy link
Contributor

Yeah, I ran their SDL2 library through Ghidra and found that it uses the pandora driver. My SDL2 library used pandora as a base, but I just made its own dedicated driver for code organization, since it requires a quite hacky way to get input events working.

Honestly, the device on a software level is an awkward and hacky mess. It's hard to do rotation at a SDL level since the system doesn't have any window manager at all and just renders directly with EGL, which doesn't support rotation of the framebuffer.

I've pretty much stopped using the device since I got an rg351m, so I haven't really tried to hack it further in hopes someone more experienced with hardware hacking would do it.

@acmeplus
Copy link

Yes, the moment I saw the pandora driver references I thought this is a franken-device... I was assuming its a simple sunx4i-drm compatible with Mali400, but does not seem to be that straightforward. A potential lateral approach would be to go the Weston/wayland route and rotate the display that way. Getting KMSDRM would be ideal, but I don't think the display driver is compatible with libdrm.

I've actually build a separate buildroot based on the same linker for ABI compatibility. All applications are compiled (Mupen, amiberry, openbor, etc.) but only a few work with proper video.

Anyway, I'll keep tinkering and post updates here, our repo will be up once we stabilized buildroot.

Thanks a lot for all your info, and enjoy that RG351m... (I may skip it and get a RGB10max... :))

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

8 participants