Add boot namespace and adjust names

This commit is contained in:
Jaby 2023-01-12 22:02:11 +01:00
parent cf62ef783c
commit 4e445b2b91
9 changed files with 199 additions and 175 deletions

View File

@ -4,6 +4,10 @@
namespace JabyEngine {
//boot namespace?
namespace boot {
namespace BootFile {
JabyEngine::NextRoutine setup();
}
namespace CD {
void setup();
@ -19,16 +23,13 @@ namespace JabyEngine {
void setup();
}
namespace Setup {
JabyEngine::NextRoutine start();
}
namespace BootFile {
namespace Start {
JabyEngine::NextRoutine setup();
}
namespace Timer {
void setup();
}
}
}
#endif //!BOOT_LOADER_HPP

View File

@ -4,10 +4,12 @@
extern JabyEngine::NextRoutine main();
namespace JabyEngine {
namespace boot {
namespace BootFile {
JabyEngine::NextRoutine setup() {
printf("Running main!\n");
return JabyEngine::NextRoutine::from(main);
}
}
}
}

View File

@ -2,10 +2,12 @@
#include <stdio.h>
namespace JabyEngine {
namespace boot {
namespace BootFile {
JabyEngine::NextRoutine setup() {
printf("Overlay boot not implemented!\n");
return JabyEngine::NextRoutine::null();
}
}
}
}

View File

@ -2,9 +2,11 @@
#include <PSX/System/IOPorts/cd_io.hpp>
namespace JabyEngine {
namespace boot {
namespace CD {
void setup() {
CD_IO::change_to_index0();
}
}
}
}

View File

@ -13,7 +13,10 @@
extern "C" uint32_t __boot_loader_end;
namespace JabyEngine {
namespace boot {
namespace GPU {
using namespace JabyEngine::GPU;
static size_t decompress_logo() {
LZ4Decompressor lz4_decomp(reinterpret_cast<uint8_t*>(&__boot_loader_end));
@ -54,4 +57,5 @@ namespace JabyEngine {
GPU::internal::quick_fill_fast(Color24::Black(), PositionU16(32, 0), SizeU16(Display::Width, Display::Height));
}
}
}
}

View File

@ -3,6 +3,7 @@
#include <limits.h>
namespace JabyEngine {
namespace boot {
namespace SPU {
using namespace JabyEngine;
@ -96,4 +97,5 @@ namespace JabyEngine {
setup_control_register();
}
}
}
}

View File

@ -5,12 +5,13 @@
#include <stdio.h>
namespace JabyEngine {
namespace Setup {
namespace boot {
namespace Start {
static void enable_DMA() {
DMA_IO::DPCR.write(DMA_IO::DPCR.read() | DMA_IO::DMAControlRegister::SPUEnable | DMA_IO::DMAControlRegister::GPUEnable);
}
JabyEngine::NextRoutine start() {
JabyEngine::NextRoutine setup() {
enable_DMA();
SPU::stop_voices();
@ -29,4 +30,5 @@ namespace JabyEngine {
return BootFile::setup();
}
}
}
}

View File

@ -9,6 +9,12 @@
namespace JabyEngine {
namespace Timer {
extern InterrupCallback IRQCallback;
}
namespace boot {
namespace Timer {
using namespace JabyEngine::Timer;
void setup() {
using namespace Timer_IO;
@ -27,11 +33,14 @@
}
}
}
}
#else
namespace JabyEngine {
namespace boot {
namespace Timer {
void setup() {
}
}
}
}
#endif //JABYENGINE_USE_HIGH_PERCISION_TIMER

View File

@ -8,7 +8,7 @@ namespace JabyEngine {
}
void start() {
NextRoutine next_routine = JabyEngine::NextRoutine::from(Setup::start);
NextRoutine next_routine = JabyEngine::NextRoutine::from(boot::Start::setup);
printf("Starting Planschbecken 0x%p\n", next_routine.value);
while(true) {