summaryrefslogtreecommitdiff
path: root/gen.rb
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-06-21 20:13:04 -0400
committerPaul Duncan <pabs@pablotron.org>2018-06-21 20:13:04 -0400
commita41aa781303b1ffb4923c3728f5b0dc7e022add4 (patch)
tree0b166aa1e5f5c64bd693092d5faed4ee69c9f7f2 /gen.rb
parent827be7304a4c40b6465951e55195caab1d666f86 (diff)
downloadgb-c-a41aa781303b1ffb4923c3728f5b0dc7e022add4.tar.bz2
gb-c-a41aa781303b1ffb4923c3728f5b0dc7e022add4.zip
add auto-pc handling, implement pc for ops
Diffstat (limited to 'gen.rb')
-rwxr-xr-xgen.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gen.rb b/gen.rb
index cdf1fec..315be3e 100755
--- a/gen.rb
+++ b/gen.rb
@@ -26,6 +26,13 @@ DATA['ops'].each do |set_id, ops|
op['cat'],
]
else
+ # pc_expr
+ pc_expr = if op['pc']
+ 'cpu_ww(ctx, RW_PC, old_pc + %d);' % [op['len']]
+ else
+ ''
+ end
+
# time expr
time_expr = case op['time']
when Numeric
@@ -41,6 +48,7 @@ DATA['ops'].each do |set_id, ops|
[
"case 0x%s: /* op: \"%s\", cat: \"%s\" */",
" %s", # action_expr
+ " %s", # pc_expr
" %s", # time_expr
" break;"
].join("\n") % [
@@ -48,6 +56,7 @@ DATA['ops'].each do |set_id, ops|
op['id'],
op['cat'],
op['code'] || 'not_implemented(ctx, old_pc, op);',
+ pc_expr,
time_expr,
]
end