Skip to content

Fix an infinite loop that can occur in some builds#256

Open
JaceCear wants to merge 4 commits intomainfrom
ogl_inf_loop_fix
Open

Fix an infinite loop that can occur in some builds#256
JaceCear wants to merge 4 commits intomainfrom
ogl_inf_loop_fix

Conversation

@JaceCear
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread src/core.c Outdated
#endif

// NOTE: If other platforms do V-Sync asynchronously, we may need to incorporate this wait.
#if PLATFORM_GBA
Copy link
Copy Markdown
Collaborator

@freshollie freshollie Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this, why not just remove DISPSTAT_VBLANK in your implementation after vblank?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified it a bit.
I just think it's better not to have an if in there that is always false, except for GBA (and maybe like DS if we ever port it to that).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But like, what I mean is all you have to do is REG_DISPSTAT &= ~DISPSTAT_VBLANK in your VBlankIntrWait implementation and then this check wouldn't cause issues?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it shouldn't have to happen in the first place.

Kept in, it'll just be an unnecessary check that happens every frame for literally no reason. 😅

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking at the code and I'm very confused how DISPSTAT_VBLANK is ever set on REG_DISPSTAT in the opengl backend?

I understand that his this is a possible solution to the issue, but it's not the root cause. I don't believe removing this check should be necessary since it works when software rendering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants