Remove unnecessary file and add subscript operator

This commit is contained in:
Justin Scofield
2022-07-24 01:33:27 -04:00
parent 0a6db683f6
commit 12f896e31e
2 changed files with 8 additions and 29 deletions

View File

@@ -64,8 +64,6 @@ class ROM {
uchar* SNES3bppTo8bppSheet(uchar* buffer_in, int sheet_id = 0,
int size = 0x1000);
SDL_Texture* DrawGraphicsSheet(int offset);
auto data() { return rom_data_.data(); }
auto isLoaded() const { return is_loaded_; }
auto GetSize() const { return size_; }
@@ -77,6 +75,14 @@ class ROM {
auto GetVRAM() const { return pseudo_vram_; }
auto GetBytes() const { return rom_data_; }
uchar& operator[](int i) {
if (i > size_) {
std::cout << "Index out of bounds" << std::endl;
return rom_data_[0];
}
return rom_data_[i];
}
private:
int num_sheets_ = 0;
long size_ = 0;