Commit Graph

243 Commits

Author SHA1 Message Date
gabest11 3e12966919 GSdx: Even more alpha test voodoo magic, it must be nailed now!
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
2009-05-27 05:55:32 +00:00
gabest11 6c58f3039a GSdx: bit more work on the vertex buffer, and broken ffxii fmv fixed again.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1266 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-26 03:40:31 +00:00
arcum42 bd9886b332 Zeropad: Yes it's a bunch *more* cleanup work on Zeropad.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1256 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-25 01:59:17 +00:00
arcum42 7519fb8113 Some quick fixes.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1252 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-24 04:34:23 +00:00
arcum42 08d3360376 ZeroGS: Strictly in the interests of maintainability, I'm moving these functions to a separate file.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1251 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-24 00:31:46 +00:00
gabest11 081006bcbe GSdx: dx9 hw mode got a vertex buffer too (as dx10), it was an old TODO...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1250 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-23 23:52:53 +00:00
arcum42 20f0e52a1a Zeropad: All around my hat...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1249 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-23 23:07:53 +00:00
arcum42 f1be4728ba Zeropad: Fix a glitch in the new esc code, and the hat code should not save in the same spots as the axis code.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1248 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-23 22:20:16 +00:00
arcum42 ecfed766cd ZeroPad: Refactor a bunch of code. Escape now sets the key value to 'Unknown' when configuring. Work some more on the hat code (still disabled).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1245 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-23 11:57:28 +00:00
arcum42 fea158f392 PadNull: A bit more work on the Windows side.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1244 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-23 06:50:10 +00:00
arcum42 a180b105d3 PadNull: It compiles in Windows. (It does not pass key events, such as escape, though, so should not be used yet.)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1243 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-23 06:11:48 +00:00
arcum42 47bc9722d4 GSnull/PadNull: Add a null Pad plugin (Currently Linux only). Fix up GSnull on the Linux side.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1242 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-23 05:15:03 +00:00
gabest11 8d119f3928 GSdx: more source cleanup and something interesting on F7
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1239 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-22 23:23:38 +00:00
arcum42 82f0143d23 GSnull: Modularise things a bit more, so we don't have a bunch of platform-specific code in the main code. (Note: the Linux side hasn't been tested yet. I'll be doing that a bit later.)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1238 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-22 02:29:01 +00:00
arcum42 f9cf905155 GSnull: Make it work better with Windows and LilyPad.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1237 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-22 01:49:39 +00:00
gabest11 3b22adc4b3 GSdx: converted a few template classes to pointers and virtual functions, the dll got more than 100k smaller, since there were many changes, backup your old version first :P
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1236 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-22 01:22:52 +00:00
arcum42 b1fd826954 GSnull: Update the GifTransfer code. Start to add keyboard code.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1234 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-21 22:19:54 +00:00
arcum42 7922f33f4f Minor variable type changes.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1233 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-21 21:12:01 +00:00
gabest11 2aec2318cc GSdx: found a compiler def for stl that removes a lot of iterator checks in the release build.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1228 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-20 21:22:37 +00:00
gabest11 09ee76d9ed GSdx: optimized local-local transfer a bit, it boosts fps in games like ffxii or ico, which do a lot of moves in local memory.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1226 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-20 15:35:31 +00:00
gabest11 5f392aba63 GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1219 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-18 11:08:04 +00:00
arcum42 1a53f45b2c Some work on variable type consistancy, and getting rid of 64 bit processor checks.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1214 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-17 21:57:24 +00:00
Jake.Stine e93b101f49 Cleanup: Moved some rather intrusive instances of global namespace pollution in Sio.h into a new sio_internal.h, so that the rest of the world doesn't have to ensure the pain of having BREAK and RTS macro'd to integers. ;)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1198 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-16 00:43:46 +00:00
gabest11 b535039ee7 GSdx: blur removal works again
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1194 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 21:07:58 +00:00
arcum42 fc7bc70cfc Linux/Plugins: I left this out at some point...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1193 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 19:45:34 +00:00
gabest11 441aee367e GSdx: fixed a few more typos in GSVector4i, the black screen bug should be gone
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1192 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 11:11:26 +00:00
gabest11 a1507e6044 GSdx: this should fix d3d9 mode and the aspect ratio bug
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1191 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 07:48:51 +00:00
arcum42 667581e4be Linux: Fix focus problems with various dialogs when hitting escape, and hook in dev9's dialog box.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1190 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 07:02:51 +00:00
arcum42 5615929ce3 Linux: Work on dialog boxes for a bunch of plugins. mostly null plugins. Not finished, by any means, but this seemed like a good commit point.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1189 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 06:08:35 +00:00
arcum42 fde4685f77 GSnull: A bit more work on the gif transfers.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1186 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 01:57:00 +00:00
arcum42 c671bba45a GSnull: Add some Gif Transfer code from pcsx2 (not currently hooked in).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1185 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 01:06:59 +00:00
arcum42 5b4935dd86 Zeropad: Archiving some hat work. Still disabled and buggy, but I want to be able to revert back here if neccessary.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1184 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-15 00:42:05 +00:00
arcum42 bddfd67bae Minor tweaks here and there. Removes a couple compiler warnings, adds in a -m32 flag I missed, and updates the Makefile a bit.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1183 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-14 21:50:03 +00:00
gabest11 bdedc325a8 GSdx: just fixing the typos...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1182 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-14 20:44:17 +00:00
gabest11 5648d07b96 GSdx: more refactoring (aka search and replace)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1179 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-14 16:41:52 +00:00
gabest11 29d11c8137 GSdx: small fixes
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1171 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-11 21:10:08 +00:00
arcum42 6083e3a643 Linux: Add -m32 to the compiler flags of pcsx2 and all plugins.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1169 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-11 10:44:12 +00:00
gabest11 d3547e0662 GSdx: trying to get rid of windows dependencies, still many classes to replace :P
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1168 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-11 08:18:00 +00:00
arcum42 25090899ce Zeropad: Experimental. Enable analog key controls in Linux. Currently does not work well if you also have actual joysticks set up as analog controls.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1165 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-10 05:57:57 +00:00
arcum42 ae975a354e Zeropad: More cleanup, and some incomplete work on the POV code, which looks like it was only halfway implemented.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1164 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-09 22:44:06 +00:00
arcum42 05867d69cb Zeropad: Add analog.cpp & analog.h.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1163 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-09 20:07:54 +00:00
arcum42 0b23b77051 Zeropad: Continuing to do some cleanup.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1162 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-09 20:06:57 +00:00
gabest11 6ea395be4b GSdx: optimizations here and there
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1161 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-09 08:37:02 +00:00
arcum42 e10ca2ba49 All right, this version of GSnull doesn't assert, and if you finagle enough with LilyPad's settings, you can get the keyboard to work (but not a gamepad). Occasionally causes the pad plugin to close on starting emulation.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1160 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-09 00:03:27 +00:00
arcum42 85c8e4c4af Mostly port the GSnull plugin to Windows. Currently asserts on startup in Windows about GSirq not being null. (Though it works if you hit ignore.)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1158 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-08 22:40:56 +00:00
arcum42 a80dfabca8 Initial commit of a new null plugin, GSnull (Linux only until I get around to porting it). Yes, it's just what it sounds like; running the pcsx2 without any graphics. May be useful under somewhat bizarre circumstances. :)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1156 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-08 12:58:57 +00:00
arcum42 0005b749b5 Zeropad: fix minor typo in previous commit that got copied and pasted several times.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1150 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-07 23:49:12 +00:00
arcum42 a0a4abdcc1 Zeropad: Break up linux.cpp into multiple files.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1149 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-07 23:37:57 +00:00
gabest11 c64691811a GSdx: 3.4.9. Texture Function => Decal/TCC=RGB: Av = At (gs_user v3 and v5) or Av = Af (v6)? Seems it was Af... Sonic unleashed was one of the games relying on this setting, could not find any other yet. Also removed the green stripes, shadow sw-mode only.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1145 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-07 12:34:58 +00:00
gabest11 3202a42578 GSdx: Reworked the sw renderer texture cache a bit, at page level its correctness was questionable if the base address was not page aligned, so now keeping track of blocks (32x more), may be slower or faster by a few percent (number of blocks vs. finer resolution).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1142 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-05-07 06:32:10 +00:00