Add gspIsPresentPending

This commit is contained in:
fincs 2021-03-31 14:49:07 +02:00
parent 4e25fb1d6c
commit bf06f27a0e
No known key found for this signature in database
GPG Key ID: 62C7609ADA219C60
2 changed files with 12 additions and 0 deletions

View File

@ -104,6 +104,12 @@ bool gspHasGpuRight(void);
*/
void gspPresentBuffer(unsigned screen, unsigned swap, const void* fb_a, const void* fb_b, u32 stride, u32 mode);
/**
* @brief Returns true if a prior \ref gspPresentBuffer command is still pending to be processed by GSP.
* @param screen Screen ID (see \ref GSP_SCREEN_TOP and \ref GSP_SCREEN_BOTTOM)
*/
bool gspIsPresentPending(unsigned screen);
/**
* @brief Configures a callback to run when a GSPGPU event occurs.
* @param id ID of the event.

View File

@ -257,6 +257,12 @@ void gspPresentBuffer(unsigned screen, unsigned swap, const void* fb_a, const vo
} while (__strex(fbInfoHeader, u.header));
}
bool gspIsPresentPending(unsigned screen)
{
s32* fbInfoHeader = (s32*)((u8*)gspSharedMem + 0x200 + gspThreadId*0x80 + screen*0x40);
return (*fbInfoHeader & 0xff00) != 0;
}
void gspSetEventCallback(GSPGPU_Event id, ThreadFunc cb, void* data, bool oneShot)
{
if(id>= GSPGPU_EVENT_MAX)return;