mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-19 01:24:26 +00:00
* Add initial external configuration files support. These external configuration files allow changing app params at the runtime without recompilation. * Find config files with specified directory in the tests * Add aspect ratio recalculation config * Clean code * Add new configuration files into the Docker container image * Add shared core and config paths into the Libretro cores config * Split ROM <-> Emulator mapping between workers and coordinators * Extract coordinator config * Add shared worker/coordinator server config * Add explicit embedded shared worker/coordinator struct for auto-config reflection fill * Remove default stun/turn servers from the config * Extract and add new ice servers config structures * Update coordinator config params * Add auto emulation lib loader based on the runtime OS/arch * Update configuration structures * Remove shared config embedding * Add missing network config params * Add game library external config * Remove unused config parameters * Add WebRTC encoder external options * Add user dir for config search * Update config loader * Update config * Add generic downloader with Grab lib implementation * Add a simple file downloader backed by the grab lib * Add initial Libretro core repos abstractions * Expose compression info for Libretro cores repository records * Add pipe-based abstract file downloader * Refactor downloader * Refactor Libretro repos * Add worker coresync stubs * Add multiprocess-safe HTTP-based core manager implementation * Remove Libretro cores from the repo * Keep custom N64 cores in te repo for now * Add Libretro cores repo select in the config * Fix http manager repo switch * Cleanup code * Add greedy Libretro lib loader * Don't crash when arch map is not set * Disable dynamic recompiler for pcsx core by default since it's could cause a crash * Use global Libretro dynalib handler * Shorten the default Libretro cores store path * Update zip extractor implementation * Remove explicit fig lib field markings * Add config note to the README file * Add GitHub repo backend for the core downloader * Fix GitHub repo param list in the manager factory * Add env variables reader with CLOUD_GAME prefix * Re-optimize ice server info struct custom marshaler
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package emulator
|
|
|
|
import "github.com/giongto35/cloud-game/v2/pkg/emulator/image"
|
|
|
|
// CloudEmulator is the interface of cloud emulator. Currently NES emulator and RetroArch implements this in codebase
|
|
type CloudEmulator interface {
|
|
// LoadMeta returns meta data of emulator. Refer below
|
|
LoadMeta(path string) Metadata
|
|
// Start is called after LoadGame
|
|
Start()
|
|
// SetViewport sets viewport size
|
|
SetViewport(width int, height int)
|
|
// GetViewport debug encoder image
|
|
GetViewport() interface{}
|
|
// SaveGame save game state, saveExtraFunc is callback to do extra step. Ex: save to google cloud
|
|
SaveGame(saveExtraFunc func() error) error
|
|
// LoadGame load game state
|
|
LoadGame() error
|
|
// GetHashPath returns the path emulator will save state to
|
|
GetHashPath() string
|
|
// Close will be called when the game is done
|
|
Close()
|
|
|
|
ToggleMultitap() error
|
|
}
|
|
|
|
type Metadata struct {
|
|
// the full path to some emulator lib
|
|
LibPath string
|
|
// the full path to the emulator config
|
|
ConfigPath string
|
|
|
|
AudioSampleRate int
|
|
Fps float64
|
|
BaseWidth int
|
|
BaseHeight int
|
|
Ratio float64
|
|
Rotation image.Rotate
|
|
IsGlAllowed bool
|
|
UsesLibCo bool
|
|
AutoGlContext bool
|
|
HasMultitap bool
|
|
}
|