comparison z80_to_x86.c @ 644:2d7e84ae818c

Temporarily comment out code to translate Z80 instructions in place as in rare cases it can stomp the next instruction if a branch goes from a short from to a long one
author Michael Pavone <pavone@retrodev.com>
date Wed, 03 Dec 2014 09:30:01 -0800
parents 041578693329
children 103d5cabbe14
comparison
equal deleted inserted replaced
643:da52f7b72156 644:2d7e84ae818c
1869 opts->code_end = dst_end = dst + size; 1869 opts->code_end = dst_end = dst + size;
1870 opts->cur_code = dst; 1870 opts->cur_code = dst;
1871 } 1871 }
1872 deferred_addr * orig_deferred = opts->deferred; 1872 deferred_addr * orig_deferred = opts->deferred;
1873 uint8_t * native_end = translate_z80inst(&instbuf, dst, context, address, 0); 1873 uint8_t * native_end = translate_z80inst(&instbuf, dst, context, address, 0);
1874 /*
1874 if ((native_end - dst) <= orig_size) { 1875 if ((native_end - dst) <= orig_size) {
1875 uint8_t * native_next = z80_get_native_address(context, address + after-inst); 1876 uint8_t * native_next = z80_get_native_address(context, address + after-inst);
1876 if (native_next && ((native_next == orig_start + orig_size) || (orig_size - (native_end - dst)) > 5)) { 1877 if (native_next && ((native_next == orig_start + orig_size) || (orig_size - (native_end - dst)) > 5)) {
1877 remove_deferred_until(&opts->deferred, orig_deferred); 1878 remove_deferred_until(&opts->deferred, orig_deferred);
1878 native_end = translate_z80inst(&instbuf, orig_start, context, address, 0); 1879 native_end = translate_z80inst(&instbuf, orig_start, context, address, 0);
1885 } 1886 }
1886 z80_handle_deferred(context); 1887 z80_handle_deferred(context);
1887 return orig_start; 1888 return orig_start;
1888 } 1889 }
1889 } 1890 }
1891 */
1890 z80_map_native_address(context, address, dst, after-inst, ZMAX_NATIVE_SIZE); 1892 z80_map_native_address(context, address, dst, after-inst, ZMAX_NATIVE_SIZE);
1891 opts->cur_code = dst+ZMAX_NATIVE_SIZE; 1893 opts->cur_code = dst+ZMAX_NATIVE_SIZE;
1892 jmp(orig_start, dst); 1894 jmp(orig_start, dst);
1893 if (!z80_is_terminal(&instbuf)) { 1895 if (!z80_is_terminal(&instbuf)) {
1894 jmp(native_end, z80_get_native_address_trans(context, address + after-inst)); 1896 jmp(native_end, z80_get_native_address_trans(context, address + after-inst));