summaryrefslogtreecommitdiff
path: root/z80_to_x86.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-11-25 08:40:45 -0800
committerMichael Pavone <pavone@retrodev.com>2015-11-25 08:40:45 -0800
commit77f239c97ce5d496998c3b8a07d84d27b5d5984f (patch)
treeb9e7951e055fa80a7afc925bec7d72193cead1f6 /z80_to_x86.c
parent621afa83ca859c29efcf57beef5b21c918161e78 (diff)
Partially working change to do proper stack alignment rather than doing a lame alignment check when calling a C compile dfunction. 68K core seems okay, but Z80 is busted.
Diffstat (limited to 'z80_to_x86.c')
-rw-r--r--z80_to_x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/z80_to_x86.c b/z80_to_x86.c
index a114da3..4dacbba 100644
--- a/z80_to_x86.c
+++ b/z80_to_x86.c
@@ -2695,6 +2695,7 @@ void zcreate_stub(z80_context * context)
{
z80_options * opts = context->options;
code_info *code = &opts->gen.code;
+ uint32_t start_stack_off = code->stack_off;
check_code_prologue(code);
context->bp_stub = code->cur;
@@ -2727,6 +2728,7 @@ void zcreate_stub(z80_context * context)
pop_r(code, opts->gen.scratch1);
add_ir(code, check_int_size - patch_size, opts->gen.scratch1, SZ_PTR);
jmp_r(code, opts->gen.scratch1);
+ code->stack_off = start_stack_off;
}
void zinsert_breakpoint(z80_context * context, uint16_t address, uint8_t * bp_handler)