Added the ROM class to manage the state of the users ROMs
This commit is contained in:
34
src/Application/Utils/ROM.cc
Normal file
34
src/Application/Utils/ROM.cc
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "ROM.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace Application {
|
||||
namespace Utils {
|
||||
|
||||
void ROM::LoadFromFile(const std::string & path) {
|
||||
|
||||
std::cout << "filename: " << path << std::endl;
|
||||
std::ifstream stream(path, std::ios::in | std::ios::binary);
|
||||
|
||||
if (!stream.good()) {
|
||||
std::cout << "failure reading file" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<char> contents((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
|
||||
|
||||
for(auto i: contents) {
|
||||
int value = i;
|
||||
std::cout << "data: " << value << std::endl;
|
||||
}
|
||||
|
||||
std::cout << "file size: " << contents.size() << std::endl;
|
||||
|
||||
unsigned int uncompressed_data_size = 0;
|
||||
unsigned int compressed_length = 0;
|
||||
auto gfx_decompressed_data = alttp_compressor_.DecompressGfx(contents.data(), 0, contents.size(), &uncompressed_data_size, &compressed_length);
|
||||
auto overworld_decompressed = alttp_compressor_.DecompressOverworld(contents.data(), 0, contents.size(), &uncompressed_data_size, &compressed_length);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user