Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit 948f59dde0 - Show all commits

View File

@ -161,6 +161,10 @@ namespace JabyEngine {
static constexpr auto MasterEnableDPCR = Bit(23);
static constexpr auto EnableDPCR = BitRange::from_to(16, 22);
static constexpr auto ForceIRQ = Bit(15);
static constexpr DICR empty() {
return DICR{0};
}
};
__declare_value_at(, Registers, MDECin, 0x1F801080);

View File

@ -1,12 +1,24 @@
#include <PSX/System/IOPorts/dma_io.hpp>
#include <PSX/System/syscalls.hpp>
#include <PSX/System/IOPorts/interrupt_io.hpp>
#include <stdio.h>
namespace JabyEngine {
namespace boot {
namespace DMA {
// TODO: Do we want all of this? So far it didn't help
void setup() {
static constexpr auto EnableDMA = DMA_IO::DPCR::from(DMA_IO::DPCR::SPU.turn_on(3), DMA_IO::DPCR::GPU.turn_on(3), DMA_IO::DPCR::CDROM.turn_on(3));
DMA_IO::DPCR.write(EnableDMA);
DMA_IO::DICR.write(DMA_IO::DICR::empty());
DMA_IO::DICR.write(DMA_IO::DICR.read());
SysCall::EnterCriticalSection();
Interrupt::disable_irq(Interrupt::DMA);
Interrupt::ack_irq(Interrupt::DMA);
SysCall::ExitCriticalSection();
}
}
}