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

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

# -*- coding:Utf-8 -*- 

############################################################################### 

## Lutris 

## 

## Copyright (C) 2009, 2010 Mathieu Comandon strycore@gmail.com 

## 

## This program is free software; you can redistribute it and/or modify 

## it under the terms of the GNU General Public License as published by 

## the Free Software Foundation; either version 3 of the License, or 

## (at your option) any later version. 

## 

## This program is distributed in the hope that it will be useful, 

## but WITHOUT ANY WARRANTY; without even the implied warranty of 

## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 

## GNU General Public License for more details. 

## 

## You should have received a copy of the GNU General Public License 

## along with this program; if not, write to the Free Software 

## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

############################################################################### 

 

""" Runner for Dreamcast games """ 

 

import os 

from lutris.runners.wine import wine 

from lutris.gui.dialogs import DirectoryDialog 

from lutris.config import LutrisConfig 

 

 

# pylint: disable=C0103 

class nulldc(wine): 

    """Runner for the Dreamcast emulator NullDC 

 

    Since there is no good Linux emulator out there, we have to use a Windows 

    emulator. It runs pretty well. 

 

    NullDC is now OpenSource ! Somebody please port it to Linux. 

    The open source NullDC version (1.0.4) doesn't work with wine ! 

 

    Download link : http://nulldc.googlecode.com/files/nullDC_104_r50.7z 

 

    """ 

 

    def __init__(self, settings=None): 

        """Initialize NullDC 

 

        joy2key $(xwininfo -root -tree  | grep nullDC | grep -v VMU |\ 

                awk '{print $1}') \ 

                -X  -rcfile ~/.joy2keyrc \ 

                -buttons y a b x c r l r o s -axis Left Right Up Down 

        """ 

        super(nulldc, self).__init__(settings) 

        self.description = "Runs Dreamcast games with nullDC emulator" 

        self.platform = "Sega Dreamcast" 

 

        self.is_installable = False 

 

        self.depends = "wine" 

        config = LutrisConfig(runner=self.__class__.__name__) 

        self.nulldc_path = config.get_path() 

        self.executable = "nullDC_1.0.3_nommu.exe" 

        self.args = "" 

        self.game_options = [{ 

            'option': 'iso', 

            'type': 'file', 

            'name': 'iso', 

            'label': 'Disc image' 

        }] 

        self.runner_options = self.runner_options + [{ 

            'option': 'fullscreen', 

            'type': 'bool', 

            'name': 'fullscreen', 

            'label': 'Fullscreen' 

        }] 

        if settings: 

            self.settings = settings 

 

    def install(self): 

        """Install NullDC""" 

        dlg = DirectoryDialog('Where is NullDC located ?') 

        config = LutrisConfig(runner=self.__class__.__name__) 

        config.runner_config = {'system': {'game_path': dlg.folder}} 

        config.save(config_type='runner') 

 

    def is_installed(self): 

        """Check if NullDC is installed""" 

        if not self.check_depends(): 

            return False 

        nulldc_path = self.get_nulldc_path() 

        if not nulldc_path or not os.path.exists(nulldc_path): 

            return False 

        else: 

            return True 

 

    def get_nulldc_path(self): 

        """ Return the full path for the NullDC executable.""" 

        if not self.nulldc_path: 

            return "" 

        else: 

            return os.path.join(self.nulldc_path, self.executable) 

 

    def play(self): 

        """Run Dreamcast game""" 

        #-config ImageReader:DefaultImage="[rompath]/[romfile]" 

        path = self.settings['game']['iso'] 

        path = path.replace("/", "\\") 

        path = 'Z:' + path 

 

        command = ["wine", self.get_nulldc_path(), 

                   "-config", "ImageReader:DefaultImage=\"%s\"" % path] 

 

        self.check_regedit_keys()  # From parent wine runner 

        return {'command': command, 

                'joy2key': {'buttons': 'y a b x c r l r o s', 

                            'window': 'nullDC', 

                            'notwindow': 'VMU'}}