I don't understand how nxengine-evo manages to prevent inputs from leaking out of options mode, map system, and inventory with memset(inputs, 0, sizeof(inputs)).
By replacing memset(inputs, 0, sizeof(inputs)) with memcpy(lastpinputs, inputs, sizeof(lastpinputs)) in various places and enabling weapons only when pinputs[FIREKEY] is true and lastpinputs[FIREKEY] is false, I could prevent inputs from leaking out of options mode, map system, and inventory.
With these commits, pressing fire key to exit options mode, map system, or inventory doesn't trigger machine gun.
Even nxengine-evo and cave story engine 2 activate machine gun when I press fire key to exit options mode, map system, or inventory.
I don't understand how nxengine-evo manages to prevent inputs from leaking out of options mode, map system, and inventory with
memset(inputs, 0, sizeof(inputs))
.By replacing
memset(inputs, 0, sizeof(inputs))
withmemcpy(lastpinputs, inputs, sizeof(lastpinputs))
in various places and enabling weapons only whenpinputs[FIREKEY]
is true andlastpinputs[FIREKEY]
is false, I could prevent inputs from leaking out of options mode, map system, and inventory.With these commits, pressing fire key to exit options mode, map system, or inventory doesn't trigger machine gun. Even nxengine-evo and cave story engine 2 activate machine gun when I press fire key to exit options mode, map system, or inventory.
Figuring this out took two days.
This fixes https://github.com/libretro/nxengine-libretro/issues/85