Skip to content

Commit

Permalink
Patch RouteMenu to show next stages for stage 6xx+
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamsyntax committed Dec 5, 2023
1 parent 6b38520 commit 873d726
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ShadowRando/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public MainForm()
InitializeComponent();
}

const string programVersion = "0.3.0";
const string programVersion = "0.3.1";
private static string hoverSoundPath = AppDomain.CurrentDomain.BaseDirectory + "res/hover.wav";
private static string selectSoundPath = AppDomain.CurrentDomain.BaseDirectory + "res/select.wav";
Settings settings;
Expand Down Expand Up @@ -221,6 +221,8 @@ private void allowSameLevel_CheckedChanged(object sender, EventArgs e)
"Sonic & Diablon (FH)",
"Devil Doom"
};
const int routeMenu6xxStagePreviewBlockerOffset = 0xB48B8;
const int routeMenu6xxStagePreviewPatchValue = 0x48000110;
const int storyModeStartAddress = 0x2CB9F0;
const int firstStageOffset = 0x4C1BA8;
const int modeOffset = 8;
Expand Down Expand Up @@ -728,6 +730,13 @@ private void randomizeButton_Click(object sender, EventArgs e)
buf = BitConverter.GetBytes(0x38000000 | stageAssociationIDMap[stageids[0] + stagefirst]);
Array.Reverse(buf);
buf.CopyTo(dolfile, storyModeStartAddress);

// patch the route menu to allow stg06xx+ to display next stages
buf = BitConverter.GetBytes(routeMenu6xxStagePreviewPatchValue);
Array.Reverse(buf);
buf.CopyTo(dolfile, routeMenu6xxStagePreviewBlockerOffset);
// end patch

File.WriteAllBytes(Path.Combine(settings.GamePath, "sys", "main.dol"), dolfile);
if (randomMusic.Checked)
{
Expand Down

0 comments on commit 873d726

Please sign in to comment.