Prepare setup of CD drive

This commit is contained in:
2023-01-22 11:02:27 +01:00
parent 5a23249032
commit 2250be6df9
4 changed files with 52 additions and 4 deletions

View File

@@ -1,13 +1,26 @@
#include "../../include/BootLoader/boot_loader.hpp"
#include <PSX/System/IOPorts/cd_io.hpp>
#include <PSX/System/IOPorts/interrupt_io.hpp>
#include <PSX/System/IOPorts/memory_io.hpp>
#include <PSX/System/syscalls.h>
namespace JabyEngine {
namespace boot {
namespace CD {
void setup() {
CD_IO::PortIndex0::change_to();
CD_IO::PortIndex0::DataFifo.read();
CD_IO::PortIndex0::DataFifo16.read();
__syscall_EnterCriticalSection();
Memory_IO::COM_DELAY.write(Memory_IO::COM_DELAY::SetupValue);
Memory_IO::CD_DELAY.write(Memory_IO::CD_DELAY::SetupValue);
//Equeue Callback?
CD_IO::PortIndex1::change_to();
CD_IO::Interrupt::ack_extended(CD_IO::PortIndex1::InterruptFlagRegister);
CD_IO::Interrupt::enable(CD_IO::PortIndex1::InterruptEnableRegister);
Interrupt::ack_irq(Interrupt::CDROM);
Interrupt::enable_irq(Interrupt::CDROM);
__syscall_ExitCriticalSection();
}
}
}

View File

@@ -15,6 +15,8 @@ namespace JabyEngine {
enable_DMA();
SPU::stop_voices();
CD::setup();
Timer::setup();
const auto start = HighResTime::get_time_stamp();