Skip to content

Commit

Permalink
Implement WaitNonVblank
Browse files Browse the repository at this point in the history
  • Loading branch information
kernle32dll committed Mar 23, 2022
1 parent fda697c commit 7cffacb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Source/iop/Iop_Vblank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ using namespace Iop;
#define FUNCTION_WAITVBLANKSTART "WaitVblankStart"
#define FUNCTION_WAITVBLANKEND "WaitVblankEnd"
#define FUNCTION_WAITVBLANK "WaitVblank"
#define FUNCTION_WAITNONVBLANK "WaitNonVblank"
#define FUNCTION_REGISTERVBLANKHANDLER "RegisterVblankHandler"
#define FUNCTION_RELEASEVBLANKHANDLER "ReleaseVblankHandler"

Expand All @@ -35,6 +36,9 @@ std::string CVblank::GetFunctionName(unsigned int functionId) const
case 6:
return FUNCTION_WAITVBLANK;
break;
case 7:
return FUNCTION_WAITNONVBLANK;
break;
case 8:
return FUNCTION_REGISTERVBLANKHANDLER;
break;
Expand All @@ -60,6 +64,9 @@ void CVblank::Invoke(CMIPS& context, unsigned int functionId)
case 6:
context.m_State.nGPR[CMIPS::V0].nD0 = WaitVblank();
break;
case 7:
context.m_State.nGPR[CMIPS::V0].nD0 = WaitNonVblank();
break;
case 8:
context.m_State.nGPR[CMIPS::V0].nD0 = RegisterVblankHandler(
context.m_State.nGPR[CMIPS::A0].nV0,
Expand Down Expand Up @@ -106,6 +113,15 @@ int32 CVblank::WaitVblank()
return 0;
}

int32 CVblank::WaitNonVblank()
{
#ifdef _DEBUG
CLog::GetInstance().Print(LOG_NAME, FUNCTION_WAITNONVBLANK "();\r\n");
#endif
m_bios.SleepThreadTillVBlankEnd();
return 0;
}

int32 CVblank::RegisterVblankHandler(uint32 startEnd, uint32 priority, uint32 handlerPtr, uint32 handlerParam)
{
#ifdef _DEBUG
Expand Down
1 change: 1 addition & 0 deletions Source/iop/Iop_Vblank.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace Iop
int32 WaitVblankStart();
int32 WaitVblankEnd();
int32 WaitVblank();
int32 WaitNonVblank();
int32 RegisterVblankHandler(uint32, uint32, uint32, uint32);
int32 ReleaseVblankHandler(uint32, uint32);

Expand Down

0 comments on commit 7cffacb

Please sign in to comment.