clear pipeline in block data transfer when writing to pc

This commit is contained in:
Matthew Berry 2020-10-23 00:03:24 -07:00
parent 476bb6afd4
commit 94a063adc3

View file

@ -15,6 +15,7 @@ module ARM
if bit?(list, idx)
address &+= add ? 4 : -4 if pre_index
@r[idx] = @gba.bus.read_word(address)
clear_pipeline if idx == 15
address &+= add ? 4 : -4 unless pre_index
end
end
@ -28,7 +29,9 @@ module ARM
end
end
@r[rn] = address if write_back
# todo reset pipeline if r15 is written (this needs to be done in all other instrs that write to r15 as well)
if write_back
@r[rn] = address
clear_pipeline if rn == 15 # do this for all other instrs that write to r15
end
end
end