From 77f239c97ce5d496998c3b8a07d84d27b5d5984f Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 25 Nov 2015 08:40:45 -0800 Subject: 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. --- z80_to_x86.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'z80_to_x86.c') 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) -- cgit v1.2.3