I have a main loop like this:
while true do
-- Only read the next frame of data if the last one was used
if input_was_used and not finished then
read_next_frame() -- sets buttons, X, and Y variables
input_was_used = false
end
if not finished then
joypad.set(buttons, 1)
console.log(string.format('Buttons : %s', table.tostring(buttons)))
local analogs = { ["X Axis"] = X, ["Y Axis"] = Y }
joypad.setanalog(analogs, 1)
end
if finished then
console.log("Movie finished")
client.pause()
return
end
emu.frameadvance()
end
The log statements indicate that the 'buttons' table is being populated correctly, for example key "Start" gets value true (boolean). However, the button data never gets passed to the emulator.
The analog data DOES get passed to the emulator, just not the button data.
This is for N64 ... Mario Kart 64 ROM
Am I using joypad.set wrong?