Skip to content

Commit

Permalink
Merge pull request #3 from MonsterDruide1/master
Browse files Browse the repository at this point in the history
cheatsheet/sead: Add note about min/max
  • Loading branch information
leoetlino authored Jun 6, 2024
2 parents 4b033c6 + c017c0e commit f69e7ea
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/cheatsheet/common-inline-functions/sead.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ sidebar_position: 0

sead is Nintendo's C++ standard library. It provides basic data structures such as strings and tree maps and many other essential components (e.g. threads, critical sections, file IO, etc.)

## Math

### min/max functions

When dealing with fmin/fmax instructions, pay close attention to the exact instruction and their order of operands. If the order of operands is wrong, try swapping the arguments of the call to the respective function call.

When calculating the minimum of two floating point operands, either the instruction `fmin` or `fminnm` can be used by the compiler. The former is usually generated by `sead::Mathf::maxClamp`, while `fminnm` is generated by `sead::Mathf::min`. Both of these will show up as `fminf` in the pseudocode.

```cpp
fmin => sead::Mathf::maxClamp
fminnm => sead::Mathf::min
```

## Strings

Expand Down

0 comments on commit f69e7ea

Please sign in to comment.