Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
boytacean
Commits
539564fb
Verified
Commit
539564fb
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
fix: vsync issue with SDL
parent
815f08c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#2189
passed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
frontends/sdl/src/main.rs
+4
-1
4 additions, 1 deletion
frontends/sdl/src/main.rs
frontends/sdl/src/util.rs
+6
-1
6 additions, 1 deletion
frontends/sdl/src/util.rs
with
11 additions
and
2 deletions
CHANGELOG.md
+
1
−
0
View file @
539564fb
...
...
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
*
Bug with ROM title that included 0x0 characters in it
*
V-Sync issue with SDL
## [0.6.7] - 2023-02-13
...
...
This diff is collapsed.
Click to expand it.
frontends/sdl/src/main.rs
+
4
−
1
View file @
539564fb
...
...
@@ -14,7 +14,7 @@ use util::Graphics;
use
crate
::
util
::
surface_from_bytes
;
/// The ratio
n
at which the logic of the Game Boy is
/// The ratio at which the logic of the Game Boy is
/// going to be run, increasing this value will provide
/// better emulator accuracy, please keep in mind that
/// the PPU will keep running at the same speed.
...
...
@@ -224,6 +224,9 @@ impl Emulator {
let
mut
last_frame
=
0xffffu16
;
if
current_time
>=
self
.next_tick_time_i
{
// calculates the number of cycles that are meant to be the target
// for the current "tick" operation this is basically the number of
// cycles per LCD roundtrip divided by the logic ratio
let
cycle_limit
=
(
GameBoy
::
LCD_CYCLES
as
f32
/
self
.logic_ratio
)
as
u32
;
loop
{
...
...
This diff is collapsed.
Click to expand it.
frontends/sdl/src/util.rs
+
6
−
1
View file @
539564fb
...
...
@@ -44,7 +44,12 @@ impl Graphics {
// creates an accelerated canvas to be used in the drawing
// then clears it so that is can be presented empty initially
let
mut
canvas
=
window
.into_canvas
()
.accelerated
()
.build
()
.unwrap
();
let
mut
canvas
=
window
.into_canvas
()
.accelerated
()
.present_vsync
()
.build
()
.unwrap
();
canvas
.set_logical_size
(
width
,
height
)
.unwrap
();
canvas
.clear
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment