summaryrefslogtreecommitdiff
path: root/cpu_dsl.py
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2019-02-06 08:54:09 -0800
committerMichael Pavone <pavone@retrodev.com>2019-02-06 08:54:09 -0800
commitdfec2468ff106556e035c8e702edf5a7d0e50e68 (patch)
tree7a1d0f1d7c7d5f8c010bbd5ff5ceb52ba462fb7e /cpu_dsl.py
parent961bdbea9dbbabff23624ef18280218eae452a3a (diff)
Fixes to DAA, SCF and CCF to pass ZEXALL in new Z80 core
Diffstat (limited to 'cpu_dsl.py')
-rwxr-xr-xcpu_dsl.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/cpu_dsl.py b/cpu_dsl.py
index 928681b..070efbe 100755
--- a/cpu_dsl.py
+++ b/cpu_dsl.py
@@ -468,10 +468,11 @@ def _cmpCImpl(prog, params, rawParams, flagUpdates):
if needsCarry:
size *= 2
tmpvar = 'cmp_tmp{sz}__'.format(sz=size)
- prog.carryFlowDst = tmpvar
- prog.lastA = params[1]
- prog.lastB = params[0]
- prog.lastBFlow = params[0]
+ if flagUpdates:
+ prog.carryFlowDst = tmpvar
+ prog.lastA = params[1]
+ prog.lastB = params[0]
+ prog.lastBFlow = params[0]
scope = prog.getRootScope()
if not scope.resolveLocal(tmpvar):
scope.addLocal(tmpvar, size)