diff options
author | Michael Pavone <pavone@retrodev.com> | 2019-02-04 22:20:51 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2019-02-04 22:20:51 -0800 |
commit | d0d4e82bb1bf7c8f61093566dbb2588580fa2860 (patch) | |
tree | b09ded35d4a5bf3060ae9d2f0318ee5b73dfbf4b /cpu_dsl.py | |
parent | e8c201a05d2ce6a8ca693b1b1d1cefe5737c7688 (diff) |
Implement DD/FD prefixes for instructions that don't reference HL
Diffstat (limited to 'cpu_dsl.py')
-rwxr-xr-x | cpu_dsl.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1316,7 +1316,6 @@ class Program: opmap[val] = inst.generateName(val) bodymap[val] = inst.generateBody(val, self, otype) - pieces.append('\ntypedef void (*impl_fun)({pre}context *context);'.format(pre=self.prefix)) pieces.append('\nstatic impl_fun impl_{name}[{sz}] = {{'.format(name = table, sz=len(opmap))) for inst in range(0, len(opmap)): op = opmap[inst] @@ -1335,8 +1334,12 @@ class Program: body.append('#include "{0}"\n'.format(include)) body.append('\nstatic void unimplemented({pre}context *context)'.format(pre = self.prefix)) body.append('\n{') - body.append('\n\tfatal_error("Unimplemented instruction");') + body.append('\n\tfatal_error("Unimplemented instruction\\n");') body.append('\n}\n') + body.append('\ntypedef void (*impl_fun)({pre}context *context);'.format(pre=self.prefix)) + for table in self.extra_tables: + body.append('\nstatic impl_fun impl_{name}[{sz}];'.format(name = table, sz=(1 << self.opsize))) + body.append('\nstatic impl_fun impl_main[{sz}];'.format(sz=(1 << self.opsize))) for table in self.extra_tables: self._buildTable(otype, table, body) self._buildTable(otype, 'main', body) |