Commit Graph

7359 Commits

Author SHA1 Message Date
avih 302bf29b6a Merge pull request #887 from PCSX2/wx-normal-keys
gui: kb shortcuts: fix incorrect wx key codes for "plain" keys
2015-10-11 09:28:35 -07:00
Avi Halachmi (:avih) 68b4d54f18 gui: kb shortcuts: fix key codes for "non-special" keys
This patch fixes 3 different issues for wx event key codes and the ini parser.
- The ini parser (for PCSX2_keys.ini) parses symbols and letters correctly,
  but parsed `shift-q` as `Q` without shift. Now it's parsed as `q` with shift.
- the wx event keycode has the shift flag set correctly, but always has the
  upper case code for letters (e.g. `Q` when `q` was pressed, and `Q` with shift
  flag when shift-q is pressed). Now uses lower case for letters.
- For symbol-only keys (e.g. `-` or `=`), the keycode is the MS VK_.. thingy,
  e.g. for `=` it passed 187 instead of 61, or for `.` it had 190 instead of 46.
  Now returns the ascii code where possible (assuming US KB layout).

Also, when the DevCon is enabled, all key presses are printed to the console in
a format which could be copied to pcsx2_keys.ini, so this should allow also
non-US KBs to be set up for arbitrary symbols.

It should now be possible to use letters and symbols at PCSX2_keys.ini or as
default accelerators definitions within the code.

Note: this should have supposedly been fixed at r4918 ( 851bfba ), but neither
that build from the buildbot archive, nor the official 1.2.1 release (r5875),
nor the current builds have this working, which is really weird (tested on win8)
2015-10-11 19:25:24 +03:00
refractionpcsx2 31ee576d6a Sif: Limit/Mask transfer size to 1mb-16, thanks to jpd002 (Play!) for the fix!
Fixes #643 Gregory Horror Show, which seems to be playable (from nothing!)
2015-10-08 20:02:15 +01:00
Avi Halachmi (:avih) 9b988ee12d GS window title: use a template system to satisfy everyone
This allows to choose which items appear at the title and at which order, as
well as the text and some of the textual values (at PCSX2_ui.ini).

The template's variables (include % if relevant but not the surrounding text):
${slot}, ${limiter}, ${speed}, ${vfps}, ${cpuusage}, ${omodef}, ${omodei}, ${gsdx}

The system treats the GSdx info as a single unit, as well as the CPU usage info.
The UI section (at the CPU usage section) is only visible in devel/debug builds.

The current template values which also demonstrate all the configurable values:
[UiTemplates]
LimiterUnlimited=-unlimited
LimiterTurbo=-turbo
LimiterSlowmo=-slowmo
LimiterNormal=
OutputFrame=frame
OutputField=field
OutputProgressive=p
OutputInterlaced=i
TitleTemplate=Slot: ${slot} | Speed${limiter}: ${speed} (${vfps}) | ${cpuusage} | ${omodef}-${omodei} | ${gsdx}

The previous longer template values:
[UiTemplates]
LimiterUnlimited=None
LimiterTurbo=Turbo
LimiterSlowmo=Slomo
LimiterNormal=Normal
OutputFrame=Frame
OutputField=Field
OutputProgressive=Progressive
OutputInterlaced=Interlaced
TitleTemplate=${gsdx} | Limiter: ${limiter} | ${omodei} (${omodef}) | Speed: ${speed} (${vfps}) | ${cpuusage} | State: ${slot}
2015-10-08 06:05:45 +03:00
refractionpcsx2 4e22dc4987 3rd Party: Update Soundtouch (Timestretching) to 1.9.2.
2 notable changes which are welcomed.

-Improved SoundTouch::flush() function so that it returns precisely the desired amount of samples for exact output duration control

-Redesigned quickseek algorithm for improved sound quality when using the quickseek mode. The new quickseek algorithm can find 99% as good results as the default full-scan mode, while the quickseek algorithm is remarkably less CPU intensive.
2015-10-08 01:18:15 +01:00
Jonathan Li d3ddf55df1 gui: Remove unused memory card dialog drag and drop code
The code seems to be leftover from a much older implementation.
2015-10-07 21:54:24 +01:00
Jonathan Li 80727aa4cc gui:linux: Fix memory card dialog drag and drop assertion
The assertion is a wxDateTime invalid assertion. But I have no idea why
it happens, and why it only happens on Linux.
2015-10-07 21:54:24 +01:00
Jonathan Li 919bdf05fe gui: Fix/simplify memory card dialog drag and drop
wxDataObjectSimple derived classes do not use a wxDataFormatId
parameter (only the wxDF_INVALID, wxDF_TEXT, wxDF_BITMAP, wxDF_METAFILE,
wxDF_FILENAME, and wxDF_HTML wxDataFormatIds are allowed because they
are implicitly converted). So drag and drop probably should have been
broken on Windows, but wasn't for whatever reason.

