mirror of
https://github.com/simple64/simple64.git
synced 2026-11-16 06:53:15 +01:00
update core
This commit is contained in:
1 parent
7175c7d166
commit
34cd4fcdba
2 files changed
+7
-8
No files matched your search
@@ -55,9 +55,11 @@ static void dma_pi_read(struct pi_controller* pi)
|
||||
|
||||
uint32_t cart_addr = pi->regs[PI_CART_ADDR_REG] & ~UINT32_C(1);
|
||||
uint32_t dram_addr = pi->regs[PI_DRAM_ADDR_REG] & 0xfffffe;
|
||||
uint32_t length = (pi->regs[PI_RD_LEN_REG] & UINT32_C(0x00fffffe)) + 2;
|
||||
uint32_t length = (pi->regs[PI_RD_LEN_REG] & UINT32_C(0x00ffffff)) + 1;
|
||||
const uint8_t* dram = (uint8_t*)pi->ri->rdram->dram;
|
||||
|
||||
if ((length & 0x1) && length >= 0x7F)
|
||||
length +=1;
|
||||
if (dram_addr & 0x7)
|
||||
length -= dram_addr & 0x7;
|
||||
|
||||
@@ -93,9 +95,11 @@ static void dma_pi_write(struct pi_controller* pi)
|
||||
|
||||
uint32_t cart_addr = pi->regs[PI_CART_ADDR_REG] & ~UINT32_C(1);
|
||||
uint32_t dram_addr = pi->regs[PI_DRAM_ADDR_REG] & 0xfffffe;
|
||||
uint32_t length = (pi->regs[PI_WR_LEN_REG] & UINT32_C(0x00fffffe)) + 2;
|
||||
uint32_t length = (pi->regs[PI_WR_LEN_REG] & UINT32_C(0x00ffffff)) + 1;
|
||||
uint8_t* dram = (uint8_t*)pi->ri->rdram->dram;
|
||||
|
||||
if ((length & 0x1) && length >= 0x7F)
|
||||
length +=1;
|
||||
if (dram_addr & 0x7)
|
||||
length -= dram_addr & 0x7;
|
||||
|
||||
|
||||
@@ -42,18 +42,13 @@ static void do_sp_dma(struct rsp_core* sp, const struct sp_dma* dma)
|
||||
|
||||
unsigned int l = dma->length;
|
||||
|
||||
unsigned int length = (l & 0xfff) + 1;
|
||||
unsigned int length = ((l & 0xfff) | 7) + 1;
|
||||
unsigned int count = ((l >> 12) & 0xff) + 1;
|
||||
unsigned int skip = ((l >> 20) & 0xfff);
|
||||
length = (length + 0x7) & ~0x7;
|
||||
|
||||
unsigned int memaddr = dma->memaddr & 0xff8;
|
||||
unsigned int dramaddr = dma->dramaddr & 0xfffff8;
|
||||
|
||||
// Check length.
|
||||
if ((memaddr + length) > 0x1000)
|
||||
length = 0x1000 - memaddr;
|
||||
|
||||
unsigned char *spmem = (unsigned char*)sp->mem + (dma->memaddr & 0x1000);
|
||||
unsigned char *dram = (unsigned char*)sp->ri->rdram->dram;
|
||||
|
||||
|
||||
Reference in new issue
Block a user