comparison m68k_core.c @ 989:d70000fdff0b

Implemented IR and undefined bits of info word for address error exception frames
author Michael Pavone <pavone@retrodev.com>
date Wed, 27 Apr 2016 21:39:17 -0700
parents ce9df7a5fdf2
children 33a46d35b913
comparison
equal deleted inserted replaced
988:ce9df7a5fdf2 989:d70000fdff0b
698 m68k_options * opts = context->options; 698 m68k_options * opts = context->options;
699 process_deferred(&opts->gen.deferred, context, (native_addr_func)get_native_from_context); 699 process_deferred(&opts->gen.deferred, context, (native_addr_func)get_native_from_context);
700 if (opts->gen.deferred) { 700 if (opts->gen.deferred) {
701 translate_m68k_stream(opts->gen.deferred->address, context); 701 translate_m68k_stream(opts->gen.deferred->address, context);
702 } 702 }
703 }
704
705 uint16_t m68k_get_ir(m68k_context *context)
706 {
707 uint32_t inst_addr = get_instruction_start(context->options, context->native_code_map, context->last_prefetch_address-2);
708 uint16_t *native_addr = get_native_pointer(inst_addr, (void **)context->mem_pointers, &context->options->gen);
709 if (native_addr) {
710 return *native_addr;
711 }
712 fprintf(stderr, "M68K: Failed to calculate value of IR. Last prefetch address: %X\n", context->last_prefetch_address);
713 return 0xFFFF;
703 } 714 }
704 715
705 typedef enum { 716 typedef enum {
706 RAW_FUNC = 1, 717 RAW_FUNC = 1,
707 BINARY_ARITH, 718 BINARY_ARITH,
824 check_cycles_int(&opts->gen, inst->address); 835 check_cycles_int(&opts->gen, inst->address);
825 //log_address(&opts->gen, inst->address, "M68K: %X @ %d\n"); 836 //log_address(&opts->gen, inst->address, "M68K: %X @ %d\n");
826 if ( 837 if (
827 (inst->src.addr_mode > MODE_AREG && inst->src.addr_mode < MODE_IMMEDIATE) 838 (inst->src.addr_mode > MODE_AREG && inst->src.addr_mode < MODE_IMMEDIATE)
828 || (inst->dst.addr_mode > MODE_AREG && inst->dst.addr_mode < MODE_IMMEDIATE) 839 || (inst->dst.addr_mode > MODE_AREG && inst->dst.addr_mode < MODE_IMMEDIATE)
840 || (inst->op == M68K_BCC && (inst->src.params.immed & 1))
829 ) { 841 ) {
830 //Not accurate for all cases, but probably good enough for now 842 //Not accurate for all cases, but probably good enough for now
831 m68k_set_last_prefetch(opts, inst->address + inst->bytes); 843 m68k_set_last_prefetch(opts, inst->address + inst->bytes);
832 } 844 }
833 impl_info * info = m68k_impls + inst->op; 845 impl_info * info = m68k_impls + inst->op;