43 lines
1.6 KiB
C++
43 lines
1.6 KiB
C++
#include "../../include/BootLoader/boot_loader.hpp"
|
|
#include "../../include/CD/cd_internal.hpp"
|
|
#include <PSX/System/IOPorts/interrupt_io.hpp>
|
|
#include <PSX/System/IOPorts/memory_io.hpp>
|
|
#include <PSX/System/syscalls.h>
|
|
|
|
namespace JabyEngine {
|
|
namespace CD {
|
|
namespace internal {
|
|
extern InterrupCallback callback;
|
|
}
|
|
}
|
|
namespace boot {
|
|
namespace CD {
|
|
using JabyEngine::CD::internal::Command;
|
|
|
|
void setup() {
|
|
__syscall_EnterCriticalSection();
|
|
Memory_IO::COM_DELAY.setup();
|
|
Memory_IO::CD_DELAY.setup();
|
|
|
|
__syscall_SysEnqIntRP(CdromIoIrq, &::JabyEngine::CD::internal::callback);
|
|
|
|
CD_IO::PortIndex1::change_to();
|
|
CD_IO::Interrupt::ack_extended(CD_IO::PortIndex1::InterruptFlag);
|
|
CD_IO::Interrupt::enable(CD_IO::PortIndex1::InterruptEnable);
|
|
|
|
Interrupt::ack_irq(Interrupt::CDROM);
|
|
Interrupt::enable_irq(Interrupt::CDROM);
|
|
__syscall_ExitCriticalSection();
|
|
|
|
|
|
CD_IO::PortIndex0::change_to();
|
|
|
|
Command::send_wait(CD_IO::PortIndex0::CommandFifo, CD_IO::PortIndex0::ParameterFifo, CD_IO::Command::GetStat);
|
|
Command::send_wait(CD_IO::PortIndex0::CommandFifo, CD_IO::PortIndex0::ParameterFifo, CD_IO::Command::GetStat);
|
|
Command::send_wait(CD_IO::PortIndex0::CommandFifo, CD_IO::PortIndex0::ParameterFifo, CD_IO::Command::Init);
|
|
|
|
// Demute?
|
|
}
|
|
}
|
|
}
|
|
} |