Commit 248d069
gx: make GX_SetTevIndTile() more readable
The old code suffered from some obfuscation due to how it was reverse
engineered:
- The 0x43300000 magix number is the binary representation of the upper
32 bits of a double floating point number havint the exponent set to
1075, which makes it so that the least significant bit of the lower 32
bit word maps exactly to the unit 1.
- 4503599627370496.0F is 1 << 52, which in floating point representation
is 0x43300000 00000000.
- 0.00097656250F is "1.0 / (1 << 10)"
In other words: multiplying by 0.00097656250F is equivalent to dividing
by 2^10, and this is the actual operation that the old code was
fulfilling. The subtraction between the double floating point numbers is
just an optimisation to convert the integer parameter into a float, so
we can safely ignore it and leave it all to the compiler.1 parent 8aecd24 commit 248d069
1 file changed
+6
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4213 | 4213 | | |
4214 | 4214 | | |
4215 | 4215 | | |
4216 | | - | |
4217 | | - | |
4218 | | - | |
4219 | 4216 | | |
4220 | 4217 | | |
4221 | 4218 | | |
| |||
4231 | 4228 | | |
4232 | 4229 | | |
4233 | 4230 | | |
4234 | | - | |
4235 | | - | |
4236 | | - | |
4237 | | - | |
| 4231 | + | |
| 4232 | + | |
| 4233 | + | |
| 4234 | + | |
| 4235 | + | |
4238 | 4236 | | |
4239 | 4237 | | |
4240 | 4238 | | |
4241 | | - | |
| 4239 | + | |
4242 | 4240 | | |
4243 | 4241 | | |
4244 | 4242 | | |
| |||
0 commit comments