Mercurial > repos > blastem
diff m68k_core_x86.c @ 1274:779920729249
Forgot to update flags in the "good" case of the new divu code
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 09 Mar 2017 21:31:31 -0800 |
parents | 462d9770d467 |
children | 2d8b9d40f5ea |
line wrap: on
line diff
--- a/m68k_core_x86.c Thu Mar 09 19:23:24 2017 -0800 +++ b/m68k_core_x86.c Thu Mar 09 21:31:31 2017 -0800 @@ -1783,15 +1783,17 @@ //TODO: inline the functionality of divu so we don't need to dump context to memory call_args(code, (code_ptr)divu, 3, opts->gen.scratch2, opts->gen.context_reg, opts->gen.scratch1); pop_r(code, opts->gen.context_reg); - if (dst_op->mode == MODE_REG_DIRECT) { - mov_rr(code, RAX, opts->gen.scratch1, SZ_D); - } else { - mov_rrdisp(code, RAX, dst_op->base, dst_op->disp, SZ_D); - } + mov_rr(code, RAX, opts->gen.scratch1, SZ_D); + call(code, opts->gen.load_context); + cmp_ir(code, 0, opts->gen.scratch1, SZ_W); + update_flags(opts, V0|Z|N); + if (dst_op->mode == MODE_REG_DIRECT) { mov_rr(code, opts->gen.scratch1, dst_op->base, SZ_D); + } else { + mov_rrdisp(code, RAX, dst_op->base, dst_op->disp, SZ_D); } *end = code->cur - (end + 1);