Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Framerate used for BizHawk's SameBoy Core #332

Closed
CasualPokePlayer opened this issue Aug 28, 2021 · 9 comments
Closed

Wrong Framerate used for BizHawk's SameBoy Core #332

CasualPokePlayer opened this issue Aug 28, 2021 · 9 comments
Assignees
Labels
bug Movie Parsers The movie parsers themselves Priority: Medium User-Facing Issue that doesn't need immediate attention
Milestone

Comments

@CasualPokePlayer
Copy link
Collaborator

The SameBoy core in BizHawk is set to run at 2147727/35112 FPS, but it seems the site parser just uses the SNES framerate (which is correct for LLE cores like BSNES as inputs are locked to SNES VBlank like with a real SGB, but the HLE cores like SameBoy have no concept of this FPS and only use the internal framerate of the SGB).

@adelikat
Copy link
Collaborator

Our site policy is to not care about what a core or emulator does, and focus on what it should do. We don't want to be dependent on the details of what a core does, or will do in the future. Our fps values are based on theoretical hardware, and not specific emulator behavior.

So our SGB value is based on a LLE value, and I believe it is correct to do so.

@nattthebear
Copy link
Collaborator

Bizhawk Sameboy SGB and Bizhawk Bsnes SGB run at the exact same speed (excepting the boot up difference, and whatever lag differences there are). The difference here is really a frame timing thing. A real SNES runs at 60.09 FPS fixed framerate. A real SGB inside the SNES runs at a 61.17 FPS nominal framerate; it will be exactly that framerate except when the virtual LCD "display" is turned off and on.

The SGB hardware handles the difference by dropping frames once in a while when outputting to the SNES side. I honestly don't know what real SGB hardware does to handle the input timing difference; maybe it polls on vblank for a steady 60.09 input samples per second and then just duplicates some of them to the SGB side? Or maybe it has irregular polls and an emulator that included the SNES side would need subframe input to recover it all. In any event, it does something to reconcile the two.

Bizhawk Sameboy SGB is counting the 61.17 fps frames as its notion of actual elapsed time; Bizhawk Bsnes SGB is counting the 60.09 fps frames as its notion of actual elapsed time. They're counting time from different measurements, and "one frame" is not equal to "one frame" because they're one frame of different things.

There are similar problems with various notions of timing for GB and A2600, among others; "equal length frames" vs otherwise.

I don't have an opinion on what TASVideos does, but I think we should have all the facts. Reopening this for now so we can make sure all the needed discussion happens.

@nattthebear nattthebear reopened this Aug 29, 2021
@CasualPokePlayer
Copy link
Collaborator Author

I honestly don't know what real SGB hardware does to handle the input timing difference; maybe it polls on vblank for a steady 60.09 input samples per second and then just duplicates some of them to the SGB side? Or maybe it has irregular polls and an emulator that included the SNES side would need subframe input to recover it all. In any event, it does something to reconcile the two.

It doesn't actually do any sort of reconciling. It just does input each SNES VBlank. By consequence, some inputs just get "dropped" so to say. Casual playing this probably doesn't mean much anyways, considering the time when the input is "dropped" would just be some SNES frame where the GB didn't try to get an input (or the inverse for the SGB2 where the GB tried to get input twice within a SNES frame).

@nattthebear
Copy link
Collaborator

I think you just described "polls on vblank for a steady 60.09 input samples per second and then just duplicates some of them to the SGB side" but with different words.

That means that unless you count SGB2 (which is innately slower), this SGB HLE can let you do things that aren't even possible on the real console. Which is fine with me and lines up as just a limitation of the HLE in use here.

@adelikat
Copy link
Collaborator

Do the old and new site's both agree? or is this a new site specific problem?

@CasualPokePlayer
Copy link
Collaborator Author

Do the old and new site's both agree? or is this a new site specific problem?

Both the old site and new site seem to have this problem (going off userfiles at least)

@adelikat adelikat added this to the Future milestone Sep 12, 2021
@adelikat adelikat added the Movie Parsers The movie parsers themselves label Sep 12, 2021
@TiKevin83 TiKevin83 added bug Priority: Medium User-Facing Issue that doesn't need immediate attention labels Jan 12, 2022
@adelikat adelikat self-assigned this Sep 1, 2022
@adelikat
Copy link
Collaborator

adelikat commented Sep 1, 2022

So what do we want done here? @CasualPokePlayer

@CasualPokePlayer
Copy link
Collaborator Author

CasualPokePlayer commented Sep 1, 2022

The old SGB SameBoy core was yoinked out in 2.8 so it probably doesn't really matter at this point (unless you care for older BizHawk versions). The newer SameBoy core is GB/C only and goes off cycle count (so works as is). Similarly Gambatte became the replacement for SGB HLE and that currently only does SGB2 which is the same frequency as the original GB/C (so cycle count again works as is). If SGB1 is supported Gambatte just needs to replace the clock rate field and that should again work (mostly).

@adelikat
Copy link
Collaborator

adelikat commented Sep 1, 2022

Closing this ticket as no longer relevant

@adelikat adelikat closed this as completed Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Movie Parsers The movie parsers themselves Priority: Medium User-Facing Issue that doesn't need immediate attention
Projects
None yet
Development

No branches or pull requests

4 participants