summaryrefslogtreecommitdiff
path: root/cpu_dsl.py
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2019-02-04 23:46:35 -0800
committerMichael Pavone <pavone@retrodev.com>2019-02-04 23:46:35 -0800
commit1f719b8879580586970338e7c96d65910dca02e8 (patch)
tree2a0e50f419456feff7262b8afabbbd3d6c2928dd /cpu_dsl.py
parent9f3816b25a22648eb1cde164dcfc1541f48ace31 (diff)
Fixed CPI/CPD/CPIR/CPDR in new Z80 core
Diffstat (limited to 'cpu_dsl.py')
-rwxr-xr-xcpu_dsl.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpu_dsl.py b/cpu_dsl.py
index a5016b6..9893600 100755
--- a/cpu_dsl.py
+++ b/cpu_dsl.py
@@ -418,7 +418,7 @@ def _updateFlagsCImpl(prog, params, rawParams):
raise Exception('Unknown flag calc type: ' + calc)
if prog.carryFlowDst:
if prog.lastOp.op != 'cmp':
- output.append('\n\t{dst} = {tmpdst};'.format(dst = prog.resolveParam(prog.lastDst, None, {}), tmpdst = prog.carryFlowDst))
+ output.append('\n\t{dst} = {tmpdst};'.format(dst = prog.resolveParam(prog.lastDst, prog.currentScope, {}), tmpdst = prog.carryFlowDst))
prog.carryFlowDst = None
if parity:
if paritySize > 8:
@@ -1363,8 +1363,8 @@ class Program:
def getTemp(self, size):
if size in self.temp:
return ('', self.temp[size])
- self.temp[size] = 'tmp{sz}'.format(sz=size);
- return ('\n\tuint{sz}_t tmp{sz};'.format(sz=size), self.temp[size])
+ self.temp[size] = 'gen_tmp{sz}__'.format(sz=size);
+ return ('\n\tuint{sz}_t gen_tmp{sz}__;'.format(sz=size), self.temp[size])
def resolveParam(self, param, parent, fieldVals, allowConstant=True, isdst=False):
keepGoing = True