Remove BootFiles. Setup code needs improving

This commit is contained in:
2023-04-16 21:39:47 +02:00
parent e4657337f9
commit e6042808ee
8 changed files with 13 additions and 102 deletions

View File

@@ -16,9 +16,7 @@ SRCS += src/syscall_printf.asm
include ../../lib/Makefile
LIB_DIR = ../../lib/$(CONFIG_NAME)
MAIN_BOOT_OBJ = $(filter %/main_boot.o,$(OBJS))
OVERLAY_BOOT_OBJ = $(filter %/overlay_boot.o,$(OBJS))
MAIN_LIB_OBJS = $(filter-out $(MAIN_BOOT_OBJ) $(OVERLAY_BOOT_OBJ),$(OBJS))
MAIN_LIB_OBJS = $(filter-out $(MAIN_BOOT_OBJ) $(OVERLAY_BOOT_OBJ),$(OBJS))
#$(info $$var is [${MAIN_BOOT_OBJ}])
#$(info $$var2 is [${MAIN_LIB_OBJS}])
@@ -33,14 +31,6 @@ $(LIB_DIR)/$(ARTIFACT).a: $(TARGET).a
@mkdir -p $(LIB_DIR)
cp $(TARGET).a $(LIB_DIR)/$(ARTIFACT).a
$(LIB_DIR)/$(notdir $(MAIN_BOOT_OBJ)): $(MAIN_BOOT_OBJ)
@mkdir -p $(LIB_DIR)
cp $(MAIN_BOOT_OBJ) $(LIB_DIR)/$(notdir $(MAIN_BOOT_OBJ))
$(LIB_DIR)/$(notdir $(OVERLAY_BOOT_OBJ)): $(OVERLAY_BOOT_OBJ)
@mkdir -p $(LIB_DIR)
cp $(OVERLAY_BOOT_OBJ) $(LIB_DIR)/$(notdir $(OVERLAY_BOOT_OBJ))
# Improve later
# rule to make the boot image
$(SPLASH_IMAGE): ressources/Splash.png
@@ -50,7 +40,7 @@ $(SPLASH_IMAGE_NTSC): ressources/Splash_ntsc.png
jaby_engine_fconv --lz4 $< simple-tim full16 | cpp_out --name SplashScreen -o $@
#Rules section for default compilation and linking
all: $(SPLASH_IMAGE) $(SPLASH_IMAGE_NTSC) $(LIB_DIR)/$(ARTIFACT).a $(LIB_DIR)/$(notdir $(MAIN_BOOT_OBJ)) $(LIB_DIR)/$(notdir $(OVERLAY_BOOT_OBJ))
all: $(SPLASH_IMAGE) $(SPLASH_IMAGE_NTSC) $(LIB_DIR)/$(ARTIFACT).a
clean:
rm -fr $(SPLASH_IMAGE)

View File

@@ -5,10 +5,6 @@
namespace JabyEngine {
//boot namespace?
namespace boot {
namespace BootFile {
JabyEngine::NextRoutine setup();
}
namespace CD {
void setup();
}
@@ -24,7 +20,7 @@ namespace JabyEngine {
}
namespace Start {
JabyEngine::NextRoutine setup();
void setup();
}
namespace Timer {

View File

@@ -1,17 +0,0 @@
#include "../../../internal-include/BootLoader/boot_loader.hpp"
#include <stdio.h>
#include <PSX/File/Processor/cd_file_processor.hpp>
extern JabyEngine::NextRoutine main();
namespace JabyEngine {
namespace boot {
namespace BootFile {
JabyEngine::NextRoutine setup() {
printf("Running main!\n");
return JabyEngine::NextRoutine::from(main);
}
}
}
}

View File

@@ -1,13 +0,0 @@
#include "../../../internal-include/BootLoader/boot_loader.hpp"
#include <stdio.h>
namespace JabyEngine {
namespace boot {
namespace BootFile {
JabyEngine::NextRoutine setup() {
printf("Overlay boot not implemented!\n");
return JabyEngine::NextRoutine::null();
}
}
}
}

View File

@@ -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);
}
JabyEngine::NextRoutine setup() {
void setup() {
enable_DMA();
SPU::stop_voices();
@@ -31,7 +31,6 @@ namespace JabyEngine {
//Pause??
SPU::setup();
return BootFile::setup();
}
}
}

View File

@@ -1,29 +1,16 @@
#include "../internal-include/BootLoader/boot_loader.hpp"
#include <stdio.h>
extern void main();
namespace JabyEngine {
static NextRoutine execute(NextRoutine routine) {
// Support currently only direct call
return reinterpret_cast<MainRoutine>((routine.value & ~JabyEngine::NextRoutine::OverlayBit))();
}
void start() {
NextRoutine next_routine = JabyEngine::NextRoutine::from(boot::Start::setup);
printf("Starting Planschbecken 0x%p\n", next_routine.value);
while(true) {
if(next_routine.is_null()) {
break;
}
if(next_routine.is_overlay()) {
printf("Overlay not supported yet!\n");
break;
}
next_routine = execute(next_routine);
}
printf("Stop!\n");
printf("Starting Planschbecken\n");
boot::Start::setup();
printf("Running main...\n");
main();
printf("Stop!!\n");
while(true);
}
}