mirror of https://github.com/stenzek/duckstation
				
				
				
			libretro: Add compatibility settings loading
							parent
							
								
									b16e639f0c
								
							
						
					
					
						commit
						859f23f4d5
					
				@ -0,0 +1,106 @@
 | 
			
		||||
import sys
 | 
			
		||||
import configparser
 | 
			
		||||
 | 
			
		||||
def parse_ini(path):
 | 
			
		||||
    config = configparser.ConfigParser()
 | 
			
		||||
    config.read(path)
 | 
			
		||||
 | 
			
		||||
    entries = {}
 | 
			
		||||
    int_keys = {
 | 
			
		||||
        "DisplayActiveStartOffset": "display_active_start_offset",
 | 
			
		||||
        "DisplayActiveEndOffset": "display_active_end_offset",
 | 
			
		||||
        "DMAMaxSliceTicks": "dma_max_slice_ticks",
 | 
			
		||||
        "DMAHaltTicks": "dma_halt_ticks",
 | 
			
		||||
        "GPUFIFOSize" : "gpu_fifo_size",
 | 
			
		||||
        "GPUMaxRunAhead" : "gpu_max_run_ahead"
 | 
			
		||||
    }
 | 
			
		||||
    float_keys = {
 | 
			
		||||
        "GPUPGXPTolerance" : "gpu_pgxp_tolerance"
 | 
			
		||||
    }
 | 
			
		||||
    traits = [
 | 
			
		||||
        "ForceInterpreter",
 | 
			
		||||
        "ForceSoftwareRenderer",
 | 
			
		||||
        "ForceInterlacing",
 | 
			
		||||
        "DisableTrueColor",
 | 
			
		||||
        "DisableUpscaling",
 | 
			
		||||
        "DisableScaledDithering",
 | 
			
		||||
        "DisableForceNTSCTimings",
 | 
			
		||||
        "DisableWidescreen",
 | 
			
		||||
        "DisablePGXP",
 | 
			
		||||
        "DisablePGXPCulling",
 | 
			
		||||
        "DisablePGXPTextureCorrection",
 | 
			
		||||
        "ForcePGXPVertexCache",
 | 
			
		||||
        "ForcePGXPCPUMode",
 | 
			
		||||
        "ForceDigitalController",
 | 
			
		||||
        "ForceRecompilerMemoryExceptions",
 | 
			
		||||
        "ForceRecompilerICache"
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    for gameid in config.sections():
 | 
			
		||||
        entry = {}
 | 
			
		||||
        for ini_key, cpp_key in int_keys.items():
 | 
			
		||||
            try:
 | 
			
		||||
                value = config.get(gameid, ini_key)
 | 
			
		||||
                if value is not None:
 | 
			
		||||
                    entry[cpp_key] = str(value)
 | 
			
		||||
            except configparser.NoOptionError:
 | 
			
		||||
                pass
 | 
			
		||||
 | 
			
		||||
        for ini_key, cpp_key in float_keys.items():
 | 
			
		||||
            try:
 | 
			
		||||
                value = config.getfloat(gameid, ini_key, fallback=None)
 | 
			
		||||
                if value is not None:
 | 
			
		||||
                    entry[cpp_key] = str(value)
 | 
			
		||||
            except configparser.NoOptionError:
 | 
			
		||||
                pass
 | 
			
		||||
        
 | 
			
		||||
        for trait in traits:
 | 
			
		||||
            try:
 | 
			
		||||
                value = config.getboolean(gameid, trait, fallback=None)
 | 
			
		||||
                if value == True:
 | 
			
		||||
                    if "traits" not in entry:
 | 
			
		||||
                        entry["traits"] = []
 | 
			
		||||
                    entry["traits"].append(trait)
 | 
			
		||||
            except configparser.NoOptionError:
 | 
			
		||||
                pass
 | 
			
		||||
 | 
			
		||||
        if len(entry) > 0:
 | 
			
		||||
            entries[gameid] = entry
 | 
			
		||||
 | 
			
		||||
    return entries
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def write_cpp(entries, path):
 | 
			
		||||
    print("Writing %u entries to '%s'" % (len(entries), path))
 | 
			
		||||
    with open(path, "w") as f:
 | 
			
		||||
        f.write('#include "libretro_game_settings.h"\n')
 | 
			
		||||
        f.write('\n')
 | 
			
		||||
        f.write('std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_code)\n')
 | 
			
		||||
        f.write('{\n')
 | 
			
		||||
        f.write('  std::unique_ptr<GameSettings::Entry> gs = std::make_unique<GameSettings::Entry>();\n')
 | 
			
		||||
        f.write('\n')
 | 
			
		||||
 | 
			
		||||
        for gameid, entry in entries.items():
 | 
			
		||||
            f.write('  if (game_code == "%s")\n' % gameid)
 | 
			
		||||
            f.write('  {\n')
 | 
			
		||||
            for key, value in entry.items():
 | 
			
		||||
                if key == "traits":
 | 
			
		||||
                    for trait in value:
 | 
			
		||||
                        f.write('    gs->AddTrait(GameSettings::Trait::%s);\n' % trait)
 | 
			
		||||
                else:
 | 
			
		||||
                    f.write('    gs->%s = %s;\n' % (key, value))
 | 
			
		||||
            f.write('    return gs;\n')
 | 
			
		||||
            f.write('  }\n')
 | 
			
		||||
            f.write('\n')
 | 
			
		||||
 | 
			
		||||
        f.write('  return {};\n')
 | 
			
		||||
        f.write('}\n')
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    if len(sys.argv) < 3:
 | 
			
		||||
        print("usage: %s <path to gamesettings.ini> <output cpp file>" % sys.argv[0])
 | 
			
		||||
        sys.exit(1)
 | 
			
		||||
 | 
			
		||||
    entries = parse_ini(sys.argv[1])
 | 
			
		||||
    write_cpp(entries, sys.argv[2])
 | 
			
		||||
@ -0,0 +1,561 @@
 | 
			
		||||
#include "libretro_game_settings.h"
 | 
			
		||||
 | 
			
		||||
std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_code)
 | 
			
		||||
{
 | 
			
		||||
  std::unique_ptr<GameSettings::Entry> gs = std::make_unique<GameSettings::Entry>();
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00530")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00634")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00077")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisableUpscaling);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPM-87089")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-03336")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-01260")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLES-01211")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-01261")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLES-02466")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLES-00259")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLES-00606")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00639")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-90039")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00337")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00606")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-03553")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-01211")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00656")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00952")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-01222")
 | 
			
		||||
  {
 | 
			
		||||
    gs->display_active_start_offset = 64;
 | 
			
		||||
    gs->display_active_end_offset = 68;
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00297")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisableUpscaling);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisablePGXP);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCUS-94350")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCUS-94900")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "PCPX-96085")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00590")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00403")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCUS-94300")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00214")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00204")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00006")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00213")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCES-00344")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00355")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisableUpscaling);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00331")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisableUpscaling);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00106")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00005")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-01265")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00601")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-00435")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00388")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCES-02834")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00870")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterpreter);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00183")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLES-00483")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-02361")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPVertexCache);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPM-86023")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00067")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLES-00524")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-00712")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-01434")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00684")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterpreter);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-02459")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPM-86750")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-02120")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterlacing);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00102")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00152")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00603")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00348")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisableUpscaling);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00042")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00561")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00035")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00057")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00014")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCUS-94403")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00549")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00240")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00027")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00119")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00224")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00453")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00753")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00811")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceDigitalController);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00208")
 | 
			
		||||
  {
 | 
			
		||||
    gs->display_active_start_offset = -62;
 | 
			
		||||
    gs->display_active_end_offset = 72;
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-01762")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisablePGXPCulling);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-01567")
 | 
			
		||||
  {
 | 
			
		||||
    gs->display_active_start_offset = -62;
 | 
			
		||||
    gs->display_active_end_offset = 51;
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-00360")
 | 
			
		||||
  {
 | 
			
		||||
    gs->display_active_start_offset = -62;
 | 
			
		||||
    gs->display_active_end_offset = 72;
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCES-02835")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterpreter);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCES-02104")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForceInterpreter);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCES-01438")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisablePGXPCulling);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCUS-94467")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCUS-94425")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCPS-10085")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCUS-94228")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisablePGXPCulling);
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SCUS-94290")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-01138")
 | 
			
		||||
  {
 | 
			
		||||
    gs->dma_max_slice_ticks = 200;
 | 
			
		||||
    gs->gpu_max_run_ahead = 1;
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLPS-02376")
 | 
			
		||||
  {
 | 
			
		||||
    gs->dma_max_slice_ticks = 100;
 | 
			
		||||
    gs->gpu_max_run_ahead = 1;
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00282")
 | 
			
		||||
  {
 | 
			
		||||
    gs->dma_max_slice_ticks = 200;
 | 
			
		||||
    gs->gpu_max_run_ahead = 1;
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (game_code == "SLUS-00022")
 | 
			
		||||
  {
 | 
			
		||||
    gs->AddTrait(GameSettings::Trait::DisableUpscaling);
 | 
			
		||||
    return gs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return {};
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,4 @@
 | 
			
		||||
#include "frontend-common/game_settings.h"
 | 
			
		||||
#include <memory>
 | 
			
		||||
 | 
			
		||||
std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_code);
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue