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
12e7ce50
Verified
Commit
12e7ce50
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: support for variable audio speed
parent
8b902ffd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#2478
failed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontends/web/ts/gb.ts
+1
-0
1 addition, 0 deletions
frontends/web/ts/gb.ts
src/apu.rs
+4
-3
4 additions, 3 deletions
src/apu.rs
with
5 additions
and
3 deletions
frontends/web/ts/gb.ts
+
1
−
0
View file @
12e7ce50
...
...
@@ -548,6 +548,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
set
frequency
(
value
:
number
)
{
value
=
Math
.
max
(
value
,
0
);
this
.
logicFrequency
=
value
;
this
.
gameBoy
?.
set_clock_freq
(
value
);
this
.
trigger
(
"
frequency
"
,
value
);
}
...
...
This diff is collapsed.
Click to expand it.
src/apu.rs
+
4
−
3
View file @
12e7ce50
...
...
@@ -312,9 +312,10 @@ impl Apu {
self
.audio_buffer
.push_back
(
self
.output
());
}
// @TODO the CPU clock is hardcoded here, we must handle situations
// where there's some kind of overclock, and for that to happen the
// current CPU clock must be propagated here
// calculates the rate at which a new audio sample should be
// created based on the (base/CPU) clock frequency and the
// sampling rate, this is basically the amount of APU clock
// calls that should be performed until an audio sample is created
self
.output_timer
+=
(
self
.clock_freq
as
f32
/
self
.sampling_rate
as
f32
)
as
i16
;
}
}
...
...
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