comparison backend_x86.c @ 692:e11e68918691

Fix bug in map_native_address that was breaking some self-modifying code in Gunstar Heroes
author Michael Pavone <pavone@retrodev.com>
date Tue, 28 Apr 2015 19:04:36 -0700
parents fc04781f4d28
children 7f96bd1cb1be
comparison
equal deleted inserted replaced
691:74d636e85bf8 692:e11e68918691
173 } 173 }
174 if (is_write && (memmap[chunk].flags & MMAP_CODE)) { 174 if (is_write && (memmap[chunk].flags & MMAP_CODE)) {
175 mov_rr(code, opts->scratch2, opts->scratch1, opts->address_size); 175 mov_rr(code, opts->scratch2, opts->scratch1, opts->address_size);
176 shr_ir(code, opts->ram_flags_shift, opts->scratch1, opts->address_size); 176 shr_ir(code, opts->ram_flags_shift, opts->scratch1, opts->address_size);
177 bt_rrdisp(code, opts->scratch1, opts->context_reg, ram_flags_off, opts->address_size); 177 bt_rrdisp(code, opts->scratch1, opts->context_reg, ram_flags_off, opts->address_size);
178 //FIXME: These adjustments to ram_flags_off need to take into account bits vs bytes and ram_flags_shift
178 if (memmap[chunk].mask == opts->address_mask) { 179 if (memmap[chunk].mask == opts->address_mask) {
179 ram_flags_off += memmap[chunk].end - memmap[chunk].start; 180 ram_flags_off += memmap[chunk].end - memmap[chunk].start;
180 } else { 181 } else {
181 ram_flags_off += memmap[chunk].mask + 1; 182 ram_flags_off += memmap[chunk].mask + 1;
182 } 183 }