libretro / nestopia

Nestopia emulator with libretro interface
GNU General Public License v2.0
51 stars 46 forks source link

Use input callbacks #81

Closed keithbowes closed 7 months ago

keithbowes commented 12 months ago

@carmiker mentioned in PR #80 that we should use callbacks for input handling, which is what this PR does, seemingly correctly.

carmiker commented 12 months ago

@keithbowes very nice work. There is some room for improvements though.

The FDS disk operations should not be inside the gamepad callback. That callback is only going to be performed when the emulator wants to strobe the gamepad's input pins, which will not necessarily happen when the system is waiting for a disk swap, and it adds unnecessary overhead to a callback that will be performed for each connected gamepad, potentially multiple times per frame. It might make sense to keep update_input() around for this type of thing only, and have the callbacks only handling the portions related to actually strobing the input pins.

VS System should also have its own callback, not be part of the gamepad callback.

carmiker commented 7 months ago

@keithbowes I will be helping maintain this repo directly in the future, so please remain patient and I will look at this again soon.