From 4ebab07d470e517dbbea500af53f95f6df736100 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 27 Feb 2024 20:40:20 +0000 Subject: [PATCH] Manually copy the value when you set up hblank --- agb/src/dma.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agb/src/dma.rs b/agb/src/dma.rs index f57008e8..53de7f04 100644 --- a/agb/src/dma.rs +++ b/agb/src/dma.rs @@ -73,9 +73,11 @@ impl Dma { let n_transfers = (size_of::() / 2) as u32; - self.source_addr.set(handle.data.as_ptr() as u32); + self.source_addr.set(handle.data.as_ptr().add(1) as u32); self.dest_addr.set(location.memory_location as u32); + location.memory_location.write_volatile(values[0]); + self.ctrl_addr.set( (0b10 << 0x15) | // keep destination address fixed // (0b00 << 0x17) | // increment the source address each time