jabyengine/src/Library/src/BootLoader/start_boot.cpp

32 lines
894 B
C++

#include "BootLoader/boot_loader.hpp"
#include <PSX/System/IOPorts/dMa_io.hpp>
#include <PSX/Timer/timer.hpp>
#include <stdio.h>
namespace JabyEngine {
namespace Setup {
static void enable_DMA() {
DMA_IO::DPCR.write(DMA_IO::DPCR.read() | DMA_IO::DMAControlRegister::SPUEnable | DMA_IO::DMAControlRegister::GPUEnable);
}
JabyEngine::NextRoutine start() {
enable_DMA();
SPU::stop_voices();
Timer::setup();
const auto start = GlobalTime::get_time_stamp();
printf("Start...\n");
GPU::setup();
GPU::display_logo();
const auto end = GlobalTime::get_time_stamp();
printf("GPU setup took %ims\n", start.milliseconds_to(end));
//Pause??
SPU::setup();
return BootFile::setup();
}
}
}