FAT Data Extractor moved to FAT Tools Tab

This commit is contained in:
Luca D'Amico
2024-08-10 23:20:12 +02:00
parent d69e4e13fa
commit 921eef86e2
10 changed files with 346 additions and 196 deletions

View File

@@ -1,6 +1,12 @@
#include "./../../mainwindow.h"
bool MainWindow::extractFatData(const std::string& fatDataSectionPath, const std::string& fatSectionPath,
const std::string& fntSectionPath, uint32_t originalFatDataAddr, const std::string& savePath)
{
return ndsFactory.extractFatData(fatDataSectionPath, fatSectionPath, fntSectionPath, originalFatDataAddr, savePath);
}
bool MainWindow::patchFat(const std::string& loadPath, uint32_t shiftSize, const std::string& savePath)
{
return ndsFactory.patchFat(loadPath, shiftSize, savePath);

View File

@@ -3,6 +3,64 @@
#include "./../../mainwindow.h"
#include "./../../ui_mainwindow.h"
void MainWindow::on_fatExtractorLoadFatDataBtn_clicked()
{
QString FatDataPath = QFileDialog::getOpenFileName(
Q_NULLPTR,
"NDS Fat Data",
QDir::currentPath(),
"NDS FAT_DATA (*.bin)");
if (!FatDataPath.isNull())
{
ui->fatExtractorFatDataPathEdt->setText(FatDataPath.toUtf8());
}
}
void MainWindow::on_fatExtractorLoadFatBtn_clicked()
{
QString FatPath = QFileDialog::getOpenFileName(
Q_NULLPTR,
"NDS Fat",
QDir::currentPath(),
"NDS FAT (*.bin)");
if (!FatPath.isNull())
{
ui->fatExtractorFatPathEdt->setText(FatPath.toUtf8());
}
}
void MainWindow::on_fatExtractorLoadFntBtn_clicked()
{
QString FntPath = QFileDialog::getOpenFileName(
Q_NULLPTR,
"NDS Fnt",
QDir::currentPath(),
"NDS FNT (*.bin)");
if (!FntPath.isNull())
{
ui->fatExtractorFntPathEdt->setText(FntPath.toUtf8());
}
}
void MainWindow::on_fatExtractorExtractBtn_clicked()
{
QString dirPath = QFileDialog::getExistingDirectory(
this, tr("Select Directory"),
"",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if (!dirPath.isNull())
extractFatData(ui->fatExtractorFatDataPathEdt->text().toStdString(),
ui->fatExtractorFatPathEdt->text().toStdString(),
ui->fatExtractorFntPathEdt->text().toStdString(),
ui->fatExtractorOriginalFatFilesAddrEdt->text().toUInt(nullptr, 16),
dirPath.toStdString()) ? QMessageBox::information(this, tr("NDS Factory"), tr("FAT files extraction completed!"))
: QMessageBox::critical(this, tr("NDS Factory"), tr("Error extracting FAT files!"));
}
void MainWindow::on_fatPatcherLoadFatBtn_clicked()
{