diff --git a/src/app/rom.cc b/src/app/rom.cc index 5df64e7f..4f9861f2 100644 --- a/src/app/rom.cc +++ b/src/app/rom.cc @@ -281,102 +281,6 @@ char *ROM::CreateAllGfxDataRaw() { return buffer; } -void ROM::CreateAllGraphicsData(uchar *allGfx16Ptr) { - int sheetPosition = 0; - char const *data = CreateAllGfxDataRaw(); - auto *newData = new char[0x6F800]; - uchar const *mask = - new uchar[]{0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; - - // 8x8 tile - // Per Sheet - for (int s = 0; s < core::constants::NumberOfSheets; s++) { - for (int j = 0; j < 4; j++) { // Per Tile Line Y - for (int i = 0; i < 16; i++) { // Per Tile Line X - for (int y = 0; y < 8; y++) { // Per Pixel Line - if (isbpp3[s]) { - uchar lineBits0 = - data[(y * 2) + (i * 24) + (j * 384) + sheetPosition]; - uchar lineBits1 = - data[(y * 2) + (i * 24) + (j * 384) + 1 + sheetPosition]; - uchar lineBits2 = - data[(y) + (i * 24) + (j * 384) + 16 + sheetPosition]; - - // Per Pixel X - for (int x = 0; x < 4; x++) { - uchar pixdata = 0; - uchar pixdata2 = 0; - - if ((lineBits0 & mask[(x * 2)]) == mask[(x * 2)]) { - pixdata += 1; - } - if ((lineBits1 & mask[(x * 2)]) == mask[(x * 2)]) { - pixdata += 2; - } - if ((lineBits2 & mask[(x * 2)]) == mask[(x * 2)]) { - pixdata += 4; - } - - if ((lineBits0 & mask[(x * 2) + 1]) == mask[(x * 2) + 1]) { - pixdata2 += 1; - } - if ((lineBits1 & mask[(x * 2) + 1]) == mask[(x * 2) + 1]) { - pixdata2 += 2; - } - if ((lineBits2 & mask[(x * 2) + 1]) == mask[(x * 2) + 1]) { - pixdata2 += 4; - } - - newData[(y * 64) + (x) + (i * 4) + (j * 512) + (s * 2048)] = - (char)((pixdata << 4) | pixdata2); - } - } else { - uchar lineBits0 = - data[(y * 2) + (i * 16) + (j * 256) + sheetPosition]; - uchar lineBits1 = - data[(y * 2) + (i * 16) + (j * 256) + 1 + sheetPosition]; - - // Per Pixel X - for (int x = 0; x < 4; x++) { - uchar pixdata = 0; - uchar pixdata2 = 0; - - if ((lineBits0 & mask[(x * 2)]) == mask[(x * 2)]) { - pixdata += 1; - } - if ((lineBits1 & mask[(x * 2)]) == mask[(x * 2)]) { - pixdata += 2; - } - - if ((lineBits0 & mask[(x * 2) + 1]) == mask[(x * 2) + 1]) { - pixdata2 += 1; - } - if ((lineBits1 & mask[(x * 2) + 1]) == mask[(x * 2) + 1]) { - pixdata2 += 2; - } - - newData[(y * 64) + (x) + (i * 4) + (j * 512) + (s * 2048)] = - (uchar)((pixdata << 4) | pixdata2); - } - } - } - } - } - - if (isbpp3[s]) { - sheetPosition += core::constants::Uncompressed3BPPSize; - } else { - sheetPosition += core::constants::UncompressedSheetSize; - } - } - - auto *allgfx16Data = allGfx16Ptr; - for (int i = 0; i < 0x6F800; i++) { - allgfx16Data[i] = newData[i]; - } - allgfx16Data = SNES3bppTo8bppSheet(allgfx16Data); -} - } // namespace rom } // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/app/rom.h b/src/app/rom.h index d20612cd..7873db50 100644 --- a/src/app/rom.h +++ b/src/app/rom.h @@ -34,13 +34,11 @@ class ROM { int GetPCGfxAddress(uint8_t id); char* CreateAllGfxDataRaw(); - void CreateAllGraphicsData(uchar* allGfx16Ptr); uchar* data() { return current_rom_; } auto Renderer() { return sdl_renderer_; } const uchar* getTitle() const { return title; } long getSize() const { return size_; } - char getVersion() const { return version_; } bool isLoaded() const { return is_loaded_; } private: