-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from kloptops/main
Fixed some stuff with Batocera/Knulli, fixed device_info.txt
- Loading branch information
Showing
10 changed files
with
225 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
from typing import TYPE_CHECKING | ||
|
||
from ... import Command | ||
from ...controller import generate_sdl_game_controller_config, write_sdl_controller_db | ||
from ..Generator import Generator | ||
|
||
if TYPE_CHECKING: | ||
from ...types import HotkeysContext | ||
|
||
|
||
class ShGenerator(Generator): | ||
|
||
def getHotkeysContext(self) -> HotkeysContext: | ||
return { | ||
"name": "shell", | ||
"keys": { "exit": ["KEY_LEFTALT", "KEY_F4"] } | ||
} | ||
|
||
def generate(self, system, rom, playersControllers, metadata, guns, wheels, gameResolution): | ||
rom_path = Path(rom) | ||
|
||
# in case of squashfs, the root directory is passed | ||
runsh = rom_path / "run.sh" | ||
shrom = runsh if runsh.exists() else rom_path | ||
|
||
# Fixes stuff on PortMaster | ||
dbfile = "/tmp/gamecontrollerdb.txt" | ||
write_sdl_controller_db(playersControllers, dbfile) | ||
|
||
commandArray = ["/bin/bash", shrom] | ||
return Command.Command(array=commandArray,env={ | ||
"SDL_GAMECONTROLLERCONFIG": generate_sdl_game_controller_config(playersControllers) | ||
}) | ||
|
||
def getMouseMode(self, config, rom): | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
|
||
from generators.Generator import Generator | ||
import Command | ||
import controllersConfig | ||
import glob | ||
|
||
class ShGenerator(Generator): | ||
|
||
def generate(self, system, rom, playersControllers, metadata, guns, wheels, gameResolution): | ||
|
||
# in case of squashfs, the root directory is passed | ||
shInDir = glob.glob(rom + "/run.sh") | ||
if len(shInDir) == 1: | ||
shrom = shInDir[0] | ||
else: | ||
shrom = rom | ||
|
||
# Fixes stuff on PortMaster | ||
dbfile = "/tmp/gamecontrollerdb.txt" | ||
controllersConfig.writeSDLGameDBAllControllers(playersControllers, dbfile) | ||
|
||
commandArray = ["/bin/bash", shrom] | ||
return Command.Command(array=commandArray,env={ | ||
"SDL_GAMECONTROLLERCONFIG": controllersConfig.generateSdlGameControllerConfig(playersControllers) | ||
}) | ||
|
||
def getMouseMode(self, config, rom): | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.