saturn: support input callback stuffs
This commit is contained in:
parent
d0969c208d
commit
5d4dc0630c
|
@ -73,6 +73,18 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
|
|||
[DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void libyabause_hardreset();
|
||||
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void InputCallback();
|
||||
|
||||
/// <summary>
|
||||
/// set a fcn to call every time input is read
|
||||
/// </summary>
|
||||
/// <param name="cb">execxutes right before the input read. null to clear</param>
|
||||
[DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void libyabause_setinputcallback(InputCallback cb);
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
|
@ -39,6 +39,8 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
|
|||
LibYabause.CDInterface.ReadSectorFAD ReadSectorFADH;
|
||||
LibYabause.CDInterface.ReadAheadFAD ReadAheadFADH;
|
||||
|
||||
LibYabause.InputCallback InputCallbackH;
|
||||
|
||||
public Yabause(CoreComm CoreComm, DiscSystem.Disc CD, byte[] bios, bool GL = false)
|
||||
{
|
||||
CoreComm.RomStatusDetails = "Yeh";
|
||||
|
@ -46,6 +48,9 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
|
|||
this.CD = CD;
|
||||
ResetCounters();
|
||||
Init(bios, GL);
|
||||
|
||||
InputCallbackH = new LibYabause.InputCallback(() => CoreComm.InputCallback.Call());
|
||||
LibYabause.libyabause_setinputcallback(InputCallbackH);
|
||||
}
|
||||
|
||||
void Init(byte[] bios, bool GL = false)
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -32,6 +32,8 @@
|
|||
#include "yabause.h"
|
||||
#include "movie.h"
|
||||
|
||||
#include "yui.h"
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
# include "dreamcast/localtime.h"
|
||||
#endif
|
||||
|
@ -362,6 +364,10 @@ static void SmpcINTBACKPeripheral(void) {
|
|||
|
||||
if (SmpcInternalVars->port1.size == 0 && SmpcInternalVars->port2.size == 0)
|
||||
{
|
||||
/////
|
||||
if (inputcallback)
|
||||
inputcallback();
|
||||
|
||||
// Request data from the Peripheral Interface
|
||||
port1 = &PORTDATA1;
|
||||
port2 = &PORTDATA2;
|
||||
|
|
|
@ -52,6 +52,14 @@ int YuiSetVideoMode(int width, int height, int bpp, int fullscreen);
|
|||
up being moved to the Video Core. */
|
||||
void YuiSwapBuffers(void);
|
||||
|
||||
|
||||
|
||||
extern void (*inputcallback)(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Helper functions(you can use these in your own port)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue