コード例 #1
0
    def _scummvm_change_aspect(self):
        """ 
        If aspect ratio correction is enabled game will fit vertically
        the screen although we lost pixel perfect.
        If disabled, most of the games are 320x200 so will show two 
        horizontal bars up and down on the screen.
        If auto will ask just before of game launching for an option
        """
        p_sARValue = 'aspect_ratio'

        # get aspect ratio configuration from CRT config
        sAspect = None
        p_sScummARC = int(ini_get(CRT_UTILITY_FILE, "scummvm_arc"))
        if p_sScummARC == 0:
            """ 
            If Aspect Ratio Correction is not enabled leave this
            config as it is, only change if forced required or asked.
            """
            pass
        if p_sScummARC == 1:
            sAspect = "FIT"
        elif p_sScummARC == 2:
            sAspect = menu_options(self.m_lOptARC)

        if sAspect == "PIXEL":
            self._scummvm_change_ini(SCUMMVMCFG_FILE, p_sARValue, "false")
        elif sAspect == "FIT":
            self._scummvm_change_ini(SCUMMVMCFG_FILE, p_sARValue, "true")
コード例 #2
0
 def _main(self):
     p_sOption = ""
     self._generate_cable_list()
     p_sOption = menu_options(self.m_lChoices, self.m_sTitle)
     if p_sOption != 'EXIT':
         self.m_oCableMNGR.change_cable(int(p_sOption))
         self._restart()
     sys.exit(0)
コード例 #3
0
 def frequency_manual(self):
     result = menu_options(self.m_lOptFreq)
     sFrequency = self.m_oFreqDB.find(self.m_sCompactedName)
     if not sFrequency:
         self.m_oFreqDB.add(self.m_sCompactedName, result)
     else:
         if sFrequency != result:
             self.m_oFreqDB.clean(self.m_sCompactedName)
             self.m_oFreqDB.add(self.m_sCompactedName, result)
     return result
コード例 #4
0
 def _loop(self):
     p_sOption = ""
     self._generate_cable_list()
     while True:
         p_sOption = menu_options(self.m_lChoices, self.m_sTitle)
         if p_sOption != 'EXIT':
             self._cable_config(p_sOption, True)
         break
     self._ctrls_configuration(p_sOption)
     self._upload_boot_cfg()
     self._restart()
コード例 #5
0
    def get_argument():
        sTitRot = "SCREEN CENTER UTILITY"
        lOptRot = [("FRONTEND CENTERING", "FRONTEND"),
                   ("IN-GAME CENTERING", "INGAME"), ("CANCEL", "CANCEL")]

        sChoice = menu_options(lOptRot, sTitRot)
        if sChoice == "FRONTEND":
            sChoice = "system"
        elif sChoice == "INGAME":
            sChoice = "test60"
        else:
            sys.exit()
        return sChoice
コード例 #6
0
    def arcade_encapsulator(self):
        # Small centering if vertical resolution is 240 lines
        if self.m_dVideo["V_Res"] == 240 and self.m_oCRT.m_sSide_Game != "H":
            self.m_dVideo["V_Pos"] -= int(1)

        if (self.m_dVideo["V_Res"] > 240 and self.m_dVideo["R_Rate"] == 60):
            # for games with high v_res at 60hz
            logging.info("INFO: high V_Res game found %sx%s@%sHz" %
                         (self.m_dVideo["H_Res"], self.m_dVideo["V_Res"],
                          self.m_dVideo["R_Rate"]))
            self.adv_config_generate()
            if self.m_dVideo["V_Res"] == 448:
                self.m_dVideo["V_Res"] = 224
            else:
                self.m_dVideo["V_Res"] = 240
        elif self.m_dVideo["V_Res"] > 240:  # Classic encapsulator
            """
            If encapsulation needed only will ask on first core check,
            just before of runcommand launching and save selection in
            'cfg_encap'.
            On second round (after runcommand) will check previous 
            selection.
            """
            if self.cfg_encap:
                select = self.cfg_encap
                logging.info("INFO: there is a previous selection for " + \
                             "encapsulation: {%s}" % select)
            else:
                if not self.m_bRndCoreCheck:
                    select = menu_options(self.m_lOptEnc, self.m_sTitEnc)
                else:
                    select = "CROPPED"
                    logging.info("WARNING: AUTO SELECTION for encapsulation: " + \
                                 "{%s}, core changed and there " % select + \
                                 "is no previous selection")

            if select == "FORCED":  # Encapsulate
                self.m_dVideo["H_Freq"] = int(15841)
                self.m_dVideo["V_Pos"] += int(10)
            elif select == "CROPPED":  # Cropped if is under 55Hz
                if self.m_dVideo["R_Rate"] < 55:
                    self.m_dVideo["H_Freq"] = int(15095)
                self.m_dVideo["V_Pos"] -= int(10)

            self.cfg_encap = select  # save selection for second check
コード例 #7
0
            self._replace_image(file, CRTICONS_PATH, CRT_ICONS_SET_PATH)
        for file in os.listdir(CRTICONS_VERTICAL_PATH):
            self._replace_image(file, CRTICONS_VERTICAL_PATH,
                                CRT_ICONS_SET_PATH)

    def _change_resolution(self):
        self._fix_aspect_ratio_images()
        self._fix_icons_image()

    def _apply_resolution(self):
        commandline = None
        oApplyRes = center()
        oApplyRes.launch("force")

    # clean system
    def __clean(self):
        pass


if __name__ == '__main__':
    m_sTitRes = "CHANGE SYSTEM RESOLUTION"  # title for selector
    m_lOptRes = [("240p (320x240@60Hz)", "240p"),
                 ("270p (450x270@50Hz)", "270p"),
                 ("CANCEL", "CANCEL")]  # options for selector
    sChoice = menu_options(m_lOptRes, m_sTitRes)
    if sChoice != "CANCEL":
        HideScreen()
        oChangeRes = resolution_change(sChoice)
        oChangeRes.change()
    sys.exit(0)
コード例 #8
0
 def prepare(self):
     #if more than one video and selected is not the last
     if self._find_videos() and \
        (self.m_nVideoNUM != self.m_nVideoPOS+1):
         self.m_sPlayAll = menu_options(self.m_lOptVideo, self.m_sTitVideo)
コード例 #9
0
 def run(self):
     show_info('PLEASE WAIT...')
     sChoice = menu_options(self.m_lOptAuto, self.m_sTitAuto)
     self._automount_act(sChoice)
     sys.exit(0)
コード例 #10
0
    # clean system
    def __clean(self):
        """ Clean all side file triggers """
        os.system('rm %s >> /dev/null 2>&1' % ROTMODES_TATE1_FILE)
        os.system('rm %s >> /dev/null 2>&1' % ROTMODES_TATE3_FILE)
        os.system('rm %s >> /dev/null 2>&1' % ROTMODES_YOKO_FILE)


if __name__ == '__main__':
    iCurSide = 0
    sTitRot = "ROTATE SCREEN"
    lOptRot = [("ROTATE 90", "90"), ("ROTATE -90", "-90"),
               ("CANCEL", "CANCEL")]

    iCurSide = get_side()
    if iCurSide in (1, 3):
        lOptRot = [("HORIZONTAL", "0"), ("ROTATE 180", "180"),
                   ("CANCEL", "CANCEL")]
    sChoice = menu_options(lOptRot, sTitRot)
    try:
        sChoice = int(sChoice)
    except:
        sys.exit(0)
    if sChoice == 180 and iCurSide == 1:
        sChoice = -90
    elif sChoice == 180 and iCurSide == 3:
        sChoice = 90

    frontend_rotation(sChoice, True)
    sys.exit(0)
コード例 #11
0
 def _remap_option_menu(self):
     m_sTitRemap = "JOYSTICK CONFIG"
     m_lOptRemap = [("REMAP JOYSTICK", "REMAP"), ("CANCEL", "CANCEL")]
     select = menu_options(m_lOptRemap, m_sTitRemap)
     if select == "REMAP": return True
     return False