MCPcopy Create free account
hub / github.com/TASEmulators/fceux / FCEU_LuaReadJoypad

Function FCEU_LuaReadJoypad

src/lua-engine.cpp:6675–6680  ·  view source on GitHub ↗

* Reads the buttons Lua is feeding for the given joypad, in the same * format as the OS-specific code. * * It may force set or force clear the buttons. It may also simply * pass the input along or invert it. The act of calling this * function will reset everything back to pass-through, though. * Generally means don't call it more than once per frame! */

Source from the content-addressed store, hash-verified

6673 * Generally means don't call it more than once per frame!
6674 */
6675uint8 FCEU_LuaReadJoypad(int which, uint8 joyl) {
6676 joyl = (joyl & luajoypads1[which]) | (~joyl & luajoypads2[which]);
6677 luajoypads1[which] = 0xFF;
6678 luajoypads2[which] = 0x00;
6679 return joyl;
6680}
6681
6682//adelikat: Returns the buttons that will be specifically set to false (as opposed to on or nil)
6683//This will be used in input.cpp to &(and) against the input to override a button with a false value. This is a work around to allow 3 conditions to be sent be lua, true, false, nil

Callers 1

UpdateGPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected