Commit Graph

508 Commits

Author SHA1 Message Date
donkopunchstania cc7c6cd35f Texture coordinates are stored in fixed point format in TEV which allows overflows to be emulated correctly. Added logic to calculated texture LOD and use the correct mip. Dumping textures will now dump all mip levels. Added line rendering. Changed data stored in vertex from float arrays to vectors for cleaner math.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5178 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-03-09 04:38:07 +00:00
Glenn Rice beba3b7f5b Removed more compiler warnings in linux.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5170 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-03-07 22:48:37 +00:00
nodchip 2dabcb881c Fixed the crazy code in r5161.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5163 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-03-06 10:07:37 +00:00
nodchip d69478e539 Reverted the comparison function to r5159 and rewrote map to hash_map. I confirmed that the code can be compiled and run under Visual Studio 2008. And I confirmed the code can be compiled under gcc 4.4.0 (mingw). I could not confirm that the code run under linux.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5161 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-03-06 02:07:48 +00:00
nodchip 1b61742b53 Rewrote a object-comparison code using a standard function. It's a tiny refactoring.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5160 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-03-05 12:04:09 +00:00
nodchip 2941bef44b Fixed a wrong type in r5140.
Commited code that I forgot to commit in r5140.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5141 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-28 12:14:40 +00:00
nodchip 1c34052266 Refactored VertexLoader::CompileVertexTranslator(). Now texture coordinates loaders are also selected from a function table. I will add a hack to increase the speed in the next commit.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5140 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-28 11:36:00 +00:00
nodchip d348c33bf2 Refactored VertexLoader::CompileVertexTranslator(). Now the vertex position loader is selected from a function table. I will apply the same kind of refactoring to texture coordinates loader. This is a pre-preparation to optimize texture coordinates loaders.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5139 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-28 08:41:02 +00:00
Rodolfo Osvaldo Bogado 6b1ca64428 experimental commit: simplify even more the params. please test and if theres something wrong will revert asap
thanks for the comments in the prev commit they make my re think the approach.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5136 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-26 22:14:29 +00:00
Rodolfo Osvaldo Bogado 02189ec5e0 Simplify the params for the safe texture cache
after some test the more relevant parameters were the color samples and the tlut max size.
so delete the rest of the parameters and define 3 modes:
Safe : the two values are set to 0 meaning all the texture data and all the tlut data are hashed this is the most correct and slowwwwwwwwwww way
Normal: 37 samples are taken from the color textures an the firs 4096 bytes of the tlut are hashed, is a lot faster than safe mode but in some games i observe small glitches.
Fast: 8 samples are taken from the color textures an the first 1024 bytes are hashed from the tlut, is a little slower than the unsafe cache but at least all the games i tested have correct text output and fast frame rate. the glitches in dinamyc color textures are more noticeable in this mode
this values could be improved, if you find a better combination please post it and the game it fixes and i will update the source.
for the moment, as my time is limited by a lot of work, only implemented the d3d gui, if someone can implement the opengl gui will be a lot of help for me.
please test a lot and let me know the results.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5135 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-26 12:54:08 +00:00
nodchip 609151c6e8 Reverted because of some processor and performance issue. I will develop in a branch about SSSE3/SSE4.1.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5123 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-24 23:58:48 +00:00
nodchip 47fb73b71a Added SSSE3/SSE4.1 code for speed up. The code does not work in this revision because cpu_info is not initialized properly. I will fix the issue in another commit.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5119 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-24 09:56:41 +00:00
Glenn Rice 1d40b8a5ae Systematically eliminating compiler warnings.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5117 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-24 03:38:36 +00:00
Rodolfo Osvaldo Bogado 3cc5d8ce6f First a bugfix:
fixed a misbehavior in the clear code that causes depth clear problems in reference hardware (Intel as example).
add 6 parameters to optimize Safe Texture Cache:
SafeTextureCacheColorSamples, SafeTextureCacheIndexedSamples, SafeTextureCacheTlutSamples:

this 3 parameters gives the number of samples taken to calculate the final hash value, less samples = more speed, more samples = more accuracy
if 0 is specified the hash is calculated using all the data in the texture.
SafeTextureCacheColorMaxSize, SafeTextureCacheIndexedMaxSize, SafeTextureCacheTlutMaxSize:
this parameters limits the amount of data used for the hash calculation, it could appear as redundant but in some games is better to make a full hash of the first bytes instead of some samples of all the texture.

color, indexed, tlut : define the texture type, full color data, indexed, and the tlut memory.

the parameters are available in the config , no GUI at this time, if the test are OK will add it to the GUI.
if someone needs it will give more examples on how to configure the values for specific games.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5116 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-23 21:52:12 +00:00
sl1nk3.s ae58a743cb Some tiny fix, fixed a crash when activating "overlay some statistics" on OGL plugin (which actually overlays a whole book + 400 chapters of statistics and, indeed, overflows and crash) + memleak fix on LLE plugin and little fix on GBAlink shutdown code.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5113 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-23 01:57:26 +00:00
Glenn Rice 303769d31c Revert commit 5105 until we sort out how we want this to work in linux.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5110 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-22 16:10:08 +00:00
Glenn Rice 73d575c5c2 On linux don't compile and link against lzo, soil, and sfml "Externals."
Instead use system libraries liblzo2-dev, libsoil-dev, and libsfml-dev


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5105 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-22 00:39:38 +00:00
Glenn Rice 154bc956ad Some code clean up, and take care of some compiler warnings.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5090 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-20 04:18:19 +00:00
Sonicadvance1 c63446827f Fix crash when stopping and starting a game with OpenCL enabled
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5047 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-13 10:09:54 +00:00
Sonicadvance1 0ab6c117c1 Fix a memory leak in OpenCL
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5044 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-12 17:20:01 +00:00
Sonicadvance1 89c276c962 Fix a Memory leak in CoreAudio backend, around 2MB. Stops OpenCL from trying to decode CMPR textures, as it fails horribly. Fixes a memory leak in EXI devices, where the destructor wouldn't be called, causing a 32MB leak with memory cards(if you have two), and maybe a bit more from the other EXI devices
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5042 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-12 16:40:13 +00:00
j4ck.fr0st e4dcdf796f OSX build fix.
Fixes Issue 2260

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5039 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-11 17:54:16 +00:00
Rodolfo Osvaldo Bogado 6200c99dd4 test commit: please test if this improve the performance with the safe texture cache
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5038 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-10 15:55:24 +00:00
Rodolfo Osvaldo Bogado e93e777ffb second try to implement a more correct safe texture cache, implemented full hashing of tlut textures as they are the more problematic, this should solve virtually all the problems with characters in all the games that have them.
sorry to tell but this will bring a speed drop, so let you decide if this change stay or not.( used the fastest open source hash algorithm i know) 
do not apply full hashing to other format because it kills the performance.
for popular request added 9x SSAA believe me will kill your graphic card even if is the best but the image quality is exceptional.
as always please test and let me know the results.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5034 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-08 23:23:04 +00:00
j4ck.fr0st 43051ffe41 some cleanup, housekeeping for error cases and increased a few buffer sizes that are overflown by its content.
Thanks to Fatalis for the initial patch and pointing us to cppcheck.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5004 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-03 20:29:49 +00:00
Rodolfo Osvaldo Bogado a319a77be4 sorry forget one file :)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5002 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-03 14:17:03 +00:00
Rodolfo Osvaldo Bogado e98a273b54 fixes for my last commit:
chage the global format of the screenshots to bmp, is correctly supported by both plugins and is faster.
reverted the changes in safe texture cache, will try to make them more stable then commit them, this should fix compilation in linux and macand error introduced in MP games
corrected all the issues commented by ector, thanks for the comments alway is good that the code is revised by others to find missed spots.
please report any remaining issue to solve them.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5001 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-03 14:13:03 +00:00
Rodolfo Osvaldo Bogado 9e2bbec47f a lot of modifications here :)
first fixed scaling when updating backbuffer to make it friendly with encoders, now frame dumping must work without errors in any codec.
clean screenshot and frame dumping code now is more correct, faster and stable.
improve safe texture cache, improving the distribution of the hash algorithm, including tlut hash in the final hash of the texture, and making use of a 64 bit hash to make it more accurate.
clean a lot of code and corrected some missused vertex formats when drawing full screen quads.
and biggest change last:
implemented pseudo antialiasing: a image post-process algorithm that mimics antialiazing and is fare more easier to implement in this scenario.
you can change the intensity of the effect changing the values of the antialiasing combo. the right value depends on the game.
for example mkwii looks awesome with 8x.
please try all the changes and let me know the results.
if something is broken, please let me know and will fix it asap.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5000 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-03 03:52:50 +00:00
Glenn Rice feba09f7a3 Linux global build. At least the basic footwork is done here.
Basic usage:  "sudo scons install=global install"
Hopefully this doesn't break builds on Macs.  I have tested this on linux and windows.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4994 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-02-02 21:56:29 +00:00
ayuanx 8b129fca0c Fies Issue 1584
OSD and Hotkey to do quick config toggling

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4984 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-29 07:44:21 +00:00
skidau 1f37bb2177 Reverted the FIFO thread change
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4937 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-23 21:06:12 +00:00
skidau 35b6e71f03 Experimental FIFO thread. Speeds up the emulator by moving FIFO to its own thread. This will work best with quad cores, though there is a noticeable improvement on my dual core.
Enable the thread by adding this line to the video plugin ini files, "User\Config\gfx_dx9.ini" and "User\Config\gfx_opengl.ini":

UseFIFOThread = True

The line should be added under the UseXFB line.

To disable the FIFO thread, use this line:

UseFIFOThread = False

If the line is not in the ini file, the default is disabled (i.e. False).

The FIFO thread causes an error when the OpenGL plugin is used.  The D3D plugin works.

Only top left quarter of the screen can be seen when rendering to main window.  The entire screen can be viewed when running in a window.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4930 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-23 12:50:56 +00:00
hrydgard a43428253b Kill the last timeGetTime calls.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4921 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-21 21:27:52 +00:00
hrydgard 9893122a58 Attempt at fixing the colors of loaded "hi-res" replacement textures in D3D. Fixes issue 2074. Delete some obsolete commented-out code.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4916 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-21 19:31:48 +00:00
hrydgard 576990c5a3 JitIL is no longer a separate .exe/binary - it's now a simple option, Dolphin.exe now contains both cores.
Advantages:
* Less confusion for users
* No need to build twice to make sure you didn't break something
* Easier to switch between the cores for testing

Disadvantages:
* None, as far as I can tell :) Maybe some extra code complexity, but not much.

Also break some include chains that caused <windows.h> to get included into everything, slowing down the build on Windows. There's more to do here though, there's still a lot of files that get it included that don't need it at all.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4891 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-19 19:28:27 +00:00
Rodolfo Osvaldo Bogado c4c809f6b1 Small fixes:
in opengl correct an error introduced by mi in efb to ram alignment, it's seems to fix SMS but it missalign a lot of other games, so revert to the default. must solve truncated coins in NSMB.
revert alpha testing values to the values in rev 4812 as they fix some games.
in d3d dynamized the Render target size so it will change at runtime when viewport exceed it size, in the worse case it will cause a missing frame when resizing but in the games I tested is not noticeable at all
This must solve all the remaining viewports problems in nvidia cards, in ati this is not needed.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4888 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-19 15:00:45 +00:00
donkopunchstania 896850b176 Disable change made in 4801.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4876 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-18 06:32:16 +00:00
hrydgard 3e01152793 Shader Disk Cache implementation for D3D. Saves generated shaders on disk. Eliminates "freeze jerks" in D3D plugin the _second_ and later times you play something.... not much to do about the first time. The D3D shader compiler is just slow.
Also assorted cleanup around the shader code.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4869 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-17 17:44:09 +00:00
ayuanx 734b0f5dd4 Fixed a stupid error left by me.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4860 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-16 22:37:38 +00:00
Rodolfo Osvaldo Bogado 8de76f8fe8 ok big changes here:
in videocommon little fix for the alpha test values, return to the original values as they are more accurate.
in D3D:
huge change in state management, now all the state management is centralized and redundant state changes are eliminated.
Fixed the overlapped viewport error in non ati cards:
the error was caused by this: when a viewport is defined larger than the current rendertarget, an error is thrown and the last valid viewport is used, this is the reference behavior, in ati cards if a larger viewport is defined, no eror is returned, the rendering is valid and is rendered using the projection defined by the viewport but limited to the rendertarget are, exactly like opengl or the GC hardware.
to solve this in reference drivers defined a large rendertarget (2x the size of the original) and proceed to render in a centered quad insithe the larger rendertarget, in this way larger viewports always falls inside a valid rendertarget size, the drawback of this is the waste of resources. it can be dynamized, depending or games or changed at runtime when a oversized viewport is detected, but i live that to future commits.
please test this and let me know the results.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4841 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-15 15:52:08 +00:00
ayuanx 571a47ef9a This could alleviate the suffering of dual core synchronization a bit.
But I doubt you would notice it in most cases.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4830 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-14 10:52:14 +00:00
hrydgard 2db709aeb6 Add "Auto Aspect Ratio" to both graphics plugins. It's the new default, so you can forget about switching aspect manually from now on. In the Auto mode, aspect ratio is automatically set depending on whether it's a Wii or GC game, and whether the global Wii Widescreen setting has been set. There is still the possibility to override, which can be useful for the very few GC games that do support widescreen.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4828 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-13 21:11:02 +00:00
ayuanx 429691ce96 This should settle the FIFO BP critical games like Metroid Prime 2
G2ME01.ini

[Video]
FIFOBPHack = 1

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4823 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-13 11:42:04 +00:00
ayuanx ecdcffc7cf Fixes Issue 1997
This also makes the CP FIFO hack obsolete.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4821 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-13 09:03:55 +00:00
hrydgard a81efdb597 D3D: Fix some texture wrapping issues by setting the texture state for every texture used at draw time. Hopefully there will not be a noticable slowdown, thanks to the state caching. Also some minor cleanup. Should fix issues like repeated shadows. TODO: In theory it should have worked without this, so I should investigate why this change was needed.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4815 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-12 23:40:30 +00:00
Rodolfo Osvaldo Bogado 532ab905c4 this is a dev commit, a cleanup in the pixel shader generator to make the generate code a lot cleaner and readable, and a little fill rate optimization when using alpha test, i don't thing any game is limited by fill rate but the code looks more cleaner and is ordered in the same way is executed in hardware.
please test, if any problem apears let me know

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4812 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-12 03:39:14 +00:00
hrydgard 9012d4f4b8 Fix missing shading in NSMBWii etc in the D3D plugin. Now, I'm not entirely sure why the existing code didn't work properly, but hey, this fixes it :)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4810 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-12 00:08:02 +00:00
donkopunchstania a19be73be3 Do special handling of texture coordinate generation if there is only a position and texture coordinate present.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4801 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-11 00:44:40 +00:00
ayuanx 81afdbe4f4 Compilation fix for r4795
Nunchuck gravity fix for r4794 (as sanchez instructed)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4797 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-08 22:56:27 +00:00
ayuanx a3cfafcd12 1. Expanded Framelimit range from 20 to 120 in case someone wants to run a little faster than full speed but still controllable not like wild OFF.
2. Fixed a bug (for Win 32bit) that reports "No possible memory base pointer found!" even when there IS valid memory base found.

3. Made Metroid Prime 2 (maybe also other games) boot
PS: There is definitely some initialization problem with Dolphin (not found exact location yet), which prevents Metroid Prime 2 from first time booting (If you boot some other GC game first, stop it, then MP2 can boot without problem).
So I added an instant BP hack that can make MP2 boot even at first time.
And I've tested all my games to guarantee it won't break any game that already boots before this hack.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4795 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-08 21:57:31 +00:00