WHO WANTS TO READ MORE ABOUT HOW THESE IDIOTS RUINED A SATURDAY FOR ME? Keep reading
So as I'm occasionally working on Sonic CD : Static Charge as a break from my commission work, one of the things that kept happening was this idiot getting all sorts of corrupted (even turning invisible!), this was UNIQUE to this badnik, NO OTHER OBJECT WOULD GET THIS CORRUPT!
I was devastated trying to find ANY lead on the corruption, thinking it was a sprite overload for the longest time since... boy there are a lot more objects here than in Sonic CD originally...
So i started dummying out objects left and right, and as it turns out, even with the stage completely devoid of any objects besides these scarab idiots, IT WOULD STILL GLITCH UP IN DEBUG MODE
So I went on a hunt, deleting pieces of code from objects that happened to be nearby until it stoped happening and I figured it out... somehow if ArrayPos0 was pointing at specific objects during specific points, it would glitch it up which made NO SENSE WHATSOEVER! So I set the ArrayPos0 to 0 or subtracted it by 1 and called it good... well, not really...
I wasn't satisfied with this solution, something deeper was going on...
And then I found it, in the Scarab's own unmodified code... this single line.... THIS SINGLE LINE...
GET PROPERTYVALUE FROM OBJECT IN ArrayPos0 AND ADD TO OBJECT'S FRAME
WHO
WHAT
WHY
HOW
SO BASICALLY WHAT ENDED UP HAPPENING, IF A OBJECT NEARBY HAPPENED TO BE USING ArrayPos0 (in this case, the conveyors, debug mode and propellers) IT WOULD TAKE THE PROPERTY VALUE FROM WHATEVER LEFTOVER OBJECT THERE WAS AND ADD TO THE OBJECT'S FRAME
THIS MADE NO SENSE WHATSOEVER
In CD 2011 this isn't a big deal, nothing uses ArrayPos0 outside of the conveyors, but the object that it points to after... in fact, many of the objects in that stage don't have a PropertyValue to begin with...
BUT BOY HOWDY I'M THE KING OF SUBTYPE SHENANIGANS SO THERE'S PLENTY OF OBJECTS GOING TOWARDS 0xFF CASUALLY
So why is it there in the first place? I was wondering that too and I figured it out... these sprites... outlined in red... go completely unused in CD 2011
They're mapped to the object alongside a duplicate of frame 1 but never get used, it looked as if they would've been used when PropertyValue was 4, which is reserved for the Scarab that holds a monitor... but that's not where that's used in the original Sonic CD on the SEGA CD
This is where OG Sonic CD uses it, it's the release frame for when Sonic gets launched.
There is no situation, despite very vulnerable code, where that frame is ever displayed outside of modding. Sonic CD 2011 completely forgot about it.
I decided to bring it back, not as a launch frame but as a pre-launch frame, so the player knows they're about to get released.
Thanks for reading. Moral of the story : When modding, never trust the original code, there's always a dumb edge case that will keep you on edge.












