From 7f3c2184727ed3da344f6cac9d3f221530b91c90 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Wed, 29 Jul 2020 23:21:36 +1000 Subject: [PATCH] ARB Patcher: fix tone_map_npr --- .../amd-tools/ARB Patcher Source/gamesettings/divaaft.py | 2 +- source-code/data/amd-tools/ARB Patcher Source/rules.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source-code/data/amd-tools/ARB Patcher Source/gamesettings/divaaft.py b/source-code/data/amd-tools/ARB Patcher Source/gamesettings/divaaft.py index d0b10ed..35c0900 100644 --- a/source-code/data/amd-tools/ARB Patcher Source/gamesettings/divaaft.py +++ b/source-code/data/amd-tools/ARB Patcher Source/gamesettings/divaaft.py @@ -92,7 +92,7 @@ def filename_filter(fname): # use to tweak reasults after patching def post_filter(fname, f_full): # ideally this could do with a generic version in the main script... - f_full = f_full.replace('MOV.F.CC1 ', 'MOV ') + f_full = f_full.replace('MOV.F.CC1 ', 'MOVC1 ') f_full = f_full.replace('\nBUFFER4', '\n#BUFFER4') diff --git a/source-code/data/amd-tools/ARB Patcher Source/rules.py b/source-code/data/amd-tools/ARB Patcher Source/rules.py index 007d792..1c81b8b 100644 --- a/source-code/data/amd-tools/ARB Patcher Source/rules.py +++ b/source-code/data/amd-tools/ARB Patcher Source/rules.py @@ -41,12 +41,17 @@ RET_IF_REGEX = recompile(r"(IF\s+?(.*?);[\s\S]*?)RET;\s*?ENDIF;") RET_IF_SUB = "\\1ENDIF;\nRET (\\2);" -# RET behaves differently on AMD, so convert conditional reta into if/else +# RET behaves differently on AMD, so convert conditional rets into if/else # (may not work properly with CAL) CONDITIONAL_RET_REGEX = recompile(r"RET\s+?\((.*?)\);([\s\S]*?)(END\s*?$|RET;)") CONDITIONAL_RET_SUB = "IF \\1; ELSE; \\2 ENDIF; \\3" +# CAL behaves differently on AMD, so convert conditional cals into if +CONDITIONAL_CAL_REGEX = recompile(r"CAL\s+?(.*?)\s+?\((.*?)\)\s*?;") +CONDITIONAL_CAL_SUB = "IF \\2; CAL \\1; ENDIF;" + + MATCH_FP_FNAME = recompile(r".*fp") MATCH_VP_FNAME = recompile(r".*vp") MATCH_ALL_FNAME = recompile(r".*") @@ -59,4 +64,5 @@ fix_repls = [ (MATCH_ALL_FNAME, SAMPLER_OFFSET_REGEX, SAMPLER_OFFSET_SUB, False), (MATCH_ALL_FNAME, RET_IF_REGEX, RET_IF_SUB, False), (MATCH_ALL_FNAME, CONDITIONAL_RET_REGEX, CONDITIONAL_RET_SUB, True), + (MATCH_ALL_FNAME, CONDITIONAL_CAL_REGEX, CONDITIONAL_CAL_SUB, False), ]