Skip to content

Conversation

@mateusfavarin
Copy link
Collaborator

No description provided.

DriverQuadblockCollData quadblock;
} CollInputData;

typedef struct CollDCache
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this start at 0x1f800000 or 0x1f800108?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x1f800000

SVec3 pos;
u16 normalDominantAxis;
Vertex* levVertex;
const Vertex* levVertex;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can const-ifying be done elsewhere too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can const-fy most of these scratchpad pointers as they seem to be used for read only purposes. As for data in other headers, they need to be analyzed in a case by case scenario, which means decompiling a ton of functions before making such decisions

const Matrix m = {
.m[0][0] = cache->inputNextPos.x, .m[0][1] = cache->inputNextPos.y, .m[0][2] = cache->inputNextPos.z,
.m[1][0] = cache->collInput.quadblock.driverPos.x, .m[1][1] = cache->collInput.quadblock.driverPos.y, .m[1][2] = cache->collInput.quadblock.driverPos.z,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do the rest get zeroed by default? Normally unallocated stack variables contain garbage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other variables aren't being used, so it's fine. It's a matrix multiplication to a vector with just row 0 and 1

@mateusfavarin mateusfavarin merged commit df4c347 into main Sep 27, 2025
1 check passed
@mateusfavarin mateusfavarin deleted the coll branch September 27, 2025 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants