rom housekeeping
This commit is contained in:
@@ -541,7 +541,7 @@ absl::StatusOr<Bytes> ROM::Decompress(int offset, int size, bool reversed) {
|
|||||||
offset += 2; // Advance 2 byte in the ROM
|
offset += 2; // Advance 2 byte in the ROM
|
||||||
} break;
|
} break;
|
||||||
case kCommandIncreasingFill: {
|
case kCommandIncreasingFill: {
|
||||||
uchar inc_byte = rom_data_[offset];
|
auto inc_byte = rom_data_[offset];
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
buffer[buffer_pos] = inc_byte++;
|
buffer[buffer_pos] = inc_byte++;
|
||||||
buffer_pos++;
|
buffer_pos++;
|
||||||
@@ -576,8 +576,8 @@ absl::StatusOr<Bytes> ROM::Decompress(int offset, int size, bool reversed) {
|
|||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
std::cout << absl::StrFormat(
|
std::cout << absl::StrFormat(
|
||||||
"DecompressOverworld: Invalid command in header for "
|
"DecompressGraphics: Invalid command in header (Offset : %#06x, "
|
||||||
"decompression (Offset : %#06x, Command: %#04x)\n",
|
"Command: %#04x)\n",
|
||||||
offset, command);
|
offset, command);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,14 +57,6 @@ struct CompressionPiece {
|
|||||||
};
|
};
|
||||||
using CompressionPiece = struct CompressionPiece;
|
using CompressionPiece = struct CompressionPiece;
|
||||||
|
|
||||||
using OWBlockset = std::vector<std::vector<ushort>>;
|
|
||||||
struct OWMapTiles {
|
|
||||||
OWBlockset light_world; // 64 maps
|
|
||||||
OWBlockset dark_world; // 64 maps
|
|
||||||
OWBlockset special_world; // 32 maps
|
|
||||||
};
|
|
||||||
using OWMapTiles = struct OWMapTiles;
|
|
||||||
|
|
||||||
class ROM {
|
class ROM {
|
||||||
public:
|
public:
|
||||||
absl::StatusOr<Bytes> Compress(const int start, const int length,
|
absl::StatusOr<Bytes> Compress(const int start, const int length,
|
||||||
@@ -118,6 +110,7 @@ class ROM {
|
|||||||
std::string filename_;
|
std::string filename_;
|
||||||
|
|
||||||
Bytes rom_data_;
|
Bytes rom_data_;
|
||||||
|
Bytes master_graphics_bin_;
|
||||||
std::shared_ptr<SDL_Renderer> renderer_;
|
std::shared_ptr<SDL_Renderer> renderer_;
|
||||||
absl::flat_hash_map<int, gfx::Bitmap> graphics_bin_;
|
absl::flat_hash_map<int, gfx::Bitmap> graphics_bin_;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user