Skip to content

Commit b272296

Browse files
GhostlyDarkmpharoah
authored andcommitted
Fixed contents of DMA related registers after a DMA completes
Co-Authored-By: Matt Pharoah <mtpharoah@gmail.com>
1 parent d6a2668 commit b272296

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/device/rcp/rsp/rsp_core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static void do_sp_dma(struct rsp_core* sp, const struct sp_dma* dma)
6464
post_framebuffer_write(&sp->dp->fb, dramaddr - length, length);
6565
dramaddr+=skip;
6666
}
67+
68+
sp->regs[SP_MEM_ADDR_REG] = memaddr & 0xfff;
69+
sp->regs[SP_DRAM_ADDR_REG] = dramaddr & 0xffffff;
70+
sp->regs[SP_RD_LEN_REG] = 0xff8;
6771
}
6872
else
6973
{
@@ -77,6 +81,10 @@ static void do_sp_dma(struct rsp_core* sp, const struct sp_dma* dma)
7781
}
7882
dramaddr+=skip;
7983
}
84+
85+
sp->regs[SP_MEM_ADDR_REG] = memaddr & 0xfff;
86+
sp->regs[SP_DRAM_ADDR_REG] = dramaddr & 0xffffff;
87+
sp->regs[SP_RD_LEN_REG] = 0xff8;
8088
}
8189

8290
/* schedule end of dma event */
@@ -224,6 +232,8 @@ void poweron_rsp(struct rsp_core* sp)
224232
sp->rsp_task_locked = 0;
225233
sp->mi->r4300->cp0.interrupt_unsafe_state &= ~INTR_UNSAFE_RSP;
226234
sp->regs[SP_STATUS_REG] = 1;
235+
sp->regs[SP_RD_LEN_REG] = 0xff8;
236+
sp->regs[SP_WR_LEN_REG] = 0xff8;
227237
}
228238

229239

0 commit comments

Comments
 (0)