Improve starting of the game and reduce persistent memory usage
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#ifndef __JABYENGINE__HPP__
|
#ifndef __JABYENGINE__HPP__
|
||||||
#define __JABYENGINE__HPP__
|
#define __JABYENGINE__HPP__
|
||||||
#include "../stdint.h"
|
#include "jabyengine_defines.h"
|
||||||
|
|
||||||
namespace JabyEngine {
|
namespace JabyEngine {
|
||||||
typedef void (*MainRoutine)();
|
typedef void (*MainRoutine)();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#define __used __attribute__((used))
|
#define __used __attribute__((used))
|
||||||
#define __no_align __attribute__((packed))
|
#define __no_align __attribute__((packed))
|
||||||
#define __no_inline __attribute__((noinline))
|
#define __no_inline __attribute__((noinline))
|
||||||
|
#define __no_return __attribute__((noreturn))
|
||||||
#define __always_inline __attribute__((always_inline))
|
#define __always_inline __attribute__((always_inline))
|
||||||
#define __section(name) __attribute__((section(name)))
|
#define __section(name) __attribute__((section(name)))
|
||||||
#define __collect(...) __VA_ARGS__
|
#define __collect(...) __VA_ARGS__
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
#include <PSX/jabyengine.hpp>
|
#include <PSX/jabyengine.hpp>
|
||||||
|
|
||||||
namespace JabyEngine {
|
namespace JabyEngine {
|
||||||
//boot namespace?
|
|
||||||
namespace boot {
|
namespace boot {
|
||||||
namespace CD {
|
namespace CD {
|
||||||
void setup();
|
void setup();
|
||||||
@@ -19,13 +18,11 @@ namespace JabyEngine {
|
|||||||
void setup();
|
void setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Start {
|
|
||||||
void setup();
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Timer {
|
namespace Timer {
|
||||||
void setup();
|
void setup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __no_return run();
|
||||||
}
|
}
|
||||||
#endif //!BOOT_LOADER_HPP
|
#endif //!BOOT_LOADER_HPP
|
||||||
@@ -13,7 +13,7 @@ namespace JabyEngine {
|
|||||||
DMA_IO::DPCR = DMA_IO::DPCR_t(DMA_IO::DPCR).set(DMA_IO::DPCR_t::SPUEnable).set(DMA_IO::DPCR_t::GPUEnable).set(DMA_IO::DPCR_t::CDROMEnable);
|
DMA_IO::DPCR = DMA_IO::DPCR_t(DMA_IO::DPCR).set(DMA_IO::DPCR_t::SPUEnable).set(DMA_IO::DPCR_t::GPUEnable).set(DMA_IO::DPCR_t::CDROMEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
static void setup() {
|
||||||
enable_DMA();
|
enable_DMA();
|
||||||
|
|
||||||
SPU::stop_voices();
|
SPU::stop_voices();
|
||||||
@@ -34,4 +34,12 @@ namespace JabyEngine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void start() {
|
||||||
|
printf("Starting Planschbecken\n");
|
||||||
|
boot::Start::setup();
|
||||||
|
|
||||||
|
printf("Running main...\n");
|
||||||
|
run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
12
src/Library/src/run.cpp
Normal file
12
src/Library/src/run.cpp
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
extern void main();
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
// Executes the game
|
||||||
|
void __no_return run() {
|
||||||
|
main();
|
||||||
|
printf("Stop!!\n");
|
||||||
|
while(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#include "../internal-include/BootLoader/boot_loader.hpp"
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
extern void main();
|
|
||||||
|
|
||||||
namespace JabyEngine {
|
|
||||||
void start() {
|
|
||||||
printf("Starting Planschbecken\n");
|
|
||||||
boot::Start::setup();
|
|
||||||
|
|
||||||
printf("Running main...\n");
|
|
||||||
main();
|
|
||||||
printf("Stop!!\n");
|
|
||||||
while(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user