Skip to content

Commit

Permalink
Merge branch 'hedge-dev:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
theblazingrush authored Jan 5, 2024
2 parents 6125cfc + 9304610 commit 9695345
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Code "Fix Air Boost Reset" in "Fixes/Gameplay" by "Hyper & Weezley" does "Allows
#lib "Bitwise"
#lib "BlackboardStatus"
#lib "Player"
#lib "HMM"

using System.Collections.Generic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Code "Enable Lives in Anniversary Mode" in "Gameplay" by "ĐeäTh" does
Disables the flag for Coins when playing in Anniversary Mode.

Notes;
- This will cause Anniversary Mode to use a different set of saves from normal, and your regular Anniversary Mode saves will be inaccessible."
- This will cause Anniversary Mode to use a different set of saves from normal, and your regular Anniversary Mode saves will be inaccessible.
*/
//
#lib "RSDK"
Expand All @@ -14,21 +14,21 @@ Notes;
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x1FC) == 1)
{
// Sonic 1 Coin Mode
WriteProtected<byte>(RSDK.GetRSDKv4DataPtr() + 0x1FC, 0x00);
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x1FC) = 0;
}

// Check if Sonic 2 game.playMode is set to BOOT_PLAYMODE_ANNIVERSARY
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x23C) == 1)
{
// Sonic 2 Coin Mode
WriteProtected<byte>(RSDK.GetRSDKv4DataPtr() + 0x288, 0x00);
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x288) = 0;
}

// Check if RSDKv3 game.playMode is set to BOOT_PLAYMODE_ANNIVERSARY
if (*(byte*)(RSDK.GetRSDKv3DataPtr() + 0x1DC) == 1)
{
// Sonic CD Coin Mode
WriteProtected<byte>(RSDK.GetRSDKv3DataPtr() + 0x220, 0x00);
*(byte*)(RSDK.GetRSDKv3DataPtr() + 0x220) = 0;
}

// Sonic 3&K Coin Mode and HUD Update
Expand All @@ -43,15 +43,13 @@ Notes;
// HUD Update
// Version 1.0.0: RSDKGlobalsPtr + 0x447D20
// Version 1.0.4: RSDKGlobalsPtr + 0x4C34D4 (Thanks to RDC)
WriteProtected<byte>(RSDK.GetRSDKGlobalsAbsPtr() + 0xD0, 0x00);
*(byte*)(RSDK.GetRSDKGlobalsAbsPtr() + 0xD0) = 0;

// Coin Mode
// Version 1.0.0: RSDKGlobalsPtr + 0x447CD4
// Version 1.0.4: RSDKGlobalsPtr + 0x4C3520 (Thanks to RDC)
// Version 2.0.0: RSDKGlobalsPtr + RSDKGlobalsOffset + 0x124
WriteProtected<byte>(RSDK.GetRSDKGlobalsAbsPtr() + 0x124, 0x00);
*(byte*)(RSDK.GetRSDKGlobalsAbsPtr() + 0x124) = 0;
}
}
}


14 changes: 6 additions & 8 deletions Source/Sonic Origins/Gameplay/Enable Lives in Mirror Mode.hmm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Code "Enable Lives in Mirror Mode" in "Gameplay" by "ĐeäTh" does
Disables the flag for Coins when playing in Mirror Mode.

Notes;
- This will cause Mirror Mode to use a different set of saves from normal, and your regular Mirror Mode saves will be inaccessible."
- This will cause Mirror Mode to use a different set of saves from normal, and your regular Mirror Mode saves will be inaccessible.
*/
//
#lib "RSDK"
Expand All @@ -14,21 +14,21 @@ Notes;
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x1FC) == 3)
{
// Sonic 1 Coin Mode
WriteProtected<byte>(RSDK.GetRSDKv4DataPtr() + 0x1FC, 0x00);
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x1FC) = 0;
}

// Check if Sonic 2 game.playMode is set to BOOT_PLAYMODE_MIRRORING
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x23C) == 3)
{
// Sonic 2 Coin Mode
WriteProtected<byte>(RSDK.GetRSDKv4DataPtr() + 0x288, 0x00);
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x288) = 0;
}

// Check if RSDKv3 game.playMode is set to BOOT_PLAYMODE_MIRRORING
if (*(byte*)(RSDK.GetRSDKv3DataPtr() + 0x1DC) == 3)
{
// Sonic CD Coin Mode
WriteProtected<byte>(RSDK.GetRSDKv3DataPtr() + 0x220, 0x00);
*(byte*)(RSDK.GetRSDKv3DataPtr() + 0x220) = 0;
}

// Sonic 3&K Coin Mode and HUD Update
Expand All @@ -43,15 +43,13 @@ Notes;
// HUD Update
// Version 1.0.0: RSDKGlobalsPtr + 0x447D20
// Version 1.0.4: RSDKGlobalsPtr + 0x4C34D4 (Thanks to RDC)
WriteProtected<byte>(RSDK.GetRSDKGlobalsAbsPtr() + 0xD0, 0x00);
*(byte*)(RSDK.GetRSDKGlobalsAbsPtr() + 0xD0) = 0;

