Get rough shape of CD file processing code
This commit is contained in:
@@ -1,34 +1,35 @@
|
||||
#ifndef __JABYENGINE_CD_FILE_PROCESSOR_HPP__
|
||||
#define __JABYENGINE_CD_FILE_PROCESSOR_HPP__
|
||||
#include "../../AutoLBA/auto_lba.hpp"
|
||||
#include "../../Auxiliary/lz4_decompressor.hpp"
|
||||
#include "../cd_file_types.hpp"
|
||||
#include "file_processor.hpp"
|
||||
|
||||
extern "C" uint32_t __heap_base;
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace CDFileProcessor {
|
||||
class State {
|
||||
private:
|
||||
FileProcessor::State file_processor_state;
|
||||
const uint32_t* data_adr;
|
||||
|
||||
public:
|
||||
State() = default;
|
||||
|
||||
void setup(uint16_t lba, uint16_t size, const CDFile::Payload& payload);
|
||||
bool process();
|
||||
class CDFileProcessor {
|
||||
public:
|
||||
struct JobArray {
|
||||
const CDFile* files = nullptr;
|
||||
size_t size = 0;
|
||||
};
|
||||
|
||||
template<size_t Size>
|
||||
static void load_from_cd(const OverlayLBA* overlay_lbas, const CDFile (&cd_files)[Size]) {
|
||||
State state;
|
||||
private:
|
||||
FileProcessor::State file_pro_state;
|
||||
LZ4Decompressor lz4_decomp;
|
||||
JobArray jobs;
|
||||
uint8_t* work_area = nullptr;
|
||||
const AutoLBAEntry* lba = nullptr;
|
||||
|
||||
for(const auto& file : cd_files) {
|
||||
const auto& lba_info = overlay_lbas[file.rel_lba_idx];
|
||||
void start_cur_job();
|
||||
|
||||
state.setup(lba_info.lba, lba_info.size, file.payload);
|
||||
//while(state.process());???
|
||||
}
|
||||
}
|
||||
}
|
||||
public:
|
||||
CDFileProcessor() = default;
|
||||
|
||||
void setup(const volatile AutoLBAEntry* lba, JobArray jobs, uint8_t* work_area = reinterpret_cast<uint8_t*>(&__heap_base));
|
||||
Progress process();
|
||||
};
|
||||
}
|
||||
|
||||
// This will be used as the file processor but will work on cd types
|
||||
|
Reference in New Issue
Block a user