Skip to content

Commit

Permalink
Fix Cutscene Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wagrenier committed Aug 11, 2021
1 parent 6ded831 commit 67ddbf3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
7 changes: 4 additions & 3 deletions ZeroUndubProcess/ExternalProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public static void PssDemux(int fileId, string region, string folder)
{
FileName = "PSS_Plex.exe",
UseShellExecute = false,
CreateNoWindow = false,
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden,
Arguments = args
}
};
Expand Down Expand Up @@ -57,7 +58,8 @@ public static void PssMux(int fileId, string folder)
{
FileName = "PSS_Plex.exe",
UseShellExecute = false,
CreateNoWindow = false,
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden,
Arguments = args
}
};
Expand All @@ -75,7 +77,6 @@ public static void PssMux(int fileId, string folder)
{
}
}


File.Delete($"{folder}/{fileId}_eu.WAV");
File.Delete($"{folder}/{fileId}_jp.WAV");
Expand Down
7 changes: 7 additions & 0 deletions ZeroUndubProcess/PssAudioHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace ZeroUndubProcess
{
public sealed class PssAudioHandler
{

}
}
2 changes: 1 addition & 1 deletion ZeroUndubProcess/WriterIsoHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void OverwriteFile(ZeroFile zeroFile, byte[] buffer)

if (newFileSize > (int) zeroFile.Size)
{
Console.WriteLine($"File {zeroFile.FileId} cannot be undubbed.");
Console.WriteLine($"File {zeroFile.FileId} cannot be undubbed. Difference of {newFileSize - zeroFile.Size}");
return;
}

Expand Down
15 changes: 14 additions & 1 deletion ZeroUndubProcess/ZeroFileImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void RestoreGame()
{
UndubbedFiles = i;
var zeroFile = _euReaderHandler.ExtractFileInfo(i);
Console.WriteLine($"FileId: {zeroFile.FileId}, Offset: {zeroFile.Offset}, Size: {zeroFile.Size}");
//Console.WriteLine($"FileId: {zeroFile.FileId}, Offset: {zeroFile.Offset}, Size: {zeroFile.Size}");

if (zeroFile.FileId == 660)
{
Expand Down Expand Up @@ -155,6 +155,7 @@ private void PssUndub(ZeroFile zeroFile)
if (newVideoBuffer.Length > pss[i].EuSize)
{
Console.WriteLine($"File {pss[i].Filename} is too big to be imported");
continue;
}

_euWriterHandler.PatchBytesAtAbsoluteOffset(pss[i].EuOffset, newVideoBuffer);
Expand Down Expand Up @@ -249,6 +250,18 @@ private void SwapModels(ZeroFile euFile)
case 1067:
jpFileIndex = 748;
break;
case 1068:
jpFileIndex = 749;
break;
case 1069:
jpFileIndex = 750;
break;
case 1070:
jpFileIndex = 751;
break;
case 1071:
jpFileIndex = 752;
break;
default:
return;
}
Expand Down

0 comments on commit 67ddbf3

Please sign in to comment.