Post subject: UCDP: Universal Console Dashboard Project.
Joined: 2/5/2014
Posts: 28
All the strange questions I've been asking since I showed up here have been about the UCDP, my little project that uses lua scripting to add basic functionality to a menu accessible via your gamepad. I've made menus for FCEUX, Snes9x-rr and Gens-rr that allow you to load a state, save a state reset the game and exit the emulator via a menu accessable by pressing start+select(or mode in the case of gens). Video Previews and full details can be found on my site: http://dragonking.arcadecontrols.com/static.php?page=AboutUCDP This really covers multiple emulators, but I'm new here and wasn't sure where to post it. If the admins have a better place for it, feel free. Enjoy and thanks to everyone who helped.
Editor, Skilled player (1203)
Joined: 9/27/2008
Posts: 1085
I think I can fix up the de-bounce stuff you've got in that lua. Have the controls be more responsive the moment you press a button and never repeat it even if you keep it held too long. Download PressTest.lua
Language: lua

local keys, lastkeys= {}, {} local function UpdateKeys() lastkeys= keys; keys= input.get() end local function Press(k) return keys[k] and not lastkeys[k] end local function Fn() UpdateKeys() if Press("space") then print("Hi, I'm some text! How are you?") end if Press("tilde") then print("Quick! Put useful code here instead!") end end gui.register(Fn)
This short piece of function stuff is roughly what I'd be using. And I'd make a separate set that replaces input.get() with joypad.getimmediate(1) for dealing with the controller stuff. Or, since I just offered a piece of code up there, you can make the changes yourself if you think you understand. It's your stuff, after all. ... As for whether this is a perfectly valid spot to place your multi-emulator code, I took a quick look around the forums. Honestly, this looks to me the best spot, as this is meant more for the emulators, playing games for fun, and not at all about TASing, and it certainly doesn't fit in "Other Emulators". The next best place is "Off topic", but, well... That's practically a catch-all.
Joined: 2/5/2014
Posts: 28
Thanks for the code. I'm not sure if it's needed though. I probably need to take the delay out of the buttons completely and use that, but the menu navigation needs a de-bounce instead. You want to be able to hold down up/down/whatever to scroll through the menu. It's not super important for gens and snes9x, but the game genie menu in fceux definitely needs it. That's why I was doing each one individually, (and have two calls to the joystick instead of one) but in the end I forgot to remove the delay for the buttons. Oops! :) That's a lot cleaner way of doing it though.