mister

package
v0.0.0-...-320c812 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TempFolder        = "/tmp/tapto"
	LogFile           = TempFolder + "/tapto.log"
	DisableLaunchFile = TempFolder + "/tapto.disabled"
	SuccessSoundFile  = TempFolder + "/success.wav"
	FailSoundFile     = TempFolder + "/fail.wav"
	SocketFile        = TempFolder + "/tapto.sock"
	PidFile           = TempFolder + "/tapto.pid"
	MappingsFile      = "/media/fat/nfc.csv"
	TokenReadFile     = "/tmp/TOKENREAD"
	DbFile            = mrextConfig.ScriptsConfigFolder + "/tapto/tapto.db"
	GamesDbFile       = mrextConfig.ScriptsConfigFolder + "/tapto/games.db"
	ArcadeDbUrl       = "https://api.github.com/repositories/521644036/contents/ArcadeDatabase_CSV"
	ArcadeDbFile      = mrextConfig.ScriptsConfigFolder + "/tapto/ArcadeDatabase.csv"
	ScriptsFolder     = mrextConfig.ScriptsFolder
	CmdInterface      = "/dev/MiSTer_cmd"
)
View Source
const ArcadeSystem = "Arcade"

Variables

This section is empty.

Functions

func ExitGame

func ExitGame()

func GetActiveCoreName

func GetActiveCoreName() string

func NfcMigration

func NfcMigration()

NfcMigration migrates NFC app data and removes the old service.

func NormalizePath

func NormalizePath(cfg *config.UserConfig, path string) string

func PlayFail

func PlayFail(cfg *config.UserConfig)

func PlaySuccess

func PlaySuccess(cfg *config.UserConfig)

func Setup

func Setup(tr *Tracker) error

func StartFileWatch

func StartFileWatch(tr *Tracker) (*fsnotify.Watcher, error)

StartFileWatch Start thread for monitoring changes to all files relating to core/game launches.

func UpdateArcadeDb

func UpdateArcadeDb() (bool, error)

func UserConfigToMrext

func UserConfigToMrext(cfg *config.UserConfig) *mrextConfig.UserConfig

Types

type ArcadeDbEntry

type ArcadeDbEntry struct {
	Setname         string `csv:"setname"`
	Name            string `csv:"name"`
	Region          string `csv:"region"`
	Version         string `csv:"version"`
	Alternative     string `csv:"alternative"`
	ParentTitle     string `csv:"parent_title"`
	Platform        string `csv:"platform"`
	Series          string `csv:"series"`
	Homebrew        string `csv:"homebrew"`
	Bootleg         string `csv:"bootleg"`
	Year            string `csv:"year"`
	Manufacturer    string `csv:"manufacturer"`
	Category        string `csv:"category"`
	Linebreak1      string `csv:"linebreak1"`
	Resolution      string `csv:"resolution"`
	Flip            string `csv:"flip"`
	Linebreak2      string `csv:"linebreak2"`
	Players         string `csv:"players"`
	MoveInputs      string `csv:"move_inputs"`
	SpecialControls string `csv:"special_controls"`
	NumButtons      string `csv:"num_buttons"`
}

func ReadArcadeDb

func ReadArcadeDb() ([]ArcadeDbEntry, error)

type GithubContentsItem

type GithubContentsItem struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Sha         string `json:"sha"`
	Size        int    `json:"size"`
	Url         string `json:"url"`
	HtmlUrl     string `json:"html_url"`
	GitUrl      string `json:"git_url"`
	DownloadUrl string `json:"download_url"`
	Type        string `json:"type"`
	Links       struct {
		Self string `json:"self"`
		Git  string `json:"git"`
		Html string `json:"html"`
	} `json:"_links"`
}

type NameMapping

type NameMapping struct {
	CoreName   string
	System     string
	Name       string // TODO: use names.txt
	ArcadeName string
}

type Service

type Service struct {
	Name string
	// contains filtered or unexported fields
}

func NewService

func NewService(args ServiceArgs) (*Service, error)

func (*Service) Pid

func (s *Service) Pid() (int, error)

Return the process ID of the current running service daemon.

func (*Service) Restart

func (s *Service) Restart() error

func (*Service) Running

func (s *Service) Running() bool

Returns true if the service is running.

func (*Service) ServiceHandler

func (s *Service) ServiceHandler(cmd *string)

func (*Service) Start

func (s *Service) Start() error

Start a new service daemon in the background.

func (*Service) Stop

func (s *Service) Stop() error

Stop the service daemon.

type ServiceArgs

type ServiceArgs struct {
	Name     string
	Entry    ServiceEntry
	NoDaemon bool
}

type ServiceEntry

type ServiceEntry func() (func() error, error)

type Tracker

type Tracker struct {
	Config *config.UserConfig

	ActiveCore       string
	ActiveSystem     string
	ActiveSystemName string
	ActiveGameId     string
	ActiveGameName   string
	ActiveGamePath   string
	NameMap          []NameMapping
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(cfg *config.UserConfig) (*Tracker, error)

func StartTracker

func StartTracker(cfg config.UserConfig) (*Tracker, func() error, error)

func (*Tracker) LoadCore

func (tr *Tracker) LoadCore()

LoadCore loads the current running core and set it as active.

func (*Tracker) LookupCoreName

func (tr *Tracker) LookupCoreName(name string, path string) NameMapping

func (*Tracker) ReloadNameMap

func (tr *Tracker) ReloadNameMap()

func (*Tracker) SetEventHook

func (tr *Tracker) SetEventHook(hook *func())

func (*Tracker) StopAll

func (tr *Tracker) StopAll()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL