For those unaware, Sonic 1 has three unused monitor types. These are Eggman, S, and Goggles. While the Eggman and Goggles monitors can easily be reworked (the former is the most common), the S monitor seems to be roped in with either enabling both invincibility and speed shoes or quick super transformation with 50 rings on the fly. But sometimes people want to rework something into a different purpose, and this tutorial aims that way for the S monitor. We are going to change the functionality for the S monitor to act as a key to spawn the Special Stage portal at the signpost. This guide aims towards the GitHub disassembly, but it can be workshopped for the Hivebrain 2005 disassembly. Step 1 - S Monitor Reworking Open the "2E Monitor Content Power-Up" asm file in the folder _incObj and scroll down to Pow_ChkS. Code: Pow_ChkS: cmpi.b #7,d0 ; does monitor contain 'S'? bne.s Pow_ChkEnd After the bne.s command, insert the following lines of code (make sure nop is gone): Code: move.b #1,(f_keycheck).w ; key is earned move.w #sfx_Cash,d0 jsr (PlaySound_Special).l ; play register sound If you're using the sfx macro, use this in place of the last two lines of the previous code: Code: sfx sfx_Cash,1,0,0 ; play ring sound This inserts functionality to the monitor, much like the ones the game currently uses. The sfx code reflects a macro for sound effect playback. The Hivebrain equivalent is Obj2E_ChkS. Step 2 - Giant Ring Check Change We need to get rid of the 50 ring check to instead reflect the S monitor's new purpose. Open the "4B Giant Ring" asm in the same folder and scroll down to GRing_Main and you should see this code: Code: GRing_Main: ; Routine 0 move.l #Map_GRing,obMap(a0) move.w #$2400,obGfx(a0) ori.b #4,obRender(a0) move.b #$40,obActWid(a0) tst.b obRender(a0) bpl.s GRing_Animate cmpi.b #6,(v_emeralds).w ; do you have 6 emeralds? beq.w GRing_Delete ; if yes, branch cmpi.w #50,(v_rings).w ; do you have at least 50 rings? bcc.s GRing_Okay ; if yes, branch rts At the last two lines before the rts, swap em out for these following lines: Code: tst.b (f_keycheck).w ; did you get the key? bne.s GRing_Okay ; if yes, branch (only if above 0) We have replaced a check for 50 rings with a tst.b command checking for the key address' value. This change is necessary since it is instead checking for the necessary byte rather than a word. If it's at 1, then the GRing_Okay routine is ready to place the portal at the end of the level. And if it's at 0, then the routine doesn't occur. The Hivebrain equivalent is Obj4B_Main. Step 3 - Additional Check Tweak At this point, the Giant Ring object will load at the signpost when the S monitor is broken in the level. But what if you go to the next level and you'll see the portal appear again despite not breaking this monitor again? Same applies if you died after breaking this monitor in a level, and a similar problem occurs upon respawning at the start of a level or at a lamppost. Go to the sonic.asm at the root of the disassembly, scroll to Level_ClrObjRam and insert this line within the empty space: Code: clr.b (f_keycheck).w ; key is redeemed The result should resemble the following: Code: Level_ClrObjRam: move.l d0,(a1)+ dbf d1,Level_ClrObjRam ; clear object RAM clr.b (f_keycheck).w ; key is earned lea ($FFFFF628).w,a1 moveq #0,d0 move.w #$15,d1 This makes sure the address is reset when the next level loads after a Special Stage or is reset from respawning. This is especially helpful considering this occurs in both scenarios. This label is the exact same in the Hivebrain 05 disassembly. Step 4 - Variable Equation (GitHub Specific) At the root of the disassembly, open the "Variables" asm and add this line at the very end of the file: Code: f_keycheck: equ $FFFFXXXX ; key flag (replace XXXX with correct address) Considering the GitHub disassembly's way of handling ram address and their equations, this feels like a necessity when adding new functions to previously unused ram addresses, although the original Hivebrain disassembly can just use the ram address we're using in place of f_keycheck. Make sure to replace XXXX with the address you're planning to use. Conclusion At the end of all this, you can plop one S monitor in each act with the suggestion of exploration to gain access to Special Stages (especially since if you put more than one, it'd only work for the first one obtained). The tiles for the S icon in the monitor art can also be changed to reflect the new purpose, like a key or a Chaos Emerald for example. Make sure the ram address you're using is not used by any other process. You can check what's safe to use at this page, although caution may be advised since some information may not stack up with what is (un)used: https://info.sonicretro.org/SCHG:Sonic_the_Hedgehog_(16-bit)/RAM_Editing This was inspired by this guide that workshops functionality to the Goggles monitor, which is created by Selbi, theocas, and Inferno Gear: https://info.sonicretro.org/SCHG_How-to:Set_up_the_Goggle_Monitor_to_work_with_it UPDATE 11/03/2022 - Changed some steps to reflect optimization and improved code from @Giovanni and proper explanations of what the code is doing.