Let's fix and simplify the code by just using the built in
wxCustomDataObject. Also make move the default drag behaviour on both
Windows and Linux (previously default on Windows only).

It now works on Windows and Linux wx2.8/wx3.0 (previously only working
on Windows).
2015-10-07 21:53:32 +01:00
Avi Halachmi (:avih) abdb8266b6 GS window title: change State to Slot, minor limiter simplification 2015-10-07 04:44:05 +03:00
Avi Halachmi (:avih) 31813c29af GS window title info: improve, shorten
The goal here is to reduce clutter and to make it more useful by putting the
important values at the begining, and the less used values at the end. The GSdx
string is unmodified, and maybe we could simplify it too in the future.

Previously, the tile displayed the following items in this order:
<GSdx string>  - (e.g. GSdx OGL HW | 514x224 | None)
<output mode>  - Progressive/Interlaced (Frame/Field)
<limiter mode> - Limiter: None/Turbo/Slomo/Normal
<speed info>   - Speed: <100-based-percentage> (<vfps>)
<CPU usage>    - EE: <%> | GS: <%> | VU <%> | UI: <%>
<save state>   - State: <slot-number>

This patch changes the following to this order and format:
- Move the save state value to the front since it's actually useful.
- The speed value, which now includes the limiter value if not "Normal".
- Then the CPU usage parts, but the UI value only shows on debug/devel builds.
- The output mode, shortened to Frame/Field-i/p
- the GSdx string same as before only at the end

So all the info is still there as before (except UI), but more readable format.

E.g. before (normal limiter and turbo limiter):
GSdx D3D11 HW | 640x512 | None | Interlaced (frame) | Limiter: Normal | Speed: 100% (50.01) | EE:  43% | GS:   4% | UI:   0% | State 0
GSdx D3D11 HW | 640x512 | None | Interlaced (frame) | Limiter: Turbo | Speed: 443% (221.31) | EE:  99% | GS:  16% | UI:   0% | State 0

E.g. after (normal limiter and turbo limiter) for the same values as above:
State 0 | Speed: 100% (50.01) | EE:  43% | GS:   4% | frame-i | GSdx D3D11 HW | 640x512 | None
State 0 | Speed (Turbo): 443% (221.31) | EE:  99% | GS:  16% | frame-i | GSdx D3D11 HW | 640x512 | None
2015-10-07 04:08:09 +03:00
Avi Halachmi (:avih) 75b2406997 macros: fix pxReleaseCode (was inverted), add pxNonReleaseCode
pxReleaseCode was not used at the code so nothing is affected.
pxNonReleaseCode will be used at the next commit.
2015-10-07 04:08:09 +03:00
Jonathan Li addf3d5331 pcsx2: Throw the exception
Coverity CID 146842: Dereference after null check (FORWARD_NULL)
2015-10-07 00:37:40 +01:00
Jonathan Li 76e61d4ef1 Merge pull request #863 from turtleli/gsdx-dx-select-shader
gsdx:windows: refactor dx9/dx11 compile shader code, allow external
shader selection via GUI, widen and rearrange GUI
2015-10-07 00:18:04 +01:00
Avi Halachmi (:avih) 7d6a73ab27 LilyPad: in PS2 mode - disable configs/hacks which PCSX2 doesn't need
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.
2015-10-07 01:22:47 +03:00
Avi Halachmi (:avih) fa04f0970e gui: ESC on fullscreen: better resilience
Make sure we exit fullscreen only if the GS window is visible and in fullscreen.

