Prepare save spot for booting
This commit is contained in:
23
include/PSX/jabyengine.h
Normal file
23
include/PSX/jabyengine.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef __JABYENGINE__H__
|
||||||
|
#define __JABYENGINE__H__
|
||||||
|
#include "../stdint.h"
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
struct NextRoutine {
|
||||||
|
typedef NextRoutine (*ExecutionFunction)();
|
||||||
|
|
||||||
|
uintptr_t value;
|
||||||
|
|
||||||
|
static NextRoutine null() {
|
||||||
|
return {.value = 0};
|
||||||
|
}
|
||||||
|
|
||||||
|
static NextRoutine from(ExecutionFunction function) {
|
||||||
|
return {.value = reinterpret_cast<uintptr_t>(function)};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef NextRoutine::ExecutionFunction ExecutionFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //!__JABYENGINE__H__
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef __JABYENGINE_DEFINES__H
|
#ifndef __JABYENGINE_DEFINES__H__
|
||||||
#define __JABYENGINE_DEFINES__H
|
#define __JABYENGINE_DEFINES__H__
|
||||||
#include "../stddef.h"
|
#include "../stddef.h"
|
||||||
|
|
||||||
#define __keep __attribute__((used))
|
#define __keep __attribute__((used))
|
||||||
@@ -13,4 +13,4 @@
|
|||||||
#else
|
#else
|
||||||
#define __constexpr
|
#define __constexpr
|
||||||
#endif
|
#endif
|
||||||
#endif //!__JABYENGINE_DEFINES__H
|
#endif //!__JABYENGINE_DEFINES__H__
|
@@ -1,5 +1,6 @@
|
|||||||
#ifndef BOOT_LOADER_HPP
|
#ifndef BOOT_LOADER_HPP
|
||||||
#define BOOT_LOADER_HPP
|
#define BOOT_LOADER_HPP
|
||||||
|
#include <PSX/jabyengine.h>
|
||||||
|
|
||||||
namespace GPU {
|
namespace GPU {
|
||||||
void display_logo();
|
void display_logo();
|
||||||
@@ -11,4 +12,8 @@ namespace SPU {
|
|||||||
void setup();
|
void setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Setup {
|
||||||
|
JabyEngine::NextRoutine start();
|
||||||
|
}
|
||||||
|
|
||||||
#endif //!BOOT_LOADER_HPP
|
#endif //!BOOT_LOADER_HPP
|
@@ -2,15 +2,12 @@
|
|||||||
#include <PSX/System/IOPorts/dMa_io.hpp>
|
#include <PSX/System/IOPorts/dMa_io.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
extern int main();
|
namespace Setup {
|
||||||
|
|
||||||
namespace JabyEngine {
|
|
||||||
static void enable_DMA() {
|
static void enable_DMA() {
|
||||||
DMA::DPCR.write(DMA::DPCR.read() | DMA::DMAControlRegister::SPUEnable | DMA::DMAControlRegister::GPUEnable);
|
DMA::DPCR.write(DMA::DPCR.read() | DMA::DMAControlRegister::SPUEnable | DMA::DMAControlRegister::GPUEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void start() {
|
JabyEngine::NextRoutine start() {
|
||||||
printf("Starting Planschbecken\n");
|
|
||||||
enable_DMA();
|
enable_DMA();
|
||||||
|
|
||||||
SPU::stop_voices();
|
SPU::stop_voices();
|
||||||
@@ -20,6 +17,6 @@ namespace JabyEngine {
|
|||||||
//Pause??
|
//Pause??
|
||||||
|
|
||||||
SPU::setup();
|
SPU::setup();
|
||||||
printf("Setup done!\n");
|
return JabyEngine::NextRoutine::null();
|
||||||
}
|
}
|
||||||
}
|
}
|
10
src/Library/src/startup.cpp
Normal file
10
src/Library/src/startup.cpp
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#include "../include/BootLoader/boot_loader.hpp"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
void start() {
|
||||||
|
printf("Starting Planschbecken\n");
|
||||||
|
Setup::start();
|
||||||
|
printf("Stop!\n");
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user