Skip to content

Commit

Permalink
Update to 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
phacoxcll committed Sep 15, 2020
1 parent 9aa07c4 commit c61250b
Show file tree
Hide file tree
Showing 197 changed files with 1,878 additions and 504 deletions.
Empty file.
15 changes: 9 additions & 6 deletions PhacoxsInjector/HelpString.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
<value>La base no se cargó. Usa uno los juegos de GBA lanzados para la consola virtual de Wii U.</value>
</data>
<data name="GBABaseSelect" xml:space="preserve">
<value>Selecciona la carpeta del juego de la consola virtual de GBA de Wii U que deseas usar como base.</value>
<value>Selecciona un juego de la Consola Virtual de GBA de Wii U.</value>
</data>
<data name="HelpBox" xml:space="preserve">
<value>Ayuda</value>
Expand Down Expand Up @@ -244,7 +244,7 @@
<value>Cargar base</value>
</data>
<data name="LoadBaseDescription" xml:space="preserve">
<value>Cambia el juego base actual.</value>
<value>Un juego base no es una ROM, es un juego de la Consola Virtual de Wii U. El juego base es esencial ya que de esté se obtendrán los archivos necesarios para ejecutar la ROM en la Wii U. Aunque no todas las ROM son compatibles con la Consola Virtual de Wii U.</value>
</data>
<data name="LoadBaseWarningWiiUCK" xml:space="preserve">
<value>¡Advertencia! No podrás cargar una base empacada (formato WUP). Ingresa la clave común de Wii U (ve la sección de Ajustes).</value>
Expand Down Expand Up @@ -277,7 +277,7 @@
<value>La base no se cargó. Usa uno los juegos de N64 lanzados para la consola virtual de Wii U.</value>
</data>
<data name="N64BaseSelect" xml:space="preserve">
<value>Selecciona la carpeta del juego de la consola virtual de N64 de Wii U que deseas usar como base.</value>
<value>Selecciona un juego de la Consola Virtual de N64 de Wii U.</value>
</data>
<data name="N64ConfigFile" xml:space="preserve">
<value>Archivo de configuración</value>
Expand All @@ -292,7 +292,7 @@
<value>La base no se cargó. Usa uno los juegos de NDS lanzados para la consola virtual de Wii U.</value>
</data>
<data name="NDSBaseSelect" xml:space="preserve">
<value>Selecciona la carpeta del juego de la consola virtual de NDS de Wii U que deseas usar como base.</value>
<value>Selecciona un juego de la Consola Virtual de NDS de Wii U.</value>
</data>
<data name="NDSIconBackground" xml:space="preserve">
<value>Fondo del icono de NDS</value>
Expand All @@ -310,7 +310,7 @@
<value>La base no se cargó. Usa uno los juegos de NES lanzados para la consola virtual de Wii U.</value>
</data>
<data name="NESBaseSelect" xml:space="preserve">
<value>Selecciona la carpeta del juego de la consola virtual de NES de Wii U que deseas usar como base.</value>
<value>Selecciona un juego de la Consola Virtual de NES de Wii U.</value>
</data>
<data name="NotPack" xml:space="preserve">
<value>No empacar</value>
Expand Down Expand Up @@ -373,7 +373,7 @@
<value>La base no se cargó. Usa uno los juegos de SNES lanzados para la consola virtual de Wii U.</value>
</data>
<data name="SNESBaseSelect" xml:space="preserve">
<value>Selecciona la carpeta del juego de la consola virtual de SNES de Wii U que deseas usar como base.</value>
<value>Selecciona un juego de la Consola Virtual de SNES de Wii U.</value>
</data>
<data name="TitleID" xml:space="preserve">
<value>Title ID</value>
Expand Down Expand Up @@ -468,4 +468,7 @@
<data name="PlayersDescription" xml:space="preserve">
<value>Indica el número máximo de jugadores que soporta el juego que quieres inyectar.</value>
</data>
<data name="ModeSelectWarning" xml:space="preserve">
<value>Estás a punto de cambiar el modo de aplicación, habiendo seleccionado una ROM previamente. El cambio hará que tengas que seleccionar una ROM nuevamente.</value>
</data>
</root>
15 changes: 9 additions & 6 deletions PhacoxsInjector/HelpString.resx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<value>The base is invalid.</value>
</data>
<data name="NESBaseSelect" xml:space="preserve">
<value>Select the game folder of the Wii U NES VC that you want to use as base.</value>
<value>Select a Wii U NES Virtual Console game.</value>
</data>
<data name="ChooseN64ConfigFile" xml:space="preserve">
<value>Choose N64 configuration file</value>
Expand Down Expand Up @@ -223,7 +223,7 @@
<value>Load base</value>
</data>
<data name="LoadBaseDescription" xml:space="preserve">
<value>Change the current base game.</value>
<value>A base game is not a ROM, it is a Wii U Virtual Console game. The base game is essential, since this will obtain the necessary files to run the ROM on the Wii U. Although not all ROMs are compatible with the Wii U Virtual Console.</value>
</data>
<data name="LoadBaseWarningWiiUCK" xml:space="preserve">
<value>Warning! You will not be able to load a packed base (WUP format). Enter the Wii U common key (see Settings section).</value>
Expand Down Expand Up @@ -366,16 +366,16 @@
<value>Enlarge or reduce the viewing area of the game. If you expand it a lot you can leave the screen.</value>
</data>
<data name="SNESBaseSelect" xml:space="preserve">
<value>Select the game folder of the Wii U SNES VC that you want to use as base.</value>
<value>Select a Wii U SNES Virtual Console game.</value>
</data>
<data name="N64BaseSelect" xml:space="preserve">
<value>Select the game folder of the Wii U N64 VC that you want to use as base.</value>
<value>Select a Wii U N64 Virtual Console game.</value>
</data>
<data name="GBABaseSelect" xml:space="preserve">
<value>Select the game folder of the Wii U GBA VC that you want to use as base.</value>
<value>Select a Wii U GBA Virtual Console game.</value>
</data>
<data name="NDSBaseSelect" xml:space="preserve">
<value>Select the game folder of the Wii U NDS VC that you want to use as base.</value>
<value>Select a Wii U NDS Virtual Console game.</value>
</data>
<data name="NESBaseErrorDescription" xml:space="preserve">
<value>The base did not load. Use one of the NES games released for the Wii U VC.</value>
Expand Down Expand Up @@ -476,4 +476,7 @@
<data name="PlayersDescription" xml:space="preserve">
<value>Indicates the maximum number of players that supports the game you want to inject.</value>
</data>
<data name="ModeSelectWarning" xml:space="preserve">
<value>You are about to change the application mode, having previously selected a ROM. The change will make you have to select a ROM again.</value>
</data>
</root>
Binary file added PhacoxsInjector/JSON.dll
Binary file not shown.
17 changes: 11 additions & 6 deletions PhacoxsInjector/N64Injector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override string TitleId
flags |= Widescreen ? 0x40 : 0;
flags |= ScaleX != 1.0F ? 0x20 : (ScaleY != 1.0F ? 0x20 : (TranslationX != 0.0F ? 0x20 : (TranslationY != 0.0F ? 0x20 : 0)));