While we don't currently have such cases, it's possible that the Sys_Suspend
command is called while it's already suspended (and the GS window is hidden)
but the code without this patch would have incorrectly made it visible again.
2015-10-07 01:10:43 +03:00
Avi Halachmi (:avih) 9c1688a39a GS window: try to fix ESC on fullscreen sometimes not exiting correctly
This tries to emulate LilyPad's "Safe fullscreen exit on escape" hack, and
hopefully also makes this LilyPad hack redundant, such that it would fix the
issue also with other input plugins.
2015-10-06 19:09:45 +03:00
Avi Halachmi (:avih) 4522418890 GSFrame: remove unused style argument at ShowFullScreen 2015-10-06 19:01:24 +03:00
Avi Halachmi (:avih) 2cd0829a8d updated a comment that --noguiprompt also works correctly at fullscreen
The issue that fullscreen was not restored if the --noguiprompt confirmation
was aborted was already fixed implicitly via e4d8af0, therefore the comment
ended up incorrect. Also explain why it was broken when emulation was not
suspended before this commit, and how it could have been fixed.
2015-10-06 15:31:36 +03:00
Avi Halachmi (:avih) e4d8af0c97 gui: exit prompt for --noguiprompt: suspend while visible
When using --nogui and --noguiprompt and the user presses ESC, a prompt is
displayed asking the user to confirm exiting/closing PCSX2. This patch suspends
the emulation while this prompt is displayed.

Also updated the comment that if LilyPad has "safe fullscreen exit on ESC", then
full screen is not restored automatically if this prompt is canceled.
2015-10-06 02:08:28 +03:00
Jonathan Li 5f2e60d751 gui:windows: Scale confirmation dialogs at high DPI
This should scale all the other dialogs that don't have specifics widths
set.
2015-10-05 20:11:20 +01:00
Jonathan Li 31b1e34ae8 gui:windows: Fix memory card dialogs at high DPI
Specifying a minimum size for the filename text controls seems to mess
up the size calculations at higher DPIs and causes usability issues.
Use sizers and proportions instead.

Also scale the dialog widths with the DPI.
2015-10-05 20:10:40 +01:00
Jonathan Li f11596fabc gui: Fix missing retry and abort button labels
Retry and abort don't have default labels, so you end up with blank
buttons on both Windows and Linux. Fix it.

Retry is used by the portable mode settings dialog. I'm not sure if
abort is used anywhere.
2015-10-05 20:02:32 +01:00
Jonathan Li 84b17765c2 gui: Fix memory card dialog message truncation
Use sizer flags so the messages aren't truncated. The message truncation
wasn't noticeable in English.
2015-10-05 20:02:32 +01:00
Jonathan Li 5856d77371 pcsx2: Pass IsoFile parameter by reference
Coverity CID 146905, 146906: Big parameter passed by value
(PASS_BY_VALUE)
2015-10-05 20:02:31 +01:00
Avi Halachmi (:avih) 1093c816d0 gui: recording dialog modality: more resilience
A very slight refactor of commit 9eadf3 to also handle a future case where the
audio has a dialog but the GS doesn't (currently both conditions are false).
2015-10-05 21:20:43 +03:00
Avi Halachmi (:avih) 9eadf353d9 gui: recording dialog - make pseudo-modal also for the main window
The dialog was already modal for the GS window, but the main window wasn't
blocked and pcsx2 could crash if, e.g. the user tried to close the main window
while the recording dialog was visible.

