Spoiler I couldn't see a topic about this subject, or I couldn't see it on the bug list, or anywhere else, so I thought I'd post my fix here How to fix accidental deletion of scattered rings The problem There is a glitch within the scattered rings. Let me explain. In the scattered rings code, there is a check to see if rings have reached to the bottom of the level and if so, to delete themselves. Here is some code from Sonic 2's scattered rings object. Code (ASM): loc_121B8: tst.b (Ring_spill_anim_counter).w beq.s BranchTo5_DeleteObject move.w (Camera_Max_Y_pos_now).w,d0 ; HERE addi.w #$E0,d0 ; HERE cmp.w y_pos(a0),d0 ; HERE bcs.s BranchTo5_DeleteObject ; HERE bra.w DisplaySprite[/ASM] It has this code because when rings reach to the bottom of the level, they delete themselves, so they do not spawn at the top of the level (they won't loop). This is a good thing, as we don't want rings looping, right? But there is an issue with levels that are y-wrapped enabled. Easiest place to explain it is in Sonic 2's Metropolis act 2. [img]http://rhs.sonicresearch.org/s2_008.png[/img] Debug is enabled to explain easier (glitch will happen with debug mode on or off), but if you go to these co-ordinates in MTZ2, you will see Asteron (starfish badnik) to the right. Go to him and let him hurt you. [img]http://rhs.sonicresearch.org/s2_009.png[/img] I've just got hurt, look at all the rings that are about to scatter. But, the bottom line of the level is right above me. [img]http://rhs.sonicresearch.org/s2_010.png[/img] Look at that! Most of my rings have suddenly vanished! To help, I've drawn a red line. That's the line where if the rings reach, to delete themselves. The rings think that that line is the bottom of the level, but because this level is y-wrapped, technically, there is no "bottom of level". So we still want the rings to be there so we can collect them. The bug is NOT fixed in S1 or S3K either, but it is quite hard to pull the glitch off. Generally because the only time you're passing the y-wrap in S1 and S3K, is when you're sliding down the water in LZ, or the ice in ICZ. But if you've editing these level layouts to cross the y-wrap quite often, the glitch may become more apparent. And you might want to fix it. [b][size="4"]The fix[/size][/b] As usual, Sonic 3 and Knuckles' fix is slightly different. [b]The fix I have added, I've not equated. That way, the fix is compatible with any disassembly you are using. I've told what disassembly for which game I'm going by, but if you're using any other disassembly, you can still use my fix.[/b] [size="3"]Sonic 1[/size] This can be done in [b]SVN disassembly[/b]. Go to "@chkdel:" and you'll see this: [code=asm] @chkdel: tst.b (v_ani3_time).w beq.s RLoss_Delete move.w (v_limitbtm2).w,d0 addi.w #$E0,d0 cmp.w obY(a0),d0 ; has object moved below level boundary? bcs.s RLoss_Delete ; if yes, branch bra.w DisplaySprite Right after the 1st branch to "RLoss_Delete" command, insert this: Code (ASM): cmpi.w #$FF00,($FFFFF72C).w ; is vertical wrapping enabled? beq.w DisplaySprite ; if so, branch So, you have something like this: Code (ASM): @chkdel: tst.b (v_ani3_time).w beq.s RLoss_Delete cmpi.w #$FF00,($FFFFF72C).w ; is vertical wrapping enabled? beq.w DisplaySprite ; if so, branch move.w (v_limitbtm2).w,d0 addi.w #$E0,d0 cmp.w obY(a0),d0 ; has object moved below level boundary? bcs.s RLoss_Delete ; if yes, branch bra.w DisplaySprite Done Sonic 2 This can be done in Xenowhirl's 2007 disassembly. Go to "loc_121B8:" and you'll see this: Code (ASM): loc_121B8: tst.b (Ring_spill_anim_counter).w beq.s BranchTo5_DeleteObject move.w (Camera_Max_Y_pos_now).w,d0 addi.w #$E0,d0 cmp.w y_pos(a0),d0 bcs.s BranchTo5_DeleteObject bra.w DisplaySprite Right after the 1st branch to "BranchTo5_DeleteObject" command, insert this: Code (ASM): cmpi.w #$FF00,($FFFFEECC).w ; is vertical wrapping enabled? beq.w DisplaySprite ; if so, branch So, you have something like this: Code (ASM): loc_121B8: tst.b (Ring_spill_anim_counter).w beq.s BranchTo5_DeleteObject cmpi.w #$FF00,($FFFFEECC).w ; is vertical wrapping enabled? beq.w DisplaySprite ; if so, branch move.w (Camera_Max_Y_pos_now).w,d0 addi.w #$E0,d0 cmp.w y_pos(a0),d0 bcs.s BranchTo5_DeleteObject bra.w DisplaySprite Done Sonic 3 and Knuckles This can be done in SVN disassembly. Go to "loc_1A79C" and you'll see this: Code (ASM): loc_1A79C: tst.b (Ring_spill_anim_counter).w beq.s loc_1A7E4 move.w (Camera_max_Y_pos).w,d0 addi.w #$E0,d0 cmp.w $14(a0),d0 bcs.s loc_1A7E4 Right after the 1st branch to "loc_1A7E4" command, insert this: Code (ASM): cmpi.w #$FF00,($FFFFEE18).w ; is vertical wrapping enabled? beq.w loc_1A7B0 ; if so, branch So, you have something like this: Code (ASM): loc_1A79C: tst.b (Ring_spill_anim_counter).w beq.s loc_1A7E4 cmpi.w #$FF00,($FFFFEE18).w ; is vertical wrapping enabled? beq.w loc_1A7B0 ; if so, branch move.w (Camera_max_Y_pos).w,d0 addi.w #$E0,d0 cmp.w $14(a0),d0 bcs.s loc_1A7E4 Done The bug explained Basically, whenever rings fell to the bottom of the level, it deletes itself to stop it looping and coming from the top of the screen (like Sonic does on y-wrapped levels). But with levels with y-wrap enabled, the rings would still delete themselves when it reached those co-ordinates. In the pictures provided as examples, those rings reached them co-ordinates and deleted themselves, which we don't want theoretically, there is no bottom of level and you want your rings back! So, all we've done here to all 3 games, is if y-wrap is enabled, do not delete the rings if they've reached them co-ordinates. If y-wrap is disabled, then to delete the rings once they've reached the bottom of the level. The rings itself will still delete themselves after a certain amount of time, so, you do not need to worry about them being around forever if y-wrap is enabled. That's it. Again, if anyone wants to add this to the hacking guide, feel free. Enjoy! redhotsonic
Damn RHS, you're on a roll with these guides. Keep it up. Now that I think of it, this issue gets on my nerves every time I play through these games. So I'm glad to know it's actually a glitch and not a permanent fixture. Well, then again nothing is permanent; it's all in the code.
Huh, I wasn't even aware of this glitch! You're always coming up with great fixes for little things that I've never really noticed before, and it's awesome!
Jesus Christ... too much more and I might be out of a job, on the count of spending all my time working on putting together wikis for all these guides. NAH I kid, but seriously... another nice fix. I'll get to it when I can, it'll be a while though.
No rush, mate. And yeah, when I spot a bug that I've never noticed before, I see if anyone has mentioned the bug before and if not, make a fix and share it with the world =P
BAM! There you go... another one in the books. I wasn't sure how to get those images onto the page... I'll figure that out sometime, in the meantime, I linked to this thread. Some of you may have noticed that I've been trying to throw a lot of your guides up on the wiki as of late. I plan on continuing this... I'm gonna be doing plenty of work with the SCHG How-To's in the immediate future... including adding a lot of stuff that hasn't been documented yet, (Mentioned perhaps, but not documented) and will be reorganizing EVERYTHING in the lists to make it a little less cluttered... Don't worry... I won't fuck anything up. I do know what I am doing. I will also be adding a template to the SCHG containing a list of Sonic 3 guides in the future, as we don't have one (due to lack of documented content). That won't come for a little while though, as I don't want to just slap one on the wiki without a substantial amount of info to put in it. I've contacted Tiddles, and he will be assisting me with this, as he probably has the most knowledge of working with Sonic 3&K, though RHS' guides like this one have a place on it as well. Anyone else with experience hacking Sonic 3 can/should also jump aboard as well. And if you can wiki shit on the site... that's a big help too, as its less work I gotta do. Of course, I'm willing to do all of it myself... as it's really a labor of love for me... I certainly enjoy doing it, and find all these guide useful... but any help would be grand. Y'arrghhhh.... I hope you all have, and will continue to enjoy my work in trying to make sure that everything you guys offer gets documented and saved on the SCHG How-To sections for future use! And of course, a big thank you to RHS, and all of the other Members/Techs that have researched and hacked to provide this wealth of information that either has been/will be put into the SCHG. Without you all, We'd have nothing more than buggy vanilla Sonic ROMS to play with until we die of boredom.