comparison m68k_core_x86.c @ 653:a18e3923481e

Remove some of the hard coded assumptions about the memory map from the CPU cores
author Michael Pavone <pavone@retrodev.com>
date Thu, 01 Jan 2015 14:36:55 -0800
parents 9d6fed6501ba
children 98927f1b005b
comparison
equal deleted inserted replaced
652:f822d9216968 653:a18e3923481e
1462 //V flag is set based on the result of the addition of the 1462 //V flag is set based on the result of the addition of the
1463 //result and the correction factor 1463 //result and the correction factor
1464 set_flag_cond(opts, CC_O, FLAG_V); 1464 set_flag_cond(opts, CC_O, FLAG_V);
1465 *no_adjust = code->cur - (no_adjust+1); 1465 *no_adjust = code->cur - (no_adjust+1);
1466 flag_to_flag(opts, FLAG_C, FLAG_X); 1466 flag_to_flag(opts, FLAG_C, FLAG_X);
1467 1467
1468 cmp_ir(code, 0, opts->gen.scratch1, SZ_B); 1468 cmp_ir(code, 0, opts->gen.scratch1, SZ_B);
1469 set_flag_cond(opts, CC_S, FLAG_N); 1469 set_flag_cond(opts, CC_S, FLAG_N);
1470 jcc(code, CC_Z, code->cur + 4); 1470 jcc(code, CC_Z, code->cur + 4);
1471 set_flag(opts, 0, FLAG_Z); 1471 set_flag(opts, 0, FLAG_Z);
1472 if (dst_op->base != opts->gen.scratch1) { 1472 if (dst_op->base != opts->gen.scratch1) {
1662 case MODE_AREG_DISPLACE: 1662 case MODE_AREG_DISPLACE:
1663 case MODE_AREG_INDEX_DISP8: 1663 case MODE_AREG_INDEX_DISP8:
1664 case MODE_ABSOLUTE_SHORT: 1664 case MODE_ABSOLUTE_SHORT:
1665 case MODE_PC_INDEX_DISP8: 1665 case MODE_PC_INDEX_DISP8:
1666 case MODE_IMMEDIATE: 1666 case MODE_IMMEDIATE:
1667 isize = 4; 1667 isize = 4;
1668 break; 1668 break;
1669 case MODE_ABSOLUTE: 1669 case MODE_ABSOLUTE:
1670 isize = 6; 1670 isize = 6;
1671 break; 1671 break;
1672 } 1672 }
2228 } 2228 }
2229 2229
2230 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks) 2230 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks)
2231 { 2231 {
2232 memset(opts, 0, sizeof(*opts)); 2232 memset(opts, 0, sizeof(*opts));
2233 opts->gen.memmap = memmap;
2234 opts->gen.memmap_chunks = num_chunks;
2233 opts->gen.address_size = SZ_D; 2235 opts->gen.address_size = SZ_D;
2234 opts->gen.address_mask = 0xFFFFFF; 2236 opts->gen.address_mask = 0xFFFFFF;
2235 opts->gen.byte_swap = 1; 2237 opts->gen.byte_swap = 1;
2236 opts->gen.max_address = 0x1000000; 2238 opts->gen.max_address = 0x1000000;
2237 opts->gen.bus_cycles = BUS; 2239 opts->gen.bus_cycles = BUS;