|
From: kosmirror <kos...@us...> - 2025-07-28 15:41:14
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 23c46e9ff097e8ffea3a295a5a315ce829e00d6c (commit)
from 72134b522ff7e43c4fa2b6dfccae0c342290656e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 23c46e9ff097e8ffea3a295a5a315ce829e00d6c
Author: QuzarDC <qu...@co...>
Date: Sat Jul 26 01:01:59 2025 -0400
dmac: Restrict dma_init back to NAOMI.
Reverts the behavior change from #983 that had
KOS performing the same initialization steps on
DC as NAOMI. This was breaking PVR dma as seen
via the dma speedtest example.
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/dmac.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/kernel/arch/dreamcast/hardware/dmac.c b/kernel/arch/dreamcast/hardware/dmac.c
index 3cde8d4a..13c47164 100644
--- a/kernel/arch/dreamcast/hardware/dmac.c
+++ b/kernel/arch/dreamcast/hardware/dmac.c
@@ -10,6 +10,7 @@
#include <arch/memory.h>
#include <kos/dbglog.h>
#include <kos/genwait.h>
+#include <kos/platform.h>
#include <kos/regfield.h>
#include <errno.h>
@@ -192,17 +193,19 @@ void dma_init(void) {
/* Set default settings for DMA #2.
* These are set by the bios on Dreamcast, but should be set by the OS
* on Naomi. */
- uint32_t chcr, dmaor;
+ if(KOS_PLATFORM_IS_NAOMI) {
+ uint32_t chcr, dmaor;
- dmac_write(2, DMA_REG_SAR, 0);
+ dmac_write(2, DMA_REG_SAR, 0);
- chcr = FIELD_PREP(REG_CHCR_SRC_ADDRMODE, DMA_ADDRMODE_INCREMENT)
- | FIELD_PREP(REG_CHCR_REQUEST, DMA_REQUEST_EXTERNAL_MEM_TO_DEV)
- | FIELD_PREP(REG_CHCR_DMAC_EN, 1);
- dmac_write(2, DMA_REG_CHCR, chcr);
+ chcr = FIELD_PREP(REG_CHCR_SRC_ADDRMODE, DMA_ADDRMODE_INCREMENT)
+ | FIELD_PREP(REG_CHCR_REQUEST, DMA_REQUEST_EXTERNAL_MEM_TO_DEV)
+ | FIELD_PREP(REG_CHCR_DMAC_EN, 1);
+ dmac_write(2, DMA_REG_CHCR, chcr);
- dmaor = REG_DMAOR_DDT
- | FIELD_PREP(REG_DMAOR_PR, DMAOR_PR_CH2013)
- | REG_DMAOR_DME;
- dmac_write(0, DMA_REG_DMAOR, dmaor);
+ dmaor = REG_DMAOR_DDT
+ | FIELD_PREP(REG_DMAOR_PR, DMAOR_PR_CH2013)
+ | REG_DMAOR_DME;
+ dmac_write(0, DMA_REG_DMAOR, dmaor);
+ }
}
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|