]> Chaos Git - console/untold1undub.git/commitdiff
Now with basic changes to support generating an EOV undub (yay) master
authorJon Feldman <chaos.kagami@gmail.com>
Wed, 18 Oct 2017 04:01:32 +0000 (00:01 -0400)
committerJon Feldman <chaos.kagami@gmail.com>
Wed, 18 Oct 2017 04:01:32 +0000 (00:01 -0400)
README.md
extract.c

index 71fc5c78460856d0c020577842133f19bd70a592..2ee03a0809e8fe816f5d9505be3b6c3832c94404 100644 (file)
--- a/README.md
+++ b/README.md
@@ -9,6 +9,8 @@ These tools are capable of modifying "Etrian Odyssey Untold: The Millenium Girl"
 
 The only reason this is possible is due to this guy: https://github.com/xdanieldzd and his tool UntoldUnpack, which served as documentation for implementing my own tool.
 
+Now with support for EOV, due to using the exact same data format! Whee.
+
 How to use
 ----------
 
@@ -21,7 +23,7 @@ More specifically: You need the data files MORI1R.HPI and MORI1R.HPB from both.
 First, run the following:
 
 ```
-./extract JPN_MORI1R.HPI JPN_MORI1R.HPB
+./extract JPN_MORI1R.HPI JPN_MORI1R.HPB 1
 ```
 
 This will generate an output folder named `VOICE` with the japanese voice data. Next, in the same directory, run the following:
@@ -34,6 +36,9 @@ This will generate two output files: out.hpi and out.hpb. These are your undub.
 
 For a full undub, you'll also want to overwrite the video files that are not in the archive and in the folder named `Mobiclip` within the romfs.
 
+If you want to do this with EOV, replace MORI1R with MORI5 and use '5' as the argument to extract instead of '1'. And use a 
+Japanese and English copy of that game, not Untold.
+
 How the hell does this work?
 ----------------------------
 
index c4a2ddc1fa19e9146ece0329c5a9636ed039164d..ff6c00c0fc8c1ef9aafee6864330baf87832f878 100644 (file)
--- a/extract.c
+++ b/extract.c
@@ -69,13 +69,24 @@ char* data_map(hpi_file_entry_t *entries, int index, char* data) {
 }
 
 int main(int c, char** v) {
+    if (c < 3 || c > 4) {
+        die("usage: extract hpi hpb [flavor]\n  flavor is either 1 (Untold), 5 (EOV), or 0 (Ignore)");
+    }
+
     FILE* hpi = fopen(v[1], "rb");
     FILE* hpb = fopen(v[2], "rb");
+    int flavor = 1;
+
     if (!hpi)
         die("Failed to open HPI.\n");
     if (!hpb)
         die("Failed to open HPB.\n");
 
+    if (c == 4)
+        flavor = v[3][0] - '0';
+    if (!(flavor == 1 || flavor == 5 || flavor == 0))
+        die("invalid flavor\n");
+
     fseek(hpi, 0, SEEK_END);
     size_t hpi_file_size = ftell(hpi);
     rewind(hpi);
@@ -111,7 +122,10 @@ int main(int c, char** v) {
         char *name = name_map(file_entries, i, filename_blob);
 
         // If you're poking around, comment this. Keep in mind no decompression is performed.
-        if (strncmp(name, "VOICE/", 6))
+        if (flavor == 1 && strncmp(name, "VOICE/", 6))
+            continue; // Not voice files, keep going
+
+        if (flavor == 5 && strncmp(name, "SND/", 4))
             continue; // Not voice files, keep going
 
         char* dir = dir_name(name);