forked from Luca1991/NDSFactory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
110 lines (93 loc) · 4.18 KB
/
mainwindow.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <cstdint>
#include "ndsfactory.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_loadRomBtn_clicked();
void on_unpackerDumpHeaderBtn_clicked();
void on_unpackerDumpArm9Btn_clicked();
void on_unpackerDumpArm7Btn_clicked();
void on_unpackerDumpFntBtn_clicked();
void on_unpackerDumpFatBtn_clicked();
void on_unpackerDumpArm9OverlayBtn_clicked();
void on_unpackerDumpArm7OverlayBtn_clicked();
void on_unpackerDumpIconTitleLogoBtn_clicked();
void on_unpackerDumpFatFilesBtn_clicked();
void on_unpackerDumpArm9OverlayFilesBtn_clicked();
void on_unpackerDumpArm7OverlayFilesBtn_clicked();
void on_unpackerDumpEverythingBtn_clicked();
void on_unpackerDecodeFatFilesBtn_clicked();
void on_actionExit_triggered();
void on_actionAbout_triggered();
void on_packerLoadHeaderBtn_clicked();
void on_packerLoadArm9BinBtn_clicked();
void on_packerLoadArm7BinBtn_clicked();
void on_packerLoadFntBtn_clicked();
void on_packerLoadFatBtn_clicked();
void on_packerLoadArm9OverlayBtn_clicked();
void on_packerLoadArm9OverlayFilesBtn_clicked();
void on_packerLoadArm7OverlayBtn_clicked();
void on_packerLoadArm7OverlayFilesBtn_clicked();
void on_packerLoadIconTitleBtn_clicked();
void on_packerLoadFatFilesBtn_clicked();
void on_packerBuildNDSRomBtn_clicked();
void on_fatPatchingLoadFatBtn_clicked();
void on_fatPatchingPatchFatBtn_clicked();
void on_packerCalcHeaderCrcBtn_clicked();
private:
Ui::MainWindow *ui;
NDSFactory ndsFactory;
void populateHeader(NDSHeader* ndsHeader);
void enableExtractionButtons();
void disableExtractionButtons();
bool dumpHeader(const std::string& dirPath);
bool dumpArm9Bin(const std::string& dirPath, bool dumpExtraBytes);
bool dumpArm7Bin(const std::string& dirPath);
bool dumpFnt(const std::string& dirPath);
bool dumpFat(const std::string& dirPath);
bool dumpArm9Overlay(const std::string& dirPath);
bool dumpArm9OverlayFiles(const std::string& dirPath);
bool dumpArm7Overlay(const std::string& dirPath);
bool dumpArm7OverlayFiles(const std::string& dirPath);
bool dumpIconTitle(const std::string& dirPath);
bool dumpFatFiles(const std::string& dirPath);
bool dumpEverything(QString dirPath);
void populatePackerSectionHeader(NDSHeader *ndsHeader);
void generateHeader(NDSHeader* pRomHeader);
bool writeHeader(const std::string& savePath);
void calcHeaderCrc16();
bool writeArm9Bin(const std::string& savePath, bool isArm9FooterPresent);
bool writeArm7Bin(const std::string& savePath);
bool writeFnt(const std::string& savePath);
bool writeFat(const std::string& savePath);
bool writeArm9Overlay(const std::string& savePath);
bool writeArm9OverlayFiles(const std::string& savePath);
bool writeArm7Overlay(const std::string& savePath);
bool writeArm7OverlayFiles(const std::string& savePath);
bool writeIconTitle(const std::string& savePath);
bool writeFatFiles(const std::string& savePath);
bool writeEverything(const std::string& savePath);
bool writeHeaderPadding(char paddingByte, const std::string& savePath);
bool writeArm9BinPadding(char paddingByte, const std::string& savePath, bool isArm9FooterPresent);
bool writeArm7BinPadding(char paddingByte, const std::string& savePath);
bool writeFntPadding(char paddingByte, const std::string& savePath);
bool writeFatPadding(char paddingByte, const std::string& savePath);
bool writeArm9OverlayPadding(char paddingByte, const std::string& savePath);
bool writeArm9OverlayFilesPadding(char paddingByte, const std::string& savePath);
bool writeArm7OverlayPadding(char paddingByte, const std::string& savePath);
bool writeArm7OverlayFilesPadding(char paddingByte, const std::string& savePath);
bool writeRomPadding(const std::string& savePath);
bool decodeFatFiles();
bool patchFat(const std::string& loadPath, uint32_t shiftSize, const std::string& savePath);
};
#endif // MAINWINDOW_H