vgbc/cartridge/cartridge.h

38 lines
487 B
C
Raw Normal View History

#pragma once
#include <misc/types.h>
#include <fstream>
enum CartridgeType : u8 {
ROM_ONLY = 0x00,
MBC1 = 0x01,
MBC1_RAM = 0x02,
MBC1_RAM_BATTERY = 0x03,
};
class Cartridge {
private:
u8* _data;
size_t _size;
char _title[17];
enum Offsets {
TITLE = 0x0134,
MANU_CODE = 0x013F,
};
public:
Cartridge(std::ifstream& file);
u8 operator[](size_t addr);
inline
const char* title()
{ return _title; }
inline
size_t size()
{ return _size; }
};