libffshit/inc/ffshit/fullflash.h
Konstantin Pereiaslov c2e9b0f39b
Writing AI prototype
2026-09-29 15:39:29 -05:00

48 lines
1.5 KiB
C++

#ifndef LIBFFSHIT_FULLFLASH_FULLFLASH_H
#define LIBFFSHIT_FULLFLASH_FULLFLASH_H
#include "ffshit/platform/detector.h"
#include "ffshit/partition/partitions.h"
#include "ffshit/rawdata.h"
#include <filesystem>
#include <memory>
namespace FULLFLASH {
class FULLFLASH {
public:
using Ptr = std::shared_ptr<FULLFLASH>;
FULLFLASH(std::filesystem::path fullflash_path);
FULLFLASH(char *ff_data, size_t ff_data_size);
FULLFLASH(std::filesystem::path fullflash_path, Platform::Type platform);
FULLFLASH(char *ff_data, size_t ff_data_size, Platform::Type platform);
template<typename ...Args>
static Ptr build(Args... args) {
return std::make_shared<FULLFLASH>(args...);
}
void load_partitions(bool old_search_algorithm, uint32_t search_start_addr);
// Writes the fullflash, with what the filesystem wrote to it, in the format it was read in
void save(std::filesystem::path fullflash_path) const;
const Platform::Detector & get_detector() const;
Partitions::Partitions::Ptr get_partitions() const;
private:
RawData data;
RawData x65flasher_header;
Platform::Detector::Ptr detector;
Partitions::Partitions::Ptr partitions;
void x65flasher_fix();
};
};
#endif