return "0005000064" + crc.ToString("X4") + ((byte)(flags)).ToString("X2");
return "0005000264" + crc.ToString("X4") + ((byte)(flags)).ToString("X2");
}
else
return "";
Expand Down Expand Up @@ -293,11 +293,16 @@ protected override void InjectRom()
}

protected override WiiUVC GetLoadedBase()
{
return GetBase(BasePath);
}

public VCN64 GetBase(string path)
{
try
{
ValidateBase(BasePath);
FileStream fs = File.Open(BasePath + "\\code\\VESSEL.rpx", FileMode.Open);
ValidateBase(path);
FileStream fs = File.Open(path + "\\code\\VESSEL.rpx", FileMode.Open);
uint hash = Cll.Security.ComputeCRC32(fs);
fs.Close();
return VCN64.GetVC(hash);
Expand All @@ -308,7 +313,7 @@ protected override WiiUVC GetLoadedBase()
}
}

protected override void ValidateBase(string path)
public override void ValidateBase(string path)
{
string[] folders = {
path + "\\content\\config",
Expand All @@ -328,10 +333,10 @@ protected override void ValidateBase(string path)
path + "\\meta\\meta.xml"
};

ValidateBase(folders,files);
ValidateBase(folders, files);
}

protected override void ValidateEncryptedBase(string path)
public override void ValidateEncryptedBase(string path)
{
ValidateEncryptedBase(path, "VESSEL.rpx");
}
Expand Down
62 changes: 55 additions & 7 deletions PhacoxsInjector/NDSInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ namespace PhacoxsInjector
{
public class NDSInjector : WiiUInjector
{
public bool DarkFilter;

public string LayoutFilePath
{ private set; get; }

public Bitmap RomIcon
{
get
Expand All @@ -23,7 +28,7 @@ public override string TitleId
get
{
if (BaseIsLoaded && RomIsValid)
return "00050000D5" + Rom.HashCRC16.ToString("X4") + Base.Index.ToString("X2");
return "00050002D5" + Rom.HashCRC16.ToString("X4") + Base.Index.ToString("X2");
else
return "";
}
Expand All @@ -42,6 +47,11 @@ public override void SetRom(string romPath)
Rom = new RomNDS(romPath);
}

public void SetLayoutFile(string layoutFilePath)
{
LayoutFilePath = layoutFilePath;
}

public override void Inject(bool encrypt, string outputPath, string shortName, string longName,
Bitmap menuIconImg, Bitmap bootTvImg, Bitmap bootDrcImg)
{
Expand All @@ -54,6 +64,9 @@ public override void Inject(bool encrypt, string outputPath, string shortName, s
if (!BaseIsLoaded)
throw new Exception("The base is not ready.");

if (!InjectGameLayout())
throw new Exception("Failed.");

InjectImages(menuIconImg, bootTvImg, bootDrcImg);
if (RomIsValid)
{
Expand All @@ -67,6 +80,34 @@ public override void Inject(bool encrypt, string outputPath, string shortName, s
throw new Exception("\"" + BasePath + "\" copy failed.");
}

private bool InjectGameLayout()
{
StreamReader sr = null;
try
{
sr = File.OpenText(Path.Combine(BasePath, "content", "0010", "configuration_cafe.json"));
Cll.JSON.SyntacticAnalyzer syn = new Cll.JSON.SyntacticAnalyzer(sr);
Cll.JSON.Element json = syn.Run();
sr.Close();

Cll.JSON.Object config = (Cll.JSON.Object)json.Value.GetValue("configuration");

if (DarkFilter)
config.GetValue("Display").SetValue("Brightness", new Cll.JSON.Number(80));
else
config.GetValue("Display").SetValue("Brightness", new Cll.JSON.Number(100));

string text = json.ToString("");
File.WriteAllText(Path.Combine(BasePath, "content", "0010", "configuration_cafe.json"), text);

return true;
}
catch { }
finally { if (sr != null) sr.Close(); }

return false;
}

protected override void InjectRom()
{
if (!Directory.Exists(Environment.CurrentDirectory + "\\resources"))
Expand All @@ -90,11 +131,16 @@ protected override void InjectRom()
}

protected override WiiUVC GetLoadedBase()
{
return GetBase(BasePath);
}

public VCNDS GetBase(string path)
{
try
{
ValidateBase(BasePath);
FileStream fs = File.Open(BasePath + "\\code\\hachihachi_ntr.rpx", FileMode.Open);
ValidateBase(path);
FileStream fs = File.Open(path + "\\code\\hachihachi_ntr.rpx", FileMode.Open);
uint hash = Cll.Security.ComputeCRC32(fs);
fs.Close();
return VCNDS.GetVC(hash);
Expand All @@ -105,11 +151,13 @@ protected override WiiUVC GetLoadedBase()
}
}

protected override void ValidateBase(string path)
public override void ValidateBase(string path)
{
string[] folders = {
path + "\\content\\0010\\assets",
path + "\\content\\0010\\data"
path + "\\content\\0010\\assets\\textures",
path + "\\content\\0010\\data",
path + "\\content\\0010\\data\\strings"
};

string[] files = {
Expand All @@ -126,8 +174,8 @@ protected override void ValidateBase(string path)

ValidateBase(folders, files);
}
protected override void ValidateEncryptedBase(string path)

public override void ValidateEncryptedBase(string path)
{
ValidateEncryptedBase(path, "hachihachi_ntr.rpx");
}
Expand Down
17 changes: 11 additions & 6 deletions PhacoxsInjector/NESInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override string TitleId
get
{
if (BaseIsLoaded && RomIsValid)
return "0005000061" + Rom.HashCRC16.ToString("X4") + Base.Index.ToString("X2");
return "0005000261" + Rom.HashCRC16.ToString("X4") + Base.Index.ToString("X2");
else
return "";
}
Expand Down Expand Up @@ -107,19 +107,24 @@ protected override void InjectRom()
}

protected override WiiUVC GetLoadedBase()
{
return GetBase(BasePath);
}

public VCNES GetBase(string path)
{
try
{
ValidateBase(BasePath, false);
RPXNES vc = ValidateRPX(BasePath);
ValidateBase(path, false);
RPXNES vc = ValidateRPX(path);
return VCNES.GetVC(vc.CRCsSum);
}
catch
{
return null;
}
}

private RPXNES ValidateRPX(string path)
{
DirectoryInfo code = new DirectoryInfo(path + "\\code");
Expand Down Expand Up @@ -161,12 +166,12 @@ private void ValidateBase(string path, bool validateRPX)
ValidateRPX(path);
}

protected override void ValidateBase(string path)
public override void ValidateBase(string path)
{
ValidateBase(path, true);
}

protected override void ValidateEncryptedBase(string path)
public override void ValidateEncryptedBase(string path)
{
string appFileName = GetAppFileName(path);

Expand Down
20 changes: 18 additions & 2 deletions PhacoxsInjector/PhacoxsInjector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>true</Prefer32Bit>
<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand All @@ -33,7 +33,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>true</Prefer32Bit>
<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
</PropertyGroup>
<PropertyGroup>
Expand Down Expand Up @@ -185,7 +185,22 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>cll.pfx</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="JSON">
<HintPath>..\..\JSON\JSON\bin\x86\Release\JSON.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression.FileSystem" />
Expand Down Expand Up @@ -272,6 +287,7 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="cll.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
Loading

0 comments on commit c61250b

Please sign in to comment.