core: arm7tdmi: Force address alignment in memory accesses

Fixes #148


Former-commit-id: 36f33c599cd9a3c51115bf20037bfdce9f581912
Former-commit-id: 24130ddb51ae3dff2c576289b74a8cbd7519593f
This commit is contained in:
Michel Heily 2020-10-23 01:31:58 +03:00
parent aeecd98757
commit 40e306349c

View file

@ -88,12 +88,12 @@ impl<I: MemoryInterface> MemoryInterface for Core<I> {
#[inline]
fn load_16(&mut self, addr: u32, access: MemoryAccess) -> u16 {
self.bus.load_16(addr, access)
self.bus.load_16(addr & !1, access)
}
#[inline]
fn load_32(&mut self, addr: u32, access: MemoryAccess) -> u32 {
self.bus.load_32(addr, access)
self.bus.load_32(addr & !3, access)
}
#[inline]
@ -102,12 +102,12 @@ impl<I: MemoryInterface> MemoryInterface for Core<I> {
}
#[inline]
fn store_16(&mut self, addr: u32, value: u16, access: MemoryAccess) {
self.bus.store_16(addr, value, access);
self.bus.store_16(addr & !1, value, access);
}
#[inline]
fn store_32(&mut self, addr: u32, value: u32, access: MemoryAccess) {
self.bus.store_32(addr, value, access);
self.bus.store_32(addr & !3, value, access);
}
#[inline]