Mercurial > repos > blastem
diff z80_to_x86.c @ 894:a7774fc2de4b
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.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 25 Nov 2015 08:40:45 -0800 |
parents | 252dfd29831d |
children | 13388ab6d78a |
line wrap: on
line diff
--- a/z80_to_x86.c Sun Nov 22 14:43:51 2015 -0800 +++ b/z80_to_x86.c Wed Nov 25 08:40:45 2015 -0800 @@ -2695,6 +2695,7 @@ { 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 @@ 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)