diff --git a/Menu/GameShell/10_Settings/Lima/gpu_driver_page.go b/Menu/GameShell/10_Settings/Lima/gpu_driver_page.go index 8e3a7ee..9b07497 100644 --- a/Menu/GameShell/10_Settings/Lima/gpu_driver_page.go +++ b/Menu/GameShell/10_Settings/Lima/gpu_driver_page.go @@ -233,9 +233,17 @@ func (self *GPUDriverPage) Click() { if strings.Contains(cur_li.Value,"modesetting") { lockfile,_ := homedir.Expand("~/.lima") UI.System("touch "+lockfile) + UI.ArmSystem("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima /usr/lib/xorg/modules/drivers/modesetting_drv.so") + UI.ArmSystem("sudo sed -i '/^#.*lima/s/^#//' /etc/ld.so.conf.d/00-arm-linux-gnueabihf.conf") + UI.ArmSystem("sudo ldconfig") + }else { lockfile,_ := homedir.Expand("~/.lima") UI.System("rm "+lockfile) + UI.ArmSystem("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima") + UI.ArmSystem("sudo sed -i 's/^[^#]*lima/#&/' /etc/ld.so.conf.d/00-arm-linux-gnueabihf.conf") + UI.ArmSystem("sudo ldconfig") + } time.BlockDelay(1000) @@ -352,7 +360,7 @@ func (self *GPUDriverPage) Draw() { } if self.HWND != nil { - surface.Fill(self.HWND, &color.Color{255,255,255,255}) + surface.Fill(self.HWND, UI.MySkinManager.GiveColor("White")) rect_ := rect.Rect(self.PosX,self.PosY,self.Width,self.Height) surface.Blit(self.HWND,self.CanvasHWND,&rect_,nil) } diff --git a/Menu/GameShell/20_Retro Games/MAME/action.config b/Menu/GameShell/20_Retro Games/MAME/action.config new file mode 100644 index 0000000..699f2f9 --- /dev/null +++ b/Menu/GameShell/20_Retro Games/MAME/action.config @@ -0,0 +1,7 @@ +ROM=/home/cpi/games/MAME +ROM_SO=/home/cpi/apps/emulators/mame2003_plus_libretro.so +EXT=zip +LAUNCHER=retroarch -L +TITLE=MAME Roms +EXCLUDE=neogeo.zip +SO_URL=https://raw.githubusercontent.com/cuu/emulators/master/mame2003_plus_libretro.so.zip diff --git a/Menu/GameShell/20_Retro Games/MAME/action.json b/Menu/GameShell/20_Retro Games/MAME/action.json deleted file mode 100644 index 01fd415..0000000 --- a/Menu/GameShell/20_Retro Games/MAME/action.json +++ /dev/null @@ -1,9 +0,0 @@ -{ -"ROM":"/home/cpi/games/MAME", -"ROM_SO":"/home/cpi/apps/emulators/mame2003_plus_libretro.so", -"EXT":["zip"], -"LAUNCHER":"retroarch -L", -"TITLE":"MAME Roms", -"EXCLUDE":["neogeo.zip"], -"SO_URL":"http://buildbot.libretro.com/nightly/linux/armhf/latest/mame2003_plus_libretro.so.zip" -} diff --git a/Menu/GameShell/20_Retro Games/MGBA/action.config b/Menu/GameShell/20_Retro Games/MGBA/action.config new file mode 100644 index 0000000..94177c0 --- /dev/null +++ b/Menu/GameShell/20_Retro Games/MGBA/action.config @@ -0,0 +1,6 @@ +ROM=/home/cpi/games/MGBA +ROM_SO=/home/cpi/apps/emulators/mgba_libretro.so +EXT=gb,gbc,gba,gbx +LAUNCHER=retroarch -L +TITLE=MGBA Roms +SO_URL=https://raw.githubusercontent.com/cuu/emulators/master/mgba_libretro.so.zip diff --git a/Menu/GameShell/20_Retro Games/MGBA/action.json b/Menu/GameShell/20_Retro Games/MGBA/action.json deleted file mode 100644 index 5cc4e51..0000000 --- a/Menu/GameShell/20_Retro Games/MGBA/action.json +++ /dev/null @@ -1,8 +0,0 @@ -{ -"ROM":"/home/cpi/games/MGBA", -"ROM_SO":"/home/cpi/apps/emulators/mgba_libretro.so", -"EXT":["gba","gbx"], -"LAUNCHER":"retroarch -L", -"TITLE":"MGBA Roms", -"SO_URL":"http://buildbot.libretro.com/nightly/linux/armhf/latest/mgba_libretro.so.zip" -} diff --git a/Menu/GameShell/20_Retro Games/NESTOPIA/action.config b/Menu/GameShell/20_Retro Games/NESTOPIA/action.config new file mode 100644 index 0000000..78dd876 --- /dev/null +++ b/Menu/GameShell/20_Retro Games/NESTOPIA/action.config @@ -0,0 +1,7 @@ +ROM=/home/cpi/games/NESTOPIA +ROM_SO=/home/cpi/apps/emulators/nestopia_libretro.so +EXT=zip,nes +LAUNCHER=retroarch -L +TITLE=NESTOPIA Roms +SO_URL=https://raw.githubusercontent.com/cuu/emulators/master/nestopia_libretro.so.zip + diff --git a/Menu/GameShell/20_Retro Games/NESTOPIA/action.json b/Menu/GameShell/20_Retro Games/NESTOPIA/action.json deleted file mode 100644 index ce43425..0000000 --- a/Menu/GameShell/20_Retro Games/NESTOPIA/action.json +++ /dev/null @@ -1,9 +0,0 @@ -{ -"ROM":"/home/cpi/games/NESTOPIA", -"ROM_SO":"/home/cpi/apps/emulators/nestopia_libretro.so", -"EXT":["zip"], -"LAUNCHER":"retroarch -L", -"TITLE":"NESTOPIA Roms", -"SO_URL":"http://buildbot.libretro.com/nightly/linux/armhf/latest/nestopia_libretro.so.zip" -} - diff --git a/mainscreen.go b/mainscreen.go index 534a042..0237cce 100644 --- a/mainscreen.go +++ b/mainscreen.go @@ -13,8 +13,9 @@ import ( "encoding/json" "sort" - "github.com/yookoala/realpath" + "github.com/go-ini/ini" + "github.com/yookoala/realpath" "github.com/clockworkpi/LauncherGoDev/sysgo/UI" "github.com/clockworkpi/LauncherGoDev/sysgo/UI/Emulator" @@ -184,10 +185,11 @@ func ReadTheDirIntoPages(self *UI.MainScreen, _dir string, pglevel int, cur_page a_c := Emulator.ActionConfig{} a_c.FILETYPE="file" a_c.TITLE = "Game" - dat, err := ioutil.ReadFile(_dir+"/"+f.Name()+"/" +UI.Emulator_flag) + cfg, err := ini.Load(_dir+"/"+f.Name()+"/" +UI.Emulator_flag) UI.ShowErr(err) - err = json.Unmarshal(dat, &a_c) + err = cfg.MapTo(&a_c) + if err == nil { //fmt.Println(a_c) if UI.FileExists(filepath.Join(_dir,f.Name(),"retroarch-local.cfg")) { diff --git a/sysgo/UI/Emulator/emulator.go b/sysgo/UI/Emulator/emulator.go index ab63d9e..f7fd8ea 100644 --- a/sysgo/UI/Emulator/emulator.go +++ b/sysgo/UI/Emulator/emulator.go @@ -6,15 +6,15 @@ import ( ) type ActionConfig struct { - ROM string `json:"ROM"` - ROM_SO string `json:"ROM_SO"` - EXT []string `json:"EXT"` - EXCLUDE []string `json:"EXCLUDE"` - FILETYPE string `json:"FILETYPE"` // defalut is file - LAUNCHER string `json:"LAUNCHER"` - TITLE string `json:"TITLE"` // defaut is Game - SO_URL string `json:"SO_URL"` - RETRO_CONFIG string `json:"RETRO_CONFIG"` + ROM string `ini:"ROM"` + ROM_SO string `ini:"ROM_SO"` + EXT []string `ini:"EXT,omitempty"` + EXCLUDE []string `ini:"EXCLUDE,omitempty"` + FILETYPE string `ini:"FILETYPE"` // defalut is file + LAUNCHER string `ini:"LAUNCHER"` + TITLE string `ini:"TITLE"` // defaut is Game + SO_URL string `ini:"SO_URL"` + RETRO_CONFIG string `ini:"RETRO_CONFIG"` } diff --git a/sysgo/UI/constants.go b/sysgo/UI/constants.go index d6deb05..998ec72 100644 --- a/sysgo/UI/constants.go +++ b/sysgo/UI/constants.go @@ -16,6 +16,6 @@ var ( ) var ( - Emulator_flag = "action.json" + Emulator_flag = "action.config" Plugin_flag = "plugin.json" ) diff --git a/sysgo/UI/skin_manager.go b/sysgo/UI/skin_manager.go index 8a8181e..1919571 100644 --- a/sysgo/UI/skin_manager.go +++ b/sysgo/UI/skin_manager.go @@ -64,7 +64,7 @@ func (self *SkinManager) Init() { self.Colors["White"] = &color.Color{255,255,255,255} self.Colors["Black"] = &color.Color{0,0,0,255} - fname := "skin/"+sysgo.SKIN+"/config.cfg" + fname := "skin/"+sysgo.SKIN+"/config.ini" load_opts := ini.LoadOptions{ IgnoreInlineComment:true, diff --git a/sysgo/UI/util_funcs.go b/sysgo/UI/util_funcs.go index 21400b8..ace510f 100644 --- a/sysgo/UI/util_funcs.go +++ b/sysgo/UI/util_funcs.go @@ -12,6 +12,7 @@ import ( "strconv" "syscall" "os/exec" + "runtime" "github.com/cuu/gogame/display" @@ -260,6 +261,16 @@ func System(cmd string) string { return ret } +func ArmSystem(cmd string) string { + + if strings.Contains(runtime.GOARCH,"arm") == true { + return System(cmd) + }else { + return "" + } + +} + func SystemTrim(cmd string) string { ret := "" out,err := exec.Command("bash","-c",cmd).Output()