mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-08-04 15:54:19 +00:00
Regulate calls to the retro core based on the fps reported by the game. (#214)
👍
This commit is contained in:
parent
85bb99f8f8
commit
3a8bf7ba7e
3 changed files with 3 additions and 3 deletions
|
|
@ -54,7 +54,7 @@ type EmulatorMeta struct {
|
|||
Width int
|
||||
Height int
|
||||
AudioSampleRate int
|
||||
Fps int
|
||||
Fps float64
|
||||
BaseWidth int
|
||||
BaseHeight int
|
||||
Ratio float64
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue