Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

import os 

from lutris import settings 

from lutris.runners.runner import Runner 

from lutris.util.system import find_executable 

 

 

class pcsxr(Runner): 

    """PlayStation emulator""" 

 

    package = "pcsxr" 

    is_installable = True 

    platform = "Playstation" 

    game_options = [{ 

        "option": "iso", 

        "type": "file", 

        "label": "iso" 

    }] 

    runner_options = [] 

 

    def get_executable(self): 

        # Lutris provided emulator 

        pcsxr_path = os.path.join(settings.RUNNER_DIR, 'pcsxr/pcsxr') 

        if os.path.exists(pcsxr_path): 

            return pcsxr_path 

        # System wide available emulator 

        candidates = ('pcsx', 'pcsxr') 

        for candidate in candidates: 

            executable = find_executable(candidate) 

            if executable: 

                return executable 

 

    def is_installed(self): 

        return bool(self.get_executable()) 

 

    def play(self): 

        """Run Playstation game""" 

        iso = self.settings["game"].get("iso") 

        executable = self.get_executable() 

        command = [executable, " -nogui -cdfile \"" + iso + "\" -runcd"] 

        return {'command': command}