Talk:World/@comment-28241556-20151007155839/@comment-26817273-20151008021331

In my c-style pseudocode for the world primitive creation routines (Crash 1), you can find where the two formats are differentiated (at lines 408-410), which occurs right after the perspective transform step (Step 3). This is part of Step 5-its basically saying to jump to the corresponding code for the instructions at 0x357A4 if the leftmost bit of the current polygon's texture info structure is 0; otherwise its 1, so control should continue past the if statement. The "0 path" (code at 0x357A4) is the code for building a non-textured primitive for the polygon; the "1 path" is the code for building a textured or semi-textured primitive for the polygon. (I didn't hand convert the code at 0x357A4, hence my use of goto as an indicator and a substitute for the alternative if..else; the code at 0x357A4 is identical to the non-texture related code in the 1 path, with the exception that it tags the primitive as non-textured rather than textured.)

This is, of course, for the default world primitive building routine (at 0x35438)-certain levels may use the other variations (0x35898, 0x35E10, etc.). However, each of them makes the same comparison in determining whether to build a textured or non-textured primitive.

If you know that a level uses the default world primitive routine, you can place a breakpoint at 0x357A4 to see when a non-textured primitive is created (i.e. the 0 path is taken). When a break occurs, 2 + the address in register T2 will point to the corresponding polygon ID-an hword value; the leftmost 4 bits will give you the index of the world in the current zone that has the non-textured polygon, and the rightmost 12 the index of that polygon. You can examine the current zone's (pointer @0x57914) structure to get the pointer to that entry (n'th WGEO), and examine that entry's structure to get its EID.

- In short, I'm not exactly sure yet, or maybe was at one point but didn't make a note of it. You can use the procedure above to figure it out, though.