From 7184517bf8e6bfdebfac2859895ffbf3312b8a37 Mon Sep 17 00:00:00 2001 From: Jaby Date: Wed, 6 Mar 2024 18:31:43 -0600 Subject: [PATCH] Turn only SPU GPU and CD DMA on and set to highest --- .../internal-include/BootLoader/boot_loader.hpp | 4 ++++ src/Library/src/BootLoader/dma_boot.cpp | 13 +++++++++++++ src/Library/src/BootLoader/start_boot.cpp | 9 ++------- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 src/Library/src/BootLoader/dma_boot.cpp diff --git a/src/Library/internal-include/BootLoader/boot_loader.hpp b/src/Library/internal-include/BootLoader/boot_loader.hpp index 47816578..829e38d2 100644 --- a/src/Library/internal-include/BootLoader/boot_loader.hpp +++ b/src/Library/internal-include/BootLoader/boot_loader.hpp @@ -8,6 +8,10 @@ namespace JabyEngine { void setup(); } + namespace DMA { + void setup(); + } + namespace GPU { void display_logo(); void setup(); diff --git a/src/Library/src/BootLoader/dma_boot.cpp b/src/Library/src/BootLoader/dma_boot.cpp new file mode 100644 index 00000000..9f0f0029 --- /dev/null +++ b/src/Library/src/BootLoader/dma_boot.cpp @@ -0,0 +1,13 @@ +#include + +namespace JabyEngine { + namespace boot { + namespace DMA { + void setup() { + static constexpr auto EnableDMA = DMA_IO::DPCR::from(DMA_IO::DPCR::SPUEnable, DMA_IO::DPCR::GPUEnable, DMA_IO::DPCR::CDROMEnable); + + DMA_IO::DPCR.write(EnableDMA); + } + } + } +} \ No newline at end of file diff --git a/src/Library/src/BootLoader/start_boot.cpp b/src/Library/src/BootLoader/start_boot.cpp index 266e1ce0..ac878bdc 100644 --- a/src/Library/src/BootLoader/start_boot.cpp +++ b/src/Library/src/BootLoader/start_boot.cpp @@ -1,6 +1,5 @@ #include "../../internal-include/BootLoader/boot_loader.hpp" #include "../../internal-include/GPU/gpu_internal.hpp" -#include #include #include @@ -102,18 +101,14 @@ namespace JabyEngine { } namespace boot { - namespace Start { - static void enable_DMA() { - DMA_IO::DPCR.write(DMA_IO::DPCR.read().set(DMA_IO::DPCR::SPUEnable, DMA_IO::DPCR::GPUEnable, DMA_IO::DPCR::CDROMEnable)); - } - + namespace Start { static void setup() { static constexpr auto DebugX = 1; static constexpr auto DebugY = 0; static constexpr auto DebugScale = 1.0; __debug_boot_color_at(::JabyEngine::GPU::Color24::Grey(), DebugX, DebugY, DebugScale); - enable_DMA(); + DMA::setup(); __debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale); Periphery::setup();