-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rom.h
43 lines (41 loc) · 1014 Bytes
/
Rom.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef ROM_H
#define ROM_H
#include "types.h"
#include "Extensions.h"
#include "Mappers/Mapper.h"
#include "Mappers/000_NROM.h"
#include "Mappers/001_SxROM.h"
#include "Mappers/002_UxROM.h"
#include "Mappers/003_CNROM.h"
#include "Mappers/004_TxROM.h"
#include "Mappers/007_AxROM.h"
#include "Mappers/011_COLOR_DREAMS.h"
class Rom {
private:
const char* saveFolder = "BatterySaves";
u8 header[16];
u8 mapperType;
u8 prgRomSize; // in 16kB units
u8 chrRomSize; // in 8kB units
u8* prgRom;
u8* chrRom;
Mapper* mapper;
const char* romPath;
const char* romName;
private:
const char* getFileNameFromPath(const char* path);
void checkForSaveFolder();
public:
Rom(const char* filePath);
void printInfo();
Mapper* getMapper();
bool hasBattery();
const char* getfileName();
void loadWorkRam();
void saveWorkRam();
Rom() : header{ 0 }, mapperType{ 0 }, prgRomSize{ 0 }, chrRomSize{ 0 },
prgRom{ nullptr }, chrRom{ nullptr }, mapper{ nullptr },
romPath{ nullptr }, romName{ nullptr }
{};
};
#endif