Commit 03757c9
gx: make GX_SetTevIndTile() more readable
The old code suffered from some obfuscation due to how it was reverse
engineered:
- The 0x43300000 magic number is the binary representation of the upper
32 bits of a double floating point number having 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 cdbdcdc commit 03757c9
1 file changed
+6
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4341 | 4341 | | |
4342 | 4342 | | |
4343 | 4343 | | |
4344 | | - | |
4345 | | - | |
4346 | | - | |
4347 | 4344 | | |
4348 | 4345 | | |
4349 | 4346 | | |
| |||
4359 | 4356 | | |
4360 | 4357 | | |
4361 | 4358 | | |
4362 | | - | |
4363 | | - | |
4364 | | - | |
4365 | | - | |
| 4359 | + | |
| 4360 | + | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
4366 | 4364 | | |
4367 | 4365 | | |
4368 | 4366 | | |
4369 | | - | |
| 4367 | + | |
4370 | 4368 | | |
4371 | 4369 | | |
4372 | 4370 | | |
| |||
0 commit comments