From 529c9752c4d3c79856faf2f8e7b049f98c04cb81 Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Mon, 1 Jun 2020 01:26:38 +0300 Subject: [PATCH] fix: Ignore top 4 bits of DMA addresses Former-commit-id: 3a5e691ca617803ef61f7a534c70d1cf04f36cb9 Former-commit-id: 289fad7340cbb18c51ecccd43e44682b37c78a1a --- core/src/dma.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/dma.rs b/core/src/dma.rs index 2e29ac4..4e61ed7 100644 --- a/core/src/dma.rs +++ b/core/src/dma.rs @@ -66,7 +66,7 @@ impl DmaChannel { pub fn write_src_high(&mut self, high: u16) { let src = self.src; - let high = high as u32; + let high = (high & 0xfff) as u32; self.src = (src & 0xffff) | (high << 16); } @@ -77,7 +77,7 @@ impl DmaChannel { pub fn write_dst_high(&mut self, high: u16) { let dst = self.dst; - let high = high as u32; + let high = (high & 0xfff) as u32; self.dst = (dst & 0xffff) | (high << 16); }