psx - support reset button

This commit is contained in:
zeromus 2015-07-17 16:37:20 -05:00
parent 0e7a82db28
commit f998ea9cf1
5 changed files with 20 additions and 0 deletions

View File

@ -588,6 +588,10 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
else
OctoshockDll.shock_SetTraceCallback(psx, IntPtr.Zero, null);
//apply soft reset if needed
if (Controller["Reset"])
OctoshockDll.shock_SoftReset(psx);
//------------------------
OctoshockDll.shock_Step(psx, OctoshockDll.eShockStep.Frame);
//------------------------

View File

@ -202,6 +202,9 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
[DllImport(dd, CallingConvention = cc)]
public static extern int shock_PowerOn(IntPtr psx);
[DllImport(dd, CallingConvention = cc)]
public static extern int shock_SoftReset(IntPtr psx);
[DllImport(dd, CallingConvention = cc)]
public static extern int shock_PowerOff(IntPtr psx);

Binary file not shown.

View File

@ -1342,6 +1342,16 @@ EW_EXPORT s32 shock_PowerOn(void* psx)
return SHOCK_OK;
}
//Triggers a soft reset immediately. Returns SHOCK_NOCANDO if console is powered off.
EW_EXPORT s32 shock_SoftReset(void *psx)
{
if (!s_ShockState.power) return SHOCK_NOCANDO;
PSX_Power(false);
return SHOCK_OK;
}
//Sets the power to OFF. It is an error to turn an already-off console OFF again
EW_EXPORT s32 shock_PowerOff(void* psx)
{

View File

@ -344,6 +344,9 @@ EW_EXPORT s32 shock_MountEXE(void* psx, void* exebuf, s32 size);
//Sets the power to ON. Returns SHOCK_NOCANDO if already on.
EW_EXPORT s32 shock_PowerOn(void* psx);
//Triggers a soft reset immediately. Returns SHOCK_NOCANDO if console is powered off.
EW_EXPORT s32 shock_SoftReset(void* psx);
//Sets the power to OFF. Returns SHOCK_NOCANDO if already off.
EW_EXPORT s32 shock_PowerOff(void* psx);