Warning can be reenabled on GCC
A warning isn't fixed as potentially the code is wrong
../pcsx2/gui/MemoryCardFolder.cpp: In member function ‘void FolderMemoryCard::FlushFileEntries(u32, u32, const wxString&, MemoryCardFileMetadataReference*)’:
../pcsx2/gui/MemoryCardFolder.cpp:1027:10: warning: unused variable ‘filenameCleaned’ [-Wunused-variable]
bool filenameCleaned = FileAccessHelper::CleanMemcardFilename( cleanName );
Strangely the game uses large texture to handle texture buffer.
I think it plays with WMS/WMT. I'm not sure texture shuffling is 100%
correct here. But without it, it's completely broken.
* 0x9C712FF0, Jak1, EU
* 0x472E7699, Jak1, US
* 0x2479F4A9, Jak2, EU
* 0x12804727, Jak3, EU
* 0xDF659E77, JakX, EU
Please report me the CRC of the US version too so I can add them.
Please test the shadows rendering (openGL HW + accurate blending at least basic)
The game sets the framebuffer as an input texture. So I did the same for
openGL. Code is protected with a CRC. It is working because the game want to sample
pixels.
For the record, I tested it GTA too, it doesn't work as expected because
the game will resize the framebuffer to a smaller one. So you don't have
the guarantee that pixel will be read before a data write.
Note: it requires at least accurate blending set on basic
Note: I need CRC of all Jak games that suffers of this issue. Thanks you :)
Default copy-constructor is eight 32 bits move
GSRendererOGL::Lines2Sprites code shrinks from 510B to 398B
(loop of the function 296B => 181B). Hopefully it will reduce the cost
to convert line to sprite on the CPU (i.e. when geometry shader is disabled)
It impacts all renderers. It ought to fix issue in GTA radiosity,
Shadows in Jak series. (note shadows will suck in upscaling)
Implementation is really brutal. Expect a massive slow down, but at least we can test the effect
easily.
Normally perf impact will remain reasonable if the game doesn't use a Read-Write effect
Performances number are welcomes (my guess is really awful in HW mode, slow in SW mode).
You can enable it with "UserHacks_AutoFlush = 1"
GS memory is only 4MB but rendering is allowed to be 2048x2048
with 32 bits format (so 16MB). Technically the frame/depth buffer can start
at the end of the GS memory. Let's not waste too much memory.
Fix crash with BASARAX
(game draws a 2048x1664 32 bits area)
The hack only fix the HW renderer but not the SW renderer. However I'm not sure
the issue is from GSdx.
The hack will disable alpha test that used to generate empty draw call.
Manual gives all setup to upload a palette from the host. But nothing forbid to render
directly in the palette buffer. (GS rule nb 1, there is no rule ^^)
Fix Virtua Fighter 2 dark colors
However I'm not sure we can fix HW renderer. Rendering is done on the GPU but palette
handling is done on the CPU... So we need to read back data (ouch, and slow). A quick
test didn't get the expected results. Potentially there are others bugs (aka not gonna
happen on the HW renderer)
IOCTL_CDROM_RAW_READ apparently does not work for some read modes on
some optical drives, which makes some CD-ROM games unplayable from the
disc.
Work around the issue by using SPTI to retrieve the raw sector data. The
old reading method has been retained in case SPTI cannot be used (if the
device could not be opened with write access).
Fix motocross mania missing texture. Close#1319
As far as I understand, transfer is initialized in DIR. But the real
write only occured later so the blit buffer could have been overwritten
by a new value.
BLIT 0 13700
TREG 40 40
DIR 0 0
BLIT 0 13f00 <=== the bad guy
Write! ... => 0x3f00 W:1 F:C_32 (DIR 00), dPos(0 0) size(64 64)
v2: set a value in m_tr.m_blit for load state
It creates a regression on game that uses a small temporary target to
upload textures of various sizes. Inital code was done to handle direct
frame write (background, FMV) so big target
Purpose is to control the filtering when final image is displayed on the screen
Could improve the sharpness of the output in some games (ofc, it will be pixelated)
When depth primitive is constant and depth test is greater or equal, we can
execute the depth write after color (depth status will only depends on the initial
value)
New case for RGB_ONLY ate:
If the blending equation uses a fixed alpha or a source alpha. We can postpone the alpha write
in a 2nd pass.
If depth can also be postponed, we can guarantee the order of correctness of the value.
1st pass => do RGB
2nd pass => do Alpha & Depth
It fixed Stuntman letter rendering :) Remaining of the game is still broken :(
At higher resolutions it takes too much time to save a screenshot at the
maximum compression level. So let's allow the user to set the
compression level.
This re-uses the png_compression_level setting. The default compression
level is 1 for speed, but if the user wishes to increase the compression
level (without using an external tool) and doesn't mind if the
screenshot takes more time to save then they can increase the
compression level up to a maximum of 9 (which can take quite a while).
Fixes#1527.
PNG_LIBRARIES adds both libpng and zlib to the command line.
PNG_LIBRARY only adds libpng to the linker command line, and the cmake
documentation also suggests not to use it.
Value seems wrongly rounded and you can't distinguish 0xFFFF from 0xFFFE
Instead check that depth is constant for the draw call and the value from the vertex buffer
Fix recent regression on GTA (and likely various games)
In FB_ONLY mode the alpha test impacts (discard) only the depth value.
If there is no depth buffer, we don't care about depth write. So alpha
test is useless and we can do the draw with a single draw call and no program
switch
Extend GSVector to support float move
Initial code likely used integer move for performance reason. However due to
the nan correction, register is now in float domain.
I hope it wasn't done on purpose.
CID 168624 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value CMD_CONFIG_MODE is not terminated by a 'break' statement.
CID 168626 (#1 of 1): Uninitialized scalar field
uninit_member: Non-static class member m_end_block is not initialized in this constructor nor in any functions that it calls.
Fix rendering issue on letters on Kengo/burnout 3/...
Default algo will execute the alpha test in 2 passes. However due to blending
you can't handle accurately the color.
Fortunately for us, the rendering uses an always pass depth test so you
can execute first all the color rendering (which doesn't depends on the alpha test)
And then the depth part which depends on the alpha test.
* Code was factorized a bit with the help of max_z
* Add an extra optimization if test is ZTST_GEQUAL and min z value is
the biggest value. Z test will always be pass.
Note: due to float rounding (23 bits mantissa vs 24 bits depth) the test
is done against 0xFF_FFFE and not 0xFF_FFFF. It is wrong but GPU will
also use float so impact will be null.
CreateEvent and CreateThread return NULL on failure, not
INVALID_HANDLE_VALUE. This should have been done in
0477e03965, I didn't check thoroughly
enough.
The solution files are unused and for ancient Visual Studio versions -
GSDumpGUI has its own solution file, and bin2cpp is included in the main
solution file.
The property sheets have either fallen out of use or were never used in
the first place.
Fixes a regression introduced by 46ba9aa117,
where the Linux GS replayer would always use the options in inis/GSdx.ini
(or use the default options if that doesn't exist) to replay the dump,
instead of using the GSdx.ini from the specified ini folder.
Update done on f712c5c6d0
Previous code use the size of the draw to compute latest block. I
don't know why I use .x/.y which are the origin offset so the start of the block.
Check the instruction set first in GPUinit, GPUconfigure and GPUtext
to prevent unsupported vector instructions from being executed.
Move the vector initialisation in GPUinit to a separate function - it
avoids a vzeroupper instruction.
vector push_back causes a SIGILL signal on a Nehalem (SSE4.2) QEMU VM
when compiled with GCC 6.1.1.
However, an empty constructor causes illegal instruction exceptions to be
generated on a Windows VM.
So here's an inbetween that looks stupid but works on what I've tested.
Not tested
* rumble
Save/load state will be implemented in the next commit
v2:
* Print current deteced pad mode
* fix dpad button tranmission
close#366
Fix#1457 (GTA)
The game uses a depth format for a pure color buffer (cokes do ravage
in gaming industry)
However I'm really afraid that it migth break another effect in other games.
Combine all the different configurations together so the project files
are more generic and maintainable.
Also standardise the layout so all the project files will be similar and
all have the same standard elements (even if empty).
Add 64-bit configurations.
Additional specifics:
spu2-x: FLOAT_SAMPLES preprocessor definition removed since it's unused.
Use a relaxed atomic to read the exit variable in the hot path
Wait that exit is deasserted in the destructor, so we are sure the
thread will "soon" return
Value could range from 1 to 9. Default is 4 and it is potentially the
best option. Feel free to test some values on your system, behavior
might depends on the core number and thread number
Value is exponential so 4 is 2 times more pixels than 3.
Small value increased thread overhead, big value increase wait/sync latency
memory overhead by thead is only 256KB
However it will reduce the probability to block the push thread to nearly 0
I tested a couple of dumps and only manage 4000 element with 1 extrathread.
Add a factor 2 on the VRAM to get the quantity of available memory for the textures.
The driver is allowed to put some textures in RAM. Of course it is bad for performance
but it won't crash.
Due to the 4GB by process limit, I keep a (reasonable) maximum of 3.8GB.
In order to avoid a crash when memory is too low an exception will be risen
with no guarantee on rendering and big performance impact. In this situation
you ought to reduce upscaling/disable large framebuffer.
* Does the first vsync (start counter) after the sleep
* Dump data after the rendering, avoid to count extra destructor,sleep time
* Dump data into a basic csv file (if people want nice graph)
There is only a single event queue, so you need to detect the pad based
on the configuration
Mouse/Wiimote is limited to first pad
Related to issue #1441
In file included from GSRenderer.cpp:23:0:
GSRenderer.h: In constructor ‘GSRenderer::GSRenderer()’:
GSRenderer.h:58:12: warning: ‘GSRenderer::m_dev’ will be initialized after [-Wreorder]
GSDevice* m_dev;
^
GSRenderer.h:52:13: warning: ‘GSVector2i GSRenderer::m_real_size’ [-Wreorder]
GSVector2i m_real_size;
^
GSRenderer.cpp:32:1: warning: when initialized here [-Wreorder]
usb-kbd: Remove unused variable.
usb-ohci: Add proper casts for the variables.
vl: Add proper casts for the variables.
USB: Add proper casts for the variables.
GLLoader: cast passed parameters to required type.
GSDeviceOGL: cast variables to required type and silence warnings.
GSRendererOGL: cast variables to required type and silence warnings.
It creates some slowdowns for unknown reason. My best hypothesis is
that stencil will be cleared too which is slow.
Let's keep the code for the future when stencil will be dropped.
Fix#1420
If baseline and display rectangle offsets differ by small values then consider the status of frame memory offsets, prevents blurring on Tenchu: Fatal Shadows, Worms 3D, ProStroke Golf, Vexx
* Improve frame buffer height management on custom resolution. Width seems to be fine with the same size as scaled image output.
* Prevent offset issues on Persona 3 based on the data from merge circuit.
Note: Fixes custom resolution upscaling on ICO 50Hz/60Hz mode when large frame buffer is enabled. previously 60Hz mode only displayed half of the screen and 50Hz mode only worked due to the scissor hack.
* Ignore Frame memory offsets for calculating dimensions value of display rectangle.
* Remove hack which limited scaling size based on the scissor value.
Note: With the following commit, SilentHill 2 now properly outputs the desired resolution by the users on custom resolution. Previously if we set 1024 x 1024 , it'll output a lower height value which was caused by the hack removed on this commit.
Fixes regression introduced by the pop'n music controller support PR.
When modifying the axis direction combo box in the Configure Binding
group, the modified binding's info would get deleted and replaced by the
next binding's info. This results in incorrect info being passed to
BindCommand().
This commit reverts the incorrect code so the binding info is backed up
before deletion takes place, therefore ensuring the correct info is
passed to BindCommand().
It ought to be the same in performance but code will be easier this way
v2: print the sync status
v3: use a performance print so it doesn't spam the console
* Support Mesa Nouveau IR (free driver for Nvidia's GPU)
=> Print intermediate representation + final shader
=> Dump GPR usage
* Move dumped shader in /tmp/GSdx_Shader/<sub_dir>
=> Avoid the landing of 3 thousands of files in $PWD ^^
* Use function instead of macro
The layout of the buttons is improved to more closely resemble a modern analog controller/DualShock configuration, and the Device column of the list view has been reduced slighty so by default the horizontal scroll bar isn't visible.
Using __declspec(dllexport) causes duplicate export warnings to be
generated when compiling 64-bit builds. Name mangling also occurs on
functions that are exported this way, so it doesn't actually work with
the plugin system, which uses unmangled names.
The module definition file exports the functions without name mangling
and is sufficient on its own.
I accidentally removed it in a previous commit. It probably didn't
affect anyone though (you'd need to be using a DS3 via libusb, most
people will be using other methods).
Increase the performance on the free driver (Nouveau)
Currently the driver validates all UBO when only 1 is updated. It
is clearly a bad idea to put all UBO in a single common headers.
This reverts commit 8a61c7d336.
The plan is to support both XAudio2 2.7 and 2.8+. This file will only be
used for 2.7, so let's remove the ifdefs and rename the class and vars.
find . -name *.vcxproj -exec sed -i -e '/user.props/d' {} \;
Microsoft recommends against using .user files. From
https://msdn.microsoft.com/en-us/library/669zx6zc.aspx :
"The best practice is to delete the reference to them in Property
Manager to ensure that your projects operate independently of any
per-user, per-computer settings. This is important to ensure correct
behaviour in a SCC (source code control) environment."
If you cannot compile SPU2-X after this commit (since that still relies
on the old DirectX SDK), you'll need to fix your build environment.
Legacy GPU:
Older driver will be broken.
Still supported GPU:
Please upgrade to the latest AMD driver 16.5.2 or 16.5.3 (and prey that future driver will still work)
Potential issue
* miss a default value
* Renderer is DX9 again on windows
* Case issue
* Same default for all code paths
* overload of GetConfig
v2: separate specific OS option
Windows Vista onwards provides application specific volume controls, and
the local volume feature only interferes with it. Any volume adjusting
stuff probably belongs in SPU2-X.
Closes#629
The code wasn't used, and generally low level hooks should be avoided
since they affect the responsiveness of all applications. On Windows 7
and later, the hooks may also be silently removed if they timeout, which
could be possible under heavy load.
The close hacks don't work with PCSX2 - the WM_CLOSE message can't
actually be triggered for the rendering window. The hacks were also
designed as a workaround for some PSX emulator close window bugs, which
don't affect us.
Enable it to ensure correct rendering (FMV)
Disable it to reduce GPU/memory requirement
Option will likely be removed when the perf impact will be reduced.
* Fast accurate DATE is always enabled, it was faster than standard DATE
* The less fast version is always enabled too. It is likely barely used
so perf impact will be small on few game that could hit this path.
Nice rendering has a higher priority
* The "slow" path will depends on the date option.
Note normally it isn't too slow (-10%) if GL_ARB_shader_image_load_store
is supported but AMD crimson is an epic fail.
Fixes games like Time Crisis 2/3, which use two half-width display
rectangles placed side by side in split screen mode by using different
DISPLAY.DX values.
Issue1: Depth buffer is wrongly invalidated only the first page is detected.
Issue2: First page seems to be partially written. Could be a GSdx transfer bug.
Anyway, invalidation only support a page granularity.
So here a quick workaround that will clear depth buffer in case of very small partial write.
Might worth to check regression on nocturne/digital saga
It would requires some texture dynamic width convert shaders.
So as a quick solution, let's add a new CRC hack.
For issue #1362 (granted the CRC is correct)
Faster :) Reduce further the cost of accurate date
The optimization will clear the stencil to 1. So all pixels will have a
single sample that pass both the depth & stencil test. No primitive
overlaps So the destination alpha test can be done directly in the
shader.
Game often uses date to allow a single pixel pass. If this
use case is detected, stencil buffer will be cleared after first pixels
that pass both depth&stencil test.
It seems to reduce the load on the GPU.
Note: with the help of texture barriere, maybe we could implement the algo
with a single pass.
If a color buffer is still attached and is smaller than depth buffer,
the latter won't be fully cleared.
As a faster alternative, use GL4.4 clear texture function. Avoid to fiddle with
framebuffer and pixel tests.
Fix #1362x Ar Tolenico 2 map clip
So just reuse GT hle shader :) Acid stage is now correct. However it might need
some tuning for others stages.
Still look awful with uspcaled resolution (note internal game framebuffer is around 160x128)
Until AMD release the driver with a fix, I can't use 2nd blending source with SSO.
So let's use the first source. Blending/Alpha will be wrong. But it is likely better
than an uninitialized alpha value.
"Enable Hardware Depth" removed from main dialog.
"Disable Depth Emulation" and "Fast Texture Invalidation" added to Hacks
dialog.
And fix lots of whitespace issues.
GSDX: Improvements to the config interface.
- GSDX: Add new logos to dialog
- GSDX: Remove all the extra null renderers
- GSDX: Changes to renderer combobox
- Sort all the renderers in ascending order. (the fact that D3D11 was
above D3D9 really annoyed me >_<)
- Properly display usage of D3D10/D3D11 on the combobox.
- Use highest available version of DX by default.
- GSDX: gray out upscaling hacks at native resolution
- GSDX-PSX: Modifications to the dialog
- Add new logos
- Remove SDL renderer from combobox since it was removed long ago.
GSOffset is already based on a lookup of PSM/BP/BW. Coverage only adds
the size parameters (so only 256 possibilities)
It replaces the hash lookup with a free array access.
Will use integral coordinate to avoid any rescaling.
Bilinear interpolation isn't supported. I don't think it is allowed to
filter a depth texture anyway.
The hypothesis is that game will use a depth (aka Z32/Z24/Z16/Z16S)
format when sampling depth texture as color. Technically one could use
a standard color format but block/pixel order won't be the same.
(otherwise I'm screwed)
=> Hypothesis invalid on GoW. They just do a scrambled rendering...
Lookup info:
* The first searched list is the depth pool as we search a depth
texture.
* 2nd one is the render target pool (if a depth was converted to a
render target already)
To avoid any CPU overhead, the source will be a pointer to the real texture
* Conversion (if float texture) will be done on the fly by the shader (GPU).
* Relative rescaling won't be supported. Texture must be fetched with
integral coordinate
Cache page coverage of texture into a hash map
Test done on Champion of Norrath (paltex + DisablePartialInvalidation)
Profiler:
Self of GSTextureCache::SourceMap::Add 5.39% => 0.23%
Self of GSTextureCache::LookupSource 15.27% => 10.82%
Hard to measure on CoN as it depends on memory transfer. Seem to be 5-10 fps faster.
This reverts commit 53690cf9d0.
Quoting user:
For aliasing, the option allow of reduce a little but always very
visible compared with DX11 even with anisotropic OFF, , furthermore
many textures bug added with option activated (predictable but not see
on DX11 with anisotropic ON).
TL;DR doesn't worth it.
Note: it seem to work on DX because DX uses HW texturing in clamp region
mode (and others invalid case). OpenGL uses SW texturing to ensure accuracy
* keep a reference of program/pipeline created to ease the deletion
* extend a bit the API to support multiple pipeline
Final goal will be to use a pre link pipeline for SW shaders. And uses
the default pipeline for HW shaders.
By default, anisotropic filtering was disabled when textures aren't countinuous.
This hack allows to force it. It can help to reduce aliasing but it would create
unexpected effect on texture boundaries.
Again, someone ought to add the option on Windows too
Someone ought to add the Windows option too (and DisablePartialInvalidation too)
It might break a couple of games but most of them run better with depth enabled.
Fixes an issue with the D3D backends crashing if the configure dialog
is accessed and ok is pressed. The D3Dcompiler dll is freed and a null
pointer is dereferenced.
It might break gsdxgui but GSshutdown really should not be called unless
GSdx is shutting down. GSDumpGUI on Windows provides the same (or
better) functionality.
* Silent Hill 2 doesn't need the CRC hack
* GSRenderer: no need to explicitly set bottom value for r.
* Texture Cache: Removed a check which couldn't possibly enter true
branch.
For some reason some Windows 7 systems (most are unaffected) cannot cope
with LoadLibraryEx and return error code 87 - "The parameter is
incorrect".
Switch to using LoadLibrary instead for any case where Windows 7 is
expected to successfully load the requested dll. Potentially Windows
Vista is also affected.
So let's increase the height. It will increase the memory requirement on some games
v2: try to do it automatically
(not sure it will useful as most game will requires it)
v3: let's back to an hardcoded 1280 size. It generates too much issue
Try to avoid random black screen frame
v2: don't force the preload hack on the frame
It creates a ghost image over FMV
v3: support offset within a frame
The long story:
Game blits FMV far aways of the RT which is actually the input of the RO texture...
Currently GSdx suffers of 2 bugs.
1/ RT is too small
2/ texture isn't properly updated with the rendered value. Texture is invalidated
but it reads back the pixels from the GS memory whereas the correct
value is located on the GPU.
This commit will replace the standard draw by a manual blit. Therefore it avoid
size issue and bad upscaling issue.
v2:
* Use various copy to be more compatible with dx api
* Move all part of the hack info the BlitFMV function
v3: add log message
It often happens the game try to upload the FMV directly which typically
gave a black screen.
Commit fix rules of roses and I hope various black screen FMV
Performance impact must be tested, and I'm afraid of strange texture cache behavior.
V2: check the size of the transfer too
V3: add support of 16 bits format
V4: avoid division by 0
Using D3DX11 requires the end user to install the DirectX redist files.
Switch to using D3DCompile, and distribute D3DCompiler_47.dll for
Windows Vista, 7 and 8 users (Windows 8.1 onwards supplies
D3DCompiler_47.dll with the OS).
It actually removes the previous hack that read the full target.
Unfortunately snowblind engine game uses big target so the read is very big too (1280x448)
which is killer for the perf. Whereas the game requires only 24x12 texels
Give a 2x speed boost on Champion of Norrath !!!
Games uses very special texture with a lots of repeating.
It is much faster to send the full texture rather than trying to partially invalidate it.
On my gs dump:
FPS: 29 => 68 !
ReadFile reports that the DVD is reading from the end of file when
attempting to read any layer 1 sectors.
Use the FSCTL_ALLOW_EXTENDED_DASD_IO ioctl to prevent the file system
driver from carrying out boundary checks.
cdvdgigaherz only determines whether there is no disc, a CD, a single
layer DVD or dual layer DVD in the drive. It does not detect whether a
CD/DVD is a PS2 CD/DVD or not.
Fix the missing TOCs.
The calculated size values were off by one for single layer DVDs, off by
two for dual layer PTP DVDs, and just wrong for OTP DVDs.
Usually the IOCTL_DISK_GET_LENGTH_INFO ioctl will have succeeded already.
Only 1 IOCTL_DVD_READ_STRUCTURE ioctl call is necessary for determining
the DVD media type and layer break address. All the necessary
information is already present in the layer 0 physical descriptor.
For dual layer DVDs, CDVDgetDualInfo() should return the first layer 1
LSN, not the last layer 0 LSN, which is what GetLayerBreakAddress()
returns. This matches what the internal ISO reader returns.
Also, PTP DVDs should return a value of 1 for the media type, not 2.
Finally, adjust the CDVDgetDualInfo() return value so PCSX2 correctly
recognises dual layer DVDs.
Basically I ran
find . -name "*.vcxproj" -exec sed -i -e 's/_xp//' {} \;
This will likely break XP, but it paves the way on Windows for a PCSX2
that does not require the DirectX redistributables to be installed for
Windows 8, 8.1 and 10 users. Windows Vista and 7 users will still require
the DirectX redistributable files for XInput and XAudio, though PCSX2
should still be capable of running if a user does not actually use either
of them.
All GL4 extensions supported by DX10 class GPU will be soon mandatory
Namely:
* GL_ARB_copy_image
* GL_ARB_texture_barrier
* GL_ARB_clip_control
* GL_ARB_direct_state_access
* GL_ARB_separate_shader_objects
* GL_ARB_buffer_storage
There are likely few games (RE4) which constantly change the FBW register value causing the framebuffer width to be updated at every interval. Adding a safe limit (512) similar to frame buffer height would prevent such constant changes of the framebuffer width when FBW changes once again to an even lower value.
Valid values for png_compression_level are from 0 (no compression) to 9
(max compression). The default is 1.
v2: Use zlib Z_BEST_SPEED (1) and Z_BEST_COMPRESSION (9) defines.
So let's not specify it as a build dependency.
Also remove some unnecessary manual library linkage and remove the
wsWidgets GUI property sheet, which does nothing useful.
Feedback fix, when more than two gamepad are used simultaneously.
Change all 'this->' by 'm_'
fix on the hack sixaxis pressure
Modification of the size (1000x760 -> 1000x730)
Can set all buttons. Buttons labels are not printed correctly in spite of update and refresh
The cause of this problem come from the while in the config_key function which monopolise ressources
Add arrow pictures implementation
OnePad : bug fixed (assert failure)
Modification of copyright
It's been available since XP and it's not special like XInput (where we
might have SCP in the middle) so let's have the linker resolve the
functions at link time.
The following patch uses the height value of the display rectangle rather than make an estimation of the Frame buffer height when the game uses a non-referenceable height (or) width.
Don't lookup a depth buffer if depth test is always pass without write
Boost performance on Tekken5 when depth emulation is enabled in openGL
(Tekken5 sets same address for both the RT and the depth but depth is disabled)
v2:
Keep ds if DATE is enabled (some implementation uses a stencil buffer)
Be more aggressive to avoid an useless depth lookup
Texture coordinate could be dummy/float/int integral/int normalized.
Old behavior:
* VS was in charge to select the texture coordinate
* int integral format wasn't supported
New behavior:
* Always compute all formats
* FS will be in charge to select the good format
Impact:
* VS will be slightly slower but it reduces shaders permutation from
little to 0 (won't be bad for CPU)
* FS speed isn't impacted as 2 separate code paths were already required
to support both format
* Rasterizer will be 33% slower but unlikely to be the limited factor of
the GPU
* In future we could directly use the integral format in the FS.
V2: remove useless PSin_t
It would be on by default. Unsafe & fast path.
The hack is a security if someone encounters any issue
v2: update Windows gui file
v3: fix typo in tooltip and linux gui
Buttons done, configuration initialization done.
Still need to add Gamepad and Joysticks configuration frames.
Require png file for the moment (the embedded picture will be fixed after).
New Onepad GUI based on wxWidget (Main frame almost finish)
Background picture is now embedded
Button binding works
Loading and saving works
Need to add feedback and gamepad, joysticks configuration frame
Modification of the onepad CMakeList.txt
Automatic generation of images headers using perl script
Modification of the test feedback function
Visual Studio Find and Replace can only be trusted if all the files are
included in the project. I suppose it's time to add any missing files
to the relevant projects...
The old implementation saved the current value of a GSSetting as uint in
a field called 'id'. The implementation of GSSettings suggests that
GSSettings could be saved in a database with id as primary key. This
would require a translation look up from id to value but could have all
advantages of a database. However the interface to GSSetting was never
implemented like that.
In the new implementation GSSetting has a 'value' field that stores an
int representative value of the desired state. Additionally the
constructor is 'overloaded' as template to reduce casting in the
consumer code. However all consumer values need to be castable to int.
Accordingly combobox initialization was adjusted.
Initially it was free to do the SW blending because safe fbmask
will already do a sw blending.
Unsafe version uses a fast path with a limited blending. Therefore
SW blending isn't free anymore.
Improve the speed of the previous speed hack (xenosaga 1)
The hack relies on the undefined behavior of the hardware so it can
potentially generate rendering corruption.
This new hack drops the cache flusing when only the alpha channel is masked.
Alpha is a direct copy of the fragment. Normally masked bits will be constant
everywhere (RT, FS output, texture cache) so it would likely work.
Just in case, code is only enabled with the new shiny hack
The previous behaviour loaded the saved renderer config whenever the
adapter combobox was changed. The renderer will now only change if the
new adapter doesn't support the currently selected renderer (i.e
Direct3D11 might not be supported, so it'll revert to Direct3D 9).
Fixes#1080.
The Wild Arms Offset text was slightly cut off due to the label being
too small. Make the dialog slightly wider so the full text will fit.
Someone should probably make the dialog look nicer at some point.
Avoid a crash on Onimusha3 (PAL 60HZ)
In theory it will be better to find the root cause of overflow. I.e. somewhere in this
code below. Dirty rectangle is too big.
***********************************************************************
if(rowsize > 0 && offset % rowsize == 0)
{
int y = GSLocalMemory::m_psm[psm].pgs.y * offset / rowsize;
if(r.bottom > y)
{
GL_CACHE("TC: Dirty After Target(%s) %d (0x%x)", to_string(type),
t->m_texture ? t->m_texture->GetID() : 0,
t->m_TEX0.TBP0);
// TODO: do not add this rect above too
t->m_dirty.push_back(GSDirtyRect(GSVector4i(r.left, r.top - y, r.right, r.bottom - y), psm));
t->m_TEX0.TBW = bw;
continue;
}
}
***********************************************************************
So as a temporary solution (that will likely stay for a couple of
years), buffers were increased.
Height of the dirty rectangle must be the GS size of the RT. Of course
RT doesn't have any height so we compute the max safest value.
Fix issue #987
Candidate for 1.4 release
15ms latency is too little most of the time, but if the stars align (light game,
fast system, the correct audio output module - portaudio comes to mind), it
might work well/reasonably, so allow it.
Watch the console for stretcher related messages. If you hear bad audio (clicks
etc) or notice reset/underruns messages, it means the latency is too low. The
optimal behavior (stretching is locked to 1:1) is when a message "stretch: None (1:1)"
shows at the console, which isn't followed by a message "stretch: Dynamic" or
resets or spu2 underruns.
I'm pretty sure such low latency with good performance (mostly locked to 1:1)
was not possible in the past, but it seems possible (sometimes) now. Maybe the
previous "black magic" commit helps
The default is still 100ms which is still fine for most cases.
This commit affects Windows. Linux still has a different minimum, probably
mostly due to UI/constants. Maybe someone should test and change that too.
I don't have a fully scientific explanation here, but it seems that with big
buffers (~200ms and up), the stretcher adjustment can overshoot the target
equilibrium back and forth, in effect never stabilizing.
This commit makes it change slightly slower which somehow seems to improve its
behavior. Sorry for not having a better explanation, as at this stage tuning the
stretcher has become somewhat of a black magic.
But hey, if it works...
Tested with buffers from 30ms to 1000ms, and with playback speed and speed
changes between 30% and 500%, and as far as I can tell it only makes it better.
Fingers crossed.
Both the Linux and Windows config dialogs now have a TV Shaders combobox,
so the F7 toggle can be made temporary. This makes the hotkey behaviour
consistent with all the other hotkeys.
Fixes the PadNull crash when any window event occurs due to mixing and
matching Unicode and MBCS window handles. Thanks to Volkanite for
figuring out why it was broken.
There's already a SysMessage definition, so a second one is unnecessary.
Cleanup some headers as well. I wanted to remove the about box as well,
but that can wait.
By doing more copy/pasting.
The directory creation code was removed - it doesn't create any
necessary parent directories so it's not all that useful.
It would be great if all plugins shared config code, but it's probably
to have all the plugins use Unicode on Windows first.
I don't understand the magic but sometimes pad buttons are detected as buttons
sometimes as axis. Create an option so people can test both and hopefully find a working solution
Note: you need to restart the plugin to take the option into account
Note2: fix dual pad init too
Related issue #938 and #414
Previously the sound touch configure caption box will still have the outdated value of the sliders when using the restore defaults function, update the caption text also during restore defaults. ( use the first slider value for caption since that lies closer to the restore default box )
The old one isn't working. I don't think there's a URL that redirects to
whatever language the user is using (unless my browser settings are
wrong), so I've just used the English US URL.
1. Add GS_Renderer Enum
Replace all instances of int/uint32 renderer identifier by a strongly
typed enum and appropriate casts.
Only instances in GS[*].cpp/h classes were touched. GPU[*].cpp/h classes
do not to follow the same convention.
2. Add default renderer according to OS
The default renderer is OS dependent (Win -> Dx9HW, others -> OGLHW).
Consequently one should always check againt the appropriate default
value on config load.
The old behaviour was only - if a at all - problematic if the respective
element in the gsdx.ini was missing and probably even then didn't create
issues. The current implementation is still more stable and does not
depend on the implementation of GS.cpp -> GetConfig()
The following patch adds Mipmap option (software mode exclusive) and Preload Data Frame (Hardware mode exclusive) to the GSDX plugin settings for debug purposes.
When X autorepeat is enabled, it will generate down/up, down/up, ... sequences
So it was decided to disable it. Unfortunately the configuration is for
the full system which is very annoying (state isn't restored after an
ASSERT or EXCEPTION)
Initially the plugin handles the event from the X loop. However since
the GSopen2 switch events are already intercepted by the WX core GUI.
The core will route them back to the input plugin.
Wx filters automatically generated event so initial sequence is now
down, down, down/up. No more autorepeat issue, so no need to screw up
the system.
Close#945
Note: SDL_Init is mandatory oterwise SDL_OpenAudio will redo the init.
So the only sane way is to initialize pulseaudio, close everything, and finally
init the requested driver.
V2:
* ifdef SDL2 code
V3:
* use std::string for m_api (avoid issue issue with wx2.8)
* call the good function to properly close subsystem avoid crashes
The purpose is to workaround bug with default API
Code is not ideal because SDL/gui are mixed. But it would be enough
for future release.
V2: ifdef SDL2 code
Add images for the new GUI
Onepad : wxWidget GUI
Replace headers by png files.
OnePad: wxWidget HUI (Images)
Fix l2.png file (white background instead to a transparent one).
The goal is to check the impact on game that have wrong RT content.
It helps a bit Smash Court Tennis Pro Tournament 2 but the game suffers
another texture cache bug. (RT BW is 10 whereas texture BW is 8)
Note: Armored Core: Last Raven must be tested (only game so far
that rely on the option and I didn't want to add a new one).
CID 147033 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)16. uninit_member: Non-static class member ActualPaCallback is not initialized in this constructor nor in any functions that it calls.
Typical wrong draw:
1/ draw in 32 bits
2/ draw in 24 bits
3/ Use alpha as a texure. (Must reuse the GPU data)
4/ Write alpha from EE
5/ Use alpha as a texure. (Must upload new data)
This commit fixes the step 5.
Fix#917 (Conflict - Desert Storm)
* the break doesn't get used since HANDLE_CHECK consists of a break on the function itself.
* removed an outdated comment since realtime update of configure has been done.
previously the soundtouch configure box required a total exit of the dialog to get the configure box value updated , now it's made to be done in an instant.
CID 146973 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)2. uninit_member: Non-static class member overflow is not initialized in this constructor nor in any functions that it calls.
2999}
runion/rempty/rinter requires x < z and y < w
Help issue #762 (accurate blending issue)
If you want to shine, please put better GSVector code (AVX512 is 2 instruction :p)
In the DATE42 algo, first pass must find the primitive that write the
bad alpha value. If depth test is fail, alpha value won't be written therefore
you mustn't keep the primitive id.
In theory to ensure 100% correctness, depth would need to be fully executed
(currently depth write is disabled). However it requires to copy the depth buffer.
It is likely bad for the perf.
Issue reported on DBZInfWorld
Function pointer was mangled to avoid any collision. Nowadays all symbols
are hidden so no risk of collision.
Syntax is nicer beside it would allow to put back GLES3.2. I think it
supports most of the used extension.
glActiveTexture & glBlendColor are provided without symbol query.
CID 146834 (#2-1 of 2): Division or modulo by zero (DIVIDE_BY_ZERO)9. divide_by_zero: In expression tpf * 10000ULL / ttpf, division by expression ttpf which may be zero has undefined behavior.
CID 146839 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)11. var_deref_model: Passing null pointer fb_pages to UsePages, which dereferences it.
CID 146840 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)11. var_deref_model: Passing null pointer zb_pages to UsePages, which dereferences it.
* Prevent a potential null pointer deference in ```void GSRendererSW::UsePages()```
+ Isolate every SDL code paths and replace any call to them by call to a generic class "GamePad" of which JoystickInfo is now a child.
+ Now backends can be added by inheriting GamePad generic class.
+ There is just one function change which is redundant with next commits but otherwise commit will not compile(which is more evil).
+ Objectify conf class.
+ Make some members private as they need to have their range checked before being set
+ Change "options" variables into an union contraining bitfield representation of it. Allows to make code more expressive/readable.
CID 147046 (#1 of 1): Useless call (USELESS_CALL)
side_effect_free: Calling ApplyVolume(Ext, Cores[1].ExtVol) is only useful for its return value, which is ignored.
Disable and overrides the following hacks at the config and dialog:
- Disable screensaver
- Safe fullscreen exit on escape
- save state in title
All of those are hacks which PCSX2 doesn't need anymore and therefore are just
confusing if enabled.
Note that we assume PCSX2 is synonym for PS2 mode in LilyPad, and while AFAIK it
is the case now, it might need a more fine grained override system.
All combobox text can now be seen in full without having to click on the
combobox.
The internal and custom resolution stuff has been moved into the Hardware
Mode Settings groupbox since it doesn't affect software mode.
The dialog has also been rearranged a bit.
shaders/GSdx.fx is now the default location and is no longer hardcoded.
The external shader and external shader config can now be selected. (The
OpenGL renderer already has this feature.)
Note: It is still possible to not use a config file, just use an invalid
value for shaderfx_conf.
Don't use D3DX compile from file and compile from resource functions -
use the compile from memory function instead. It does the same thing,
except you have to set things up yourself.
Benefits:
Allows external shaders to be split into a config file and a shader file
without hardcoding the config file name.
Less code.
Yes, I more or less used the same message as the dx11 one.
Don't use D3DX compile from file and compile from resource functions -
use the compile from memory function instead. It does the same thing,
except you have to set things up yourself.
Benefits:
Easier move to D3DCompile when it becomes necessary.
Allows external shaders to be split into a config file and a shader
file without hardcoding the config file name.
Less code.
OpenGL does not use the cdecl calling convention (which is the default
calling convention for GSdx on Windows). Since DebugOutputToFile is used
by OpenGL, it needs to use the same calling convention that OpenGL uses.
This fixes a debug build crash when the OpenGL renderers are used and
debug_opengl is nonzero in the ini.
A couple of useless members were removed too.
Also fix wnd initialization
Coverity:
CID 146955 (#1 of 1): Uninitialized pointer read (UNINIT)
18. uninit_use: Using uninitialized value wnd[i].
Coverity:
CID 146816 (#1 of 1): Calling risky function (DC.STREAM_BUFFER)
dont_call: fscanf(FILE *, char const *, ...) assumes an arbitrarily large string, so callers must use correct precision specifiers or never use fscanf(FILE *, char const *, ...)
Without this patch, if a user initiates a recording and then cancels at the GSdx
dialog, the audio was recording anyway, which is probably highly unexpected.
However, while probably highly unexpected, it could still be useful to record
only audio, but with this patch it's now impossible.
We can reconsider if it turns out that people are actually using this "feature",
though one might as well set the video setting to be very unobtrusive (very low
resolution/bitrate) such that it uses very little CPU.
This is the internal resolution which GSdx uses and recording at this resolution
is optimal, i.e. without any dumb scaling, with all relevant pixels and without
redundant pixels.
The resulting clip still doesn't have the correct aspect ratio set, but that's
just a property which can be set to the clip afterwards, which is where the DAR
becomes useful. Since it's usually anamorphic, when muxing later with the audio
use the DAR to set the playback aspect ratio.
gsdx changes:
Remove native resolution checkbox from GUI and rework associated code
Small changes to Windows and Linux GUI
Support 8x native resolution
Fix custom resolution width less than native width use case
Previously it was saving the display name to the config but trying to restore
according to the friendly name.
Now store and restore according to the "displayName" which is more unique than
"friendlyName" since it includes GUID[s], and handle it consistently as _bstr_t.
This fixes the following issues when custom resolution is selected.
- When the width is smaller than the native resolution width, the
texture cache targets are removed on every Vsync signal, causing a
black screen issue.
- The texture cache code needs a 1 returned for the custom resolution
upscale multiplier or there'll be some really funny graphical issues.
It also removes unnecessary GetConfig (which I think unconditionally
does a a file read on Windows) calls if the width was increased - the
upscale multiplier is already stored, and the custom resolution width
and height calls are now unnecessary.
Also fix some whitespace issues.
Before this patch, when recording Progressive (frame) mode, it recorded all
the frames correctly but set the clip's fps property to 25/29.97, so when
played back it played at half the speed (but was fine when played at double speed).
This patch does not affect the number of frames recorded per second, but rather
only sets the resulting clip fps property to the correct one (double than before).
Also fixes a bug that in a non-managed window in progressive mode, the title
displayed "200%" speed when it should have displayed 100% speed.
Fixes#832
upscale_multiplier function values have been changed to allocate native resolution and also move custom resolution to 9.
Remove the old native checkbox value and include Native in the combo box.
Internal GSDX functions have also been updated with this new update to the upscale_multiplier variable.
* Greatly reduce the number of clut read (factor 10x)
* Avoid to get wrong TEXA texture in the cache.
* Fix "jump depends on uninitialized variable" Valgrind warning.
Fix#748
I try my best to avoid any breakage of DX but please test it too.
* add lengthly comment to explain the format
* Likely reduce the number of shader permutation
* Avoid slow AEM (on GPU)
Expect regressions because TC needs some fixes
v2: fix palette mode
CID 146833 (#2-1 of 2): Division or modulo by zero (DIVIDE_BY_ZERO)
divide_by_zero: In expression this->m_width / this->m_upscale_multiplier, division by expression this->m_upscale_multiplier which may be zero has undefined behavior.
CID 146835 (#1 of 1): Division or modulo by float zero (DIVIDE_BY_ZERO)
50. divide_by_zero: In expression (float)(end - start) / (float)frame_number, division by expression frame_number which may be zero has undefined behavior
Add 2 new shaders:
* ps_main12: cast a 16 bit depth to a RGB5A1 color
* ps_main16: cast a a RGB5A1 color to a 16 bit depth
Shader might be used in future commit as it seems Silent Hill uses this
kind of format.
Fix tab/indentation too
Add tooltips to Windows GUI. Fixes#578.
Rearrange Window GSdx GUI a bit.
Reformat tooltip descriptions to be both Linux and Windows (un)friendly.
Add new tooltip descriptions.
Fix Windows Lilypad local volume control GUI checkbox.
Make MicroVU E-bit delay slot warning a Dev warning.
Don't minimise GS Window if main window is minimised.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.
For Windows, also add Alpha Correction and Logarithmic Z tooltips.
For Linux, add software mipmap tooltip.
Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
The hack description box messages were replaced by tooltips on Windows,
so there is no need for the first line in the description to refer to
the hack anymore.
3-state checkboxes were also converted to comboboxes, so remove any
references to checkbox states.
Reformat the descriptions so it looks okay on both Windows and Linux.
Could be better, but I'm out of ideas.
Also fix a few typos and missing punctuation.
Changes the three-state checkboxes to comboboxes.
Removes the hack description box.
Hides Alpha and Alpha Stencil when OpenGL is selected.
Rearranges the hacks dialog.
This moves the hardware, non-renderer dependent options to the top and
makes the renderer options visible only when it affects the current
renderer.
The texture filtering checkbox has been changed to a combobox and now
uses the same description as Linux does.
Also changes the Title to GSdx Settings.
The purpose is to avoid issue on MS-Intel driver without
a dedicated hack in the compilation.
Code doesn't use it so I suspect others implement to discard the
statement.
The CRC hack option is always used regardless of whether the HW Hack
checkbox is ticked. Move it to the main gsdx dialog and make it use the
same descriptions that are used in Linux.
And fix the accurate_blend_unit whitespace formatting.
It claimed to be 1.7.1 but it had a mixture from various
versions. It was hard to update as everything in the top directory
so I used upstream's way to organize files. I renamed include to
soundtouch since I did not want to #ifdef that for windows.
.
Wavfile.h is a private header so I used the private path instead of
moving the file over. This changed 3 files in the plugin folder.
according to some of the internal functions in GSDevice files, Anisotropic Filtering is only done when paltex is disabled. do the same on the GUI for user awareness.
Removes the checkbox of Anisotropic filtering from the GSDX plugin settings, the checkbox was usually used to enable & disable the AF which is not necessary since there is an option in the drop down list for disabling AF.
the internal function value of "AnisotropicFiltering" has been replaced with "MaxAnisotropy" for detection.
the detection uses the function getconfig("MaxAnisotropy", value) where value 0 means disabled and value is the default value when no value is set in the INI file.
I went a bit of trigger happy since compiling so much is not fun. Changes:
Solution
- Remove all SSE2/SSSE3/SSSE4/AVX/AVX2 configurations. Not used.
- Remove wxAdv3.0 and x86emitter. Compiled but not used.
- Make sure Release compiles Release.
- Make sure Debug compiles Debug.
- Make sure Devel compiles Release or Devel.
- Make sure nothing get skipped.
- Do the last 4 for the x64 build.
.
CDVDolio
- Remove SSE2/SSSE3/SSSE4/AVX/AVX2 configurations. Not used.
- Remove props. Cruft.
- Remove _M_SSE from stdafx.h. Pointless and only reference to it.
xpad
- Remove SSE2/SSSE3/SSSE4/AVX/AVX2 configurations. Not used.
- Remove props. Cruft.
- No reference to _M_SSE.
.
Only GSdx uses _M_SSE.
- Remove *.mo. Not needed.
- Add *.aps and delete USBqemu.aps.
- Don't ignore asm files.
- Ignore the cmake obj-i586-linux-gnu build folder in Linux.
- Fix the regex pattern for /bin/pcsx2*
- Don't ignore the changelog of libjpeg.
- portaudio line not needed and ignored vcxproj/props/etc.
- update to the new rcdefs.h location
- Don't ignore pcsx2/gui/Resources/EmbeddedImage.h
- Remove autogenerated file plugins/dev9ghzdrk/Win32/postBuild.cmd
- Simplify lines using '**' or '*.exe'.
Remaining issues:
$ git status --ignored
Ignored files:
plugins/CDVDiso/src/mkiso/mkiso.dsp
plugins/CDVDiso/src/mkiso/mkiso.dsw
.
These can be deleted.
It could not find dxguid.lib since it was only available for Release.
.
This should go on a prop but that is a different PR.
.
I also fixed it for x64 while I'm at it.
- zerospu2: include stdint.h in Windows. (VC2012+)
- CDVDolio: Remove hash_map (not used, VC2015+)
- zerogs: Fix extern and link to utilities. (VC2012+)
- zzogl: Port windows part to wx30. (VC2012+)
I: pcsx2: spelling-error-in-binary usr/lib/i386-linux-gnu/pcsx2/libGSdx-1.0.0.so allows to allows one to
I: pcsx2: spelling-error-in-binary usr/lib/i386-linux-gnu/pcsx2/libGSdx-1.0.0.so Allow to Allow one to
.
Apparently lintian checks grammar too (most common ones).
The Wild Arms Offset hack can only be on or off. There is no third
state. Convert the three-state checkbox into a two-state checkbox, fix
the description and remove a leftover.
Intially GSBlendStateOGL was an alias of the m_blendMapD3D9 array
The object was replaced by an index in the array. Save 2k of memory duplication.
And too much useless code.
v2: push/pop blending state in DATE stuff
v3: remove m_state which is useless now
I used to disable the RT but it doesn't work well with 50cents. It seems
texture writes weren't propagated correctly to the depth buffer. Besides
the game write an alpha value whereas depth is 24 bits only...
Commit message edited by Gregory.
Comment below from Jonathan Li
On my system, /dev/input/event13 (evdev interface) and /dev/input/js0 (joystick interface) correspond to the DS3 on my system. User/group ownership are both root.
With /dev/input/event13 at 0640 and /dev/input/js0 at 0644 - SDL2 detects no pad, SDL1 detects a 19 button, 27 axis pad
With /dev/input/event13 at 0666 and /dev/input/js0 at 0644 - Both SDL1 and SDL2 report a 19 button, 4 axis pad.
SDL2 only uses the evdev interface, SDL1 uses the evdev interface but if that fails, it uses the joystick interface.