The geometry piece is only drawn if this is either 0 or a variable called MaskBlock contains the same bit. If it fulfils either of these, then it goes on to do a general camera distance cull.
MaskBlock is used for a more targeted cull by the stage's round manager. The following stages have code to use it:
Twinkle Park 2
Speed Highway 3
Icecap 4
Sky Deck 1/2
Perfect Chaos
In SADX, the geometry for Twinkle Park, Speed Highway and Perfect Chaos have this value set to 0, so they don't do anything anymore. I don't know if this was because of the hardware being able to load it or if it's just because of the stage geometry being changed.
Here's Twinkle Park's code (In a cleaned up form, the raw output is a little confusing). Despite no longer doing anything with this part, all of the code is intact in SADX:
checkCamera: 0x61CDE0 (PC)
Here's how the first check looks in-game - left is with camPosZ 1000 and right is with CamPosZ 1001.
In SADX, the blockbit value of most land geometry is 0, so none of the MaskBlock model switching runs.
In Sky Deck, a lot of the objects around the cannon in Act 1 rely on MaskBlock to be drawn:
sub of Bg_Skydeck: 0x5ED0B0 (PC)
Granted, you need to be close enough to spawn them in the first place and then go backwards, but if you're trying to place one outside this area for a mod then it cause issues pretty easily.
Blockbit is also the core of how the mechanic where the stage breaks apart in Act 2 works.
ControlSkydeck_wing_childgen: 0x5F2C00 (PC)
When the player reaches the point the stage breaks apart, it hides the original level pieces using this system.
Lastly, it's still fully intact in Icecap 4. I guess because the devs didn't change much compared to the other areas.
It only loads one half of the stage and one of the two connecting pools. The latter is based on height, so if you follow Sonic's path up to where it stops you can see the lower pool missing if you've broken the ice.
A great vocaloid for those who are unsure about vocaloid. And like any good vocaloid song, don’t ask me about the lyrics cause I dont know. This song truly captures the feeling of a sun shower and I love that
I was recently reminded of a bug where after glitching into Twinkle Park as Knuckles the stage would break (and eventually crash the game) if you restarted in Act 2, particularly noticeable on DC:
I took a look at the code to find out why, and figured out the problem.
Twinkle Park's stage initialization function has a case for each act. For Act 2, it needs to know whether you're Sonic and he's in the Rollercoaster, as that's a different stage mode.
Left: MD_RDTWINKLE_COASTER
Right: MD_RDTWINKLE_CASTLE
It checks which character you are and changes the mode accordingly. However, it doesn't have a default case if you're not him, Amy or Big:
rdTwinkleInit (PC: 0x61CB10)
For the other characters, it'll get stuck and infinitely loop this code.
This mode also creates the BGM task and the task for texture animations, which means that the game will continue to do so until it fills the task buffer. Then it'll crash due to trying to read the twp of a bgm task that doesn't exist.
On DC, you'll notice the stage starts to look something like this:
That's because Twinkle Park on DC uses the camera's position to determine which parts of the stage load. The geometry doesn't do this in DX (or DC conversion), making the stage being broken less obvious.
It runs fine when you first enter from Act 1, because it successfully puts you in Rollercoaster mode (You can tell by the lack of fog), but after restarting it'll get stuck, resulting in the missing geometry.