Skip to content

Commit

Permalink
Added a load screen remover extra for rayman 2
Browse files Browse the repository at this point in the history
Reverted the reload engine mode change from last commit because it didn't work
  • Loading branch information
rtsonneveld committed Jan 27, 2024
1 parent 0d079ef commit 2970f79
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public Rayman2GameManager()
new Rayman2CheckpointExtra(this, Rayman2CheckpointExtra.CheckpointMode.CurrentPosition),
new Rayman2CheckpointExtra(this, Rayman2CheckpointExtra.CheckpointMode.SavedPosition),
new Rayman2RespawnAnimRemover(this),
new Rayman2LoadingScreenRemover(this),
};

//Levels
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Threading;

namespace OpenSpaceToolbox
{
public class Rayman2LoadingScreenRemover : OpenspaceExtraAction {

public Rayman2LoadingScreenRemover(Rayman2GameManager gameManager) : base(gameManager)
{
Name = ShortName = $"⚠ Remove loading screens";

Tooltip = "⚠ Warning: these actions require a game restart to undo!";
}

public override void Action()
{
int processHandle = GameManager.GetProcessHandle();
if (processHandle < 0)
return;

byte[] nopInstructions = new byte[] { 0x90, 0x90, 0x90, 0x90, 0x90};

GameManager.WriteBytes(nopInstructions, 0x45F85E);
GameManager.WriteBytes(nopInstructions, 0x4508F0);
GameManager.WriteBytes(nopInstructions, 0x4043D6);
}
}
}
5 changes: 3 additions & 2 deletions OpenSpaceToolbox/GameManager/OpenspaceGameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;

namespace OpenSpaceToolbox
Expand Down Expand Up @@ -247,8 +248,8 @@ public override void ReloadLevel()
currentBufferLevelName.Length, ref bytesReadOrWritten);

if (currentBufferLevelName[0] == 0) return;
WriteEngineMode(EnumEngineMode.EnterLevel);

WriteEngineMode(EnumEngineMode.ChangeLevel);
}

public override void LoadOffsetLevel(int offset)
Expand Down
1 change: 1 addition & 0 deletions OpenSpaceToolbox/OpenSpaceToolbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<Compile Include="DataModels\GameList.cs" />
<Compile Include="GameManager\EnumEngineMode.cs" />
<Compile Include="GameManager\Games\Generic\GenericSpeedMonitorExtra.cs" />
<Compile Include="GameManager\Games\Rayman2\Rayman2LoadingScreenRemover.cs" />
<Compile Include="GameManager\Games\Rayman2\Rayman2RespawnAnimRemover.cs" />
<Compile Include="GameManager\Games\Rayman2\Rayman2MaxHpExtra.cs" />
<Compile Include="GameManager\Games\Rayman2\Rayman2ProgressArrayExtra.cs" />
Expand Down

0 comments on commit 2970f79

Please sign in to comment.