pce - add input callback

forgot this
This commit is contained in:
nattthebear 2020-05-27 16:01:53 -04:00
parent 0295f7472b
commit 287e78a5a9
4 changed files with 7 additions and 1 deletions

Binary file not shown.

View File

@ -27,6 +27,7 @@ enum { MAX_PORT_DATA = 16 };
static uint8_t InputPortData[(MAX_PORTS + 1) * MAX_PORT_DATA];
bool LagFlag;
void (*InputCallback)();
ECL_EXPORT void PreInit()
{
@ -195,7 +196,9 @@ ECL_EXPORT void SetLayers(uint64_t layers)
}
ECL_EXPORT void SetInputCallback(void (*cb)())
{}
{
InputCallback = cb;
}
// same information as PortInfo, but easier to marshal
struct NPortInfo

View File

@ -15,3 +15,4 @@ struct CheatArea
CheatArea* FindCheatArea(uint32_t address);
extern bool LagFlag;
extern void (*InputCallback)();

View File

@ -56,6 +56,8 @@ namespace MDFN_IEN_PCE
uint8 INPUT_Read(int32 timestamp, unsigned int A)
{
LagFlag = false;
if (InputCallback)
InputCallback();
return ZZINPUT_Read(timestamp, A);
}
}