Mercurial > repos > blastem
changeset 1770:a81db00e171a mame_interp
Fix a couple bugs in the integration of Musashi
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 12 Mar 2019 21:57:13 -0700 |
parents | 8fe162bdb038 |
children | e59045f781ce |
files | musashi/m68kcpu.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/musashi/m68kcpu.c Fri Mar 01 14:17:29 2019 -0800 +++ b/musashi/m68kcpu.c Tue Mar 12 21:57:13 2019 -0700 @@ -686,7 +686,7 @@ /* Record previous program counter */ REG_PPC(this) = REG_PC(this); - + printf("M68K: %X @ %d\n", this->pc, this->c.current_cycle); this->run_mode = RUN_MODE_NORMAL; /* Read an instruction and call its handler */ @@ -786,8 +786,8 @@ { address &= 0xFFFFFF; uint32_t base = address >> 16; - if (m68k->read_pointers[base]) { - uint8_t *chunk = m68k->read_pointers[base]; + if (m68k->write_pointers[base]) { + uint8_t *chunk = m68k->write_pointers[base]; chunk[(address ^ 1) & 0xFFFF] = value; return; } @@ -864,7 +864,7 @@ this->read_pointers[address >> 16] = NULL; this->write_pointers[address >> 16] = NULL; memmap_chunk const *chunk = find_map_chunk(address, &this->c.options->gen, 0, NULL); - if (!chunk || chunk->end < (address + 64*1024) || (chunk->flags & (MMAP_ONLY_ODD | MMAP_ONLY_EVEN | MMAP_PTR_IDX)) || !chunk->buffer) { + if (!chunk || chunk->end < (address + 64*1024) || (chunk->flags & (MMAP_ONLY_ODD | MMAP_ONLY_EVEN)) || !chunk->buffer) { continue; } void *ptr = get_native_pointer(address, (void **)this->c.mem_pointers, &this->c.options->gen);