mirror of
https://github.com/Luca1991/NDSFactory.git
synced 2025-07-09 05:30:12 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2e129375f9 | ||
|
0ee258df2d | ||
|
82cb6f3108 | ||
|
732a2541ee | ||
|
55fa399dc9 | ||
|
bf4195b581 |
224
.github/workflows/build.yml
vendored
224
.github/workflows/build.yml
vendored
@ -10,121 +10,145 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.7
|
||||
- uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Create Build Environment
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential libgl1-mesa-dev and libglvnd-dev cmake qt6-base-dev
|
||||
mkdir build
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- name: Create Build Environment
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential libgl1-mesa-dev libglvnd-dev cmake qt6-base-dev
|
||||
mkdir build
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
make -j4
|
||||
|
||||
- name: Archive Artifact
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
tar -czvf NDSFactory-${{ github.ref_name }}-Linux-x64.tar.gz NDSFactory ../README.md ../LICENSE
|
||||
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: "build/NDSFactory-${{ github.ref_name }}-Linux-x64.tar.gz"
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
make -j4
|
||||
|
||||
- name: Archive Artifact
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
tar -czvf NDSFactory-${{ github.ref_name }}-Linux-x64.tar.gz NDSFactory ../README.md ../LICENSE
|
||||
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: "build/NDSFactory-${{ github.ref_name }}-Linux-x64.tar.gz"
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: '6.7.2'
|
||||
|
||||
- name: Install CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
- uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Create Build Environment
|
||||
run: |
|
||||
mkdir build
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: "6.7.2"
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
make -j4
|
||||
macdeployqt NDSFactory.app
|
||||
- name: Install CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Archive Artifact
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: |
|
||||
zip -r NDSFactory-${{ github.ref_name }}-macOS.zip NDSFactory.app ../README.md ../LICENSE
|
||||
- name: Create Build Environment
|
||||
run: |
|
||||
mkdir -p build/x86_64 build/arm64 build/universal
|
||||
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: "build/NDSFactory-${{ github.ref_name }}-macOS.zip"
|
||||
- name: Configure CMake (x86_64)
|
||||
working-directory: ${{ github.workspace }}/build/x86_64
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 ../..
|
||||
|
||||
- name: Configure CMake (arm64)
|
||||
working-directory: ${{ github.workspace }}/build/arm64
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 ../..
|
||||
|
||||
- name: Build (x86_64)
|
||||
working-directory: ${{ github.workspace }}/build/x86_64
|
||||
shell: bash
|
||||
run: |
|
||||
make -j4
|
||||
|
||||
- name: Build (arm64)
|
||||
working-directory: ${{ github.workspace }}/build/arm64
|
||||
shell: bash
|
||||
run: |
|
||||
make -j4
|
||||
|
||||
- name: Create Universal Binary
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
shell: bash
|
||||
run: |
|
||||
cp -R x86_64/NDSFactory.app universal/
|
||||
lipo -create -output universal/NDSFactory.app/Contents/MacOS/NDSFactory x86_64/NDSFactory.app/Contents/MacOS/NDSFactory arm64/NDSFactory.app/Contents/MacOS/NDSFactory
|
||||
|
||||
- name: Deploy Qt Frameworks
|
||||
working-directory: ${{ github.workspace }}/build/universal
|
||||
shell: bash
|
||||
run: |
|
||||
macdeployqt NDSFactory.app -verbose=1
|
||||
|
||||
- name: Archive Artifact
|
||||
working-directory: ${{ github.workspace }}/build/universal
|
||||
shell: bash
|
||||
run: |
|
||||
zip -r NDSFactory-${{ github.ref_name }}-macOS.zip NDSFactory.app ../README.md ../LICENSE
|
||||
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: "build/universal/NDSFactory-${{ github.ref_name }}-macOS.zip"
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: '6.7.2'
|
||||
|
||||
- name: Install CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
- uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Create Build Environment
|
||||
run: |
|
||||
mkdir build
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake ..
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: "6.7.2"
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake --build . -j4 --config Release
|
||||
mkdir .\Release\prod
|
||||
move .\Release\NDSFactory.exe .\Release\prod
|
||||
windeployqt .\Release\prod\NDSFactory.exe
|
||||
|
||||
- name: Archive Artifact
|
||||
working-directory: ${{github.workspace}}/build/Release
|
||||
run: |
|
||||
xcopy ..\..\README.md .\prod
|
||||
xcopy ..\..\LICENSE .\prod
|
||||
powershell "Compress-Archive -Path .\prod\* -DestinationPath .\NDSFactory-${{ github.ref_name }}-Windows-x64.zip"
|
||||
- name: Install CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: "build/Release/NDSFactory-${{ github.ref_name }}-Windows-x64.zip"
|
||||
- name: Create Build Environment
|
||||
run: |
|
||||
mkdir build
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake ..
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake --build . -j4 --config Release
|
||||
mkdir .\Release\prod
|
||||
move .\Release\NDSFactory.exe .\Release\prod
|
||||
windeployqt .\Release\prod\NDSFactory.exe
|
||||
|
||||
- name: Archive Artifact
|
||||
working-directory: ${{github.workspace}}/build/Release
|
||||
run: |
|
||||
xcopy ..\..\README.md .\prod
|
||||
xcopy ..\..\LICENSE .\prod
|
||||
powershell "Compress-Archive -Path .\prod\* -DestinationPath .\NDSFactory-${{ github.ref_name }}-Windows-x64.zip"
|
||||
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: "build/Release/NDSFactory-${{ github.ref_name }}-Windows-x64.zip"
|
||||
|
@ -52,6 +52,7 @@ In this tab, you can:
|
||||
* extract the FAT files from fat_data.bin.
|
||||
* rebuild the FAT files into a new fat.bin and fat_data.bin.
|
||||
If the ROM contains ARM9/ARM7 overlays you must provide the original fat.bin to extract the overlay offsets.
|
||||
|
||||
WARNING: DO NOT MODIFY FAT FILES NAMES OR EXTENSIONS, OR YOU WILL NEED A NEW fnt.bin.
|
||||
* patch the FAT section (fat.bin): this is only necessary if the FAT files' final address (fat_data.bin) differs from the original.
|
||||
Patching the FAT is straightforward: load your fat.bin, and fill in the original and new addresses of fat_data.bin. This will produce a patched fat.bin for use in the packing process.
|
||||
@ -60,5 +61,6 @@ In this tab, you can:
|
||||
|
||||
If you find a bug, feel free to open an issue or submit a pull request :)
|
||||
|
||||
## Developed with ❤ by Luca D'Amico
|
||||
## Special thanks to Antonio Barba & Davide Trogu
|
||||
Special thanks to [Antonio Barba](https://github.com/antoniobarba) & [Davide Trogu](https://github.com/Dax89)
|
||||
|
||||
Developed with ❤ by Luca D'Amico
|
||||
|
@ -55,8 +55,7 @@ NFResult NDSFactory::dumpDataFromFile(const std::string& romPath, const std::str
|
||||
bool NDSFactory::logToFile(const std::string& logPath, const std::string& log)
|
||||
{
|
||||
std::ofstream savedFile(logPath, std::ios::out | std::ios::binary | std::ios::app);
|
||||
if (!savedFile.is_open())
|
||||
return false;
|
||||
if (!savedFile.is_open()) return false;
|
||||
|
||||
savedFile.write(log.c_str(), log.size());
|
||||
savedFile.close();
|
||||
@ -308,7 +307,7 @@ NFResult NDSFactory::buildFatData(const std::string& fatDataDirPath, const std::
|
||||
std::vector<char> fntBytes;
|
||||
|
||||
std::vector<FatFileID> fileIDs;
|
||||
std::ifstream fileIDsFile(fatDataDirPath + "/_file_IDs.txt", std::ios::in | std::ios::beg);
|
||||
std::ifstream fileIDsFile(fatDataDirPath + "/_file_IDs.txt", std::ios::in);
|
||||
if (!fileIDsFile.is_open()) return { false, "Error opening file: " + fatDataDirPath + "/_file_IDs.txt" };
|
||||
std::string fileIDsLine;
|
||||
while (std::getline(fileIDsFile, fileIDsLine))
|
||||
@ -331,7 +330,7 @@ NFResult NDSFactory::buildFatData(const std::string& fatDataDirPath, const std::
|
||||
int firstFileId = fatFileID.id;
|
||||
if (firstFileId > 0)
|
||||
{
|
||||
std::ifstream originalFatFile(originalFatPath, std::ios::in | std::ios::binary | std::ios::beg);
|
||||
std::ifstream originalFatFile(originalFatPath, std::ios::in | std::ios::binary);
|
||||
if (!originalFatFile.is_open()) return { false, "Error opening file: " + originalFatPath };
|
||||
std::vector<char> ovrBytes;
|
||||
uint32_t requiredBytes = firstFileId * sizeof(FatRange);
|
||||
|
@ -42,7 +42,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>NDSFactory V1.3</string>
|
||||
<string>NDSFactory V1.3.2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
@ -58,7 +58,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>(C) 2019-2024 - Luca D'Amico</string>
|
||||
<string>(C) 2019-2025 - Luca D'Amico</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef REVISION_H
|
||||
#define REVISION_H
|
||||
|
||||
#define GIT_COMMIT_HASH "dec5243"
|
||||
#define GIT_COMMIT_HASH "c916f47"
|
||||
|
||||
#endif
|
||||
|
@ -39,8 +39,7 @@ void MainWindow::on_unpackerDumpHeaderBtn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS Header", "header.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpHeader(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpHeader(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpHeaderBtn->setEnabled(true);
|
||||
}
|
||||
@ -57,8 +56,7 @@ void MainWindow::on_unpackerDumpArm9Btn_clicked()
|
||||
"Do you want to dump the extra 12 bytes? (click yes if you want a 1:1 arm9 dump)",
|
||||
QMessageBox::Yes|QMessageBox::No);
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpArm9Bin(dirPath.toStdString(), dumpExtraBytes == QMessageBox::Yes ? true : false));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpArm9Bin(dirPath.toStdString(), dumpExtraBytes == QMessageBox::Yes ? true : false));
|
||||
|
||||
ui->unpackerDumpArm9Btn->setEnabled(true);
|
||||
}
|
||||
@ -69,8 +67,7 @@ void MainWindow::on_unpackerDumpArm7Btn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS ARM7", "arm7.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpArm7Bin(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpArm7Bin(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpArm7Btn->setEnabled(true);
|
||||
}
|
||||
@ -81,8 +78,7 @@ void MainWindow::on_unpackerDumpFntBtn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS FNT", "fnt.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpFnt(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpFnt(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpFntBtn->setEnabled(true);
|
||||
}
|
||||
@ -93,8 +89,7 @@ void MainWindow::on_unpackerDumpFatBtn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS FAT", "fat.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpFat(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpFat(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpFatBtn->setEnabled(true);
|
||||
}
|
||||
@ -105,8 +100,7 @@ void MainWindow::on_unpackerDumpArm9OverlayBtn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS ARM9 Overlay", "a9ovr.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpArm9Overlay(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpArm9Overlay(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpArm9OverlayBtn->setEnabled(true);
|
||||
}
|
||||
@ -117,8 +111,7 @@ void MainWindow::on_unpackerDumpArm7OverlayBtn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS ARM7 Overlay", "a7ovr.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpArm7Overlay(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpArm7Overlay(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpArm7OverlayBtn->setEnabled(true);
|
||||
}
|
||||
@ -129,8 +122,7 @@ void MainWindow::on_unpackerDumpIconTitleLogoBtn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS IconTitleLogo", "itl.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpIconTitle(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpIconTitle(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpIconTitleLogoBtn->setEnabled(true);
|
||||
}
|
||||
@ -141,8 +133,7 @@ void MainWindow::on_unpackerDumpFatFilesBtn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS FAT Files", "fat_data.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpFatFiles(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpFatFiles(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpFatFilesBtn->setEnabled(true);
|
||||
}
|
||||
@ -153,8 +144,7 @@ void MainWindow::on_unpackerDumpArm9OverlayFilesBtn_clicked()
|
||||
|
||||
QString dirPath = customSaveFileDialog("NDS ARM9 Overlay Data", "a9ovr_data.bin", "Binary (*.bin)");
|
||||
|
||||
if (!dirPath.isNull())
|
||||
notifyExtractionResult(dumpArm9OverlayFiles(dirPath.toStdString()));
|
||||
if (!dirPath.isNull()) notifyExtractionResult(dumpArm9OverlayFiles(dirPath.toStdString()));
|
||||
|
||||
ui->unpackerDumpArm9OverlayFilesBtn->setEnabled(true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user