Documentation ¶
Index ¶
- Constants
- Variables
- func ActiveGameEnabled() bool
- func CopyAndFixSSHKeys(reverse bool) error
- func CreateLauncher(cfg *config.UserConfig, system *games.System, gameFile string, folder string, ...) (string, error)
- func DeleteLauncher(path string) error
- func EnableFastUsbPoll() error
- func FixRootSSHPerms() error
- func GenerateMgl(cfg *config.UserConfig, system *games.System, path string, override string) (string, error)
- func GetActiveCoreName() (string, error)
- func GetActiveGame() (string, error)
- func GetActiveIni() (int, error)
- func GetConfiguredMacAddress() (string, error)
- func GetLastUpdateTime() (time.Time, error)
- func GetLauncherFilename(system *games.System, folder string, name string) string
- func GetMenuFolders(root string) []string
- func GetMounts(cfg *config.UserConfig) ([]string, error)
- func GetRbfs(root string) []string
- func GetUsbHidQuirks() ([]string, error)
- func IsFastUsbPollActive() (bool, error)
- func IsMenuRunning() bool
- func IsScriptRunning() bool
- func KillActiveScript() error
- func LaunchCore(cfg *config.UserConfig, system games.System) error
- func LaunchGame(cfg *config.UserConfig, system games.System, path string) error
- func LaunchGenericFile(cfg *config.UserConfig, path string) error
- func LaunchMenu() error
- func LaunchRandomGame(cfg *config.UserConfig, systems []games.System) error
- func LaunchShortCore(path string) error
- func LaunchToken(cfg *config.UserConfig, manual bool, kbd input.Keyboard, text string) error
- func MatchRbf(rbfs []string, match string) string
- func OpenConsole(kbd input.Keyboard) error
- func ReadUBootParams() (map[string]string, error)
- func RecentsOptionEnabled() (bool, error)
- func RelaunchIfInMenu() error
- func ResolvePath(path string) string
- func RunScript(kbd input.Keyboard, path string) error
- func ScriptCanLaunch() bool
- func SetActiveGame(path string) error
- func SetActiveIni(ini int, relaunchCore bool) error
- func SetMenuBackgroundMode(mode int) error
- func SetVideoMode(width int, height int) error
- func TryPickRandomGame(system *games.System, folder string) (string, error)
- func TrySetupArcadeCoresLink(path string) error
- func TryStartMdns(logger *service.Logger, appVersion string) func() error
- func UpdateConfiguredMacAddress(newMacAddress string) error
- func UpdateHostname(newHostname string, writeProc bool) error
- func UpdateUsbHidQuirks(quirks []string) error
- func WriteUBootParams(params map[string]string) error
- type DiskUsage
- type DownloaderIni
- type MGL
- type MGLFile
- type MdnsClient
- type MdnsService
- type MenuConfig
- type MisterIni
- func (mi *MisterIni) AddKey(key string, value string) error
- func (mi *MisterIni) GetKey(key string) (string, error)
- func (mi *MisterIni) IsShadowedKey(key string) bool
- func (mi *MisterIni) IsValidKey(key string) bool
- func (mi *MisterIni) Load() error
- func (mi *MisterIni) RemoveKey(key string) error
- func (mi *MisterIni) Save() error
- func (mi *MisterIni) SetKey(key string, value string) error
- type RecentEntry
- type Script
- type Startup
- type StartupEntry
Constants ¶
const ( KeyYpbpr = "ypbpr" KeyCompositeSync = "composite_sync" KeyForcedScandoubler = "forced_scandoubler" KeyVgaScaler = "vga_scaler" KeyVgaSog = "vga_sog" KeyKeyrahMode = "keyrah_mode" KeyResetCombo = "reset_combo" KeyKeyMenuAsRgui = "key_menu_as_rgui" KeyVideoMode = "video_mode" KeyVideoModePal = "video_mode_pal" KeyVideoModeNtsc = "video_mode_ntsc" KeyVideoInfo = "video_info" KeyVsyncAdjust = "vsync_adjust" KeyHdmiAudio96k = "hdmi_audio_96k" KeyDviMode = "dvi_mode" KeyHdmiLimited = "hdmi_limited" KeyKbdNomouse = "kbd_nomouse" KeyMouseThrottle = "mouse_throttle" KeyBootscreen = "bootscreen" KeyVscaleMode = "vscale_mode" KeyVscaleBorder = "vscale_border" KeyRbfHideDatecode = "rbf_hide_datecode" KeyMenuPal = "menu_pal" KeyBootcore = "bootcore" KeyBootcoreTimeout = "bootcore_timeout" KeyFont = "font" KeyFbSize = "fb_size" KeyFbTerminal = "fb_terminal" KeyOsdTimeout = "osd_timeout" KeyDirectVideo = "direct_video" KeyOsdRotate = "osd_rotate" KeyGamepadDefaults = "gamepad_defaults" KeyRecents = "recents" KeyControllerInfo = "controller_info" KeyRefreshMin = "refresh_min" KeyRefreshMax = "refresh_max" KeyJammaVid = "jamma_vid" KeyJammaPid = "jamma_pid" KeySniperMode = "sniper_mode" KeyBrowseExpand = "browse_expand" KeyLogo = "logo" KeyNoMergeVid = "no_merge_vid" KeyNoMergePid = "no_merge_pid" KeyNoMergeVidpid = "no_merge_vidpid" KeyCustomAspectRatio1 = "custom_aspect_ratio_1" KeyCustomAspectRatio2 = "custom_aspect_ratio_2" KeySpinnerVid = "spinner_vid" KeySpinnerPid = "spinner_pid" KeySpinnerAxis = "spinner_axis" KeySpinnerThrottle = "spinner_throttle" KeyAfilterDefault = "afilter_default" KeyVfilterDefault = "vfilter_default" KeyVfilterVerticalDefault = "vfilter_vertical_default" KeyVfilterScanlinesDefault = "vfilter_scanlines_default" KeyShmaskDefault = "shmask_default" KeyShmaskModeDefault = "shmask_mode_default" KeyPresetDefault = "preset_default" KeyLogFileEntry = "log_file_entry" KeyBtAutoDisconnect = "bt_auto_disconnect" KeyBtResetBeforePair = "bt_reset_before_pair" KeyWaitmount = "waitmount" KeyRumble = "rumble" KeyWheelForce = "wheel_force" KeyWheelRange = "wheel_range" KeyHdmiGameMode = "hdmi_game_mode" KeyVrrMode = "vrr_mode" KeyVrrMinFramerate = "vrr_min_framerate" KeyVrrMaxFramerate = "vrr_max_framerate" KeyVrrVesaFramerate = "vrr_vesa_framerate" KeyVideoOff = "video_off" KeyPlayer1Controller = "player_1_controller" KeyPlayer2Controller = "player_2_controller" KeyPlayer3Controller = "player_3_controller" KeyPlayer4Controller = "player_4_controller" KeyPlayer5Controller = "player_5_controller" KeyPlayer6Controller = "player_6_controller" KeyDisableAutofire = "disable_autofire" KeyVideoBrightness = "video_brightness" KeyVideoContrast = "video_contrast" KeyVideoSaturation = "video_saturation" KeyVideoHue = "video_hue" KeyVideoGainOffset = "video_gain_offset" KeyHdr = "hdr" KeyHdrMaxNits = "hdr_max_nits" KeyHdrAvgNits = "hdr_avg_nits" KeyVgaMode = "vga_mode" KeyNtscMode = "ntsc_mode" KeyControllerUniqueMapping = "controller_unique_mapping" )
const ( DefaultIniFilename = "MiSTer.ini" MainIniSection = "MiSTer" )
const ( BackgroundModeNone = 0 BackgroundModeWallpaper = 2 BackgroundModeHBars1 = 4 BackgroundModeHBars2 = 6 BackgroundModeVBars1 = 8 BackgroundModeVBars2 = 10 BackgroundModeSpectrum = 12 BackgroundModeBlack = 14 )
const ( DefaultHostname = "MiSTer" MdnsServiceName = "_mister-remote._tcp" )
const ( UBootMACParam = "ethaddr" UBootKernelParam = "v" )
const ( VideoModeScaleFull = "1" VideoModeScaleHalf = "2" VideoModeScaleThird = "3" VideoModeScaleQuarter = "4" VideoModeFormatRGB32 = "18888" VideoModeFormatRGB15 = "11555" VideoModeFormatRGB16 = "1565" VideoModeFormatBGR32 = "08888" VideoModeFormatBGR15 = "01555" VideoModeFormatBGR16 = "0565" VideoModeFormatIDX8 = "08" ResCountPath = "/sys/module/MiSTer_fb/parameters/res_count" )
const ShadowDelimiter = ","
Variables ¶
var Mdns = &MdnsService{ Active: false, Clients: []MdnsClient{}, }
var ShadowedIniKeys = []string{ KeyNoMergeVidpid, KeyControllerUniqueMapping, }
ShadowedIniKeys are keys which can be defined multiple times in an .ini file
var ValidIniKeys = []string{ KeyYpbpr, KeyCompositeSync, KeyForcedScandoubler, KeyVgaScaler, KeyVgaSog, KeyKeyrahMode, KeyResetCombo, KeyKeyMenuAsRgui, KeyVideoMode, KeyVideoModePal, KeyVideoModeNtsc, KeyVideoInfo, KeyVsyncAdjust, KeyHdmiAudio96k, KeyDviMode, KeyHdmiLimited, KeyKbdNomouse, KeyMouseThrottle, KeyBootscreen, KeyVscaleMode, KeyVscaleBorder, KeyRbfHideDatecode, KeyMenuPal, KeyBootcore, KeyBootcoreTimeout, KeyFont, KeyFbSize, KeyFbTerminal, KeyOsdTimeout, KeyDirectVideo, KeyOsdRotate, KeyGamepadDefaults, KeyRecents, KeyControllerInfo, KeyRefreshMin, KeyRefreshMax, KeyJammaVid, KeyJammaPid, KeySniperMode, KeyBrowseExpand, KeyLogo, KeySharedFolder, KeyNoMergeVid, KeyNoMergePid, KeyNoMergeVidpid, KeyCustomAspectRatio1, KeyCustomAspectRatio2, KeySpinnerVid, KeySpinnerPid, KeySpinnerAxis, KeySpinnerThrottle, KeyAfilterDefault, KeyVfilterDefault, KeyVfilterVerticalDefault, KeyVfilterScanlinesDefault, KeyShmaskDefault, KeyShmaskModeDefault, KeyPresetDefault, KeyLogFileEntry, KeyBtAutoDisconnect, KeyBtResetBeforePair, KeyWaitmount, KeyRumble, KeyWheelForce, KeyWheelRange, KeyHdmiGameMode, KeyVrrMode, KeyVrrMinFramerate, KeyVrrMaxFramerate, KeyVrrVesaFramerate, KeyVideoOff, KeyPlayer1Controller, KeyPlayer2Controller, KeyPlayer3Controller, KeyPlayer4Controller, KeyPlayer5Controller, KeyPlayer6Controller, KeyDisableAutofire, KeyVideoBrightness, KeyVideoContrast, KeyVideoSaturation, KeyVideoHue, KeyVideoGainOffset, KeyHdr, KeyHdrMaxNits, KeyHdrAvgNits, KeyVgaMode, KeyNtscMode, KeyControllerUniqueMapping, }
Functions ¶
func ActiveGameEnabled ¶
func ActiveGameEnabled() bool
func CopyAndFixSSHKeys ¶
CopyAndFixSSHKeys copies the authorized_keys file from the linux folder to root home and fixes all permissions.
func CreateLauncher ¶
func DeleteLauncher ¶
func EnableFastUsbPoll ¶
func EnableFastUsbPoll() error
func FixRootSSHPerms ¶
func FixRootSSHPerms() error
func GenerateMgl ¶
func GetActiveCoreName ¶
func GetActiveGame ¶
func GetActiveIni ¶
func GetConfiguredMacAddress ¶
GetConfiguredMacAddress returns the ethernet MAC address configured in the u-boot.txt file, if available.
func GetLastUpdateTime ¶
func GetLauncherFilename ¶
func GetMenuFolders ¶
Search for directories in root that start with "_".
func GetUsbHidQuirks ¶
func IsFastUsbPollActive ¶
func IsMenuRunning ¶
func IsMenuRunning() bool
func IsScriptRunning ¶
func IsScriptRunning() bool
func KillActiveScript ¶
func KillActiveScript() error
func LaunchCore ¶
func LaunchCore(cfg *config.UserConfig, system games.System) error
LaunchCore Launch a core given a possibly partial path, as per MGL files.
func LaunchGame ¶
func LaunchGenericFile ¶
func LaunchGenericFile(cfg *config.UserConfig, path string) error
LaunchGenericFile Given a generic file path, launch it using the correct method, if possible.
func LaunchMenu ¶
func LaunchMenu() error
func LaunchRandomGame ¶
func LaunchRandomGame(cfg *config.UserConfig, systems []games.System) error
func LaunchShortCore ¶
LaunchShortCore attempts to launch a core with a short path, as per what's allowed in an MGL file.
func LaunchToken ¶
func OpenConsole ¶
func ReadUBootParams ¶
func RecentsOptionEnabled ¶
func RelaunchIfInMenu ¶
func RelaunchIfInMenu() error
func ResolvePath ¶
Convert a launchable path to an absolute path.
func ScriptCanLaunch ¶
func ScriptCanLaunch() bool
func SetActiveGame ¶
func SetActiveIni ¶
func SetMenuBackgroundMode ¶
func SetVideoMode ¶
func TryPickRandomGame ¶
TryPickRandomGame recursively searches through given folder for a valid game file for that system.
func TrySetupArcadeCoresLink ¶
func TryStartMdns ¶
TryStartMdns will attempt to start the mDNS service, retrying multiple times if it fails. This is because a script may be run at boot time before the network is available.
func UpdateConfiguredMacAddress ¶
UpdateConfiguredMacAddress updates the ethernet MAC address configured in the u-boot.txt file. Setting a new one if it doesn't exist, or updating the existing one. Any existing u-boot.txt arguments are preserved.
func UpdateHostname ¶
UpdateHostname updates all hostname related files with the new hostname and refreshes it in kernel memory.
func UpdateUsbHidQuirks ¶
func WriteUBootParams ¶
Types ¶
type DiskUsage ¶
func GetDiskUsage ¶
type DownloaderIni ¶
func LoadDownloaderIni ¶
func LoadDownloaderIni() (*DownloaderIni, error)
func (*DownloaderIni) AddDb ¶
func (d *DownloaderIni) AddDb(name, url string) error
func (*DownloaderIni) HasDb ¶
func (d *DownloaderIni) HasDb(name string) bool
func (*DownloaderIni) RemoveDb ¶
func (d *DownloaderIni) RemoveDb(name string) error
func (*DownloaderIni) Save ¶
func (d *DownloaderIni) Save() error
type MGL ¶
type MdnsClient ¶
type MdnsService ¶
type MdnsService struct { Active bool Clients []MdnsClient // contains filtered or unexported fields }
func (*MdnsService) AddClient ¶
func (s *MdnsService) AddClient(client MdnsClient)
func (*MdnsService) ClearClients ¶
func (s *MdnsService) ClearClients()
func (*MdnsService) GetClients ¶
func (s *MdnsService) GetClients() []MdnsClient
func (*MdnsService) IsActive ¶
func (s *MdnsService) IsActive() bool
func (*MdnsService) SetActive ¶
func (s *MdnsService) SetActive(active bool)
type MenuConfig ¶
type MenuConfig struct {
BackgroundMode int
}
func ReadMenuConfig ¶
func ReadMenuConfig() (MenuConfig, error)
type MisterIni ¶
type MisterIni struct { Id int `json:"id"` DisplayName string `json:"displayName"` Filename string `json:"filename"` Path string `json:"path"` File *ini.File `json:"-"` }
func GetActiveMisterIni ¶
func GetAllMisterIni ¶
func GetAllWithDefaultMisterIni ¶
GetAllWithDefaultMisterIni returns all ini files, setting up a default one if none exist.
func GetMisterIni ¶
func (*MisterIni) AddKey ¶
AddKey sets a key to a value whether it exists or not and appends to any shadowed values.
func (*MisterIni) IsShadowedKey ¶
func (*MisterIni) IsValidKey ¶
type RecentEntry ¶
func ReadRecent ¶
func ReadRecent(path string) ([]RecentEntry, error)
type Script ¶
type Script struct { Name string `json:"name"` Filename string `json:"filename"` Path string `json:"path"` }