X16 Emulator & Retropi

Get technical support from the community & developers with specific X16 programs if you can't find the solution elsewhere
(for general non-support related chat about programs please comment directly under the program in the software library)
Post Reply
electricwildflower
Posts: 7
Joined: Wed Apr 23, 2025 5:26 pm

X16 Emulator & Retropi

Post by electricwildflower »

Hopefully i'm in the right part of the forums

So i have successfully got the Command X16 emulator into Retropie with it's own system. I spent a good few hours arguing with the build till it finally worked, you can see the results below.

https://retropie.org.uk/forum/topic/370 ... all-script

There is a good way to go to get it better integrated and got a couple of questions

1 - How do you exit the emulator whilst in full screen as in what is the key combo?

2 - How does one exit a game or even exit the emulator whilst in a game whilst in full screen as in what is the key or pad combo?

3 - Controllers i understand the arguments -joy1, -joy2, -joy3, -joy4 enables binding a gamepad to that SNES controller port but is there a better explanation in terms of controller mapping as the Pi script i currently have

"$EMULATOR_DIR/x16emu" -fullscreen -prg "$PRG_FILE" -run

This starts a game in full screen in the emulator but with the research i have been doing (sidetracked with other emulators) i'm totally missing where to find the info for some of the above so i can update the argument file with anything needed.

Also on a side note

PC - x86/64 it installs fine and can play some games
Raspberry Pi (PI 4 tested) - Got it installed but when i try and run a game it just flashes and goes back to Retropi menu so need to figure out what's up with that.

Anyway thank you for your hard work on the system and emulator :)
User avatar
JimmyDansbo
Posts: 493
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Re: X16 Emulator & Retropi

Post by JimmyDansbo »

At the moment, I believe there is no key combination to exit the emulator.
You could press CTRL+R to do a reset of the emulator and type POWEROFF.

Most of the documentation for the emulator is actually found in the README on the github repo
I had a look at the source of the emulator and unfortunately it seems there is no way to actually assign specific joysticks to to the virtual SNES ports, you simply tell the emulator how many joysticks you want to use and it will try to attach system joysticks to the virtual SNES ports.

Remember that tings are case sensitive on linux (raspberry pi).
All files that should be read by the emulator (.PRG, .BIN, .ZSM etc.) should be all capital letters.

I look forward to following your progress with getting the x16 into retropie.
Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
electricwildflower
Posts: 7
Joined: Wed Apr 23, 2025 5:26 pm

Re: X16 Emulator & Retropi

Post by electricwildflower »

Thank you for the info, i did find the github

At the moment i have it working partially on PC, it creates a system under Retropie, you add a rom to the roms folder, the rom.bin to the relevant bios folder (had to simlink to the emulator for bios as it needs to be in the same folder??) and then you boot Retropie and boot a game just like any system. Some games have booted fine, others just load the emulator and you got weird garbage or colours on the screen.

The Raspberry Pi though just flashes and goes back to the Retropie menu so need to figure out why as it uses the same script unless i need to modify it for the PI?

And that's as far as i have got at the moment

1 - Exiting - I currently have to switch to a terminal and kill the emulator or reboot the system, need a cleaner way to exit and get back to Retropie menu, maybe an argument that uses the hotkey for Retropie to kill the emulator?

2 - Control pads - Will need to look into this and work on a solution or maybe stick to keyboard and just document it well?

I did look into the github docs and just need to learn all the commands and hopefully find a good solution for the above. I just need someone other than myself to test it and provide feedback.
User avatar
JimmyDansbo
Posts: 493
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Re: X16 Emulator & Retropi

Post by JimmyDansbo »

You can use the -rom option to tell the emulator where to find the ROM.BIN file.

If you load a game/program and it just displays garbage, chances are it was not able to load the required assets. I suggest you make sure that all files used by the emulator are all capital letters, that usually solves the problem.
An alternative could be to place the games inside retro pie as sdcard images, that way the developer of the game could ensure that all relevant files are included in the sdcard image. Unfortunately that means that each program will be at least 34MB's as that is the smallest size the sdcard image can have.

Are you using the same binary for PC and Raspberry Pi? You shouldn't.
Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
electricwildflower
Posts: 7
Joined: Wed Apr 23, 2025 5:26 pm

Re: X16 Emulator & Retropi

