Setup LZ4 decompressor but have it copy data for now

This commit is contained in:
Jaby 2022-12-27 22:06:14 +01:00 committed by Jaby
parent 243ad7ca00
commit e8d4c2fdeb
3 changed files with 33 additions and 2 deletions

View File

@ -21,6 +21,9 @@ namespace JabyEngine {
public: public:
LZ4Decompressor() = default; LZ4Decompressor() = default;
LZ4Decompressor(uint8_t* dst_adr) : LZ4Decompressor() {
LZ4Decompressor::setup(dst_adr);
}
void setup(uint8_t* dst_adr); void setup(uint8_t* dst_adr);
void reset(); void reset();

View File

@ -11,6 +11,9 @@ namespace JabyEngine {
} }
Progress LZ4Decompressor :: process(const uint8_t* data, size_t size) { Progress LZ4Decompressor :: process(const uint8_t* data, size_t size) {
for(size_t n = 0; n < size; n++) {
this->dst_adr[n] = data[n];
}
return Progress::Error; return Progress::Error;
} }
} }

View File

@ -1,6 +1,8 @@
#include "../../include/GPU/gpu.hpp" #include "../../include/GPU/gpu.hpp"
#include <PSX/File/Processor/file_processor.hpp> #include <PSX/File/Processor/file_processor.hpp>
#include <PSX/Auxiliary/lz4_decompressor.hpp>
#include <PSX/GPU/gpu.hpp> #include <PSX/GPU/gpu.hpp>
#include <stdio.h>
#ifdef JABYENGINE_PAL #ifdef JABYENGINE_PAL
#include "splash_image_pal_boot.hpp" #include "splash_image_pal_boot.hpp"
@ -8,11 +10,34 @@
#include "splash_image_ntsc_boot.hpp" #include "splash_image_ntsc_boot.hpp"
#endif //JABYENGINE_PAL #endif //JABYENGINE_PAL
extern "C" uint32_t __boot_loader_end;
namespace JabyEngine { namespace JabyEngine {
namespace GPU { namespace GPU {
static void decompress_logo() {
LZ4Decompressor lz4_decomp(reinterpret_cast<uint8_t*>(&__boot_loader_end));
switch(lz4_decomp.process(SplashScreen, sizeof(SplashScreen))) {
case Progress::InProgress:
printf("Decompressing still in progress...\n");
break;
case Progress::Error:
printf("Error decompressing!!!\n");
break;
case Progress::Done:
printf("Done decompressing\n");
break;
}
}
void display_logo() { void display_logo() {
decompress_logo();
// Upload SplashScreen picture // Upload SplashScreen picture
auto state = FileProcessor::create(reinterpret_cast<const uint32_t*>(SplashScreen), SimpleTIM(32, 0, 0, 0)); auto state = FileProcessor::create(&__boot_loader_end, SimpleTIM(32, 0, 0, 0));
// v this will not be correct for now...
while(state.process((sizeof(SplashScreen)/sizeof(uint32_t))) == Progress::InProgress); while(state.process((sizeof(SplashScreen)/sizeof(uint32_t))) == Progress::InProgress);
Display::enable(); Display::enable();