Skip to content

Commit

Permalink
Merge pull request #17 from PikminGuts92/dev
Browse files Browse the repository at this point in the history
Wii texture support
  • Loading branch information
PikminGuts92 authored Mar 2, 2024
2 parents 5206699 + 2cad404 commit 9c49d40
Show file tree
Hide file tree
Showing 18 changed files with 335 additions and 90 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
ZIP_NAME: ${{ github.event.repository.name }}-ci-${{ github.sha }}-${{ matrix.osname }}
OUTPUT_PATH: ./build
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.nuget/packages
Expand All @@ -31,7 +31,7 @@ jobs:
Test/**/obj/*.*
key: ${{ matrix.osname }}-build-${{ hashFiles('**/*.csproj', './*.sln') }}
- name: Setup dotnet
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Test projects
Expand All @@ -41,7 +41,7 @@ jobs:
run: |
chmod +x ./build.sh
./build.sh -r ${{ matrix.osname }} -o ${{ env.OUTPUT_PATH }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ env.ZIP_NAME }}
path: ${{ env.OUTPUT_PATH }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Mackiloha [![CI](https://github.com/PikminGuts92/Mackiloha/workflows/CI/badge.svg)](https://github.com/PikminGuts92/Mackiloha/actions?query=workflow%3ACI)
A suite of modding software for hacking milo engine based games. This is still very much a work-in-progress project. So don't expect perfection. Although feel free to submit [issues](https://github.com/PikminGuts92/Mackiloha/issues) for any bugs found. The latest CI build can be found [here](https://github.com/PikminGuts92/Mackiloha/actions/workflows/ci.yml).

[Download](https://github.com/PikminGuts92/Mackiloha/releases/latest)
**[DOWNLOAD](https://github.com/PikminGuts92/Mackiloha/releases/latest)**

# Overview
## Ark Helper
Expand All @@ -27,7 +27,7 @@ Usage:
- Create project from milo: `p9songtool.exe milo2proj -m temporarysec.mid temporarysec.milo_xbox project_temporarysec`
- Generate milo from project: `p9songtool.exe proj2milo project_temporarysec temporarysec.milo_xbox`

## SuperFreq (pronounced "Super Freak")
## SuperFreq
CLI tool for unpacking/packing rnd archives from milo games. These files usually use the extensions: .gh, .kr, .milo, .rnd

**Warning:** Game compatibility is *very* limited. Editing archives for games beyond GH2 will have mixed results.
Expand Down
14 changes: 13 additions & 1 deletion Src/Apps/ArkHelper/Apps/Ark2DirApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Mackiloha.CSV;
using Mackiloha.IO;
using Mackiloha.Milo;
using System.Diagnostics;
using System.Text.RegularExpressions;
using static Mackiloha.FileHelper;

Expand Down Expand Up @@ -83,6 +84,8 @@ public void Parse(Ark2DirOptions op)
int arkVersion;
bool arkEncrypted;

var watch = Stopwatch.StartNew();

if (!op.ExtractAll
&& !op.ConvertScripts
&& !op.ConvertTextures
Expand Down Expand Up @@ -174,7 +177,13 @@ public void Parse(Ark2DirOptions op)
var info = new SystemInfo()
{
Version = 10,
Platform = Platform.PS2,
Platform = textureEntry.FileName switch
{
var p when p.EndsWith("_ps3", StringComparison.InvariantCultureIgnoreCase) => Platform.PS3,
var p when p.EndsWith("_wii", StringComparison.InvariantCultureIgnoreCase) => Platform.Wii,
var p when p.EndsWith("_xbox", StringComparison.InvariantCultureIgnoreCase) => Platform.X360,
_ => Platform.PS2
},
BigEndian = false
};

Expand Down Expand Up @@ -284,5 +293,8 @@ public void Parse(Ark2DirOptions op)
// Clean up temp files
if (Directory.Exists(tempDir))
Directory.Delete(tempDir, true);

watch.Stop();
Log.Information("Finished extracting ark in {WatchElapsed}", watch.Elapsed);
}
}
6 changes: 6 additions & 0 deletions Src/Apps/ArkHelper/Apps/Dir2ArkApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using ArkHelper.Options;
using Mackiloha;
using Mackiloha.Ark;
using System.Diagnostics;
using System.Text.RegularExpressions;

namespace ArkHelper.Apps;
Expand Down Expand Up @@ -38,6 +39,7 @@ public void Parse(Dir2ArkOptions op)
}

var arkDir = Path.GetFullPath(op.OutputPath);
var watch = Stopwatch.StartNew();

// Set encrypted data
if (op.ArkVersion < 3)
Expand Down Expand Up @@ -175,6 +177,10 @@ public void Parse(Dir2ArkOptions op)
}

ark.CommitChanges(true);
watch.Stop();

Log.Information("Finished building ark in {WatchElapsed}", watch.Elapsed);

if (op.ArkVersion < 3)
Log.Information("Wrote ark to \"{ArkPath}\"", hdrPath);
else
Expand Down
4 changes: 2 additions & 2 deletions Src/Apps/ArkHelper/ArkHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CliWrap" Version="3.6.4" />
<PackageReference Include="CliWrap" Version="3.6.6" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 6 additions & 5 deletions Src/Apps/P9SongTool/Apps/Milo2ProjectApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ protected SystemInfo GetSystemInfo(Milo2ProjectOptions op)
{
Version = 25,
BigEndian = true,
Platform = op.InputPath
.ToLower()
.EndsWith("_ps3")
? Platform.PS3
: Platform.X360
Platform = op.InputPath.ToLower() switch
{
var p when p.EndsWith("_ps3") => Platform.PS3,
var p when p.EndsWith("_wii") => Platform.Wii,
_ => Platform.X360
}
};

protected List<MiloObject> GetEntries(MiloObjectDir miloDir)
Expand Down
11 changes: 6 additions & 5 deletions Src/Apps/P9SongTool/Apps/Project2MiloApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,12 @@ protected SystemInfo GetSystemInfo(Project2MiloOptions op)
{
Version = 25,
BigEndian = true,
Platform = op.OutputPath
.ToLower()
.EndsWith("_ps3")
? Platform.PS3
: Platform.X360
Platform = op.OutputPath.ToLower() switch
{
var p when p.EndsWith("_ps3") => Platform.PS3,
var p when p.EndsWith("_wii") => Platform.Wii,
_ => Platform.X360
}
};

protected MiloObjectDir CreateRootDirectory(string name)
Expand Down
2 changes: 1 addition & 1 deletion Src/Apps/P9SongTool/P9SongTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="NAudio.Midi" Version="2.2.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Src/Apps/SuperFreq/Options/GameOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class GameOptions : BaseOptions
[Option('b', "bigEndian", Default = false, HelpText = "Use big endian serialization")]
public bool BigEndian { get; set; }

[Option('p', "platform", Default = "ps2", HelpText = "Platform (ps2, x360)")]
[Option('p', "platform", Default = "ps2", HelpText = "Platform (ps2, ps3, x360, wii)")]
public string PlatformString { get; set; }
public Platform Platform { get; set; } = Platform.PS2;

Expand Down
2 changes: 1 addition & 1 deletion Src/Apps/SuperFreq/SuperFreq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 9c49d40

Please sign in to comment.