Make LZ4 Decompressor return a state value
This commit is contained in:
@@ -10,10 +10,10 @@ namespace JabyEngine {
|
||||
|
||||
}
|
||||
|
||||
Progress LZ4Decompressor :: process(const uint8_t* data, size_t size) {
|
||||
LZ4Decompressor::Result 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 Result::new_error();
|
||||
}
|
||||
}
|
@@ -14,10 +14,11 @@ extern "C" uint32_t __boot_loader_end;
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace GPU {
|
||||
static void decompress_logo() {
|
||||
static size_t decompress_logo() {
|
||||
LZ4Decompressor lz4_decomp(reinterpret_cast<uint8_t*>(&__boot_loader_end));
|
||||
|
||||
switch(lz4_decomp.process(SplashScreen, sizeof(SplashScreen))) {
|
||||
const auto [progress, bytes_ready] = lz4_decomp.process(SplashScreen, sizeof(SplashScreen));
|
||||
switch(progress) {
|
||||
case Progress::InProgress:
|
||||
printf("Decompressing still in progress...\n");
|
||||
break;
|
||||
@@ -30,15 +31,16 @@ namespace JabyEngine {
|
||||
printf("Done decompressing\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return bytes_ready;
|
||||
}
|
||||
|
||||
void display_logo() {
|
||||
decompress_logo();
|
||||
const auto bytes_ready = decompress_logo();
|
||||
|
||||
// Upload SplashScreen picture
|
||||
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((bytes_ready/sizeof(uint32_t))) == Progress::InProgress);
|
||||
|
||||
Display::enable();
|
||||
}
|
||||
|
Reference in New Issue
Block a user