fixed sync between processors

This commit is contained in:
h4570
2020-12-27 19:09:50 +01:00
parent c7fe915174
commit 1d7730504b
4 changed files with 66 additions and 35 deletions
+18 -4
View File
@@ -40,12 +40,26 @@ public:
void enableVSync() { isVSyncEnabled = true; }
void disableVSync() { isVSyncEnabled = false; }
void clearAndWaitForRender()
/** Reset draw wait flag. */
inline void resetWaitFlag()
{
*GS_REG_CSR |= 2; // Reset wait flag
draw_wait_finish();
*GS_REG_CSR |= 2;
}
/** Checks if draw wait flag is set */
inline u8 isWaitFlagSet() const
{
return *GS_REG_CSR & 2;
}
/** Waits for draw wait flag and reset it. */
inline void waitForRender()
{
while (!isWaitFlagSet())
;
resetWaitFlag();
}
void waitForRender() { draw_wait_finish(); }
/** 2D draw. */
void draw(Sprite &t_sprite);