Skip to content

Conversation

@mateusfavarin
Copy link
Collaborator

No description provided.

@@ -0,0 +1,20 @@
#ifndef RAND_H
#define RAND_H
Copy link
Contributor

Choose a reason for hiding this comment

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

weren't you using pragma once in other files?

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 could switch to pragma once for every header

#endif
const u32 x = seed->b >> 8;
const u32 nextA = (seed->a >> 8) | (seed->b << 24);
seed->b = (x | ((seed->a + x + (nextA >> 8)) << 24)) ^ 0xDEADC0ED;
Copy link
Contributor

Choose a reason for hiding this comment

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

iirc there was a deadcoed struct in sdata or something? Do we still use that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We aren't using anything from the previous decomp

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm more interested in knowing where the functionality that that struct represented went.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just parameters initialized with a seed, and bit shifted to give a pseudorandom number at the end.

{
const u32 index = PatchFunction_Beg((u32*)(&ND_MATH_Sin));
const s32 expected = ND_MATH_Sin(angle);
if (expected != res) { ND_printf("[MATH_Sin] Test Failed:\nInput: %d\nExpected: %d\nResult :%d\n", angle, expected, res); }
Copy link
Contributor

Choose a reason for hiding this comment

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

Expected:[space][number] vs Result:[number]

Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like result has two spaces on it now lol, probably doesn't matter though.


#endif // TEST_MATH_IMPL

#ifdef TEST_RNG_IMPL
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should split up the test files per-namespace

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is a good idea

Copy link
Contributor

@TheUbMunster TheUbMunster left a comment

Choose a reason for hiding this comment

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

I left some comments, but nothing that should block merging I think

@@ -0,0 +1,89 @@
from symbols import Syms, RAM_BASE

class ASMInstruction:
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

analizes the log of instructions of one frame and displays the function calls

Copy link
Contributor

Choose a reason for hiding this comment

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

this should be gitignored and untracked probably

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sample log of instructions for a frame playing crash cove while doing a powerslide, maybe should be untracked

Copy link
Contributor

Choose a reason for hiding this comment

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

This maybe should be gitignored and untracked.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nah, useful log of function calls

@mateusfavarin mateusfavarin merged commit 1af9340 into main Sep 22, 2025
1 check passed
@mateusfavarin mateusfavarin deleted the math_decomp branch September 22, 2025 21:02
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