Fixes #879
2015-10-05 20:57:19 +03:00
Gregory Hainaut 2eefc135e5 pcsx2: forbid negative index of array in case of register allocation failure
CID 146870 (#1 of 1): Negative array index write (NEGATIVE_RETURNS)
5. negative_returns: Using variable xmmreg as an index to array ...

Open discussion: how to handle correctly bad register allocation?
    Currently negative index is returned and a message printed. It means
    we need to propagate the index check everywhere in order to not use it.

    I suspect that Instruction Generation is more or less corrupted so
    potentially we could just fire an exception.
2015-10-05 19:55:25 +02:00
pcsx2fan 15907fcda0 Update GUI Translation for Chinese Traditional 2015-10-05 13:26:29 +08:00
pcsx2fan 560b57f812 Update pcsx2_Main.po 2015-10-05 13:17:38 +08:00
Jonathan Li d7391badf4 Merge pull request #872 from turtleli/fix-memcard-dialog-properly
Make memory card dialog modal, fix resume on memory card dialog close bug
2015-10-04 23:00:14 +01:00
Jonathan Li 1cbae66bb3 pcsx2: Make memory card dialog modal
There were bugs in the UI handling that allowed you to resume emulation
when the memory card dialog was opened, which could potentially cause
data loss/corruption.

Make the memory card dialog modal to prevent this. Although it's
possible to do with a modeless dialog, the solution will be much more
complicated and less future proof.

This also fixes the emulation resume bug after closing the memory card
dialog.
2015-10-04 20:49:53 +01:00
Jonathan Li c17eacec04 pcsx2: Move AppOpenModalDialog
Also avoid sending a change page event if an empty string is passed and
the dialog is already open.
2015-10-04 20:46:52 +01:00
refractionpcsx2 ad784a56ec superVU: Fix missing breaks.
-This was actually a bug, may improve some games that were buggy in superVU, but these functions aren't often used.
-Coverity CID 146865 & 146864:  In recVUMI_ESIN(VURegs *, int): Missing break statement between cases in switch statement (CWE-484)
-Coverity CID 146863 & 146862: In recVUMI_EEXP(VURegs *, int): Missing break statement between cases in switch statement (CWE-484)
-Coverity CID 146855 & 146854: In recVUMI_EATAN(VURegs *, int): Missing break statement between cases in switch statement (CWE-484)
2015-10-04 15:04:34 +01:00
refractionpcsx2 3618983aaa CDVD: Comment out unreachable code.
-Left in so future checks can see what's going on.
-Coverity CID 146818: In ISOreadSector(unsigned char *, unsigned int, int): Code can never be reached because of a logical contradiction (CWE-561)
2015-10-04 14:39:57 +01:00
refractionpcsx2 4a056fe55a VIF Unpack: Remove logically dead (and pointless) code
-Coverity CID  146829: In nVifUnpack<1>(unsigned char const*): Code can never be reached because of a logical contradiction (CWE-561)
2015-10-04 14:34:46 +01:00
refractionpcsx2 99095c0529 eeRec: Fixed Negative array index write
-Coverity CID 146868: In R5900::​Dynarec::​OpcodeImpl::​recWritebackHILOMMX(int, int, int, int): Negative value used to index an array in a write operation (CWE-129)
2015-10-04 14:12:45 +01:00
refractionpcsx2 5b4eb65e68 eeInt: Fix logically dead code in PMFLH.
-Coverity CID 146817: In R5900::​Interpreter::​OpcodeImpl::​MMI::​PMFHL(): Code can never be reached because of a logical contradiction (CWE-561)
-This code is used by both the Interpreter and Recompiler, however it was probably never checked because nothing much uses it. Out of 248 games, it was called 0 times.
2015-10-04 13:34:37 +01:00
Jonathan Li 39dc23e83b gsdx:windows: Widen and rearrange GUI
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.
2015-10-03 22:33:55 +01:00
Jonathan Li 64cccda076 gsdx:windows: Add external shader selection to GUI
This lets Windows users select the external shader and config file via the
GUI.

Also, comment out an unused variable in the Hacks dialog code.
2015-10-03 22:33:15 +01:00
refractionpcsx2 379adf3a8e GameDB: Update entry for .hack/Fragment to include SkipMPEG. Fixes #867 2015-10-03 13:48:14 +01:00
Jonathan Li a57b2a059a gsdx:windows: Add file selection support
The file open dialog will be usable for all GSdx dialogs if required.
2015-09-28 12:45:14 +01:00
Jonathan Li 133fd3113b Remove include from shader suite
This allows different shader configuration files to be used.
2015-09-28 12:45:14 +01:00
Jonathan Li c0137227e6 gsdx:dx: Allow selection of external shader/shader config
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.
2015-09-28 12:45:13 +01:00
Jonathan Li df98c766e5 gsdx:dx9: Refactor shader compilation code
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.
2015-09-28 12:45:13 +01:00
Jonathan Li fabd6075ef gsdx:dx11: Refactor shader compilation code
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.
2015-09-28 12:45:12 +01:00
Gregory Hainaut c7000355fe gsdx-ogl: flush debug file before exiting the application 2015-09-28 09:41:30 +02:00
Jonathan Li 8e34af5b5e wxWidgets:windows: Fix debug build menu assertion
There was a version check in the menu handling, but Windows 8.1 and
Windows 10 weren't recognised and some pre Windows 98 code was used.

This is a combination of the following wxWidgets upstream commits.
9280f836c2569d0f50301a1117f7ba144e5240d2
1966dfb17d7cb106d1dfb44df6a15b92ba3b8d5f
c87c432033f4277bc9995a4de1390a59b810a005
a8c98a119145a77b1313337314853de75562e4ab

Thanks to micove for finding the commits.
2015-09-27 23:46:12 +01:00
Jonathan Li cbd2417833 gsdx:ogl:windows: Fix calling convention mismatch
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.
2015-09-26 22:38:05 +01:00
refractionpcsx2 953804c429 Merge pull request #849 from pgert/master
GameIndex > Added fix for the "The Incredibles" (SLUS-20905) by Prafull.
2015-09-26 19:52:52 +01:00
Jonathan Li 84bdd0ef45 pcsx2:debugger: Add missing break
Coverity CID 146856: Missing break in switch (MISSING_BREAK)
2015-09-26 19:33:36 +01:00