Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b0b384c
Initialize Fast3dWindow before ROM archive checks/extraction.
Malkierian Oct 10, 2025
5cb1706
Start isolation of extraction code for looping and ImGui replacement.
Malkierian Oct 10, 2025
bebe2e6
Commit modules and update refs.
Malkierian Oct 12, 2025
0083ced
Merge branch 'develop' of github.com:Malkierian/Shipwright into imgui…
Malkierian Oct 26, 2025
111e308
Update LUS ref.
Malkierian Oct 26, 2025
ae3aac9
Update for `zapd_report` changes in ZAPD branch.
Malkierian Oct 27, 2025
6131c8a
clang
Malkierian Oct 27, 2025
04f1b0b
Update ZAPD ref.
Malkierian Oct 27, 2025
9aae81c
Update module refs.
Malkierian Oct 27, 2025
91045c1
Merge branch 'develop' of github.com:Malkierian/Shipwright into imgui…
Malkierian Dec 3, 2025
866a91e
Remove OS prompt for cancelling out of file finder dialog on first ru…
Malkierian Dec 3, 2025
f9c35f1
Convert ROM archive update flow to ImGui.
Malkierian Dec 5, 2025
d7779ea
General cleanup.
Malkierian Dec 7, 2025
1736da2
Allow Exit button to close program during extraction flow.
Malkierian Jan 10, 2026
de56c54
Merge branch 'develop' of github.com:Malkierian/Shipwright into imgui…
Malkierian Jan 10, 2026
1fe6aa7
Add parameter default of `isJapaneseFont = false` to `CreateFontWithS…
Malkierian Jan 10, 2026
0f573b5
Re-arrange initializers to allow menu to be "setup" before everything…
Malkierian Jan 10, 2026
aef7bcd
Make modal centering reactive to window size after showing.
Malkierian Jan 11, 2026
b3d164a
clang
Malkierian Jan 11, 2026
91c5129
Bump LUS.
Malkierian Jan 11, 2026
c713fc2
Fix hangs, remove commented code.
Malkierian Jan 12, 2026
d2743fd
Make progress variables atomic for thread safety.
Malkierian Jan 12, 2026
d433977
clang
Malkierian Jan 12, 2026
7e40563
Swap AppDirectory for AppBundle for `installPath` in ZAPD calls.
Malkierian Jan 12, 2026
3076999
clang
Malkierian Jan 12, 2026
f2ff03e
Remove border from progress bar.
Malkierian Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ZAPDTR
33 changes: 9 additions & 24 deletions soh/soh/Extractor/Extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ bool Extractor::ManuallySearchForRom() {
std::ifstream inFile;

if (!GetRomPathFromBox()) {
ShowErrorBox("No rom selected", "No Rom selected. Exiting");
return false;
}

Expand Down Expand Up @@ -481,11 +480,15 @@ bool Extractor::RunFileStandalone(std::string rom) {
return true;
}

void Extractor::SetSearchPath(const std::string& path) {
mSearchPath = path;
}

bool Extractor::Run(std::string searchPath, RomSearchMode searchMode) {
std::vector<std::string> roms;
std::ifstream inFile;

mSearchPath = searchPath;
SetSearchPath(searchPath);

GetRoms(roms);
FilterRoms(roms, searchMode);
Expand Down Expand Up @@ -634,10 +637,11 @@ std::string Extractor::Mkdtemp() {
return tmppath;
}

extern "C" int zapd_main(int argc, char** argv);
extern "C" int zapd_report(int argc, char** argv, std::atomic<size_t>* extractCount, std::atomic<size_t>* totalExtract);
static void MessageboxWorker();

bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
bool Extractor::CallZapd(std::string installPath, std::string exportdir, std::atomic<size_t>* extractCount,
std::atomic<size_t>* totalExtract) {
constexpr int argc = 22;
char xmlPath[1024];
char confPath[1024];
Expand Down Expand Up @@ -688,26 +692,7 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) {
argv[20] = "-osf";
argv[21] = "placeholder";

#ifdef _WIN32
// Grab a handle to the command window.
HWND cmdWindow = GetConsoleWindow();

// Normally the command window is hidden. We want the window to be shown here so the user can see the progess of the
// extraction.
ShowWindow(cmdWindow, SW_SHOW);
SetWindowPos(cmdWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
#else
// Show extraction in background message until linux/mac can have visual progress
std::thread mbThread(MessageboxWorker);
mbThread.detach();
#endif

zapd_main(argc, (char**)argv.data());

#ifdef _WIN32
// Hide the command window again.
ShowWindow(cmdWindow, SW_HIDE);
#endif
zapd_report(argc, (char**)argv.data(), extractCount, totalExtract);

std::filesystem::copy(otrFile, exportdir + "/" + otrFile, std::filesystem::copy_options::overwrite_existing);

Expand Down
9 changes: 6 additions & 3 deletions soh/soh/Extractor/Extract.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef EXTRACT_H
#define EXTRACT_H

#include <atomic>
#include <stdint.h>
#include <string>
#include <memory>
Expand Down Expand Up @@ -45,23 +46,25 @@ class Extractor {
void SetRomInfo(const std::string& path);

void FilterRoms(std::vector<std::string>& roms, RomSearchMode searchMode);
void GetRoms(std::vector<std::string>& roms);
void ShowSizeErrorBox() const;
void ShowCrcErrorBox() const;
void ShowCompressedErrorBox() const;
int ShowRomPickBox(uint32_t verCrc) const;
bool ManuallySearchForRom();
bool ManuallySearchForRomMatchingType(RomSearchMode searchMode);

public:
// TODO create some kind of abstraction for message boxes.
static int ShowYesNoBox(const char* title, const char* text);
static void ShowErrorBox(const char* title, const char* text);
bool IsMasterQuest() const;
bool ManuallySearchForRomMatchingType(RomSearchMode searchMode);

void SetSearchPath(const std::string& path);
void GetRoms(std::vector<std::string>& roms);
bool RunFileStandalone(std::string file);
bool Run(std::string searchPath, RomSearchMode searchMode = RomSearchMode::Both);
bool CallZapd(std::string installPath, std::string exportdir);
bool CallZapd(std::string installPath, std::string exportdir, std::atomic<size_t>* extractCount,
std::atomic<size_t>* totalExtract);
const char* GetZapdStr();
std::string Mkdtemp();
};
Expand Down
Loading
Loading