// Coin Mode
// Version 1.0.0: RSDKGlobalsPtr + 0x447CD4
// Version 1.0.4: RSDKGlobalsPtr + 0x4C3520 (Thanks to RDC)
// Version 2.0.0: RSDKGlobalsPtr + RSDKGlobalsOffset + 0x124
WriteProtected<byte>(RSDK.GetRSDKGlobalsPtr() + 0x124, 0x00);
*(byte*)(RSDK.GetRSDKGlobalsAbsPtr() + 0x124) = 0;
}
}
}


21 changes: 21 additions & 0 deletions Source/Sonic Origins/Gameplay/Sonic 1/Enable 7th Chaos Emerald.hmm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Code "Enable 7th Chaos Emerald" in "Gameplay/Sonic 1" by "MegAmi" does
/*
Enables the 7th Chaos Emerald in normal gameplay, allowing the player to use Super forms once all seven are collected.

Notes;
- The game does not check the emeralds setting when checking if the player should transform, so collecting all seven emeralds in a save file will allow the player to transform regardless of whether or not this code is enabled.
*/
//
#lib "RSDK"
//
{
// Check if this is Sonic 1
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0xC8) == 0xFF)
{
// Check if Super forms (options.superStates) are disabled
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x38) != 0x01)
{
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x38) = 0x01;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Code "Enable Elemental Shields and Insta Shield (experimental)" in "Gameplay/Sonic 1" by "MegAmi" does
/*
Enables the Elemental Shields and Sonic's Insta Shield move.

Known issues;
- The elemental shield monitors will not appear upon initial stage load when starting the game from the main menu. This is fixed upon loading the stage again or loading a different one.
- Progress in save files will not be saved.
*/
//
#lib "RSDK"
//
{
// Check if this is Sonic 1
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0xC8) == 0xFF)
{
// Check if elemental shields (second bit of options.shieldType) are disabled
if ((*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x34) & 2) == 0)
{
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x34) |= 2;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Code "Enable Sonic 2 Style Items (experimental)" in "Gameplay/Sonic 1" by "MegAmi" does
/*
Enables the Sonic 2 style Blue Shield and invincibility stars.

Known issues;
- The Sonic 1 style items will still appear upon initial stage load when starting the game from the main menu. This is fixed upon loading the stage again or loading a different one.
- Progress in save files will not be saved.
*/
//
#lib "RSDK"
//
{
// Check if this is Sonic 1
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0xC8) == 0xFF)
{
// Check if S2 items (first bit of options.shieldType) are disabled
if ((*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x34) & 1) == 0)
{
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x34) |= 1;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Code "Enable Elemental Shields and Insta Shield (experimental)" in "Gameplay/Sonic 2" by "MegAmi" does
/*
Enables the Elemental Shields and Sonic's Insta Shield move.

Known issues;
- The elemental shield monitors will not appear upon initial stage load when starting the game from the main menu. This is fixed upon loading the stage again or loading a different one.
- Progress in save files will not be saved.
*/
//
#lib "RSDK"
//
{
// Check if this is Sonic 2
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0xC8) != 0xFF)
{
// Check if elemental shields (first bit of options.shieldType) are disabled
if ((*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x30) & 1) == 0)
{
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x30) |= 1;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Code "Enable Random Monitors (experimental)" in "Gameplay/Sonic 2" by "MegAmi" does
/*
Replaces all monitors in the stages with random monitors.

Known issues;
- The random monitors will not appear upon initial stage load when starting the game from the main menu. This is fixed upon loading the stage again or loading a different one.
- Progress in save files will not be saved.
*/
//
#lib "RSDK"
//
{
// Check if this is Sonic 2
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0xC8) != 0xFF)
{
// Check if random monitors (second bit of options.shieldType) are disabled
if ((*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x30) & 2) == 0)
{
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x30) |= 2;
}
}
}
21 changes: 21 additions & 0 deletions Source/Sonic Origins/Gameplay/Sonic 2/Enable Super Tails.hmm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Code "Enable Super Tails" in "Gameplay/Sonic 2" by "MegAmi" does
/*
Allows Tails to transform into Super Tails, like the other characters.

Notes;
- Due to using the same palette colors as Tails, the Coins icon will flash along with Tails when in his Super form.
*/
//
#lib "RSDK"
//
{
// Check if this is Sonic 2
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0xC8) != 0xFF)
{
// Check if Super Tails (options.superTails) is disabled
if (*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x40) != 0x01)
{
*(byte*)(RSDK.GetRSDKv4DataPtr() + 0x40) = 0x01;
}
}
}

0 comments on commit 9695345

Please sign in to comment.