diff --git a/AquaMai/AquaMai.csproj b/AquaMai/AquaMai.csproj
index 815e02d6..b7f6d42b 100644
--- a/AquaMai/AquaMai.csproj
+++ b/AquaMai/AquaMai.csproj
@@ -266,6 +266,7 @@
+
diff --git a/AquaMai/AquaMai.toml b/AquaMai/AquaMai.toml
index bdbe445e..47e7c6ef 100644
--- a/AquaMai/AquaMai.toml
+++ b/AquaMai/AquaMai.toml
@@ -13,4 +13,8 @@ SkipWarningScreen=true
# Single player: Show 1P only, at the center of the screen
SinglePlayer=true
# !!EXPERIMENTAL!! Skip from the card-scanning screen directly to music selection screen
-SkipToMusicSelection=false
\ No newline at end of file
+SkipToMusicSelection=false
+
+[Performance]
+# Disable some useless checks and delays to speedup the game boot process
+ImproveLoadSpeed=false
\ No newline at end of file
diff --git a/AquaMai/Config.cs b/AquaMai/Config.cs
index a9b8fb56..07c1b14b 100644
--- a/AquaMai/Config.cs
+++ b/AquaMai/Config.cs
@@ -7,6 +7,7 @@ namespace AquaMai
{
public UXConfig UX { get; set; }
public CheatConfig Cheat { get; set; }
+ public PerformanceConfig Performance { get; set; }
public class CheatConfig
{
@@ -19,5 +20,10 @@ namespace AquaMai
public bool SinglePlayer { get; set; }
public bool SkipToMusicSelection { get; set; }
}
+
+ public class PerformanceConfig
+ {
+ public bool ImproveLoadSpeed { get; set; }
+ }
}
}
diff --git a/AquaMai/Performance/ImproveLoadSpeed.cs b/AquaMai/Performance/ImproveLoadSpeed.cs
new file mode 100644
index 00000000..1e659adc
--- /dev/null
+++ b/AquaMai/Performance/ImproveLoadSpeed.cs
@@ -0,0 +1,57 @@
+using System.Diagnostics;
+using HarmonyLib;
+using MelonLoader;
+using Process;
+
+namespace AquaMai.Performance
+{
+ public class ImproveLoadSpeed
+ {
+ [HarmonyPrefix]
+ [HarmonyPatch(typeof(PowerOnProcess), "OnUpdate")]
+ public static bool PrePowerOnUpdate(PowerOnProcess __instance)
+ {
+ var traverse = Traverse.Create(__instance);
+ var state = traverse.Field("_state").GetValue();
+ switch (state)
+ {
+ case 3:
+ traverse.Field("_state").SetValue((byte)4);
+ break;
+ case 5:
+ traverse.Field("_state").SetValue((byte)8);
+ break;
+ case 9:
+ traverse.Field("_state").SetValue((byte)10);
+ break;
+ }
+
+ return true;
+ }
+
+ [HarmonyPrefix]
+ [HarmonyPatch(typeof(StartupProcess), "OnUpdate")]
+ public static bool PreStartupUpdate(StartupProcess __instance)
+ {
+ var traverse = Traverse.Create(__instance);
+ var state = traverse.Field("_state").GetValue();
+ switch (state)
+ {
+ case 0:
+ case 1:
+ case 2:
+ traverse.Field("_state").SetValue((byte)3);
+ break;
+ case 4:
+ traverse.Field("_state").SetValue((byte)5);
+ break;
+ case 8:
+ var timer = traverse.Field("timer").GetValue();
+ Traverse.Create(timer).Field("elapsed").SetValue(2 * 10000000L);
+ break;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file