And there is even an explanation.
The tfx functions calculate At * Af >> 7, which means modulating by 0x80 should return At as the result.
With the evil floating point pixel shader however 0x80 translates to 128/255 (0.502), not exactly 0.5, modulation as At' * Af' * 2 (' means 0 - 1.0 range) is not the same as with integers.
At' = Af' = 0.502
At' * Af' * 2 = 0.504
If the alpha test happens to be "not equal to 0x80", then abs(0.504 - 128/255) < 0.5/255 will just miss.
Solution is to re-scale those values to the integer range, do the calculations, and then back to float again, but in the end it just simplifies down to At' * Af' * 255/128, doh...
At * Af >> 7 => ((At' * 255) * (Af' * 255) / 128) / 255 => At' * Af' * 255/128
At' = Af' = 0.502
0.502 * 0.502 * 255/128 = 0.502 (w00t!)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1272 96395faa-99c1-11dd-bbfe-3dabce05a288
- Increased mVU run cycles (Fixes Kloana 2's Inf Loop messages)
- Fixed some potential problems with the log code that would cause some games to crash.
- Minor Changes...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1271 96395faa-99c1-11dd-bbfe-3dabce05a288
- Fixed a big bug with the help of sudonim and rama which greatly increases mVU's compatibility!
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1270 96395faa-99c1-11dd-bbfe-3dabce05a288
- Properly fixed problems from r1254, a lot of games should be fixed.
pcsx2/microVU:
- Added some debug code that runs sVU and mVU, and compares their results. If they differ, then the game is halted, and debug info is given. (this can be enabled in iVU1micro.cpp with the DEBUG_COMPARE2 macro)... the code is a bit messy, but it gets the job done for now.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1265 96395faa-99c1-11dd-bbfe-3dabce05a288
Also semi-removed my gifsplit thing to resolve the tekken 5 menus Issue 209
Note: GT4 is still missing its logo, this is down to a really bizzare timing issue i cant pinpoint.
Removed redundant path3hack
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1257 96395faa-99c1-11dd-bbfe-3dabce05a288
- Implemented an idea by Jake to use a GPR as a reg-offset index to save a few bytes from reg-moves (only did it for VI regs, didn't have enough free GPR's to do it for VF regs)
- Fixed a minor problem with micro-program logs
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1254 96395faa-99c1-11dd-bbfe-3dabce05a288
- Added a new status-flag speedhack after learning how evil sVU is with status flags (mVU with both flag-speedhacks ON is less evil than sVU's default setting which does something even hackier)
- Minor Changes
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1246 96395faa-99c1-11dd-bbfe-3dabce05a288
- Implemented the case where an Unconditional branch has the E-bit Set. This solves a few games from getting stuck in infinite loops. (I still need to handle conditional branches and jumps).
- Max/Mini Opcodes shouldn't set status/mac flags. This should be a minor speedup.
- Minor Changes/Cleanups...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1241 96395faa-99c1-11dd-bbfe-3dabce05a288
- Fixed a problem that was causing microPrograms to be cached when they shouldn't be (introduced in r1209). This also fixes broken logging in some games, and is a small-speedup.
- Minor Changes
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1230 96395faa-99c1-11dd-bbfe-3dabce05a288
- Fixed a Q/P instance bug. This fixed some graphical corruption in Haunting Ground, might fix some other games too.
- Minor Changes...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1225 96395faa-99c1-11dd-bbfe-3dabce05a288
- Fixed the bugs with the logical min/max code (DaZ should work fine again)
- Optimized some lower instructions a bit.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1220 96395faa-99c1-11dd-bbfe-3dabce05a288
- Raised the run-cycles amount. This fixes FFXII's missing geometry (the game appears perfect now :p)
- mVU prints a message to console now if games are exiting early due to infinite loops (I'm interested in games that do this, so post any game you find that does this. Dark Cloud does this for example...)
- Added some debug stuff to iVU1micro.cpp.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1216 96395faa-99c1-11dd-bbfe-3dabce05a288
- Fixed a bug with P-reg's instances; this fixes problems/SPS in a lot of games such as (FFXII, NaN3, Digimon Rumble Arena 2, etc...)
Note: All the games mentioned still have other problems (ffxii for example has missing geometry on characters, but looks a lot better than before :p).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1215 96395faa-99c1-11dd-bbfe-3dabce05a288