GithubHelp home page GithubHelp logo

Improvements about snesdev-rpi HOT 5 OPEN

petrockblog avatar petrockblog commented on June 12, 2024
Improvements

from snesdev-rpi.

Comments (5)

petrockblog avatar petrockblog commented on June 12, 2024

Thanks for that - looks great. I will add the enhancements based on your work!

from snesdev-rpi.

DerekRoth avatar DerekRoth commented on June 12, 2024

@axle-h does your fork work when using the GPIO adapter ? I installed it hoping it would solve the issues i'm having with my SNES controllers, but i don't know what values i should put in the configuration file, since the pins of the SNES controllers are not directly connected to the Pi GPIOs.

from snesdev-rpi.

DerekRoth avatar DerekRoth commented on June 12, 2024

Never mind, i found my answer for revision 2 of the adapter :

  • Gamepad 1 GPIO = 27
  • Gamepad 2 GPIO = 22
  • Clock GPIO = 23
  • Latch GPIO = 24
  • Button GPIO = 17

It's working but i see you have removed the option to handle different behaviours on 1, 3 or 5 presses on the button. Is there a way to get this option back ? Sorry to ask this question here, but you didn't open the "issues" tab on your Github fork.

from snesdev-rpi.

axle-h avatar axle-h commented on June 12, 2024

Hi, Yeah probably not right place to be talking about a different branch here until/if it gets pulled. Issues can only be created on the original repository unfortunately. Is my email address not visible?
I don't know about the adapter - I built my own. Most of the fun of using the Pi is to find your own way anyway!

I took the button press polling thing out as it was a bit over complicated, was difficult to setup from a config file and I didn't need it. It should be relatively easy to implement though. Check out button.c. It's a simple state machine. You just need to add some more states and decide when to switch to them. Maybe add a counter in the button struct and "do stuff" when it hits a particular threshold - I think that's how Florian implemented it. It might be difficult however to add this to the config. Hence why it's not in my branch. Might look at it. Be an excuse to have another dabble with this. Unless you fancy a go?

from snesdev-rpi.

DerekRoth avatar DerekRoth commented on June 12, 2024

I'm writing here instead of e-mailing because this may be of some interest to someone using your fork :)
I understand your code but i'm not a C dev, so for now i'll keep it like this. Maybe i will try to patch it some day.
For the configuration of the button, you don't have to make it fully configurable with a variable amount of programmable key presses. Maybe you could just have something like this :

Buttons {
    Button 1 {
        Enabled = true

        # Tap the button to press this keyboard key
        SinglePressKey = "R"
        #SinglePressCommand =

        # Double tap the button to press this keyboard key
        DoublePressKey = "ESC"
        #DoublePressCommand = 

        # Hold the button for 3 seconds to execute this command
        LongPressCommand = "shutdown -t 3 -h now"
        #LongPressKey = 

        Gpio = 5
    }

    # Frequency to poll buttons in Hz
    PollFrequency = 2
}

What do you think ?

from snesdev-rpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.