Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Normalize all Game INI files
Add a simple Python script that does a basic normalization on the game INI files and run it across all the files we have. This normalizes the sections, their order and comments, and the whitespace within them. It also removes the sections Video_Hardware, Gecko, and Wii, which should not be in the game INI files we ship by default.
- Loading branch information
Showing
1,468 changed files
with
34,295 additions
and
16,220 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
|
|
||
| import chardet | ||
| import codecs | ||
| import os | ||
| import glob | ||
|
|
||
| standard_sections = [ | ||
| "Core", | ||
| "EmuState", | ||
| "OnLoad", | ||
| "OnFrame", | ||
| "ActionReplay", | ||
| "Video", | ||
| "Video_Settings", | ||
| "Video_Enhancements", | ||
| "Video_Hacks", | ||
| "Speedhacks", | ||
| ] | ||
|
|
||
| standard_comments = { | ||
| "Core": "Values set here will override the main dolphin settings.", | ||
| "EmuState": "The Emulation State. 1 is worst, 5 is best, 0 is not set.", | ||
| "OnLoad": "Add memory patches to be loaded once on boot here.", | ||
| "OnFrame": "Add memory patches to be applied every frame here.", | ||
| "ActionReplay": "Add action replay cheats here.", | ||
| "Video": "", | ||
| "Video_Settings": "", | ||
| "Video_Enhancements": "", | ||
| "Video_Hacks": "", | ||
| "Speedhacks": "", | ||
| } | ||
|
|
||
| def normalize_comment(line): | ||
| line = line.strip().lstrip('#').lstrip() | ||
| if line: | ||
| return "# %s" % (line,) | ||
| else: | ||
| return "" | ||
|
|
||
| def normalize_ini_file(in_, out): | ||
| sections = {} | ||
| current_section = None | ||
| toplevel_comment = "" | ||
| wants_comment = False | ||
|
|
||
| for line in in_: | ||
| line = line.strip() | ||
|
|
||
| # strip utf8 bom | ||
| line = line.lstrip(u'\ufeff') | ||
|
|
||
| if line.startswith('#'): | ||
| line = normalize_comment(line) | ||
| if current_section is None: | ||
| toplevel_comment += line | ||
| continue | ||
|
|
||
| if line.startswith('['): | ||
| end = line.find(']') | ||
| section_name = line[1:end] | ||
| if section_name not in standard_sections: | ||
| continue | ||
| current_section = [] | ||
| sections[section_name] = current_section | ||
| wants_comment = False | ||
| continue | ||
|
|
||
| if current_section is None and line: | ||
| raise ValueError("invalid junk") | ||
|
|
||
| if current_section is None: | ||
| continue | ||
|
|
||
| if line.startswith('#') and not wants_comment: | ||
| continue | ||
|
|
||
| current_section.append(line) | ||
| if line: | ||
| wants_comment = True | ||
|
|
||
| out.write(toplevel_comment.strip() + "\n\n") | ||
|
|
||
| for section in standard_sections: | ||
| lines = '\n'.join(sections.get(section, "")).strip() | ||
| comments = standard_comments[section] | ||
|
|
||
| if not lines and not comments: | ||
| continue | ||
|
|
||
| out.write("[%s]\n" % (section,)) | ||
| if comments: | ||
| out.write("# %s\n" % (comments,)) | ||
| if lines: | ||
| out.write(lines) | ||
| out.write('\n') | ||
| out.write('\n') | ||
|
|
||
| def main(): | ||
| for name in glob.glob("??????.ini"): | ||
| in__name = name | ||
| out_name = name + '.new' | ||
|
|
||
| in_str = open(in__name, 'r').read() | ||
| encoding = chardet.detect(in_str) | ||
|
|
||
| in_ = codecs.open(in__name, 'r', encoding['encoding']) | ||
| out = codecs.open(out_name, 'w', 'utf8') | ||
| normalize_ini_file(in_, out) | ||
| os.rename(out_name, in__name) | ||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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 |
|---|---|---|
| @@ -1,15 +1,27 @@ | ||
| # D43E01 - ZELDA OCARINA MULTI PACK | ||
| [Core] Values set here will override the main dolphin settings. | ||
| [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
|
|
||
| [Core] | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationStateId = 5 | ||
| EmulationIssues = Minor video glitches when pausing | ||
| [OnFrame] Add memory patches to be applied every frame here. | ||
| [ActionReplay] Add action replay cheats here. | ||
|
|
||
| [OnLoad] | ||
| # Add memory patches to be loaded once on boot here. | ||
|
|
||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
|
|
||
| [ActionReplay] | ||
| # Add action replay cheats here. | ||
|
|
||
| [Video] | ||
| ProjectionHack = 0 | ||
| PH_SZNear = 0 | ||
| PH_SZFar = 0 | ||
| PH_ExtraParam = 0 | ||
| PH_ZNear = | ||
| PH_ZFar = | ||
| [Gecko] | ||
| PH_ZNear = | ||
| PH_ZFar = | ||
|
|
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 |
|---|---|---|
| @@ -1,14 +1,21 @@ | ||
| # D43J01 - ZELDA OCARINA MULTI PACK | ||
|
|
||
| [Core] | ||
| #Values set here will override the main dolphin settings. | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| #The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationStateId = 4 | ||
| EmulationIssues = | ||
| EmulationIssues = | ||
|
|
||
| [OnLoad] | ||
| #Add memory patches to be loaded once on boot here. | ||
| # Add memory patches to be loaded once on boot here. | ||
|
|
||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
| +$loophack | ||
| 0x806866E4:word:0x60000000 | ||
|
|
||
| [ActionReplay] | ||
| [Video] | ||
| # Add action replay cheats here. | ||
|
|
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 |
|---|---|---|
| @@ -1,10 +1,23 @@ | ||
| # D43P01 - The Legend of Zelda: Ocarina of Time | ||
|
|
||
| [Core] | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| #The Emulation State. | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationStateId = 1 | ||
| Issues="Dolphin doesn't support soft reset" | ||
| EmulationIssues = | ||
| [OnFrame]#Add memory patches here. | ||
| EmulationIssues = | ||
|
|
||
| [OnLoad] | ||
| # Add memory patches to be loaded once on boot here. | ||
|
|
||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
|
|
||
| [ActionReplay] | ||
| # Add action replay cheats here. | ||
|
|
||
| [Video] | ||
| ProjectionHack = 0 | ||
|
|
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 |
|---|---|---|
| @@ -1,10 +1,22 @@ | ||
| # D43U01 - ZELDA OCARINA MULTI PACK | ||
| [Core] Values set here will override the main dolphin settings. | ||
| [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
|
|
||
| [Core] | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationStateId = 4 | ||
| EmulationIssues = | ||
| [OnFrame] Add memory patches to be applied every frame here. | ||
| [ActionReplay] Add action replay cheats here. | ||
| EmulationIssues = | ||
|
|
||
| [OnLoad] | ||
| # Add memory patches to be loaded once on boot here. | ||
|
|
||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
|
|
||
| [ActionReplay] | ||
| # Add action replay cheats here. | ||
|
|
||
| [Video] | ||
| ProjectionHack = 0 | ||
| [Gecko] | ||
|
|
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 |
|---|---|---|
| @@ -1,9 +1,20 @@ | ||
| # DTLX01 - ACTION REPLAY | ||
| # DTLX01 - ACTION REPLAY | ||
|
|
||
| [Core] | ||
| # Values set here will override the main dolphin settings. | ||
| TLBHack = 1 | ||
| #Values set here will override the main dolphin settings. | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| #The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationStateId = 0 | ||
|
|
||
| [OnLoad] | ||
| # Add memory patches to be loaded once on boot here. | ||
|
|
||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
|
|
||
| [ActionReplay] | ||
| # Add action replay cheats here. | ||
|
|
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 |
|---|---|---|
| @@ -1,6 +1,18 @@ | ||
| # DVDXDV - Unknown | ||
| [Core] Values set here will override the main dolphin settings. | ||
| [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationIssues = | ||
| [OnFrame] Add memory patches to be applied every frame here. | ||
| [ActionReplay] Add action replay cheats here. | ||
|
|
||
| [Core] | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationIssues = | ||
|
|
||
| [OnLoad] | ||
| # Add memory patches to be loaded once on boot here. | ||
|
|
||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
|
|
||
| [ActionReplay] | ||
| # Add action replay cheats here. | ||
|
|
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 |
|---|---|---|
| @@ -1,9 +1,22 @@ | ||
| # FABP01 - Zelda: Link to Past | ||
| [Core] Values set here will override the main dolphin settings. | ||
| [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationIssues = | ||
| # FABP01 - Zelda: Link to Past | ||
|
|
||
| [Core] | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationIssues = | ||
| EmulationStateId = 4 | ||
| [OnFrame] Add memory patches to be applied every frame here. | ||
| [ActionReplay] Add action replay cheats here. | ||
|
|
||
| [OnLoad] | ||
| # Add memory patches to be loaded once on boot here. | ||
|
|
||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
|
|
||
| [ActionReplay] | ||
| # Add action replay cheats here. | ||
|
|
||
| [Video] | ||
| ProjectionHack = 0 | ||
|
|
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 |
|---|---|---|
| @@ -1,8 +1,19 @@ | ||
| # FBYE01 - Super Mario Bros. 2 | ||
| [Core] Values set here will override the main dolphin settings. | ||
| [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
|
|
||
| [Core] | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationStateId = 3 | ||
| EmulationIssues = Can't see graphics | ||
| [OnFrame] Add memory patches to be applied every frame here. | ||
| [ActionReplay] Add action replay cheats here. | ||
| [Video] | ||
| [OnLoad] | ||
| # Add memory patches to be loaded once on boot here. | ||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
| [ActionReplay] | ||
| # Add action replay cheats here. | ||
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 |
|---|---|---|
| @@ -1,17 +1,30 @@ | ||
| # G2BE5G - Black & Bruised | ||
| [Core] Values set here will override the main dolphin settings. | ||
| [EmuState] The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationStateId = 4 | ||
| EmulationIssues = | ||
| [OnFrame] Add memory patches to be applied every frame here. | ||
| [ActionReplay] Add action replay cheats here. | ||
| [Video] | ||
| ProjectionHack = 0 | ||
| PH_SZNear = 0 | ||
| PH_SZFar = 0 | ||
| PH_ExtraParam = 0 | ||
| PH_ZNear = | ||
| PH_ZFar = | ||
| [Gecko] | ||
| [Video_Settings] | ||
| SafeTextureCacheColorSamples = 512 | ||
| # G2BE5G - Black & Bruised | ||
|
|
||
| [Core] | ||
| # Values set here will override the main dolphin settings. | ||
|
|
||
| [EmuState] | ||
| # The Emulation State. 1 is worst, 5 is best, 0 is not set. | ||
| EmulationStateId = 4 | ||
| EmulationIssues = | ||
|
|
||
| [OnLoad] | ||
| # Add memory patches to be loaded once on boot here. | ||
|
|
||
| [OnFrame] | ||
| # Add memory patches to be applied every frame here. | ||
|
|
||
| [ActionReplay] | ||
| # Add action replay cheats here. | ||
|
|
||
| [Video] | ||
| ProjectionHack = 0 | ||
| PH_SZNear = 0 | ||
| PH_SZFar = 0 | ||
| PH_ExtraParam = 0 | ||
| PH_ZNear = | ||
| PH_ZFar = | ||
|
|
||
| [Video_Settings] | ||
| SafeTextureCacheColorSamples = 512 | ||
|
|
Oops, something went wrong.