Simulated load of a file
This commit is contained in:
@@ -17,10 +17,12 @@ namespace JabyEngine {
|
||||
public:
|
||||
FastCircularBuffer() = default;
|
||||
|
||||
void setup(T* buffer_start_adr) {
|
||||
size_t setup(T* buffer_start_adr) {
|
||||
this->start_adr = buffer_start_adr;
|
||||
this->read_idx = 0;
|
||||
this->write_idx = 0;
|
||||
|
||||
return (sizeof(T)*ElementCount);
|
||||
}
|
||||
|
||||
T* allocate() {
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#ifndef __JABYENGINE_CD_FILE_PROCESSOR_HPP__
|
||||
#define __JABYENGINE_CD_FILE_PROCESSOR_HPP__
|
||||
#include "../../AutoLBA/auto_lba.hpp"
|
||||
#include "../../Auxiliary/circular_buffer.hpp"
|
||||
#include "../../Auxiliary/lz4_decompressor.hpp"
|
||||
#include "../../System/IOPorts/cd_io.hpp"
|
||||
#include "../cd_file_types.hpp"
|
||||
#include "file_processor.hpp"
|
||||
|
||||
@@ -16,11 +18,12 @@ namespace JabyEngine {
|
||||
};
|
||||
|
||||
private:
|
||||
FileProcessor::State file_pro_state;
|
||||
LZ4Decompressor lz4_decomp;
|
||||
JobArray jobs;
|
||||
uint8_t* work_area = nullptr;
|
||||
const AutoLBAEntry* lba = nullptr;
|
||||
FileProcessor::State file_pro_state;
|
||||
FastCircularBuffer<CD_IO::DataSector, 8> circular_buffer;
|
||||
LZ4Decompressor lz4_decomp;
|
||||
JobArray jobs;
|
||||
uint8_t* work_area = nullptr;
|
||||
const AutoLBAEntry* lba = nullptr;
|
||||
|
||||
void start_cur_job();
|
||||
|
||||
|
@@ -4,6 +4,18 @@
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace CD_IO {
|
||||
struct DataSector {
|
||||
static constexpr size_t SizeBytes = 2048;
|
||||
static constexpr size_t SizeWords = (SizeBytes/sizeof(uint32_t));
|
||||
|
||||
uint32_t data[SizeWords];
|
||||
|
||||
template<typename T>
|
||||
static constexpr T words_to_sectors(T size) {
|
||||
return (size + static_cast<T>(DataSector::SizeWords - 1))/static_cast<T>(DataSector::SizeWords);
|
||||
}
|
||||
};
|
||||
|
||||
enum Index {
|
||||
Index0 = 0,
|
||||
Index1 = 1,
|
||||
|
Reference in New Issue
Block a user