Regulate calls to the retro core based on the fps reported by the game. (#214)

👍
This commit is contained in:
88hcsif 2020-07-01 10:51:01 +01:00 committed by GitHub
parent 85bb99f8f8
commit 3a8bf7ba7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -54,7 +54,7 @@ type EmulatorMeta struct {
Width int
Height int
AudioSampleRate int
Fps int
Fps float64
BaseWidth int
BaseHeight int
Ratio float64

View file

@ -154,7 +154,7 @@ func (na *naEmulator) SetViewport(width int, height int) {
func (na *naEmulator) Start() {
na.playGame(na.gamePath)
ticker := time.NewTicker(time.Second / 60)
ticker := time.NewTicker(time.Second / time.Duration(na.meta.Fps))
for range ticker.C {
select {

View file

@ -610,7 +610,7 @@ func coreLoadGame(filename string) {
// Append the library name to the window title.
NAEmulator.meta.AudioSampleRate = int(avi.timing.sample_rate)
NAEmulator.meta.Fps = int(avi.timing.fps)
NAEmulator.meta.Fps = float64(avi.timing.fps)
NAEmulator.meta.BaseWidth = int(avi.geometry.base_width)
NAEmulator.meta.BaseHeight = int(avi.geometry.base_height)
// set aspect ratio