paulscode
New member
During the course of writing an Android front-end, I've run into two small hurdles which would require somewhat hackish workarounds to avoid modifying the core. These may be very specific to my project and not likely to affect most front-end devs, but I thought I'd bring them up anyway in case they are worth looking at. Also note that I might have missed something already in the API, so feel free to correct me if solutions to these already exist!
The first issue is there is no interface for determining when a save-state has completed. State-changes are not synchronized with save-states, so the state-change callback can not be used to obtain this information (for example, doing M64CMD_PAUSE, M64CMD_STATE_SAVE, M64CMD_RESUME in conjunction with a state-change callback listening for M64EMU_RUNNING is not a reliable way to determine when the save-state is complete). It would be useful to either add a save-state callback, or to add an additional emu state (such as M64EMU_SAVESTATE_COMPLETE, for example), or even to just re-notify the current state (M64EMU_PAUSED or M64EMU_RUNNING) every time a save-state is complete.
The second issue is there is no interface for the Gameshark Button other than assigning it to a key or joystick control in the config file. The actual implementation for this function is hardwired into the core with SDL input listener. For a front-end where input is more abstract, there is no apparent way to access this function other than injecting SDL events. Of course there are a few other functions besides this one that can be assigned to key or joystick via the config file, but all the other functions have obvious interfaces in the API to re-implement them in the front-end. This was the only one that gave me pause (there are a couple I didn't use though, Screenshot and Full Screen).
The first issue is there is no interface for determining when a save-state has completed. State-changes are not synchronized with save-states, so the state-change callback can not be used to obtain this information (for example, doing M64CMD_PAUSE, M64CMD_STATE_SAVE, M64CMD_RESUME in conjunction with a state-change callback listening for M64EMU_RUNNING is not a reliable way to determine when the save-state is complete). It would be useful to either add a save-state callback, or to add an additional emu state (such as M64EMU_SAVESTATE_COMPLETE, for example), or even to just re-notify the current state (M64EMU_PAUSED or M64EMU_RUNNING) every time a save-state is complete.
The second issue is there is no interface for the Gameshark Button other than assigning it to a key or joystick control in the config file. The actual implementation for this function is hardwired into the core with SDL input listener. For a front-end where input is more abstract, there is no apparent way to access this function other than injecting SDL events. Of course there are a few other functions besides this one that can be assigned to key or joystick via the config file, but all the other functions have obvious interfaces in the API to re-implement them in the front-end. This was the only one that gave me pause (there are a couple I didn't use though, Screenshot and Full Screen).
Last edited: