ROM and Compression library updates
Remove Compress and Decompress from ROM Move Editor parent class to its own file Move 65816 editor constants to widgets Update compression_test and snes_palette_test Start version constant classes (experimental) Move SetupROM for editors to load renderer
This commit is contained in:
@@ -470,7 +470,8 @@ absl::Status ValidateCompressionResult(CompressionPiecePointer& chain_head,
|
||||
ROM temp_rom;
|
||||
RETURN_IF_ERROR(
|
||||
temp_rom.LoadFromBytes(CreateCompressionString(chain_head->next, mode)))
|
||||
ASSIGN_OR_RETURN(auto decomp_data, temp_rom.Decompress(0, temp_rom.size()))
|
||||
ASSIGN_OR_RETURN(auto decomp_data,
|
||||
DecompressV2(temp_rom.data(), 0, temp_rom.size()))
|
||||
if (!std::equal(decomp_data.begin() + start, decomp_data.end(),
|
||||
temp_rom.begin())) {
|
||||
return absl::InternalError(absl::StrFormat(
|
||||
@@ -538,7 +539,9 @@ absl::StatusOr<Bytes> CompressV2(const uchar* data, const int start,
|
||||
|
||||
uint max_win = 2;
|
||||
uint cmd_with_max = kCommandDirectCopy;
|
||||
ValidateForByteGainV2(current_cmd, max_win, cmd_with_max);
|
||||
ValidateForByteGain(current_cmd.data_size, current_cmd.cmd_size, max_win,
|
||||
cmd_with_max);
|
||||
// ValidateForByteGainV2(current_cmd, max_win, cmd_with_max);
|
||||
|
||||
if (cmd_with_max == kCommandDirectCopy) {
|
||||
// This is the worst case scenario
|
||||
@@ -553,7 +556,6 @@ absl::StatusOr<Bytes> CompressV2(const uchar* data, const int start,
|
||||
auto new_comp_piece = std::make_shared<CompressionPiece>(
|
||||
kCommandDirectCopy, comp_accumulator, buffer, comp_accumulator);
|
||||
compressed_chain->next = new_comp_piece;
|
||||
compressed_chain = new_comp_piece;
|
||||
comp_accumulator = 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -94,8 +94,10 @@ void CompressionCommandAlternativeV2(const uchar* data,
|
||||
absl::StatusOr<Bytes> CompressV2(const uchar* data, const int start,
|
||||
const int length, int mode = 1,
|
||||
bool check = false);
|
||||
absl::StatusOr<Bytes> CompressGraphics(const int pos, const int length);
|
||||
absl::StatusOr<Bytes> CompressOverworld(const int pos, const int length);
|
||||
absl::StatusOr<Bytes> CompressGraphics(const uchar* data, const int pos,
|
||||
const int length);
|
||||
absl::StatusOr<Bytes> CompressOverworld(const uchar* data, const int pos,
|
||||
const int length);
|
||||
|
||||
std::string SetBuffer(const uchar* data, int src_pos, int comp_accumulator);
|
||||
void memfill(const uchar* data, Bytes& buffer, int buffer_pos, int offset,
|
||||
|
||||
Reference in New Issue
Block a user