fix: improper lifetime for *Arm7tdmi ptr in Bus

*Arm7tdmi ptr is now assigned one scope up so that it lives as least
as long as Bus does
This commit is contained in:
2022-10-21 05:12:37 -03:00
parent f074b703b3
commit c7f537959b
3 changed files with 7 additions and 3 deletions

View File

@@ -60,6 +60,10 @@ pub fn deinit(self: Self) void {
self.ppu.deinit();
}
pub fn attach(self: *Self, cpu: *Arm7tdmi) void {
self.cpu = cpu;
}
pub fn handleDMATransfers(self: *Self) void {
while (self.isDmaRunning()) {
if (self.dma._1.step(self)) continue;