From 29f2a7862ad95616058a50c9e9910b709b41d619 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 9 Jan 2008 06:35:07 +0000 Subject: [PATCH] Wow. I can't believe I got away for months without saving RBP. Should fix linux crashes with 64-bit DRC. --- src/emu/cpu/x64drc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emu/cpu/x64drc.c b/src/emu/cpu/x64drc.c index 88cb07eb40c..f9f88451b67 100644 --- a/src/emu/cpu/x64drc.c +++ b/src/emu/cpu/x64drc.c @@ -521,9 +521,10 @@ void drc_append_restore_sse_rounding(drc_core *drc) static void append_entry_point(drc_core *drc) { - int pushbytes = 8 * (5 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE)); + int pushbytes = 8 * (6 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE)); /* save non-volatile registers */ + emit_push_r64(DRCTOP, REG_DRC); // push drc emit_push_r64(DRCTOP, REG_NV0); // push nv0 emit_push_r64(DRCTOP, REG_NV1); // push nv1 emit_push_r64(DRCTOP, REG_NV2); // push nv2 @@ -561,7 +562,7 @@ static void append_entry_point(drc_core *drc) static void append_exit_point(drc_core *drc) { - int pushbytes = 8 * (5 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE)); + int pushbytes = 8 * (6 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE)); /* on exit, P1 must contain the final PC */ emit_mov_m32_r32(DRCTOP, MDRC(drc->pcptr), REG_P1); // mov [pc],p1 @@ -580,6 +581,7 @@ static void append_exit_point(drc_core *drc) emit_pop_r64(DRCTOP, REG_NV2); // pop nv2 emit_pop_r64(DRCTOP, REG_NV1); // pop nv1 emit_pop_r64(DRCTOP, REG_NV0); // pop nv0 + emit_pop_r64(DRCTOP, REG_DRC); // pop drc emit_ret(DRCTOP); // ret }