rom housekeeping

This commit is contained in:
scawful
2022-07-09 23:50:34 -04:00
parent 939b9d6d0d
commit 4911f0c551
2 changed files with 43 additions and 58 deletions

View File

@@ -20,19 +20,22 @@
namespace yaze {
namespace app {
constexpr uchar kGraphicsBitmap[8] = {0x80, 0x40, 0x20, 0x10,
0x08, 0x04, 0x02, 0x01};
class ROM {
public:
void Close();
void SetupRenderer(std::shared_ptr<SDL_Renderer> renderer);
void LoadFromFile(const std::string& path);
char* Decompress(int pos, int size = 0x800, bool reversed = false);
gfx::SNESPalette ExtractPalette(uint addr, int bpp);
uchar* SNES3bppTo8bppSheet(uchar* buffer_in, int sheet_id = 0,
int size = 0x1000);
uint GetGraphicsAddress(uint8_t id) const;
SDL_Texture* DrawGraphicsSheet(int offset);
gfx::SNESPalette ExtractPalette(uint addr, int bpp);
int GetPCGfxAddress(uint8_t id);
char* CreateAllGfxDataRaw();
uchar* data() { return current_rom_; }
@@ -47,7 +50,6 @@ class ROM {
long size_;
uint compressed_size_;
uchar* current_rom_;
uchar version_;
uchar title[21] = "ROM Not Loaded";
enum rom_type type_ = LoROM;
bool isbpp3[core::constants::NumberOfSheets];