-
Notifications
You must be signed in to change notification settings - Fork 46
[RW] RNG namespace #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RW] RNG namespace #227
Conversation
include/ctr/rng.h
Outdated
| @@ -0,0 +1,20 @@ | |||
| #ifndef RAND_H | |||
| #define RAND_H | |||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); } |
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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.
rewrite/src/tests/test.c
Outdated
|
|
||
| #endif // TEST_MATH_IMPL | ||
|
|
||
| #ifdef TEST_RNG_IMPL |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
TheUbMunster
left a comment
There was a problem hiding this 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: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this do?
There was a problem hiding this comment.
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
rewrite/scripts/codeflow/log.txt
Outdated
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
No description provided.