dMZX Forums: Interface GPIO pins on RPI? - dMZX Forums

Jump to content

If you are new to DMZX, please take the time to look over the FAQ pinned in General before asking a question.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Interface GPIO pins on RPI? Can you use the GPIO pins in any way?

#1 User is offline   Skakmat 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 12-October 19

Posted 29 October 2019 - 08:53 PM

I already posted the query in my game jounral post, but I had the thought of potentially linking some Robotic script to an external device to produce some cool effects, like haptic feedback or a custom controller for puzzle games.

I imagine it's not something that's implemented, but you don't know unless you ask, right?

:)
0

#2 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 29 October 2019 - 11:42 PM

MegaZeux generally doesn't expose any platform-specific features like this to MZX games and that probably isn't changing. SDL 2 has a built-in haptic library, so there's a (very slim) chance that particular example might be doable sometime in the future if MZX ends up supporting it and SDL supports whatever the Raspberry Pi uses for haptic feedback. Don't count on it being soon (if at all), though.

If you make the custom controller an HID-compliant USB/Bluetooth/etc. device that might be enough to get SDL to detect it, in which case you can set up a game controller mapping for it. I don't know what the specifics are for getting SDL to detect a controller in Linux.

Typically what MZXers end up doing for these sorts of extensions is communicating with an external program via file access. If you want to do this, that's probably how you'll have to go about it.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

#3 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,938
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 30 October 2019 - 02:45 AM

View PostLachesis, on 30 October 2019 - 09:42 AM, said:

Typically what MZXers end up doing for these sorts of extensions is communicating with an external program via file access. If you want to do this, that's probably how you'll have to go about it.


Linux typically exposes gpio through the filesystem, but MegaZeux's path protection won't let you write to it directly. What you could do is set up a symlink in your game's directory pointing at one of those gpio files, make sure the permissions are all good, then have your game write to that.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#4 User is offline   Skakmat 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 12-October 19

Posted 30 October 2019 - 01:11 PM

View PostDr Lancer-X, on 29 October 2019 - 09:45 PM, said:

Linux typically exposes gpio through the filesystem, but MegaZeux's path protection won't let you write to it directly. What you could do is set up a symlink in your game's directory pointing at one of those gpio files, make sure the permissions are all good, then have your game write to that.



Whoa, alright. I'll have to figure out all the intermediate steps, but thanks a ton for that!
0

#5 User is offline   Skakmat 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 12-October 19

Posted 30 October 2019 - 01:14 PM

View PostLachesis, on 29 October 2019 - 06:42 PM, said:

MegaZeux generally doesn't expose any platform-specific features like this to MZX games and that probably isn't changing. SDL 2 has a built-in haptic library, so there's a (very slim) chance that particular example might be doable sometime in the future if MZX ends up supporting it and SDL supports whatever the Raspberry Pi uses for haptic feedback. Don't count on it being soon (if at all), though.

If you make the custom controller an HID-compliant USB/Bluetooth/etc. device that might be enough to get SDL to detect it, in which case you can set up a game controller mapping for it. I don't know what the specifics are for getting SDL to detect a controller in Linux.

Typically what MZXers end up doing for these sorts of extensions is communicating with an external program via file access. If you want to do this, that's probably how you'll have to go about it.


And thank you as well
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users