Post by electricwildflower »

Thank you for the response

1 - Rom - so i don't need to use a symlink and can just tell the emulator the rom is in so and so location with an argument?

2 - I have noted it down and will make sure it's capital letters and see how it goes and report back

3 - Many roms for emulators the size of roms can range from a few kilabytes to over 100 gig+ depending on the emulator so i'm sure having sd card images at least 34mb's wouldn't be a problem for many people but will need ti do some testing on this.

4 - for the PC version i pulled the following github link https://github.com/X16Community/x16-emulator.git and for the Raspberry Pi i installed Raspberrypi os with Retropi on top for easier testing but i don't have an official script written yet just for the PI so i just tested the one for PC and it pulled, installed etc and i managed to get a game running outside of RetroPi but inside RetroPi again it just flashes and does nothing else.

A script specifically for the Pi will need to be created but at the moment i'm focusing on working out the arguments, getting the emulator exited and so on. There will also need to be some documentation on how to use it in Raspberry Pi created but that's for a future date when i figure it all out

Thank You again for the response though this will certainly help me along
User avatar
JimmyDansbo
Posts: 493
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Re: X16 Emulator & Retropi

Post by JimmyDansbo »

Yes, with the -rom option, you tell the emulator where the rom is located.

Please keep us posted on your progress, others have had the emulator running on raspberry pi under the default window manager, but pi4 seems to be too slow to run the emulator at full speed.

retro pi may have some tricks up it's sleeve that will enable it to run the emulator at full speed?
Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
electricwildflower
Posts: 7
Joined: Wed Apr 23, 2025 5:26 pm

Re: X16 Emulator & Retropi

Post by electricwildflower »

Thank you

In regards to the rom.bin i have now set up an argument so it just checks the /BIOS/x16 folder for the rom.bin file and passes it through to the emulator so simlinking is done away with and it works fine.

exec "$SCRIPT_DIR/x16emu" -fullscreen -rom "$BIOS_PATH" -prg "$PRG_FILE" -run

Would it be possible for me to add to the script so it automatically pulls the rom.bin file from the github page and drops it in the relevant bios folder if that's allowed or does the user have to manually do it themself. It would automate the process easier but i don't want to overstep copywrite or anything else. Of course a user will have to replace the file as and when a new version is release if it happens.

In terms of exiting i could possible give Retropie instructions so when the Hotkey & Start is pressed it kills the emulator process for Commander X16 and boots them back to Retropie menu but would that be safe to do so as i don't want it to corrupt any files or cause issues so they have to reinstall

In terms of controllers we have the args -joy1`, `-joy2`, `-joy3`, `-joy4` enables binding a gamepad to that SNES controller port. Maybe if i could get Retropie to pass through an argument that says take what ever controller is currently used and bind it to joy1, joy2 etc and pass it as that so in a sense it's making the emulator think they just plugged in a gamepad?
User avatar
JimmyDansbo
Posts: 493
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Re: X16 Emulator & Retropi

Post by JimmyDansbo »

It is possible to pull the latest ROM from github, but I am fairly sure that it will violate the agreement that has been made with Cloanto.

Killing the emulator will not destroy anything unless a program is running inside the emulator that is trying to write to a file and then it will only be the file in question that could possibly get destroyed, not the entire x16emulator installation/configuration.

I have no idea how retro pie handles gamepads, but you may just be able to run the emulator with -joy1 -joy2 -joy3 -joy4 options. It seems to just ignore it if there are no gamepads attached to the system that can be used.
Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
electricwildflower
Posts: 7
Joined: Wed Apr 23, 2025 5:26 pm

Re: X16 Emulator & Retropi

Post by electricwildflower »

Thank you for the clarification

I will leave out the rom and a user can source it themself, i wouldn't want to violate an agreement or anything so it's not the end of the world if a user has to do a quick google search and manually add it themself.

That's good to know and i'll get the code updated as a test for a user to use the Hotkey & start buttons in Retropie to kill it and take them back to the Retropie menu. Until i find a more elegant solution other than killing the process.

I'll give the -joy1, -joy2 a test and see how that goes and if not i can always look up the documentation on gamepads in Retropie and figure out something unless someone more knowledgeable in Retropie will figure out it. I have the post in the RetroPie forums anyway for people to jump in and test.
Post Reply