Conversation
| var_v0 = 15; | ||
| gSPVertex(gGfxDisplayListHead++, OS_PHYSICAL_TO_K0(&gGeomVertexPtrs[var_t5]), 14, 1); | ||
| gSP1Triangle(gGfxDisplayListHead++, 0, 15, 1, 0); | ||
| gSPVertex(gGfxDisplayListHead++, (((u32)(&gGeomVertexPtrs[var_t5]) + 0x80000000)) + 14 * sizeof(Vtx), 1, 15); |
There was a problem hiding this comment.
This line was a bit weird to match but using OS_PHYSICAL_TO_K0 would break it as using any kind of pointer cast would majorly change the addition orders. https://decomp.me/scratch/Wb6aE Here is the scratch in case someone can find a better method
There was a problem hiding this comment.
You're right, this is weird. If we change the cast to u32, it can be used: #define OS_PHYSICAL_TO_K0(x) (u32)(((u32)(x)+0x80000000)) here as well. But the order of the addition is just strange. I feel like this would have been more clearly originally written OS_PHYSICAL_TO_K0(&gGeomVertexPtrs[var_t5 + 14]) but that's not how it was.
| var_v0 = 15; | ||
| gSPVertex(gGfxDisplayListHead++, OS_PHYSICAL_TO_K0(&gGeomVertexPtrs[var_t5]), 14, 1); | ||
| gSP1Triangle(gGfxDisplayListHead++, 0, 15, 1, 0); | ||
| gSPVertex(gGfxDisplayListHead++, (((u32)(&gGeomVertexPtrs[var_t5]) + 0x80000000)) + 14 * sizeof(Vtx), 1, 15); |
There was a problem hiding this comment.
You're right, this is weird. If we change the cast to u32, it can be used: #define OS_PHYSICAL_TO_K0(x) (u32)(((u32)(x)+0x80000000)) here as well. But the order of the addition is just strange. I feel like this would have been more clearly originally written OS_PHYSICAL_TO_K0(&gGeomVertexPtrs[var_t5 + 14]) but that's not how it was.
No description provided.