Closed harbaum closed 8 years ago
The instruction bfset mem{1:32}
writes 32 bits 0x7fffffff and then 8 bits of a fifth byte with 0xff while it should be writing 0x80 (only the last missing bit from the first 32 bit write).
The problem is in m68k_in.c at:
mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); ... if((width + offset) > 32) { mask_byte = MASK_OUT_ABOVE_8(mask_base); ... m68ki_write_8((mc68kcpu), ea+4, data_byte | mask_byte); }
The mask_byte imho needs to be generated like this: mask_byte = MASK_OUT_ABOVE_8(mask_base) << (8-offset);
This fix is not tested as i am actually not working on Musashi but instead tried to use Musashi to verify another core.
Fixed in mess
The instruction bfset mem{1:32}
writes 32 bits 0x7fffffff and then 8 bits of a fifth byte with 0xff while it should be writing 0x80 (only the last missing bit from the first 32 bit write).
The problem is in m68k_in.c at:
The mask_byte imho needs to be generated like this: mask_byte = MASK_OUT_ABOVE_8(mask_base) << (8-offset);
This fix is not tested as i am actually not working on Musashi but instead tried to use Musashi to verify another core.