forked from Luca1991/NDSFactory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathndsfactory.h
30 lines (23 loc) · 1.15 KB
/
ndsfactory.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
#ifndef NDSFACTORY_H
#define NDSFACTORY_H
#include <string>
#include <vector>
#include <cstdint>
#include "ndsheader.h"
class NDSFactory
{
public:
NDSFactory();
bool loadRomHeader(const std::string& romPath, std::vector<char>& header);
bool dumpDataFromFile(const std::string& romPath, const std::string& savePath, uint32_t startAddr, uint32_t size);
bool readBytesFromFile(std::vector<char>& byteBuffer, const std::string& romPath, uint32_t startAddr, uint32_t size);
bool writeSectionToFile(const std::string& sectionPath, const std::string& savePath, uint32_t startAddr, uint32_t size);
bool writeBytesToFile(std::vector<char>& byteBuffer, const std::string& savePath, uint32_t startAddr, uint32_t size);
bool writePaddingToFile(char paddingChar, const std::string& savePath, uint32_t startAddr, uint32_t size);
int getCardSizeInBytes(int cardType);
bool checkArm9FooterPresence(const std::string& sectionPath, uint32_t size);
bool patchFat(const std::string& sectionPath, uint32_t shiftSize, const std::string& savePath);
uint16_t calcHeaderCrc16(const std::vector<char>& romHeader);
private:
};
#endif // NDSFACTORY_H