mirror of
https://github.com/libretro/Play-.git
synced 2025-03-04 09:17:50 +00:00
Add basic implementation for WaitVblank.
This commit is contained in:
parent
54b7857ede
commit
feb00fbffc
@ -9,6 +9,7 @@ using namespace Iop;
|
||||
|
||||
#define FUNCTION_WAITVBLANKSTART "WaitVblankStart"
|
||||
#define FUNCTION_WAITVBLANKEND "WaitVblankEnd"
|
||||
#define FUNCTION_WAITVBLANK "WaitVblank"
|
||||
#define FUNCTION_REGISTERVBLANKHANDLER "RegisterVblankHandler"
|
||||
|
||||
CVblank::CVblank(CIopBios& bios)
|
||||
@ -32,6 +33,9 @@ std::string CVblank::GetFunctionName(unsigned int functionId) const
|
||||
case 5:
|
||||
return FUNCTION_WAITVBLANKEND;
|
||||
break;
|
||||
case 6:
|
||||
return FUNCTION_WAITVBLANK;
|
||||
break;
|
||||
case 8:
|
||||
return FUNCTION_REGISTERVBLANKHANDLER;
|
||||
break;
|
||||
@ -51,6 +55,9 @@ void CVblank::Invoke(CMIPS& context, unsigned int functionId)
|
||||
case 5:
|
||||
context.m_State.nGPR[CMIPS::V0].nD0 = WaitVblankEnd();
|
||||
break;
|
||||
case 6:
|
||||
context.m_State.nGPR[CMIPS::V0].nD0 = WaitVblank();
|
||||
break;
|
||||
case 8:
|
||||
context.m_State.nGPR[CMIPS::V0].nD0 = RegisterVblankHandler(
|
||||
context,
|
||||
@ -83,6 +90,16 @@ int32 CVblank::WaitVblankEnd()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 CVblank::WaitVblank()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
CLog::GetInstance().Print(LOG_NAME, FUNCTION_WAITVBLANK "();\r\n");
|
||||
#endif
|
||||
//TODO: Skip waiting if we're already in Vblank
|
||||
m_bios.SleepThreadTillVBlankStart();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 CVblank::RegisterVblankHandler(CMIPS& context, uint32 startEnd, uint32 priority, uint32 handlerPtr, uint32 handlerParam)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
@ -19,6 +19,7 @@ namespace Iop
|
||||
private:
|
||||
int32 WaitVblankStart();
|
||||
int32 WaitVblankEnd();
|
||||
int32 WaitVblank();
|
||||
int32 RegisterVblankHandler(CMIPS&, uint32, uint32, uint32, uint32);
|
||||
|
||||
CIopBios& m_bios;
|
||||
|
Loading…
x
Reference in New Issue
Block a user