I've been fiddling with firefox and trying to learn about javascript programming and read about the gamepad API so I thought I'd write a gamepad tester in javascript:

My javascript code is crap, but it taught me a lot about how gamepads work under firefox and chrome in linux: The big takeaway is that the gamepad is invisible in a window until you "generate some activity". This activity can be moving the joystick axis or pressing a button.

g = navigator.getGamepads()

returns an empty array until you move the gamepad/joystick. If anyone wants to see my crap tester I'll clean it up and post it somewhere. Let me know.

Before moving the joystick:

[Linked Image from i.imgur.com]

After moving the joystick, you get an array of gamepads:

[Linked Image from i.imgur.com]



[Linked Image from i.imgur.com]


So I figured, what online emulators could use a joystick?

I tried scullinsteel's online apple // jse emulator and amazingly it supports the joystick. Until you move the joystick, the mouse controls PDL(0) and PDL(1) but after movement, it returns values from the gamepad api.

[Linked Image from i.imgur.com]

pulling the joystick into the lower right for 255,255

(note that here you see two different firefox windows reading the same gamepad. Even though the gamepad was active in one firefox window, it wasn't active in the other freshly opened window until there was gamepad activity)

[Linked Image from i.imgur.com]

Ahhh, yes! Choplifter plays great with a joystick!



Then I thought, didn't I hear that you can run mame in a browser?

So I went to archive and tried Total Replay and it amazed me: It's mame in a browser, and it blew my mind when I saw you can access the UI and everything.

[Linked Image from i.imgur.com]

but too bad, the joystick didn't work, one possible reason is that -gameio joy wasn't specified, and if you enable the joy from the UI and reset, it hangs. But I see the potential there, and it's awesome.

[Linked Image from i.imgur.com]

Last edited by Golden Child; 11/07/21 04:50 PM.