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

Add joystick / gamepad support using distribution html files #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joyrider3774
Copy link
Contributor

@joyrider3774 joyrider3774 commented Jun 20, 2022

Hi,

I noticed this version of the emulator had no joystick / gamepad support, but the WASM version did. So i added joystick / gamepad support to the distribution html files for this version of the emulator.

I keep using RequestAnimationFrame to handle joypad input and i only reset the joypad button state once after not pressing any buttons / axises. If i did not do this keyboard and touch input had problems.

This allowed me to use the emulator on my arcade cabinet as well as on the steamdeck as you can see in the video's below. (basically i used chrome / edge with local html files and made the bin= variable from within the frontends. I also had to disable websecurity to go around CORS issues from loading files using file:// protocol but this is not a problem as everything is done locally

2022-06-19.23-54-11.mp4
2022-06-20.02-00-53.mkv.mp4

@aoneill01
Copy link
Owner

This is amazing!
This was particularly satisfying to see running on an arcade cabinet as I have been building a cabinet myself: https://www.youtube.com/watch?v=jZMGX-tDTWA

@joyrider3774
Copy link
Contributor Author

joyrider3774 commented Jun 25, 2022

Hi thanks, it was already always possible i just needed to have the scaling and a bit of tinkering to make the emulator load from a local file and local bin files.

It is indeed seriously fun & cool to see it running, i did the same with arduboy games but arduboy was a bit easier as it would seem retroarch added a core for it. But it was still fairly easy to make it work with your emulator once i added the gamepad support. the only real thing you need to know is to load chrome (or edge) with --disable-web-security --user-data-dir=c:/somedir to make it go around cors issues and load from local files. (word of warning never surf the web with these commandline parameters active, only use it to load the emulator loacally)

Also its very cool you made a cabinet with original motherboard of the original arcade. Mine is has a pc inside it running windows that autoboots into the frontend i use (attract mode).

Now i also tried it on a raspberry pi 4 but the pi 4 was too slow to handle the html5 emulator, or it was chromium not running well on my rpi4. I have the same issue on my old android phone but you can run it also on phones using the scaling things. i tested that and i even released a game on itch.io using those dist files and the wasm version of the emulator. On a phone i load a version with the console skin and touch screen input and on desktop / pc i load it using a fullscreen version.

If you want to see that in action you can check that here try going to the page and pressing run game on a desktop pc / browser as well as on your phone (if it can handle the emulator)

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

Successfully merging this pull request may close these issues.

2 participants