Skip to content
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

00_Core/Map/Course.cpp #39

Open
AetiasHax opened this issue Apr 30, 2024 · 4 comments
Open

00_Core/Map/Course.cpp #39

AetiasHax opened this issue Apr 30, 2024 · 4 comments
Assignees
Labels
decomp Reservation spot for decompiling code

Comments

@AetiasHax
Copy link
Collaborator

No description provided.

@AetiasHax AetiasHax added the decomp Reservation spot for decompiling code label Apr 30, 2024
@isaact23
Copy link

I would like to de-compile this one.

@isaact23
Copy link

isaact23 commented Nov 6, 2024

Up to 20%. Need to decompile SBORROW4, SoftDivideMod, and CoDivide64By32. Also currently have no idea how to decompile functions like func_ov00_0207ca28. Can't commit to the repo yet so work is local. I'll keep working

@AetiasHax
Copy link
Collaborator Author

Nice progress! Let me clarify some things:

Need to decompile SBORROW4, SoftDivideMod, and CoDivide64By32.

SBORROW4(x, y) is a built-in operation in Ghidra that returns true if there would be an overflow when subtracting the signed integers x and y, i.e. x - y < 0 or x < y. You can read more about built-in operations in the Ghidra help manual (Menu bar -> Help -> Contents).

As for SoftDivideMod and CoDivide64By32, they are division operations. SoftDivideMod performs division and modulo using software, returning the quotient in r0 and remainder in r1. It's most likely written in assembly due to the bizarre jump table, so I don't think it can be decompiled.

CoDivide64By32 uses hardware instead to divide two 32-bit numbers, but puts the numerator in the high half of a 64-bit number. So it effectively performs division on the original 32-bit numerator, but gaining an extra 32 fractional bits in the quotient. Not much to decompile here since the operation is done on a special coprocessor outside the CPU.

Can't commit to the repo yet so work is local.

You should fork this repository to your GitHub account so you can push your commits there. Then you can make a pull request when you want to merge your progress into the main repo. It doesn't have to be 100% complete; I would even encourage it if your progress can help other devs. You can also ask for help on Discord and refer to your fork for us to look at. Hope that helps!

@isaact23
Copy link

Course fork - https://github.com/isaact23/ph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decomp Reservation spot for decompiling code
Projects
None yet
Development

No branches or pull requests

2 participants