diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-01-14 09:38:54 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-01-14 09:38:54 -0800 |
commit | f439d8688758710b74d4909e77ebce6444b8a448 (patch) | |
tree | 6d000eba25209ae902c5360402b15118c79559ad /m68k_core_x86.c | |
parent | d42234e4af41481a3db6f6ea5173bb1623b30d22 (diff) |
Removed hardcoded assumptions in M68K core about which parts of the memory map are RAM
Diffstat (limited to 'm68k_core_x86.c')
-rw-r--r-- | m68k_core_x86.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/m68k_core_x86.c b/m68k_core_x86.c index 9787b9c..167c740 100644 --- a/m68k_core_x86.c +++ b/m68k_core_x86.c @@ -2202,8 +2202,10 @@ void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chu opts->gen.native_code_map = malloc(sizeof(native_map_slot) * NATIVE_MAP_CHUNKS); memset(opts->gen.native_code_map, 0, sizeof(native_map_slot) * NATIVE_MAP_CHUNKS); opts->gen.deferred = NULL; - opts->gen.ram_inst_sizes = malloc(sizeof(uint8_t *) * 64); - memset(opts->gen.ram_inst_sizes, 0, sizeof(uint8_t *) * 64); + + uint32_t inst_size_size = sizeof(uint8_t *) * ram_size(&opts->gen) / 1024; + opts->gen.ram_inst_sizes = malloc(inst_size_size); + memset(opts->gen.ram_inst_sizes, 0, inst_size_size); code_info *code = &opts->gen.code; init_code_info(code); @@ -2227,9 +2229,11 @@ void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chu opts->gen.load_context = code->cur; for (int i = 0; i < 5; i++) + { if (opts->flag_regs[i] >= 0) { mov_rdispr(code, opts->gen.context_reg, offsetof(m68k_context, flags) + i, opts->flag_regs[i], SZ_B); } + } for (int i = 0; i < 8; i++) { if (opts->dregs[i] >= 0) { |