Actions

SCHG Talk

Sonic the Hedgehog 2 (16-bit)

From Sonic Retro

(Redirected from SCHG Talk:Sonic 2)

Block maps

"Nemesis provides this chart of values for the upper four bits of cellProperties. The LSB mirrors the cell." *insert table*

That table has bothered me from day one. Aside from the inconsistencies (what the hell does "mirror" mean? There are both H and V flip bits there...), the bitfield seems to match up perfectly with a PNT entry. As I don't have time to look at this myself, would somebody please check it out for me (or just say if you know)? --Aurochs

Pseudocode

It's not pseudocode, it's actual C+ code. This is likely to be confusing to virtually everyone, because it's overly complicated and C+ programming is a completely unrelated subject. It should be replaced with something simpler. - Hivebrain 17:50, 28 August 2006 (CDT)

Oh, it is indeed pseudocode. Neither C nor C++ has a byte or word type. They would have to be typedefed further up from char and int respectively, which I did not show. Further, for clarity, I wrote the bitfields backwards - for instance,
struct metaBlockElement {
    int : 4;                       // x
    int blockIndex : 12; };        // I
// xxxx IIII IIII IIII
should be
struct metaBlockElement {
    int blockIndex : 12; };        // I
    int : 4;                       // x
// xxxx IIII IIII IIII
because the compiler allocates bits starting from the LSB rather than the MSB. Therefore, pseudocode. I'll admit that the bitfields are kind of esoteric, but I like them because they allow for named variables, rather than the cheap ASCII bitfields that only allow for letters.
--Aurochs