Fix gba-suite arm test #530

Fixes edge-case in STMDA with empty rlist


Former-commit-id: 5f43fa19e0faad7d27d022480d856ab0c52f1d56
Former-commit-id: 8e2392e1dd34fb161aa1b2c3445272f06f432316
This commit is contained in:
Michel Heily 2020-05-15 16:23:42 +03:00 committed by MishMish
parent 4e6735bb5c
commit 9bb39fe135

View file

@ -626,9 +626,20 @@ impl Core {
self.reload_pipeline32(sb); self.reload_pipeline32(sb);
result = CpuAction::FlushPipeline; result = CpuAction::FlushPipeline;
} else { } else {
// block data store with empty rlist
let addr = match (ascending, full) {
(false, false) => addr.wrapping_sub(0x3c),
(false, true) => addr.wrapping_sub(0x40),
(true, false) => addr,
(true, true) => addr.wrapping_add(4),
};
self.write_32(addr, self.pc + 4, sb); self.write_32(addr, self.pc + 4, sb);
} }
addr = addr.wrapping_add(0x40); addr = if ascending {
addr.wrapping_add(0x40)
} else {
addr.wrapping_sub(0x40)
};
} }
if user_bank_transfer { if user_bank_transfer {