aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxspu
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2022-11-17 22:20:38 +0100
committerspicyjpeg <thatspicyjpeg@gmail.com>2022-11-17 22:20:38 +0100
commitfc021dc6d6f06f8eff7edc72929faddd1e1f0d1b (patch)
treec088d292c6cc974854c2e7d3a4024c4951ef3602 /libpsn00b/psxspu
parent85d765f30595fe7f27c1b065c5a1934c3d389cef (diff)
downloadpsn00bsdk-fc021dc6d6f06f8eff7edc72929faddd1e1f0d1b.tar.gz
Refactor libpsxcd, add new CD-ROM APIs, fix SPU DMA read
Diffstat (limited to 'libpsn00b/psxspu')
-rw-r--r--libpsn00b/psxspu/common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpsn00b/psxspu/common.c b/libpsn00b/psxspu/common.c
index a340af6..5dae473 100644
--- a/libpsn00b/psxspu/common.c
+++ b/libpsn00b/psxspu/common.c
@@ -44,6 +44,11 @@ static size_t _dma_transfer(uint32_t *data, size_t length, int write) {
length += DMA_CHUNK_LENGTH - 1;
}
+ // Increase bus delay for DMA reads
+ SPU_DELAY_SIZE &= 0xf0ffffff;
+ if (!write)
+ SPU_DELAY_SIZE = 2 << 24;
+
SPU_CTRL &= 0xffcf; // Disable DMA request
_wait_status(0x0030, 0x0000);
@@ -102,6 +107,8 @@ static size_t _manual_write(const uint16_t *data, size_t length) {
/* Public API */
void SpuInit(void) {
+ SPU_DELAY_SIZE = 0x200931e1;
+
SPU_CTRL = 0x0000; // SPU disabled
_wait_status(0x001f, 0x0000);